Repository navigation
Closed as not planned
Labels
Description
Overview
Harness hooks can refuse a tool call but need a verdict from somewhere. Plays fire on graph events and a repo write is not one. This adds a nodespace gate check command that answers "may this session edit files in the project right now?" by evaluating the rules, so every harness integration asks the same question and the rules live in one place.
Problem Statement
- The process is enforced only on graph writes. A plan cannot be approved before its spec, and a planned task cannot start without lineage, but an agent can edit the repository with no claimed task and no approved spec.
- A skill is advice. The implementing skill tells an agent to claim a task first. Nothing refuses the edit if it does not.
- Each harness would otherwise hold its own copy of the rule. A hook that decides for itself would drift from the Plays.
Proposed Solution
nodespace gate checktakes the session (NODESPACE_SESSION), the action kind (repo_write) and the target paths, and returnsallowordeny, a reason written for the agent, and the name of the rule that decided.- Evaluation reuses the dry run from ADR-094 §9 rather than adding a second rule matcher. ADR-097 §2 decides this (design B); a new action-attempt trigger kind is deferred until a rule must name a path.
- Advisory by default. A rule that would deny returns
allowwith a "would have denied" note and is counted. Enforcement is switched on per rule, without editing the Play. The would-deny count is the shadow-period report. - Recorded override. A person can allow a specific denied edit or task with
nodespace gate allow <task> --reason "...", recorded on the task. This is a convention: core has no access control, so nothing stops an agent running it. The gate catches mistakes and drift; it is not a defence against an agent set on bypassing it.
Documentation
- ADR-097 - the gate this issue builds
- ADR-094 §9 (dry run), §6 (claiming by version)
- ADR-093 §5 (harness plugins)
- ADR-095 (where per-rule enforcement could live)
- playbook-engine.md "Dry run of a write" - the conditions-only mode the check reuses, and how it differs from workflow state (which evaluates a node as it stands)
- agent-session.md and ADR-032 - launched sessions and their variables
- playbook-system.md - rule classes, dry run
- ADR-060 (invariant rules)
- Updates:
packages/skill/references/cli.md,architecture/playbook-engine.md
Architecture Impact
Extends the dry run (ADR-094 §9, done) to a question that is not a property change. Changes a consequence stated in ADR-094 ("Nothing forces an agent to act on what it read") and adds a second reason for in-turn refusal beside ADR-093 §5; both are recorded by ADR-097 (Proposed, on docs main). Accept it before starting.
Acceptance Criteria
-
nodespace gate checkreturns a verdict (allowordeny), a reason, and the deciding rule - A session with no NodeSpace session, or one not tied to a project, is allowed
- Reads,
nodespacecommands, and writes outside the project folder are never denied - Rules ship advisory. An advisory rule that would deny returns
allowwith a "would have denied" note and increments a count the user can read (nodespace gate report) - A rule can be switched to enforcing per rule, without editing the Play; the setting's home is decided and recorded
- A deny reason states that the edit was not made, names the next
nodespacecommand, names the skill to follow, and tells the agent not to retry the same edit -
nodespace gate allowoverrides a specific denial with a reason, recorded on the task - The CLI help and docs state that override and approval are conventions, not access control, and that a check is a prediction
- A task already
in_progressis evaluated correctly: the dry run of "this task is inin_progress" does not become a no-op for transition-triggered rules (test with a task whose spec is later unapproved) - If the daemon cannot be reached or the check times out, the verdict is
allowand the output says the check did not run - The measured time of a check is recorded in the issue before it closes
-
references/cli.mddocuments the commands;bun run skill:checkpasses - Code passes
bun run quality:fix - Tests pass (
bun run test:changed)
Technical Specifications
Reference Files
packages/core/src/services/node_service/invariants.rs(the one invariant execution loop, with a conditions-only mode)packages/core/src/playbook/workflow_state.rspackages/core/src/playbook/core_plays.rspackages/cli/src/commands/(newgate.rs;session.rsfor session handling) and the daemon's gRPC surfacepackages/agent/src/pty/session.rs(NODESPACE_SESSION,NODESPACE_LAUNCHED_FOR)
Implementation Details
- Resolve the session's task:
NODESPACE_LAUNCHED_FORfor launched sessions; otherwise the task that session started. "No claimed task at all" is answered by the command before any rule runs. - Override and approval: ADR-092 says approval is the user's, enforced only by seeded skills telling an agent to leave specs in
draftand ask. There is no mechanism to reuse. Do not claim the agent cannot override; restricting who may approve is access control and belongs in nodespace-sync. - Fail-open on timeout or unreachable daemon is deliberate: a broken gate must not stop work.
- Shipping a CLI input/output change needs skill-guidance criteria in this same issue (above).
Dependencies
- Evaluate a write without making it, filter a saved query by what the rules would permit, and sort any enum by its declared order #3559 (the dry run and
permittedfilter; closed)
Related Issues
- Add a reject/validation action type so an invariant Play can veto a write, not just augment it #2642 (reject action for invariant Plays; closed)
- Wire RuleClass::Invariant rules into the write path so they actually run synchronously, in-transaction #2643 (in-transaction invariant rules; closed)
Non-Goals
- Covering shell commands that write files
- Any rule logic in the harness hook
- A new trigger kind for action attempts
Activity
malibio commentedon Oct 10, 2026
Frontend baseline: 5873 passed (324 files)
Address review: reword the deny text, read one --path argument, test …
malibio commentedon Oct 11, 2026
Closing as deprecated. The harness-facing gate command is not being built: enforcement is the claim write itself (the seeded invariant refuses moving a task to in_progress without an approved spec), and the version check tells a session its task changed. Related: #3711 and #3712 depend on this and need revisiting.