@event4u/agent-config 16.0.0 → 16.1.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/.augment-plugin/marketplace.json +3 -3
- package/.augment-plugin/plugin.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +297 -137
- package/CONTRIBUTING.md +9 -0
- package/README.md +2 -2
- package/dist/agent-src/commands/analyze/inbox.md +26 -0
- package/dist/agent-src/commands/analyze/roadmap-repos.md +27 -0
- package/dist/agent-src/commands/challenge-me/closure.md +178 -0
- package/dist/agent-src/commands/challenge-me.md +9 -2
- package/dist/agent-src/commands/council/default.md +25 -5
- package/dist/agent-src/commands/feature/plan.md +28 -1
- package/dist/agent-src/commands/feature/roadmap.md +28 -1
- package/dist/agent-src/commands/implement-ticket.md +27 -0
- package/dist/agent-src/commands/jira-ticket.md +27 -0
- package/dist/agent-src/commands/pr/create.md +29 -0
- package/dist/agent-src/commands/pr/merge.md +60 -9
- package/dist/agent-src/commands/roadmap/ai-council.md +7 -1
- package/dist/agent-src/commands/roadmap/create.md +74 -27
- package/dist/agent-src/commands/roadmap/materialize.md +27 -0
- package/dist/agent-src/commands/roadmap/process-full.md +123 -18
- package/dist/agent-src/commands/team.md +22 -0
- package/dist/agent-src/contexts/authority/scope-growth-ownership.md +80 -0
- package/dist/agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +47 -0
- package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +44 -3
- package/dist/agent-src/contexts/execution/autonomy-mechanics.md +15 -15
- package/dist/agent-src/contexts/execution/decision-closure-execution.md +93 -0
- package/dist/agent-src/contexts/execution/fix-loop-ladder.md +108 -0
- package/dist/agent-src/contexts/execution/plan-confidence-gate.md +4 -2
- package/dist/agent-src/contexts/execution/roadmap-process-loop.md +75 -6
- package/dist/agent-src/guidelines/agent-infra/active-remediation-mechanics.md +57 -0
- package/dist/agent-src/guidelines/agent-infra/evaluator-independence-mechanics.md +102 -0
- package/dist/agent-src/guidelines/design-fidelity-routing.md +29 -0
- package/dist/agent-src/rules/autonomous-execution.md +15 -8
- package/dist/agent-src/rules/delegation-policy.md +23 -45
- package/dist/agent-src/rules/design-fidelity.md +32 -37
- package/dist/agent-src/rules/evaluator-independence.md +43 -49
- package/dist/agent-src/rules/test-first.md +41 -0
- package/dist/agent-src/skills/accessibility-auditor/data/manifest.json +3 -3
- package/dist/agent-src/skills/ai-council/SKILL.md +11 -3
- package/dist/agent-src/skills/api-design/data/manifest.json +3 -3
- package/dist/agent-src/skills/database/data/manifest.json +4 -4
- package/dist/agent-src/skills/database/data/query-tuning.csv +3 -3
- package/dist/agent-src/skills/design-review/SKILL.md +50 -0
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +14 -4
- package/dist/agent-src/skills/experiment-loop/SKILL.md +31 -1
- package/dist/agent-src/skills/roadmap-writing/SKILL.md +1 -1
- package/dist/agent-src/skills/storybook-workshop/SKILL.md +42 -3
- package/dist/agent-src/skills/threat-modeling/SKILL.md +9 -4
- package/dist/agent-src/skills/threat-modeling/data/manifest.json +4 -4
- package/dist/agent-src/skills/verify-repair-loop/SKILL.md +37 -3
- package/dist/agent-src/templates/agent-settings.md +1 -1
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/roadmaps.md +188 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/backend/_self_fix.ts +62 -2
- package/dist/agent-src/templates/scripts/work_engine/directives/backend/test.ts +1 -0
- package/dist/agent-src/templates/scripts/work_engine/directives/backend/verify.ts +1 -0
- package/dist/cli-delegate/check_update_banner.js +40 -2
- package/dist/cli-delegate/chunk-4E2W63DA.js +335 -0
- package/dist/cli-delegate/chunk-5R7HOLAF.js +99 -0
- package/dist/cli-delegate/{chunk-IVBPRCQO.js → chunk-6KFEC3G7.js} +1 -1
- package/dist/cli-delegate/{chunk-2TAQ2K4V.js → chunk-6KM6ORRY.js} +55 -386
- package/dist/cli-delegate/{chunk-2XY7ILBT.js → chunk-FC75PGJE.js} +42 -2
- package/dist/cli-delegate/{chunk-GYC3VRYN.js → chunk-FXYUYU4N.js} +57 -13
- package/dist/cli-delegate/{chunk-55ACLDUE.js → chunk-GJCBB2UG.js} +168 -10
- package/dist/cli-delegate/{chunk-AK6HODNQ.js → chunk-HDVVGPQW.js} +873 -539
- package/dist/cli-delegate/{chunk-H32DGUJH.js → chunk-P6ZHP5W2.js} +1 -1
- package/dist/cli-delegate/{chunk-57PN4GYJ.js → chunk-RGNIWTEA.js} +1 -1
- package/dist/cli-delegate/chunk-ROYYTEZU.js +39 -0
- package/dist/cli-delegate/{chunk-3FKR64R5.js → chunk-UNCRJBT3.js} +31 -7
- package/dist/cli-delegate/{chunk-2DK2VJWG.js → chunk-WGXTVKCQ.js} +20 -6
- package/dist/cli-delegate/chunk-YDPILCOL.js +152 -0
- package/dist/cli-delegate/cmd_analyze_session.js +1 -1
- package/dist/cli-delegate/cmd_brand_status.js +1 -1
- package/dist/cli-delegate/cmd_conformance.js +90 -56
- package/dist/cli-delegate/cmd_doctor.js +7 -5
- package/dist/cli-delegate/cmd_explain.js +2 -2
- package/dist/cli-delegate/cmd_export.js +9 -7
- package/dist/cli-delegate/cmd_fleet.js +4 -2
- package/dist/cli-delegate/cmd_handoff.js +4 -4
- package/dist/cli-delegate/cmd_mcp_available.js +1 -1
- package/dist/cli-delegate/cmd_migrate.js +2 -2
- package/dist/cli-delegate/cmd_packs_active.js +2 -2
- package/dist/cli-delegate/cmd_preflight.js +4 -2
- package/dist/cli-delegate/cmd_prune.js +10 -8
- package/dist/cli-delegate/cmd_route_audit.js +2 -2
- package/dist/cli-delegate/cmd_route_explain.js +1 -1
- package/dist/cli-delegate/cmd_session_recycle.js +2 -2
- package/dist/cli-delegate/cmd_settings_get.js +28 -2
- package/dist/cli-delegate/cmd_settings_migrate.js +9 -7
- package/dist/cli-delegate/cmd_settings_set.js +1 -1
- package/dist/cli-delegate/cmd_sync.js +10 -8
- package/dist/cli-delegate/cmd_uninstall.js +16 -13
- 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 +12 -10
- package/dist/cli-delegate/cmd_versions.js +1 -1
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +85 -38
- 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 +1832 -1007
- package/dist/install/claudeRuleRewrite.js +14 -3
- package/dist/install/conflict.js +60 -10
- package/dist/install/conflictTracker.js +218 -0
- package/dist/install/fsPrimitives.js +54 -0
- package/dist/install/install.mjs +2007 -1481
- package/dist/install/manifestFiles.js +259 -0
- package/dist/install/preflight.js +14 -2
- package/dist/install/preserve.js +157 -0
- package/dist/install/recordedOwnership.js +132 -0
- package/dist/install/txlog.js +11 -2
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +398 -39
- package/dist/router.json +1 -1
- package/dist/scripts/_lib/agent_settings.js +3 -2
- package/dist/scripts/_lib/fs_atomic.js +167 -0
- package/dist/scripts/_lib/installed_tools.js +460 -0
- package/dist/scripts/_lib/lean_projection_mode.js +3 -2
- package/dist/scripts/_lib/settings_renamed_keys.js +78 -0
- package/dist/server/routes/install.js +8 -0
- package/dist/server/routes/wizard.js +9 -3
- package/dist/server/schemas/settings.js +17 -5
- package/dist/shared/missionExecution.js +97 -0
- package/dist/ui/assets/{index-D0jaCRPM.js → index-DH1xc62v.js} +17 -17
- package/dist/ui/index.html +1 -1
- package/docs/MIGRATION.md +103 -0
- package/docs/contracts/settings-classes.md +26 -7
- package/docs/guidelines/agent-infra/active-remediation-mechanics.md +57 -0
- package/docs/guidelines/agent-infra/evaluator-independence-mechanics.md +102 -0
- package/docs/guidelines/design-fidelity-routing.md +29 -0
- package/package.json +1 -1
- package/src/agent-src/templates/scripts/work_engine/directives/backend/_self_fix.ts +62 -2
- package/src/agent-src/templates/scripts/work_engine/directives/backend/test.ts +1 -0
- package/src/agent-src/templates/scripts/work_engine/directives/backend/verify.ts +1 -0
- package/src/config/agent-settings.template.yml +139 -27
- package/src/config/auto-rule-budget.json +16 -0
- package/src/config/ci-local-parity.yml +18 -5
- package/src/config/continuity-surface.json +21 -0
- package/src/config/gate-coverage.yml +146 -13
- package/src/config/gate-violation-baselines.json +6 -6
- package/src/config/hook-token-budget.json +2 -0
- package/src/config/loop-surfaces.yaml +215 -0
- package/src/config/platform-anchor.json +3 -2
- package/src/config/release-gate-locality.yml +11 -0
- package/src/config/routing-coverage-seed.json +18 -4
- package/src/config/rule-enforcement-baseline.json +0 -1
- package/src/install/claudeRuleRewrite.ts +16 -2
- package/src/install/conflict.ts +65 -9
- package/src/install/conflictTracker.ts +299 -0
- package/src/install/fsPrimitives.ts +54 -0
- package/src/install/manifestFiles.ts +312 -0
- package/src/install/preflight.ts +16 -2
- package/src/install/preserve.ts +205 -0
- package/src/install/recordedOwnership.ts +149 -0
- package/src/install/txlog.ts +11 -2
- package/src/install/types.ts +19 -4
- package/src/scripts/_cli/cmd_conformance.ts +88 -15
- package/src/scripts/_cli/cmd_doctor.ts +4 -3
- package/src/scripts/_cli/cmd_route_explain.ts +9 -2
- package/src/scripts/_cli/cmd_settings_get.ts +44 -0
- package/src/scripts/_cli/doctor_execution.ts +90 -0
- package/src/scripts/_lib/activation_payload.ts +247 -0
- package/src/scripts/_lib/agent_settings.ts +4 -2
- package/src/scripts/_lib/authority_path.ts +102 -0
- package/src/scripts/_lib/cascade_base.ts +94 -0
- package/src/scripts/_lib/changelog_eras.ts +7 -2
- package/src/scripts/_lib/continuation_ladder.ts +149 -2
- package/src/scripts/_lib/council_transport.ts +129 -0
- package/src/scripts/_lib/delivery_ready.ts +112 -0
- package/src/scripts/_lib/forge_protection.ts +267 -0
- package/src/scripts/_lib/hook_platform_keys.ts +27 -0
- package/src/scripts/_lib/json_python_parity.ts +127 -0
- package/src/scripts/_lib/lean_projection_mode.ts +14 -3
- package/src/scripts/_lib/loop_surfaces.ts +382 -0
- package/src/scripts/_lib/mission_record.ts +190 -0
- package/src/scripts/_lib/obligation_frequency.ts +217 -0
- package/src/scripts/_lib/obligations.ts +402 -0
- package/src/scripts/_lib/orchestration_record.ts +11 -20
- package/src/scripts/_lib/release_highlights.ts +199 -10
- package/src/scripts/_lib/release_holds.ts +493 -0
- package/src/scripts/_lib/release_migration_gate.ts +184 -0
- package/src/scripts/_lib/rides_along.ts +102 -0
- package/src/scripts/_lib/settings_renamed_keys.ts +82 -0
- package/src/scripts/_lib/test_delta.ts +166 -0
- package/src/scripts/_lib/test_provenance.ts +171 -0
- package/src/scripts/_lib/typed_op_grant.ts +246 -0
- package/src/scripts/_lib/typed_op_watch.ts +185 -0
- package/src/scripts/ai_council/config.ts +8 -11
- package/src/scripts/ai_council/fallback_config.ts +5 -3
- package/src/scripts/ai_council/ownership_classes.ts +118 -0
- package/src/scripts/ask_block_census.ts +285 -15
- package/src/scripts/check_enforcement_matrix.ts +624 -0
- package/src/scripts/check_gate_reachability.ts +173 -10
- package/src/scripts/check_generator_sync.ts +954 -0
- package/src/scripts/check_preamble_payload_budget.ts +75 -2
- package/src/scripts/check_release_highlights.ts +33 -1
- package/src/scripts/check_release_holds.ts +567 -0
- package/src/scripts/check_rule_projection_integrity.ts +22 -12
- package/src/scripts/check_test_delta.ts +294 -0
- package/src/scripts/check_test_weakening.ts +299 -0
- package/src/scripts/closure_scan.ts +333 -0
- package/src/scripts/compile_hook_manifest.ts +43 -3
- package/src/scripts/council_record_shape.ts +209 -0
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +88 -9
- package/src/scripts/hooks/concern_registry.ts +4 -0
- package/src/scripts/hooks/design_pass_hook.ts +128 -3
- package/src/scripts/hooks/evidence_independence.ts +96 -0
- package/src/scripts/hooks/memory_recall_hook.ts +540 -0
- package/src/scripts/hooks/obligation_settle_hook.ts +182 -0
- package/src/scripts/hooks/rule_inject_hook.ts +49 -1
- package/src/scripts/hooks/run_continuation_hook.ts +17 -20
- package/src/scripts/hooks_doctor.ts +85 -0
- package/src/scripts/hooks_status.ts +19 -0
- package/src/scripts/install.ts +106 -206
- package/src/scripts/janitor.ts +7 -0
- package/src/scripts/lint_decision_classes.ts +464 -0
- package/src/scripts/lint_hook_manifest.ts +11 -0
- package/src/scripts/lint_major_migration_sections.ts +450 -0
- package/src/scripts/lint_plan_risk_register.ts +47 -3
- package/src/scripts/lint_roadmap_blockers.ts +61 -0
- package/src/scripts/lint_roadmap_producers.ts +202 -0
- package/src/scripts/measure_rule_budget.ts +101 -5
- package/src/scripts/new_roadmap.ts +37 -0
- package/src/scripts/orchestration_record.ts +0 -5
- package/src/scripts/release.ts +14 -98
- package/src/scripts/release_drill.ts +267 -1
- package/src/scripts/release_publication.ts +51 -0
- package/src/scripts/report_enforcement_drift.ts +566 -0
- package/src/scripts/report_host_injection_effect.ts +3 -11
- package/src/scripts/report_standing_payload_by_host.ts +26 -152
- package/src/scripts/schemas/agent-settings.schema.json +23 -0
- package/src/scripts/schemas/command.schema.json +4 -0
- package/src/scripts/scope_growth.ts +219 -0
- package/src/scripts/trigger_eval_grandfather.json +0 -1
- package/src/scripts/ui_conformance_probe.ts +622 -0
- package/src/server/schemas/settings.ts +31 -7
- package/src/shared/missionExecution.ts +126 -0
- package/dist/cli-delegate/chunk-523HCFYO.js +0 -90
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
2
|
+
|
|
3
|
+
// src/shared/missionExecution.ts
|
|
4
|
+
var ESCALATION_LADDER = [
|
|
5
|
+
"independent",
|
|
6
|
+
"council",
|
|
7
|
+
"team",
|
|
8
|
+
"owner_owned_check"
|
|
9
|
+
];
|
|
10
|
+
var FIX_LOOP_MAX_DEFAULT = 10;
|
|
11
|
+
var MISSION_AUTO_RUN_DEFAULT = true;
|
|
12
|
+
function resolveLocalAutoRun(inputs) {
|
|
13
|
+
if (inputs.configured) return { value: true, origin: "settings" };
|
|
14
|
+
if (!inputs.inMission) return { value: false, origin: "settings" };
|
|
15
|
+
const mission = inputs.missionValue ?? MISSION_AUTO_RUN_DEFAULT;
|
|
16
|
+
return mission ? { value: true, origin: "mission" } : { value: false, origin: "settings" };
|
|
17
|
+
}
|
|
18
|
+
function executionPostureFromOverrides(layers) {
|
|
19
|
+
const raw = {};
|
|
20
|
+
for (const [key, value] of layers) {
|
|
21
|
+
if (key === "execution.fix_loop_max") raw["fix_loop_max"] = value;
|
|
22
|
+
else if (key === "execution.escalation") raw["escalation"] = value;
|
|
23
|
+
}
|
|
24
|
+
return resolveExecutionPosture(raw);
|
|
25
|
+
}
|
|
26
|
+
function resolveExecutionPosture(raw) {
|
|
27
|
+
const block = raw ?? {};
|
|
28
|
+
const rawMax = block["fix_loop_max"];
|
|
29
|
+
const max = typeof rawMax === "number" && Number.isInteger(rawMax) && rawMax > 0 ? rawMax : FIX_LOOP_MAX_DEFAULT;
|
|
30
|
+
const rawLadder = block["escalation"];
|
|
31
|
+
const ladder = Array.isArray(rawLadder) && rawLadder.length > 0 && rawLadder.every((r) => typeof r === "string") ? rawLadder : ESCALATION_LADDER;
|
|
32
|
+
return { fix_loop_max: max, escalation: ladder };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
resolveLocalAutoRun,
|
|
37
|
+
executionPostureFromOverrides,
|
|
38
|
+
resolveExecutionPosture
|
|
39
|
+
};
|
|
@@ -4068,6 +4068,8 @@ var leanProjectionHost = external_exports.enum(["claude-code", "cursor", "cline"
|
|
|
4068
4068
|
var projectionMode = external_exports.enum(["legacy-all", "scoped"]);
|
|
4069
4069
|
var memoryCadence = external_exports.enum(["auto", "always", "never"]);
|
|
4070
4070
|
var projectAudience = external_exports.enum(["self", "internal", "client", "public"]);
|
|
4071
|
+
var deliveryMerge = external_exports.enum(["off", "on-green"]);
|
|
4072
|
+
var prTopology = external_exports.enum(["single", "stacked"]);
|
|
4071
4073
|
var settingsSchema = external_exports.object({
|
|
4072
4074
|
agent_config_version: external_exports.string().default("").describe(
|
|
4073
4075
|
'Pin the package to an exact semver (e.g. "1.4.2") so all teammates load the same skill / rule set. Leave empty to track whatever is installed locally \u2014 useful for the maintainers of this package, risky for production projects.'
|
|
@@ -4096,7 +4098,7 @@ var settingsSchema = external_exports.object({
|
|
|
4096
4098
|
),
|
|
4097
4099
|
lean_projection: external_exports.object({
|
|
4098
4100
|
mode: leanProjectionMode.default("eager-all").describe(
|
|
4099
|
-
"How the per-tool projector emits the rule layer. eager-all = every rule body inlined into every projection (safe; what an ABSENT key still resolves to, per ADR-267 decision point 4). thin = kernel rules full-bodied + non-kernel rules as router-resolved pointers (~45k GPT-tok lighter per session), with no delivery mechanism. delivery = thin stubs PLUS the rule-inject hook concern, which delivers a body back on a trigger match; this is the value the SHIPPED TEMPLATE carries for Claude Code since ADR-267, and the
|
|
4101
|
+
"How the per-tool projector emits the rule layer. eager-all = every rule body inlined into every projection (safe; what an ABSENT key still resolves to, per ADR-267 decision point 4). thin = kernel rules full-bodied + non-kernel rules as router-resolved pointers (~45k GPT-tok lighter per session, exact-BPE \u2014 a different unit from the chars/4 figures below, never compare the two directly), with no delivery mechanism. delivery = thin stubs PLUS the rule-inject hook concern, which delivers a body back on a trigger match; this is the value the SHIPPED TEMPLATE carries for Claude Code since ADR-267. SAVING AND CHARGE, MEASURED TOGETHER so neither is published alone (2026-09-12, `check_preamble_payload_budget`): the rule bucket falls 122,769 -> 24,537 chars/4 tok per session on a thinned host (-80.0%), and a trigger match costs p50 6,728 B / p90 14,016 B / max 16,297 B per fire over 318 gate-open fires of the frozen tests/eval/routing-matrix corpus at the concern's 16,384 B cap. Bytes per fire and tokens per session are different denominators and are never summed; re-read both rather than quoting this line. The ceiling for that charge is registered in src/config/hook-token-budget.json (user_prompt_submit slot sum 4,096 -> 16,384)."
|
|
4100
4102
|
),
|
|
4101
4103
|
hosts: external_exports.array(leanProjectionHost).default(["claude-code"]).describe(
|
|
4102
4104
|
"Which hosts a thinning mode may thin (ADR-267). Absent resolves to [claude-code]. Only the three hosts with a per-rule rule tree are accepted, and this enum is the AUTHORING layer: an id outside it is a hard validation FAILURE here and under validate_agent_settings, never a warning. resolveLeanProjectionHosts is the READ-TIME backstop for a hand-edited .agent-settings.yml that passed neither, and THERE the id is dropped with a warning (R2 finding 6 \u2014 the two layers answer differently and neither said so). Every host outside this list receives exactly what eager-all writes, asserted byte-for-byte by check_host_tree_parity."
|
|
@@ -4185,6 +4187,17 @@ var settingsSchema = external_exports.object({
|
|
|
4185
4187
|
"How the agent replies to PR review comments. create_review_comment = post a new review comment (works on every GitHub plan). replies_endpoint = thread the reply under the original comment (needs the newer REST endpoint). auto = detect at runtime, prefer threaded replies when available."
|
|
4186
4188
|
)
|
|
4187
4189
|
}),
|
|
4190
|
+
delivery: external_exports.object({
|
|
4191
|
+
merge: deliveryMerge.default("off").describe(
|
|
4192
|
+
"Whether a run may merge the pull request it produced. off (default) = the run ends at mergeable-green-and-open and says so. on-green = merge is permitted, and only when an object-bound grant covering {op: prod_merge, target: <base>} exists and the final head is required-check-green, target-current and tamper-checked. This key is a precondition, never the authorisation by itself; forge auto-merge is the mechanism, so branch protection stays the gate."
|
|
4193
|
+
),
|
|
4194
|
+
wait_for_ci: external_exports.boolean().default(true).describe(
|
|
4195
|
+
"Whether the run stays alive until the required checks settle. true (default) = the run drives CI and reports the settled verdict. false = the run ends once the branch is pushed and the PR is open, leaving the checks to be read later. Independent of merge: a run may wait for CI without being allowed to merge."
|
|
4196
|
+
),
|
|
4197
|
+
pr_topology: prTopology.default("single").describe(
|
|
4198
|
+
"How a mission's work is shaped into pull requests. single (default) = one branch, one pull request. stacked = a dependent series. stacked is never chosen by the agent and never asked about at roadmap creation \u2014 the owner plans it or it does not happen."
|
|
4199
|
+
)
|
|
4200
|
+
}),
|
|
4188
4201
|
augment: external_exports.object({
|
|
4189
4202
|
rules_use_symlinks: external_exports.boolean().default(false).describe(
|
|
4190
4203
|
"When true, .augment/rules/*.md are symlinks into dist/agent-src/rules/ \u2014 edits flow back to source on save. When false (default), they are copies \u2014 safer on Windows and shared volumes, but rule edits in .augment/ are lost on the next `task sync`."
|
|
@@ -4226,8 +4239,8 @@ var settingsSchema = external_exports.object({
|
|
|
4226
4239
|
skip_pre_run_gate: external_exports.boolean().default(true).describe(
|
|
4227
4240
|
'Skip the /roadmap:process-* pre-run confirmation gate. true (default) starts processing immediately and surfaces the resolved config inline; false shows the numbered-options gate and waits. A genuine "which roadmap?" ambiguity always prompts regardless.'
|
|
4228
4241
|
),
|
|
4229
|
-
quality_cadence: qualityCadence.default("
|
|
4230
|
-
"When the agent runs the full quality / test suite during /roadmap:process-* runs.
|
|
4242
|
+
quality_cadence: qualityCadence.default("per_phase").describe(
|
|
4243
|
+
"When the agent runs the full quality / test suite during /roadmap:process-* runs. per_phase = after each phase boundary (default since 2026-09-13 \u2014 end_of_roadmap lets errors compound across phases, which is expensive in a multi-phase autonomous run nobody is watching). end_of_roadmap = once, after the last step (fastest). per_step = after every single step (slowest, highest confidence)."
|
|
4231
4244
|
),
|
|
4232
4245
|
dashboard_regen_cadence: regenCadence.default("every_5_steps").describe(
|
|
4233
4246
|
"How often the agent regenerates agents/roadmaps/dashboard.md during a roadmap run. every_5_steps = batch the regen (default). per_step = after every step (freshest dashboard, highest subprocess overhead). phase_boundary = only at phase edges. A rename, phase add, or archive always regenerates immediately regardless."
|
|
@@ -4245,8 +4258,8 @@ var settingsSchema = external_exports.object({
|
|
|
4245
4258
|
}).default({ max_cost_per_run_usd: 5, max_cost_per_rolling_7d_usd: 25 })
|
|
4246
4259
|
}),
|
|
4247
4260
|
planning: external_exports.object({
|
|
4248
|
-
|
|
4249
|
-
|
|
4261
|
+
closure_pass: external_exports.boolean().default(true).describe(
|
|
4262
|
+
`Gate C \u2014 plan-closure pass. true (default) = a plan-artifact ask (/roadmap:create, roadmap-writing, /feature:plan, /feature:roadmap, /roadmap:materialize, /implement-ticket, /jira-ticket, /analyze:inbox, /analyze:roadmap-repos) ends in a closure pass (/challenge-me closure): every foreseeable decision is closed at the lowest rung that owns it and written into the roadmap's "## Decisions" table, so a long run never meets a question planning could have closed. false = inert, plan asks author directly. An explicit user bypass always wins for that turn and is counted as a bypass rather than as an absent closure.`
|
|
4250
4263
|
),
|
|
4251
4264
|
risk_review: external_exports.boolean().default(true).describe(
|
|
4252
4265
|
'Gate R1 \u2014 plan-risk review. true (default) = every ready (non-draft) plan must carry a schema-valid "## Risk Register" section (ranked risks, mitigation + anchor per row, freshness marker, exact honest-null grammar), enforced by lint_plan_risk_register at pre-push + CI. false = escape hatch, the validator skips.'
|
|
@@ -4255,9 +4268,20 @@ var settingsSchema = external_exports.object({
|
|
|
4255
4268
|
"Gate R2 \u2014 completion review at 100% roadmap completion / pre-PR. true (default) = a findings-before-fixes review by a fresh reviewer context must exist for the current diff hash (or an exact honest-null / skip declaration) before fix commits and PR creation, enforced by check_completion_review at pre-push + CI (CI authoritative; a crashed validator warns and allows). false = escape hatch, the validator skips."
|
|
4256
4269
|
)
|
|
4257
4270
|
}).default({}),
|
|
4271
|
+
execution: external_exports.object({
|
|
4272
|
+
fix_loop_max: external_exports.number().int().min(1).default(10).describe(
|
|
4273
|
+
"Consecutive failed fix attempts against one validation target before the escalation ladder reaches its terminal rung. Reaching the bound triggers a strategy change, never a question. Overridable globally, per project and per prompt."
|
|
4274
|
+
),
|
|
4275
|
+
escalation: external_exports.array(external_exports.string()).default(["independent", "council", "team", "owner_owned_check"]).describe(
|
|
4276
|
+
"The escalation rungs, in order, walked when the fix-loop bound is reached: independent (another session or a provider-diverse reviewer), council, team, then owner_owned_check \u2014 which asks whether the residue is owner-owned, not whether to ask the owner now."
|
|
4277
|
+
)
|
|
4278
|
+
}).default({}),
|
|
4258
4279
|
quality: external_exports.object({
|
|
4259
4280
|
local_auto_run: external_exports.boolean().default(false).describe(
|
|
4260
|
-
"Run quality tools (linters, type-checks, formatters) and the local test suite autonomously after edits. Off by default \u2014
|
|
4281
|
+
"Run quality tools (linters, type-checks, formatters) and the local test suite autonomously after edits, IN CHAT. Off by default \u2014 in a chat turn a human is present and remote CI is the authoritative gate, so a local full-pipeline run duplicates it at wall-clock cost. The agent only runs a quality tool on an explicit ask, a concrete CI failure, or the new-gate carve-out. A mission is governed by local_auto_run_in_mission instead."
|
|
4282
|
+
),
|
|
4283
|
+
local_auto_run_in_mission: external_exports.boolean().default(true).describe(
|
|
4284
|
+
"Run quality tools autonomously inside a mission \u2014 an autonomous roadmap run with a claimed contract. On by default: nobody is waiting, the next action belongs to the agent itself, and a red found twenty steps later costs more than the run that would have caught it at step one. Inert outside a mission, and a mission never lowers local_auto_run: true."
|
|
4261
4285
|
)
|
|
4262
4286
|
}),
|
|
4263
4287
|
design: external_exports.object({
|
|
@@ -4560,7 +4584,7 @@ var settingsSchema = external_exports.object({
|
|
|
4560
4584
|
}).default({}),
|
|
4561
4585
|
rtk_wrap: external_exports.object({
|
|
4562
4586
|
enabled: external_exports.boolean().default(false).describe(
|
|
4563
|
-
'PreToolUse RTK-wrap nudge (token-saving Phase 3). Default off. When on AND the binary on PATH is verified as Rust Token Killer (a live two-stage identity probe \u2014 not a self-reported flag, and never a colliding same-name binary), warns (never blocks) "re-run wrapped with rtk" before a single verbose CLI command (git/npm/cargo/docker/\u2026) \u2014 upstream reports 60\u201390% output-token savings (their estimate). Skips completeness-critical / piped / compound commands and git diff. No-op when rtk is absent, unverified, or a different tool.'
|
|
4587
|
+
'PreToolUse RTK-wrap nudge (token-saving Phase 3). Default off. When on AND the binary on PATH is verified as Rust Token Killer (a live two-stage identity probe \u2014 not a self-reported flag, and never a colliding same-name binary), warns (never blocks) "re-run wrapped with rtk" before a single verbose CLI command (git/npm/cargo/docker/\u2026) \u2014 upstream reports 60\u201390% output-token savings (their estimate). Skips completeness-critical / piped / compound commands and git diff. No-op when rtk is absent, unverified, or a different tool. Its own activation charge is one advisory line under the 1,024 B default concern cap in src/config/hook-token-budget.json; the per-fire distribution is UNMEASURED \u2014 stated rather than estimated, because the saving above is a third-party output-token claim and not a standing-payload reduction this package measured.'
|
|
4564
4588
|
)
|
|
4565
4589
|
}).default({}),
|
|
4566
4590
|
design_slop: external_exports.object({
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
buildInstallPlan,
|
|
4
|
+
classifyOwnership,
|
|
5
|
+
recordedHashesForRoot,
|
|
4
6
|
sha256File
|
|
5
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YDPILCOL.js";
|
|
6
8
|
import {
|
|
7
9
|
detectToolPresence
|
|
8
10
|
} from "./chunk-A4QJ6ENT.js";
|
|
@@ -17,23 +19,27 @@ import { existsSync } from "node:fs";
|
|
|
17
19
|
function isJsonTarget(entry) {
|
|
18
20
|
return entry.kind === "deployed" && entry.path.endsWith(".json");
|
|
19
21
|
}
|
|
20
|
-
function computeConflicts(plan) {
|
|
22
|
+
function computeConflicts(plan, recordedOverride) {
|
|
21
23
|
if (plan.policy.force) return [];
|
|
24
|
+
const recorded = recordedOverride ?? recordedHashesForRoot(plan.root);
|
|
22
25
|
const out = [];
|
|
23
26
|
for (const entries of Object.values(plan.filesByTool)) {
|
|
24
27
|
for (const entry of entries) {
|
|
25
28
|
if (entry.kind === "bridge") continue;
|
|
26
29
|
if (entry.sha256 === null) continue;
|
|
27
30
|
if (!existsSync(entry.path)) continue;
|
|
28
|
-
if (plan.policy.knownPaths.has(entry.path)) continue;
|
|
29
31
|
const onDisk = sha256File(entry.path);
|
|
32
|
+
const ownership = classifyOwnership(recorded.get(entry.path), onDisk);
|
|
33
|
+
if (ownership === "recorded-unchanged") continue;
|
|
34
|
+
if (ownership === "unknown" && plan.policy.knownPaths.has(entry.path)) continue;
|
|
30
35
|
if (onDisk === entry.sha256) continue;
|
|
31
36
|
out.push({
|
|
32
37
|
path: entry.path,
|
|
33
38
|
kind: entry.kind,
|
|
34
39
|
plannedSha256: entry.sha256,
|
|
35
40
|
existingSha256: onDisk,
|
|
36
|
-
mergeable: isJsonTarget(entry)
|
|
41
|
+
mergeable: isJsonTarget(entry),
|
|
42
|
+
ownership
|
|
37
43
|
});
|
|
38
44
|
}
|
|
39
45
|
}
|
|
@@ -133,8 +139,16 @@ function checkConflicts(inputs) {
|
|
|
133
139
|
id: "conflicts",
|
|
134
140
|
severity: "warning",
|
|
135
141
|
path: c.path,
|
|
136
|
-
message: `existing file conflicts with planned ${c.kind} content`,
|
|
137
|
-
remedy
|
|
142
|
+
message: c.ownership === "recorded-modified" ? `managed ${c.kind} file has been edited since we wrote it` : `existing file conflicts with planned ${c.kind} content`,
|
|
143
|
+
// A remedy here may only describe what an install actually does. Before
|
|
144
|
+
// the owner ruling of 2026-09-21 the writer overwrote every deployed
|
|
145
|
+
// file unconditionally, so the `recorded-modified` arm told the
|
|
146
|
+
// operator to back their edit up. It now preserves that file and stages
|
|
147
|
+
// the package content beside it, so the same sentence would be false in
|
|
148
|
+
// the opposite direction — it would understate a protection that ships.
|
|
149
|
+
// The `unknown` arm is unchanged: nothing is recorded for that path, so
|
|
150
|
+
// the writer still writes over it.
|
|
151
|
+
remedy: c.ownership === "recorded-modified" ? "installing preserves your edit and stages package content as <path>.agent-config.new; --force replaces it instead" : "back up this file \u2014 installing writes the planned content over it"
|
|
138
152
|
}));
|
|
139
153
|
}
|
|
140
154
|
function checkHostDetection(inputs) {
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
manifest_path
|
|
4
|
+
} from "./chunk-4E2W63DA.js";
|
|
5
|
+
import {
|
|
6
|
+
require_dist
|
|
7
|
+
} from "./chunk-OY53J6II.js";
|
|
8
|
+
import {
|
|
9
|
+
__toESM
|
|
10
|
+
} from "./chunk-J55WI3RR.js";
|
|
11
|
+
|
|
12
|
+
// src/install/plan.ts
|
|
13
|
+
import { createHash } from "node:crypto";
|
|
14
|
+
import { readFileSync, readdirSync, statSync } from "node:fs";
|
|
15
|
+
import { join, relative, resolve } from "node:path";
|
|
16
|
+
function sha256File(path) {
|
|
17
|
+
try {
|
|
18
|
+
const data = readFileSync(path);
|
|
19
|
+
return createHash("sha256").update(data).digest("hex");
|
|
20
|
+
} catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function fileEntry(path, kind, options) {
|
|
25
|
+
return {
|
|
26
|
+
path,
|
|
27
|
+
kind,
|
|
28
|
+
sha256: options.hashContent ? sha256File(path) : null
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function walkSourceTree(dir) {
|
|
32
|
+
const out = [];
|
|
33
|
+
walkInto(dir, out);
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
function walkInto(dir, out) {
|
|
37
|
+
let entries;
|
|
38
|
+
try {
|
|
39
|
+
entries = readdirSync(dir).sort();
|
|
40
|
+
} catch {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
for (const name of entries) {
|
|
44
|
+
const full = join(dir, name);
|
|
45
|
+
let isDir;
|
|
46
|
+
try {
|
|
47
|
+
isDir = statSync(full).isDirectory();
|
|
48
|
+
} catch {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (isDir) {
|
|
52
|
+
walkInto(full, out);
|
|
53
|
+
} else {
|
|
54
|
+
out.push(full);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function buildInstallPlan(inputs) {
|
|
59
|
+
const filesByTool = {};
|
|
60
|
+
for (const source of inputs.sources) {
|
|
61
|
+
const bucket = filesByTool[source.toolId] ?? [];
|
|
62
|
+
let files = walkSourceTree(source.srcDir);
|
|
63
|
+
if (source.fileFilter !== void 0) {
|
|
64
|
+
files = files.filter(source.fileFilter);
|
|
65
|
+
}
|
|
66
|
+
for (const srcFile of files) {
|
|
67
|
+
const rel = relative(source.srcDir, srcFile);
|
|
68
|
+
const destPath = resolve(source.destDir, rel);
|
|
69
|
+
bucket.push(
|
|
70
|
+
fileEntry(srcFile, source.kind, {
|
|
71
|
+
hashContent: source.kind !== "bridge"
|
|
72
|
+
})
|
|
73
|
+
);
|
|
74
|
+
bucket[bucket.length - 1] = {
|
|
75
|
+
...bucket[bucket.length - 1],
|
|
76
|
+
path: destPath
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
filesByTool[source.toolId] = bucket;
|
|
80
|
+
}
|
|
81
|
+
for (const source of inputs.sources) {
|
|
82
|
+
if (!(source.toolId in filesByTool)) {
|
|
83
|
+
filesByTool[source.toolId] = [];
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
version: 2,
|
|
88
|
+
target: inputs.target,
|
|
89
|
+
root: inputs.root,
|
|
90
|
+
filesByTool,
|
|
91
|
+
mergedKeysByTool: {},
|
|
92
|
+
policy: inputs.policy
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// src/install/recordedOwnership.ts
|
|
97
|
+
var YAML = __toESM(require_dist(), 1);
|
|
98
|
+
import { existsSync, readFileSync as readFileSync2 } from "node:fs";
|
|
99
|
+
import { homedir } from "node:os";
|
|
100
|
+
import { isAbsolute, join as join2, resolve as resolve2 } from "node:path";
|
|
101
|
+
var NO_RECORDED_HASHES = /* @__PURE__ */ new Map();
|
|
102
|
+
function classifyOwnership(recordedSha256, onDiskSha256) {
|
|
103
|
+
if (recordedSha256 === void 0 || recordedSha256 === null) return "unknown";
|
|
104
|
+
if (onDiskSha256 === null) return "unknown";
|
|
105
|
+
return recordedSha256 === onDiskSha256 ? "recorded-unchanged" : "recorded-modified";
|
|
106
|
+
}
|
|
107
|
+
function readRecordedHashes(manifestPath, projectRoot) {
|
|
108
|
+
if (!existsSync(manifestPath)) return NO_RECORDED_HASHES;
|
|
109
|
+
let doc;
|
|
110
|
+
try {
|
|
111
|
+
doc = YAML.parse(readFileSync2(manifestPath, "utf8"));
|
|
112
|
+
} catch {
|
|
113
|
+
return NO_RECORDED_HASHES;
|
|
114
|
+
}
|
|
115
|
+
if (doc === null || typeof doc !== "object" || Array.isArray(doc)) return NO_RECORDED_HASHES;
|
|
116
|
+
const tools = doc["tools"];
|
|
117
|
+
if (!Array.isArray(tools)) return NO_RECORDED_HASHES;
|
|
118
|
+
const out = /* @__PURE__ */ new Map();
|
|
119
|
+
for (const tool of tools) {
|
|
120
|
+
if (tool === null || typeof tool !== "object" || Array.isArray(tool)) continue;
|
|
121
|
+
const files = tool["files"];
|
|
122
|
+
if (!Array.isArray(files)) continue;
|
|
123
|
+
for (const entry of files) {
|
|
124
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry)) continue;
|
|
125
|
+
const rec = entry;
|
|
126
|
+
const raw = rec["path"];
|
|
127
|
+
if (typeof raw !== "string" || raw.length === 0) continue;
|
|
128
|
+
const sha = rec["sha256"];
|
|
129
|
+
const expanded = expanduser(raw);
|
|
130
|
+
const target = isAbsolute(expanded) ? resolve2(expanded) : resolve2(projectRoot, expanded);
|
|
131
|
+
out.set(target, typeof sha === "string" && sha.length > 0 ? sha : null);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return out;
|
|
135
|
+
}
|
|
136
|
+
function expanduser(p) {
|
|
137
|
+
if (p === "~") return homedir();
|
|
138
|
+
if (p.startsWith("~/") || process.platform === "win32" && p.startsWith("~\\")) {
|
|
139
|
+
return join2(homedir(), p.slice(2));
|
|
140
|
+
}
|
|
141
|
+
return p;
|
|
142
|
+
}
|
|
143
|
+
function recordedHashesForRoot(root, env) {
|
|
144
|
+
return readRecordedHashes(manifest_path(root, env), root);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export {
|
|
148
|
+
classifyOwnership,
|
|
149
|
+
recordedHashesForRoot,
|
|
150
|
+
sha256File,
|
|
151
|
+
buildInstallPlan
|
|
152
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
resolve_project_root
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FC75PGJE.js";
|
|
5
5
|
import "./chunk-NDJLNC6Q.js";
|
|
6
6
|
import "./chunk-J55WI3RR.js";
|
|
7
7
|
|
|
@@ -36,14 +36,15 @@ import {
|
|
|
36
36
|
frontmatterPaths,
|
|
37
37
|
proseEqual,
|
|
38
38
|
splitFrontmatter
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-GJCBB2UG.js";
|
|
40
40
|
import "./chunk-FTAISGDQ.js";
|
|
41
41
|
import "./chunk-M2DPGFZ4.js";
|
|
42
|
+
import "./chunk-ROYYTEZU.js";
|
|
42
43
|
import "./chunk-BTWUYDGN.js";
|
|
43
44
|
import {
|
|
44
45
|
projectStoreSlug,
|
|
45
46
|
resolveSessionRole
|
|
46
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-FXYUYU4N.js";
|
|
47
48
|
import {
|
|
48
49
|
atomic_write_json,
|
|
49
50
|
atomic_write_text,
|
|
@@ -57,18 +58,23 @@ import {
|
|
|
57
58
|
import {
|
|
58
59
|
artefact_roots
|
|
59
60
|
} from "./chunk-NUHLI2RX.js";
|
|
61
|
+
import {
|
|
62
|
+
readRecentEntries
|
|
63
|
+
} from "./chunk-5R7HOLAF.js";
|
|
60
64
|
import {
|
|
61
65
|
detectToolPresence
|
|
62
66
|
} from "./chunk-A4QJ6ENT.js";
|
|
63
67
|
import {
|
|
64
68
|
atomicAppendLine,
|
|
69
|
+
probeHostCapabilities
|
|
70
|
+
} from "./chunk-6KM6ORRY.js";
|
|
71
|
+
import "./chunk-T7L2QK3K.js";
|
|
72
|
+
import "./chunk-DMSZHXZS.js";
|
|
73
|
+
import {
|
|
65
74
|
manifest_path,
|
|
66
|
-
probeHostCapabilities,
|
|
67
75
|
read_manifest
|
|
68
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-4E2W63DA.js";
|
|
69
77
|
import "./chunk-MWRD5YOH.js";
|
|
70
|
-
import "./chunk-T7L2QK3K.js";
|
|
71
|
-
import "./chunk-DMSZHXZS.js";
|
|
72
78
|
import {
|
|
73
79
|
require_dist
|
|
74
80
|
} from "./chunk-OY53J6II.js";
|
|
@@ -77,7 +83,7 @@ import {
|
|
|
77
83
|
} from "./chunk-MCJYCQPF.js";
|
|
78
84
|
import {
|
|
79
85
|
load_agent_settings
|
|
80
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-FC75PGJE.js";
|
|
81
87
|
import "./chunk-NDJLNC6Q.js";
|
|
82
88
|
import {
|
|
83
89
|
__toESM
|
|
@@ -89,42 +95,9 @@ import * as fs15 from "node:fs";
|
|
|
89
95
|
import * as os7 from "node:os";
|
|
90
96
|
import * as path15 from "node:path";
|
|
91
97
|
import process5 from "node:process";
|
|
92
|
-
import { spawnSync as
|
|
98
|
+
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
93
99
|
import { fileURLToPath as fileURLToPath14, pathToFileURL as pathToFileURL14 } from "node:url";
|
|
94
100
|
|
|
95
|
-
// src/install/txlog.ts
|
|
96
|
-
import { createReadStream, createWriteStream, existsSync, readFileSync, renameSync, statSync, unlinkSync } from "node:fs";
|
|
97
|
-
var ROTATION_MAX_BYTES = 10 * 1024 * 1024;
|
|
98
|
-
var ROTATION_MAX_AGE_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
99
|
-
var RECOVERY_DEPTH_CAP = 500;
|
|
100
|
-
function readRecentEntries(logPath) {
|
|
101
|
-
if (!existsSync(logPath)) {
|
|
102
|
-
return [];
|
|
103
|
-
}
|
|
104
|
-
const raw = readFileSync(logPath, "utf8");
|
|
105
|
-
const lines = raw.split("\n").filter((l) => l.length > 0);
|
|
106
|
-
const tail = lines.slice(-RECOVERY_DEPTH_CAP);
|
|
107
|
-
const out = [];
|
|
108
|
-
for (const line of tail) {
|
|
109
|
-
const parsed = tryParseEntry(line);
|
|
110
|
-
if (parsed !== null) {
|
|
111
|
-
out.push(parsed);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return out;
|
|
115
|
-
}
|
|
116
|
-
function tryParseEntry(line) {
|
|
117
|
-
try {
|
|
118
|
-
const obj = JSON.parse(line);
|
|
119
|
-
if (typeof obj.ts !== "string" || typeof obj.kind !== "string" || typeof obj.path !== "string") {
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
return obj;
|
|
123
|
-
} catch {
|
|
124
|
-
return null;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
101
|
// src/scripts/router_target_paths.mjs
|
|
129
102
|
var ROUTE_TARGET_TEMPLATES = Object.freeze({
|
|
130
103
|
skill: Object.freeze(["dist/agent-src/skills/{id}/SKILL.md"]),
|
|
@@ -3799,10 +3772,28 @@ if (_isCliEntry6()) {
|
|
|
3799
3772
|
}
|
|
3800
3773
|
|
|
3801
3774
|
// src/scripts/hooks/evidence_independence.ts
|
|
3775
|
+
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
3802
3776
|
import crypto3 from "node:crypto";
|
|
3803
3777
|
import fs8 from "node:fs";
|
|
3804
3778
|
import path8 from "node:path";
|
|
3805
3779
|
import { fileURLToPath as fileURLToPath7, pathToFileURL as pathToFileURL7 } from "node:url";
|
|
3780
|
+
|
|
3781
|
+
// src/scripts/_lib/test_delta.ts
|
|
3782
|
+
function isCodePath(p) {
|
|
3783
|
+
const f = p.replace(/\\/g, "/");
|
|
3784
|
+
if (isTestPath(f)) return false;
|
|
3785
|
+
if (!/\.(ts|tsx|js|mjs|cjs)$/.test(f)) return false;
|
|
3786
|
+
if (f.endsWith(".d.ts")) return false;
|
|
3787
|
+
if (/^(dist|\.augment|\.claude|\.cursor|node_modules)\//.test(f)) return false;
|
|
3788
|
+
return /^(src|scripts)\//.test(f);
|
|
3789
|
+
}
|
|
3790
|
+
function isTestPath(p) {
|
|
3791
|
+
const f = p.replace(/\\/g, "/");
|
|
3792
|
+
if (/^tests\//.test(f)) return true;
|
|
3793
|
+
return /\.(test|spec)\.(ts|tsx|js|mjs|cjs)$/.test(f);
|
|
3794
|
+
}
|
|
3795
|
+
|
|
3796
|
+
// src/scripts/hooks/evidence_independence.ts
|
|
3806
3797
|
var EXIT_ALLOW5 = 0;
|
|
3807
3798
|
var EXIT_BLOCK2 = 1;
|
|
3808
3799
|
var STATE_FILE3 = path8.join("agents", "state", "evidence-dispatch.json");
|
|
@@ -3931,6 +3922,32 @@ function decide(tool, prompt, priorEvaluations) {
|
|
|
3931
3922
|
evaluations: priorEvaluations + 1
|
|
3932
3923
|
};
|
|
3933
3924
|
}
|
|
3925
|
+
function sameSessionTestFlag(command) {
|
|
3926
|
+
if (command === null || !/\bgit\b[^|;&]*\bcommit\b/.test(command)) return null;
|
|
3927
|
+
return SAME_SESSION_TEXT;
|
|
3928
|
+
}
|
|
3929
|
+
var SAME_SESSION_TEXT = "This commit stages both a test and code it could cover \u2014 the shape L0 takes in a diff, where the implementer authored the evaluator. This check reads the staged set only: it cannot tell who wrote the test, so it is a prompt to STATE the level, not a finding that you are at L0. L0 is a permitted FALLBACK, not the default: where a second session, a second model or a second provider was available, the test should have come from one of them. Say which in the commit or the PR body \u2014 a diff looks identical either way. See evaluator-independence \xA7 Tests are evaluators.";
|
|
3930
|
+
function touchesTestAndCode(paths) {
|
|
3931
|
+
return paths.some(isTestPath) && paths.some(isCodePath);
|
|
3932
|
+
}
|
|
3933
|
+
function _commandOf(envelope) {
|
|
3934
|
+
const payload = _isObject5(envelope["payload"]) ? envelope["payload"] : envelope;
|
|
3935
|
+
const input = _isObject5(payload["tool_input"]) ? payload["tool_input"] : payload;
|
|
3936
|
+
for (const key of ["command", "cmd", "shell_command"]) {
|
|
3937
|
+
const v = input[key];
|
|
3938
|
+
if (typeof v === "string" && v !== "") return v;
|
|
3939
|
+
}
|
|
3940
|
+
return null;
|
|
3941
|
+
}
|
|
3942
|
+
function _stagedPaths(consumer_root) {
|
|
3943
|
+
const r = spawnSync3("git", ["diff", "--cached", "--name-only"], {
|
|
3944
|
+
cwd: consumer_root,
|
|
3945
|
+
encoding: "utf8"
|
|
3946
|
+
});
|
|
3947
|
+
if (r.status !== 0) return null;
|
|
3948
|
+
const out = r.stdout.split("\n").map((s) => s.trim()).filter((s) => s !== "");
|
|
3949
|
+
return out.length === 0 ? null : out;
|
|
3950
|
+
}
|
|
3934
3951
|
function run3(stdin_text, options) {
|
|
3935
3952
|
let envelope = {};
|
|
3936
3953
|
if (stdin_text.trim()) {
|
|
@@ -3953,6 +3970,15 @@ function run3(stdin_text, options) {
|
|
|
3953
3970
|
state.evaluations = [];
|
|
3954
3971
|
}
|
|
3955
3972
|
const [tool, prompt] = extractDispatch(envelope);
|
|
3973
|
+
const flag = sameSessionTestFlag(_commandOf(envelope));
|
|
3974
|
+
if (flag !== null) {
|
|
3975
|
+
const staged = _stagedPaths(options.consumer_root);
|
|
3976
|
+
if (staged !== null && touchesTestAndCode(staged)) {
|
|
3977
|
+
process.stdout.write(`${JSON.stringify({ decision: "warn", reason: flag })}
|
|
3978
|
+
`);
|
|
3979
|
+
return EXIT_ALLOW5;
|
|
3980
|
+
}
|
|
3981
|
+
}
|
|
3956
3982
|
const decision = decide(tool, prompt, state.evaluations.length);
|
|
3957
3983
|
if (decision.evaluations > state.evaluations.length) {
|
|
3958
3984
|
state.evaluations.push({
|
|
@@ -6315,6 +6341,10 @@ var CONFORMANCE_CHECK_IDS = [
|
|
|
6315
6341
|
"host-manifest"
|
|
6316
6342
|
];
|
|
6317
6343
|
var THIN_STUB_MARKER = "Routed rule \u2014 load the body on trigger-match";
|
|
6344
|
+
var CONFORMANCE_STATUS_SYMBOLS = {
|
|
6345
|
+
...STATUS_SYMBOLS,
|
|
6346
|
+
unknown: "\u2754"
|
|
6347
|
+
};
|
|
6318
6348
|
function print(s = "") {
|
|
6319
6349
|
process5.stdout.write(`${s}
|
|
6320
6350
|
`);
|
|
@@ -6337,21 +6367,24 @@ function installLogPath() {
|
|
|
6337
6367
|
}
|
|
6338
6368
|
return path15.join(os7.homedir(), ".event4u", "agent-config", "install-log.jsonl");
|
|
6339
6369
|
}
|
|
6340
|
-
function
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
message: "no install transaction log \u2014 nothing to recover",
|
|
6346
|
-
remedy: ""
|
|
6347
|
-
};
|
|
6348
|
-
}
|
|
6349
|
-
const entries = readRecentEntries(logPath);
|
|
6370
|
+
function _installLogExpected(projectRoot) {
|
|
6371
|
+
return fs15.existsSync(manifest_path(projectRoot));
|
|
6372
|
+
}
|
|
6373
|
+
function _check_txlog_clean(logPath = installLogPath(), projectRoot = null) {
|
|
6374
|
+
const entries = fs15.existsSync(logPath) ? readRecentEntries(logPath) : [];
|
|
6350
6375
|
if (entries.length === 0) {
|
|
6376
|
+
if (projectRoot !== null && _installLogExpected(projectRoot)) {
|
|
6377
|
+
return {
|
|
6378
|
+
id: "txlog-clean",
|
|
6379
|
+
status: "unknown",
|
|
6380
|
+
message: "install manifest present, no usable install transaction log \u2014 nothing recorded this install, so the last run cannot be confirmed complete",
|
|
6381
|
+
remedy: "no install path writes this log today; run `agent-config doctor` for the drift answer this check cannot give"
|
|
6382
|
+
};
|
|
6383
|
+
}
|
|
6351
6384
|
return {
|
|
6352
6385
|
id: "txlog-clean",
|
|
6353
6386
|
status: "ok",
|
|
6354
|
-
message: "install transaction log
|
|
6387
|
+
message: "no usable install transaction log and no install manifest \u2014 nothing was installed here",
|
|
6355
6388
|
remedy: ""
|
|
6356
6389
|
};
|
|
6357
6390
|
}
|
|
@@ -6361,7 +6394,7 @@ function _check_txlog_clean(logPath = installLogPath()) {
|
|
|
6361
6394
|
id: "txlog-clean",
|
|
6362
6395
|
status: "fail",
|
|
6363
6396
|
message: `install log tail is an abandoned run (abort at ${last.ts}${last.note ? `: ${last.note}` : ""})`,
|
|
6364
|
-
remedy: "re-run `agent-config init`
|
|
6397
|
+
remedy: "re-run `agent-config init` \u2014 it re-applies the plan over the partial tail; the aborted run's writes stay on disk and are replaced only where the plan covers them"
|
|
6365
6398
|
};
|
|
6366
6399
|
}
|
|
6367
6400
|
return {
|
|
@@ -6470,7 +6503,7 @@ function _check_hook_dispatcher(projectRoot, packageRoot = PACKAGE_ROOT, opts =
|
|
|
6470
6503
|
...event === "stop" ? { stop_reason: "conformance-smoke" } : { source: "startup" }
|
|
6471
6504
|
});
|
|
6472
6505
|
const argv = [...runner, "--platform", platform, "--event", event];
|
|
6473
|
-
const proc =
|
|
6506
|
+
const proc = spawnSync4(argv[0], argv.slice(1), {
|
|
6474
6507
|
input: payload,
|
|
6475
6508
|
cwd: projectRoot,
|
|
6476
6509
|
encoding: "utf8",
|
|
@@ -6632,7 +6665,7 @@ function runConformanceChecks(opts = {}) {
|
|
|
6632
6665
|
const projectRoot = opts.projectRoot ?? process5.cwd();
|
|
6633
6666
|
const packageRoot = opts.packageRoot ?? PACKAGE_ROOT;
|
|
6634
6667
|
const checks = [];
|
|
6635
|
-
checks.push(_check_txlog_clean());
|
|
6668
|
+
checks.push(_check_txlog_clean(installLogPath(), projectRoot));
|
|
6636
6669
|
checks.push(_check_router_pointers(packageRoot));
|
|
6637
6670
|
if (opts.skipDispatcher === true) {
|
|
6638
6671
|
checks.push({
|
|
@@ -6756,7 +6789,7 @@ function main14(argv = null) {
|
|
|
6756
6789
|
print(` \u{1F4CD} project_root: ${project_root}`);
|
|
6757
6790
|
print("conformance:");
|
|
6758
6791
|
for (const c of allChecks) {
|
|
6759
|
-
const sym =
|
|
6792
|
+
const sym = CONFORMANCE_STATUS_SYMBOLS[c["status"]] ?? "?";
|
|
6760
6793
|
print(` ${sym} ${c["id"]}: ${c["message"]}`);
|
|
6761
6794
|
if (c["status"] !== "ok" && c["remedy"]) {
|
|
6762
6795
|
print(` fix: ${c["remedy"]}`);
|
|
@@ -6808,6 +6841,7 @@ export {
|
|
|
6808
6841
|
_check_lean_projection,
|
|
6809
6842
|
_check_router_pointers,
|
|
6810
6843
|
_check_txlog_clean,
|
|
6844
|
+
_installLogExpected,
|
|
6811
6845
|
_parse,
|
|
6812
6846
|
appendConformanceReport,
|
|
6813
6847
|
conformanceLogPath,
|