Fix TestFormal_TestIDFormatWellFormed for shared CTR test ID allocation - #53108
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job
Fix TestFormal_TestIDFormatWellFormed for shared CTR test ID allocation
Aug 16, 2026
pelikhan
approved these changes
Aug 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes formal compliance validation for test IDs shared across core-rule and optimizer catalogs.
Changes:
- Replaces numeric ID alignment with format and uniqueness checks.
- Documents shared test-ID allocation and the CTR-025 exception.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/compiler_threat_detection_compliance_formal_test.go |
Updates compliance-map validation. |
specs/compiler-threat-detection-spec.md |
Documents shared ID sequencing. |
specs/compiler-threat-detection-compliance/README.md |
Clarifies compliance-map ID allocation. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
Comment on lines
+105
to
+108
| // Test IDs are allocated from a single sequence shared with the Section 8.2 | ||
| // optimizer protocol catalog, so a test ID number need not match its rule ID | ||
| // number; only uniqueness is required. | ||
| require.True(t, formalHasUniqueTestIDs(mapping)) |
Contributor
|
🎉 This pull request is included in a new release. Release: |
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.
The
pkg/workflowunit shard fails onTestFormal_TestIDFormatWellFormed:The test asserted
testID == "T-" + ruleIDfor every compliance-map entry. That invariant broke when spec1.0.23added CTR-025 (Framework Self-Prompt Misattribution), which is intentionally mapped to T-CTR-039 —T-CTR-025is already claimed by the §8.2 optimizer-protocol catalog (T-CTR-024…T-CTR-038). Test IDs come from one sequence shared across §8.1 and §8.2, so numeric alignment with rule IDs was never a real invariant. The spec and compliance map are correct; the assertion was not.Changes
pkg/workflow/compiler_threat_detection_compliance_formal_test.go— replaced the numeric-identity assertion with format checks plus test ID uniqueness:Rule↔test correspondence stays enforced by
TestFormal_RuleTestIDBijection(map must agree with the §8.1 catalog),TestFormal_NoOrphanTestID, andTestFormal_ActiveRuleCoverageComplete, so no coverage is lost.specs/compiler-threat-detection-spec.md§8.1 andspecs/compiler-threat-detection-compliance/README.md— documented that test IDs are allocated from a sequence shared with the §8.2 catalog and need not match their rule ID number, citing CTR-025 → T-CTR-039, so the assumption isn't reintroduced with the next rule.