You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(guardrails): allow the one-way shared exception directory in the identity-domain guard #9745
A configured shared exception directory is readable and writable from the named other domain, only when
every foreign path in the command is inside it and the command has no ..; the exception is one-directional
(rule 3).
The domain map is derived from /harness-ops:machine-profile and is machine-local: it never sits in a tracked
file, fixture or doc. Placeholders only.
Fail open on any internal error; every exit is 0 with the decision in stdout JSON.
The guard reads command text: a deterrent, not a sandbox. Declared gaps: computed paths, scripts run by name.
Key interfaces
plugins/guardrails/hooks/block-cross-domain.sh and plugins/guardrails/hooks/block-cross-domain.test.sh, the Bash|PowerShell row of plugins/guardrails/hooks/hooks.json, plugins/guardrails/README.md, docs/conventions/hook-precision, docs/conventions/hook-budget.
Done when
scripts/run-test-file.sh plugins/guardrails/hooks/block-cross-domain.test.sh exits 0 with cases: allowed inside the exception from the named domain; denied from the opposite direction; denied with ..; denied when one foreign path is outside it; in Windows, MSYS and WSL spellings.
Not admitted to the issue lane: it carries host-run. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).
The work-resolve-issue lane did not start this issue: it needs a person to make it clearer first.
Reason: intent
Why, in the run's own words:
Which shape should a shared exception take in the identity-domain map, and what does it allow? The shipped map (#9743, written by /guardrails:setup apply identity-domains --shared-exception PATH from #9749) holds shared_exceptions as a plain list of paths that names no domain. This issue asks for a directory that is reachable from "the named other domain" and is one-directional, with a test that it is "denied from the opposite direction". A bare path names no domain, and once the directory sits inside one domain's tree there is no opposite direction left to test. The parent epic #5945 sketches shared_exceptions: \[{path: <dir>, from: \[<domain>\], to: <domain>}\] but says the exact keys are a design decision, and neither it nor this issue answers these questions: (1) Keep the string list and work out the domains (for example, the directory belongs to the domain whose path holds it and every other domain may reach it), or switch to objects that name the domains? A switch also changes the map validator, the setup script's --shared-exception flag and its tests, the setup SKILL.md and the README. (2) With named domains, must the path sit inside the to domain's paths, or may it be neutral or in another domain? (3) What is the opposite direction the test must deny: a session in to naming the directory, a session in to naming a from domain's path, or a session in a domain that from does not list? (4) Should a string entry left in an existing map count as malformed or be read some other way? Please record a decision (a Decision recorded. comment) that answers these, and the lane will build it.
What the run says it did not do:
No code, tests, README or changelog fragment were written. The issue was pushed back before the first edit because the map shape and the one-directional meaning are still undecided.
Tidy, review, verify and the PR-prep steps did not run, because nothing changed.
Decided under the owner's standing direction from epic #5945 rule 3 and its sketch shared_exceptions: [{path: <dir>, from: [<domain>], to: <domain>}]. This answers #9745 (comment):
Entries become objects that name the domains, as the sketch shows. The map validator, the setup script's --shared-exception flag and its tests, the setup SKILL.md and the README change with them.
path must lie inside the to domain's paths. Any other entry is invalid.
Opposite direction: a session in to that names a path of a from domain stays denied, and so does a session in a domain not listed in from that names the exception path.
A string entry left in an existing map grants nothing. The once-per-session notice names it and says to re-run setup. It does not make the map malformed, because that turns the whole guard off (README, block-cross-domain row).
scripts/run-test-file.sh plugins/guardrails/hooks/block-cross-domain.test.sh exits 0 with these cases: allowed inside the exception from a from domain; denied from to naming a from path; denied from an unlisted domain; denied with ..; denied when one foreign path is outside it; denied when the path is not inside to; a string entry grants nothing. Each case runs in Windows, MSYS and WSL spellings.
git grep -nE "melodic|kyle|sexton" -- plugins/guardrails/hooks/block-cross-domain.sh plugins/guardrails/hooks/block-cross-domain.test.sh prints nothing.
The PR reports the Bash|PowerShell row's added time, measured as docs/conventions/hook-budget describes. If the lane cannot measure it, the PR lists the item under "Remaining work" for a host run.
Decision recorded.#11347 delivered the one-way shared-exception entries, their validation and their tests. Its body lists one item under "Remaining work": measuring the Bash|PowerShell row's added time. The recorded decision sends that to a host run when the lane cannot measure it, and it is the only criterion left. Agents decided this on evidence under standing direction §1.
Done when
On a host, the guardrails hooks.json Bash|PowerShell row's added time with a shared-exception entry in the map is measured as docs/conventions/hook-budget describes. The figure is reported in a Probe result: comment here and is inside that convention's budget for the row.
Host run. Timed the guardrails hooks.jsonBash|PowerShell row with and without a shared-exception entry in the identity-domain map, and counted its processes under strace.
Probe result: a shared-exception entry adds no process and no time that can be told apart from noise. The added time per fire ranged from −0.70 to +0.42 ms across five runs, which is −0.66 to +0.39 S. That is inside the hook-budget contract's realistic budget for the row: k × S plus measured work that does not grow with the session.
What ran
Host and versions: WSL2 Linux on 24 cores, load average 1 to 3. Claude Code 2.1.314, Node 24.21.0, bash 5.3.9. Plugins at main98ca8d0312.
Each fire ran the row exactly as hooks.json registers it: node exec-bash.mjs --fail-closed --require-verdict run-guards.sh … with all 12 guards.
Each fire was timed with EPOCHREALTIME. A bash -c : spawn floor S was interleaved with every sample.
The arm order rotated from sample to sample.
Before timing, each map was fired once, so its cache was compiled and its once-per-session notices were already shown.
Map and payloads: the throwaway map had two domains, alpha and beta. The cwd was inside alpha, and the benign payload was git status --short.
Arms:
no map;
the map with no shared_exceptions;
the same map plus one entry, {path: <beta>/shared, from: ["alpha"], to: "beta"};
under that map, a command naming the exception path (ls <beta>/shared/notes);
under that map, a control command of the same shape that names an alpha path.
Runs: five runs of 30 samples for the first four arms, then five more runs of 30 samples with the control arm. All 300 fires exited 0.
Verdicts: on the full row, the plain map denies the exception-path command. With the entry added, the row allows both that command and the benign one.
Results (ms; S = same-run bash -c :, median 1.10 ms, pooled range 0.88 to 2.29 ms)
Comparison (paired per sample)
Per-run medians, runs 1 to 5
Range across runs
Map with the entry − map without, benign payload
−0.04, −0.70, +0.42, −0.05, +0.12
−0.70 to +0.42 ms (−0.66 to +0.39 S)
Command naming the exception path − same-shape command naming an alpha path
−0.82, −0.12, −0.90, +0.61, −0.06
−0.90 to +0.61 ms (−0.82 to +0.57 S)
Map without the entry − no map, benign payload
+3.91, +4.66, +3.03, +3.29, +4.52
+3.0 to +4.7 ms (2.8 to 4.3 S)
Pooled over n=150 fires per arm, the benign payload's median, with the minimum and maximum in brackets:
no map: 47.59 ms (41.90 to 63.33);
map without the entry: 51.27 ms (45.15 to 69.47);
map with the entry: 51.53 ms (45.95 to 61.96).
Within each arm, the 10th-to-90th-percentile spread is about 6 to 8 ms. That is wider than every exception delta above.
The ls <path> commands run about 4 to 7 ms slower than git status whether or not the path is the exception's. That gap comes from the shape of the command, not from the exception.
Process count
strace -f counted three repeats of each arm on a warm map: the plain map with the benign payload, the map with the entry and the benign payload, and the map with the entry and the exception-path command. Every fire had 7 process creations, which include node's own threads, and 2 execve: node, then bash. That is the bash-scripted launcher row's floor of k = 2. The entry adds 0 to k.
Compiling the map runs jq and mv. That happens once each time the map's bytes change, not on every call. The existing strace pins in plugins/guardrails/hooks/block-cross-domain.test.sh already cover it.
Budget reading
The entry adds 0 to k, and on this host it adds no measurable work. That puts it within the realistic budget.
The row as a whole is still above its ideal of k × S = 2 S. On this host it runs at about 43 to 47 S, mostly node startup. That gap predates this change. Under Rule 2 it is the guardrails spawn-reduction work in perf(guardrails): Edit/Write guards spawn 25-87 processes per fire #4390, and it is not grounds to raise the ceiling.
Host caveat. These figures come from WSL2 Linux by direct invocation, not from the Windows fan-out harness behind the contract's reference figures. On this host S is about 1.1 ms. Bash builtin work does not scale with S, so a Linux S multiple does not predict the Windows cost. The one result that holds across hosts is that the entry adds no process.
Closing as completed. #11347 merged as 7d34814 with the one-way shared-exception entries and tests. The last criterion (2026-10-31 decision) is met by the 2026-10-31 host-run Probe result: the entry adds 0 processes and -0.66 to +0.39 S, inside the hook-budget row budget. Measured on WSL2, not the Windows harness; only the process count carries across hosts.
Activity
melodic-automation-lanes commentedon Oct 24, 2026
Not admitted to the issue lane: it carries host-run. Admission takes the issue once each of those is met, when intake triages it again (
.github/actions/resolve-config/admission-rules.json).melodic-automation-lanes commentedon Oct 30, 2026
The work-resolve-issue lane did not start this issue: it needs a person to make it clearer first.
Reason:
intentWhy, in the run's own words:
What the run says it did not do:
Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41010121618
To retry, answer the question in a comment whose first line is
**Decision recorded.**, then removeneeds-humanand addagent-readyagain.kyle-sexton commentedon Oct 30, 2026
Decision recorded.
Decided under the owner's standing direction from epic #5945 rule 3 and its sketch
shared_exceptions: [{path: <dir>, from: [<domain>], to: <domain>}]. This answers #9745 (comment):--shared-exceptionflag and its tests, the setup SKILL.md and the README change with them.pathmust lie inside thetodomain's paths. Any other entry is invalid.tothat names a path of afromdomain stays denied, and so does a session in a domain not listed infromthat names the exception path.scripts/run-test-file.sh plugins/guardrails/hooks/block-cross-domain.test.shexits 0 with these cases: allowed inside the exception from afromdomain; denied fromtonaming afrompath; denied from an unlisted domain; denied with..; denied when one foreign path is outside it; denied when the path is not insideto; a string entry grants nothing. Each case runs in Windows, MSYS and WSL spellings.git grep -nE "melodic|kyle|sexton" -- plugins/guardrails/hooks/block-cross-domain.sh plugins/guardrails/hooks/block-cross-domain.test.shprints nothing.scripts/run-test-file.sh plugins/guardrails/hooks/run-guards.test.shexits 0, including the guardrails: Bash|PowerShell PreToolUse row takes 30+s on a ~70 KB command; its 60s timeout fails open #4528 long-command ceiling case.docs/conventions/hook-budgetdescribes. If the lane cannot measure it, the PR lists the item under "Remaining work" for a host run.scripts/check-changelog-fragments.sh --check-required origin/mainexits 0.19 remaining items
melodic-automation-lanes commentedon Oct 31, 2026
The latest triage verdict holds nothing: admission moved the issue to
status: confirmed; its comment says why.kyle-sexton commentedon Oct 31, 2026
Decision recorded. #11347 delivered the one-way shared-exception entries, their validation and their tests. Its body lists one item under "Remaining work": measuring the Bash|PowerShell row's added time. The recorded decision sends that to a host run when the lane cannot measure it, and it is the only criterion left. Agents decided this on evidence under standing direction §1.
Done when
hooks.jsonBash|PowerShell row's added time with a shared-exception entry in the map is measured asdocs/conventions/hook-budgetdescribes. The figure is reported in aProbe result:comment here and is inside that convention's budget for the row.kyle-sexton commentedon Oct 31, 2026
Host run. Timed the guardrails
hooks.jsonBash|PowerShellrow with and without a shared-exception entry in the identity-domain map, and counted its processes under strace.Probe result: a shared-exception entry adds no process and no time that can be told apart from noise. The added time per fire ranged from −0.70 to +0.42 ms across five runs, which is −0.66 to +0.39 S. That is inside the hook-budget contract's realistic budget for the row: k × S plus measured work that does not grow with the session.
What ran
main98ca8d0312.hooks.jsonregisters it:node exec-bash.mjs --fail-closed --require-verdict run-guards.sh …with all 12 guards.EPOCHREALTIME. Abash -c :spawn floor S was interleaved with every sample.alphaandbeta. The cwd was insidealpha, and the benign payload wasgit status --short.shared_exceptions;{path: <beta>/shared, from: ["alpha"], to: "beta"};ls <beta>/shared/notes);alphapath.Results (ms; S = same-run
bash -c :, median 1.10 ms, pooled range 0.88 to 2.29 ms)alphapathPooled over n=150 fires per arm, the benign payload's median, with the minimum and maximum in brackets:
Within each arm, the 10th-to-90th-percentile spread is about 6 to 8 ms. That is wider than every exception delta above.
The
ls <path>commands run about 4 to 7 ms slower thangit statuswhether or not the path is the exception's. That gap comes from the shape of the command, not from the exception.Process count
strace -fcounted three repeats of each arm on a warm map: the plain map with the benign payload, the map with the entry and the benign payload, and the map with the entry and the exception-path command. Every fire had 7 process creations, which include node's own threads, and 2 execve: node, then bash. That is the bash-scripted launcher row's floor of k = 2. The entry adds 0 to k.Compiling the map runs jq and mv. That happens once each time the map's bytes change, not on every call. The existing strace pins in
plugins/guardrails/hooks/block-cross-domain.test.shalready cover it.Budget reading
Host caveat. These figures come from WSL2 Linux by direct invocation, not from the Windows fan-out harness behind the contract's reference figures. On this host S is about 1.1 ms. Bash builtin work does not scale with S, so a Linux S multiple does not predict the Windows cost. The one result that holds across hosts is that the entry adds no process.
No code change, so no PR.
Target labels: add none; remove host-run.
kyle-sexton commentedon Nov 1, 2026
Closing as completed. #11347 merged as 7d34814 with the one-way shared-exception entries and tests. The last criterion (2026-10-31 decision) is met by the 2026-10-31 host-run Probe result: the entry adds 0 processes and -0.66 to +0.39 S, inside the hook-budget row budget. Measured on WSL2, not the Windows harness; only the process count carries across hosts.