@event4u/agent-config 14.5.0 → 14.7.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 +384 -3
- package/README.md +1 -1
- package/dist/agent-src/commands/analyze/decision.md +7 -0
- package/dist/agent-src/commands/analyze/inbox.md +264 -10
- package/dist/agent-src/commands/analyze.md +1 -1
- package/dist/agent-src/commands/optimize/project.md +10 -0
- package/dist/agent-src/commands/roadmap/process-full.md +132 -4
- package/dist/agent-src/contexts/execution/roadmap-execution-contract.md +31 -0
- package/dist/agent-src/contexts/execution/roadmap-process-loop.md +161 -1
- package/dist/agent-src/rules/context-hygiene.md +2 -0
- package/dist/agent-src/rules/decision-revisit-gate.md +111 -7
- package/dist/agent-src/rules/fix-what-you-see.md +108 -0
- package/dist/agent-src/rules/no-roadmap-references.md +0 -5
- package/dist/agent-src/rules/recurring-criticism.md +110 -0
- package/dist/agent-src/rules/roadmap-progress-sync.md +1 -1
- package/dist/agent-src/rules/rule-type-governance.md +0 -2
- package/dist/agent-src/rules/self-repair-loop.md +17 -0
- package/dist/agent-src/rules/skill-quality.md +0 -2
- package/dist/agent-src/rules/source-confidentiality.md +37 -7
- package/dist/agent-src/scripts/archival_sweep.ts +117 -0
- package/dist/agent-src/scripts/archive_completed_roadmaps.ts +19 -3
- package/dist/agent-src/scripts/gate_budget.ts +282 -0
- package/dist/agent-src/scripts/gate_execute.ts +72 -31
- package/dist/agent-src/scripts/roadmap_gates.ts +74 -3
- package/dist/agent-src/scripts/update_roadmap_progress.ts +251 -7
- package/dist/agent-src/skills/adr-create/SKILL.md +25 -3
- package/dist/agent-src/skills/ai-council/SKILL.md +48 -807
- package/dist/agent-src/skills/ai-council/references/advanced-modes.md +320 -0
- package/dist/agent-src/skills/ai-council/references/cost-and-redaction.md +99 -0
- package/dist/agent-src/skills/ai-council/references/execution-modes.md +162 -0
- package/dist/agent-src/skills/ai-council/references/output-and-synthesis.md +125 -0
- package/dist/agent-src/skills/ai-council/references/procedure.md +143 -0
- package/dist/agent-src/skills/decision-review/SKILL.md +18 -0
- package/dist/agent-src/skills/quality-tools/SKILL.md +34 -326
- package/dist/agent-src/skills/quality-tools/references/js-ts-tools.md +113 -0
- package/dist/agent-src/skills/quality-tools/references/php-tools.md +222 -0
- package/dist/agent-src/skills/roadmap-management/SKILL.md +15 -409
- package/dist/agent-src/skills/roadmap-management/references/archival.md +226 -0
- package/dist/agent-src/skills/roadmap-management/references/authoring.md +107 -0
- package/dist/agent-src/skills/roadmap-management/references/dashboard.md +47 -0
- package/dist/agent-src/skills/roadmap-management/references/lifecycle.md +58 -0
- package/dist/agent-src/skills/skill-writing/SKILL.md +34 -570
- package/dist/agent-src/skills/skill-writing/references/procedure.md +275 -0
- package/dist/agent-src/skills/skill-writing/references/read-only-scripts.md +18 -0
- package/dist/agent-src/skills/skill-writing/references/section-patterns.md +298 -0
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/roadmaps.md +45 -2
- package/dist/agent-src/templates/scripts/telemetry/flush_sender.mjs +163 -0
- package/dist/agent-src/templates/scripts/telemetry/remote.ts +160 -7
- package/dist/agent-src/templates/scripts/telemetry/transport.ts +169 -0
- package/dist/cli/registry.js +1 -1
- package/dist/cli/registry.js.map +1 -1
- package/dist/cli-delegate/chunk-2GNWGMAL.js +172 -0
- package/dist/cli-delegate/{chunk-RLN73PR5.js → chunk-4VR4ORQ6.js} +10 -7
- package/dist/cli-delegate/chunk-6EOCNQAM.js +402 -0
- package/dist/cli-delegate/{chunk-XURJ4AQC.js → chunk-74E3TKWV.js} +381 -280
- package/dist/cli-delegate/{chunk-3UCJWMMP.js → chunk-7F3VYSM2.js} +4 -4
- package/dist/cli-delegate/{chunk-BKO2AZ7Z.js → chunk-B2ERU2VA.js} +1 -1
- package/dist/cli-delegate/{chunk-NXFWFAYV.js → chunk-G23AT6GD.js} +1 -0
- package/dist/cli-delegate/{chunk-63WSP6YZ.js → chunk-GJ5BVHXM.js} +72 -165
- package/dist/cli-delegate/{chunk-ZPSXJTLI.js → chunk-JZ4NR2TW.js} +353 -1
- package/dist/cli-delegate/chunk-MWRD5YOH.js +100 -0
- package/dist/cli-delegate/{chunk-GRRPEPRN.js → chunk-T7L2QK3K.js} +24 -5
- package/dist/cli-delegate/{chunk-EVTY7ISR.js → chunk-YM4GZDJG.js} +9 -1
- package/dist/cli-delegate/cmd_conformance.js +459 -709
- package/dist/cli-delegate/cmd_doctor.js +6 -6
- package/dist/cli-delegate/cmd_explain.js +1 -1
- package/dist/cli-delegate/cmd_export.js +7 -6
- package/dist/cli-delegate/cmd_handoff.js +6 -6
- package/dist/cli-delegate/cmd_packs_active.js +1 -1
- package/dist/cli-delegate/cmd_preflight.js +2 -2
- package/dist/cli-delegate/cmd_prune.js +7 -6
- package/dist/cli-delegate/cmd_session_recycle.js +840 -30
- package/dist/cli-delegate/cmd_settings_migrate.js +7 -6
- package/dist/cli-delegate/cmd_settings_set.js +1 -1
- package/dist/cli-delegate/cmd_sync.js +7 -6
- package/dist/cli-delegate/cmd_uninstall.js +9 -7
- package/dist/cli-delegate/cmd_update.js +1 -1
- package/dist/cli-delegate/cmd_upgrade.js +1 -1
- package/dist/cli-delegate/cmd_validate.js +7 -6
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +72 -29
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +4 -4
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +10 -8
- package/dist/discovery/trust-report.md +3 -3
- package/dist/discovery/workspaces.json +8 -6
- package/dist/hooks/dispatch.js +3127 -2022
- package/dist/install/claudePathsPlan.js +187 -0
- package/dist/install/claudePathsPlan.js.map +1 -0
- package/dist/install/hostLayerFingerprint.js +136 -0
- package/dist/install/hostLayerFingerprint.js.map +1 -0
- package/dist/install/install.mjs +553 -425
- package/dist/install/partitionEligibility.js +276 -0
- package/dist/install/partitionEligibility.js.map +1 -0
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +1744 -1191
- package/dist/router.json +1 -1
- package/dist/scripts/_lib/agent_src.js +41 -0
- package/dist/scripts/_lib/agent_src.js.map +1 -1
- package/dist/scripts/_lib/install_layout.js +83 -0
- package/dist/scripts/_lib/install_layout.js.map +1 -0
- package/dist/scripts/_lib/installed_lock.js +444 -0
- package/dist/scripts/_lib/installed_lock.js.map +1 -0
- package/dist/scripts/condense.js +13 -164
- package/dist/scripts/condense.js.map +1 -1
- package/dist/server/schemas/settings.js +4 -0
- package/dist/server/schemas/settings.js.map +1 -1
- package/docs/contracts/settings-classes.md +12 -6
- package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +8 -3
- package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +26 -0
- package/docs/guidelines/agent-infra/engineering-memory-data-format.md +49 -0
- package/docs/guidelines/agent-infra/memory-access.md +17 -0
- package/docs/guidelines/agent-infra/recurring-criticism-mechanics.md +96 -0
- package/package.json +1 -1
- package/src/agent-src/scripts/archival_sweep.ts +117 -0
- package/src/agent-src/scripts/archive_completed_roadmaps.ts +19 -3
- package/src/agent-src/scripts/gate_budget.ts +282 -0
- package/src/agent-src/scripts/gate_execute.ts +72 -31
- package/src/agent-src/scripts/roadmap_gates.ts +74 -3
- package/src/agent-src/scripts/update_roadmap_progress.ts +251 -7
- package/src/agent-src/templates/scripts/telemetry/flush_sender.mjs +163 -0
- package/src/agent-src/templates/scripts/telemetry/remote.ts +160 -7
- package/src/agent-src/templates/scripts/telemetry/transport.ts +169 -0
- package/src/config/agent-settings.template.yml +27 -2
- package/src/config/ci-local-parity.yml +18 -0
- package/src/config/estate-count-budget.json +367 -3
- package/src/config/gate-violation-baselines.json +41 -41
- package/src/config/pack-size-budget.json +3 -2
- package/src/config/rule-activation-census.json +14 -6
- package/src/config/rule-stub-ceilings.json +19 -6
- package/src/install/claudePathsPlan.ts +196 -0
- package/src/install/hostLayerFingerprint.ts +145 -0
- package/src/install/partitionEligibility.ts +325 -0
- package/src/scripts/_cli/cmd_session_recycle.ts +9 -1
- package/src/scripts/_dispatch.bash +6 -1
- package/src/scripts/_lib/ac_heading.ts +30 -0
- package/src/scripts/_lib/agent_src.ts +42 -0
- package/src/scripts/_lib/bench_ab_pinned_repo.ts +162 -0
- package/src/scripts/_lib/bench_ab_workspace.ts +10 -1
- package/src/scripts/_lib/envelope_grounding.ts +38 -8
- package/src/scripts/_lib/installed_lock.ts +50 -5
- package/src/scripts/_lib/layer_overlap_notice.ts +85 -0
- package/src/scripts/_lib/md_section.ts +129 -0
- package/src/scripts/_lib/scope_guard.sh +86 -4
- package/src/scripts/_lib/self_repair.ts +19 -0
- package/src/scripts/_lib/self_repair_class_b.ts +171 -0
- package/src/scripts/_lib/subagent_capsule.ts +81 -1
- package/src/scripts/adr/regenerate_index.ts +13 -2
- package/src/scripts/adr_cite_check.ts +424 -0
- package/src/scripts/ai_council/cli_help.ts +55 -0
- package/src/scripts/before_complete_hook.ts +153 -28
- package/src/scripts/bench_ab_v2_complexity.ts +27 -7
- package/src/scripts/check_adr_frontmatter.ts +187 -1
- package/src/scripts/check_references.ts +60 -0
- package/src/scripts/check_release_published.ts +32 -11
- package/src/scripts/check_single_delivery.ts +517 -0
- package/src/scripts/ci_settle.ts +170 -0
- package/src/scripts/condense.ts +20 -170
- package/src/scripts/council_cli.ts +3 -3
- package/src/scripts/dispatch_r2_reviewer.ts +6 -14
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +77 -14
- package/src/scripts/hooks/block_no_verify.ts +61 -10
- package/src/scripts/hooks/block_unauthorized_git.ts +1 -1
- package/src/scripts/hooks/concern_registry.ts +4 -0
- package/src/scripts/hooks/rtk_wrap_hook.ts +8 -3
- package/src/scripts/hooks/run_continuation_hook.ts +887 -68
- package/src/scripts/hooks/ship_diff_volume_hook.ts +81 -15
- package/src/scripts/hooks/source_first_gate_hook.ts +464 -0
- package/src/scripts/hooks/state_io.ts +782 -20
- package/src/scripts/hooks/subagent_ledger_hook.ts +44 -15
- package/src/scripts/hooks/telemetry_flush_hook.ts +139 -0
- package/src/scripts/hooks/telemetry_self_repair.ts +128 -0
- package/src/scripts/hooks/telemetry_usage_hook.ts +22 -4
- package/src/scripts/hooks/turn_end_gate_hook.ts +81 -15
- package/src/scripts/install.sh +12 -2
- package/src/scripts/install.ts +16 -11
- package/src/scripts/language_mirror_hook.ts +561 -25
- package/src/scripts/lint_framework_leakage_allowlist.json +2 -2
- package/src/scripts/lint_plan_risk_register.ts +4 -3
- package/src/scripts/lint_skill_router_head.ts +4 -4
- package/src/scripts/mcp_server/tools.ts +2 -2
- package/src/scripts/memory_consolidation.ts +189 -0
- package/src/scripts/memory_eviction.ts +384 -0
- package/src/scripts/new_roadmap.ts +136 -0
- package/src/scripts/pack_mcp_content.ts +20 -5
- package/src/scripts/release.ts +37 -38
- package/src/scripts/report_layer_overlap.ts +78 -0
- package/src/scripts/report_memory_pointers.ts +622 -0
- package/src/scripts/self_repair_hook.ts +37 -5
- package/src/scripts/session_register_hook.ts +115 -15
- package/src/scripts/skill_usage_collect.ts +11 -1
- package/src/scripts/skill_usage_report.ts +278 -8
- package/src/scripts/sync_pr_branch.ts +7 -0
- package/src/server/schemas/settings.ts +8 -0
- package/dist/cli-delegate/chunk-EJITJBJX.js +0 -172
- package/dist/cli-delegate/chunk-PZWRPRWP.js +0 -38
- /package/dist/cli-delegate/{chunk-RYNADUFG.js → chunk-LWTYTX6F.js} +0 -0
package/src/scripts/condense.ts
CHANGED
|
@@ -251,7 +251,20 @@ function _stripChars(s: string, chars: string): string {
|
|
|
251
251
|
// module-level CLI self-invoke into its bundle. Re-exported here because four
|
|
252
252
|
// in-repo consumers import it from `condense.js`.
|
|
253
253
|
export { rule_in_scope } from '../install/ruleInScope.js';
|
|
254
|
+
// Re-exported for in-repo consumers; definitions moved beside emit_host_rules_cli.ts (Phase 5).
|
|
255
|
+
export {
|
|
256
|
+
CLAUDE_PATHS_PATTERN_BUDGET,
|
|
257
|
+
_claude_paths_plan,
|
|
258
|
+
_escape_claude_bracket,
|
|
259
|
+
_expanded_pattern_count,
|
|
260
|
+
_has_non_path_trigger,
|
|
261
|
+
_is_unresolved_placeholder,
|
|
262
|
+
derive_trigger_globs,
|
|
263
|
+
type ClaudePathsPlan,
|
|
264
|
+
} from '../install/claudePathsPlan.js';
|
|
254
265
|
import { rule_in_scope } from '../install/ruleInScope.js';
|
|
266
|
+
import { isExclusivelyPackageOnly, partitionActive, setPartitionAnnounce } from '../install/partitionEligibility.js'; // ADR-236
|
|
267
|
+
import { _claude_paths_plan, derive_trigger_globs } from '../install/claudePathsPlan.js';
|
|
255
268
|
|
|
256
269
|
const _HERE = path.dirname(fileURLToPath(import.meta.url)); // <repo>/src/scripts
|
|
257
270
|
const _DEFAULT_PROJECT_ROOT = path.resolve(_HERE, '..', '..');
|
|
@@ -304,6 +317,7 @@ function _deriveState(root: string): ModuleState {
|
|
|
304
317
|
}
|
|
305
318
|
|
|
306
319
|
export const MODULE_STATE: ModuleState = _deriveState(_DEFAULT_PROJECT_ROOT);
|
|
320
|
+
setPartitionAnnounce(success); // ADR-236: the mode line must be visible at the default level
|
|
307
321
|
|
|
308
322
|
/**
|
|
309
323
|
* Test seam — reassign one or more module-state fields, mirroring the pytest
|
|
@@ -1118,6 +1132,7 @@ function _scoped_rule_basenames(): string[] {
|
|
|
1118
1132
|
// is its fourth consumer, after the router compiler, the dist writer, and
|
|
1119
1133
|
// check_sync. Same predicate in all four; that is the point.
|
|
1120
1134
|
.filter((p) => !skip_compile_disabled_rule(`rules/${path.basename(p)}`))
|
|
1135
|
+
.filter((p) => !partitionActive(MODULE_STATE.PROJECT_ROOT) || isExclusivelyPackageOnly(p))
|
|
1121
1136
|
.map((p) => path.basename(p))
|
|
1122
1137
|
.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
|
|
1123
1138
|
}
|
|
@@ -1322,32 +1337,6 @@ function _yaml_scalar(value: string): string {
|
|
|
1322
1337
|
return JSON.stringify(value);
|
|
1323
1338
|
}
|
|
1324
1339
|
|
|
1325
|
-
/**
|
|
1326
|
-
* Derive host-native activation globs from a rule's `triggers:` frontmatter
|
|
1327
|
-
* (road-to-request-scoped-rule-load Phase 2). `file_pattern` triggers map
|
|
1328
|
-
* verbatim; `path_prefix` triggers map to `<prefix>**`. Keyword / phrase /
|
|
1329
|
-
* command triggers produce no glob — those rules stay
|
|
1330
|
-
* description-activated (Cursor Agent-Requested / Windsurf model_decision).
|
|
1331
|
-
*/
|
|
1332
|
-
export function derive_trigger_globs(meta: Record<string, unknown>): string[] {
|
|
1333
|
-
const triggers = meta['triggers'];
|
|
1334
|
-
if (!Array.isArray(triggers)) {
|
|
1335
|
-
return [];
|
|
1336
|
-
}
|
|
1337
|
-
const globs: string[] = [];
|
|
1338
|
-
for (const t of triggers) {
|
|
1339
|
-
if (t === null || typeof t !== 'object' || Array.isArray(t)) continue;
|
|
1340
|
-
const obj = t as Record<string, unknown>;
|
|
1341
|
-
if (typeof obj['file_pattern'] === 'string' && obj['file_pattern']) {
|
|
1342
|
-
globs.push(obj['file_pattern']);
|
|
1343
|
-
} else if (typeof obj['path_prefix'] === 'string' && obj['path_prefix']) {
|
|
1344
|
-
const prefix = obj['path_prefix'] as string;
|
|
1345
|
-
globs.push(prefix.endsWith('/') ? `${prefix}**` : `${prefix}**`);
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
// De-dup, keep declaration order (deterministic output).
|
|
1349
|
-
return [...new Set(globs)];
|
|
1350
|
-
}
|
|
1351
1340
|
|
|
1352
1341
|
export function _emit_cursor_mdc(source: string, target: string): void {
|
|
1353
1342
|
const [meta, body] = _parse_frontmatter(_readText(source));
|
|
@@ -1390,151 +1379,8 @@ export function _emit_windsurf_rule(source: string, target: string): void {
|
|
|
1390
1379
|
_writeText(target, lines.join('\n'));
|
|
1391
1380
|
}
|
|
1392
1381
|
|
|
1393
|
-
/**
|
|
1394
|
-
* A brace group the host expands, versus an agent-config placeholder that only
|
|
1395
|
-
* LOOKS like one.
|
|
1396
|
-
*
|
|
1397
|
-
* `path_prefix: "{module_root}/"` in `roadmap-ci-steps-policy` is resolved by
|
|
1398
|
-
* this suite from `modules.root_paths`. Emitted verbatim into a host `paths:`
|
|
1399
|
-
* list it is a brace group with no comma, which the host expands to the literal
|
|
1400
|
-
* string `{module_root}` — a pattern that matches no file. The rule would then
|
|
1401
|
-
* reach the model **never** instead of on-demand, and nothing would say so: the
|
|
1402
|
-
* probed contract records this exact degradation as silent
|
|
1403
|
-
* (`claude-code-rules-dir-contract.md` § constraints).
|
|
1404
|
-
*
|
|
1405
|
-
* Dropping the pattern is fail-safe in the one direction that matters. A rule
|
|
1406
|
-
* left with no pattern at all carries no `paths:` key and loads
|
|
1407
|
-
* unconditionally — the status quo, not a regression. A rule carrying a
|
|
1408
|
-
* no-op pattern is invisible.
|
|
1409
|
-
*
|
|
1410
|
-
* The discriminator is the comma, not a placeholder allowlist: `{ts,tsx}` is a
|
|
1411
|
-
* real alternation, `{module_root}` cannot be one.
|
|
1412
|
-
*/
|
|
1413
|
-
export function _is_unresolved_placeholder(pattern: string): boolean {
|
|
1414
|
-
for (const m of pattern.matchAll(/\{([^}]*)\}/g)) {
|
|
1415
|
-
if (!(m[1] as string).includes(',')) {
|
|
1416
|
-
return true;
|
|
1417
|
-
}
|
|
1418
|
-
}
|
|
1419
|
-
return false;
|
|
1420
|
-
}
|
|
1421
|
-
|
|
1422
|
-
/**
|
|
1423
|
-
* `[` opens a bracket expression for the host. An unparseable one makes that
|
|
1424
|
-
* pattern match nothing while the rule's other patterns keep working — so a
|
|
1425
|
-
* literal `[` in a trigger is escaped rather than trusted.
|
|
1426
|
-
*/
|
|
1427
|
-
export function _escape_claude_bracket(pattern: string): string {
|
|
1428
|
-
return pattern.replace(/\[/g, '\\[');
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
/**
|
|
1432
|
-
* Expanded-pattern cost of one glob: the product of its brace alternations.
|
|
1433
|
-
* The host budgets a rule's whole `paths:` list at 1,000 expanded patterns and
|
|
1434
|
-
* 4 MiB, and a list over budget is used UNEXPANDED — braces then match
|
|
1435
|
-
* literally, i.e. nothing. Counting keeps the emitter under the cliff instead
|
|
1436
|
-
* of discovering it as a silent no-op.
|
|
1437
|
-
*/
|
|
1438
|
-
export function _expanded_pattern_count(pattern: string): number {
|
|
1439
|
-
let n = 1;
|
|
1440
|
-
for (const m of pattern.matchAll(/\{([^}]*)\}/g)) {
|
|
1441
|
-
n *= (m[1] as string).split(',').length;
|
|
1442
|
-
}
|
|
1443
|
-
return n;
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
/** Host-documented budget for one rule's whole `paths:` list. */
|
|
1447
|
-
export const CLAUDE_PATHS_PATTERN_BUDGET = 1000;
|
|
1448
|
-
|
|
1449
|
-
export interface ClaudePathsPlan {
|
|
1450
|
-
/** Patterns to emit under `paths:`, in declaration order. */
|
|
1451
|
-
globs: string[];
|
|
1452
|
-
/** Patterns deliberately not emitted, with the reason a reader can act on. */
|
|
1453
|
-
dropped: { pattern: string; reason: 'unresolved-placeholder' | 'over-budget' | 'mixed-triggers' }[];
|
|
1454
|
-
}
|
|
1455
1382
|
|
|
1456
|
-
/**
|
|
1457
|
-
* Does this rule declare any trigger that is NOT path-shaped?
|
|
1458
|
-
*
|
|
1459
|
-
* Load-bearing for `_claude_paths_plan` below, because one `triggers:` list
|
|
1460
|
-
* means two different things on two hosts. Cursor and Windsurf treat globs as
|
|
1461
|
-
* ADDITIVE — a rule with empty globs still reaches the agent through its
|
|
1462
|
-
* description (see `_emit_cursor_mdc`'s own comment). Claude Code treats
|
|
1463
|
-
* `paths:` as EXCLUSIVE: with it the rule loads on a path match; without it the
|
|
1464
|
-
* rule loads unconditionally. The emitter fed both semantics from one list, so
|
|
1465
|
-
* a rule that declared keywords *and* one path glob silently became
|
|
1466
|
-
* path-gated-only on Claude.
|
|
1467
|
-
*/
|
|
1468
|
-
export function _has_non_path_trigger(meta: Record<string, unknown>): boolean {
|
|
1469
|
-
const triggers = meta['triggers'];
|
|
1470
|
-
if (!Array.isArray(triggers)) return false;
|
|
1471
|
-
for (const t of triggers) {
|
|
1472
|
-
if (t === null || typeof t !== 'object' || Array.isArray(t)) continue;
|
|
1473
|
-
const obj = t as Record<string, unknown>;
|
|
1474
|
-
if (typeof obj['keyword'] === 'string' && obj['keyword']) return true;
|
|
1475
|
-
if (typeof obj['phrase'] === 'string' && obj['phrase']) return true;
|
|
1476
|
-
}
|
|
1477
|
-
return false;
|
|
1478
|
-
}
|
|
1479
1383
|
|
|
1480
|
-
/**
|
|
1481
|
-
* Derive the host's `paths:` list for one rule, with every drop recorded.
|
|
1482
|
-
*
|
|
1483
|
-
* Kernel / always-apply rules get an EMPTY list on purpose: absent `paths:` is
|
|
1484
|
-
* how this host says "load unconditionally", which is exactly what an Iron-Law
|
|
1485
|
-
* rule needs. Scoping one would be a correctness regression dressed as a byte
|
|
1486
|
-
* saving — and the same contract notes path-scoped rules are not re-injected
|
|
1487
|
-
* after `/compact`, so an obligation that must survive compaction cannot be
|
|
1488
|
-
* path-scoped at all.
|
|
1489
|
-
*/
|
|
1490
|
-
export function _claude_paths_plan(meta: Record<string, unknown>): ClaudePathsPlan {
|
|
1491
|
-
const always_apply = Boolean(meta['alwaysApply'] || meta['type'] === 'always');
|
|
1492
|
-
if (always_apply) {
|
|
1493
|
-
return { globs: [], dropped: [] };
|
|
1494
|
-
}
|
|
1495
|
-
const globs: string[] = [];
|
|
1496
|
-
const dropped: ClaudePathsPlan['dropped'] = [];
|
|
1497
|
-
|
|
1498
|
-
// A rule that ALSO declares keyword / phrase triggers gets no `paths:` at
|
|
1499
|
-
// all, and therefore keeps loading unconditionally on Claude Code.
|
|
1500
|
-
//
|
|
1501
|
-
// Emitting `paths:` here would narrow the rule to a path match and discard
|
|
1502
|
-
// every keyword the author wrote, because this host reads the list as the
|
|
1503
|
-
// whole gate rather than as one way in. Measured before this guard: 25 of
|
|
1504
|
-
// 110 projected rules carried `paths:` and 19 of them also carried keyword
|
|
1505
|
-
// triggers — `design-fidelity` lost 21 of them, in exactly the pasted-
|
|
1506
|
-
// screenshot and capability-URL handovers its own routing section names as
|
|
1507
|
-
// the classes it exists to catch. Nothing in the tree recorded a decision
|
|
1508
|
-
// to make that trade, which is why it is treated as a defect.
|
|
1509
|
-
//
|
|
1510
|
-
// The drop is REPORTED rather than silent, so a rule whose obligation
|
|
1511
|
-
// really is path-bound is visible as a candidate for removing its keyword
|
|
1512
|
-
// triggers — the narrowing then becomes an authoring decision instead of an
|
|
1513
|
-
// emitter side effect. Cursor and Windsurf are untouched: globs are
|
|
1514
|
-
// additive there, so the same rule keeps both routes.
|
|
1515
|
-
if (_has_non_path_trigger(meta)) {
|
|
1516
|
-
for (const raw of derive_trigger_globs(meta)) {
|
|
1517
|
-
dropped.push({ pattern: raw, reason: 'mixed-triggers' });
|
|
1518
|
-
}
|
|
1519
|
-
return { globs, dropped };
|
|
1520
|
-
}
|
|
1521
|
-
|
|
1522
|
-
let spent = 0;
|
|
1523
|
-
for (const raw of derive_trigger_globs(meta)) {
|
|
1524
|
-
if (_is_unresolved_placeholder(raw)) {
|
|
1525
|
-
dropped.push({ pattern: raw, reason: 'unresolved-placeholder' });
|
|
1526
|
-
continue;
|
|
1527
|
-
}
|
|
1528
|
-
const cost = _expanded_pattern_count(raw);
|
|
1529
|
-
if (spent + cost > CLAUDE_PATHS_PATTERN_BUDGET) {
|
|
1530
|
-
dropped.push({ pattern: raw, reason: 'over-budget' });
|
|
1531
|
-
continue;
|
|
1532
|
-
}
|
|
1533
|
-
spent += cost;
|
|
1534
|
-
globs.push(_escape_claude_bracket(raw));
|
|
1535
|
-
}
|
|
1536
|
-
return { globs, dropped };
|
|
1537
|
-
}
|
|
1538
1384
|
|
|
1539
1385
|
/**
|
|
1540
1386
|
* Emit a Claude Code rule carrying the host's OWN activation key.
|
|
@@ -1823,6 +1669,7 @@ function _render_native_model_md(src_md: string, tier: string): string {
|
|
|
1823
1669
|
}
|
|
1824
1670
|
|
|
1825
1671
|
export function generate_claude_skills(active_skill_names: ReadonlySet<string> | null = null): number {
|
|
1672
|
+
if (partitionActive(MODULE_STATE.PROJECT_ROOT)) active_skill_names = new Set<string>();
|
|
1826
1673
|
if (!_exists(MODULE_STATE.SKILLS_SOURCE)) {
|
|
1827
1674
|
process.stderr.write(' ⚠️ dist/agent-src/skills/ not found — skipping skills\n');
|
|
1828
1675
|
return 0;
|
|
@@ -1836,7 +1683,9 @@ export function generate_claude_skills(active_skill_names: ReadonlySet<string> |
|
|
|
1836
1683
|
skills = skills.filter((s) => active_skill_names.has(s));
|
|
1837
1684
|
}
|
|
1838
1685
|
const skill_set = new Set(skills);
|
|
1839
|
-
const command_slugs =
|
|
1686
|
+
const command_slugs = partitionActive(MODULE_STATE.PROJECT_ROOT)
|
|
1687
|
+
? new Set<string>()
|
|
1688
|
+
: new Set([...iterCommands()].map(([, slug]) => slug));
|
|
1840
1689
|
|
|
1841
1690
|
_mkdirp(MODULE_STATE.CLAUDE_SKILLS_DIR);
|
|
1842
1691
|
const auto = _read_model_auto_switch() === 'auto';
|
|
@@ -1997,6 +1846,7 @@ export function generate_claude_project_commands(
|
|
|
1997
1846
|
}
|
|
1998
1847
|
|
|
1999
1848
|
export function generate_claude_commands(active_command_slugs: ReadonlySet<string> | null = null): number {
|
|
1849
|
+
if (partitionActive(MODULE_STATE.PROJECT_ROOT)) active_command_slugs = new Set<string>();
|
|
2000
1850
|
if (!_isDir(path.join(MODULE_STATE.PROJECT_ROOT, 'src', 'domains'))) {
|
|
2001
1851
|
process.stderr.write(' ⚠️ src/domains/ not found — skipping commands\n');
|
|
2002
1852
|
return 0;
|
|
@@ -63,6 +63,7 @@ import {
|
|
|
63
63
|
plan_advisor_swap,
|
|
64
64
|
} from './ai_council/advisors.js';
|
|
65
65
|
import { format_install_hints } from './ai_council/cli_hints.js';
|
|
66
|
+
import { renderSubHelp } from './ai_council/cli_help.js';
|
|
66
67
|
import {
|
|
67
68
|
type AdvisorConfig,
|
|
68
69
|
type CouncilConfig,
|
|
@@ -2507,6 +2508,7 @@ function cmd_run(
|
|
|
2507
2508
|
const [extra_calls, extra_usd] = _consensus_cost_delta(ai_cfg, question.mode, estimates, billable.length);
|
|
2508
2509
|
const [ch_calls, ch_usd] = _chairman_cost_delta(ai_cfg, estimates);
|
|
2509
2510
|
const [pr_extra_calls, pr_extra_usd] = _peer_review_cost_delta(ai_cfg, args, estimates, billable.length);
|
|
2511
|
+
if (!args.confirm) _stdout('council:run · DRY PASS — estimate only, no seat is contacted. Add --confirm to run.\n');
|
|
2510
2512
|
_stdout(
|
|
2511
2513
|
`council:run · mode=${question.mode} · members=${members.length} ` +
|
|
2512
2514
|
`(billable=${billable.length})\n`,
|
|
@@ -3728,10 +3730,8 @@ function _parseArgs(argv: string[]): Args {
|
|
|
3728
3730
|
const rest = argv.slice(1);
|
|
3729
3731
|
const usage = _usageFor(first);
|
|
3730
3732
|
const { positionals, opts, requiredOpts } = _specsFor(first);
|
|
3731
|
-
|
|
3732
|
-
// Sub-help.
|
|
3733
3733
|
if (rest.includes('-h') || rest.includes('--help')) {
|
|
3734
|
-
_stdout(usage);
|
|
3734
|
+
_stdout(renderSubHelp(first, usage, { positionals, opts, requiredOpts }));
|
|
3735
3735
|
process.exitCode = 0;
|
|
3736
3736
|
throw new _ArgExit();
|
|
3737
3737
|
}
|
|
@@ -51,6 +51,7 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
|
51
51
|
// (validator → dispatcher for the scope hash, dispatcher → validator for
|
|
52
52
|
// relevance) is safe: neither module calls the other at module-evaluation
|
|
53
53
|
// time, and each CLI entry guard only fires for its own argv[1].
|
|
54
|
+
import { isAcceptanceCriteriaHeading } from './_lib/ac_heading.js';
|
|
54
55
|
import { gitEnv } from './_lib/git_env.js';
|
|
55
56
|
import { completionReviewDisabled } from './_lib/planning_settings.js';
|
|
56
57
|
import { artifactRelevance } from './check_completion_review.js';
|
|
@@ -492,20 +493,11 @@ export function extractAcceptanceCriteria(roadmapText: string): string {
|
|
|
492
493
|
const lines = roadmapText.split('\n');
|
|
493
494
|
let start = -1;
|
|
494
495
|
for (let i = 0; i < lines.length; i++) {
|
|
495
|
-
// Case-insensitive
|
|
496
|
-
//
|
|
497
|
-
//
|
|
498
|
-
//
|
|
499
|
-
|
|
500
|
-
//
|
|
501
|
-
// The end-anchor was the same defect wearing a different mask, and it was
|
|
502
|
-
// LIVE: `\s*$` rejected a heading carrying a qualifier, so
|
|
503
|
-
// `## Acceptance criteria (per phase, on promotion to ready)` and
|
|
504
|
-
// `## Acceptance criteria (anti-dump — the review-s own rule)` extracted
|
|
505
|
-
// nothing. Two roadmaps, measured 2026-08-18 — and they had been counted
|
|
506
|
-
// as "declares no criteria" by the very census that motivated this fix,
|
|
507
|
-
// which is how a matcher tuned to its own measurement hides its misses.
|
|
508
|
-
if (/^##\s+acceptance criteria\b/i.test(lines[i] as string)) {
|
|
496
|
+
// Case-insensitive and NOT end-anchored — both of those were live misses
|
|
497
|
+
// here (case: zcs-close R2 review 2026-08-09; the `(per phase, …)` qualifier:
|
|
498
|
+
// measured 2026-08-18). The predicate now lives in `_lib/ac_heading`, which
|
|
499
|
+
// records all three instances of the defect and why it is shared.
|
|
500
|
+
if (isAcceptanceCriteriaHeading(lines[i] as string)) {
|
|
509
501
|
start = i;
|
|
510
502
|
break;
|
|
511
503
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fingerprint":"4834904a:65187","manifest":{"schema_version":1,"concerns":{"chat-history":{"script":"src/scripts/chat_history.ts","args":["hook-dispatch"],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["result"]},"hot-context":{"script":"src/scripts/hot_context_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"handoff-context":{"script":"src/scripts/handoff_context_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"roadmap-progress":{"script":"src/scripts/roadmap_progress_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input"]},"onboarding-gate":{"script":"src/scripts/onboarding_gate_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"context-hygiene":{"script":"src/scripts/context_hygiene_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"verify-before-complete":{"script":"src/scripts/before_complete_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input","result"]},"ship-diff-volume":{"script":"src/scripts/hooks/ship_diff_volume_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input"]},"minimal-safe-diff":{"script":"src/scripts/minimal_safe_diff_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input"]},"injection-scan":{"script":"src/scripts/injection_scan_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input","result"]},"block-no-verify":{"script":"src/scripts/hooks/block_no_verify.ts","args":[],"fail_closed":true,"severity":"blocking","needs_payload_bodies":["input"]},"block-kernel-rule-writes":{"script":"src/scripts/hooks/block_kernel_rule_writes.ts","args":[],"fail_closed":true,"severity":"blocking","needs_payload_bodies":["input"]},"block-config-weakening":{"script":"src/scripts/hooks/block_config_weakening.ts","args":[],"fail_closed":false,"severity":"blocking","needs_payload_bodies":["input"]},"rtk-wrap":{"script":"src/scripts/hooks/rtk_wrap_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input"]},"design-slop":{"script":"src/scripts/hooks/design_slop_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input"]},"ui-route-nudge":{"script":"src/scripts/hooks/ui_route_nudge_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input"]},"code-graph-nudge":{"script":"src/scripts/hooks/code_graph_nudge_hook.ts","args":[],"fail_closed":false,"severity":"advisory","tools":["Grep","Glob","Read"],"needs_payload_bodies":["input"]},"memory-learn":{"script":"src/scripts/memory_learn_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"first-run-gate":{"script":"src/scripts/first_run_gate_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"profile-staleness":{"script":"src/scripts/profile_staleness_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"wrapper-freshness":{"script":"src/scripts/wrapper_freshness_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"surface-probe":{"script":"src/scripts/surface_probe_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"team-review-gate":{"script":"src/scripts/team_review_gate_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"pr-url-reminder":{"script":"src/scripts/pr_url_reminder_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input","result"]},"language-mirror":{"script":"src/scripts/language_mirror_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"git-authorization":{"script":"src/scripts/git_authorization_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"block-unauthorized-git":{"script":"src/scripts/hooks/block_unauthorized_git.ts","args":[],"fail_closed":true,"severity":"blocking","needs_payload_bodies":["input"]},"evidence-independence":{"script":"src/scripts/hooks/evidence_independence.ts","args":[],"fail_closed":false,"severity":"blocking","needs_payload_bodies":["input"]},"session-canary":{"script":"src/scripts/session_canary_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"council-availability":{"script":"src/scripts/council_availability_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"telemetry-disclosure":{"script":"src/scripts/telemetry_disclosure_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"self-repair":{"script":"src/scripts/self_repair_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"session-register":{"script":"src/scripts/session_register_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"orchestration-record":{"script":"src/scripts/hooks/orchestration_record_hook.ts","args":[],"fail_closed":false,"severity":"advisory","tools":["Agent","Task"],"needs_payload_bodies":["input","result"]},"telemetry-usage":{"script":"src/scripts/hooks/telemetry_usage_hook.ts","args":[],"fail_closed":false,"severity":"advisory","tools":["Skill"],"needs_payload_bodies":["input"]},"delegation-nudge":{"script":"src/scripts/hooks/delegation_nudge_hook.ts","args":[],"fail_closed":false,"severity":"advisory","nudge_rank":1},"skill-route":{"script":"src/scripts/hooks/skill_route_hook.ts","args":[],"fail_closed":false,"severity":"advisory","nudge_rank":2},"end-review-nudge":{"script":"src/scripts/hooks/end_review_nudge_hook.ts","args":[],"fail_closed":false,"severity":"advisory","skip_on_refusal_retry":true},"turn-end-gate":{"script":"src/scripts/hooks/turn_end_gate_hook.ts","args":[],"fail_closed":false,"severity":"blocking"},"edit-shape":{"script":"src/scripts/hooks/edit_shape_hook.ts","args":[],"fail_closed":false,"severity":"advisory","tools":["Write"],"needs_payload_bodies":["input"]},"reread-guard":{"script":"src/scripts/hooks/reread_guard_hook.ts","args":[],"fail_closed":false,"severity":"advisory","tools":["Read","Edit","Write"],"needs_payload_bodies":["input"]},"session-eol":{"script":"src/scripts/hooks/session_eol_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"run-continuation":{"script":"src/scripts/hooks/run_continuation_hook.ts","args":[],"fail_closed":false,"severity":"blocking"},"interruption-ledger":{"script":"src/scripts/hooks/interruption_ledger_hook.ts","args":[],"fail_closed":false,"severity":"advisory","skip_on_refusal_retry":true},"subagent-ledger":{"script":"src/scripts/hooks/subagent_ledger_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"tool-result-bytes":{"script":"src/scripts/hooks/tool_result_bytes_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"spawn-guard-shadow":{"script":"src/scripts/hooks/spawn_guard_shadow_hook.ts","args":[],"fail_closed":false,"severity":"advisory","tools":["Agent","Task"]}},"roles":{"worker":{"drop":["delegation-nudge","skill-route","end-review-nudge","council-availability","team-review-gate","self-repair","session-eol","interruption-ledger"]}},"platforms":{"augment":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","minimal-safe-diff","profile-staleness","wrapper-freshness","surface-probe","session-register"],"session_end":["chat-history","memory-learn","session-register","roadmap-progress"],"stop":["chat-history","hot-context","verify-before-complete","self-repair","session-register","roadmap-progress"],"pre_tool_use":["block-no-verify","block-unauthorized-git","evidence-independence","block-kernel-rule-writes","block-config-weakening","rtk-wrap","design-slop","ui-route-nudge","code-graph-nudge","ship-diff-volume","reread-guard"],"post_tool_use":["chat-history","roadmap-progress","context-hygiene","verify-before-complete","minimal-safe-diff","injection-scan","pr-url-reminder","orchestration-record","telemetry-usage","tool-result-bytes","edit-shape"]},"claude":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","minimal-safe-diff","profile-staleness","wrapper-freshness","surface-probe","session-register"],"session_end":["chat-history","memory-learn","session-register","roadmap-progress"],"stop":["chat-history","hot-context","verify-before-complete","team-review-gate","end-review-nudge","turn-end-gate","self-repair","session-register","session-eol","interruption-ledger","roadmap-progress","run-continuation"],"user_prompt_submit":["chat-history","verify-before-complete","minimal-safe-diff","language-mirror","delegation-nudge","skill-route","git-authorization","session-canary","self-repair","session-register"],"pre_tool_use":["block-no-verify","block-unauthorized-git","evidence-independence","block-kernel-rule-writes","block-config-weakening","rtk-wrap","design-slop","ui-route-nudge","code-graph-nudge","ship-diff-volume","reread-guard","spawn-guard-shadow"],"post_tool_use":["chat-history","roadmap-progress","context-hygiene","verify-before-complete","minimal-safe-diff","injection-scan","pr-url-reminder","orchestration-record","telemetry-usage","tool-result-bytes","edit-shape","language-mirror"],"pre_compact":["language-mirror","hot-context"],"subagent_start":["subagent-ledger"],"subagent_stop":["subagent-ledger"]},"cowork":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","minimal-safe-diff","profile-staleness","wrapper-freshness","surface-probe","session-register"],"session_end":["chat-history","memory-learn","session-register","roadmap-progress"],"stop":["chat-history","hot-context","verify-before-complete","self-repair","session-register","roadmap-progress"],"user_prompt_submit":["chat-history","verify-before-complete","minimal-safe-diff","language-mirror","git-authorization","session-canary","self-repair","session-register"],"pre_tool_use":["block-no-verify","block-unauthorized-git","evidence-independence","block-kernel-rule-writes","block-config-weakening","rtk-wrap","design-slop","ui-route-nudge","code-graph-nudge","ship-diff-volume","reread-guard","spawn-guard-shadow"],"post_tool_use":["chat-history","roadmap-progress","context-hygiene","verify-before-complete","minimal-safe-diff","injection-scan","pr-url-reminder","orchestration-record","telemetry-usage","tool-result-bytes","edit-shape"],"subagent_start":["subagent-ledger"],"subagent_stop":["subagent-ledger"]},"cursor":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","minimal-safe-diff","profile-staleness","wrapper-freshness","surface-probe","session-register"],"session_end":["chat-history","memory-learn","session-register","roadmap-progress"],"stop":["chat-history","hot-context","verify-before-complete","self-repair","session-register","roadmap-progress"],"user_prompt_submit":["chat-history","verify-before-complete","minimal-safe-diff","language-mirror","git-authorization","session-canary","self-repair","session-register"],"post_tool_use":["chat-history","roadmap-progress","context-hygiene","verify-before-complete","minimal-safe-diff","injection-scan","pr-url-reminder","orchestration-record","telemetry-usage","tool-result-bytes","edit-shape"]},"cline":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","minimal-safe-diff","profile-staleness","wrapper-freshness","surface-probe","session-register"],"session_end":["chat-history","memory-learn","session-register","roadmap-progress"],"stop":["chat-history","hot-context","verify-before-complete","self-repair","session-register","roadmap-progress"],"user_prompt_submit":["chat-history","verify-before-complete","minimal-safe-diff","language-mirror","git-authorization","session-canary","self-repair","session-register"],"post_tool_use":["chat-history","roadmap-progress","context-hygiene","verify-before-complete","minimal-safe-diff","injection-scan","pr-url-reminder","orchestration-record","telemetry-usage","tool-result-bytes","edit-shape"]},"windsurf":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","profile-staleness","wrapper-freshness","surface-probe","session-register"],"stop":["chat-history","hot-context","verify-before-complete","self-repair","session-register"],"user_prompt_submit":["chat-history","verify-before-complete","language-mirror","git-authorization","session-canary","self-repair","session-register"]},"gemini":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","minimal-safe-diff","profile-staleness","wrapper-freshness","surface-probe","session-register"],"session_end":["chat-history","memory-learn","session-register","roadmap-progress"],"stop":["chat-history","hot-context","verify-before-complete","self-repair","session-register","roadmap-progress"],"user_prompt_submit":["chat-history","verify-before-complete","minimal-safe-diff","language-mirror","git-authorization","session-canary","self-repair","session-register"],"post_tool_use":["chat-history","roadmap-progress","context-hygiene","verify-before-complete","minimal-safe-diff","injection-scan","pr-url-reminder","orchestration-record","telemetry-usage","tool-result-bytes","edit-shape"]},"copilot":{"fallback_only":true}},"native_event_aliases":{"augment":{"SessionStart":"session_start","SessionEnd":"session_end","Stop":"stop","PostToolUse":"post_tool_use","PreToolUse":"pre_tool_use"},"claude":{"SessionStart":"session_start","SessionEnd":"session_end","Stop":"stop","UserPromptSubmit":"user_prompt_submit","PostToolUse":"post_tool_use","PreToolUse":"pre_tool_use","PreCompact":"pre_compact","SubagentStart":"subagent_start","SubagentStop":"subagent_stop"},"cowork":{"SessionStart":"session_start","SessionEnd":"session_end","Stop":"stop","UserPromptSubmit":"user_prompt_submit","PostToolUse":"post_tool_use","PreToolUse":"pre_tool_use","PreCompact":"pre_compact","SubagentStart":"subagent_start","SubagentStop":"subagent_stop"},"cursor":{"sessionStart":"session_start","sessionEnd":"session_end","stop":"stop","beforeSubmitPrompt":"user_prompt_submit","postToolUse":"post_tool_use","preToolUse":"pre_tool_use","preCompact":"pre_compact"},"cline":{"TaskStart":"session_start","TaskResume":"session_start","TaskComplete":"session_end","TaskCancel":"stop","UserPromptSubmit":"user_prompt_submit","PostToolUse":"post_tool_use","PreToolUse":"pre_tool_use","PreCompact":"pre_compact"},"windsurf":{"pre_user_prompt":"user_prompt_submit","post_cascade_response":"stop","post_setup_worktree":"session_start"},"gemini":{"SessionStart":"session_start","SessionEnd":"session_end","BeforeAgent":"user_prompt_submit","AfterAgent":"stop","BeforeTool":"pre_tool_use","AfterTool":"post_tool_use"}}}}
|
|
1
|
+
{"fingerprint":"f4a2905d:68966","manifest":{"schema_version":1,"concerns":{"chat-history":{"script":"src/scripts/chat_history.ts","args":["hook-dispatch"],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["result"]},"hot-context":{"script":"src/scripts/hot_context_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"handoff-context":{"script":"src/scripts/handoff_context_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"roadmap-progress":{"script":"src/scripts/roadmap_progress_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input"]},"onboarding-gate":{"script":"src/scripts/onboarding_gate_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"context-hygiene":{"script":"src/scripts/context_hygiene_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"verify-before-complete":{"script":"src/scripts/before_complete_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input","result"]},"ship-diff-volume":{"script":"src/scripts/hooks/ship_diff_volume_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input"]},"minimal-safe-diff":{"script":"src/scripts/minimal_safe_diff_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input"]},"injection-scan":{"script":"src/scripts/injection_scan_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input","result"]},"block-no-verify":{"script":"src/scripts/hooks/block_no_verify.ts","args":[],"fail_closed":true,"severity":"blocking","needs_payload_bodies":["input"]},"block-kernel-rule-writes":{"script":"src/scripts/hooks/block_kernel_rule_writes.ts","args":[],"fail_closed":true,"severity":"blocking","needs_payload_bodies":["input"]},"block-config-weakening":{"script":"src/scripts/hooks/block_config_weakening.ts","args":[],"fail_closed":false,"severity":"blocking","needs_payload_bodies":["input"]},"rtk-wrap":{"script":"src/scripts/hooks/rtk_wrap_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input"]},"design-slop":{"script":"src/scripts/hooks/design_slop_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input"]},"ui-route-nudge":{"script":"src/scripts/hooks/ui_route_nudge_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input"]},"code-graph-nudge":{"script":"src/scripts/hooks/code_graph_nudge_hook.ts","args":[],"fail_closed":false,"severity":"advisory","tools":["Grep","Glob","Read"],"needs_payload_bodies":["input"]},"memory-learn":{"script":"src/scripts/memory_learn_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"first-run-gate":{"script":"src/scripts/first_run_gate_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"profile-staleness":{"script":"src/scripts/profile_staleness_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"wrapper-freshness":{"script":"src/scripts/wrapper_freshness_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"surface-probe":{"script":"src/scripts/surface_probe_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"team-review-gate":{"script":"src/scripts/team_review_gate_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"pr-url-reminder":{"script":"src/scripts/pr_url_reminder_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input","result"]},"language-mirror":{"script":"src/scripts/language_mirror_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"git-authorization":{"script":"src/scripts/git_authorization_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"block-unauthorized-git":{"script":"src/scripts/hooks/block_unauthorized_git.ts","args":[],"fail_closed":true,"severity":"blocking","needs_payload_bodies":["input"]},"evidence-independence":{"script":"src/scripts/hooks/evidence_independence.ts","args":[],"fail_closed":false,"severity":"blocking","needs_payload_bodies":["input"]},"session-canary":{"script":"src/scripts/session_canary_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"council-availability":{"script":"src/scripts/council_availability_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"telemetry-disclosure":{"script":"src/scripts/telemetry_disclosure_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"telemetry-flush":{"script":"src/scripts/hooks/telemetry_flush_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"self-repair":{"script":"src/scripts/self_repair_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"session-register":{"script":"src/scripts/session_register_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"orchestration-record":{"script":"src/scripts/hooks/orchestration_record_hook.ts","args":[],"fail_closed":false,"severity":"advisory","tools":["Agent","Task"],"needs_payload_bodies":["input","result"]},"telemetry-usage":{"script":"src/scripts/hooks/telemetry_usage_hook.ts","args":[],"fail_closed":false,"severity":"advisory","tools":["Skill"],"needs_payload_bodies":["input"]},"delegation-nudge":{"script":"src/scripts/hooks/delegation_nudge_hook.ts","args":[],"fail_closed":false,"severity":"advisory","nudge_rank":1},"skill-route":{"script":"src/scripts/hooks/skill_route_hook.ts","args":[],"fail_closed":false,"severity":"advisory","nudge_rank":2},"end-review-nudge":{"script":"src/scripts/hooks/end_review_nudge_hook.ts","args":[],"fail_closed":false,"severity":"advisory","skip_on_refusal_retry":true},"turn-end-gate":{"script":"src/scripts/hooks/turn_end_gate_hook.ts","args":[],"fail_closed":false,"severity":"blocking"},"edit-shape":{"script":"src/scripts/hooks/edit_shape_hook.ts","args":[],"fail_closed":false,"severity":"advisory","tools":["Write"],"needs_payload_bodies":["input"]},"reread-guard":{"script":"src/scripts/hooks/reread_guard_hook.ts","args":[],"fail_closed":false,"severity":"advisory","tools":["Read","Edit","Write"],"needs_payload_bodies":["input"]},"session-eol":{"script":"src/scripts/hooks/session_eol_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"run-continuation":{"script":"src/scripts/hooks/run_continuation_hook.ts","args":[],"fail_closed":false,"severity":"blocking"},"interruption-ledger":{"script":"src/scripts/hooks/interruption_ledger_hook.ts","args":[],"fail_closed":false,"severity":"advisory","skip_on_refusal_retry":true},"subagent-ledger":{"script":"src/scripts/hooks/subagent_ledger_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"tool-result-bytes":{"script":"src/scripts/hooks/tool_result_bytes_hook.ts","args":[],"fail_closed":false,"severity":"advisory"},"spawn-guard-shadow":{"script":"src/scripts/hooks/spawn_guard_shadow_hook.ts","args":[],"fail_closed":false,"severity":"advisory","tools":["Agent","Task"]},"source-first-gate":{"script":"src/scripts/hooks/source_first_gate_hook.ts","args":[],"fail_closed":false,"severity":"advisory","needs_payload_bodies":["input"]}},"roles":{"worker":{"drop":["delegation-nudge","skill-route","end-review-nudge","council-availability","team-review-gate","self-repair","session-eol","interruption-ledger"]}},"platforms":{"augment":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","minimal-safe-diff","profile-staleness","wrapper-freshness","surface-probe","session-register"],"session_end":["chat-history","memory-learn","session-register","roadmap-progress","telemetry-flush"],"stop":["chat-history","hot-context","verify-before-complete","self-repair","session-register","roadmap-progress"],"pre_tool_use":["block-no-verify","block-unauthorized-git","evidence-independence","block-kernel-rule-writes","block-config-weakening","rtk-wrap","design-slop","ui-route-nudge","code-graph-nudge","ship-diff-volume","reread-guard"],"post_tool_use":["chat-history","roadmap-progress","context-hygiene","verify-before-complete","minimal-safe-diff","injection-scan","pr-url-reminder","orchestration-record","telemetry-usage","tool-result-bytes","edit-shape"]},"claude":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","minimal-safe-diff","profile-staleness","wrapper-freshness","surface-probe","session-register"],"session_end":["chat-history","memory-learn","session-register","roadmap-progress","telemetry-flush"],"stop":["chat-history","hot-context","verify-before-complete","team-review-gate","end-review-nudge","turn-end-gate","self-repair","session-register","session-eol","interruption-ledger","roadmap-progress","run-continuation"],"user_prompt_submit":["chat-history","verify-before-complete","minimal-safe-diff","language-mirror","delegation-nudge","skill-route","git-authorization","session-canary","self-repair","session-register"],"pre_tool_use":["block-no-verify","block-unauthorized-git","evidence-independence","block-kernel-rule-writes","block-config-weakening","rtk-wrap","design-slop","ui-route-nudge","code-graph-nudge","ship-diff-volume","reread-guard","spawn-guard-shadow","source-first-gate"],"post_tool_use":["chat-history","roadmap-progress","context-hygiene","verify-before-complete","minimal-safe-diff","injection-scan","pr-url-reminder","orchestration-record","telemetry-usage","tool-result-bytes","edit-shape","language-mirror"],"pre_compact":["language-mirror","hot-context"],"subagent_start":["subagent-ledger"],"subagent_stop":["subagent-ledger"]},"cowork":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","minimal-safe-diff","profile-staleness","wrapper-freshness","surface-probe","session-register"],"session_end":["chat-history","memory-learn","session-register","roadmap-progress","telemetry-flush"],"stop":["chat-history","hot-context","verify-before-complete","self-repair","session-register","roadmap-progress"],"user_prompt_submit":["chat-history","verify-before-complete","minimal-safe-diff","language-mirror","git-authorization","session-canary","self-repair","session-register"],"pre_tool_use":["block-no-verify","block-unauthorized-git","evidence-independence","block-kernel-rule-writes","block-config-weakening","rtk-wrap","design-slop","ui-route-nudge","code-graph-nudge","ship-diff-volume","reread-guard","spawn-guard-shadow","source-first-gate"],"post_tool_use":["chat-history","roadmap-progress","context-hygiene","verify-before-complete","minimal-safe-diff","injection-scan","pr-url-reminder","orchestration-record","telemetry-usage","tool-result-bytes","edit-shape"],"subagent_start":["subagent-ledger"],"subagent_stop":["subagent-ledger"]},"cursor":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","minimal-safe-diff","profile-staleness","wrapper-freshness","surface-probe","session-register"],"session_end":["chat-history","memory-learn","session-register","roadmap-progress","telemetry-flush"],"stop":["chat-history","hot-context","verify-before-complete","self-repair","session-register","roadmap-progress"],"user_prompt_submit":["chat-history","verify-before-complete","minimal-safe-diff","language-mirror","git-authorization","session-canary","self-repair","session-register"],"post_tool_use":["chat-history","roadmap-progress","context-hygiene","verify-before-complete","minimal-safe-diff","injection-scan","pr-url-reminder","orchestration-record","telemetry-usage","tool-result-bytes","edit-shape"]},"cline":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","minimal-safe-diff","profile-staleness","wrapper-freshness","surface-probe","session-register"],"session_end":["chat-history","memory-learn","session-register","roadmap-progress","telemetry-flush"],"stop":["chat-history","hot-context","verify-before-complete","self-repair","session-register","roadmap-progress"],"user_prompt_submit":["chat-history","verify-before-complete","minimal-safe-diff","language-mirror","git-authorization","session-canary","self-repair","session-register"],"post_tool_use":["chat-history","roadmap-progress","context-hygiene","verify-before-complete","minimal-safe-diff","injection-scan","pr-url-reminder","orchestration-record","telemetry-usage","tool-result-bytes","edit-shape"]},"windsurf":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","profile-staleness","wrapper-freshness","surface-probe","session-register"],"stop":["chat-history","hot-context","verify-before-complete","self-repair","session-register"],"user_prompt_submit":["chat-history","verify-before-complete","language-mirror","git-authorization","session-canary","self-repair","session-register"]},"gemini":{"session_start":["chat-history","hot-context","handoff-context","session-canary","council-availability","telemetry-disclosure","first-run-gate","onboarding-gate","verify-before-complete","minimal-safe-diff","profile-staleness","wrapper-freshness","surface-probe","session-register"],"session_end":["chat-history","memory-learn","session-register","roadmap-progress","telemetry-flush"],"stop":["chat-history","hot-context","verify-before-complete","self-repair","session-register","roadmap-progress"],"user_prompt_submit":["chat-history","verify-before-complete","minimal-safe-diff","language-mirror","git-authorization","session-canary","self-repair","session-register"],"post_tool_use":["chat-history","roadmap-progress","context-hygiene","verify-before-complete","minimal-safe-diff","injection-scan","pr-url-reminder","orchestration-record","telemetry-usage","tool-result-bytes","edit-shape"]},"copilot":{"fallback_only":true}},"native_event_aliases":{"augment":{"SessionStart":"session_start","SessionEnd":"session_end","Stop":"stop","PostToolUse":"post_tool_use","PreToolUse":"pre_tool_use"},"claude":{"SessionStart":"session_start","SessionEnd":"session_end","Stop":"stop","UserPromptSubmit":"user_prompt_submit","PostToolUse":"post_tool_use","PreToolUse":"pre_tool_use","PreCompact":"pre_compact","SubagentStart":"subagent_start","SubagentStop":"subagent_stop"},"cowork":{"SessionStart":"session_start","SessionEnd":"session_end","Stop":"stop","UserPromptSubmit":"user_prompt_submit","PostToolUse":"post_tool_use","PreToolUse":"pre_tool_use","PreCompact":"pre_compact","SubagentStart":"subagent_start","SubagentStop":"subagent_stop"},"cursor":{"sessionStart":"session_start","sessionEnd":"session_end","stop":"stop","beforeSubmitPrompt":"user_prompt_submit","postToolUse":"post_tool_use","preToolUse":"pre_tool_use","preCompact":"pre_compact"},"cline":{"TaskStart":"session_start","TaskResume":"session_start","TaskComplete":"session_end","TaskCancel":"stop","UserPromptSubmit":"user_prompt_submit","PostToolUse":"post_tool_use","PreToolUse":"pre_tool_use","PreCompact":"pre_compact"},"windsurf":{"pre_user_prompt":"user_prompt_submit","post_cascade_response":"stop","post_setup_worktree":"session_start"},"gemini":{"SessionStart":"session_start","SessionEnd":"session_end","BeforeAgent":"user_prompt_submit","AfterAgent":"stop","BeforeTool":"pre_tool_use","AfterTool":"post_tool_use"}}}}
|
|
@@ -80,12 +80,18 @@ concerns:
|
|
|
80
80
|
severity: advisory
|
|
81
81
|
# Phase 5 — Tier-1 hook for the verify-before-complete rule. Records
|
|
82
82
|
# observable evidence of verification commands (tests, quality tools,
|
|
83
|
-
# builds) into agents/state/verify-before-complete
|
|
84
|
-
#
|
|
85
|
-
# `
|
|
86
|
-
#
|
|
87
|
-
#
|
|
88
|
-
#
|
|
83
|
+
# builds) into agents/state/verify-before-complete/<digest>.json — ONE FILE
|
|
84
|
+
# PER SESSION since 2026-08-20, addressed through
|
|
85
|
+
# `before_complete_hook.statePathFor`. Two earlier corrections are worth
|
|
86
|
+
# keeping visible, because this comment was wrong about the path twice: it
|
|
87
|
+
# said `agents/runtime/state/` until round 7 (a directory the code never
|
|
88
|
+
# used), and it named the single `STATE_FILE` until the split, which is the
|
|
89
|
+
# constant `prune_legacy_state_file` now DELETES. The rule body cites that
|
|
90
|
+
# state as the source of truth for "verified this turn?". Since round 7 it
|
|
91
|
+
# also carries `ci_last`, the session-scoped CI-settle negative that
|
|
92
|
+
# `turn-end-gate` reads to refuse a premature completion claim — and
|
|
93
|
+
# "session-scoped" is now a property of the layout rather than of a reset
|
|
94
|
+
# that fired when a foreign id showed up in a shared file.
|
|
89
95
|
verify-before-complete:
|
|
90
96
|
script: src/scripts/before_complete_hook.ts
|
|
91
97
|
args: []
|
|
@@ -423,6 +429,34 @@ concerns:
|
|
|
423
429
|
args: []
|
|
424
430
|
fail_closed: false
|
|
425
431
|
severity: advisory
|
|
432
|
+
# road-to-org-telemetry Phase 2 (step 2.1) — session-end Class-A flush.
|
|
433
|
+
# Checks whether the outbound spool has bytes and, if so, spawns a DETACHED
|
|
434
|
+
# sender and returns. It makes no network call in the session's own process,
|
|
435
|
+
# ever, and that shape is measured rather than preferred: Phase 0's second
|
|
436
|
+
# spike pre-registered "at or below one second at p95" for an inline flush
|
|
437
|
+
# and measured 1002 ms against a blackhole sink (a socket that accepts and
|
|
438
|
+
# never answers — the shape a wedged sink takes), against 20.5 ms for the
|
|
439
|
+
# detached spool. The step's own text defers to that result.
|
|
440
|
+
#
|
|
441
|
+
# DEFAULT-OFF and then some, exactly as telemetry-usage: `active` needs
|
|
442
|
+
# `enabled` AND an endpoint AND an org id AND a salt, none of which this
|
|
443
|
+
# public repository ships a value for, so a clone cannot reach the spawn
|
|
444
|
+
# path. `flush: never` short-circuits before the spool is stat-ed. Inactive
|
|
445
|
+
# ⇒ zero telemetry file operations and zero network calls.
|
|
446
|
+
#
|
|
447
|
+
# Bound on the six platforms that carry `session_end`; windsurf has the slot
|
|
448
|
+
# nowhere in this manifest, so an org running it keeps its records local
|
|
449
|
+
# until a flush slot exists there — a readable absence, not a silent one.
|
|
450
|
+
#
|
|
451
|
+
# Silent on every path and exit 0 always, including a failed spawn: a
|
|
452
|
+
# telemetry concern has nothing to say to the model, least of all at session
|
|
453
|
+
# end where the line would arrive after the last thing the user reads.
|
|
454
|
+
# Carries no hook-token-budget row — it emits nothing. fail_closed: false.
|
|
455
|
+
telemetry-flush:
|
|
456
|
+
script: src/scripts/hooks/telemetry_flush_hook.ts
|
|
457
|
+
args: []
|
|
458
|
+
fail_closed: false
|
|
459
|
+
severity: advisory
|
|
426
460
|
# Self-repair intake (road-to-self-repair Phase 1). Two slots, one queue:
|
|
427
461
|
# user_prompt_submit opens a record when the user states the agent worked
|
|
428
462
|
# wrongly and injects the open-queue line; stop runs the deterministic
|
|
@@ -832,6 +866,35 @@ concerns:
|
|
|
832
866
|
fail_closed: false
|
|
833
867
|
severity: advisory
|
|
834
868
|
tools: [Agent, Task]
|
|
869
|
+
# road-to-source-first-frontend Phase 3 Steps 1-2 — source-first gate, SHADOW
|
|
870
|
+
# ONLY, per docs/contracts/concern-activation-policy.md. On every
|
|
871
|
+
# capture-shaped tool call it appends one `source_first_gate_shadow` line
|
|
872
|
+
# recording what the gate WOULD have warned under four candidate gating
|
|
873
|
+
# rules. It emits nothing to the model and has no code path that can warn or
|
|
874
|
+
# deny.
|
|
875
|
+
#
|
|
876
|
+
# Phase 3 Step 1 was drafted as `exit 2 warn` and Step 2 left the posture an
|
|
877
|
+
# explicit maintainer call; the roadmap's own 2026-08-17 correction records
|
|
878
|
+
# that the activation policy contradicts the drafted default-ON warn. Shadow
|
|
879
|
+
# is the re-argued answer, and it dissolves both of that step's blocking
|
|
880
|
+
# dependencies rather than waiting on them: the verifier-exemption risk is a
|
|
881
|
+
# harm of EMISSION (a concern that emits nothing warns nobody, so the open
|
|
882
|
+
# SLI `agent_id` binding becomes a recorded field instead of a gate), and the
|
|
883
|
+
# unfinished multi-host matcher census becomes the measurement rather than a
|
|
884
|
+
# false-positive generator (`capture_kind` separates page-reaching capture
|
|
885
|
+
# from display capture on every record).
|
|
886
|
+
#
|
|
887
|
+
# No `tools:` filter on purpose: the concern must see ordinary reads to latch
|
|
888
|
+
# whether the handover source was read before the capture. The flip condition
|
|
889
|
+
# to advisory is pre-registered in the hook header.
|
|
890
|
+
#
|
|
891
|
+
# Never blocks, never warns: exit 0 on every path. fail_closed: false.
|
|
892
|
+
source-first-gate:
|
|
893
|
+
script: src/scripts/hooks/source_first_gate_hook.ts
|
|
894
|
+
args: []
|
|
895
|
+
fail_closed: false
|
|
896
|
+
severity: advisory
|
|
897
|
+
needs_payload_bodies: [input]
|
|
835
898
|
|
|
836
899
|
# Role axis (road-to-token-economy-dispatch Phase 2). The dispatcher reads
|
|
837
900
|
# AGENT_CONFIG_SESSION_ROLE (resolved via _lib/session_role.ts — set ONLY by
|
|
@@ -884,17 +947,17 @@ roles:
|
|
|
884
947
|
platforms:
|
|
885
948
|
augment:
|
|
886
949
|
session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, telemetry-disclosure, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
|
|
887
|
-
session_end: [chat-history, memory-learn, session-register, roadmap-progress]
|
|
950
|
+
session_end: [chat-history, memory-learn, session-register, roadmap-progress, telemetry-flush]
|
|
888
951
|
stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register, roadmap-progress]
|
|
889
952
|
pre_tool_use: [block-no-verify, block-unauthorized-git, evidence-independence, block-kernel-rule-writes, block-config-weakening, rtk-wrap, design-slop, ui-route-nudge, code-graph-nudge, ship-diff-volume, reread-guard]
|
|
890
953
|
post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, telemetry-usage, tool-result-bytes, edit-shape]
|
|
891
954
|
|
|
892
955
|
claude:
|
|
893
956
|
session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, telemetry-disclosure, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
|
|
894
|
-
session_end: [chat-history, memory-learn, session-register, roadmap-progress]
|
|
957
|
+
session_end: [chat-history, memory-learn, session-register, roadmap-progress, telemetry-flush]
|
|
895
958
|
stop: [chat-history, hot-context, verify-before-complete, team-review-gate, end-review-nudge, turn-end-gate, self-repair, session-register, session-eol, interruption-ledger, roadmap-progress, run-continuation]
|
|
896
959
|
user_prompt_submit: [chat-history, verify-before-complete, minimal-safe-diff, language-mirror, delegation-nudge, skill-route, git-authorization, session-canary, self-repair, session-register]
|
|
897
|
-
pre_tool_use: [block-no-verify, block-unauthorized-git, evidence-independence, block-kernel-rule-writes, block-config-weakening, rtk-wrap, design-slop, ui-route-nudge, code-graph-nudge, ship-diff-volume, reread-guard, spawn-guard-shadow]
|
|
960
|
+
pre_tool_use: [block-no-verify, block-unauthorized-git, evidence-independence, block-kernel-rule-writes, block-config-weakening, rtk-wrap, design-slop, ui-route-nudge, code-graph-nudge, ship-diff-volume, reread-guard, spawn-guard-shadow, source-first-gate]
|
|
898
961
|
post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, telemetry-usage, tool-result-bytes, edit-shape, language-mirror]
|
|
899
962
|
# `language-mirror` — round-5 § 6.1. `pre_compact` sets a pin-lost marker;
|
|
900
963
|
# the `post_tool_use` entry above re-emits the pin exactly once while that
|
|
@@ -935,7 +998,7 @@ platforms:
|
|
|
935
998
|
# agents/settings/contexts/chat-history-platform-hooks.md § Cowork.
|
|
936
999
|
cowork:
|
|
937
1000
|
session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, telemetry-disclosure, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
|
|
938
|
-
session_end: [chat-history, memory-learn, session-register, roadmap-progress]
|
|
1001
|
+
session_end: [chat-history, memory-learn, session-register, roadmap-progress, telemetry-flush]
|
|
939
1002
|
# end-review-nudge and delegation-nudge are DELIBERATELY NOT bound on
|
|
940
1003
|
# this platform (F10, review) — cowork-dispatcher.sh's own header states
|
|
941
1004
|
# it "always exit[s] 0" and its dispatch line discards the dispatcher's
|
|
@@ -948,7 +1011,7 @@ platforms:
|
|
|
948
1011
|
# still costs the dispatch, and its entire output is thrown away.
|
|
949
1012
|
stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register, roadmap-progress]
|
|
950
1013
|
user_prompt_submit: [chat-history, verify-before-complete, minimal-safe-diff, language-mirror, git-authorization, session-canary, self-repair, session-register]
|
|
951
|
-
pre_tool_use: [block-no-verify, block-unauthorized-git, evidence-independence, block-kernel-rule-writes, block-config-weakening, rtk-wrap, design-slop, ui-route-nudge, code-graph-nudge, ship-diff-volume, reread-guard, spawn-guard-shadow]
|
|
1014
|
+
pre_tool_use: [block-no-verify, block-unauthorized-git, evidence-independence, block-kernel-rule-writes, block-config-weakening, rtk-wrap, design-slop, ui-route-nudge, code-graph-nudge, ship-diff-volume, reread-guard, spawn-guard-shadow, source-first-gate]
|
|
952
1015
|
post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, telemetry-usage, tool-result-bytes, edit-shape]
|
|
953
1016
|
# subagent-ledger IS bound here, unlike the two nudges above, and the
|
|
954
1017
|
# difference is the delivery channel rather than the platform: the nudges
|
|
@@ -969,7 +1032,7 @@ platforms:
|
|
|
969
1032
|
# agents/settings/contexts/chat-history-platform-hooks.md.
|
|
970
1033
|
cursor:
|
|
971
1034
|
session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, telemetry-disclosure, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
|
|
972
|
-
session_end: [chat-history, memory-learn, session-register, roadmap-progress]
|
|
1035
|
+
session_end: [chat-history, memory-learn, session-register, roadmap-progress, telemetry-flush]
|
|
973
1036
|
stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register, roadmap-progress]
|
|
974
1037
|
user_prompt_submit: [chat-history, verify-before-complete, minimal-safe-diff, language-mirror, git-authorization, session-canary, self-repair, session-register]
|
|
975
1038
|
post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, telemetry-usage, tool-result-bytes, edit-shape]
|
|
@@ -984,7 +1047,7 @@ platforms:
|
|
|
984
1047
|
# session is interrupted with partial state (mirrors Augment Stop).
|
|
985
1048
|
cline:
|
|
986
1049
|
session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, telemetry-disclosure, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
|
|
987
|
-
session_end: [chat-history, memory-learn, session-register, roadmap-progress]
|
|
1050
|
+
session_end: [chat-history, memory-learn, session-register, roadmap-progress, telemetry-flush]
|
|
988
1051
|
stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register, roadmap-progress]
|
|
989
1052
|
user_prompt_submit: [chat-history, verify-before-complete, minimal-safe-diff, language-mirror, git-authorization, session-canary, self-repair, session-register]
|
|
990
1053
|
post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, telemetry-usage, tool-result-bytes, edit-shape]
|
|
@@ -1020,7 +1083,7 @@ platforms:
|
|
|
1020
1083
|
# — this is our `stop` slot.
|
|
1021
1084
|
gemini:
|
|
1022
1085
|
session_start: [chat-history, hot-context, handoff-context, session-canary, council-availability, telemetry-disclosure, first-run-gate, onboarding-gate, verify-before-complete, minimal-safe-diff, profile-staleness, wrapper-freshness, surface-probe, session-register]
|
|
1023
|
-
session_end: [chat-history, memory-learn, session-register, roadmap-progress]
|
|
1086
|
+
session_end: [chat-history, memory-learn, session-register, roadmap-progress, telemetry-flush]
|
|
1024
1087
|
stop: [chat-history, hot-context, verify-before-complete, self-repair, session-register, roadmap-progress]
|
|
1025
1088
|
user_prompt_submit: [chat-history, verify-before-complete, minimal-safe-diff, language-mirror, git-authorization, session-canary, self-repair, session-register]
|
|
1026
1089
|
post_tool_use: [chat-history, roadmap-progress, context-hygiene, verify-before-complete, minimal-safe-diff, injection-scan, pr-url-reminder, orchestration-record, telemetry-usage, tool-result-bytes, edit-shape]
|