feat: add governance boundary detector prototype#1653
Open
tomjwxf wants to merge 4 commits into
Open
Conversation
|
@ZeroXLauren is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
1 task
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.
Summary
This adds a reversible governance-boundary prototype for #1012.
The new
gitnexus governance [path]command scans a repository for governance/config surfaces and sensitive operation paths, then emits both:The graph patch deliberately uses existing
CodeElementnodes plusDEFINESandUSESrelationships, so the prototype does not require a schema migration or new first-class node labels.What it detects
Governance surfaces:
.mcp.json,.mcp.jsonc,mcp.jsonsurfaces.yaml,surfaces.yml,.surfaces.yaml*.cedar.veritasacta/,veritasacta.config.json.scopeblind/,protect-mcp.config.jsonagent-governance.json,.agent-governance.json, paths containingagent-governanceSensitive operations:
fetch, Axios, Python HTTP clients, sockets, Node HTTP/TLS/net)exec,spawn,child_process, Python subprocess/os execution)Why this shape
This is intentionally advisory. It gives agents governance-relevant context before they edit sensitive code, while leaving enforcement to the runtime hook, policy engine, gateway, or CI job that owns the boundary.
Validation
npx vitest run test/unit/governance-detector.test.tsnpx tsc --noEmitingitnexusnpm run buildingitnexusnpm run lintat repo root exits 0; existing repo warnings remainnode gitnexus/dist/cli/index.js governance . --max-files 400