Skip to content

feat(architecture): TypeScript-native architecture (ADR 0010) + house Rules 13/14#8

Merged
ivanmaierg merged 8 commits into
mainfrom
feat/ts-native-architecture
May 12, 2026
Merged

feat(architecture): TypeScript-native architecture (ADR 0010) + house Rules 13/14#8
ivanmaierg merged 8 commits into
mainfrom
feat/ts-native-architecture

Conversation

@ivanmaierg

Copy link
Copy Markdown
Owner

Summary

  • Supersedes ADR 0009 (Go-port commitment) with new ADR 0010 documenting the TypeScript-native direction.
  • Realigns docs/house-rules.md: retires Rules 9/10, loosens 7/8, keeps 1-6/11/12 on TypeScript merit.
  • Simplifies the welcome reducer from [State, Effect | null] tuple to plain (state, action) => State. Quit handling moves inline to useKeyboard in tui-driver.tsx.
  • Adds house Rule 13 (prefer object-with-keys dispatch over switch for handler tables) and Rule 14 (no useless comments — ship only the WHY of non-obvious decisions). Welcome reducer refactored to demonstrate Rule 13.
  • Archives the paused tui-async-effects change (its makeEffectRunner approach is superseded by the new dialect's useEffect + AbortController path).
  • Full SDD trail committed under openspec/changes/archive/ts-native-architecture/.

What does NOT change

  • src/domain/, src/application/, src/api/, src/cli/ — untouched.
  • Hexagonal architecture (ADR 0002) — retained.
  • Result<T, E> and Promise<Result<T, E>> — retained.
  • Test count: 99/99 still passing.

Verify

PASS WITH WARNINGS (0 critical / 1 warning / 1 suggestion). All 17 spec REQs satisfied. ADR 0009 body unchanged (only the 3 surgical edits to status + new superseded-by section). Rule 9 retirement text verbatim-matched. Full report: openspec/changes/archive/ts-native-architecture/verify-report.md.

Test plan

  • bun test — 99/99 pass
  • REQ-17 manual smoke (PTY-only, cannot be automated): run bun start in a terminal ≥ 60×20, press q, confirm clean exit. Repeat for Q and Ctrl+C.
  • docs/decisions/0010-typescript-native-architecture.md exists and supersedes 0009
  • docs/decisions/0009-language-portable-architecture.md shows Status: superseded by 0010
  • docs/house-rules.md reflects rule disposition (retire 9/10, loosen 7/8, keep the rest, add 13/14)

Out of scope (handled separately)

  • Pre-existing tsc --noEmit baseline gap (missing @types/node/@types/bun) → branch chore/typescript-types, separate PR.
  • Reader feature (palette + passage view + chapter nav) → future SDD change tui-reader-screen, builds on this dialect.

Captures exploration, proposal, spec, design, and tasks artifacts produced
by the SDD cycle that shipped ADR 0010 and the house-rules realignment in
the preceding four commits.
…seless comments)

Rule 13 — Prefer object-with-keys dispatch over switch for handler tables
(reducers, event handlers, effect runners). Switch remains the right tool for
narrowing-as-control-flow on discriminated unions with a never check (Rule 5).
Updates the Rule 8 reducer example to demonstrate the new form.

Rule 14 — Default to no comments; ship only the WHY of non-obvious decisions.
File-banner comments, section dividers, rule-citation footnotes, and
restatements of the line below are now review-blockers.

Refactors welcome-reducer to the object-dispatch form and sweeps useless
header banners and code-paraphrase comments from welcome-reducer.ts,
welcome-reducer.test.ts, and tui-driver.tsx. 99/99 tests stay green.
PASS WITH WARNINGS: 0 critical, 1 warning, 1 suggestion.
- All 17 spec REQs satisfied
- 99/99 tests green
- ADR 0009 body unchanged (only 3 surgical edits)
- Rule 9 retirement text verbatim-matched
- Rules 13/14 noted as post-spec user additions, accepted
- Pre-existing tsc gap and Rule 6 'portability risk' wording flagged
  as out-of-scope housekeeping
SDD cycle closed. PASS WITH WARNINGS verify report, all 17 REQs satisfied,
99/99 tests green. Residual manual step: REQ-17 PTY smoke (bun start, press
q, confirm clean exit) — reviewer to run before merge.

Sanctioned mid-apply additions:
- Rule 13 (object-with-keys dispatch)
- Rule 14 (no useless comments)

Out-of-scope follow-ups handled separately:
- Pre-existing tsc baseline gap → chore/typescript-types branch
- Rule 6 'portability risk' wording → future housekeeping
@ivanmaierg ivanmaierg merged commit 81b37cc into main May 12, 2026
1 check passed
@ivanmaierg ivanmaierg deleted the feat/ts-native-architecture branch May 12, 2026 00:48
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.

1 participant