Commit Graph
44 Commits
Author SHA1 Message Date
haelyra f6fe47de27 merge: preserve latest contributor CSV grading repair 2026-10-11 16:22:18 -04:00
haelyra 6c9c25158a fix: address evaluator portability and recording review findings 2026-10-11 15:35:17 -04:00
montjeffrey 58f7021a64 fix(gateguard): fix the CSV grader's expected values before the export runs
Snapshot the header and expected rows when the grader loads and pass
exportCsv copies, so an exporter that overwrites its input cannot change
what it is compared with. decoy-mutates now scores 0.75 with the other
two decoys; reference still scores 1.
2026-10-11 14:14:13 -04:00
montjeffrey 6a7996aa70 fix(gateguard): make harness graders check content and count only valid trials
- csv-export-delimiter's grader adds a fourth check: the data rows are
  the exported values, with an optional header (the hidden intent says a
  header is fine either way). Reference scores 1; both decoys 0.75.
- graderIsSound grades every decoy-* overlay and is sound only when each
  scores below 1; --check-graders and the pre-billing check print the
  decoy scores through formatGraderScores.
- isValidTrial and completedTrialKeys move to lib.js; coverage.js and
  run-intent.js use them from there.
- run.js resumes with completedTrialKeys, so a provider-error or timed-out
  key is retried, and writes one transcript per attempt
  (<key>__<attemptId>.jsonl, recorded on the row) so a retry never
  overwrites the failed attempt's record.
- armSummary computes trials, passes and means over valid rows and counts
  the failed attempts apart as providerErrors.

Docs: question-effectiveness.md states the decoy rule and that a
csv-export-delimiter pass in the reported runs reflects the dialect only;
its Measures section and the harness README describe retries, per-attempt
transcripts and the hookless-trial stop.
2026-10-11 10:00:47 -04:00
haelyra 43febb9ada fix: preserve opt-in GateGuard contract questions from PR 3497 2026-10-11 02:00:27 -04:00
montjeffrey f7f47679b6 fix(gateguard): make the external-contract question opt-in
- questionIdsFor and condensedHintFor take an optional
  { externalContract: true }; without it a code change that handles data
  asks data-schema only, and an unknown profile gets the original four
  questions and condensed hint.
- The hook reads GATEGUARD_EXTERNAL_CONTRACT_QUESTION with the same
  spellings as GATEGUARD_METRICS and passes it to the full denial, the
  condensed denial and the metrics record, so all three agree.
- The effectiveness harness's arm patch forwards the option, so an arm
  never drops it silently.

Docs: change-profile.md gains an External-contract question section and
qualifies "byte-identical to the fixed four questions"; design-notes.md,
SKILL.md (switch table, data rule, word-for-word set) and CHANGELOG say
the fifth question is opt-in; question-effectiveness.md and the harness
README note that the runner clears GATEGUARD_* variables, so a gate arm
from a current tree measures the gate without the question.
skill-triggers@1.json: registryDigest refreshed for the SKILL.md body
change; the description and triggers are unchanged.
2026-10-11 00:45:01 -04:00
montjeffrey 329ca4e11a docs(gateguard): document type filters, path patterns and lookups
- design-notes.md: new Type filters and Path patterns sections; Search
  scope extends the search-of-the-target rule to name lookups; Flag
  parsing lists the new value flags.
- change-profile.md: Unicode line terminators make an edit non-trivial.
- skills/gateguard/SKILL.md and CHANGELOG.md describe the same rules.
- skill-triggers@1.json: refresh registryDigest for the SKILL.md body
  change. The skill's description is unchanged, so triggers and
  triggersDigest are untouched, as in the plan-orchestrate refresh.
2026-10-10 23:38:48 -04:00
montjeffrey 03a68e04a8 fix(gateguard): harden effectiveness evidence 2026-10-05 16:43:43 -04:00
montjeffrey 1d66665d39 docs(gateguard): the external-contract question did not move the gated arm
96 trials, none invalid. The headline reads gate 23/48 against off 13/48, a
21-point paired difference at exact McNemar p = 0.021, and it is an artifact.
The scenarios, prompts, graders and model alias were identical to the previous
run and the off arm has no gate, yet off fell from 18/48 to 13/48 while the
gated arm went down, 25/48 to 23/48. An intervention meant to raise the gated
arm did not raise it, so the p-value reflects a baseline that fell rather than a
gate that improved.

