Repository navigation
feat: migrate conditions to shared conditions-core evaluator (byte-identical) - #17
Merged
Merged
Conversation
…entical)
Migrate Codex's headless conditions onto the new generic conditions-core
evaluator vendored from agent-code's src/shared/conditions-core. The trust
dialog and approval builders become ConditionModules; CODEX_MODULES preserves
trust-before-approval insertion order (observable via the JSON.stringify dedupe
key). CodexHeadless.publishConditionSnapshot now drives a long-lived
makeEvaluator instance. Verified byte-for-byte against the prior builder path
across the full input matrix (trust hidden/visible; approval
absent/screen-only/metadata-only/screen+metadata/metadata-cleared/null-command).
The vendored core (src/conditions/core/{contract,evaluator}.ts) is GENERATED by
agent-code scripts/sync-conditions-core.mjs and must not be hand-edited.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… review fixes Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Migrate Codex's headless conditions onto the new generic conditions-core evaluator (vendored from agent-code's `src/shared/conditions-core`), proven byte-for-byte against the prior builder implementation.
Changes
Byte-for-byte golden matrix
Throwaway script ran OLD (inline copy of prior builders) vs NEW over the full matrix; assert `JSON.stringify(snapshot.conditions)` identical (ts excluded, keys NOT sorted):
ALL PASS.
Typecheck
`npx tsc --noEmit` and full `npx tsc` build: 1 error — `SemanticChannel.ts:283` — which is pre-existing on main (unrelated). Zero new errors.
🤖 Generated with Claude Code