@event4u/agent-config 9.25.0 → 9.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +87 -0
- package/README.md +1 -1
- package/dist/agent-src/commands/analyze/conformance.md +2 -2
- package/dist/agent-src/commands/review/changes.md +6 -5
- package/dist/agent-src/commands/roadmap/next.md +194 -0
- package/dist/agent-src/commands/roadmap.md +12 -4
- package/dist/agent-src/contexts/execution/subagent-routing.md +4 -1
- package/dist/agent-src/rules/delegation-policy.md +3 -2
- package/dist/agent-src/rules/design-fidelity.md +17 -1
- package/dist/agent-src/rules/design-review-after-ui-write.md +116 -0
- package/dist/agent-src/rules/evaluator-independence.md +9 -3
- package/dist/agent-src/rules/session-canary.md +2 -0
- package/dist/agent-src/rules/settings-ask-protocol.md +176 -0
- package/dist/agent-src/rules/token-budget-discipline.md +6 -3
- package/dist/agent-src/rules/ui-audit-gate.md +3 -0
- package/dist/agent-src/rules/user-interaction.md +3 -2
- package/dist/agent-src/skills/recursive-verification/SKILL.md +13 -0
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/cli-delegate/cmd_route_audit.js +4 -1
- package/dist/cli-delegate/cmd_route_explain.js +4 -1
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +94 -23
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +4 -4
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +11 -8
- package/dist/discovery/trust-report.md +3 -3
- package/dist/discovery/workspaces.json +9 -6
- package/dist/hooks/dispatch.js +355 -63
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/router.json +1 -1
- package/dist/server/nicknameResolver.js +116 -0
- package/dist/server/nicknameResolver.js.map +1 -0
- package/dist/server/routes/ping.js +29 -11
- package/dist/server/routes/ping.js.map +1 -1
- package/dist/shared/interactiveContext.js +73 -0
- package/dist/shared/interactiveContext.js.map +1 -0
- package/dist/shared/nicknamePrefill.js +59 -0
- package/dist/shared/nicknamePrefill.js.map +1 -0
- package/dist/shared/settingsAsks.js +128 -0
- package/dist/shared/settingsAsks.js.map +1 -0
- package/dist/shared/settingsConsent.js +93 -0
- package/dist/shared/settingsConsent.js.map +1 -0
- package/package.json +1 -1
- package/src/config/agents-paths.yml +15 -0
- package/src/config/gate-coverage.yml +29 -1
- package/src/config/gate-violation-baselines.json +13 -7
- package/src/scripts/_cli/cmd_route_audit.ts +4 -1
- package/src/scripts/_cli/cmd_route_explain.ts +9 -1
- package/src/scripts/ai-video/stitch.sh +27 -9
- package/src/scripts/before_complete_hook.ts +23 -4
- package/src/scripts/bench_ab_v2_run.ts +272 -16
- package/src/scripts/bench_ab_v2_stats.ts +156 -3
- package/src/scripts/check_completion_review.ts +80 -3
- package/src/scripts/check_corpus_staleness.ts +692 -0
- package/src/scripts/check_gate_coverage.ts +67 -0
- package/src/scripts/check_hook_bundle_freshness.ts +183 -0
- package/src/scripts/conformance_scan.ts +47 -17
- package/src/scripts/dispatch_r2_reviewer.ts +31 -2
- package/src/scripts/git_authorization_hook.ts +75 -10
- package/src/scripts/hook_manifest.yaml +19 -0
- package/src/scripts/hooks/block_no_verify.ts +3 -1
- package/src/scripts/hooks/block_unauthorized_git.ts +133 -16
- package/src/scripts/hooks/design_slop_hook.ts +13 -1
- package/src/scripts/hooks/dispatch_hook.ts +97 -2
- package/src/scripts/hooks/evidence_independence.ts +40 -6
- package/src/scripts/language_mirror_hook.ts +200 -11
- package/src/scripts/lint_abstraction_thresholds.ts +41 -8
- package/src/scripts/lint_agents_layout.ts +2 -0
- package/src/scripts/lint_hook_manifest.ts +29 -0
- package/src/scripts/memory_learn_hook.ts +109 -6
- package/src/scripts/pr_url_reminder_hook.ts +17 -2
- package/src/scripts/release.ts +38 -1
- package/src/scripts/schemas/review-findings.schema.json +99 -0
- package/src/shared/interactiveContext.ts +98 -0
- package/src/shared/nicknamePrefill.ts +96 -0
- package/src/shared/settingsAsks.ts +176 -0
- package/src/shared/settingsConsent.ts +136 -0
|
@@ -79,6 +79,34 @@ export interface Marker {
|
|
|
79
79
|
/** Branch-head sha at review time. Provenance only, NEVER compared. */
|
|
80
80
|
diffSha: string;
|
|
81
81
|
reviewer: string;
|
|
82
|
+
/**
|
|
83
|
+
* OPTIONAL — the implementing session, so `author ≠ reviewer` becomes
|
|
84
|
+
* checkable instead of merely stated.
|
|
85
|
+
*
|
|
86
|
+
* The contract already says `reviewer:` is "never the implementing session"
|
|
87
|
+
* (§ 2.1), but with no `author` field there was nothing to compare it to, so
|
|
88
|
+
* the sentence was a convention with no enforcement behind it. Optional on
|
|
89
|
+
* purpose: every committed artefact under `agents/evidence/reviews/` carries
|
|
90
|
+
* the four-field v1 shape and § 2.7 forbids editing round records in place,
|
|
91
|
+
* so a REQUIRED field would have been a migration event for the whole
|
|
92
|
+
* evidence corpus. Absent → nothing to check, exactly as before.
|
|
93
|
+
*/
|
|
94
|
+
author?: string;
|
|
95
|
+
/**
|
|
96
|
+
* OPTIONAL — sha256 of the reviewer prompt the dispatcher built.
|
|
97
|
+
*
|
|
98
|
+
* Addresses the contract's own most dangerous residual (§ 5, "the prompt
|
|
99
|
+
* channel"): the dispatcher fixes the reviewer's *inputs* but not the
|
|
100
|
+
* *instructions* wrapped around them, so "a hash-verified artefact is not
|
|
101
|
+
* evidence of an unbiased review". Recording the prompt's hash makes the
|
|
102
|
+
* channel auditable — a steered prompt no longer leaves the artefact
|
|
103
|
+
* indistinguishable from an unsteered one.
|
|
104
|
+
*
|
|
105
|
+
* It does NOT close the residual, and this file does not claim it does: the
|
|
106
|
+
* hash is written by the same host that authors the prompt. What it buys is
|
|
107
|
+
* an attributable record instead of an absent one.
|
|
108
|
+
*/
|
|
109
|
+
promptHash?: string;
|
|
82
110
|
}
|
|
83
111
|
|
|
84
112
|
export interface HonestNull {
|
|
@@ -288,20 +316,52 @@ export function isCodePath(p: string): boolean {
|
|
|
288
316
|
return CODE_EXTENSIONS.has(base.slice(dot + 1));
|
|
289
317
|
}
|
|
290
318
|
|
|
319
|
+
/**
|
|
320
|
+
* The header grammar, with two OPTIONAL trailing fields.
|
|
321
|
+
*
|
|
322
|
+
* Field order stays fixed and the four v1 fields stay required, so every
|
|
323
|
+
* committed artefact parses unchanged — the extension is additive, not a version
|
|
324
|
+
* bump. `reviewer`'s capture already excludes `|`, which is what lets a further
|
|
325
|
+
* `| author: …` follow it without being swallowed.
|
|
326
|
+
*/
|
|
291
327
|
const MARKER_RE =
|
|
292
|
-
/^<!--\s*completion-review:\s*v1\s*\|\s*reviewed:\s*(\d{4}-\d{2}-\d{2})\s*\|\s*scope:\s*([0-9a-fA-F]{64})\s*\|\s*diff:\s*([0-9a-fA-F]{7,40})\s*\|\s*reviewer:\s*(\S(?:[^|>]*[^|>\s])?)\s*-->$/;
|
|
328
|
+
/^<!--\s*completion-review:\s*v1\s*\|\s*reviewed:\s*(\d{4}-\d{2}-\d{2})\s*\|\s*scope:\s*([0-9a-fA-F]{64})\s*\|\s*diff:\s*([0-9a-fA-F]{7,40})\s*\|\s*reviewer:\s*(\S(?:[^|>]*[^|>\s])?)(?:\s*\|\s*author:\s*(\S(?:[^|>]*[^|>\s])?))?(?:\s*\|\s*prompt_hash:\s*([0-9a-fA-F]{64}))?\s*-->$/;
|
|
293
329
|
|
|
294
330
|
export function parseMarkerLine(line: string): Marker | null {
|
|
295
331
|
const m = MARKER_RE.exec(line.trim());
|
|
296
332
|
if (!m) {
|
|
297
333
|
return null;
|
|
298
334
|
}
|
|
299
|
-
|
|
335
|
+
const marker: Marker = {
|
|
300
336
|
reviewed: m[1] as string,
|
|
301
337
|
scope: (m[2] as string).toLowerCase(),
|
|
302
338
|
diffSha: (m[3] as string).toLowerCase(),
|
|
303
339
|
reviewer: (m[4] as string).trim(),
|
|
304
340
|
};
|
|
341
|
+
if (m[5] !== undefined) {
|
|
342
|
+
marker.author = m[5].trim();
|
|
343
|
+
}
|
|
344
|
+
if (m[6] !== undefined) {
|
|
345
|
+
marker.promptHash = m[6].toLowerCase();
|
|
346
|
+
}
|
|
347
|
+
return marker;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* `author ≠ reviewer` — the check the field exists to make possible.
|
|
352
|
+
*
|
|
353
|
+
* Comparison is case-insensitive and whitespace-trimmed, because the ids are
|
|
354
|
+
* free-form strings a human or a dispatcher types, and `claude/host` vs
|
|
355
|
+
* `Claude/Host` is the same session by any reading. Deliberately NOT normalised
|
|
356
|
+
* further (no stripping of suffixes, no fuzzy match): a gate that guesses two
|
|
357
|
+
* different ids are "really" the same principal would start failing legitimate
|
|
358
|
+
* reviews, which is the failure direction that gets a gate ignored.
|
|
359
|
+
*/
|
|
360
|
+
export function authorIsReviewer(marker: Marker): boolean {
|
|
361
|
+
if (marker.author === undefined) {
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
return marker.author.trim().toLowerCase() === marker.reviewer.trim().toLowerCase();
|
|
305
365
|
}
|
|
306
366
|
|
|
307
367
|
const HONEST_NULL_RE = /^\*\*Honest-null:\*\* 0 findings, scope ([0-9a-fA-F]{64}), reviewed (\d{4}-\d{2}-\d{2})$/;
|
|
@@ -785,7 +845,24 @@ function evaluate(input: EvalInput): Violation[] {
|
|
|
785
845
|
detail:
|
|
786
846
|
'completion-review header marker malformed — expected ' +
|
|
787
847
|
'`<!-- completion-review: v1 | reviewed: YYYY-MM-DD | scope: <64-hex scope hash> | ' +
|
|
788
|
-
'diff: <sha> | reviewer: <id>
|
|
848
|
+
'diff: <sha> | reviewer: <id> -->`, optionally followed by ' +
|
|
849
|
+
'`| author: <id>` and `| prompt_hash: <64-hex>`',
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
// §2.1: `reviewer:` is "never the implementing session". With an
|
|
853
|
+
// `author:` present that sentence becomes checkable — a review the
|
|
854
|
+
// author performed on their own change is the self-review the whole
|
|
855
|
+
// two-gate design exists to prevent. Only fires when the field is
|
|
856
|
+
// there, so no committed v1 artefact is retroactively broken.
|
|
857
|
+
if (art.marker !== null && authorIsReviewer(art.marker)) {
|
|
858
|
+
violations.push({
|
|
859
|
+
kind: 'author-is-reviewer',
|
|
860
|
+
file,
|
|
861
|
+
detail:
|
|
862
|
+
`author: ${art.marker.author ?? ''} equals reviewer: ${art.marker.reviewer} — ` +
|
|
863
|
+
'the contract requires a fresh reviewer context, never the implementing ' +
|
|
864
|
+
'session (§ 2.1). Dispatch a reviewer, or drop the author field if it was ' +
|
|
865
|
+
'filled in by mistake.',
|
|
789
866
|
});
|
|
790
867
|
}
|
|
791
868
|
for (const detail of art.malformedLines) {
|