@event4u/agent-config 14.6.0 → 14.8.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 +255 -145
- package/README.md +1 -1
- package/dist/agent-src/commands/analyze/inbox.md +264 -10
- package/dist/agent-src/commands/analyze.md +1 -1
- package/dist/agent-src/commands/evals/git-pr-merge.json +13 -0
- package/dist/agent-src/commands/evals/roadmap.json +17 -1
- package/dist/agent-src/commands/pr/create.md +14 -2
- package/dist/agent-src/commands/pr/merge.md +379 -0
- package/dist/agent-src/commands/roadmap/process-full.md +272 -32
- package/dist/agent-src/commands/roadmap.md +1 -1
- package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +46 -36
- package/dist/agent-src/contexts/execution/autonomy-mechanics.md +37 -2
- package/dist/agent-src/contexts/execution/roadmap-execution-contract.md +95 -2
- package/dist/agent-src/contexts/execution/roadmap-process-loop.md +289 -106
- package/dist/agent-src/rules/artifact-drafting-protocol.md +5 -1
- package/dist/agent-src/rules/context-hygiene.md +2 -0
- package/dist/agent-src/rules/decision-revisit-gate.md +67 -32
- 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 +20 -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 +26 -7
- package/dist/agent-src/scripts/dashboard_mode.ts +212 -0
- 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 +296 -53
- package/dist/agent-src/skills/adr-create/SKILL.md +124 -5
- 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-record/SKILL.md +61 -3
- package/dist/agent-src/skills/decision-review/SKILL.md +65 -0
- package/dist/agent-src/skills/merge-conflicts/SKILL.md +26 -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/security/SKILL.md +8 -0
- package/dist/agent-src/skills/security-audit/SKILL.md +12 -1
- 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 +65 -4
- 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 +2 -1
- package/dist/cli/registry.js.map +1 -1
- package/dist/cli-delegate/chunk-2GNWGMAL.js +172 -0
- package/dist/cli-delegate/{chunk-P6LQDIWK.js → chunk-7PRE6ZV2.js} +338 -0
- package/dist/cli-delegate/{chunk-BKO2AZ7Z.js → chunk-B2ERU2VA.js} +1 -1
- package/dist/cli-delegate/chunk-E4XIZDIB.js +402 -0
- package/dist/cli-delegate/{chunk-3UCJWMMP.js → chunk-EEJUMCDZ.js} +16 -16
- package/dist/cli-delegate/{chunk-NXFWFAYV.js → chunk-G23AT6GD.js} +1 -0
- package/dist/cli-delegate/{chunk-XURJ4AQC.js → chunk-H4VIVD4C.js} +385 -284
- package/dist/cli-delegate/chunk-I3EIN2YG.js +36 -0
- package/dist/cli-delegate/{chunk-RLN73PR5.js → chunk-LPPWO5CE.js} +12 -8
- package/dist/cli-delegate/chunk-MWRD5YOH.js +100 -0
- package/dist/cli-delegate/{chunk-UEZ7D35A.js → chunk-N7CDDGI3.js} +4 -23
- package/dist/cli-delegate/{chunk-63WSP6YZ.js → chunk-PMEKGDED.js} +74 -167
- 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_adr_effective.js +1162 -0
- package/dist/cli-delegate/cmd_conformance.js +466 -716
- package/dist/cli-delegate/cmd_converge.js +3 -3
- package/dist/cli-delegate/cmd_doctor.js +10 -10
- package/dist/cli-delegate/cmd_explain.js +1 -1
- package/dist/cli-delegate/cmd_export.js +10 -9
- package/dist/cli-delegate/cmd_handoff.js +10 -9
- package/dist/cli-delegate/cmd_memory_get.js +2 -1
- package/dist/cli-delegate/cmd_migrate.js +2 -2
- package/dist/cli-delegate/cmd_packs_active.js +1 -1
- package/dist/cli-delegate/cmd_preflight.js +5 -5
- package/dist/cli-delegate/cmd_prune.js +11 -10
- package/dist/cli-delegate/cmd_route_audit.js +6 -5
- package/dist/cli-delegate/cmd_route_explain.js +3 -3
- package/dist/cli-delegate/cmd_session_recycle.js +840 -30
- package/dist/cli-delegate/cmd_settings_get.js +3 -3
- package/dist/cli-delegate/cmd_settings_migrate.js +10 -9
- package/dist/cli-delegate/cmd_settings_set.js +1 -1
- package/dist/cli-delegate/cmd_sync.js +11 -10
- package/dist/cli-delegate/cmd_uninstall.js +13 -11
- package/dist/cli-delegate/cmd_update.js +4 -4
- package/dist/cli-delegate/cmd_upgrade.js +4 -4
- package/dist/cli-delegate/cmd_validate.js +11 -10
- package/dist/cli-delegate/cmd_versions.js +3 -3
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +111 -37
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +5 -5
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +15 -12
- package/dist/discovery/trust-report.md +3 -3
- package/dist/discovery/workspaces.json +11 -8
- package/dist/hooks/dispatch.js +3165 -2192
- package/dist/install/claudePathsPlan.js +187 -0
- package/dist/install/claudePathsPlan.js.map +1 -0
- package/dist/install/globalRuleLayers.js +169 -0
- package/dist/install/globalRuleLayers.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 +432 -0
- package/dist/install/partitionEligibility.js.map +1 -0
- package/dist/install/ruleLayerPartition.js +157 -0
- package/dist/install/ruleLayerPartition.js.map +1 -0
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +1863 -1234
- 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/_lib/prune_empty_dirs.js +85 -0
- package/dist/scripts/_lib/prune_empty_dirs.js.map +1 -0
- package/dist/scripts/condense.js +63 -251
- 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/artifact-drafting-protocol-mechanics.md +45 -1
- package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +26 -0
- package/docs/guidelines/agent-infra/false-green.md +47 -1
- 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 +26 -7
- package/src/agent-src/scripts/dashboard_mode.ts +212 -0
- 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 +296 -53
- 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 +39 -0
- package/src/config/estate-count-budget.json +612 -3
- package/src/config/evaluator-budgets.json +3 -3
- package/src/config/gate-coverage.yml +220 -12
- package/src/config/gate-violation-baselines.json +73 -63
- package/src/config/gitignore-block.txt +15 -2
- package/src/config/hook-latency-budget.json +5 -0
- package/src/config/rule-activation-census.json +14 -6
- package/src/config/rule-stub-ceilings.json +34 -7
- package/src/install/claudePathsPlan.ts +196 -0
- package/src/install/globalRuleLayers.ts +197 -0
- package/src/install/hostLayerFingerprint.ts +145 -0
- package/src/install/partitionEligibility.ts +502 -0
- package/src/install/ruleLayerPartition.ts +212 -0
- package/src/scripts/_cli/cmd_adr_effective.ts +484 -0
- package/src/scripts/_cli/cmd_session_recycle.ts +9 -1
- package/src/scripts/_dispatch.bash +17 -1
- package/src/scripts/_lib/ac_heading.ts +30 -0
- package/src/scripts/_lib/adr_frontmatter.test.ts +365 -0
- package/src/scripts/_lib/adr_frontmatter.ts +459 -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 +49 -9
- package/src/scripts/_lib/installed_lock.ts +50 -5
- package/src/scripts/_lib/layer_overlap_notice.ts +11 -2
- package/src/scripts/_lib/md_section.ts +129 -0
- package/src/scripts/_lib/prune_empty_dirs.ts +80 -0
- package/src/scripts/_lib/scope_guard.sh +26 -3
- package/src/scripts/_lib/self_repair.ts +19 -0
- package/src/scripts/_lib/self_repair_class_b.ts +171 -0
- package/src/scripts/adr/evidence_census.ts +899 -0
- package/src/scripts/adr/regenerate_index.ts +12 -32
- package/src/scripts/adr_cite_check.ts +540 -39
- package/src/scripts/ai_council/cli_help.ts +55 -0
- package/src/scripts/audit_adr_coverage.ts +103 -17
- package/src/scripts/before_complete_hook.ts +153 -28
- package/src/scripts/bench_ab_v2_complexity.ts +27 -7
- package/src/scripts/bench_hook_latency.ts +204 -0
- package/src/scripts/build_archive_index.ts +34 -0
- package/src/scripts/check_adr_frontmatter.ts +574 -39
- package/src/scripts/check_hook_bundle_content.ts +219 -0
- package/src/scripts/check_new_adr_evidence.ts +529 -0
- package/src/scripts/check_references.ts +78 -0
- package/src/scripts/check_release_published.ts +32 -11
- package/src/scripts/check_rule_layer_partition.ts +531 -0
- package/src/scripts/check_single_delivery.ts +194 -17
- package/src/scripts/check_standing_rule_delivery.ts +8 -2
- package/src/scripts/ci_settle.ts +170 -0
- package/src/scripts/condense.ts +79 -259
- package/src/scripts/council_cli.ts +3 -3
- package/src/scripts/dispatch_r2_reviewer.ts +6 -14
- package/src/scripts/external_sources_denylist.json +4 -1
- 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 +21 -1
- package/src/scripts/hooks/concern_registry.ts +4 -0
- package/src/scripts/hooks/dispatch_hook.ts +154 -187
- package/src/scripts/hooks/dispatch_issues.ts +38 -19
- package/src/scripts/hooks/fallback_yaml.ts +66 -0
- package/src/scripts/hooks/host_semantics.ts +21 -0
- package/src/scripts/hooks/injection_budget.ts +13 -3
- package/src/scripts/hooks/py_json_dumps.ts +103 -0
- package/src/scripts/hooks/rtk_wrap_hook.ts +8 -3
- package/src/scripts/hooks/run_continuation_hook.ts +8 -5
- 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 +870 -21
- package/src/scripts/hooks/stdin_failure_policy.ts +96 -0
- 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/injection_scan_hook.ts +137 -5
- 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_hook_manifest.ts +49 -0
- package/src/scripts/lint_plan_risk_register.ts +4 -3
- package/src/scripts/lint_provenance_vocabulary.ts +472 -4
- package/src/scripts/lint_skill_router_head.ts +4 -4
- package/src/scripts/mcp_server/tools.ts +2 -2
- 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 +6 -0
- package/src/scripts/routing_doctor.ts +5 -1
- package/src/scripts/self_repair_hook.ts +37 -5
- package/src/scripts/session_register_hook.ts +11 -0
- 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 +170 -20
- 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-PPQO4NGR.js → chunk-6RJA2F5A.js} +3 -3
- package/dist/cli-delegate/{chunk-RYNADUFG.js → chunk-LWTYTX6F.js} +0 -0
- package/dist/cli-delegate/{chunk-FBKL6JWT.js → chunk-MMSGVZKV.js} +3 -3
package/dist/cli/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/cli/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,MAAM,CAAC,MAAM,QAAQ,GAA4B;IAC7C,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,iFAAiF,EAAE;IACtI,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,8BAA8B,EAAE;IACnF,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,kCAAkC,EAAE;IAC3F,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,oCAAoC,EAAE;IACzF,EAAE,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,oCAAoC,EAAE;IACrG,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,E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node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
read_lockfile
|
|
4
|
+
} from "./chunk-T7L2QK3K.js";
|
|
5
|
+
|
|
6
|
+
// src/scripts/_lib/turn_end_refusals.ts
|
|
7
|
+
import * as crypto from "node:crypto";
|
|
8
|
+
import * as fs from "node:fs";
|
|
9
|
+
import * as path from "node:path";
|
|
10
|
+
var DETECTOR_IDS = [
|
|
11
|
+
"promissory",
|
|
12
|
+
"language",
|
|
13
|
+
"verification",
|
|
14
|
+
"completion"
|
|
15
|
+
];
|
|
16
|
+
var REFUSAL_STATE_REL = path.join("agents", "runtime", "state", "turn-end-gate");
|
|
17
|
+
function refusalStateDir(workspaceRoot) {
|
|
18
|
+
return path.join(workspaceRoot, REFUSAL_STATE_REL);
|
|
19
|
+
}
|
|
20
|
+
function deriveSessionKey(sessionId) {
|
|
21
|
+
return crypto.createHash("sha256").update(sessionId).digest("hex").slice(0, 32);
|
|
22
|
+
}
|
|
23
|
+
function sessionRefusalFile(workspaceRoot, sessionKey) {
|
|
24
|
+
return path.join(refusalStateDir(workspaceRoot), `${sessionKey}.json`);
|
|
25
|
+
}
|
|
26
|
+
function readSessionCounts(workspaceRoot, sessionId) {
|
|
27
|
+
try {
|
|
28
|
+
const raw = fs.readFileSync(
|
|
29
|
+
sessionRefusalFile(workspaceRoot, deriveSessionKey(sessionId)),
|
|
30
|
+
"utf-8"
|
|
31
|
+
);
|
|
32
|
+
const rec = parseRecord(raw);
|
|
33
|
+
return rec === null ? null : countsOf(rec);
|
|
34
|
+
} catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function emptyCounts() {
|
|
39
|
+
return { promissory: 0, language: 0, verification: 0, completion: 0 };
|
|
40
|
+
}
|
|
41
|
+
function isDetector(v) {
|
|
42
|
+
return typeof v === "string" && DETECTOR_IDS.includes(v);
|
|
43
|
+
}
|
|
44
|
+
function parseRecord(raw) {
|
|
45
|
+
let decoded;
|
|
46
|
+
try {
|
|
47
|
+
decoded = JSON.parse(raw);
|
|
48
|
+
} catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
if (typeof decoded !== "object" || decoded === null || Array.isArray(decoded)) return null;
|
|
52
|
+
const o = decoded;
|
|
53
|
+
if (typeof o["refused_at"] !== "string") return null;
|
|
54
|
+
if (typeof o["refused_turn"] !== "number") return null;
|
|
55
|
+
if (!isDetector(o["detector"])) return null;
|
|
56
|
+
const rec = {
|
|
57
|
+
refused_at: o["refused_at"],
|
|
58
|
+
refused_turn: o["refused_turn"],
|
|
59
|
+
detector: o["detector"]
|
|
60
|
+
};
|
|
61
|
+
if (typeof o["first_refused_at"] === "string") rec.first_refused_at = o["first_refused_at"];
|
|
62
|
+
if (typeof o["agent_config_version"] === "string") {
|
|
63
|
+
rec.agent_config_version = o["agent_config_version"];
|
|
64
|
+
}
|
|
65
|
+
const counts = o["counts"];
|
|
66
|
+
if (typeof counts === "object" && counts !== null && !Array.isArray(counts)) {
|
|
67
|
+
const parsed = {};
|
|
68
|
+
for (const id of DETECTOR_IDS) {
|
|
69
|
+
const n = counts[id];
|
|
70
|
+
if (typeof n === "number" && Number.isFinite(n) && n >= 0) parsed[id] = n;
|
|
71
|
+
}
|
|
72
|
+
rec.counts = parsed;
|
|
73
|
+
}
|
|
74
|
+
return rec;
|
|
75
|
+
}
|
|
76
|
+
function countsOf(rec) {
|
|
77
|
+
const out = emptyCounts();
|
|
78
|
+
if (rec.counts === void 0) {
|
|
79
|
+
out[rec.detector] = 1;
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
let any = false;
|
|
83
|
+
for (const id of DETECTOR_IDS) {
|
|
84
|
+
const n = rec.counts[id];
|
|
85
|
+
if (typeof n === "number" && n > 0) {
|
|
86
|
+
out[id] = n;
|
|
87
|
+
any = true;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (!any) out[rec.detector] = 1;
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
function foldRefusal(prev, input) {
|
|
94
|
+
const counts = prev === null ? emptyCounts() : countsOf(prev);
|
|
95
|
+
for (const d of input.detectors) counts[d] += 1;
|
|
96
|
+
const primary = input.detectors[0] ?? prev?.detector ?? "verification";
|
|
97
|
+
const rec = {
|
|
98
|
+
refused_at: input.at,
|
|
99
|
+
refused_turn: input.turnOrdinal,
|
|
100
|
+
detector: primary,
|
|
101
|
+
first_refused_at: prev?.first_refused_at ?? prev?.refused_at ?? input.at,
|
|
102
|
+
counts
|
|
103
|
+
};
|
|
104
|
+
if (input.version !== void 0) rec.agent_config_version = input.version;
|
|
105
|
+
else if (prev?.agent_config_version !== void 0) {
|
|
106
|
+
rec.agent_config_version = prev.agent_config_version;
|
|
107
|
+
}
|
|
108
|
+
return rec;
|
|
109
|
+
}
|
|
110
|
+
function readInstallBoundary() {
|
|
111
|
+
try {
|
|
112
|
+
const lock = read_lockfile();
|
|
113
|
+
if (lock === null) return { version: null, installed_at: null };
|
|
114
|
+
return {
|
|
115
|
+
version: lock.agent_config_version ?? null,
|
|
116
|
+
installed_at: lock.installed_at ?? null
|
|
117
|
+
};
|
|
118
|
+
} catch {
|
|
119
|
+
return { version: null, installed_at: null };
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
var REFUSAL_STATE_MAX_AGE_DAYS = 90;
|
|
123
|
+
function pruneAgedRefusalState(workspaceRoot, opts = {}) {
|
|
124
|
+
const maxAgeDays = opts.maxAgeDays ?? REFUSAL_STATE_MAX_AGE_DAYS;
|
|
125
|
+
const now = opts.now ?? /* @__PURE__ */ new Date();
|
|
126
|
+
const dir = refusalStateDir(workspaceRoot);
|
|
127
|
+
const result = { scanned: 0, pruned: 0, kept: 0 };
|
|
128
|
+
let entries;
|
|
129
|
+
try {
|
|
130
|
+
entries = fs.readdirSync(dir);
|
|
131
|
+
} catch {
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
const cutoffMs = now.getTime() - maxAgeDays * 24 * 60 * 60 * 1e3;
|
|
135
|
+
for (const name of entries) {
|
|
136
|
+
if (!name.endsWith(".json")) continue;
|
|
137
|
+
result.scanned += 1;
|
|
138
|
+
const file = path.join(dir, name);
|
|
139
|
+
let rec = null;
|
|
140
|
+
try {
|
|
141
|
+
rec = parseRecord(fs.readFileSync(file, "utf-8"));
|
|
142
|
+
} catch {
|
|
143
|
+
rec = null;
|
|
144
|
+
}
|
|
145
|
+
if (rec === null) {
|
|
146
|
+
result.kept += 1;
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
const at = Date.parse(rec.refused_at);
|
|
150
|
+
if (!Number.isFinite(at) || at >= cutoffMs) {
|
|
151
|
+
result.kept += 1;
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
try {
|
|
155
|
+
fs.unlinkSync(file);
|
|
156
|
+
result.pruned += 1;
|
|
157
|
+
} catch {
|
|
158
|
+
result.kept += 1;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return result;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export {
|
|
165
|
+
deriveSessionKey,
|
|
166
|
+
sessionRefusalFile,
|
|
167
|
+
readSessionCounts,
|
|
168
|
+
parseRecord,
|
|
169
|
+
foldRefusal,
|
|
170
|
+
readInstallBoundary,
|
|
171
|
+
pruneAgedRefusalState
|
|
172
|
+
};
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
readHookStdin
|
|
4
|
+
} from "./chunk-F7DQWYR5.js";
|
|
5
|
+
import {
|
|
6
|
+
has_stable_session_id,
|
|
7
|
+
prune_legacy_state_file,
|
|
8
|
+
prune_stale_session_states,
|
|
9
|
+
session_state_file,
|
|
10
|
+
update_json_under_lock
|
|
11
|
+
} from "./chunk-E4XIZDIB.js";
|
|
2
12
|
|
|
3
13
|
// src/scripts/_lib/secret_detector.ts
|
|
4
14
|
var ENTROPY_MIN_TOKEN_LENGTH = 20;
|
|
@@ -469,7 +479,335 @@ function validateAssumption(input, label = "assumption") {
|
|
|
469
479
|
return errors;
|
|
470
480
|
}
|
|
471
481
|
|
|
482
|
+
// src/scripts/before_complete_hook.ts
|
|
483
|
+
import fs from "node:fs";
|
|
484
|
+
import path from "node:path";
|
|
485
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
486
|
+
var STATE_FILE = path.join("agents", "state", "verify-before-complete.json");
|
|
487
|
+
var STATE_DIR = path.join("agents", "state", "verify-before-complete");
|
|
488
|
+
var STATE_RETENTION_DAYS = 7;
|
|
489
|
+
function statePathFor(session_id) {
|
|
490
|
+
return session_state_file(STATE_DIR, session_id);
|
|
491
|
+
}
|
|
492
|
+
var COMMAND_TOOLS = /* @__PURE__ */ new Set([
|
|
493
|
+
"launch-process",
|
|
494
|
+
"launch_process",
|
|
495
|
+
// Augment
|
|
496
|
+
"Bash",
|
|
497
|
+
"BashTool",
|
|
498
|
+
// Claude Code
|
|
499
|
+
"run-process",
|
|
500
|
+
"runProcess",
|
|
501
|
+
// variants
|
|
502
|
+
"shell",
|
|
503
|
+
"execute_shell",
|
|
504
|
+
// generic / Cline
|
|
505
|
+
"RunShellCommand"
|
|
506
|
+
// Cursor
|
|
507
|
+
]);
|
|
508
|
+
var _VERIFICATION_RE = new RegExp(
|
|
509
|
+
"(?:^|[\\s;&|`(])(task\\s+(?:ci|test|tests|lint|check|qa|phpstan|rector|ecs|pest|pytest)|(?:\\./|\\.venv/bin/|vendor/bin/)?(?:pest|phpunit|phpstan|psalm|rector|ecs)\\b|(?:python3?|\\.venv/bin/python3?)\\s+-m\\s+pytest|pytest\\b|(?:npm|pnpm|yarn|bun)\\s+(?:run\\s+)?(?:test|check|lint|typecheck|tsc)|cargo\\s+(?:test|check|clippy)|go\\s+test|make\\s+(?:test|check|lint)|composer\\s+(?:test|check|lint|phpstan)|(?:php\\s+)?artisan\\s+test)",
|
|
510
|
+
"i"
|
|
511
|
+
);
|
|
512
|
+
function _now() {
|
|
513
|
+
return (/* @__PURE__ */ new Date()).toISOString().replace(/\.\d{3}Z$/, "+00:00");
|
|
514
|
+
}
|
|
515
|
+
function _empty_state() {
|
|
516
|
+
return {
|
|
517
|
+
schema_version: 1,
|
|
518
|
+
session_id: "",
|
|
519
|
+
turn_started_at: null,
|
|
520
|
+
last_verification: null,
|
|
521
|
+
verifications_this_turn: 0,
|
|
522
|
+
verifications_this_session: 0,
|
|
523
|
+
last_stop_at: null,
|
|
524
|
+
verified_this_turn: false,
|
|
525
|
+
ci_saw_pending: false,
|
|
526
|
+
nonevidence_this_turn: 0,
|
|
527
|
+
// Round 7 § Phase 1 — the last CI read, SESSION-scoped on purpose. Every
|
|
528
|
+
// other counter here is turn-scoped because a stale POSITIVE would wrongly
|
|
529
|
+
// vouch ("I verified"). This one is a NEGATIVE ("CI was not settled"), and a
|
|
530
|
+
// stale negative only ever refuses more often — so surviving the turn
|
|
531
|
+
// boundary preserves the freshness invariant rather than bypassing it. It
|
|
532
|
+
// has to survive it: the measured failure is a completion claim in a LATER
|
|
533
|
+
// turn than the poll it rests on.
|
|
534
|
+
ci_last: null,
|
|
535
|
+
checked_at: _now()
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
function _extract_command(payload) {
|
|
539
|
+
const toolRaw = payload["tool_name"] || payload["toolName"] || payload["tool"];
|
|
540
|
+
if (!(typeof toolRaw === "string" && COMMAND_TOOLS.has(toolRaw))) {
|
|
541
|
+
return [typeof toolRaw === "string" ? toolRaw : null, null];
|
|
542
|
+
}
|
|
543
|
+
const tool = toolRaw;
|
|
544
|
+
const ti = payload["tool_input"];
|
|
545
|
+
if (typeof ti === "object" && ti !== null && !Array.isArray(ti)) {
|
|
546
|
+
for (const key of ["command", "cmd", "shell_command"]) {
|
|
547
|
+
const v = ti[key];
|
|
548
|
+
if (typeof v === "string" && v) {
|
|
549
|
+
return [tool, v];
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
for (const key of ["command", "cmd"]) {
|
|
554
|
+
const v = payload[key];
|
|
555
|
+
if (typeof v === "string" && v) {
|
|
556
|
+
return [tool, v];
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
return [tool, null];
|
|
560
|
+
}
|
|
561
|
+
function _is_verification(command) {
|
|
562
|
+
return _VERIFICATION_RE.test(command) || isCiPoll(command);
|
|
563
|
+
}
|
|
564
|
+
var _VACUOUS_PATTERNS = [
|
|
565
|
+
// gh pr checks / gh run — no checks registered at all.
|
|
566
|
+
/\b0\s+(?:checks?|runs?)\b/i,
|
|
567
|
+
// Test runners reporting an empty run.
|
|
568
|
+
/\bno tests? (?:ran|found|to run|were run)\b/i,
|
|
569
|
+
/\bNo test files found\b/i,
|
|
570
|
+
/\b0\s+pass(?:ed|ing)?\b[\s,|·]*\b0\s+fail(?:ed|ing|ures)?\b/i,
|
|
571
|
+
/\bTests?\s+0\s+passed\b/i,
|
|
572
|
+
/\bRan 0 tests?\b/i,
|
|
573
|
+
// Linters / scanners with an empty target set.
|
|
574
|
+
/\bno files? (?:matched|to (?:lint|check|scan)|found)\b/i,
|
|
575
|
+
/\b0\s+files?\s+(?:checked|scanned|linted)\b/i,
|
|
576
|
+
/\bnothing to check\b/i
|
|
577
|
+
];
|
|
578
|
+
function isVacuousOutput(output) {
|
|
579
|
+
const text = output.trim();
|
|
580
|
+
if (!text) {
|
|
581
|
+
return false;
|
|
582
|
+
}
|
|
583
|
+
const lines = text.split("\n").filter((l) => l.trim());
|
|
584
|
+
return lines.every((l) => _VACUOUS_PATTERNS.some((re) => re.test(l)));
|
|
585
|
+
}
|
|
586
|
+
var _CI_POLL_RE = /\bgh\s+(?:pr\s+checks|run\s+(?:watch|list|view))\b/i;
|
|
587
|
+
function isCiPoll(command) {
|
|
588
|
+
return _CI_POLL_RE.test(command);
|
|
589
|
+
}
|
|
590
|
+
function pendingCount(output) {
|
|
591
|
+
const m = /(\d+)\s+(?:checks? )?pending\b/i.exec(output) ?? /\bpending[:=]\s*(\d+)/i.exec(output);
|
|
592
|
+
if (m?.[1] !== void 0) {
|
|
593
|
+
return Number(m[1]);
|
|
594
|
+
}
|
|
595
|
+
const rows = output.match(/^\S.*\b(pending|in_progress|queued)\b/gim);
|
|
596
|
+
if (rows) {
|
|
597
|
+
return rows.length;
|
|
598
|
+
}
|
|
599
|
+
if (/\bno checks reported\b/i.test(output)) {
|
|
600
|
+
return null;
|
|
601
|
+
}
|
|
602
|
+
if (/^\S+\s+(pass|fail|skipping|successful|failing)\b/im.test(output)) {
|
|
603
|
+
return 0;
|
|
604
|
+
}
|
|
605
|
+
return null;
|
|
606
|
+
}
|
|
607
|
+
function _extract_output(payload) {
|
|
608
|
+
for (const key of ["tool_response", "toolResponse", "output", "stdout", "result"]) {
|
|
609
|
+
const v = payload[key];
|
|
610
|
+
if (typeof v === "string") {
|
|
611
|
+
return v;
|
|
612
|
+
}
|
|
613
|
+
if (v !== null && typeof v === "object") {
|
|
614
|
+
return JSON.stringify(v);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
return null;
|
|
618
|
+
}
|
|
619
|
+
function _reset_turn(state, session_id) {
|
|
620
|
+
state["session_id"] = session_id || state["session_id"] || "";
|
|
621
|
+
state["turn_started_at"] = _now();
|
|
622
|
+
state["verifications_this_turn"] = 0;
|
|
623
|
+
state["verified_this_turn"] = false;
|
|
624
|
+
state["ci_saw_pending"] = false;
|
|
625
|
+
state["nonevidence_this_turn"] = 0;
|
|
626
|
+
return state;
|
|
627
|
+
}
|
|
628
|
+
function _asInt(v) {
|
|
629
|
+
if (!v) {
|
|
630
|
+
return 0;
|
|
631
|
+
}
|
|
632
|
+
if (typeof v === "number") {
|
|
633
|
+
return Math.trunc(v);
|
|
634
|
+
}
|
|
635
|
+
const n = Number(v);
|
|
636
|
+
return Number.isFinite(n) ? Math.trunc(n) : 0;
|
|
637
|
+
}
|
|
638
|
+
function _update(state, event, envelope) {
|
|
639
|
+
const session_id = envelope["session_id"] || state["session_id"] || "";
|
|
640
|
+
if (session_id && session_id !== state["session_id"]) {
|
|
641
|
+
state["session_id"] = session_id;
|
|
642
|
+
state["verifications_this_session"] = 0;
|
|
643
|
+
state["ci_last"] = null;
|
|
644
|
+
state = _reset_turn(state, session_id);
|
|
645
|
+
}
|
|
646
|
+
let payload = envelope["payload"];
|
|
647
|
+
if (!(typeof payload === "object" && payload !== null && !Array.isArray(payload))) {
|
|
648
|
+
payload = {};
|
|
649
|
+
}
|
|
650
|
+
const pl = payload;
|
|
651
|
+
if (event === "session_start" || event === "user_prompt_submit") {
|
|
652
|
+
state = _reset_turn(state, session_id);
|
|
653
|
+
} else if (event === "post_tool_use") {
|
|
654
|
+
const [tool, cmd] = _extract_command(pl);
|
|
655
|
+
if (cmd && _is_verification(cmd)) {
|
|
656
|
+
const output = _extract_output(pl);
|
|
657
|
+
const vacuous = output !== null && isVacuousOutput(output);
|
|
658
|
+
let counts = !vacuous;
|
|
659
|
+
if (isCiPoll(cmd)) {
|
|
660
|
+
const pending = output === null ? null : pendingCount(output);
|
|
661
|
+
if (pending !== null && pending > 0) {
|
|
662
|
+
state["ci_saw_pending"] = true;
|
|
663
|
+
counts = false;
|
|
664
|
+
} else if (pending === 0) {
|
|
665
|
+
counts = !vacuous && state["ci_saw_pending"] === true;
|
|
666
|
+
} else {
|
|
667
|
+
counts = false;
|
|
668
|
+
}
|
|
669
|
+
state["ci_last"] = {
|
|
670
|
+
at: _now(),
|
|
671
|
+
command: cmd.slice(0, 512),
|
|
672
|
+
pending,
|
|
673
|
+
settled: pending === 0 && counts === true
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
state["last_verification"] = {
|
|
677
|
+
command: cmd.slice(0, 512),
|
|
678
|
+
tool,
|
|
679
|
+
at: _now(),
|
|
680
|
+
platform: envelope["platform"] || "",
|
|
681
|
+
vacuous,
|
|
682
|
+
counted: counts
|
|
683
|
+
};
|
|
684
|
+
if (counts) {
|
|
685
|
+
state["verifications_this_turn"] = _asInt(state["verifications_this_turn"]) + 1;
|
|
686
|
+
state["verifications_this_session"] = _asInt(state["verifications_this_session"]) + 1;
|
|
687
|
+
state["verified_this_turn"] = true;
|
|
688
|
+
} else {
|
|
689
|
+
state["nonevidence_this_turn"] = _asInt(state["nonevidence_this_turn"]) + 1;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
} else if (event === "stop") {
|
|
693
|
+
state["last_stop_at"] = _now();
|
|
694
|
+
}
|
|
695
|
+
state["checked_at"] = _now();
|
|
696
|
+
return state;
|
|
697
|
+
}
|
|
698
|
+
function run(stdin_text, options) {
|
|
699
|
+
const { consumer_root } = options;
|
|
700
|
+
const verbose = options.verbose ?? false;
|
|
701
|
+
let envelope = {};
|
|
702
|
+
if (stdin_text.trim()) {
|
|
703
|
+
try {
|
|
704
|
+
const decoded = JSON.parse(stdin_text);
|
|
705
|
+
if (typeof decoded === "object" && decoded !== null && !Array.isArray(decoded)) {
|
|
706
|
+
envelope = decoded;
|
|
707
|
+
}
|
|
708
|
+
} catch {
|
|
709
|
+
envelope = {};
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
const event = envelope["event"] || "";
|
|
713
|
+
const session_id = typeof envelope["session_id"] === "string" ? envelope["session_id"] : "";
|
|
714
|
+
if (!has_stable_session_id(session_id)) {
|
|
715
|
+
if (verbose) {
|
|
716
|
+
process.stderr.write(
|
|
717
|
+
"verify-before-complete-hook: no session_id \u2014 running stateless, nothing recorded\n"
|
|
718
|
+
);
|
|
719
|
+
}
|
|
720
|
+
return 0;
|
|
721
|
+
}
|
|
722
|
+
const target = path.join(consumer_root, statePathFor(session_id));
|
|
723
|
+
let state = {};
|
|
724
|
+
const outcome = update_json_under_lock(target, (loaded) => {
|
|
725
|
+
state = _update({ ..._empty_state(), ...loaded }, event, envelope);
|
|
726
|
+
return state;
|
|
727
|
+
});
|
|
728
|
+
if (outcome === "failed") {
|
|
729
|
+
if (verbose) {
|
|
730
|
+
process.stderr.write("verify-before-complete-hook: state write failed\n");
|
|
731
|
+
}
|
|
732
|
+
return 0;
|
|
733
|
+
}
|
|
734
|
+
if (event === "session_start" || event === "user_prompt_submit") {
|
|
735
|
+
prune_legacy_state_file(path.join(consumer_root, STATE_FILE));
|
|
736
|
+
prune_stale_session_states(
|
|
737
|
+
path.join(consumer_root, STATE_DIR),
|
|
738
|
+
Date.now(),
|
|
739
|
+
STATE_RETENTION_DAYS
|
|
740
|
+
);
|
|
741
|
+
}
|
|
742
|
+
if (verbose) {
|
|
743
|
+
process.stderr.write(
|
|
744
|
+
`verify-before-complete-hook: event=${event} verified_this_turn=${pyRepr(state["verified_this_turn"])} verifications_this_turn=${pyRepr(state["verifications_this_turn"])}
|
|
745
|
+
`
|
|
746
|
+
);
|
|
747
|
+
}
|
|
748
|
+
return 0;
|
|
749
|
+
}
|
|
750
|
+
function pyRepr(value) {
|
|
751
|
+
if (value === null || value === void 0) {
|
|
752
|
+
return "None";
|
|
753
|
+
}
|
|
754
|
+
if (typeof value === "boolean") {
|
|
755
|
+
return value ? "True" : "False";
|
|
756
|
+
}
|
|
757
|
+
return String(value);
|
|
758
|
+
}
|
|
759
|
+
function parse_args(argv) {
|
|
760
|
+
let platform = "generic";
|
|
761
|
+
let verbose = false;
|
|
762
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
763
|
+
const arg = argv[i];
|
|
764
|
+
if (arg === "--platform") {
|
|
765
|
+
platform = argv[i + 1] ?? "generic";
|
|
766
|
+
i += 1;
|
|
767
|
+
} else if (arg !== void 0 && arg.startsWith("--platform=")) {
|
|
768
|
+
platform = arg.slice("--platform=".length);
|
|
769
|
+
} else if (arg === "--verbose") {
|
|
770
|
+
verbose = true;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
return { platform, verbose };
|
|
774
|
+
}
|
|
775
|
+
function _readStdin() {
|
|
776
|
+
return readHookStdin();
|
|
777
|
+
}
|
|
778
|
+
function main(argv) {
|
|
779
|
+
const args = parse_args(argv ?? process.argv.slice(2));
|
|
780
|
+
return run(_readStdin(), { consumer_root: process.cwd(), verbose: args.verbose });
|
|
781
|
+
}
|
|
782
|
+
function _isCliEntry() {
|
|
783
|
+
if (true) {
|
|
784
|
+
return false;
|
|
785
|
+
}
|
|
786
|
+
if (process.argv[1] === void 0) {
|
|
787
|
+
return false;
|
|
788
|
+
}
|
|
789
|
+
const argvUrl = pathToFileURL(path.resolve(process.argv[1])).href;
|
|
790
|
+
if (import.meta.url === argvUrl) {
|
|
791
|
+
return true;
|
|
792
|
+
}
|
|
793
|
+
try {
|
|
794
|
+
const here = fs.realpathSync(fileURLToPath(import.meta.url));
|
|
795
|
+
const argv = fs.realpathSync(path.resolve(process.argv[1]));
|
|
796
|
+
return here === argv;
|
|
797
|
+
} catch {
|
|
798
|
+
return false;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
var isCliEntry = _isCliEntry();
|
|
802
|
+
if (isCliEntry) {
|
|
803
|
+
process.exit(main(process.argv.slice(2)));
|
|
804
|
+
}
|
|
805
|
+
|
|
472
806
|
export {
|
|
807
|
+
statePathFor,
|
|
808
|
+
isVacuousOutput,
|
|
809
|
+
isCiPoll,
|
|
810
|
+
pendingCount,
|
|
473
811
|
CAPSULE_SCHEMA_VERSION,
|
|
474
812
|
scanEnvelopeDirectives,
|
|
475
813
|
wrapAsPriorSessionData,
|