Skip to content

Spec: TypeScript (bun build --compile) vertical-slice prototype and comparison against the Rust binary - #1843

Merged
JacobStephens2 merged 26 commits into
mainfrom
issue-1831
Nov 7, 2026
Merged

JacobStephens2 merged 26 commits into
mainfrom
issue-1831

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

prototypes/typescript/
├── Ticket → Claim → Worktree + embedded Factory skills → streaming Harness
│             └── Delivery → CI/conflict Repair → ready PR or draft salvage
├── Pickup → origin-ref reservation + Ready recheck → Ticket → owner release
│             └── bounded BFS: both safety properties + mutation counterexamples
├── shared schema → CLI JSON + HTTP API + OpenAPI + typed Console + Playwright
└── benchmark → fresh-worktree timings + binary/source sizes + runtime peak RSS
docs/research/typescript-vs-rust.{md,json} → measured comparison and limitations

Implements the whole Spec across #1836–#1840 as an isolated Bun-compiled Linux
executable. Prototype-only edits select TypeScript checks; ordinary Rust edits
do not select the prototype. The production Rust executable and ADR-0001 stay
unchanged. The comparison records narrower prototype coverage and distinct
model graphs; it supports a Day shift decision rather than asserting rewrite
equivalence. Console state is separate from Ticket records, with one local
token and a single writer. Continuation, Spec runs and Self-merge remain outside
the implemented prototype slice.

Run, Claim, Delivery, CI and Pickup transitions use tagged states with explicit
exhaustiveness checks. Pickup applies the Claim before dispatch; its model
boundary explains the resulting difference from Rust's known pre-Claim
dispatch counterexample. The compiled executable embeds Factory skills and
Console assets while using Git, gh and the representative Harness from PATH.

The comparison report
retains cold/repeat timings, source inventories, binary sizes, model timings and
architectural tradeoffs. This review adds startup/status peak RSS samples:
25.16 MiB for TypeScript and 6.75 MiB for Rust, with explicit workload limits.

Closes #1831

Evidence

Execution evidence

  • Before: PATH="$HOME/.bun/bin:$PATH" bun test --cwd prototypes/typescript tests/benchmark.test.ts -t 'benchmark CLI'
    failed the added RSS regression: TypeError: undefined is not an object (evaluating 'report.runtimeMemory[language]'); 0 pass, 1 fail.
    After: the same command passed: 1 pass, 0 fail, 21 expect() calls.
  • The Spec review's exact read-only JSON check failed with
    AssertionError: Spec #1831 requires memory footprint, but report contains no executable RSS/runtime-memory measurement.
    The same check passed after adding actual measurements for both standalone executables.
  • The benchmark now runs python3 prototypes/typescript/memory.py <binary> status --json
    after each build. Linux child peak RSS is recorded in bytes with stdout,
    stderr, command and exit status, using isolated HOME/XDG state. The report
    preserves the original timing observations and separately identifies the
    supplemental memory measurement's source commit and toolchain.
  • PATH="$PWD/.affected-tests/python-bin:$HOME/.bun/bin:$PATH" python3 -m unittest discover -s scripts -p 'test_*.py':
    Ran 37 tests in 16.255s, OK. The PATH selects Python 3.12; an initial
    attempt let a subprocess select Python 3.9 and failed on missing tomllib.
  • PATH="$HOME/.bun/bin:$PATH" bun test --cwd prototypes/typescript tests/console.test.ts:
    4 pass, 0 fail, 61 expect() calls, including compiled CLI/API/OpenAPI parity,
    authorization and desktop/mobile Playwright Dismissal, reload and Undo.
  • CARGO_BUILD_JOBS=4 cargo build --release --locked --bin thirdshift:
    passed in 5m 26s; this executable supplied the Rust RSS sample.
  • Final PATH="$PWD/.affected-tests/python-bin:$HOME/.bun/bin:$PATH" CARGO_BUILD_JOBS=4 CARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0 RUST_TEST_THREADS=3 scripts/affected-tests main:
    typecheck passed in 3.73s; all 56 prototype tests passed (457 assertions,
    99.24s). Local Cargo compilation used
    four jobs, three test threads and disabled debug symbols to limit disk use.
  • The selector's Rust fallback, cargo test, failed after 1102.28s
    (compilation included). All 1,657 unit tests passed (3 ignored); integration
    checks passed through the earlier suites, then Console reported 235 passed, 1 failed, 1 ignored. The failure was the existing
    idle::unchanged_requests_reuse_retained_records_but_replacements_are_visible:
    unchanged request reread 156073 bytes (limit 48 KiB). Later integration
    binaries were not run after Cargo stopped.
  • Isolated confirmation:
    PATH="$PWD/.affected-tests/python-bin:$HOME/.bun/bin:$PATH" CARGO_BUILD_JOBS=4 CARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0 RUST_TEST_THREADS=3 cargo test --locked --test console idle::unchanged_requests_reuse_retained_records_but_replacements_are_visible -- --exact --nocapture
    failed with unchanged request reread 156041 bytes, matching the pre-review
    failure already documented in docs/research/typescript-vs-rust.md.
    git diff --exit-code main...HEAD -- src tests Cargo.toml Cargo.lock skills
    passed with an empty diff. This is a pre-existing production validation limit;
    no production change is included in this experiment.

