Skip to content

fix(public-tree): a full guard with secret-held words, and three leaks it found - #80

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

dinndev2 merged 2 commits into
mainfrom
fix/public-tree-full

Conversation

@dinndev2

Copy link
Copy Markdown
Contributor

Closes #79. Follows #47.

What changes

  • .mcp.json: our own MCP service removed again (the platform's onboarding re-added it in Establish the AI-first base for developerz-ai/mcp-ssh #48); sentry-mcp and codegraph stay.
  • tests/public_tree.rs is now the full guard the sibling repositories use (db-mcp-gateway#353's design). It refuses an internal host on our domain (.mcp.json included), a private repository or bare private tracker reference, a home path (this package's own mcp-ssh service user excepted), the setup mode's name, and a private word. Each rule is proven to fire; a failure names the file and the rule, never the value.
  • Private words come from the PUBLIC_TREE_PRIVATE_WORDS secret. The guard no longer joins fragments into a value. ci.yml's cargo test --locked step passes the secret and sets PUBLIC_TREE_PRIVATE_WORDS_REQUIRED=1 on this repository's own runs; forks and Dependabot skip with a notice. A test pins the exact env lines. The secret is set.
  • Cargo.toml: the .deb maintainer is admin@developerz.ai.
  • .dz/onboarding/base-audit.md: the agent-machine path in a build log line is replaced with <checkout>.

Verification

In a rust:latest container on the pinned toolchain (1.100.0):

Run Result
cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings clean
cargo test --test public_tree 11 passed
same, with the three private words, required public-tree guard read 175 of 186 tracked files, 3 private words, green
cargo test --locked (whole suite) 313 passed; dev_scripts::check_runs_the_gate_from_the_repo_root fails the same way on main in a bare container (it runs bin/check)

The values are deliberately not repeated here.

🤖 Generated with Claude Code

…s it found

The platform's onboarding put our own MCP service back into .mcp.json
(#48); the guard had no host rule, so it passed. The guard also joined two
fragments into the private CI provider's name, publishing it. And the .deb
maintainer address was on a private product's domain; a path from the
platform agent's machine sat in .dz/onboarding/base-audit.md.

tests/public_tree.rs is now the full guard the sibling repositories use:
no internal host on our domain (.mcp.json scanned), no private repository
or bare tracker reference, no home path (this package's own service user
excepted), no setup-mode name, and none of the private words, which come
from the PUBLIC_TREE_PRIVATE_WORDS CI secret, required on this
repository's own runs. A test pins CI's exact wiring. The .deb maintainer
is admin@developerz.ai.

Closes #79

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

⚠️ 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 — 5 file(s), 1 finding(s).

Critical 0 · Major 0 · Minor 1 · Nit 0

Each guard rule has a test that fails if the rule breaks, and the CI secret wiring is pinned. The scan loop now panics on a tracked file missing from the working tree, which the old guard skipped on purpose.

  • 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 tests/public_tree.rs Resolved
@developerz-ai

developerz-ai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Address review findings on #80

Queued — waiting for a free box.


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

@developerz-ai

developerz-ai Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Ready — CI green, all guards passed, no risk signals. The redesigned guard now reads private words from the secret (never assembling fragments), each rule is proven by test, and the .mcp.json revert + build log path sanitization complete the closure of #79. Merging when gates settle.

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

Review on #80: an unstaged `rm` made std::fs::read panic, so the
pre-commit gate failed every commit until the deletion was staged (the old
guard skipped that case). NotFound is now skipped; any other read error
still fails.

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

Copy link
Copy Markdown
Contributor Author

Fixed in 6c36f64 with your suggestion: NotFound is skipped and any other read error still fails. Checked locally by deleting README.md from the working tree: the scan passes; restored, all 11 guard tests pass, and fmt and clippy are clean.

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

This increment applies the earlier finding: the public-tree guard now skips a tracked file that was deleted from the working tree but not yet staged, and any other read error still panics. The change is low risk and the fix is correct.

  • 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?

@developerz-ai

developerz-ai Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

All gates pass — CI green, no risk signals. Ready for auto-merge.

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

@dinndev2
dinndev2 merged commit 8e014ce into main Nov 15, 2026
13 checks passed
@dinndev2
dinndev2 deleted the fix/public-tree-full branch November 15, 2026 16:59
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: our MCP service is back, the guard spells out a private word, the .deb names a private product

1 participant