fix: add behavioral depth criteria to task acceptance and parity checks#225
Merged
fix: add behavioral depth criteria to task acceptance and parity checks#225
Conversation
The task graph builder was generating only structural acceptance criteria (symbols exist, signatures match, compiles) while the parity verifier enforced full behavioral equivalence. This gap caused the code-migrator to produce hollow implementations that compiled but didn't actually perform the intended computation — leading to expensive retry loops. Both buildAcceptanceCriteria() and buildParityChecks() now generate behavioral criteria for every task containing functions: Acceptance criteria: - Full implementation required (no stubs/TODOs/placeholders) - Behavioral equivalence using idiomatic target-language patterns - Implementation depth must match source complexity Parity checks: - All source code paths reachable in target - No hollow implementations (input-dependent output required) - Internal call chains wired end-to-end These criteria apply uniformly regardless of task size — a 30-line hash function gets the same behavioral bar as a 900-line compressor. Criteria use behavioral language (same observable outputs) rather than structural language, so idiomatic rewrites are not penalized.
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.
Problem
The task graph builder generated only structural acceptance criteria for migration tasks:
Meanwhile, the parity verifier enforced behavioral equivalence — checking for hollow implementations, dead dispatch, pass-through codecs, and semantic effectiveness. This disconnect caused the code-migrator to produce implementations that satisfied the stated acceptance criteria (compiled, had the right symbols) but were algorithmically hollow — leading to expensive parity retry loops (7+ attempts per task in the zstd migration).
Root Cause
buildAcceptanceCriteria()andbuildParityChecks()intask-graph-builder.tsonly generated structural checks. The code-migrator had no upfront signal that it would be held to a behavioral standard, so it optimized for the criteria it was given.Fix
Both functions now generate behavioral criteria for every task containing functions:
Acceptance Criteria (new)
Parity Checks (new)
These criteria:
Test Coverage
Added 4 new tests:
should include behavioral acceptance criteria for tasks with functionsshould include behavioral parity checks for tasks with functionsshould not include behavioral criteria for type-only tasksshould apply behavioral criteria uniformly regardless of task sizeAll 48 task-graph-builder tests pass. Full suite: 1498 passed.