Repository navigation
FIX-1564: BR-17's positive half goes through the transport door - #2175
Conversation
The "read with an org lands" half of BR-17 called a direct runAction, which never reaches the lab's principal resolver, so a door that refused every request still passed. It now sends the same read through the same router carrying the lab's verified bearer, on a fresh session id so its org can only come from that bearer, and is graded on the seat's own facts off the inline stream. The router is now built after the lab's logger is installed, so the request that lands does not print the engine's default logs. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_b05c0781-5916-434d-87a0-d29fd8e5f3c8) |
jhoffner
left a comment
There was a problem hiding this comment.
Second-look + a light architecture pass, since the PR description explicitly invites a review of the approach (bug fix on the direct route, this PR is the only gate).
Approach. Routing both halves of BR-17 through the same transport door, on separate fresh session ids, and grading the positive half on the seat's own facts rather than just "no error" is the right shape — it closes exactly the hole #2073 flagged (a door that refuses everything still passing). The omitOrg?: boolean → door: "org-less" | "bearer" discriminant is a good simplification (was two independently-settable booleans, is now one). Verified the diagnosis against the evidence in the PR body: the defect (resolver refuses everything → still PASS on main) and all three red states line up with the code paths they claim to exercise.
Architecture. No refactor opportunity here beyond the one thing raised inline below — this is a scoped fix to a private test harness (goals/), the manual SSE data: parsing matches the existing convention used elsewhere in this same file and in goals/workforce-conventions/*/run.mts rather than introducing a new one, and the PR is explicit that packages/* is deliberately untouched. Forcing a broader abstraction here (e.g. a shared SSE-stream-to-facts helper) would be premature — this is still a single call site.
Router/logger reorder. The getRouter() after logger-install reorder checks out against how createFlowState resolves/mutates runtime.runtimeConfig — didn't find anything that contradicts the empirical before/after log-count evidence in the PR body.
Two inline notes below (one on the "last inline output" selection the PR description itself asks about, one a small message-clarity nit) — neither blocks, both are cheap to address or to leave as a comment for whoever revisits this file next.
Generated by Claude Code
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7147ea1274
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Review on #2175: - Name the single-handler dependency behind "last inline output". The wire patch carries no provenance, so the root block can't be selected by id (BP-011 note). - Replace the always-2xx status in the no-output error with whether request.completed fired at all, or fired with no inline output. - Force trace capture for the door request only, then restore it. The facts ride on the handler's block_trace item, which the engine does not emit under NODE_ENV=production or FSDEV_TRACE_OBSERVABILITY=false. - The positive-half note reads "did not land" instead of "refused too", because not every failure is a refusal. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
The positive half read the seat's facts off a block_trace item.updated. It only reached the caller because the client filter drops a hidden item's added/done events but not its updates. The engine also captures no trace at all under NODE_ENV=production or FSDEV_TRACE_OBSERVABILITY=false. The inspect entry now also emits its facts as a stream-only component item (transient, so nothing is persisted). The probe selects that item by component name. This drops the env forcing and the BP-011 "last inline output" dependency: the selection is by name, so it no longer depends on which block emitted last. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz
The problem
The DevForce lab goal says it proves two things about the HTTP front door: a read with no verified organization is turned away, and the same read with one gets through. It only checked the first. The "gets through" half bypassed the door and called the seat directly, so a door that refused every request, authenticated or not, still passed. That weakness was flagged on #2073 and merged without an answer, and the W5 epic spec cites this goal as the re-proof of that rule. The proof was weaker than it said.
What this does
Both halves now go through the same door. The refusal half is unchanged: no credential, a session nothing has used, and it must get a 401. The positive half sends the same read through that same door, carrying the lab's own verified bearer token on a separate fresh session. That way its organization can only come from the token, not from something already stored. It must come back successful with the seat's own facts: its id and the document it names. The seat hands those facts to the caller on a stream-only item it emits for that purpose, so the goal no longer depends on debug tracing being switched on. Each half now has a check that turns red when it's wrong. Before, only the refusal did.
What's asked of you
Nothing here is yours to decide. This is a bug fix on the direct route, so this PR is the only gate.
Parts worth reviewing closely
The rest of this is for whoever reviews the code.
goals/devforce-lab/lab/seat-config.mts,readOwnFacts, now also emits its facts as a stream-onlycomponentitem (devforce-seat-facts,transient: true). An HTTP caller has no intended surface for a handler's return value: the POST stream carries it only onblock_trace, the request record stores no output, and?include=traceis gated by trace observability. Is putting the result on a client item the right call for a lab entry, given that it changes what every inspect call streams? If it's wrong, the change is contained to this lab.goals/devforce-lab/lab/host.mts, thedoorbranch ofinspect. The probe selects that component by name, and fails with a message that says whetherrequest.completedfired at all. Earlier heads read the traceitem.updated. That only reached the caller through a client-filter leak, which is being filed against the engine separately, and it was absent entirely underNODE_ENV=production/FSDEV_TRACE_OBSERVABILITY=false.packages/*change, including the client-filter leak.FIX-1564 · epic FIX-1457 (W5) · fixes the P1 on #2073 · bug route, no spec · merges after review
How to review this — altitude, what's in scope, what's deliberately unsettled
Engineering calls — decided along the way, no product sign-off needed
inspect(seatId, { omitOrg: true })becomesinspect(seatId, { door: "org-less" | "bearer" }): one discriminant instead of two booleans that could both be set. The only caller is this goal. If it's wrong, it's a rename.org-less-<seat>,bearer-<seat>). With a shared id, once the bearer probe created that session, any org-less probe that ran after it would inherit the session's stored org and never be refused.transient, soreadOwnFactsstill writes nothing durable. That keeps the never-woken reviewer seat's silence meaningful.Verification — the defect on main, red states, trace settings, green, checks
All runs are model-free, with
FSDEV_DEFAULT_MODELand everyFSDEV_INTENT_*removed from the environment. Command:pnpm tsx goals/devforce-lab/it-wakes-the-seat-a-file-declared/run.mts. Each red state was produced by asedon a copy of the file and restored from that copy.The defect on
main. On main'shost.mts, the resolver was changed to refuse every request. The goal still printedPASSand exited 0.the same read carrying a verified bearer did not land — 401: {"error":"Request requires a verified organization: no verified principal was presented."}an org-less read of eng.em was answered rather than refusedrequest.completedstripped… did not land — request.completed never fired (events: request.created, request.in_progress, item.added, item.done, item.updated)… did not land — request.completed fired with no devforce-seat-facts component (events: …, request.completed)item.updatedis still on the wire)… did not land — request.completed fired with no devforce-seat-facts component (events: request.created, request.in_progress, item.updated, request.completed)Trace settings. The goal passes (exit 0), with nothing forced, under the default env,
FSDEV_TRACE_OBSERVABILITY=false, andNODE_ENV=production. At the earlier trace-reading head with no env forcing, the last two failed withrequest.completed fired with no inline block output.Green. Exit 0, and all five
GOAL_CONTROLcontrols still go red. Recorded in the goal's verdict log.Checks.
pnpm turbo run typecheck --filter=@flow-state-dev/goalspassed.pnpm --filter @flow-state-dev/goals guard:control-shapepassed.pnpm knip:ciexited 0.validate-model-stringsandvalidate-no-nul-bytespassed.No changeset:
goals/is private.🤖 Generated with Claude Code
https://claude.ai/code/session_016qaz1VpRK4wCQzxpjzZ4Hz