Follow-up to #100: fix CodeQL finding, externalize the bridge marker - #101
Merged
open-coder-ai merged 1 commit intoSep 2, 2026
Merged
Conversation
Two loose ends from the just-merged emitted-artifact-templates wave: - CodeQL flagged _GITATTRIBUTES_TEMPLATE as an unused global in scaffold/templates.py: the leading underscore reads as module-private, but the constant is genuinely consumed by scaffold/init.py. Renamed to GITATTRIBUTES_TEMPLATE, matching its two siblings in the same file (POLICIES_GUARDRAIL, SKILLS_GUARDRAIL) which already use no underscore for the identical cross-module usage pattern. - scaffold/skills_bridge.py's _BRIDGE_MARKER_BODY -- the text written into a bridge directory's ownership marker file -- was missed by the original wave's inventory. It is exactly the same kind of emitted, non-Python (plain text) artifact template as everything else that moved: externalized to scaffold/data/bridge_marker.txt, read via package_data_dir, byte-identical (verified directly). Both already covered by the existing chock.scaffold package-data glob; tests/test_template_tokens.py extended to cover the marker. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
What
Two small loose ends discovered right after #100 merged (spine-a W48, "externalize, don't
hardcode" wave), both fixed here:
CodeQL finding on Externalize emitted-artifact templates and the CLI command table into data files #100 (code-scanning alert #121):
_GITATTRIBUTES_TEMPLATEinscaffold/templates.pyflagged as an unused global. It is notunused — it's genuinely consumed from
scaffold/init.py— but its leading underscore reads asmodule-private while its two siblings in the same file (
POLICIES_GUARDRAIL,SKILLS_GUARDRAIL) already have no underscore for the identical cross-module usage. Renamedto
GITATTRIBUTES_TEMPLATEto match and resolve the finding at its root cause.A missed template:
scaffold/skills_bridge.py's_BRIDGE_MARKER_BODY(the ownership-notetext written into a bridge directory) is exactly the same kind of emitted, non-Python
(plain-text) artifact template as everything Externalize emitted-artifact templates and the CLI command table into data files #100 moved, but wasn't in that wave's inventory.
Externalized to
scaffold/data/bridge_marker.txt, read viapackage_data_dir— the samepattern already used for its sibling templates in the same package. Content verified
byte-identical directly.
Both files are already covered by the existing
"chock.scaffold" = ["data/*"]package-dataglob (no
pyproject.tomlchange needed).tests/test_template_tokens.pyextended to cover themarker alongside the other static (token-free) templates.
Verification
skills_bridge._BRIDGE_MARKER_BODYafter the change equalsthe original literal string.
pytest -q→ 1047 passed, 1 skipped (pre-existing, unrelated).chock check→ exit 0;chock sync --repo . --check→ compiled artifacts match manifests.ruff check .andruff format --check .clean.chock/scaffold/data/bridge_marker.txtconfirmed present in the built wheel.Definition of done
chock check→ 0 errors, 0 warnings, 0 infoschock sync --repo . --checkcleanpytest -qgreenruff check .andruff format --check .clean🤖 Generated with Claude Code