OpenCode suggestions for PR #34 - #35
Conversation
|
👀 Starting code review... |
|
🔄 Cloning repository... |
|
🤖 Analyzing code with opencode... |
|
This suggestion PR is now obsolete because the original PR #34 has been closed/merged. Closing automatically. |
|
✅ Review complete! |
There was a problem hiding this comment.
Self-approval guardrail: the review decision was degraded from "request_changes" to "comment" because the bot cannot formally review its own PR.
This PR introduces syntax errors in all three changed files, preventing compilation, and introduces an incorrect test assertion.
Blocking issues:
- Duplicate package declarations in
hygiene.goandmeaning.go: Both files now contain twopackage textnormlines with orphaned comment fragments between them. This is invalid Go syntax. - Missing closing brace in
fuzz_test.go:FuzzHygienePresetis nested insideFuzzMeaningPresetbecause the closing}forFuzzMeaningPresetwas removed. - Incorrect idempotency assertion in
fuzz_test.go:HygienePresetincludes aDecodeHTMLEntitiesstage (non-idempotent; e.g."&"→"&"→"&"). The previous version of this test explicitly avoided an idempotency check for this reason. The new assertion will cause the fuzzer to fail on valid inputs.
Additional comments (could not be anchored to the PR diff)
- textnorm/meaning.go:21 — The file now contains two
package textnormdeclarations separated by a duplicated comment fragment from the old package doc. This is invalid Go syntax.
| }) | ||
| func FuzzHygienePreset(f *testing.F) { |
There was a problem hiding this comment.
FuzzHygienePreset is nested inside FuzzMeaningPreset because the closing brace } for FuzzMeaningPreset was removed.
| }) | |
| func FuzzHygienePreset(f *testing.F) { | |
| }) | |
| } | |
| func FuzzHygienePreset(f *testing.F) { | |
| if err != nil { | ||
| t.Fatalf("second Run() error = %v", err) | ||
| } | ||
| if out1 != out2 { |
There was a problem hiding this comment.
HygienePreset includes DecodeHTMLEntities, which is non-idempotent on inputs like "&" (first run → "&", second → "&"). The previous version of this test explicitly avoided an idempotency check for this reason. This assertion will cause the fuzzer to fail on valid inputs.
| // hygiene.go: byte-hygiene stages for text that will be | ||
| // sent to an external model or stored verbatim. These stages never touch | ||
| // case, punctuation, or diacritics. | ||
| package textnorm | ||
| // sent to an external model or stored verbatim. These stages never touch | ||
| // case, punctuation, or diacritics. | ||
| package textnorm |
There was a problem hiding this comment.
The file now contains two package textnorm declarations and a leftover comment fragment from the old package doc. This is invalid Go syntax.
| // hygiene.go: byte-hygiene stages for text that will be | |
| // sent to an external model or stored verbatim. These stages never touch | |
| // case, punctuation, or diacritics. | |
| package textnorm | |
| // sent to an external model or stored verbatim. These stages never touch | |
| // case, punctuation, or diacritics. | |
| package textnorm | |
| // hygiene.go: byte-hygiene stages for text that will be | |
| // sent to an external model or stored verbatim. These stages never touch | |
| // case, punctuation, or diacritics. | |
| package textnorm | |
This PR contains automated suggestions for #34.
Merging this PR will apply the suggestions directly into the reviewed branch (
feat/meaning-preset).[opencode-suggestion]