test(kr-7): generator index must be positive (no sigma 0, no negative)#25
Merged
Merged
Conversation
…ve index)
KR-7 from PROOF-NARRATIVE.md §3: `sigma N`, `sigma_inv N`, `cup N`,
`cap N` must be accepted iff N >= 1.
The canonical parser in `KRLAdapter.jl` raises a "zero index" error
for `sigma 0` etc., and negative indices are outside the lexer's
positive-Int recognition. The smoke test now asserts that no
committed example contains such a pattern.
Added check 4b in tests/smoke/grammar_smoke.sh:
- Grep examples for `<gen> 0` — fail if present.
- Grep examples for `<gen> -<digits>` — fail if present.
- Report pass for examples with no violation.
This is a positive smoke check, not a parser-correctness proof; full
KR-7 discharge requires a parser-level property test (deferred to
follow-up — see PROOF-NEEDS.md TG-K3 entry). The smoke version
catches accidental commits of malformed examples and stays in the
existing lexical-level CI lane.
Verified locally:
- Original 4 examples: 20 passing checks (was 16; added 1 KR-7
pass per file × 4 files).
- Synthetic example `let bad = (sigma 0); close bad;` correctly
fails with "generator with zero index violates KR-7 (sigma 0)".
Cross-references:
- PROOF-NARRATIVE.md KR-7 (added in PR #23)
- ASSUMPTIONS.md A-KR-2.1
- TEST-NEEDS.md TG-K3 (added in PR #23)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 71 issues detected
View findings[
{
"reason": "Action perpolymath/standards/.github/workflows/governance-reusable.yml@main\n needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in boj-build.yml",
"type": "missing_timeout_minutes",
"file": "boj-build.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in codeql.yml",
"type": "missing_timeout_minutes",
"file": "codeql.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in dependabot-automerge.yml",
"type": "missing_timeout_minutes",
"file": "dependabot-automerge.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in dogfood-gate.yml",
"type": "missing_timeout_minutes",
"file": "dogfood-gate.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in dogfood-gate.yml",
"type": "missing_timeout_minutes",
"file": "dogfood-gate.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in dogfood-gate.yml",
"type": "missing_timeout_minutes",
"file": "dogfood-gate.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in dogfood-gate.yml",
"type": "missing_timeout_minutes",
"file": "dogfood-gate.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in dogfood-gate.yml",
"type": "missing_timeout_minutes",
"file": "dogfood-gate.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Issue in governance.yml",
"type": "missing_timeout_minutes",
"file": "governance.yml",
"action": "flag",
"rule_module": "workflow_audit",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
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
Implements KR-7 from PROOF-NARRATIVE.md §3 (added in PR #23):
The canonical parser in
KRLAdapter.jlalready raises a "zero index" error forsigma 0, and negative indices fall outside the lexer's positive-Int recognition. This PR adds a smoke-test assertion that no committed example contains either pattern.What's added
tests/smoke/grammar_smoke.shcheck 4b — for each.krlexample:<gen> 0(whitespace-separated zero index). Fail if present.<gen> -<digits>(negative index). Fail if present.Verification
Locally:
let bad = (sigma 0); close bad;generator with zero index violates KR-7 (sigma 0)What this does NOT do
This is a smoke check, not a parser-correctness proof. The full KR-7 discharge requires a parser-level property test (deferred — see TEST-NEEDS.md
TG-K3entry added in PR #23). The smoke version catches accidental commits of malformed examples and stays in the existing lexical-level CI lane.Cross-references
Test plan
🤖 Generated with Claude Code