Skip to content

refactor: tighten daemon output helpers#892

Merged
thymikee merged 13 commits into
mainfrom
codex/helper-type-safety-cleanup
Jun 26, 2026
Merged

refactor: tighten daemon output helpers#892
thymikee merged 13 commits into
mainfrom
codex/helper-type-safety-cleanup

Conversation

@thymikee

@thymikee thymikee commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Tightens daemon-output parsing by replacing helper-style readRecord/readRecordArray with domain types for screenshot, batch, observability network/log output, runtime hints, and target shutdown results.

Restores one shared isRecord guard for real JSON/unknown boundaries, so repeated inline object predicates are gone without reintroducing readRecord. Arrays remain rejected for daemon record data because record contracts should be JSON objects, not arrays.

Keeps observability resilient where the formatter still trusts daemon output: missing network entries renders as no entries, and nullable display fields are skipped instead of printing field=null.

Adds a shared TargetShutdownResult contract so sessions.close and apps.close no longer expose raw shutdown records, and the daemon-side shutdown result aliases the same public shape.

Touched files: 32. Scope stayed in daemon/client output typing, batch projection/output, screenshot parsing, perf/debug-symbol/xctestrun JSON readers, and AGENTS guidance.

Validation

Static checks passed with direct project binaries: TypeScript no-emit, OXLint on touched files, targeted Vitest batch/observability/client coverage (6 files, 63 tests), rslib build, and fallow audit --base origin/main.

Cleanup scans confirmed readRecord/readRecordArray are gone, old batch/network unknown formatter signatures are not present, and the remaining isRecord calls are deliberate JSON/plist/daemon-response boundaries. Three explorer subagents independently audited the remaining isRecord usage by area; no uncertain cases were left open.

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.3 MB 1.3 MB +292 B
JS gzip 437.1 kB 437.6 kB +488 B
npm tarball 575.0 kB 575.8 kB +775 B
npm unpacked 1.9 MB 1.9 MB +1.2 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 23.1 ms 22.3 ms -0.8 ms
CLI --help 40.3 ms 38.9 ms -1.4 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/2948.js -2.0 kB -452 B
dist/src/cli.js +237 B +92 B
dist/src/9722.js -170 B -65 B
dist/src/9919.js -163 B +11 B
dist/src/interaction.js 0 B +3 B

@thymikee thymikee merged commit 2d6fc98 into main Jun 26, 2026
20 checks passed
@thymikee thymikee deleted the codex/helper-type-safety-cleanup branch June 26, 2026 14:32
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-26 14:33 UTC

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