Skip to content

Follow-up to #100: fix CodeQL finding, externalize the bridge marker - #101

Merged
open-coder-ai merged 1 commit into
mainfrom
w48-followup/gitattributes-rename-and-bridge-marker
Sep 2, 2026
Merged

Follow-up to #100: fix CodeQL finding, externalize the bridge marker#101
open-coder-ai merged 1 commit into
mainfrom
w48-followup/gitattributes-rename-and-bridge-marker

Conversation

@open-coder-ai

@open-coder-ai open-coder-ai commented Sep 2, 2026

Copy link
Copy Markdown
Owner

What

Two small loose ends discovered right after #100 merged (spine-a W48, "externalize, don't
hardcode" wave), both fixed here:

  1. CodeQL finding on Externalize emitted-artifact templates and the CLI command table into data files #100 (code-scanning alert #121):
    _GITATTRIBUTES_TEMPLATE in scaffold/templates.py flagged as an unused global. It is not
    unused — it's genuinely consumed from scaffold/init.py — but its leading underscore reads as
    module-private while its two siblings in the same file (POLICIES_GUARDRAIL,
    SKILLS_GUARDRAIL) already have no underscore for the identical cross-module usage. Renamed
    to GITATTRIBUTES_TEMPLATE to match and resolve the finding at its root cause.

  2. A missed template: scaffold/skills_bridge.py's _BRIDGE_MARKER_BODY (the ownership-note
    text 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 via package_data_dir — the same
    pattern 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-data
glob (no pyproject.toml change needed). tests/test_template_tokens.py extended to cover the
marker alongside the other static (token-free) templates.

Verification

  • Byte-identical, verified directly: skills_bridge._BRIDGE_MARKER_BODY after the change equals
    the 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 . and ruff format --check . clean.
  • Wheel build: chock/scaffold/data/bridge_marker.txt confirmed present in the built wheel.

Definition of done

  • chock check → 0 errors, 0 warnings, 0 infos
  • chock sync --repo . --check clean
  • pytest -q green
  • ruff check . and ruff format --check . clean
  • No version bump (byte-identical, cosmetic/organizational change only)

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 903ed571-fbb9-46f8-93da-cd66bfac5ffc


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@open-coder-ai
open-coder-ai marked this pull request as ready for review September 2, 2026 02:44
@open-coder-ai
open-coder-ai merged commit ff14006 into main Sep 2, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants