@event4u/agent-config 16.2.0 → 16.3.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 +89 -237
- package/README.md +14 -12
- package/dist/agent-src/commands/analyze/inbox.md +1 -1
- package/dist/agent-src/commands/analyze/roadmap-repos.md +1 -1
- package/dist/agent-src/commands/bug/fix.md +17 -2
- package/dist/agent-src/commands/feature/plan.md +1 -1
- package/dist/agent-src/commands/feature/roadmap.md +1 -1
- package/dist/agent-src/commands/fix/ci.md +1 -1
- package/dist/agent-src/commands/implement-ticket.md +1 -1
- package/dist/agent-src/commands/jira-ticket.md +1 -1
- package/dist/agent-src/commands/roadmap/create.md +1 -1
- package/dist/agent-src/commands/roadmap/materialize.md +1 -1
- package/dist/agent-src/commands/roadmap/process-full.md +4 -4
- package/dist/agent-src/commands/roadmap/resolve-blockers.md +361 -0
- package/dist/agent-src/commands/roadmap/triage-parked.md +325 -0
- package/dist/agent-src/commands/roadmap.md +18 -4
- package/dist/agent-src/commands/tests/create.md +17 -3
- package/dist/agent-src/commands/tests/execute.md +22 -5
- package/dist/agent-src/contexts/authority/decision-revisit-gate-enforcement.md +43 -0
- package/dist/agent-src/contexts/communication/rules-auto/design-fidelity-enforcement.md +24 -0
- package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +6 -6
- package/dist/agent-src/contexts/execution/roadmap-process-loop.md +32 -2
- package/dist/agent-src/contexts/execution/session-canary-enforcement-history.md +67 -0
- package/dist/agent-src/contexts/execution/toolchain-resolver.md +101 -7
- package/dist/agent-src/rules/active-remediation.md +1 -1
- package/dist/agent-src/rules/autonomous-execution.md +1 -0
- package/dist/agent-src/rules/broken-access-control.md +1 -0
- package/dist/agent-src/rules/command-suggestion-policy.md +1 -0
- package/dist/agent-src/rules/context-hygiene.md +1 -1
- package/dist/agent-src/rules/decision-revisit-gate.md +16 -33
- package/dist/agent-src/rules/design-fidelity.md +13 -16
- package/dist/agent-src/rules/doc-screenshot-hygiene.md +1 -0
- package/dist/agent-src/rules/domain-safety-disclaimer.md +1 -0
- package/dist/agent-src/rules/domain-safety-pii.md +1 -0
- package/dist/agent-src/rules/domain-safety-retention.md +1 -0
- package/dist/agent-src/rules/engineering-safety-floor.md +1 -0
- package/dist/agent-src/rules/evaluator-independence.md +3 -2
- package/dist/agent-src/rules/fast-path-marker-visibility.md +1 -0
- package/dist/agent-src/rules/finance-safety-floor.md +1 -0
- package/dist/agent-src/rules/git-history-discipline.md +1 -0
- package/dist/agent-src/rules/image-likeness-and-rights.md +1 -0
- package/dist/agent-src/rules/legal-safety-floor.md +3 -2
- package/dist/agent-src/rules/lethal-trifecta-guard.md +1 -0
- package/dist/agent-src/rules/low-impact-corpus-privacy-floor.md +1 -0
- package/dist/agent-src/rules/media-governance-routing.md +14 -17
- package/dist/agent-src/rules/persona-governance.md +2 -2
- package/dist/agent-src/rules/provider-lifecycle-discipline.md +1 -1
- package/dist/agent-src/rules/question-not-instruction.md +1 -0
- package/dist/agent-src/rules/roadmap-progress-sync.md +1 -1
- package/dist/agent-src/rules/runtime-safety.md +1 -0
- package/dist/agent-src/rules/secret-vcs-guard.md +1 -0
- package/dist/agent-src/rules/security-sensitive-stop.md +3 -2
- package/dist/agent-src/rules/session-canary.md +8 -62
- package/dist/agent-src/rules/settings-ask-protocol.md +1 -0
- package/dist/agent-src/rules/source-confidentiality.md +1 -0
- package/dist/agent-src/rules/strategy-safety-floor.md +1 -0
- package/dist/agent-src/rules/tool-safety.md +1 -0
- package/dist/agent-src/rules/untrusted-input-defense.md +1 -0
- package/dist/agent-src/rules/user-interrupt-priority.md +1 -0
- package/dist/agent-src/scripts/archive_completed_roadmaps.ts +115 -20
- package/dist/agent-src/scripts/deferral_carry.ts +339 -0
- package/dist/agent-src/scripts/update_roadmap_progress.ts +4 -1
- package/dist/agent-src/skills/api-design/data/manifest.json +2 -2
- package/dist/agent-src/skills/api-testing/SKILL.md +17 -0
- package/dist/agent-src/skills/code-intelligence/SKILL.md +14 -2
- package/dist/agent-src/skills/design-system-capture/references/import-procedure.md +1 -1
- package/dist/agent-src/skills/existing-ui-audit/SKILL.md +2 -2
- package/dist/agent-src/skills/fe-design/SKILL.md +1 -1
- package/dist/agent-src/skills/iconography/SKILL.md +1 -1
- package/dist/agent-src/skills/js-library-packaging/SKILL.md +2 -2
- package/dist/agent-src/skills/monorepo-workspace/SKILL.md +1 -1
- package/dist/agent-src/skills/quality-tools/SKILL.md +11 -1
- package/dist/agent-src/skills/quality-tools/references/go-tools.md +76 -0
- package/dist/agent-src/skills/quality-tools/references/python-tools.md +104 -0
- package/dist/agent-src/skills/review-routing/SKILL.md +2 -2
- package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +1 -1
- package/dist/agent-src/skills/storybook-workshop/SKILL.md +3 -3
- package/dist/agent-src/skills/tailwind-engineer/SKILL.md +1 -1
- package/dist/agent-src/skills/test-case-discovery/SKILL.md +7 -0
- package/dist/agent-src/skills/test-driven-development/SKILL.md +17 -0
- package/dist/agent-src/skills/test-performance/SKILL.md +19 -1
- package/dist/agent-src/skills/ui-component-architect/SKILL.md +2 -2
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +48 -6
- package/dist/agent-src/templates/scripts/work_engine/stack/runner.ts +774 -109
- package/dist/cli/registry.js +1 -1
- package/dist/cli-delegate/archive_completed_roadmaps.js +92 -12
- package/dist/cli-delegate/check_update_banner.js +12 -1
- package/dist/cli-delegate/chunk-523HCFYO.js +90 -0
- package/dist/cli-delegate/{chunk-M2DPGFZ4.js → chunk-6V6TA25H.js} +22 -152
- package/dist/cli-delegate/chunk-7IQE3D5S.js +191 -0
- package/dist/cli-delegate/{chunk-6KFEC3G7.js → chunk-CQWX336L.js} +1 -1
- package/dist/cli-delegate/chunk-DEIV7XP7.js +108 -0
- package/dist/cli-delegate/chunk-EEHDXSYD.js +2040 -0
- package/dist/cli-delegate/{chunk-P6ZHP5W2.js → chunk-GKE7ZVFA.js} +4 -4
- package/dist/cli-delegate/chunk-JQOM7TTM.js +1201 -0
- package/dist/cli-delegate/{chunk-IGD6ERX6.js → chunk-JQVYKIZA.js} +10 -0
- package/dist/cli-delegate/{chunk-FC75PGJE.js → chunk-JY2I2DXV.js} +12 -1
- package/dist/cli-delegate/chunk-KB5FZ655.js +208 -0
- package/dist/cli-delegate/{chunk-7RQP4UDH.js → chunk-KR6EM23A.js} +235 -1455
- package/dist/cli-delegate/{chunk-LTYVIY76.js → chunk-LIYTLH6O.js} +1 -1
- package/dist/cli-delegate/{chunk-YJ72UIAK.js → chunk-NQ7WT43P.js} +1186 -244
- package/dist/cli-delegate/chunk-NXEILF2K.js +2160 -0
- package/dist/cli-delegate/{chunk-5R7HOLAF.js → chunk-NYX3L2PZ.js} +1 -1
- package/dist/cli-delegate/{chunk-4E2W63DA.js → chunk-OKJUIAPS.js} +62 -1
- package/dist/cli-delegate/{chunk-QAJS5YWY.js → chunk-PHD7OOLE.js} +2 -1
- package/dist/cli-delegate/{chunk-RGNIWTEA.js → chunk-QLDHIPWR.js} +1 -1
- package/dist/cli-delegate/{chunk-7XGBX6ZH.js → chunk-RQNNW7IF.js} +1314 -560
- package/dist/cli-delegate/{chunk-4XFP2Y3E.js → chunk-S4UMZNES.js} +1 -1
- package/dist/cli-delegate/{chunk-6KM6ORRY.js → chunk-S4YWNRKO.js} +24 -8
- package/dist/cli-delegate/{chunk-FP36SWJD.js → chunk-TRI6DQZ6.js} +2781 -340
- package/dist/cli-delegate/chunk-ULQRUR23.js +208 -0
- package/dist/cli-delegate/{chunk-NUHLI2RX.js → chunk-YCU3TIXH.js} +2 -0
- package/dist/cli-delegate/chunk-ZBZV2G5R.js +210 -0
- package/dist/cli-delegate/{chunk-WGXTVKCQ.js → chunk-ZUZKZYCN.js} +5 -3
- 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 +1167 -234
- package/dist/cli-delegate/cmd_doctor.js +13 -6
- package/dist/cli-delegate/cmd_doctor_neighbours.js +23 -0
- package/dist/cli-delegate/cmd_explain.js +5 -5
- package/dist/cli-delegate/cmd_export.js +11 -8
- package/dist/cli-delegate/cmd_fleet.js +3 -3
- package/dist/cli-delegate/cmd_handoff.js +10 -7
- package/dist/cli-delegate/cmd_mcp_available.js +1 -1
- package/dist/cli-delegate/cmd_memory_get.js +3 -1
- package/dist/cli-delegate/cmd_migrate.js +2 -2
- package/dist/cli-delegate/cmd_packs_active.js +3 -3
- package/dist/cli-delegate/cmd_preflight.js +6 -6
- package/dist/cli-delegate/cmd_prune.js +11 -8
- package/dist/cli-delegate/cmd_refresh.js +2 -1
- package/dist/cli-delegate/cmd_route_audit.js +8 -6
- package/dist/cli-delegate/cmd_route_explain.js +4 -4
- package/dist/cli-delegate/cmd_session_recycle.js +4 -3
- package/dist/cli-delegate/cmd_settings_get.js +1 -1
- package/dist/cli-delegate/cmd_settings_migrate.js +11 -8
- package/dist/cli-delegate/cmd_settings_set.js +4 -4
- package/dist/cli-delegate/cmd_sync.js +11 -8
- package/dist/cli-delegate/cmd_uninstall.js +11 -8
- package/dist/cli-delegate/cmd_update.js +1 -1
- package/dist/cli-delegate/cmd_upgrade.js +3 -2
- package/dist/cli-delegate/cmd_validate.js +11 -8
- package/dist/cli-delegate/cmd_versions.js +1 -1
- package/dist/cli-delegate/deferral_carry.js +16 -0
- package/dist/cli-delegate/gate_execute.js +2 -2
- package/dist/cli-delegate/roadmap_gates.js +5 -5
- package/dist/cli-delegate/update_roadmap_progress.js +1 -1
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +127 -75
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +3 -3
- package/dist/discovery/dormancy-report.md +1 -1
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +7 -5
- package/dist/discovery/trust-report.md +2 -2
- package/dist/discovery/workspaces.json +6 -4
- package/dist/hooks/dispatch.js +5357 -6656
- package/dist/hooks/dispatch.sha256 +1 -1
- package/dist/install/claudePathsPlan.js +47 -6
- package/dist/install/claudeRuleRewrite.js +7 -0
- package/dist/install/emit_host_rules_cli.js +39 -36
- package/dist/install/globalRuleScope.js +87 -0
- package/dist/install/host_rule_ownership.js +160 -0
- package/dist/install/install.mjs +2080 -1024
- package/dist/install/installThinLayer.js +261 -0
- package/dist/install/installedRuleLinks.js +176 -0
- package/dist/install/wizard-plan.js +24 -0
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/mcp/server.json +2 -2
- package/dist/mcp/server.mjs +31965 -27154
- package/dist/scripts/_lib/agent_settings.js +11 -0
- package/dist/scripts/_lib/claude_settings_hooks.js +10 -8
- package/dist/scripts/_lib/installed_layer.js +378 -0
- package/dist/scripts/_lib/lean_projection_mode.js +218 -15
- package/dist/scripts/_lib/rule_consequence_class.js +45 -0
- package/dist/scripts/_lib/rule_injection.js +67 -10
- package/dist/scripts/_lib/rule_law_section.js +122 -0
- package/dist/scripts/_lib/thin_rules.js +458 -0
- package/dist/scripts/_lib/windsurf_render.js +60 -0
- package/dist/scripts/condense.js +14 -26
- package/dist/scripts/project_thin_rules.js +14 -294
- package/dist/server/schemas/settings.js +6 -0
- package/dist/shared/skillRanking.js +74 -13
- package/docs/contracts/settings-classes.md +7 -5
- package/package.json +1 -1
- package/src/agent-src/scripts/archive_completed_roadmaps.ts +115 -20
- package/src/agent-src/scripts/deferral_carry.ts +339 -0
- package/src/agent-src/scripts/update_roadmap_progress.ts +4 -1
- package/src/agent-src/templates/scripts/work_engine/directives/ui/apply.ts +48 -6
- package/src/agent-src/templates/scripts/work_engine/stack/runner.ts +774 -109
- package/src/config/agent-settings.template.yml +62 -22
- package/src/config/continuity-surface.json +7 -0
- package/src/config/evaluator-budgets.json +4 -4
- package/src/config/gate-coverage.yml +96 -3
- package/src/config/gate-violation-baselines.json +17 -9
- package/src/config/hook-bundle-budget.json +25 -0
- package/src/config/hook-token-budget.json +6 -1
- package/src/config/host-instruction-limits.json +33 -0
- package/src/config/routing-coverage-seed.json +24 -3
- package/src/config/rule-activation-census.json +7 -3
- package/src/config/rule-consequence-class.json +161 -0
- package/src/config/rule-law-ceilings.json +99 -0
- package/src/install/claudePathsPlan.ts +46 -4
- package/src/install/claudeRuleRewrite.ts +10 -1
- package/src/install/emit_host_rules_cli.ts +43 -34
- package/src/install/globalRuleScope.ts +109 -0
- package/src/install/host_rule_ownership.ts +170 -0
- package/src/install/installThinLayer.ts +312 -0
- package/src/install/installedRuleLinks.ts +220 -0
- package/src/install/wizard-plan.ts +24 -0
- package/src/scripts/_cli/cmd_doctor.ts +23 -71
- package/src/scripts/_cli/cmd_doctor_neighbours.ts +293 -0
- package/src/scripts/_dispatch.bash +16 -2
- package/src/scripts/_lib/agent_settings.ts +11 -0
- package/src/scripts/_lib/claude_settings_hooks.ts +10 -8
- package/src/scripts/_lib/estate_offsets.ts +241 -0
- package/src/scripts/_lib/exemption_shape.ts +143 -0
- package/src/scripts/_lib/fnv.ts +23 -0
- package/src/scripts/_lib/foreign_scan.ts +106 -0
- package/src/scripts/_lib/gitignore_block.ts +314 -0
- package/src/scripts/_lib/global_deploy_inventory.ts +32 -0
- package/src/scripts/_lib/graph_feeder_record.ts +214 -0
- package/src/scripts/_lib/hook_settings.ts +73 -0
- package/src/scripts/_lib/host_capability.ts +40 -19
- package/src/scripts/_lib/host_hook_merge.ts +165 -0
- package/src/scripts/_lib/installed_layer.ts +538 -0
- package/src/scripts/_lib/json_merge.ts +82 -0
- package/src/scripts/_lib/json_pointers.ts +93 -11
- package/src/scripts/_lib/lean_projection_mode.ts +275 -15
- package/src/scripts/_lib/machine_wake.ts +16 -3
- package/src/scripts/_lib/neighbour_census.ts +760 -0
- package/src/scripts/_lib/neighbour_scan.ts +122 -0
- package/src/scripts/_lib/neighbour_tool_use.ts +189 -0
- package/src/scripts/_lib/prompt_shape.ts +46 -0
- package/src/scripts/_lib/release_migration_gate.ts +19 -3
- package/src/scripts/_lib/reserved_name_sweep.ts +73 -0
- package/src/scripts/_lib/review_coverage.ts +134 -0
- package/src/scripts/_lib/rule_consequence_class.ts +71 -0
- package/src/scripts/_lib/rule_injection.ts +130 -10
- package/src/scripts/_lib/rule_law_section.ts +147 -0
- package/src/scripts/_lib/rule_layer_overlap.ts +58 -0
- package/src/scripts/_lib/skill_origin.ts +254 -0
- package/src/scripts/_lib/structured_ask.ts +64 -21
- package/src/scripts/_lib/thin_rules.ts +540 -0
- package/src/scripts/_lib/touched_file_quality.ts +434 -0
- package/src/scripts/_lib/turn_end_refusals.ts +77 -2
- package/src/scripts/_lib/windsurf_render.ts +63 -0
- package/src/scripts/ai_council/cli_call_budget.ts +13 -5
- package/src/scripts/ai_council/clients.ts +26 -57
- package/src/scripts/ai_council/config.ts +1 -1
- package/src/scripts/ai_council/vendor_defaults.ts +45 -0
- package/src/scripts/audit_skill_overlap.ts +261 -0
- package/src/scripts/before_complete_hook.ts +243 -12
- package/src/scripts/bench_touched_file_quality.ts +238 -0
- package/src/scripts/check_enforcement_matrix.ts +377 -20
- package/src/scripts/check_estate_count.ts +130 -153
- package/src/scripts/check_finding_dispositions.ts +116 -4
- package/src/scripts/check_hook_bundle_composition.ts +370 -0
- package/src/scripts/check_kernel_edit_ratified.ts +49 -11
- package/src/scripts/check_memory.ts +7 -1
- package/src/scripts/check_release_highlights.ts +10 -0
- package/src/scripts/check_release_pr_shape.ts +38 -15
- package/src/scripts/check_standing_rule_delivery.ts +33 -13
- package/src/scripts/check_verify_expectation_delta.ts +521 -0
- package/src/scripts/code_graph/detect.ts +127 -7
- package/src/scripts/code_graph/foreign.ts +194 -0
- package/src/scripts/code_graph/query.ts +217 -4
- package/src/scripts/code_graph/types.ts +26 -2
- package/src/scripts/code_graph/validate.ts +3 -1
- package/src/scripts/code_graph/verbs.ts +103 -0
- package/src/scripts/compile_hook_manifest.ts +33 -1
- package/src/scripts/condense.ts +14 -27
- package/src/scripts/estate_exemption_shape.ts +202 -0
- package/src/scripts/generate_host_cost_table.ts +1 -1
- package/src/scripts/hook_manifest.json +1 -1
- package/src/scripts/hook_manifest.yaml +150 -9
- package/src/scripts/hooks/block_config_weakening.ts +67 -2
- package/src/scripts/hooks/block_plumbing_writes.ts +29 -1
- package/src/scripts/hooks/code_graph_context_hook.ts +252 -23
- package/src/scripts/hooks/concern_failure_policy.ts +280 -0
- package/src/scripts/hooks/dispatch_hook.ts +52 -52
- package/src/scripts/hooks/exit_codes.ts +2 -1
- package/src/scripts/hooks/host_lowering.json +1 -1
- package/src/scripts/hooks/host_lowering.ts +19 -1
- package/src/scripts/hooks/one_question_per_ask_hook.ts +41 -25
- package/src/scripts/hooks/payload_stub.ts +10 -1
- package/src/scripts/hooks/rule_inject_hook.ts +757 -63
- package/src/scripts/hooks/table_fingerprint.ts +21 -0
- package/src/scripts/hooks/telemetry_usage_hook.ts +64 -8
- package/src/scripts/hooks/turn_end_gate_hook.ts +84 -0
- package/src/scripts/hooks_status.ts +112 -0
- package/src/scripts/injection_scan_hook.ts +7 -0
- package/src/scripts/install.ts +72 -185
- package/src/scripts/installed_layer_report.ts +103 -0
- package/src/scripts/language_mirror_hook.ts +15 -6
- package/src/scripts/learning_sidecar.ts +119 -8
- package/src/scripts/lint_hook_manifest.ts +53 -0
- package/src/scripts/lint_major_migration_sections.ts +156 -26
- package/src/scripts/lint_pack_boundaries.ts +63 -5
- package/src/scripts/lint_rule_law_section.ts +517 -0
- package/src/scripts/lint_workflow_security.ts +161 -5
- package/src/scripts/mcp_server/consumer_tool_catalog.json +53 -0
- package/src/scripts/mcp_server/graph_tools.ts +72 -3
- package/src/scripts/measure_routing_signal.ts +54 -16
- package/src/scripts/measure_skill_ranker_baseline.ts +216 -8
- package/src/scripts/memory_learn_hook.ts +91 -6
- package/src/scripts/model_rule_injection.ts +52 -5
- package/src/scripts/project_thin_rules.ts +34 -327
- package/src/scripts/report_evidence_temperature.ts +657 -0
- package/src/scripts/report_installed_rule_links.ts +157 -0
- package/src/scripts/report_label_agreement.ts +233 -0
- package/src/scripts/report_obligation_mechanism.ts +230 -0
- package/src/scripts/report_single_token_triggers.ts +277 -0
- package/src/scripts/report_skill_ranker_confusion.ts +442 -0
- package/src/scripts/report_standing_payload_by_host.ts +188 -15
- package/src/scripts/report_verification_record_coverage.ts +306 -0
- package/src/scripts/rule_activation_census.ts +5 -2
- package/src/scripts/rule_trigger_eval.ts +9 -9
- package/src/scripts/schemas/review-findings.schema.json +3 -2
- package/src/scripts/schemas/rule.schema.json +5 -0
- package/src/scripts/self_review_gate.ts +62 -7
- package/src/scripts/skill_tools/score_skill_relevance.ts +290 -25
- package/src/scripts/sweep_skill_ranker_signals.ts +129 -0
- package/src/scripts/sync_gitignore.ts +29 -235
- package/src/scripts/trigger_eval_grandfather.json +0 -5
- package/src/server/schemas/settings.ts +10 -0
- package/src/shared/skillRanking.ts +117 -11
- package/dist/cli-delegate/chunk-JNMVLWLR.js +0 -4457
- package/dist/cli-delegate/chunk-YDPILCOL.js +0 -152
|
@@ -20,9 +20,6 @@ applies_to_user_types:
|
|
|
20
20
|
- "marketing"
|
|
21
21
|
- "gtm"
|
|
22
22
|
validator_ignore:
|
|
23
|
-
- type: "substring"
|
|
24
|
-
pattern: "../../agents/"
|
|
25
|
-
reason: "Routing rule whose subject matter is the project-local agents/settings/policies/media/ tree; every body link points there by design."
|
|
26
23
|
- type: "substring"
|
|
27
24
|
pattern: ".agent-src.uncondensed/"
|
|
28
25
|
reason: "Rule contrasts project-local placement with the .agent-src.uncondensed/rules/ alternative — mentioning the path is the argument."
|
|
@@ -36,7 +33,7 @@ collision_ok:
|
|
|
36
33
|
"/audio:": "routes the media policy layer for audio surfaces"
|
|
37
34
|
"/video:": "routes the media policy layer for video surfaces"
|
|
38
35
|
"likeness": "likeness prompts must load the policy layer before generation"
|
|
39
|
-
# obligation: line
|
|
36
|
+
# obligation: line 43
|
|
40
37
|
obligation_frequency: "per-event"
|
|
41
38
|
---
|
|
42
39
|
|
|
@@ -50,25 +47,25 @@ MEDIA POLICIES IN agents/settings/policies/media/ BEFORE EMITTING THE PROMPT TO
|
|
|
50
47
|
THE PROVIDER. REFUSE-AND-SURFACE OVER GUESS-AND-RENDER.
|
|
51
48
|
```
|
|
52
49
|
|
|
53
|
-
This rule routes the agent to the **project-local** media governance policy layer at
|
|
50
|
+
This rule routes the agent to the **project-local** media governance policy layer at `agents/settings/policies/media/` whenever a video / image / voice surface fires. The policies themselves are LLM-readable decision frameworks consulted in-session, not Python-enforced gates — see `agents/settings/policies/media/README.md` § Enforcement model for the full agent-in-the-loop contract.
|
|
54
51
|
|
|
55
52
|
## What this rule surfaces
|
|
56
53
|
|
|
57
54
|
When any trigger above matches in the user prompt or in a tool invocation, the agent loads into context:
|
|
58
55
|
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
56
|
+
- `agents/settings/policies/media/likeness.md` — real person's visual likeness.
|
|
57
|
+
- `agents/settings/policies/media/style.md` — named living artist's distinctive style.
|
|
58
|
+
- `agents/settings/policies/media/public-figures.md` — recognised public figures.
|
|
59
|
+
- `agents/settings/policies/media/voice-cloning.md` — vocal likeness.
|
|
60
|
+
- `agents/settings/policies/media/disclosure.md` — mandatory non-removable AI-generation disclosure.
|
|
61
|
+
- `agents/settings/policies/media/brand-impersonation.md` — brand / broadcaster identity imitation.
|
|
62
|
+
- `agents/settings/policies/media/transparency.md` — provenance metadata (C2PA, SynthID).
|
|
66
63
|
|
|
67
64
|
Each policy carries its own trigger block, so within the active context the agent narrows from this superset to the policies whose specific patterns actually fired (e.g., a prompt naming a public figure activates `public-figures.md` and `disclosure.md`; a prompt requesting `--no-disclosure` activates `disclosure.md` standalone).
|
|
68
65
|
|
|
69
66
|
## Why project-local, not `src/rules/`
|
|
70
67
|
|
|
71
|
-
The seven media policies live under
|
|
68
|
+
The seven media policies live under `agents/settings/policies/media/`, not as `src/rules/domain-safety-media-*.md`, for three reasons:
|
|
72
69
|
|
|
73
70
|
1. **They are consumed by skills and adapters**, not surfaced as standalone always-loaded prose. The cost is non-trivial (7 × ~80 lines = ~560 lines into the always-context if hoisted to rules), and most sessions never touch a video / image / voice surface.
|
|
74
71
|
2. **The enforcement model is project-local** — the working precedent (`/ghostwriter:*` mandatory footer in `write-engine.md`) and the audit log (session transcripts) are project artifacts. Rules under `src/rules/` are tool-portable governance; these policies are domain-specific bindings.
|
|
@@ -78,16 +75,16 @@ This routing rule is the bridge: it sits in the always-loaded rule set so the tr
|
|
|
78
75
|
|
|
79
76
|
## CI reachability guarantee
|
|
80
77
|
|
|
81
|
-
|
|
78
|
+
`src/scripts/lint_media_policy_linkage.ts` fails the build if any policy file under `agents/settings/policies/media/` is not referenced from:
|
|
82
79
|
|
|
83
80
|
- this routing rule, **or**
|
|
84
81
|
- a skill's `## Policies` see-also block, **or**
|
|
85
82
|
- another policy file's `## See also` block.
|
|
86
83
|
|
|
87
|
-
A policy that no skill, rule, or sibling policy references is a silent policy. The CI check is the structural reachability guarantee that the agent-in-the-loop model rests on.
|
|
84
|
+
A policy that no skill, rule, or sibling policy references is a silent policy. The gate matches the path as a substring, so the code spans above satisfy it exactly as a markdown link would — the word is **referenced**, not linked, and it is chosen rather than loose: a reading that demanded a link would un-reference all seven policies from the rule that routes them. The CI check is the structural reachability guarantee that the agent-in-the-loop model rests on.
|
|
88
85
|
|
|
89
86
|
## See also
|
|
90
87
|
|
|
91
|
-
-
|
|
88
|
+
- `agents/settings/policies/media/README.md` — the full enforcement-model contract.
|
|
92
89
|
- [`ask-when-uncertain`](ask-when-uncertain.md) — the single-question refusal-path discipline every policy depends on.
|
|
93
|
-
- [`docs/contracts/write-engine.md`](../docs/contracts/write-engine.md) — the prose-disclosure precedent extended to media by
|
|
90
|
+
- [`docs/contracts/write-engine.md`](../docs/contracts/write-engine.md) — the prose-disclosure precedent extended to media by `agents/settings/policies/media/disclosure.md`.
|
|
@@ -19,7 +19,7 @@ applies_to_user_types:
|
|
|
19
19
|
validator_ignore:
|
|
20
20
|
- type: "substring"
|
|
21
21
|
pattern: "../../docs/"
|
|
22
|
-
reason: "Rule routes to docs/contracts/persona-schema.md
|
|
22
|
+
reason: "Rule routes to docs/contracts/persona-schema.md — the canonical persona schema lives there by design."
|
|
23
23
|
- type: "substring"
|
|
24
24
|
pattern: ".agent-src.uncondensed/"
|
|
25
25
|
reason: "Rule documents the persona authoring tree (.agent-src.uncondensed/personas/) as the deprecation-path operand."
|
|
@@ -48,6 +48,6 @@ Trigger-set above activates this routing on demand, independent of the disciplin
|
|
|
48
48
|
## See also
|
|
49
49
|
|
|
50
50
|
- [`docs/contracts/persona-schema.md`](../docs/contracts/persona-schema.md) — schema lock, tiers, sections, size budgets, linter enforcement surface, and the migrated governance checks (§ 8).
|
|
51
|
-
-
|
|
51
|
+
- `docs/personas.md` — active persona catalog, citation map, ownership column.
|
|
52
52
|
- [`ai-council`](../skills/ai-council/SKILL.md) — neutral second-opinion mechanism used for merge / deprecation decisions.
|
|
53
53
|
- [`skill-quality`](skill-quality.md) — sibling discipline rule for skill files.
|
|
@@ -54,6 +54,6 @@ Trigger-set above activates this routing on demand, independent of the disciplin
|
|
|
54
54
|
## See also
|
|
55
55
|
|
|
56
56
|
- [`docs/contracts/provider-lifecycle.md`](../docs/contracts/provider-lifecycle.md) — the full tier definitions, promotion / demotion criteria, day-one assignment matrix, and the migrated enforcement detail (§ 4–4b).
|
|
57
|
-
-
|
|
57
|
+
- `src/scripts/media/lib/adapter-contract.md` — the four-method shell surface every adapter implements; the tier tag is read alongside this contract.
|
|
58
58
|
- [`media-governance-routing`](media-governance-routing.md) — sibling tier-2a rule that surfaces the prompt-side policy layer; this rule covers the provider-side discipline.
|
|
59
59
|
- [`ask-when-uncertain`](ask-when-uncertain.md) — the one-question-per-turn discipline the refuse-and-surface path uses.
|
|
@@ -58,7 +58,7 @@ A SILENT ARCHIVE THAT BURIES PLANNED-FOR-LATER WORK
|
|
|
58
58
|
IS A RULE VIOLATION, NOT A CONVENIENCE.
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
Closure check fires (`count_open == 0
|
|
61
|
+
Closure check fires (`count_open == 0`, `count_deferred > 0`) → the sweep carries each bare `[~]` and its blockers to a `<slug>-carried` follow-up (council row below), then archives; the rest goes to the menu (per [`user-interaction`](user-interaction.md)). Full option menu + migration mechanics: guideline + [`roadmap-management`](../skills/roadmap-management/SKILL.md).
|
|
62
62
|
|
|
63
63
|
### Who resolves it — the preservation test
|
|
64
64
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "2a"
|
|
4
4
|
alwaysApply: false
|
|
5
|
+
consequence_class: "security-boundary"
|
|
5
6
|
description: "Writing a credential into a tracked file or committing one in any VCS (git/svn/hg) — STOP, show the match, ask, offer alternatives; never silently"
|
|
6
7
|
triggers:
|
|
7
8
|
- keyword: "secret"
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "2a"
|
|
4
4
|
alwaysApply: false
|
|
5
|
+
consequence_class: "security-boundary"
|
|
5
6
|
description: "Security-sensitive paths (auth, billing, tenants, secrets, uploads, webhooks) — threat-model BEFORE editing"
|
|
6
7
|
# Disjoint from secret-vcs-guard by design (2026-08-04): bare `secret` /
|
|
7
8
|
# `password` are that rule's VCS-write surface, not this rule's.
|
|
@@ -20,7 +21,7 @@ triggers:
|
|
|
20
21
|
validator_ignore:
|
|
21
22
|
- type: "substring"
|
|
22
23
|
pattern: "../../docs/"
|
|
23
|
-
reason: "
|
|
24
|
+
reason: "Rule routes to docs/guidelines/agent-infra/memory-access.md — the memory-consult procedure lives there by design."
|
|
24
25
|
self_contained: true
|
|
25
26
|
workspaces: [engineering]
|
|
26
27
|
packs: [engineering-base]
|
|
@@ -130,4 +131,4 @@ model-carried, honestly uncovered). Adjacent validators (`check_secret_leak`,
|
|
|
130
131
|
`lint_agent_security`) cover neighbouring surfaces, not this stop — claiming
|
|
131
132
|
them here would inflate coverage, so they are not claimed.
|
|
132
133
|
|
|
133
|
-
See also: `threat-modeling` · `authz-review` · `data-flow-mapper` · `minimal-safe-diff` · `think-before-action` · [`untrusted-input-defense`](untrusted-input-defense.md) · [`lethal-trifecta-guard`](lethal-trifecta-guard.md) · [`secret-vcs-guard`](secret-vcs-guard.md) ·
|
|
134
|
+
See also: `threat-modeling` · `authz-review` · `data-flow-mapper` · `minimal-safe-diff` · `think-before-action` · [`untrusted-input-defense`](untrusted-input-defense.md) · [`lethal-trifecta-guard`](lethal-trifecta-guard.md) · [`secret-vcs-guard`](secret-vcs-guard.md) · `docs/threat-model.md`.
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "2a"
|
|
4
|
+
consequence_class: "authority-bypass"
|
|
4
5
|
description: "personal.canary_name set — open every new task by name (liveness canary); keep the reply-close markers alive (ONE end-summary, PR URL last)"
|
|
5
6
|
alwaysApply: false
|
|
7
|
+
load_context:
|
|
8
|
+
- ../contexts/execution/session-canary-enforcement-history.md
|
|
6
9
|
triggers:
|
|
7
10
|
- keyword: "canary"
|
|
8
11
|
- keyword: "canary_name"
|
|
@@ -12,7 +15,7 @@ workspaces: [agent-config-maintainer, construction, engineering, finance, founde
|
|
|
12
15
|
packs: [meta]
|
|
13
16
|
enforced_by:
|
|
14
17
|
- "hook:session-canary"
|
|
15
|
-
# obligation: line
|
|
18
|
+
# obligation: line 33
|
|
16
19
|
obligation_frequency: "per-task"
|
|
17
20
|
# frequency-override: the per-turn phrases in the body describe the CARRIER
|
|
18
21
|
# (a per-turn beat is the closest reachable cover for a per-task obligation),
|
|
@@ -76,7 +79,7 @@ name it and suggest a fresh session or `/agent-handoff`, per
|
|
|
76
79
|
|
|
77
80
|
## Enforcement — per turn, which is the closest reachable cover for per task
|
|
78
81
|
|
|
79
|
-
> **Enforced by:**
|
|
82
|
+
> **Enforced by:** `src/scripts/session_canary_hook.ts`,
|
|
80
83
|
> bound in **two** slots. `session_start` injects the full `<session-canary>`
|
|
81
84
|
> contract once, so a fresh conversation cannot start without it.
|
|
82
85
|
> `user_prompt_submit` injects a one-line beat every turn, which is what
|
|
@@ -92,66 +95,9 @@ under-firing is the silent one. The full contract stays at session scope because
|
|
|
92
95
|
re-injecting ~800 characters every turn would buy the same coverage at roughly
|
|
93
96
|
40× the tokens over a long session.
|
|
94
97
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
carrying a name the settings chain did not resolve; the honesty clause fired
|
|
99
|
-
zero times. The frequency join in `check_enforcement_coverage.ts` now reports the
|
|
100
|
-
carrier as covering the obligation — which is a claim about firing, not about
|
|
101
|
-
compliance.
|
|
102
|
-
|
|
103
|
-
**What the second audit found: the carrier fires and compliance did not
|
|
104
|
-
follow.** Conformance round 5, 2026-08-07, reading the five highest-turn
|
|
105
|
-
sessions with the carrier bound per turn: opening canary dropped on **24 of 29**
|
|
106
|
-
task starts, the honesty clause fired **0** times, and the wrong name was
|
|
107
|
-
emitted **twice** — "Mathias", which resolves from no layer of the chain
|
|
108
|
-
(`identity.name` is `Matze`, `git config user.name` is `matze4u`), i.e. inferred
|
|
109
|
-
from the ambient environment rather than read from settings. 24/29 against the
|
|
110
|
-
earlier 13/15 is not a fall, and the two windows are not identical, so they are
|
|
111
|
-
stated side by side rather than as a trend — but nothing here supports the claim
|
|
112
|
-
that the miss rate moved. A reminder in context is therefore not a mechanism for
|
|
113
|
-
this obligation: at higher frequency it is the same request, more often.
|
|
114
|
-
|
|
115
|
-
**What the next mechanism has to be.** Not another injection. It has to be able
|
|
116
|
-
to **refuse** — a check at delivery (`stop` is block-capable on this host, so a
|
|
117
|
-
refused turn-end continues in the same turn) that rejects a task-start reply
|
|
118
|
-
carrying no greeting. Proposed, not shipped; until it is, this obligation is
|
|
119
|
-
model-carried in practice, whatever the frequency join reports.
|
|
120
|
-
|
|
121
|
-
**Round 7 downgrade: that proposed mechanism is UNDECIDABLE as written, and the
|
|
122
|
-
obligation splits into a measured half and an unmeasurable one.** A *task* start
|
|
123
|
-
is recorded nowhere in a transcript — there is no task event on any host, and
|
|
124
|
-
`user-interrupt-priority`'s continuation/clarification/interrupt distinction is a
|
|
125
|
-
judgement, not a field. So a delivery check "that rejects a task-start reply" has
|
|
126
|
-
no way to know a task started. The proposal is not merely unbuilt; as specified it
|
|
127
|
-
cannot be built, and saying "proposed, not shipped" implied otherwise.
|
|
128
|
-
|
|
129
|
-
What IS decidable is the per-**session** instance, and it was measured rather than
|
|
130
|
-
asserted — reproducibly, which took a correction: the probe resolves the name
|
|
131
|
-
through the same settings layers this rule names and REFUSES when no layer carries
|
|
132
|
-
one, so the figure below is reproduced with the name passed explicitly
|
|
133
|
-
(`./scripts-run src/scripts/probe_session_canary --limit 30 --name <your name>`;
|
|
134
|
-
the first version hardcoded a maintainer's nickname as its default, which made the
|
|
135
|
-
number irreproducible for anyone else and silently read 0 %). Over 30 sessions on
|
|
136
|
-
2026-08-12: the opening greeting is present in **25 of 28** sessions carrying
|
|
137
|
-
assistant prose (89.3 %), and in **24 of 25** post-carrier (96.0 %). Of the three
|
|
138
|
-
misses, two predate the carrier (2026-07-21, 2026-07-29) and one is a session whose
|
|
139
|
-
first thirty turns were tool calls.
|
|
140
|
-
|
|
141
|
-
Both halves of that are load-bearing. The carrier works exactly where it has a
|
|
142
|
-
slot — `session_start` — which is why the session-scope figure is high; and the
|
|
143
|
-
24-of-29 task-start figure above is not contradicted by it, because the two count
|
|
144
|
-
different events. The honest statement is therefore: **session-scope compliance is
|
|
145
|
-
measured and good; task-scope compliance is unmeasured and unmeasurable with
|
|
146
|
-
today's transcript, and no gate can change that until a task boundary is recorded
|
|
147
|
-
somewhere.** Do not read the 96 % as covering the obligation as a whole.
|
|
148
|
-
|
|
149
|
-
**The wrong-name half needs nothing, and that is worth stating.** The beat
|
|
150
|
-
already carries the resolved value — `build_canary_reminder` emits
|
|
151
|
-
`Canary active for "<name>"`, and the hook no-ops when no layer resolves a name —
|
|
152
|
-
and both wrong-name occurrences predate it: 2026-08-04, where the per-turn beat
|
|
153
|
-
landed 2026-08-06. The inference path they measure is already closed, so a third
|
|
154
|
-
audit should not re-open it.
|
|
98
|
+
Four dated conformance audits stand behind those two slots — what the session-scope carrier fixed, what the second audit measured when it did not follow, why the proposed delivery check is undecidable as written, and the per-session figure that replaced it. They are the record, not the obligation, and live in
|
|
99
|
+
`contexts/execution/session-canary-enforcement-history.md`,
|
|
100
|
+
named in `load_context` above so a session that reaches this rule can open them.
|
|
155
101
|
|
|
156
102
|
**Two declared gaps, neither papered over.** On **Augment** there is no
|
|
157
103
|
`user_prompt_submit` slot; its `stop` fires *after* the reply, so injecting
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "2a"
|
|
4
4
|
alwaysApply: false
|
|
5
|
+
consequence_class: "authority-bypass"
|
|
5
6
|
description: "Asking the user about a setting — one question per command execution, a fixed four-slot shape, and the key's class decides where the answer goes"
|
|
6
7
|
triggers:
|
|
7
8
|
- keyword: "settings:set"
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
* `urp.collect()` completion criterion, and exit code 0. snake_case kept.
|
|
13
13
|
*
|
|
14
14
|
* A roadmap that has reached `count_open == 0` and `count_deferred == 0` is
|
|
15
|
-
* **complete
|
|
15
|
+
* **complete** — and so is one whose only `[~]` steps are bare, because the
|
|
16
|
+
* sweep first carries them to a follow-up (`deferral_carry.ts`; `--no-carry`
|
|
17
|
+
* turns that off). This sweep moves it to `agents/roadmaps/archive/`, rewrites code-comment-allow provenance-comment -- the sweep's own operand
|
|
16
18
|
* inbound references (`agents/roadmaps/<x>.md` → `agents/roadmaps/archive/<x>.md`) code-comment-allow provenance-comment -- the rewrite this sweep performs
|
|
17
19
|
* across tracked files so links never break, and regenerates the dashboard.
|
|
18
20
|
*
|
|
@@ -63,6 +65,7 @@ import {
|
|
|
63
65
|
collect,
|
|
64
66
|
parse_blockers,
|
|
65
67
|
} from './update_roadmap_progress.js';
|
|
68
|
+
import { BLOCK_END_RE, DEFERRED_RESOLUTION_RE, DEFERRED_STEP_RE, planCarry, type CarryPlan, type OwnerDecision } from './deferral_carry.js';
|
|
66
69
|
import { guardedBaselineProblems, parseGuardedBaselines } from './guarded_baseline.js';
|
|
67
70
|
|
|
68
71
|
import { isCliEntry } from './_cli_entry.js';
|
|
@@ -403,17 +406,6 @@ export interface DeferredItem {
|
|
|
403
406
|
destination: string | null;
|
|
404
407
|
}
|
|
405
408
|
|
|
406
|
-
/**
|
|
407
|
-
* `<!-- deferred-resolution: carried-to=<slug> -->` — the resolved-deferral
|
|
408
|
-
* annotation. `merged-into=<slug>` is the second accepted form.
|
|
409
|
-
*/
|
|
410
|
-
const DEFERRED_RESOLUTION_RE = /<!--\s*deferred-resolution:\s*(carried-to|merged-into)\s*=\s*([A-Za-z0-9._-]+)\s*-->/;
|
|
411
|
-
|
|
412
|
-
/** `- [~] …` — a deferred step, at any indent, with `-` or `*`. */
|
|
413
|
-
const DEFERRED_STEP_RE = /^[ \t]*[-*][ \t]+\[~\][ \t]*(.*)$/;
|
|
414
|
-
/** Any other checkbox, or a heading — where a step's block ends. */
|
|
415
|
-
const BLOCK_END_RE = /^[ \t]*[-*][ \t]+\[[ xX~-]\]|^#{1,6}[ \t]/;
|
|
416
|
-
|
|
417
409
|
/** Escape a string for literal use inside a `RegExp`. */
|
|
418
410
|
function _escapeRe(v: string): string {
|
|
419
411
|
return v.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
@@ -590,9 +582,10 @@ export function deferralProblems(
|
|
|
590
582
|
/** Archive every complete active roadmap: no open steps, and every `[~]` resolved. */
|
|
591
583
|
function archive_completed(
|
|
592
584
|
root: string,
|
|
593
|
-
opts: { changed_only: boolean; base: string; dry_run: boolean },
|
|
585
|
+
opts: { changed_only: boolean; base: string; dry_run: boolean; carry?: boolean; owner_decision?: OwnerDecision; only?: string | null },
|
|
594
586
|
): ArchiveRecord[] {
|
|
595
587
|
const { changed_only, base, dry_run } = opts;
|
|
588
|
+
const carry = opts.carry ?? true;
|
|
596
589
|
const roadmap_root = path.join(root, 'agents', 'roadmaps');
|
|
597
590
|
if (!_isDir(roadmap_root)) {
|
|
598
591
|
return [];
|
|
@@ -617,7 +610,12 @@ function archive_completed(
|
|
|
617
610
|
);
|
|
618
611
|
|
|
619
612
|
const archived: ArchiveRecord[] = [];
|
|
613
|
+
// `--only`: the owner's archive answer is about ONE roadmap. Without the
|
|
614
|
+
// filter, `--owner-decision later` would also park every other roadmap
|
|
615
|
+
// still waiting on its own, unasked owner question.
|
|
616
|
+
const only = opts.only ? opts.only.replace(/^.*\//, '').replace(/\.md$/, '') + '.md' : null;
|
|
620
617
|
for (const stats of collect(roadmap_root)) {
|
|
618
|
+
if (only !== null && stats.rel !== only) continue;
|
|
621
619
|
// `guarded-baseline` is INCOMPLETE by construction (council 2026-08-31,
|
|
622
620
|
// 2/2 convergent) — checked BEFORE the open-step test on purpose. A
|
|
623
621
|
// well-formed record keeps its box `[ ]` and would be skipped silently as
|
|
@@ -625,7 +623,7 @@ function archive_completed(
|
|
|
625
623
|
// and invisible in a sweep that only reports what it moved; a MALFORMED
|
|
626
624
|
// one on `[x]` would otherwise archive with an annotation claiming the
|
|
627
625
|
// opposite. Both are named here instead.
|
|
628
|
-
|
|
626
|
+
let roadmapText = fs.readFileSync(path.join(roadmap_root, stats.rel), 'utf-8');
|
|
629
627
|
const guarded = parseGuardedBaselines(roadmapText);
|
|
630
628
|
if (guarded.length > 0) {
|
|
631
629
|
process.stderr.write(
|
|
@@ -644,13 +642,54 @@ function archive_completed(
|
|
|
644
642
|
// A `[~]` no longer blocks unconditionally: it blocks unless it carries a
|
|
645
643
|
// validated resolution annotation. See `deferralProblems` for why, and
|
|
646
644
|
// for every way that check fails closed.
|
|
645
|
+
const old_rel = `agents/roadmaps/${stats.rel}`;
|
|
646
|
+
let open_blockers = stats.open_blockers.map((b) => b.id);
|
|
647
647
|
if (stats.deferred !== 0) {
|
|
648
648
|
const abs = path.join(roadmap_root, stats.rel);
|
|
649
649
|
// The source's own slug is removed: it is trivially in `sweepSet`,
|
|
650
650
|
// and self-reference is reported by its own, clearer message.
|
|
651
651
|
const others = new Set(sweepSet);
|
|
652
652
|
others.delete(stats.rel.replace(/\.md$/, ''));
|
|
653
|
-
|
|
653
|
+
// Bare `[~]` steps are carried to a follow-up first, then validated
|
|
654
|
+
// like any hand-written carry — see `deferral_carry.ts`. Only for a
|
|
655
|
+
// roadmap this sweep would actually archive, so a `--changed-only`
|
|
656
|
+
// run never writes a follow-up for someone else's roadmap.
|
|
657
|
+
const inScope = !changed_only || (touched as Set<string>).has(old_rel);
|
|
658
|
+
const bare = parseDeferredItems(roadmapText).some((d) => d.kind === null);
|
|
659
|
+
if (carry && inScope && bare) {
|
|
660
|
+
const outcome = planCarry(root, stats.rel, roadmapText, open_blockers, _today(), opts.owner_decision ?? 'ask');
|
|
661
|
+
if ('refused' in outcome) {
|
|
662
|
+
process.stderr.write(` ⚠️ ${stats.rel}: deferrals not carried — ${outcome.refused}.\n`);
|
|
663
|
+
} else if (outcome.plan.ownerBlockers.length > 0 && !outcome.plan.parked) {
|
|
664
|
+
// The steps wait on the OWNER. Nothing is written: whether
|
|
665
|
+
// to park them or work them is the owner's call, and the
|
|
666
|
+
// step-by-step offer needs the first step on screen.
|
|
667
|
+
process.stdout.write(_ownerDecisionBlock(stats.rel, outcome.plan));
|
|
668
|
+
continue;
|
|
669
|
+
} else {
|
|
670
|
+
const { plan } = outcome;
|
|
671
|
+
process.stdout.write(
|
|
672
|
+
` ↪ ${stats.rel}: carried ${plan.carried} deferred step(s)` +
|
|
673
|
+
(plan.movedBlockers.length > 0 ? ` and blocker(s) ${plan.movedBlockers.join(', ')}` : '') +
|
|
674
|
+
` → ${plan.destRel}\n`,
|
|
675
|
+
);
|
|
676
|
+
if (dry_run) {
|
|
677
|
+
// Nothing was written, so the validation below would
|
|
678
|
+
// read the old file; report the move it would make.
|
|
679
|
+
archived.push({ roadmap: old_rel, archived_to: `agents/roadmaps/archive/${stats.rel}`, refs_migrated: [] });
|
|
680
|
+
continue;
|
|
681
|
+
}
|
|
682
|
+
fs.mkdirSync(path.dirname(path.join(root, plan.destRel)), { recursive: true });
|
|
683
|
+
fs.writeFileSync(path.join(root, plan.destRel), plan.destText, 'utf-8');
|
|
684
|
+
fs.writeFileSync(abs, plan.sourceText, 'utf-8');
|
|
685
|
+
// Staged so the blocker-divergence check below compares the
|
|
686
|
+
// carry against itself, not against the pre-carry index.
|
|
687
|
+
_run(['git', 'add', '--', plan.destRel, old_rel], root);
|
|
688
|
+
roadmapText = plan.sourceText;
|
|
689
|
+
open_blockers = open_blockers.filter((id) => !plan.movedBlockers.includes(id));
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
const problems = deferralProblems(root, stats.rel, roadmapText, others);
|
|
654
693
|
if (problems.length > 0) {
|
|
655
694
|
process.stderr.write(
|
|
656
695
|
` ⚠️ ${stats.rel}: ${problems.length} unresolved deferral(s) — not archived.\n`,
|
|
@@ -666,9 +705,8 @@ function archive_completed(
|
|
|
666
705
|
// predicted shipped in the 9.36.0 changelog head. Same discipline
|
|
667
706
|
// `roadmap-progress-sync` Iron Law 3 applies to `[~]` steps: a roadmap
|
|
668
707
|
// carrying an open decision stays visible until the decision is made.
|
|
669
|
-
const open_blockers = stats.open_blockers;
|
|
670
708
|
if (open_blockers.length > 0) {
|
|
671
|
-
const ids = open_blockers.
|
|
709
|
+
const ids = open_blockers.join(', ');
|
|
672
710
|
process.stderr.write(
|
|
673
711
|
` ⚠️ ${stats.rel}: all steps closed but ${open_blockers.length} ` +
|
|
674
712
|
`blocker(s) still open (${ids}) — not archived. Resolve them, ` +
|
|
@@ -676,7 +714,6 @@ function archive_completed(
|
|
|
676
714
|
);
|
|
677
715
|
continue;
|
|
678
716
|
}
|
|
679
|
-
const old_rel = `agents/roadmaps/${stats.rel}`;
|
|
680
717
|
if (changed_only && !(touched as Set<string>).has(old_rel)) {
|
|
681
718
|
continue; // complete, but not this branch's work
|
|
682
719
|
}
|
|
@@ -722,6 +759,38 @@ function archive_completed(
|
|
|
722
759
|
return archived;
|
|
723
760
|
}
|
|
724
761
|
|
|
762
|
+
/**
|
|
763
|
+
* The owner question, rendered for a human AND forwarded verbatim by a
|
|
764
|
+
* subagent: the trailing `OWNER-DECISION` line is one JSON object, so an
|
|
765
|
+
* orchestrator can re-present the decision without re-deriving it. A subagent
|
|
766
|
+
* never answers it and never re-runs with `--owner-decision later` itself.
|
|
767
|
+
*/
|
|
768
|
+
function _ownerDecisionBlock(rel: string, plan: CarryPlan): string {
|
|
769
|
+
const ids = plan.ownerBlockers.join(', ');
|
|
770
|
+
const park = `agents/roadmaps/later/${plan.destSlug}.md`;
|
|
771
|
+
const step = plan.firstStep.split('\n').map((l) => ` ${l}`).join('\n');
|
|
772
|
+
const record = {
|
|
773
|
+
roadmap: `agents/roadmaps/${rel}`,
|
|
774
|
+
owner_blockers: plan.ownerBlockers,
|
|
775
|
+
deferred_steps: plan.carried,
|
|
776
|
+
park_to: park,
|
|
777
|
+
archive_command: `./agent-config roadmap:archive --all --owner-decision later --only ${rel}`,
|
|
778
|
+
first_step: plan.firstStep,
|
|
779
|
+
};
|
|
780
|
+
return (
|
|
781
|
+
` ❓ ${rel}: ${plan.carried} deferred step(s) wait on owner blocker(s) ${ids} — not archived; the owner decides:\n` +
|
|
782
|
+
` 1. Archive it — the steps and their blockers park in ${park}\n` +
|
|
783
|
+
` (${record.archive_command})\n` +
|
|
784
|
+
' 2. Work them step by step, starting with:\n' +
|
|
785
|
+
`${step}\n` +
|
|
786
|
+
` OWNER-DECISION ${JSON.stringify(record)}\n`
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
function _today(): string {
|
|
791
|
+
return new Date().toISOString().slice(0, 10);
|
|
792
|
+
}
|
|
793
|
+
|
|
725
794
|
function _isDir(p: string): boolean {
|
|
726
795
|
try {
|
|
727
796
|
return fs.statSync(p).isDirectory();
|
|
@@ -824,13 +893,16 @@ function _runTwin(root: string, script: string): void {
|
|
|
824
893
|
const _PROG = 'archive_completed_roadmaps.py';
|
|
825
894
|
|
|
826
895
|
function _usage(): string {
|
|
827
|
-
return `usage: ${_PROG} [-h] [--all] [--base BASE] [--dry-run] [--repo-root REPO_ROOT]\n`;
|
|
896
|
+
return `usage: ${_PROG} [-h] [--all] [--base BASE] [--dry-run] [--no-carry] [--owner-decision later] [--only ROADMAP] [--repo-root REPO_ROOT]\n`;
|
|
828
897
|
}
|
|
829
898
|
|
|
830
899
|
interface Args {
|
|
831
900
|
all: boolean;
|
|
832
901
|
base: string;
|
|
833
902
|
dry_run: boolean;
|
|
903
|
+
carry: boolean;
|
|
904
|
+
owner_decision: OwnerDecision;
|
|
905
|
+
only: string | null;
|
|
834
906
|
repo_root: string | null;
|
|
835
907
|
}
|
|
836
908
|
|
|
@@ -838,6 +910,9 @@ function _parseArgs(argv: readonly string[]): Args {
|
|
|
838
910
|
let all = false;
|
|
839
911
|
let base = 'origin/main';
|
|
840
912
|
let dry_run = false;
|
|
913
|
+
let carry = true;
|
|
914
|
+
let owner_decision: OwnerDecision = 'ask';
|
|
915
|
+
let only: string | null = null;
|
|
841
916
|
let repo_root: string | null = null;
|
|
842
917
|
const emitError = (msg: string): never => {
|
|
843
918
|
process.stderr.write(_usage());
|
|
@@ -856,6 +931,23 @@ function _parseArgs(argv: readonly string[]): Args {
|
|
|
856
931
|
} else if (tok === '--dry-run') {
|
|
857
932
|
dry_run = true;
|
|
858
933
|
i += 1;
|
|
934
|
+
} else if (tok === '--no-carry') {
|
|
935
|
+
carry = false;
|
|
936
|
+
i += 1;
|
|
937
|
+
} else if (tok === '--only' || tok.startsWith('--only=')) {
|
|
938
|
+
const val = tok.includes('=') ? tok.slice(tok.indexOf('=') + 1) : argv[i + 1];
|
|
939
|
+
if (val === undefined || val === '') {
|
|
940
|
+
emitError('argument --only: expected one argument');
|
|
941
|
+
}
|
|
942
|
+
only = val as string;
|
|
943
|
+
i += tok.includes('=') ? 1 : 2;
|
|
944
|
+
} else if (tok === '--owner-decision' || tok.startsWith('--owner-decision=')) {
|
|
945
|
+
const val = tok.includes('=') ? tok.slice(tok.indexOf('=') + 1) : argv[i + 1];
|
|
946
|
+
if (val !== 'later' && val !== 'ask') {
|
|
947
|
+
emitError("argument --owner-decision: expected 'later' or 'ask'");
|
|
948
|
+
}
|
|
949
|
+
owner_decision = val as OwnerDecision;
|
|
950
|
+
i += tok.includes('=') ? 1 : 2;
|
|
859
951
|
} else if (tok === '--base') {
|
|
860
952
|
const val = argv[i + 1];
|
|
861
953
|
if (val === undefined) {
|
|
@@ -880,7 +972,7 @@ function _parseArgs(argv: readonly string[]): Args {
|
|
|
880
972
|
emitError(`unrecognized arguments: ${tok}`);
|
|
881
973
|
}
|
|
882
974
|
}
|
|
883
|
-
return { all, base, dry_run, repo_root };
|
|
975
|
+
return { all, base, dry_run, carry, owner_decision, only, repo_root };
|
|
884
976
|
}
|
|
885
977
|
|
|
886
978
|
function main(argv?: readonly string[]): number {
|
|
@@ -894,6 +986,9 @@ function main(argv?: readonly string[]): number {
|
|
|
894
986
|
changed_only: !ns.all,
|
|
895
987
|
base: ns.base,
|
|
896
988
|
dry_run: ns.dry_run,
|
|
989
|
+
carry: ns.carry,
|
|
990
|
+
owner_decision: ns.owner_decision,
|
|
991
|
+
only: ns.only,
|
|
897
992
|
});
|
|
898
993
|
if (archived.length === 0) {
|
|
899
994
|
process.stdout.write(' ℹ️ No completed roadmaps to archive.\n');
|