Skip to content

Commit 41d712e

Browse files
hyperpolymathclaude
andcommitted
fix(verify-harvard): skip doc-comment lines + add word-boundary guards
The grep -iE 'If|...|For|...' was case-insensitively matching the English word "for" in doc-comment prose ("for shortest path", "algebraic form") inside the DataExpr enum block, producing false positives for the semiring operators Min/Max/Or/Xor — all of which are genuinely data-level. Fix: filter comment lines with `grep -v '^\s*//'` before the variant scan, and wrap each keyword in `\b...\b` so e.g. "form" no longer matches "For". `just contractile-check` now passes: bust-check ✓. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fdc2ae6 commit 41d712e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ verify-harvard:
486486
if [ -f "$AST_FILE" ]; then
487487
DATA_ENUM=$(sed -n '/enum DataExpr/,/^}/p' "$AST_FILE" 2>/dev/null || true)
488488
if [ -n "$DATA_ENUM" ]; then
489-
CONTROL_IN_DATA=$(echo "$DATA_ENUM" | grep -iE 'If|Match|Loop|While|For|Branch|Send|Receive|Spawn|Choose|Offer' || true)
489+
CONTROL_IN_DATA=$(echo "$DATA_ENUM" | grep -v '^\s*//' | grep -iE '\b(If|Match|Loop|While|For|Branch|Send|Receive|Spawn|Choose|Offer)\b' || true)
490490
if [ -n "$CONTROL_IN_DATA" ]; then
491491
echo " FAIL: DataExpr enum contains control-flow variants:"
492492
echo "$CONTROL_IN_DATA" | sed 's/^/ /'

0 commit comments

Comments
 (0)