Repository navigation
fix(secom): add secom-skip opt-out tag and structured-data safety warnings - #20
Merged
Merged
Conversation
β¦nings Closes spec 20. Three-part fix for silent JSON/YAML destruction at promote time: 1. secom-skip tag β explicit opt-out bypass in before_propose (semantically honest alternative to the secom-compressed workaround) 2. before_save advisory β warns when fenced code blocks or JSON-like lines are detected and secom-skip is absent (code: secom_structured_data_advisory) 3. before_propose WARNING log β surfaces structured-data compression to operators so silent data corruption can be investigated Existing secom-compressed bypass and all prior tests continue to pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
β¦ notes From devstral code review: - Move `import logging` to module top in test file - Add test_both_advisories_triggered: verbose + structured content yields both Advise actions - Add test_secom_skip_does_not_suppress_verbosity_advisory: secom-skip is scoped to structured data only Docs: - README.md: add secom-skip structured data note and known limitation to SECOM section - docs/fava_trails_faq.md: add known limitation paragraph to SECOM FAQ answer 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
secom-skiptag as an explicit opt-out from SECOM compression inbefore_proposeβ semantically honest alternative to thesecom-compressedworkaroundbefore_saveadvisory (secom_structured_data_advisory) when fenced code blocks or JSON-like lines are detected withoutsecom-skippresentWARNINGlog inbefore_proposewhen compression proceeds on content with detected structured data, so operators can investigate silent data corruptionFixes the root cause from Spec 20 β the silent JSON/YAML destruction that caused Porch to parse
plan_phases: []and loop the builder indefinitely.Test plan
uv run python -m pytest tests/test_secom.py -vβ all 34 tests pass (4 new)uv run ruff checkβ cleantest_secom_skip_tag_bypasses_compressionβ secom-skip skips compressiontest_structured_data_warning_loggedβ WARNING emitted via caplogtest_structured_data_fenced_code_block_advisesβ fenced block triggers advisorytest_structured_data_json_block_advisesβ JSON-like line triggers advisorytest_structured_data_advisory_suppressed_with_secom_skipβ advisory suppressed when secom-skip presentπ€ Generated with Claude Code