Skip to content

fix(tsc): exactOptionalPropertyTypes — bus.ts/claim.ts/bus.test.ts#2956

Merged
AceHack merged 1 commit into
mainfrom
fix-tsc-exactoptional-bus-tools-2026-05-13
May 13, 2026
Merged

fix(tsc): exactOptionalPropertyTypes — bus.ts/claim.ts/bus.test.ts#2956
AceHack merged 1 commit into
mainfrom
fix-tsc-exactoptional-bus-tools-2026-05-13

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 13, 2026

Summary

  • bus.ts: Replace two identical list({ topic: topicFilter, to: toFilter }) calls (where both args are T | undefined) with a shared listOpts object built via conditional spread — omits the property entirely when undefined, satisfying exactOptionalPropertyTypes: true
  • claim.ts: Conditional spread for optional branch field in ClaimRecord push — property is omitted when p.branch is undefined
  • bus.test.ts: Non-null assertion on msgs[0] guarded by the preceding expect(msgs.length).toBeGreaterThan(0)

These were pre-existing non-required lint (tsc tools) failures firing on every PR since the exactOptionalPropertyTypes: true tsconfig flag rejects T | undefined being passed to an optional T? 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

`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>
Copilot AI review requested due to automatic review settings May 13, 2026 06:38
@AceHack AceHack enabled auto-merge (squash) May 13, 2026 06:38
@AceHack AceHack merged commit 7af01ec into main May 13, 2026
26 of 27 checks passed
@AceHack AceHack deleted the fix-tsc-exactoptional-bus-tools-2026-05-13 branch May 13, 2026 06:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 shared listOpts object that conditionally includes topic/to, and reuse it for both list(...) calls in watch.
  • tools/bus/claim.ts: Omit branch from ClaimRecord when the payload has no branch.
  • tools/bus/bus.test.ts: Add a non-null assertion for msgs[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>
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