refactor(agent-bundle): move test-only host-contract smoke harnesses to tests/support - #655
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 12ef50d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ScriptedAlchemy
force-pushed
the
refactor/ponytail-host-contract-tests
branch
2 times, most recently
from
September 6, 2026 00:26
acc365c to
d99cae2
Compare
ScriptedAlchemy
force-pushed
the
refactor/ponytail-host-contract-tests
branch
from
September 6, 2026 00:26
d99cae2 to
46e8345
Compare
commit: |
ScriptedAlchemy
marked this pull request as ready for review
September 6, 2026 00:37
ScriptedAlchemy
enabled auto-merge (squash)
September 6, 2026 00:37
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
packages/agent-bundle/src/host-contracts/shipped ~1,600 lines that only the test suite called. Per AGENTS.md ("a module with no production importer is not delivered"), the test-only code moves underpackages/agent-bundle/tests/support/and the production surface shrinks to what production imports.host-contract.ts(586 lines) →tests/support/host-contract.ts. Its only non-test consumers were theapi.tsre-export block (no docs, examples, or other source referenced any of those names) andnormalizeCodexNativeSmokeEvents, which is itself test-only. Theapi.tsre-export block is removed:evaluateHostContract,compareInstalledHostContract,compareLocalHostContract,parseHostContractManifest,parseRedactedEventEnvelopes,nativeHostContractComparisonEnabledand theHostContract*/NativeHost/RedactedEventEnvelopetypes are no longer exported fromagent-bundle/api.native-codex-contract.ts(539 → 31 lines): keepswithoutProviderApiKeys,copyOpaqueCodexAuthState,copyOpaqueCodexAuthStateProgram(used byeval/codex-home.tsandtests/effect-filesystem-phase2.test.ts). The smoke plan, executor, staging, classifier,SmokeStepError, andrunCodexNativeSmokemove totests/support/native-codex-smoke.ts.native-claude-contract.ts(843 → 175 lines): keepscreateNativeClaudeCommand,createNativeClaudeChildEnvironment,runNativeClaudeProcessand its types, andparseClaudeVersion/formatClaudeVersion/isCompatibleClaudeVersion(used byeval/*). Stream normalization, normal-home digesting, andrunNativeClaudeSmokemove totests/support/native-claude-smoke.ts.parseClaudeVersion/isCompatibleClaudeVersionnow delegate tocore/semver.ts(parseSemanticVersion/meetsMinimumVersion) instead of carrying a private copy; the unusedClaudeVersionalias goes away in favour ofSemanticVersion.core/semver.tsnow keeps the old Claude parser's strict trailing boundary ((?=$|[^0-9A-Za-z.-])) on top of its+buildsupport, and forbids a.before the token, so2.1.232abc,2.1.232.4, and0.146.9.1are all rejected instead of being reinterpreted;tests/core.test.tspins these vectors.native-host-spine.ts'sdigestFileTree({ includeIdentity: true }), which has the same preimage as the privatedigestClaudeFileTreeit replaces; the privateisMissingExecutableErrorcopy is replaced by the spine's export.core/runtime.tsparseRuntimeVersion/compareVersionsare not delegated tocore/semver.ts— they are anchoredmajor.minor[.patch]parsers with an optional patch, no leading zeros, and a tuple return, so the semantics differ..github/workflows/native-host-smoke.ymlstill targetstests/native-claude-contract.test.tsandtests/native-codex-contract.test.ts; those files stay where they are and only their import path changed.Validation
pnpm build && pnpm typecheck && pnpm lint && pnpm test:unit— green (283 files, 4237 passed, 6 skipped).pnpm test:unit packages/agent-bundle/tests/native-claude-contract.test.ts packages/agent-bundle/tests/native-codex-contract.test.ts packages/agent-bundle/tests/host-contract.test.ts packages/agent-bundle/tests/effect-filesystem-phase2.test.ts packages/agent-bundle/tests/eval-codex-home.test.ts— 53 passed, 4 skipped (the opt-innativeItcases self-skip without the host CLI flag, as before).pnpm docs:site:build— green (public exports changed, so TypeDoc and language parity re-ran).git grep -lforhost-contract,native-claude-smoke,native-codex-smokeeach resolve to a test importer;native-claude-contract/native-codex-contractkeep theireval/*production importers.Deslop
Deslop: Claude Fable 5.1, 3 edits (dropped the
ClaudeVersionalias forSemanticVersion, aliasedparseClaudeVersion = parseSemanticVersioninstead of a wrapper lambda, removed the deadexport type { NativeHost }re-export from the movedhost-contract.ts).Self-review
Reviewer:
gpt-5.6-sol-medium(generalPurpose; TraceDecay daemon was down sochange-risk-reviewercould not run). Three findings, all fixed:parseClaudeVersion = parseSemanticVersionbroadened parsing:2.1.232abcnewly passed and2.1.232.4changed from1.232.4to2.1.232. Fixed —core/semver.tsnow uses the stricter lookahead boundary the Claude parser had, while keeping+buildmetadata; added a vector test intests/core.test.ts.CompareInstalledHostContractOptionstype. Fixed — named in the summary.docs/audits/2026-09-03-claude-live-session-proofs.md:86still calledrunNativeClaudeSmokeproduct code at its deleted src path. Fixed — notes the move totests/support/native-claude-smoke.ts.Second pass (same reviewer): the tightened trailing boundary let
0.146.9.1backtrack to146.9.1, which the Codex check would accept. Fixed — the leading boundary now also excludes., so a four-component token is rejected outright; vectors added totests/core.test.ts. Realclaude --version/codex --versionbanners andv22.19.0-style prefixes still parse.Third pass (same reviewer): no merge risks found.