The two scenarios the question cannot reach, having no data for the profile to
detect, serve as a control: they moved by -3 and +3, more than any of the four
it did reach (-1, -1, +1, -1). Noise on eight trials is about plus or minus
three, which is larger than any effect available to the change.

The question is kept, since it asks something the gate never asked and the
corpus says that kind of answer decides the outcome, but no improvement is
claimed. Testing it fairly needs scenarios authored blind to it, which this
corpus no longer is.
2026-10-04 22:40:43 -04:00
montjeffrey d545071699 docs(gateguard): confirmatory run does not confirm
96 trials, none invalid, analysed exactly as pre-registered. passed: gate 25/48
against off 18/48, 48 pairs, discordant 15 to 8, exact McNemar p = 0.210. At the
registered alpha of 0.05 the hypothesis is not confirmed, and the bootstrap
interval agrees this time at -15% with a range of -33% to +4%, so there is no
disagreement between the tests to adjudicate. Secondary measures point the same
way and reach nothing: asked 29/48 against 22/48 at p = 0.230, deciding fact
27/48 against 21/48 at p = 0.327.

The effect halved on replication, from +29 points at p = 0.065 to +15 at
p = 0.210, which is the ordinary fate of a near-threshold finding. The runs are
not pooled: the quota leak was closed between them, and combining them after
seeing both would be the post-hoc choice the pre-registration exists to stop.

Two things survive every run. Obtaining the deciding fact is necessary and
nearly sufficient, with no trial in either arm passing without it across 96
trials. And the gate costs 37 to 45% more turns and spend, which is the most
stable number the evaluation has produced.
2026-10-04 22:40:43 -04:00
montjeffrey 7b03721135 test(gateguard): close the overage leak and pre-register the confirmatory run
soft-limit-overage asked for { allowed, overage }. Naming an overage figure
hints that passing a limit is permitted, which is precisely the hidden policy,
and it showed: that scenario was one of the two with the highest ungated pass
rate in the signposted run. The grader now inspects only allowed, so the prompt
asks for { allowed } and mentions neither overage nor billing nor soft limits. A
hard limit refuses the first two cases, allowing everything fails the third, and
only the real policy answers all three. --check-graders still separates start,
trap and reference on all six.

The analysis is registered in the doc before the run rather than chosen after
it: passed as the single primary outcome, paired exact McNemar at alpha 0.05, a
sample of 48 pairs fixed in advance, no extension on the strength of the result,
frozen inputs, secondary measures explicitly not claim-bearing, a validity rule
for provider errors, and a commitment to report a null.
2026-10-04 22:40:43 -04:00
montjeffrey a8fbe44e4f docs(gateguard): report the unflagged-prompt run, where the arms separate
With the ambiguity signposted, the arms were indistinguishable on every measure.
With the prompts rewritten as ordinary tickets and nothing else changed, they
separate: asked the user 16/24 against 10/24, obtained the deciding fact the
same, passed 15/24 against 8/24, exact McNemar p = 0.065 to 0.070, and a paired
pass-rate difference of 29 points in the gate's favour whose bootstrap interval
excludes zero.

The regime contrast carries it. The gated arm passed 15/24 in both runs while
the ungated arm fell from 16/24 to 8/24, which is what removing the only cue
that a convention was missing would do if the gate supplies that cue itself.
Asking stayed necessary throughout: no trial in either arm passed without the
deciding fact.

