Skip to content

fix(public-tree): no internal service, private CI or private tracker in the tree, and a guard - #195

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

dinndev2 merged 4 commits into
mainfrom
fix/public-tree

Conversation

@dinndev2

Copy link
Copy Markdown
Contributor

Closes #192.

What changes

  • .mcp.json: our own MCP service removed (a user of this server can't use it). codegraph and sentry-mcp stay.
  • .github/workflows/ci.yml: the runner comment no longer names the CI providers or the routing rule for the organisation's private repositories; it says "GitHub-hosted runner".
  • CHANGELOG.md: a 1.9.0 entry no longer cites the platform's private tracker.
  • src/public-tree.test.ts (new, runs in bun test): reads git ls-files, proves it read itself, counts the files, and fails on an internal host on our domain, a private repository or bare private tracker reference (dz#N included), someone's home directory, the setup mode's name, or a private word. Each rule is proven to fire first; a failure names the file and the rule, never the value. The allowlist is the organisation's public repositories.
  • 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 test 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
guard, no secret runs; prints that it skipped the private words
guard, three private words, required read 278 of 281 tracked files, 3 private words, 6 pass
the same guard on main's tree fails: ci.yml (private word), .mcp.json (internal host), CHANGELOG.md (private repository)
bun run lint, bun run typecheck clean
actionlint on ci.yml clean

The published package (1.10.0) ships dist, the README and the licence only; scanned, nothing in it.

The values are deliberately not repeated here.

🤖 Generated with Claude Code

…in the tree, and a guard

.mcp.json named our own MCP service, which a user of this server can't
use; ci.yml's runner comment named the CI providers and routing for the
organisation's private repositories; CHANGELOG cited the platform's
private tracker. All gone.

src/public-tree.test.ts guards it: no internal host on our domain, no
private repository or bare private tracker reference (dz#N included), 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 (fragments joined in a public file are the word). Required on this
repository's own runs; forks and Dependabot skip with a notice.

Closes #192

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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

🤖 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 — 4 file(s), 1 finding(s).

Critical 0 · Major 0 · Minor 1 · Nit 0

The guard's rule tests are sound, but nothing stops someone deleting the CI env wiring, which would quietly switch off the private-word scan.

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

Comment thread .github/workflows/ci.yml Resolved
Review finding on #195: deleting the env lines on the test step would
switch the private-word scan off with every test still green. A test now
reads the step and requires both; removing the required flag fails it.

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

Copy link
Copy Markdown
Contributor Author

Fixed in 44cf5c9: a new test reads the test step in ci.yml and requires both PUBLIC_TREE_PRIVATE_WORDS: ${{ secrets.PUBLIC_TREE_PRIVATE_WORDS }} and the PUBLIC_TREE_PRIVATE_WORDS_REQUIRED line. With the flag line removed locally it fails (0 pass, 1 fail); restored, all 7 pass. This PR's CI log already shows the secret reaching the scan: public-tree: read 278 of 281 tracked files, 3 private words.

@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), 2 finding(s).

Critical 0 · Major 0 · Minor 2 · Nit 0

This increment adds a test that the CI test step passes the private-words secret and the required flag to the guard. Deleting either line now fails it, but commenting a line out with # still passes, because the test only searches the raw YAML text.

2 non-blocking finding(s) below major (no thread on a re-review — only blocking findings open threads)
  • src/public-tree.test.ts:213 minor · test The step is checked as raw text, so prefixing either env line with # still passes and switches the private-word check off. This is the commented-out-step class from kb:review/pr-105. Drop comment lines from step before the toContain asserts, and assert that - name: test was found.
  • src/public-tree.test.ts:217 minor · test These substring checks still pass if the env lines in ci.yml are commented out with #, or if PUBLIC_TREE_PRIVATE_WORDS_REQUIRED is set to '0'; either change turns the private-word check off with every test still green (kb:review/learnings #1). Match uncommented lines anchored to line star…

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

Re-review on #195: a commented-out env line, or the required flag set to
'0', still passed the raw-text check. The step must now be found, comment
lines are dropped, and both lines are matched anchored and in full;
either mutation fails it.

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

Copy link
Copy Markdown
Contributor Author

Both re-review points fixed in 74111ac: the test now requires the test step to be found, drops comment lines, and matches both env lines anchored and in full (the flag must be … && '1' || ''). Mutations checked locally: commenting out the flag line fails it, so does changing '1' to '0'; unmodified, it passes.

@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), 1 finding(s).

Critical 0 · Major 0 · Minor 1 · Nit 0

This increment hardens the CI-wiring guard in public-tree.test.ts: it skips commented-out lines and matches the full text of both env lines. Commenting out either line now fails the test, but the pattern for the required flag still accepts a condition that never sets it.

1 non-blocking finding(s) below major (no thread on a re-review — only blocking findings open threads)
  • src/public-tree.test.ts:231 minor · test The .* accepts any condition, so PUBLIC_TREE_PRIVATE_WORDS_REQUIRED: ${{ false && '1' || '' }} passes. That line never sets the flag, so a missing secret only prints a warning, which is the 'weakening' the comment on line 211 says this test catches (kb:review/learnings #1). Replace .* with…

🤖 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 green, no blocking reviews. Ready for merge.

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

Re-review: `.*` let a condition that never sets the flag (`false && '1'`,
or a repository check broken by a rename) pass, which silently skips the
private-word check. The pin now compares the whole line.

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

Copy link
Copy Markdown
Contributor Author

Re-review point fixed in 702fe02: the pin now compares the whole PUBLIC_TREE_PRIVATE_WORDS_REQUIRED line, so a weaker condition fails it. Checked locally: replacing the repository check with false fails the test; unmodified, it passes.

@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).

Tightens the CI-workflow guard so it now requires the exact condition on the PUBLIC_TREE_PRIVATE_WORDS_REQUIRED line, closing the false && '1' bypass from the earlier review. Low risk: if the line drifts, the test fails rather than silently passing.

🤖 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

Looks good — CI is green and the guard is ready. The merge gate owns the final decision and will merge once all protections pass.

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

@dinndev2
dinndev2 merged commit 29d68bf into main Nov 15, 2026
4 checks passed
@dinndev2
dinndev2 deleted the fix/public-tree branch November 15, 2026 15:49
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.

Before listing: tracked files carry facts about our own infrastructure

1 participant