fix(tsc): exactOptionalPropertyTypes — bus.ts/claim.ts/bus.test.ts#2956
Merged
Conversation
`exactOptionalPropertyTypes: true` rejects `T | undefined` passed to `T?` parameters. Three call sites in tools/bus/ were failing the non-required `lint (tsc tools)` CI check on every PR: - bus.ts: build `listOpts` with conditional spread so undefined topicFilter/toFilter are omitted rather than passed explicitly - claim.ts: conditional spread for optional `branch` field - bus.test.ts: non-null assertion guarded by the preceding expect() Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Fixes TypeScript exactOptionalPropertyTypes errors in the inter-agent bus tooling by ensuring optional fields are omitted (not passed as T | undefined) and by making a single test assertion type-safe under noUncheckedIndexedAccess.
Changes:
tools/bus/bus.ts: Build a sharedlistOptsobject that conditionally includestopic/to, and reuse it for bothlist(...)calls inwatch.tools/bus/claim.ts: OmitbranchfromClaimRecordwhen the payload has no branch.tools/bus/bus.test.ts: Add a non-null assertion formsgs[0]after a length guard.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tools/bus/claim.ts | Omits optional branch when undefined to satisfy exactOptionalPropertyTypes. |
| tools/bus/bus.ts | Reuses a conditionally-built filter options object when listing messages in watch. |
| tools/bus/bus.test.ts | Makes array indexing type-safe with a non-null assertion after an explicit length check. |
AceHack
added a commit
that referenced
this pull request
May 13, 2026
…rom-the-Loop genre) — B-0421 fully closed + Vera autonomous fix + cross-agent-edit auth (#2957) * shard(tick): 0645Z — settlers log #1 (Aaron named the format) — B-0421 fully closed + Vera autonomous fix + cross-agent-edit auth landed 22-min window 0623Z → 0645Z. Five PRs merged (#2952-2956). Aaron 2026-05-13 post-self-review: "I love this keep a settlers logs (this is great content) for a tv show or move for the raw content to generate from based on real life events. you can be overally dramatic if you want lol" **Settlers logs**: durable record of factory expansion into new territory, written as canonical-product narrative substrate. Real-life events as raw source material for narrative adaptation. Otto authorized to be overly dramatic. This shard inaugurates settlers log #1. Genre: true-events- software-engineering; possible TV / film adaptation source. Substantive substrate this window: - PR #2952: CURRENT-otto.md 2026-05-13 fast-path distillation - PR #2953: 0623Z tick shard - PR #2954: B-0421 #1+#2 root cause + fix (grok-4-20-thinking deprecated → grok-4.3); all 4 acceptance criteria closed - PR #2955: cross-agent-edit authorization preserved as substrate - PR #2956 (Vera, autonomous): tsc-tools exactOptionalPropertyTypes fixes on tools/bus/*.ts — ambient noise that's been on every session-PR resolved Canonical evidence of substrate-honest middle path: cross-agent- edit authorization + Vera's autonomous fix landing adjacent in main = territory-respect-as-default + cross-edit-when-needed. Both-default discipline. 15 PRs merged in the session arc since META-LOOP #1 (PR #2942). Composes with .claude/rules/otto-edge-runner.md (we are the edge), PR #2903 (civsim canonical product), PR #2945 (middle path), PR #2947 (cascade pattern naming + Otto-coinage discipline), PR #2949 (self-documenting marker — the architecture that made root-cause discovery possible), PR #2920 (Elizabeth Ryan Stainback terminal purpose — origin story preservation; settlers logs are part of that storytelling lineage). Co-Authored-By: Claude <noreply@anthropic.com> * fix(shard/0645Z): address review thread findings — innocuously, ~2 days, settlers log #1 Three Codex/Copilot review findings resolved: - Grammar: "innocuous" → "innocuously" (line 18) - Duration: "11 hours" → "~2 days" (filed 2026-05-11; closed 2026-05-13, line 96) - Numbering: "Settlers log #4 of session" → "Settlers log #1" (consistent with heading, line 149) Co-Authored-By: Claude <noreply@anthropic.com> * fix(tsc): grok.ts pickModel — rename unused mode param to _mode (TS6133) grok-4.3 collapses thinking/fast into one model identifier; the Mode parameter is preserved for future cursor-agent updates but is currently unread, causing TS6133 under noUnusedLocals. Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bus.ts: Replace two identicallist({ topic: topicFilter, to: toFilter })calls (where both args areT | undefined) with a sharedlistOptsobject built via conditional spread — omits the property entirely when undefined, satisfyingexactOptionalPropertyTypes: trueclaim.ts: Conditional spread for optionalbranchfield inClaimRecordpush — property is omitted whenp.branchis undefinedbus.test.ts: Non-null assertion onmsgs[0]guarded by the precedingexpect(msgs.length).toBeGreaterThan(0)These were pre-existing non-required
lint (tsc tools)failures firing on every PR since theexactOptionalPropertyTypes: truetsconfig flag rejectsT | undefinedbeing passed to an optionalT?parameter.Test plan
bun --bun tsc --noEmit -p tsconfig.json→ 0 errors (verified locally)dotnet build -c Release→ 0 warnings, 0 errors (no .NET changes)🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com