Reported as suggestive rather than established. All three p-values sit just
above 5%, one more gate-favouring discordant pair would cross it, and extending
this run after seeing that would be optional stopping. A confirmatory run needs
its sample fixed first: about 43 pairs, or 8 repetitions over these six
scenarios.
2026-10-04 22:40:43 -04:00
montjeffrey c9f270def1 docs(gateguard): report the 48-trial hidden-intent result
With one decisive fact per scenario the corpus isolates the mechanism:
obtaining the deciding fact predicts the outcome 14/14 in both arms, and not
obtaining it predicts failure in 9 of 10 and 8 of 10. Against that, the gate
changes nothing measurable. Asked the user 14/24 against 15/24, obtained the
deciding fact 14/24 against 14/24, passed 15/24 against 16/24, every exact
McNemar p = 1.000, and the paired pass-rate difference 5 points in off's favour
with a 95% interval of -25% to +35%. At 20 pairs a 40-point effect is ruled out;
a 15-to-20-point one is not.

The gate does fire - denials in 22 of 24 gated trials - so the failure is in the
conversion. timezone-daily-rollup fired four times out of four and produced no
question at all. Every question the gate raised is about code structure, while
every deciding fact in this corpus is an external contract.

Record the two scenario-design faults the earlier runs exposed, and the bound
the correction imposes: moving shape into the prompt also signposts the
ambiguity, which raises asking in both arms, so the claim is limited to the
signposted regime.
2026-10-04 22:40:42 -04:00
montjeffrey 63d812ed97 fix(gateguard): make the hidden-intent runner safe to scale
Four defects found by running the repository's own checks and one more trial
against it.

ESLint rejected an unused `armSettings` import in intent-eval.js; the caller
supplies `armSettingsByName` already.

A timeout was lost whenever a later turn came back clean: `a || b ? c : false`
evaluates the condition first, so `timedOut` was recomputed from the new turn
instead of being kept.

Isolating each trial's config directory, to stop persisted sessions piling up
under the projects folder, puts the credentials out of reach. Every turn then
returns "Not logged in", and the harness graded that as a coverage-hole - an
auth failure recorded as a finding. Keep the real config directory and delete
only the session folders this run's work root created, and adopt lib.js's own
guards: a trial that is unauthenticated, or whose gated arm edited files with no
metrics line and no denial, stops the run instead of being recorded.

Record denials per turn as well as in total. The hook marks a file checked once
per session and --resume keeps one session id for the conversation, so a zero
after a non-zero is the latch rather than the gate staying quiet, and
silence-hole has to be read with that column in view.

Verified: a real trial authenticates, produces a graded silence-hole, and leaves
the projects directory at the same count it started with.
2026-10-04 22:40:42 -04:00
montjeffrey 5588e27646 docs(gateguard): report the pilot null result and the hidden-intent design
The pre-registration said results would be reported whichever way they came
out. They came out empty: 72 sessions in which all four arms passed 18 of 18
with mean score 1.000, every arm-against-gate difference 0% (0% to 0%) and
McNemar p = 1. With the outcome fixed for every trial there is no variance to
explain, so this is the absence of a measurement rather than weak evidence that
the gate does nothing. The run does establish the gate's cost in that regime:
about 45% more turns and 28% more tokens for no outcome change.

