feat(check): gate managed output content - #18
Merged
Conversation
Scan every managed output for absolute home directories and for strings a marketplace declares under `redactions:`. The scan rides on the byte read `checkManagedOutput` already performs for the drift comparison, so copied passthrough resources are covered at no extra I/O — until now nothing read those bytes for anything but equality. Redactions are literal strings rather than patterns: a declaration names a vocabulary, and a regex invites an author to encode matching logic the compiler then has to defend against. The one patterned class that generalizes across every repository is built in. A gate on `check`, never on `compile` (ndr:tfee0d): compilation stays total, and whether a tree is publishable is a judgement about a finished tree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LxNdWk6ZUzq6uWFtd94yWD
Validate any `.json` output that is not one of the native documents — a hook configuration, a package's own settings file, anything a publication ships verbatim. Both harnesses parse these at load time, so a file that does not parse is one the runtime rejects. Narrower than the repo-local linter this replaces, which also failed an empty markdown file and warned on a short one. Neither is a runtime failure on either harness, and turning one repository's house style into every consumer's build error is the overreach ndr:17dhph rejected for strict target schemas. Two tests pin the tolerance. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LxNdWk6ZUzq6uWFtd94yWD
|
🎉 This PR is included in version 0.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Ports the two content gates that
jdh-agentscurrently runs outside the compiler (marketplace scan,marketplace lint) intoagentforge check, so a consumer repo no longer needs its own Python tooling to know whether a compiled tree is publishable.Both gates ride on the byte read
checkManagedOutputalready performs for the drift comparison, so copied passthrough resources are covered, not just generated documents — at no extra I/O. Nothing previously read those bytes for anything but equality.Commits
feat(check): gate managed output content on declared redactions— newunsafe-output-contentissue. Flags absolute home directories (/Users/<name>/,/home/<name>/) and any literal string a marketplace declares under a new optionalredactions:block.feat(check): report a managed .json output that does not parse— newinvalid-output-documentissue for a.jsonoutput that is not one of the native documents.Design notes
authoring-keys/documentsprecedent (ndr:4nshwv).checkderives every judgement from the compilation plan (ndr:tfee0d); a gate handed in as a separate optional argument is a gate a caller can forget — the same reasoning that keepsrootOutputson the plan.check, never oncompile. Compilation stays total. A leak that reaches disk under--outhas not been published; one that survivescheckis about to be.Risk surface
Low. Both gates are additive to
checkand touch no compile or materialize path — output bytes are unchanged, andbun testsnapshots are untouched (67 unchanged). The only breaking shape isCompilationPlan.redactionsbeing required rather than optional, which is deliberate: the type surfaces every construction site rather than letting one silently skip the gate.The realistic failure mode is a false positive failing a consumer's build. Mitigated by scoping the built-in detector to absolute home paths only — secret-shaped detection was deliberately left out, since it belongs to the repo-wide scan that stays put.
Testing
jdh-agents420 managed files,ndr77 managed files, allok.Rollback
Revert either commit alone — they are independent gates sharing only the read site. Reverting both restores
checkexactly.🤖 Generated with Claude Code
https://claude.ai/code/session_01LxNdWk6ZUzq6uWFtd94yWD