diff --git a/.claude/learnings.md b/.claude/learnings.md index 5b85315..f11adb3 100644 --- a/.claude/learnings.md +++ b/.claude/learnings.md @@ -162,3 +162,9 @@ The /cost + /evals collectors were first built against assumed endpoints that DO ## 2026-06-18 — `agent.ts` workflow has NO top-level adapter/logger imports — all deferred - `apps/worker/src/workflows/agent.ts` is a Vercel Workflow DevKit `"use workflow"` module. The WDK bundler cannot tolerate top-level adapter/logger imports, so EVERY use of `logger`/adapters inside a `"use step"` is a deferred `await import("../lib/logger.js")` / `await import("../lib/step-adapters.js")` in the step body (logger refs at lines 73,137,201,338,445,486,508 — none top-level). Do NOT assume "a warm module is already imported at the top" — there isn't one; the module is only cache-warm because earlier steps in the same run imported it. (Correction to a wrong assumption I made during the PR-link-comment work: I claimed logger was imported top-level; it is not — an opus reviewer caught it.) Consequence for best-effort steps that log inside a `catch`: that import is itself a deferred `await import` that could in theory fail cold, so a "never throws" step is only truly safe in concert with `maxRetries=0` + a failure mode that doesn't affect the run outcome. + +## 2026-06-18 — us11 capacity e2e flakiness = Jira JQL index is non-monotonic, not a product bug +- `e2e/tier2/us11-capacity-limit-respected.test.ts` intermittently failed with `expected 0 to be greater than or equal to 1` on `pollRes.body.discovered`. Root cause: the cron's discovery (`/rest/api/3/search/jql`, `project AND status=COLUMN_AI`) hit Jira's eventually-consistent search index during a window where it reported the AI column **empty** — even though the `isTicketVisibleInJql` barrier had just gotten one positive read. A single positive index read does NOT guarantee the cron's immediately-following search (a separate request) also sees the ticket. The cron is idempotent (next tick discovers it), so this is purely a test-reliability defect. Fix: poll the cron in a bounded `waitFor` (30s) until `discovered >= 1`, **re-saturating the dummy registry entries before each poll** (reconcile's `ORPHAN_GRACE_MS = 30s` would otherwise free a slot mid-loop and let a late poll actually start the ticket), asserting `started === 0` every tick. us08 already tolerates this race by asserting only on the *effect* (no registry entry over a 15s window), not on the `discovered` count — us11 was the only test making a single-shot `discovered` assertion. + +## 2026-06-18 — Dashboard ticket grid blowout = bare `1fr` honors content min-content +- `apps/dashboard/app/(cockpit)/ticket/[ticketKey]/page.tsx` desktop split-view used `gridTemplateColumns: "280px 1fr"`. A bare `1fr` is `minmax(auto, 1fr)`, so the detail (trace) column honored its content's min-content (~1082px, driven by the 5-up `grid-cols-5` KPI row + the `lg:grid-cols-[1.4fr_1fr]` panel), pushing the grid to 1410px inside a ~1060px area → horizontal scrollbar inside `cockpit-shell`'s `flex-1 overflow-auto` scroller (`html` itself didn't overflow because the root is `overflow-hidden`). Fix: `280px minmax(0, 1fr)` on the column + `min-w-0` on the `DetailArea` grid item (`ticket-selection.tsx`) so the track + item can shrink below content. Verified live with agent-browser (grid 1410→1060, scroller H-overflow gone). The FlameGraph's own `overflow-x-auto` (fixed 1040px timeline) is intended internal scroll, not a blowout. General rule here: any `1fr` grid track holding wide/min-content-heavy content should be `minmax(0, 1fr)` and its grid item `min-w-0`. diff --git a/apps/dashboard/app/(cockpit)/ticket/[ticketKey]/page.tsx b/apps/dashboard/app/(cockpit)/ticket/[ticketKey]/page.tsx index 07fc956..804192e 100644 --- a/apps/dashboard/app/(cockpit)/ticket/[ticketKey]/page.tsx +++ b/apps/dashboard/app/(cockpit)/ticket/[ticketKey]/page.tsx @@ -48,7 +48,7 @@ export default async function TicketPage({