Test seams: the benchmark CLI's structured results, execution and Worktree
cleanup with external compiler fixtures; the persisted empirical comparison;
the standalone executables' status --json workload. The existing Spec tests
also exercise temporary Git origins, fake GitHub/Harness processes, process-group
escalation, Delivery/Repair/salvage, reservation races and rendered Console flows.

Visual evidence

Implementation captures from #1844,
whose Console source/assets are unchanged by the Spec review. Before shows no
prototype Console listener; After shows seeded Inbox rows after Dismissal,
reload and Undo. This review reran the matching Playwright flow successfully.

Desktop · 1440×900

Before
After

Mobile · 390×844

Before
After

Review coverage

Independent Standards and Spec reviewers compared the whole Spec against
main (305923a8), including Ticket integration. Standards raised 0 findings;
Spec raised 1 finding, the missing runtime-memory comparison, reproduced and
fixed in 1600a772 with retained regression tests. Reports and each axis's final files-read
list are in .thirdshift-review-YojVXH/standards.md and spec.md; summary.json
records {"standards":0,"spec":1} before disposition.

Both axes' final passes read all 38 changed files, including the added memory
probe and amended results. No changed file was left unread. No generated
output was excluded: the Bun lock and structured benchmark results were inspected.

Unaddressed findings

Standards

None.

Spec

None. The sole finding was reproduced and fixed.

Security

None. The introduced Console development-page disclosure was reproduced and fixed.

Security review outcome

No unaddressed introduced findings.

Merge Danger

Door: two-way

Revert the isolated prototype, comparison and selector changes to remove the
experiment. No production migration or ADR change is included.

Blast Radius: prototype

Prototype validation requires Bun, Chromium and Python 3. The executable uses
real Git/GitHub/Harness commands when invoked on a repository; its narrower
contracts and recovery limits are documented in its README. Ordinary Rust
behavior is unchanged.

Built with codex codex-cli 0.160.0 · gpt-6.1-sol · high

Tickets

JacobStephens2 and others added 25 commits November 6, 2026 14:18
Add isolated TypeScript Ticket run prototype
Prototype: TypeScript Pickup and bounded BFS verification
A pull request from another repository can reuse the Issue branch name.
Delivery treated that pull request as its own and could mark it ready.
Ignore cross-repository pull requests, and bind the pull request just opened.
Preserve Pickup reservation and Claim handling while running dispatched Tickets through Delivery, Repair and failed-run salvage. Reconcile the prototype documentation and assertions for published work, and cover Pickup salvage and reservation lifetime.
Add shared-schema TypeScript Console, API and CLI slice
Preserve Delivery and bounded Repair documentation alongside the incoming shared-schema Console slice. Validated with scripts/affected-tests origin/issue-1831: typecheck and 54 Bun tests passed.
TypeScript prototype: Ticket Delivery and bounded CI Repair
Benchmark TypeScript prototype against Rust
@JacobStephens2
JacobStephens2 marked this pull request as ready for review November 7, 2026 01:27
@JacobStephens2
JacobStephens2 merged commit b2505c3 into main Nov 7, 2026
16 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1831 branch November 7, 2026 01:53
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.

Spec: TypeScript (bun build --compile) vertical-slice prototype and comparison against the Rust binary

1 participant