feat(harness): make the confirm gate's gated-tool set injectable - #1714
Merged
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
createConfirmGatehardcodedMUTATING_DB_TOOLSas the set of tool calls that need a human decision, making the policy a property of the harness rather than of the host. A remote coding host (constructive-planning#1633: pi in a Kubernetes Job against a cloned repo) wants to gatebash/force-push and auto-approve reads instead.The set is now one more injected dependency in the existing
ConfirmGateDepsbag, defaulting toMUTATING_DB_TOOLS:agentic/pi's adapter forwards an optionalgatedToolsstraight through, so a pi-based host can carry its own policy without reaching into the harness.Shape:
ReadonlySet<string>, not a predicate. Every current caller wants a set, a set is data (so a persona can carry it as JSON and it can be diffed/logged/sent over the wire), and it stays interchangeable with the exported default. A predicate is only more expressive for per-argument gating, which no caller needs today — and the gate already special-cases arguments internally (manage_entity_typesaction: 'list', tokenlessadd_records/create_api_key), so a predicate would create two competing places to express the same rule.ReadonlySetrather thanSetso the default constant can't be mutated by the gate. Widening to a predicate later is a superset of this signature and stays backwards-compatible.MUTATING_DB_TOOLSstays exported and is still the default, so Desktop/CLI behaviour is unchanged.Call sites verified unchanged (none pass
gatedTools)agentic/pi/src/confirm-gate.ts— only harness consumer ofcreateConfirmGate; now forwardsdeps.gatedTools(undefinedfor all existing callers → default).agentic/pi/src/index.ts— wires the real resolvers, nogatedTools.agentic/pi/__tests__/confirm-gate.test.ts— passes.agentic/harness/__tests__/gating.test.ts— all pre-existing cases pass untouched.MUTATING_DB_TOOLS,createConfirmGate, orConfirmGateDepsexists in the monorepo (agentic/clionly imports the harness's skills/dirs helpers; the desktop host is not vendored here — it consumes@agentic-kit/harnessvia the pi adapter).Tests
Added to
agentic/harness/__tests__/gating.test.ts: the whole default set is still gated when nothing is injected; withgatedTools: new Set(['bash']),bashis gated (a tool the default never gates) anddelete_tablestops being gated; the decline guard and the headless "no confirmation UI" block apply to injected tools too; an empty set gates nothing.Incidental unblock: three expired release-age waivers removed
The
buildjob failed onpnpm run policy:checkbefore running any tests, identically onmain: the@playwright/test@1.62.1,@types/react@19.2.18and@types/react-dom@19.2.4waivers inpnpm-policy.yamlcarrieduntil: 2026-08-13, i.e. today. Per the comment block aboveexceptions:,untilis the day the pinned version turns two weeks old — so those waivers are now obsolete, not in need of extension. They are deleted, andpnpm-workspace.yaml's derivedminimumReleaseAgeExcludeblock and header count are regenerated withnpx pnpm-policy generate(not hand-edited). The pinned versions now clear the 2-dayminimumReleaseAgeon their own:policy:checkreportspnpm-workspace.yaml matches the policyandpnpm install --frozen-lockfilestill resolves. No control was weakened — the exempt set shrank.Link to Devin session: https://app.devin.ai/sessions/d57afe90832a4d7197b9b41ff4ca4f43
Requested by: @pyramation