Skip to content

docs(ui): route the undefined session-id case to the direct seam (RIG-2874) - #1097

Merged
trunk-io[bot] merged 1 commit into
compass-ui/rig-2874-composeboot-seamfrom
compass-ui/rig-2874-record-direct-seam
Sep 11, 2026
Merged

trunk-io[bot] merged 1 commit into
compass-ui/rig-2874-composeboot-seamfrom
compass-ui/rig-2874-record-direct-seam

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 4 PRs:

  1. main
  2. feat(ui): export a composeBoot seam so the analytics/clients boot order is testable (RIG-2874) #1096
  3. "docs(ui): route the undefined session-id case to the direct seam (RIG-2874)" (this PR)
  4. fix(ui): trim the boot comments after the composeBoot extraction (RIG-2874) #1104
  5. docs(ui): anchor the captureRequest citation by its thrown string (RIG-2874) #1105

Fixes a defect in the frozen design record for the outbound session header.
Matt approved the fix directly. Docs-only; no code changes.

The defect

The record's test-case list assigned the getter returns undefined case to
the capture seam:

- getter returns `undefined` ⇒ header **absent** (not empty) — capture seam.

That placement is unsafe. captureRequest's capturing fetch always
throws (packages/compass-client/src/index.test.ts:93), so the helper gates
on await expect(run(fetch)).rejects.toThrow() (:95). That gate is green
whether the interceptor threw early or reached next normally — it cannot
distinguish the two. Since the guard can throw on undefined, routing this
case onto the capture seam makes the test green on exactly the defect the case
exists to catch.

The record already states this rule correctly for the non-Latin-1 case
(including "Do not 'simplify' this case back onto captureRequest") and
already requires the triple assertion, where assertion 3 — the awaited result
is the sentinel next produced — is what proves nothing threw. Line 582
simply contradicted the record's own rule.

The fix

The undefined case now reads direct seam, all three assertions above,
with a short justification in the record's existing voice.

The shipped implementation was already correct#1055 did not follow the
record here, precisely because the prescription was unsafe. Only the record
needed fixing, so there is no behaviour change and no test change.

Verification

The load-bearing claim was checked at source rather than assumed: the
unconditional throw is at index.test.ts:93 and the rejects.toThrow()
gate at :95.

  • bun tools/design-ledger-gate/index.tsOK, 311 ledger rows, 132 record
    headers valid
    (rc=0)
  • moon run root:markdownlintrc=0

Diff touches one file, 7 insertions / 1 deletion.

RIG-2874

…-2874)

The record assigned the `getter returns undefined` case to the capture seam,
but `captureRequest`'s fetch always throws, so its `rejects.toThrow()` gate
cannot tell "threw early" from "reached next" — green on the very defect the
case exists to catch. The guard can throw on undefined, so this case needs the
direct seam and all three assertions.
@linear-code

linear-code Bot commented Sep 11, 2026

Copy link
Copy Markdown

RIG-2874

@rigel-mintaka
rigel-mintaka added this pull request to stack #1098 September 11, 2026 18:25
@github-actions

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-ui-rig-2874-record-d.compass-eng-docs.pages.dev

Deployed from compass-ui/rig-2874-record-direct-seam at 7651fc1.

Changed pages:

@trunk-io
trunk-io Bot merged commit 546ea54 into main Sep 11, 2026
17 checks passed
@trunk-io
trunk-io Bot deleted the compass-ui/rig-2874-record-direct-seam branch September 11, 2026 19:37
@trunk-io

trunk-io Bot commented Sep 11, 2026

Copy link
Copy Markdown

This pull request was merged into main as part of stacked PR 1105.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants