Skip to content

fix(public-tree): no setup-mode preamble or internal MCP service in the tree, and a guard - #32

Merged
dinndev2 merged 5 commits into
mainfrom
fix/public-tree
Nov 15, 2026
Merged

dinndev2 merged 5 commits into
mainfrom
fix/public-tree

Conversation

@dinndev2

Copy link
Copy Markdown
Contributor

Closes #30.

What changes

  • 4 files lose the setup-mode preamble (.claude/skills/verify-change/SKILL.md and the three .dz/ files): each now says it is owned by this repository's maintainers.
  • .mcp.json: our own MCP service removed; sentry-mcp and codegraph stay. Scorecard: the platform run id line is gone.
  • bin/check-public-tree (new; bash, no dependencies), run as a "Public tree" step in the unconditional checks job, which the required ci gate grades, so docs-only PRs run it too. It reads git ls-files, proves it read itself, and fails on an internal host on our domain, a private repository or bare private tracker reference, someone's home directory, the setup mode's name, or a private word. A CODEOWNERS @org/team is not a repository. A failure names the file and the rule, never the value.
  • --self-test proves each rule fires, including on a 200 KB file with the match on line 1 (no SIGPIPE false pass under pipefail). It also pins CI's exact env lines: commenting one out or weakening the condition fails it.
  • Private words come from the PUBLIC_TREE_PRIVATE_WORDS secret, never from the tree (fragments joined in a public file are the word: db-mcp-gateway#350). The workflow step passes it and sets PUBLIC_TREE_PRIVATE_WORDS_REQUIRED=1 on this repository's own runs; forks and Dependabot skip with a notice. The secret is set.

Verification

Run Result
bin/check-public-tree --self-test every rule fires
guard, two private words, required read 326 of 326 tracked files, 2 private words, green
the same guard on main's tree 5 findings: the 4 preamble files and .mcp.json
actionlint no new findings (one pre-existing note on main)

The values are deliberately not repeated here.

🤖 Generated with Claude Code

…he tree, and a guard

Four files carried a preamble naming the internal setup mode; each now
says it is owned by this repository's maintainers (or, for the onboarding
proposal and the scorecard, says who wrote it). .mcp.json no longer names
our own MCP service, and the scorecard drops its platform run id.

bin/check-public-tree (bash) guards the tree as a "Public tree" step in
the unconditional `checks` job, which the required `ci` gate grades: no
internal host on our domain, no private repository or bare private
tracker reference, no one's home directory, no setup-mode name, and none
of the private words, which come from the PUBLIC_TREE_PRIVATE_WORDS CI
secret, never from the tree. --self-test proves each rule fires and pins
the workflow's exact wiring.

Closes #30

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dinndev2
dinndev2 requested a review from sebyx07 as a code owner November 15, 2026 16:05
@dinndev2 dinndev2 added this to the Public listing milestone Nov 15, 2026
@github-actions github-actions Bot added ci docs docs/, wiki/, llms.txt, any Markdown labels Nov 15, 2026
@developerz-ai

developerz-ai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

✅ Reviewed — nothing blocking

0 actionable comment(s) · grounded on your code

⚠️ 1 config note(s): test files were not shown to the reviewer — this diff touched no path recognised as a test, so no assertion was available to read the change against

🤖 developerz.ai — automated review, running on your model and your box.

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary — 7 file(s), 4 finding(s).

Critical 0 · Major 0 · Minor 4 · Nit 0

Removes the setup-mode preamble, an internal MCP endpoint and a run id from tracked files, and adds a bash guard to CI that scans the tracked files for private names. Low risk.

File Findings
.github/workflows/ci.yml 1 minor
bin/check-public-tree 3 minor
  • test files were not shown to the reviewer — this diff touched no path recognised as a test, so no assertion was available to read the change against

🤖 developerz.ai review — automated, running on your model and your box. What is this?