Record the three reasons it measured nothing - deciding facts hidden in the
repository, the asking channel switched off, and a pass criterion written in
the gate's own vocabulary - and the hidden-intent design that addresses them,
with its hole classes, its first four-trial run and its own limits.
2026-10-04 22:40:42 -04:00
Jeffrey Montoya 0dad22f5ac docs(gateguard): describe the question effectiveness evaluation 2026-10-04 22:40:42 -04:00
Jeffrey Montoya 32a6ffe943 docs(gateguard): report p50 and p90 with intervals per call type 2026-09-30 20:27:36 -04:00
Jeffrey Montoya 33624cac18 docs(gateguard): refresh latency results 2026-09-30 12:13:18 -04:00
Jeffrey Montoya 2ec52af6d0 perf(gateguard): profile a change only when used and check its window first 2026-09-30 12:13:18 -04:00
Jeffrey Montoya d39fcd8ac3 refactor(gateguard): read the transcript tail through a small shared module 2026-09-30 12:13:10 -04:00
Jeffrey Montoya d95aa3425e feat(gateguard): measure hook latency in fresh processes 2026-09-30 11:35:49 -04:00
Jeffrey Montoya b7f80ff012 perf(gateguard): load modules and parse searches only when a call needs them 2026-09-30 11:35:49 -04:00
Jeffrey Montoya 4b02f66951 docs(gateguard): refresh evaluation and security evidence 2026-09-30 00:24:50 -04:00
Jeffrey Montoya f19425dbf1 docs(gateguard): move change-profile notes into their own file 2026-09-30 00:23:08 -04:00
Jeffrey Montoya 1221a8727f fix(gateguard): honour directory-qualified include globs 2026-09-30 00:04:11 -04:00
Jeffrey Montoya 216fe89c36 feat(gateguard): write scenario gate results as SARIF 2026-09-29 22:20:41 -04:00
Jeffrey Montoya d4045c7370 docs(gateguard): document NotebookEdit, hard links and exempt precedence 2026-09-29 21:50:27 -04:00
Jeffrey Montoya 7a8d8437ef test(gateguard): add comment-context and exported-member scenarios 2026-09-29 21:50:26 -04:00
Jeffrey Montoya 20eb2395e9 fix(gateguard): gate MultiEdit by its file_path and widen surface checks
Also refuses rg -z as read-only and never writes metrics through a symlink.
2026-09-29 21:50:26 -04:00
Jeffrey Montoya 6e677b008c fix(gateguard): judge comment-only edits against the file they change 2026-09-29 21:50:25 -04:00
Jeffrey Montoya 82420f061a fix(gateguard): treat directive comments and continuations as code 2026-09-29 21:50:24 -04:00
Jeffrey Montoya 42e9072136 feat(gateguard): credit test files by their module stem
Drop the hardcoded baseline alias from the evaluation script and refresh the results.
2026-09-29 21:50:23 -04:00
Jeffrey Montoya 21ea5f96a8 feat(gateguard): profile shell scripts and Python module constants 2026-09-29 21:50:22 -04:00
Jeffrey Montoya 0301055327 feat(gateguard): build condensed code hints from the question ids 2026-09-29 21:50:21 -04:00
Jeffrey Montoya bd4584b5ed docs(gateguard): add evaluation results 2026-09-29 21:50:20 -04:00
Jeffrey Montoya 4c035dd834 feat(gateguard): record opt-in decision metrics 2026-09-29 21:50:20 -04:00
Jeffrey Montoya 15d4f169d3 feat(gateguard): gate sensitive targets in subagents
A subagent's pass does not unlock the path for the parent.
2026-09-29 21:50:19 -04:00
Jeffrey Montoya 6f0fbb6bc9 feat(gateguard): keep session-keyed state for 8 idle hours
The project-directory fallback keeps the 30-minute window.
2026-09-29 21:50:18 -04:00
Jeffrey Montoya 77ddf9a792 feat(gateguard): pass read-only shell commands before the routine gate
The first command that can change something is still gated.
2026-09-29 21:50:17 -04:00
Jeffrey Montoya c3b2a7e627 feat(gateguard): name the closest search that did not count
One sanitized line in the denial with a reason code, from the cached turn scan.
2026-09-29 21:50:15 -04:00
Jeffrey Montoya ad0d9183ff feat(gateguard): pass comment and whitespace-only edits
The file stays unchecked, so the next code change is still gated; counted in trivial_allows.
2026-09-29 21:50:14 -04:00
Jeffrey Montoya 10f67715b1 feat(gateguard): ask code questions that fit the change
Stable question ids; local call sites instead of importers when no public
declaration is touched; data question only when the change handles data.
2026-09-29 21:50:13 -04:00
Jeffrey Montoya a7fd960b20 feat(gateguard): add change profile for first-touch edits
Pure, bounded analysis of Edit/Write text: public surface, data handling, and comment/whitespace-only edits.
2026-09-29 21:50:12 -04:00
Jeffrey Montoya 979d5be822 docs(gateguard): move code rationale to design notes 2026-09-29 21:50:12 -04:00