Repository navigation
feat(app-shell): publish readEnvelopeFailureText, and read the agent-key failure through it (objectui#7980) - #8792
Conversation
…key failure through it (objectui#7980) The console's "Connect an AI agent" section read `json?.error?.message` and stopped, so a refused key mint dropped two DECLARED things: the producer's marked `error.userMessage` — the #9934 channel, whose presence IS the marking — and `error.code`. The 5xx band is where that cost most: the producing door substitutes the generic `Internal server error` into `message` while the mark rides through untouched, so a marked 500/503 showed the developer the generic sentence and discarded the specific one written for them. `readEnvelopeFailureText` is the one read of the ADR-0112 failure envelope, extracted and pinned in objectui#7959. That card kept it off the public entry as scope restraint — its file surface was `packages/app-shell/**` — not as a ruling that it should stay private. Exporting it, rather than giving `apps/console` a local copy, is the maintainer ruling of record on objectui#7980 (relayed by the director seat, decision batch #91): a second copy of one rule, on a card whose diagnosis is that copies drift, was refused by name. The function itself is unchanged. It returns `string | null`, so no type accompanies the export, and its module imports nothing, so it adds no module side effect and no transitive surface. The `!data?.key`-on-200 arm is left byte-identical: it is objectui#8782 / PR objectui#8787, in flight on this same file. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
PR objectui#8787 (objectui#8782) landed on AgentConnectSection.tsx while this branch was in flight and split the two failure arms; PR objectui#8789 (objectui#8051) landed on app-shell. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH # Conflicts: # apps/console/src/pages/developer/AgentConnectSection.tsx
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
⏸ Parked for 项目总监 (director-seat) contract review — maintainer's call, verbatim: 「等项目总监评审」
The tier question was put to the maintainer with this diff in hand and answered: wait for the director's review. ⇒ ⛔ The quota-exhaustion downgrade exemption is NOT being spent, and ⛔ this seat is not substituting its own review. ⛔ Not flipped ready. No auto-merge. Not enqueued. ⭐ The review has a short brief, because the surface delta is exactly one lineThe ruling of record is already made — objectui#7980 comment 5583988475, a maintainer ruling relayed by the director seat in decision batch #91: option B, «Export the already-pinned pure function… ⛔ A refused; ⛔ C refused». So the reviewer is not being asked to re-choose the arm. What is owed is a contract review of the surface that arm produces: Measured on the built type surface (
⇒ the 前提 I dispatched with (that exporting this one already-pinned pure function is the whole of the surface change) was measured and holds. What this seat verified independently
One thing deliberately not done, and it is the right callThe keyless-success arm (objectui#8782, landed in #8787) is out of scope and unpinned by this PR — a pin of that wording from here would be a tripwire on another card's work. It is called out in the test file's own header so the next reader does not add one. Generated by Claude Code |
Correction to my comment above — the director's review is not the release gate. The in-seat contract review is, and it belongs to this seat.
And the downgrade I offered the maintainer was never on the table — line 60: 「契约复核 ⛔ 不适用额度耗尽豁免降档:豁免对象是派发,复核正为补偿低档派发而存在。」 The exemption covers construction; the review is what compensates for a downgraded build. My framing of it as an option was invalid; the maintainer's 「等项目总监评审」 matched the written rule and my recommendation did not. ⛔ Nothing changes in substance: still a draft, no auto-merge, not enqueued, ⭐ Worth noting for whoever runs it: this PR's review is unusually short-brief. The arm is already ruled (batch #91, option B), and the surface delta is measured at exactly one export line (83 → 84) with no new type, no transitive re-export and no side-effect entry. What the review owes is the three-item checklist per line 29–32 — ① the derived judgments named one by one, ② semver level against the changeset declaration, ③ each boundary flag and
Generated by Claude Code |
Contract review at
|
|
Landing provenance — director seat takes the release action under the maintainer's 13:4xZ instruction 「把当前的契约复审全部处理完」 (
Generated by Claude Code |
Fixes #7980
Publish
readEnvelopeFailureTextfrom@object-ui/app-shell's public entry, and have theconsole's agent-key generator read the ADR-0112 failure envelope through it.
Ruling of record: option B — objectui#7980 comment 5583988475, a maintainer ruling
relayed by the director seat (decision batch #91, 2026-09-08), verbatim: «Export the
already-pinned pure function; the console reads
userMessage(marked channel), thenmessage, withcodeappended, exactly asapiErrorEnvelope.test.tspins. ⛔ A refused;⛔ C refused.» Option A (a local copy in
apps/console) is refused by name, and thewithdrawn 裁决 on comment 5597562427 is void per 5597586378.
What was wrong
The Integrations page read a refused key mint as
json?.error?.messageand stopped, so twoDECLARED things never reached the developer:
error.userMessage— the producer's finding(ci): every push silently removesneeds:contract-review— the label objectui's own merge-queue guard treats as its exit-6 stop sign #9934 marked channel, whose presence IS themarking. The producing door substitutes the generic
Internal server errorintomessagein the 5xx band while the mark rides through untouched, so a marked 500/503showed the developer the generic sentence and discarded the specific one written for
them. Nothing invalid was displayed, which is what made the loss quiet.
error.code, which never reached the surface at all.The thrown string lands in
setError(...)and IS the whole report the developer gets.The change
packages/app-shell/src/index.ts— one new named export,readEnvelopeFailureText.apps/console/src/pages/developer/AgentConnectSection.tsx— the!res.okarm reads theenvelope through the shared rule;
??, not||, because the helper answersnullfor aprose-less body and that
nullis exactly the signal to state this caller's own fallback.minor/patchchangeset.The function itself is untouched. objectui#7959 kept it off the public entry as scope
restraint — that card's file surface was
packages/app-shell/**— not as a ruling that itshould stay private.
The Clause-② surface, measured rather than asserted
The dispatch's 前提 was that exporting this one already-pinned pure function is the WHOLE of
the surface change. Measured on the built type surface,
packages/app-shell/dist/index.d.ts:unknownin,string | nullout — both primitives.utils/apiErrorEnvelope.tsimportsnothing at all, and the module is not added to the package's
sideEffectsarray(
check:side-effects-arraygreen).exportlines on the public entry: 83 to 84. Exactly one, so the count is a reading.The import direction was checked too, since the dispatch flagged it as an assumption:
apps/consolealready imports@object-ui/app-shell's public entry in 41 source files,so no dependency and no graph direction is new here. Option C is not put back on the table.
Tests
All commands from the repo root, per this repo's vitest invocation rule. Evidence quoted
from the runs themselves; the suite numbers below are on the final commit
71966d740.pnpm exec vitest run apps/console/ packages/app-shell/src/utils/ packages/app-shell/src/views/metadata-admin/Test Files 372 passed (372)·Tests 4199 passed / 1 skippedpnpm exec vitest run packages/app-shell/(pre-merge)Test Files 665 passed (665)·Tests 6419 passed / 1 skippedpnpm --filter @object-ui/app-shell --filter @object-ui/console type-checkDonepnpm --filter @object-ui/app-shell --filter @object-ui/console lint0 errorsin both; 0 findings naming either changed filenode scripts/check-changeset-presence.mjs✅ 3 source file(s) of 2 released package(s) changed … declares 1 changeset(s)Gates run locally, each read from the gate's own verdict line, exit code captured before any
pipe:
check:control-bytescheck:readme-exportscheck:eager-closurecheck:entry-guardcheck:esm-specifierscheck:self-importcheck:side-effects-arraycheck:unreferenced-sourcescheck:published-distcheck:published-tsconfig-excludecheck:phantom-deps— all exit 0.check:eager-closureis the one this diff could plausibly move, so it was measured against areal
vite buildrather than skipped: aggregate closure 3484.2 KB / 3512.7 KB ceiling,and all four per-chunk ceilings green. Both that gate and
check:readme-exportsfirstreturned PREREQUISITE-NOT-MET on an unbuilt worktree and say so in as many words; the numbers
above are from the runs after the missing packages were built, not from the broken gauge.
node scripts/check-governed-queue-guard.mjs --teston this diff: NOT GOVERNED — 4 pathschecked against 5 governed surfaces, none matched.
Ablation — the new pin can fail, and fails for the right reason
The console pin was proven capable of failing by reverting only the read, on the committed
tree, with an
EXIT INT TERMtrap holding the restore. Direction predicted before the run:turns red. Observed: 4 of 5 red, and §4 stayed green — which is correct, because §4 is
the fallback case this change deliberately leaves byte-identical.
Mutation observability, anchored on the text actually being changed rather than on a
non-empty diffstat:
The §3 failure IS the card, reproduced:
Restore leg proven by BYTES, not by an exit code:
git checkout HEAD -- path, thengit diff HEADempty and the on-disk blob back toab99bff70…. No mutation survives, and noablation artefact is left in the tree.
Why no rebuild leg is needed for this pair: the root vitest config aliases
@object-ui/app-shelltopackages/app-shell/src, so the console test resolves the helperthrough source and the mutation is observed directly. The
dist/surface was verifiedseparately, by
apps/console's owntsc— which has nopathsmapping and therefore reads@object-ui/app-shellthroughnode_modulesatdist/index.d.ts. That typecheck is a realcross-package reverse verification of the new export: it was RED before the export existed
and is green now.
验收备注
origin/mainwas merged, and it did conflict. PR objectui#8787 (objectui#8782) landedon
AgentConnectSection.tsxmid-run and split the two failure arms. The conflict isresolved in favour of their structure verbatim — both arms, their comment, their new
keyless-success sentence — with only the prose read inside the
!res.okarm swapped forthe shared rule. Their new pin (
AgentConnectSection.keylessSuccess-8782.test.tsx) isuntouched and green.
pins nothing about it. A pin of that wording from here would be a tripwire on that card's
work. It is called out in the test file's own header so the next reader does not add one.
PackageFormDialog,not the helper and not the public entry, so the export line remains this branch's only
change to
index.ts.noted, not filed:the dispatch brief recorded objectui#8787 as already landed. It wasopen when this branch was cut and merged during the run — a timing artefact of a moving
main, not a defect in anything. Carrier: none needed; the merge above absorbs it.Landing
Clause-②: yes— a new export on a published index. Carrierneeds:contract-reviewis onboth the card and this PR, and the review is owed on this diff before it enqueues.
CONTRACT_REVIEW_TIERwas measured unavailable (429) at dispatch, which per objectui#8069comment 5594065532 gates the review, not the construction.
⛔ This stays a draft. Not flipped ready, no auto-merge armed, not enqueued — that is the
PM seat's call once a contract review is on record.
🤖 Generated with Claude Code
https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
Generated by Claude Code