Comment thread .github/workflows/ci.yml Resolved
Comment thread bin/check-public-tree Resolved
Comment thread bin/check-public-tree Resolved
Comment thread bin/check-public-tree Outdated
done
echo "check-public-tree: read $read of ${#files[@]} tracked files, $(wc -l < "$words_file" | tr -d ' ') private words" >&2
[[ $read -ge $min_tracked ]] || { echo "check-public-tree: read only $read tracked files" >&2; exit 1; }
[[ $failures -eq 0 ]] || { echo "check-public-tree: $failures finding(s); rule per file, value withheld" >&2; exit 1; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor · maintainability Every failure branch (lines 109, 119, 125, 128, 143, 144) prints a cause but no runnable fix: command, so an agent with a red run has no recovery command to paste (kb:review/learnings lesson 1). Add a fix: line to each, e.g. fix: bash bin/check-public-tree after editing the named files, or the command that sets the missing env var.

@developerz-ai

developerz-ai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Address review findings on #32

Queued — waiting for a free box.


🤖 developerz.ai, an automated agent, not a human — developerz-ai[bot]

…, fix: lines

Review on #32: the guard is now a bin/check step (`public-tree`), and CI
runs `bin/check --only checks --only public-tree` with the secret, so a
contributor's bin/check grades what CI grades; raw.githubusercontent.com
and api.github.com/repos paths count as repository references; a tracked
path is checked like its content; every failure prints a fix: line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dinndev2

Copy link
Copy Markdown
Contributor Author

All four addressed in 6b8eefd:

  • bin/check: a new public-tree step runs the guard (self-test, then the scan). The checks job now runs bin/check --only checks --only public-tree with the secret, so a contributor's bin/check grades exactly what CI grades. ruby bin/check --only public-tree: pass. bundle exec rubocop bin/check: no offenses.
  • URL forms: raw.githubusercontent.com/<org>/… and api.github.com/repos/<org>/… now count as repository references, with self-test fixtures for both.
  • Paths: each tracked path is checked with the same rules as its content, reported as <path>: <rule> (in the path).
  • fix: lines: the tree failure, the required-but-empty secret and a failing self-test each print a runnable fix:.

…root

check_test.rb pins bin/check's ordered steps; public-tree is now part of
that contract (and of the two comments that list the steps). The guard
compares resolved paths (`pwd -P`), so a checkout under a symlinked
directory is not mistaken for another tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary — 6 file(s), 4 finding(s).

Critical 0 · Major 0 · Minor 4 · Nit 0

This increment moves the public-tree guard into bin/check as its own step, so CI and contributors run the same command. It also extends the repo regex to raw/API GitHub URLs, scans file paths and adds fix: lines.

File Findings
.github/workflows/release.yml 1 minor
bin/check 1 minor
bin/check-public-tree 2 minor
4 non-blocking finding(s) below major (no thread on a re-review — only blocking findings open threads)
  • .github/workflows/release.yml:197 minor · security The release build job's bin/check (release.yml:211-212) sets neither PUBLIC_TREE_PRIVATE_WORDS nor PUBLIC_TREE_PRIVATE_WORDS_REQUIRED. A tag cut from a commit that never ran ci.yml on this repository therefore passes the release gate without the private-word check. Pass both env lines on th…
  • bin/check:589 minor · bug The public-tree step now runs in every contributor's bin/check. On stock macOS /bin/bash 3.2, the self-test's ${p1^^} (bin/check-public-tree:85) is a bad substitution and mapfile (:129) does not exist, so the pre-push gate goes red on an unchanged tree. Make the script check…
  • bin/check-public-tree:136 minor · security The path scan at lines 145-149 runs after the continue guards at lines 136-137, so the check never reads the name of some tracked files. Those are empty files (vendor/<​private-repo>/.keep), binary files (<​private-word>.png) and symlinks or other non-regular entries, and git ls-files still p…
  • bin/check-public-tree:145 minor · test The new path scan is never exercised. --self-test only calls violations on fixture text and exits at line 116, so you could delete lines 145-149 or pass $full instead of $path and every self-test and bin/check test would stay green (kb:review/learnings lesson 2). Move the path rule into a…

🤖 developerz.ai review — automated, running on your model and your box. What is this?

@developerz-ai

developerz-ai Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

CI passed. PR is ready to merge when the gates pass.

🤖 Posted by developerz.ai — an automated agent, not a human.

@developerz-ai

developerz-ai Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

CI passed, review approved, all findings addressed. Ready to merge.

🤖 Posted by developerz.ai — an automated agent, not a human.

…, release gated

Review on #32: `${x^^}` and `mapfile` are gone (stock macOS bash 3.2
runs the self-test and the scan); a tracked entry's path is checked even
when its content is not read (empty, binary, symlink), through one
scan_entry function the self-test exercises with an empty file named after
a private word; release.yml's bin/check passes the secret and requires it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dinndev2

