test: initial coverage — normalizer, governance, intent (closes #68, #66)#89
Merged
test: initial coverage — normalizer, governance, intent (closes #68, #66)#89
Conversation
Add 25 tests across the three most security-critical packages: - normalizer: classifyShellRisk word-boundary regression (issue #63 guard), classifyTool, Normalize, Fingerprint - governance: Engine.Evaluate enforce/monitor modes, GetTimeout, NewEngine error paths - intent: all Parse extraction strategies (JSON block, XML tag, function_call, bare JSON), tool/param alias normalization, unknown-tool rejection Also fix dead code in flattenParams() — closes #66: remove 7-line unreachable string-manipulation block that was immediately overwritten by fmt.Sprintf("%g"). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jpleva91
added a commit
that referenced
this pull request
Mar 30, 2026
Sprint goal ACHIEVED: all P0/P1 governance bugs closed. - PR #86 merged: P1 #28 (timeout override) closed - PR #88 merged: P1 #63 (classifyShellRisk word-boundary) closed - PR #89 open: P1 #68 (test coverage) + P2 #66 (dead code), CI green 5/5 Remaining blocker: PR #89 requires human review (@jpleva91). Dogfood (#76) blocked on setup.sh remote Ollama gap. Next sprint proposal: dogfood readiness + P2 batch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jpleva91
added a commit
that referenced
this pull request
Mar 30, 2026
Sprint goal ACHIEVED: all P0/P1 governance bugs closed. - PR #86 merged: P1 #28 (timeout override) closed - PR #88 merged: P1 #63 (classifyShellRisk word-boundary) closed - PR #89 open: P1 #68 (test coverage) + P2 #66 (dead code), CI green 5/5 Remaining blocker: PR #89 requires human review (@jpleva91). Dogfood (#76) blocked on setup.sh remote Ollama gap. Next sprint proposal: dogfood readiness + P2 batch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jpleva91
added a commit
that referenced
this pull request
Mar 30, 2026
Sprint transition: enforcement hardening → dogfood readiness. Previous sprint goal (P0/P1 governance hardening) ACHIEVED. PR #89 (test coverage, closes #68 + #66) CI-green, awaiting human merge. PR #90 (EM state run 7) CI-green, awaiting human merge. New sprint: unblock jared-box dogfood run. - Primary: fix setup.sh remote Ollama gap (#76) - P2 batch: #65 (silent WriteFile), #52 (Glob **), #51 (silent run()), #50 (version compare) - README cleanup (#53) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jpleva91
added a commit
that referenced
this pull request
Mar 30, 2026
Sprint goal ACHIEVED: all P0/P1 governance bugs closed. - PR #86 merged: P1 #28 (timeout override) closed - PR #88 merged: P1 #63 (classifyShellRisk word-boundary) closed - PR #89 open: P1 #68 (test coverage) + P2 #66 (dead code), CI green 5/5 Remaining blocker: PR #89 requires human review (@jpleva91). Dogfood (#76) blocked on setup.sh remote Ollama gap. Next sprint proposal: dogfood readiness + P2 batch. Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
flattenParams()— closes bug: dead code in flattenParams() overwrites result before using it (intent/parser.go) #66go test ./internal/normalizer/ ./internal/governance/ ./internal/intent/(25/25)What's covered
internal/normalizerclassifyShellRisk— word-boundary regression guard (lock in the PR fix(normalizer): word-boundary check in classifyShellRisk — closes #63 #88 fix)"catalog_tool"must returnRiskMutating, notRiskReadOnly"finder.sh"must returnRiskMutating, notRiskReadOnlyrm,git push,chmod, etc.)classifyTool— all 7 tool name casesNormalize— struct field correctnessFingerprint— determinism, hex format, 16-char lengthinternal/governanceEngine.Evaluate— enforce mode denies, monitor mode allows on same matchargs_containmatching —git pushdenied,git pullallowedmonitoraction policies always allow (even in enforce mode)GetTimeout— policy-specified timeout vs 300s defaultNewEngine— missing file error, invalid YAML error, default monitor modeinternal/intentParseextraction strategies: JSON block, XML tag, function_call, bare JSONBash → run_shell,Read → read_file, etc.)file_path → path,text → content)flattenParamsnumeric/bool conversionBug fix: #66 — dead code in
flattenParamsRemoved 7-line unreachable block (complex string manipulation) that was
immediately overwritten by
fmt.Sprintf("%g", val). No behavior change.🤖 Generated with Claude Code