Copy link
Copy Markdown
Contributor Author

All four addressed in 41d9624:

  • Release gate: release.yml's bin/check step now passes PUBLIC_TREE_PRIVATE_WORDS and sets PUBLIC_TREE_PRIVATE_WORDS_REQUIRED: "1", since a release is always cut from this repository.
  • bash 3.2: no ${x^^} and no mapfile. Run in a bash:3.2 container (3.2.57): the self-test passes and the scan reads 325 of 326 files.
  • Paths of unread files: a new scan_entry checks every tracked entry's path first, then its content only when it is a regular text file. Empty files, binaries and symlinks get their names checked.
  • The path check is tested: the self-test runs scan_entry on an empty file at vendor/<word>/.keep and requires the in-path finding. Deleting the path check, or passing the full path instead of the repo path, fails it.

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary — 2 file(s), 1 finding(s).

Critical 0 · Major 0 · Minor 1 · Nit 0

One gap in the guard: it skips tracked symlinks, so a symlink's target text gets published without being scanned. The secret only reaches a temp file and is never printed.

1 non-blocking finding(s) below major (no thread on a re-review — only blocking findings open threads)
  • bin/check-public-tree:73 minor · security scan_entry returns early for symlinks, but Git stores a symlink's target string as public blob content. A tracked symlink pointing at /home/alice/<​private-repo> or a private-word path therefore passes green, and before this diff -f at least scanned the target file. Before the regular-file che…
  • test files were not shown to the reviewer — this diff touched no path recognised as a test, so no assertion was available to read the change against

🤖 developerz.ai review — automated, running on your model and your box. What is this?

Review on #32: Git publishes a tracked symlink's target string as its
blob, so a link pointing into someone's home or at a private name was
published unchecked. scan_entry now checks the target; the self-test
links to a home path and requires the finding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dinndev2

Copy link
Copy Markdown
Contributor Author

Fixed in 45cf9ef: for a tracked symlink, scan_entry now checks the target string (what Git publishes as its blob), reported as (in the link target). The self-test adds a symlink to a home path and requires that finding. It passes on bash 5 and bash 3.2, and the tree scan stays green.

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary — 1 file(s), 0 finding(s).

Extends bin/check-public-tree to scan a tracked symlink's target text, which Git publishes as the blob's content, and adds a self-test case that fails if that check is removed. Low risk: the new branch runs before the regular-file test and the existing path and content checks are unchanged.

  • test files were not shown to the reviewer — this diff touched no path recognised as a test, so no assertion was available to read the change against

🤖 developerz.ai review — automated, running on your model and your box. What is this?

@dinndev2
dinndev2 merged commit 552149c into main Nov 15, 2026
14 checks passed
@dinndev2
dinndev2 deleted the fix/public-tree branch November 15, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci docs docs/, wiki/, llms.txt, any Markdown

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Before listing: tracked files carry facts about our own infrastructure

1 participant