@event4u/agent-config 9.27.0 → 9.28.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.
Files changed (138) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/AGENTS.md +12 -11
  3. package/CHANGELOG.md +99 -0
  4. package/README.md +1 -1
  5. package/dist/agent-src/commands/analyze/conformance.md +24 -0
  6. package/dist/agent-src/contexts/execution/orchestration-telemetry.md +10 -3
  7. package/dist/agent-src/rules/artifact-engagement-recording.md +4 -1
  8. package/dist/agent-src/rules/autonomous-execution.md +1 -1
  9. package/dist/agent-src/rules/brand-source-of-truth.md +33 -6
  10. package/dist/agent-src/rules/context-hygiene.md +3 -1
  11. package/dist/agent-src/rules/council-availability.md +93 -0
  12. package/dist/agent-src/rules/cross-source-consistency.md +3 -0
  13. package/dist/agent-src/rules/delegation-policy.md +29 -5
  14. package/dist/agent-src/rules/design-fidelity.md +3 -0
  15. package/dist/agent-src/rules/evaluator-independence.md +2 -1
  16. package/dist/agent-src/rules/external-code-graph-interop.md +2 -1
  17. package/dist/agent-src/rules/finance-safety-floor.md +1 -1
  18. package/dist/agent-src/rules/git-history-discipline.md +1 -1
  19. package/dist/agent-src/rules/history-discipline.md +3 -1
  20. package/dist/agent-src/rules/legal-safety-floor.md +1 -1
  21. package/dist/agent-src/rules/no-pr-progress-comments.md +3 -1
  22. package/dist/agent-src/rules/onboarding-gate.md +3 -1
  23. package/dist/agent-src/rules/roadmap-ci-steps-policy.md +4 -1
  24. package/dist/agent-src/rules/role-mode-adherence.md +1 -1
  25. package/dist/agent-src/rules/scale-discipline.md +3 -1
  26. package/dist/agent-src/rules/self-repair-loop.md +103 -0
  27. package/dist/agent-src/rules/session-canary.md +2 -1
  28. package/dist/agent-src/rules/strategy-safety-floor.md +1 -1
  29. package/dist/agent-src/rules/token-budget-discipline.md +3 -1
  30. package/dist/agent-src/rules/tool-safety.md +5 -1
  31. package/dist/agent-src/skills/adversarial-review/SKILL.md +1 -1
  32. package/dist/agent-src/skills/analysis-autonomous-mode/SKILL.md +1 -1
  33. package/dist/agent-src/skills/performance-analysis/SKILL.md +1 -1
  34. package/dist/agent-src/skills/persona-improvement/SKILL.md +1 -1
  35. package/dist/agent-src/skills/project-analyzer/SKILL.md +1 -1
  36. package/dist/agent-src/skills/security-audit/SKILL.md +1 -1
  37. package/dist/agent-src/skills/sequential-thinking/SKILL.md +1 -1
  38. package/dist/agent-src/skills/skill-improvement-pipeline/SKILL.md +1 -1
  39. package/dist/agent-src/skills/universal-project-analysis/SKILL.md +1 -1
  40. package/dist/agent-src/templates/AGENTS.md +6 -10
  41. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  42. package/dist/cli/registry.js +7 -0
  43. package/dist/cli/registry.js.map +1 -1
  44. package/dist/cli-delegate/chunk-22GCIJ2O.js +270 -0
  45. package/dist/cli-delegate/{chunk-BCPIOAGV.js → chunk-2BE5I2MN.js} +8 -8
  46. package/dist/cli-delegate/{chunk-AIIUU73N.js → chunk-7OMQCH4V.js} +1 -1
  47. package/dist/cli-delegate/{chunk-HJ6DAJHR.js → chunk-GB2FSUEE.js} +57 -7
  48. package/dist/cli-delegate/{chunk-WR6GTRHJ.js → chunk-JXARCGVN.js} +3 -3
  49. package/dist/cli-delegate/{chunk-3KJIMFTB.js → chunk-PQSAQKHW.js} +466 -304
  50. package/dist/cli-delegate/chunk-REKCMYOU.js +2991 -0
  51. package/dist/cli-delegate/cmd_analyze_session.js +1 -1
  52. package/dist/cli-delegate/cmd_brand_status.js +134 -0
  53. package/dist/cli-delegate/cmd_conformance.js +7 -7
  54. package/dist/cli-delegate/cmd_converge.js +3 -3
  55. package/dist/cli-delegate/cmd_doctor.js +4 -4
  56. package/dist/cli-delegate/cmd_explain.js +80 -330
  57. package/dist/cli-delegate/cmd_export.js +5 -5
  58. package/dist/cli-delegate/cmd_fleet.js +3 -3
  59. package/dist/cli-delegate/cmd_handoff.js +2 -2
  60. package/dist/cli-delegate/cmd_mcp_available.js +433 -0
  61. package/dist/cli-delegate/cmd_migrate.js +3 -3
  62. package/dist/cli-delegate/cmd_packs_active.js +153 -0
  63. package/dist/cli-delegate/cmd_preflight.js +1 -1
  64. package/dist/cli-delegate/cmd_prune.js +5 -5
  65. package/dist/cli-delegate/cmd_route_audit.js +8 -8
  66. package/dist/cli-delegate/cmd_route_explain.js +4 -4
  67. package/dist/cli-delegate/cmd_settings_get.js +272 -0
  68. package/dist/cli-delegate/cmd_settings_migrate.js +5 -5
  69. package/dist/cli-delegate/cmd_settings_set.js +7 -2967
  70. package/dist/cli-delegate/cmd_sync.js +5 -5
  71. package/dist/cli-delegate/cmd_uninstall.js +5 -5
  72. package/dist/cli-delegate/cmd_update.js +4 -4
  73. package/dist/cli-delegate/cmd_upgrade.js +4 -4
  74. package/dist/cli-delegate/cmd_validate.js +5 -5
  75. package/dist/cli-delegate/cmd_versions.js +4 -4
  76. package/dist/discovery/deprecation-report.md +1 -1
  77. package/dist/discovery/discovery-manifest.json +100 -40
  78. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  79. package/dist/discovery/discovery-manifest.summary.md +3 -3
  80. package/dist/discovery/orphan-report.md +1 -1
  81. package/dist/discovery/packs.json +7 -5
  82. package/dist/discovery/trust-report.md +11 -11
  83. package/dist/discovery/workspaces.json +6 -4
  84. package/dist/hooks/dispatch.js +9004 -6132
  85. package/dist/install/install.mjs +697 -507
  86. package/dist/mcp/registry-manifest.json +3 -3
  87. package/dist/mcp/server.json +2 -2
  88. package/dist/mcp/server.mjs +127 -20
  89. package/dist/router.json +1 -1
  90. package/dist/scripts/_lib/agent_settings.js +80 -15
  91. package/dist/scripts/_lib/agent_settings.js.map +1 -1
  92. package/docs/contracts/settings-classes.md +29 -8
  93. package/docs/guidelines/agent-infra/memory-access.md +14 -3
  94. package/package.json +1 -1
  95. package/src/agent-src/templates/AGENTS.md +6 -10
  96. package/src/config/budgets.yml +29 -0
  97. package/src/config/evaluator-budgets.json +4 -4
  98. package/src/config/gate-coverage.yml +26 -0
  99. package/src/scripts/_cli/cmd_brand_status.ts +174 -0
  100. package/src/scripts/_cli/cmd_mcp_available.ts +266 -0
  101. package/src/scripts/_cli/cmd_packs_active.ts +225 -0
  102. package/src/scripts/_cli/cmd_settings_get.ts +324 -0
  103. package/src/scripts/_dispatch.bash +57 -0
  104. package/src/scripts/_lib/agent_settings.ts +82 -16
  105. package/src/scripts/_lib/carrier_divergence.ts +135 -0
  106. package/src/scripts/_lib/host_capability.ts +84 -1
  107. package/src/scripts/_lib/prompt_shape.ts +88 -0
  108. package/src/scripts/_lib/review_skipped_record.ts +102 -0
  109. package/src/scripts/_lib/rule_layer_overlap.ts +254 -0
  110. package/src/scripts/_lib/self_repair.ts +342 -0
  111. package/src/scripts/_lib/self_repair_store.ts +100 -0
  112. package/src/scripts/_lib/transcript_entry.ts +80 -0
  113. package/src/scripts/check_branch_freshness.ts +255 -0
  114. package/src/scripts/check_council_config_location.ts +125 -1
  115. package/src/scripts/check_standing_rule_delivery.ts +314 -0
  116. package/src/scripts/config/profiles.ts +13 -3
  117. package/src/scripts/conformance_scan.ts +272 -24
  118. package/src/scripts/council_availability_hook.ts +188 -0
  119. package/src/scripts/council_cli.ts +126 -7
  120. package/src/scripts/hook_manifest.yaml +107 -26
  121. package/src/scripts/hooks/block_no_verify.ts +39 -2
  122. package/src/scripts/hooks/block_unauthorized_git.ts +156 -7
  123. package/src/scripts/hooks/concern_registry.ts +10 -0
  124. package/src/scripts/hooks/delegation_nudge_hook.ts +450 -0
  125. package/src/scripts/hooks/end_review_nudge_hook.ts +726 -0
  126. package/src/scripts/hooks/orchestration_record_hook.ts +342 -0
  127. package/src/scripts/install.ts +151 -0
  128. package/src/scripts/language_mirror_hook.ts +30 -37
  129. package/src/scripts/measure_scope_dedup.ts +19 -13
  130. package/src/scripts/onboarding_gate_hook.ts +40 -1
  131. package/src/scripts/orchestration_record.ts +4 -1
  132. package/src/scripts/preamble_byte_census.ts +9 -20
  133. package/src/scripts/report_carrier_divergence.ts +364 -0
  134. package/src/scripts/report_skill_activation.ts +257 -0
  135. package/src/scripts/report_skill_obligation_violations.ts +579 -0
  136. package/src/scripts/routing_doctor.ts +77 -6
  137. package/src/scripts/self_repair_cli.ts +240 -0
  138. package/src/scripts/self_repair_hook.ts +241 -0
@@ -20,7 +20,7 @@ one of the six modes defined in
20
20
  [`role-contracts`](../docs/guidelines/agent-infra/role-contracts.md):
21
21
  `developer`, `reviewer`, `tester`, `po`, `incident`, `planner`.
22
22
 
23
- Read `roles.active_role` from `.agent-settings.yml` at session start. Empty / missing → rule is inert; do NOT guess a mode.
23
+ Read `roles.active_role` from `.agent-settings.yml` at session start — the project layer of a cascade that starts user-global, so use `agent-config settings:get roles.active_role`, which reports the value and the file it came from, rather than opening one file. Empty / missing → rule is inert; do NOT guess a mode.
24
24
 
25
25
  When active, every closing output MUST:
26
26
 
@@ -33,7 +33,9 @@ obligation_frequency: "per-edit"
33
33
  # Scale Discipline
34
34
 
35
35
  Pack floor for the `scale-discipline` pack (default-off; auto-activates
36
- when the pack is installed). AI agents produce functionally correct but
36
+ when the pack is installed — `agent-config packs:active` says whether it is,
37
+ and names the degraded case where zero packs load and this floor cannot
38
+ activate at all). AI agents produce functionally correct but
37
39
  scale-hostile persistence code — this rule binds the failure classes to
38
40
  deterministic pattern lints where possible and to review advice where not.
39
41
 
@@ -0,0 +1,103 @@
1
+ ---
2
+ type: "auto"
3
+ tier: "2a"
4
+ description: "An observed defect in the agent's own behaviour becomes a queued record and a fix against agent-config — never a silent shrug"
5
+ triggers:
6
+ - keyword: "self-repair"
7
+ - keyword: "self-repair-queue"
8
+ - phrase: "nicht richtig gearbeitet"
9
+ - phrase: "du hast das falsch"
10
+ - phrase: "you ignored the rule"
11
+ - phrase: "that was wrong"
12
+ self_contained: true
13
+ workspaces: [agent-config-maintainer, construction, engineering, finance, founder, gtm, legal-review-prep, ops, product, small-business]
14
+ packs: [meta]
15
+ enforced_by:
16
+ - "hook:self-repair"
17
+ # obligation: line 28
18
+ obligation_frequency: "per-turn"
19
+ ---
20
+
21
+ # Self-Repair Loop
22
+
23
+ A defect in how the agent behaved is a defect in **agent-config**, not in the
24
+ user's project. The user should not have to file it, and the next user should
25
+ not meet it again. Two intake paths fill one queue: the user says so
26
+ (`user_prompt_submit`), or a deterministic detector fires at turn end (`stop`).
27
+
28
+ ## The Iron Law
29
+
30
+ ```
31
+ AN OBSERVED DEFECT IN THE AGENT'S OWN BEHAVIOUR IS QUEUED AND FIXED — NEVER SHRUGGED OFF.
32
+ THE DEFECT BELONGS TO AGENT-CONFIG. NEVER "FIX" IT BY EDITING THE USER'S PROJECT.
33
+ CORRECT THE TURN OPENLY IN FRONT OF THE USER. NEVER RE-RUN IT SILENTLY TO HIDE THE MISS.
34
+ THE OUTWARD STEP — PUSH, PR, ISSUE — NEEDS THE USER'S WORD THIS TURN. NO EXCEPTION.
35
+ ```
36
+
37
+ ## When the queue line appears
38
+
39
+ `<self-repair-queue>` is injected at prompt time while records are open. It is
40
+ work, not a notification:
41
+
42
+ 1. **Read it** — `agent-config self-repair:status`, then the newest record
43
+ under `agents/runtime/self-repair/`.
44
+ 2. **Name the surface that failed** — the rule, skill, gate, or missing carrier
45
+ that allowed the behaviour. A defect with no named surface is an apology,
46
+ not a fix.
47
+ 3. **Author the fix against agent-config** — in a checkout if one exists, so
48
+ the release can be a pull request; otherwise the report alone becomes an
49
+ issue.
50
+ 4. **Offer the release** — `agent-config self-repair:release <fingerprint>`;
51
+ `--dry-run` shows route and body without touching the network. Running it is
52
+ the user's call, per
53
+ [`non-destructive-by-default`](non-destructive-by-default.md).
54
+
55
+ ## Correct openly, never silently
56
+
57
+ Reported by the user → redo the task properly in the same turn, visibly, saying
58
+ what changed. Found by a detector → say so at the next opportunity and correct
59
+ it. Forbidden is the hidden version: re-running the turn so the miss never
60
+ surfaces. That mechanism (`attempt → critic → re-attempt`) was benchmarked and
61
+ falsified under ADR-106 — capability Δ = 0, council verdict TERMINAL — and the
62
+ same verdict names the replacement lever: refine the rules on the failure tail,
63
+ which is what a queued record feeds. Hiding the miss also destroys the only
64
+ signal the loop runs on.
65
+
66
+ ## What the detectors do NOT do
67
+
68
+ They do not check that every rule was followed. Most obligations here are
69
+ model-carried and unobservable from a transcript; guessing at them would
70
+ manufacture defects and flood the queue. A new detector must fire on a real
71
+ recorded failure **and** stay silent on its near-miss.
72
+
73
+ ## Privacy — fail-closed by construction
74
+
75
+ A record carries a class, a sanitized evidence span and a counter, and has **no
76
+ field** that can hold a prompt, a file body, or a project path. It passes the
77
+ audited privacy floor before leaving the machine; a refusal downgrades it to
78
+ local-only rather than scrubbing it into publishable shape — the same principle
79
+ as [`domain-safety-pii`](domain-safety-pii.md) § Surface 2.
80
+
81
+ ## When NOT to fire
82
+
83
+ The user is criticising the **code**, not the agent's conduct; the fingerprint
84
+ is already an open record (the hook increments it); or a one-off caused by
85
+ information the agent could not have had — note it, do not queue it.
86
+
87
+ ## Enforcement
88
+
89
+ The hook is `fail_closed: false` and always exits 0: it records, it never
90
+ gates — blocking a turn-end on a heuristic is the failure mode the
91
+ enforcement-projection null warns about. Detection is hook-carried, analysis and
92
+ fix model-carried; only the privacy gate and route choice are deterministic.
93
+ Nothing claims a defect *will* be caught — only that a caught one is not dropped.
94
+ Whether the hook is bound at all on this host is `agent-config hooks:status`; on
95
+ a host with no matching slot the detection half does not run and only the
96
+ model-carried half remains.
97
+
98
+ ## See also
99
+
100
+ - [`non-destructive-by-default`](non-destructive-by-default.md) — the Hard Floor the release step obeys.
101
+ - [`skill-improvement-pipeline`](../skills/skill-improvement-pipeline/SKILL.md) — the sibling loop for capability gaps.
102
+ - [`upstream-contribute`](../skills/upstream-contribute/SKILL.md) — the manual path this automates.
103
+ - [`council-availability`](council-availability.md) — the defect class that motivated the first detector.
@@ -80,7 +80,8 @@ name it and suggest a fresh session or `/agent-handoff`, per
80
80
  > bound in **two** slots. `session_start` injects the full `<session-canary>`
81
81
  > contract once, so a fresh conversation cannot start without it.
82
82
  > `user_prompt_submit` injects a one-line beat every turn, which is what
83
- > actually reaches a task boundary.
83
+ > actually reaches a task boundary. Both bindings are manifest facts; whether
84
+ > they are live on this install is `agent-config hooks:status`.
84
85
 
85
86
  **Why two slots, and why not one.** The obligation is per *task*. No host has a
86
87
  per-task slot — Cline maps `TaskStart`/`TaskResume` onto `session_start`, and
@@ -43,7 +43,7 @@ obligation_frequency: "per-task"
43
43
 
44
44
  # Strategy Safety Floor
45
45
 
46
- Domain safety floor for founder-strategy artefacts (vision, positioning, competitive moats, market entry, OKR trees, build-vs-buy). Auto-activates when `pack-founder-strategy` is installed.
46
+ Domain safety floor for founder-strategy artefacts (vision, positioning, competitive moats, market entry, OKR trees, build-vs-buy). Auto-activates when `pack-founder-strategy` is installed — `agent-config packs:active` says whether it is, and names the degraded case where zero packs load and this floor cannot activate at all.
47
47
 
48
48
  ## Iron Law — strategy is a frame, not a verdict
49
49
 
@@ -32,7 +32,9 @@ TO THE FULL FRUGALITY CANON (telegraph-speak, thin-projector).
32
32
  | `standard` | — | Balanced condensation | Not trimmed if priority ≥ 60 | 500–2000 tokens |
33
33
  | `rich` | Must be declared + justified | **Exempt** | **Never trimmed** | 2000–3500 tokens |
34
34
 
35
- Read `tokens.rich_skills` from `.agent-settings.yml` (default `on`) to determine
35
+ Read `tokens.rich_skills` from `.agent-settings.yml` (default `on`) — the project
36
+ layer of a cascade that starts user-global, so `agent-config settings:get
37
+ tokens.rich_skills` is the read that answers it, file included — to determine
36
38
  whether rich skills may load in full. If `off`, treat them as `standard`. If
37
39
  `ask`, the question's shape is
38
40
  [`settings-ask-protocol`](settings-ask-protocol.md)'s, not this rule's; what only
@@ -25,7 +25,11 @@ Tools are permissions, not abilities. Every tool access must be declared and rev
25
25
  ## Constraints
26
26
 
27
27
  - **Deny by default** — no tool access unless explicitly listed in `allowed_tools`
28
- - **Allowlist only** — tool names must match the tool registry
28
+ - **Allowlist only** — tool names must match the tool registry. That registry is
29
+ a small static constant and is **not** the same thing as the MCP servers a
30
+ session can reach; `agent-config mcp:available` prints both, kept apart, and
31
+ says plainly that it performs no handshake. Conflating the two is how a skill
32
+ ends up declaring a tool nothing provides.
29
33
  - **Read-first** — prefer read-only actions; write requires explicit approval
30
34
  - **No hidden credentials** — tools must not embed API keys or tokens in skill files
31
35
  - **No arbitrary execution** — tool adapters have fixed interfaces, not free-form calls
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  model_tier: high
3
3
  name: adversarial-review
4
- description: "ONLY on a request for adversarial review, devil's advocate, stress-test, or honest critique ('poke holes', 'be brutal', 'was hältst du davon') — NOT routine code/design review."
4
+ description: "Adversarial critique — devil's advocate, stress-test, honest teardown ('poke holes', 'be brutal', 'was hältst du davon'); explicit request only. Routine code or design review → code-review."
5
5
  personas:
6
6
  - critical-challenger
7
7
  domain: quality
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  model_tier: high
3
3
  name: analysis-autonomous-mode
4
- description: "ONLY when user explicitly requests autonomous analysis, deep investigation, multi-step research, or 'dig into this end-to-end without asking me each step' — NOT for normal feature work."
4
+ description: "Autonomous multi-step investigation — deep research carried end-to-end without per-step approval; explicit request only, never for normal feature work."
5
5
  domain: discovery
6
6
  workspaces:
7
7
  - agent-config-maintainer
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  model_tier: high
3
3
  name: performance-analysis
4
- description: "ONLY when user explicitly requests: performance audit, bottleneck analysis, or N+1 query detection. NOT for regular feature work."
4
+ description: "Performance audit — bottleneck profiling, N+1 query detection, hot-path analysis; explicit request only, not part of regular feature work."
5
5
  personas:
6
6
  - performance-engineer
7
7
  domain: discovery
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  model_tier: inherit
3
3
  name: persona-improvement
4
- description: "ONLY when the user explicitly asks to refine a persona from recent corrections — persona analog of skill-improvement-pipeline; tightens a persona's Unique Questions, governance-gated."
4
+ description: "Refine a persona from recent corrections — tightens its Unique Questions, governance-gated; explicit request only. Skill analog → skill-improvement-pipeline."
5
5
  domain: process
6
6
  execution:
7
7
  type: assisted
@@ -2,7 +2,7 @@
2
2
  model_tier: high
3
3
  context: large
4
4
  name: project-analyzer
5
- description: "ONLY when user asks for single-pass tech-stack detection or `agents/evidence/analysis/` write-up. Deep multi-pass audit → `universal-project-analysis`. Raw primitives → `project-analysis-core`."
5
+ description: "Single-pass tech-stack detection with an agents/evidence/analysis/ write-up; explicit request only. Deep multi-pass audit → universal-project-analysis. Raw primitives → project-analysis-core."
6
6
  domain: discovery
7
7
  workspaces:
8
8
  - engineering
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  model_tier: high
3
3
  name: security-audit
4
- description: "ONLY when user explicitly requests: security audit, vulnerability scan, or penetration test review. NOT for regular feature work."
4
+ description: "Security audit — vulnerability scan, pentest review, attack-surface sweep; explicit request only, not regular feature work. Pre-implementation threat pass → threat-modeling."
5
5
  domain: quality
6
6
  parallelizable: files
7
7
  workspaces:
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  model_tier: high
3
3
  name: sequential-thinking
4
- description: "ONLY when user explicitly requests: step-by-step reasoning, structured problem decomposition, or iterative analysis. NOT for regular coding tasks."
4
+ description: "Structured step-by-step problem decomposition and iterative analysis; explicit request only, never for regular coding tasks, and at most once per task."
5
5
  domain: process
6
6
  workspaces:
7
7
  - agent-config-maintainer
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  model_tier: inherit
3
3
  name: skill-improvement-pipeline
4
- description: "ONLY when user explicitly requests: run the skill improvement pipeline after a learning was detected. Orchestrates capture, classify, create, validate, and apply."
4
+ description: "Run the skill-improvement pipeline after a learning was detected — capture, classify, create, validate, apply; explicit request only."
5
5
  domain: process
6
6
  execution:
7
7
  type: assisted
@@ -2,7 +2,7 @@
2
2
  model_tier: high
3
3
  context: large
4
4
  name: universal-project-analysis
5
- description: "ONLY when user asks for deep multi-pass codebase audit — orchestrator routing to `project-analysis-core` + framework-specific `project-analysis-*`. Single-pass scan → `project-analyzer`."
5
+ description: "Deep multi-pass codebase audit — orchestrates project-analysis-core plus the framework-specific project-analysis-*; explicit request only. Single-pass scan → project-analyzer."
6
6
  domain: discovery
7
7
  workspaces:
8
8
  - engineering
@@ -1,11 +1,6 @@
1
1
  # {{project_name}}
2
2
 
3
- <!--
4
- Fill placeholders or run `/agents init`, then delete this
5
- comment. Iron Law — capability bullets, not path lists; paths rot.
6
- Tool stubs (`CLAUDE.md`, `GEMINI.md`, `.cursorrules`) link here.
7
- Anatomy + recipes: `.augment/contexts/contracts/agents-md-anatomy.md`.
8
- -->
3
+ <!-- Fill placeholders or run `/agents init`; delete after. Capability bullets, not paths. Recipes: `.augment/contexts/contracts/agents-md-anatomy.md`. -->
9
4
 
10
5
  > {{project_description}}
11
6
 
@@ -18,11 +13,12 @@
18
13
 
19
14
  ## Pointers
20
15
 
21
- - **Filling out this AGENTS.md** — section templates, capability bullets, multi-agent entry flow, monorepo per-package layout: [`.augment/contexts/contracts/consumer-agents-md-guide.md`](.augment/contexts/contracts/consumer-agents-md-guide.md).
22
- - **Behavior rules (always active)** — [`.augment/rules/`](.augment/rules/). Kernel rules are **immutable** — never propose an edit; tighten-only via the override registry.
23
- - **Skills (on-demand expertise)** — domain skills surfaced by description; invoked when their trigger fires: [`.augment/skills/`](.augment/skills/).
24
- - **Commands (workflows)** — slash-commands the agent runs end-to-end (`/work`, `/implement-ticket`, `/commit`, `/create-pr`, …): [`.augment/commands/`](.augment/commands/).
16
+ - **Filling out this AGENTS.md** — section templates, capability bullets, multi-agent entry flow, monorepo layout: [`consumer-agents-md-guide`](.augment/contexts/contracts/consumer-agents-md-guide.md).
17
+ - **Behavior rules (always active)** — [`.augment/rules/`](.augment/rules/). Kernel rules are **immutable**; tighten only via the override registry.
18
+ - **Skills (on-demand expertise)** — domain skills surfaced by description, invoked on trigger match: [`.augment/skills/`](.augment/skills/).
19
+ - **Commands (workflows)** — slash-commands the agent runs end-to-end (`/work`, `/create-pr`, …): [`.augment/commands/`](.augment/commands/).
25
20
  - **Project-specific docs** — your own architecture notes, roadmaps, sessions, contexts: [`agents/`](agents/).
21
+ - **Delegation & review** — dispatch independent-slice tasks to subagents instead of serial work; a mutating session ends after a neutral cross-model review: [`delegation-policy`](.augment/rules/delegation-policy.md).
26
22
 
27
23
  ## Emergency triage — read this when nothing else is reachable
28
24
 
@@ -39,7 +39,7 @@ schema_version: 1
39
39
  # CI guard: a release bump of `package.json` must update this value
40
40
  # in lockstep — see scripts/check_template_pin_drift.ts (road-to-
41
41
  # portable-runtime-and-update-check P3.3).
42
- agent_config_version: "9.27.0"
42
+ agent_config_version: "9.28.0"
43
43
 
44
44
  # --- Project identity ---
45
45
  project:
@@ -24,6 +24,7 @@ export const REGISTRY = [
24
24
  { name: 'settings:check', disposition: 'delegate', synopsis: 'Validate .agent-settings.yml against the YAML-subset contract (read-only).' },
25
25
  { name: 'settings:sync', disposition: 'delegate', synopsis: 'Additively merge new template keys into an existing .agent-settings.yml.' },
26
26
  { name: 'settings:migrate', disposition: 'delegate', synopsis: 'Lift legacy project-local settings into ~/.event4u/agent-config/.' },
27
+ { name: 'settings:get', disposition: 'delegate', synopsis: 'Read one setting: value, resolved source file, class, and absent-vs-default divergence.' },
27
28
  { name: 'settings:set', disposition: 'delegate', synopsis: 'Set one A/B-class setting in the global file; C-class keys are refused.' },
28
29
  { name: 'uninstall', disposition: 'delegate', synopsis: 'Remove bridge markers (project) or lockfile entries (global).' },
29
30
  { name: 'prune', disposition: 'delegate', synopsis: 'Remove project bridge markers not declared in installed-tools.lock.' },
@@ -40,6 +41,8 @@ export const REGISTRY = [
40
41
  { name: 'setup', disposition: 'native', synopsis: 'Open the onboarding wizard (UI server, lands on Identity).' },
41
42
  { name: 'workspaces', disposition: 'native', synopsis: 'List workspaces from the discovery manifest (ls subcommand).' },
42
43
  { name: 'packs', disposition: 'native', synopsis: 'List packs from the discovery manifest (ls subcommand).' },
44
+ { name: 'packs:active', disposition: 'delegate', synopsis: 'Which packs are active here, from which file — names the degraded zero-pack case.' },
45
+ { name: 'brand:status', disposition: 'delegate', synopsis: 'Whether a consumer brand tokens file is present, where, and dot-prefixed near-misses.' },
43
46
  { name: 'commands', disposition: 'native', synopsis: 'List/explain the command surface from the discovery manifest (ls / explain subcommands).' },
44
47
  { name: 'help', disposition: 'native', synopsis: 'Show TS-shell help; delegates --tier=N to Bash.' },
45
48
  { name: 'explain', disposition: 'delegate', synopsis: 'Read-only decision-chain trace (config | rule <name> | route "<text>") or command explanation.' },
@@ -48,6 +51,7 @@ export const REGISTRY = [
48
51
  { name: 'migrate', disposition: 'delegate', synopsis: 'One-shot migration off every legacy install / state shape.' },
49
52
  { name: 'mcp:render', disposition: 'delegate', synopsis: 'Render mcp.json into per-tool MCP client configs.' },
50
53
  { name: 'mcp:check', disposition: 'delegate', synopsis: 'Dry-run mcp:render; exit non-zero if targets are stale.' },
54
+ { name: 'mcp:available', disposition: 'delegate', synopsis: 'Declared MCP servers, whether each is launchable, and the separate tool registry.' },
51
55
  { name: 'mcp:setup', disposition: 'delegate', synopsis: 'Verify the tsx runtime + MCP server module; print the client config snippet.' },
52
56
  { name: 'mcp:run', disposition: 'delegate', synopsis: 'Run the built-in MCP server over stdio (experimental).' },
53
57
  { name: 'mcp-server', disposition: 'native', synopsis: 'Turnkey read-only stdio MCP server over the bundled content (no repo clone; ADR-085).' },
@@ -97,7 +101,10 @@ export const REGISTRY = [
97
101
  { name: 'council:estimate', disposition: 'delegate', synopsis: 'Pre-call council cost preview (no API call, no spend).' },
98
102
  { name: 'council:run', disposition: 'delegate', synopsis: 'Run the AI council (requires --confirm to spend).' },
99
103
  { name: 'council:render', disposition: 'delegate', synopsis: 'Re-render a saved council responses JSON to markdown.' },
104
+ { name: 'council:status', disposition: 'delegate', synopsis: 'Is a council configured, and from which file — zero spend, no inference.' },
100
105
  { name: 'eval:record', disposition: 'native', synopsis: 'Record a live trigger-eval result into a corpus manifest (corpus-refresh DoD, ADR-061 §6).' },
106
+ { name: 'self-repair:status', disposition: 'delegate', synopsis: 'List queued agent-config defect records (read-only).' },
107
+ { name: 'self-repair:release', disposition: 'delegate', synopsis: 'Publish one defect record as a PR, or an issue when a PR is impossible (Hard-Floor gated).' },
101
108
  ];
102
109
  export function findCommand(name) {
103
110
  return REGISTRY.find((entry) => entry.name === name);
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/cli/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,MAAM,CAAC,MAAM,QAAQ,GAA4B;IAC7C,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,iFAAiF,EAAE;IACtI,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,8BAA8B,EAAE;IACnF,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,kCAAkC,EAAE;IAC3F,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,oCAAoC,EAAE;IACzF,EAAE,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,oCAAoC,EAAE;IACrG,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,6DAA6D,EAAE;IACpH,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,mEAAmE,EAAE;IAC3H,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,mEAAmE,EAAE;IAC3H,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,sCAAsC,EAAE;IAC7F,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,0DAA0D,EAAE;IACjH,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,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ACjC,OAAO,WAAW,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,QAAQ,CAAC;AACvD,CAAC"}
@@ -0,0 +1,270 @@
1
+ import { createRequire as __acCreateRequire } from 'node:module'; const require = globalThis.require ?? __acCreateRequire(import.meta.url);
2
+ import {
3
+ DEFAULT_PROJECT_FILE,
4
+ logger
5
+ } from "./chunk-GB2FSUEE.js";
6
+
7
+ // src/scripts/config/profiles.ts
8
+ import * as fs2 from "node:fs";
9
+ import { createRequire } from "node:module";
10
+ import * as path2 from "node:path";
11
+
12
+ // src/scripts/_lib/agent_src.ts
13
+ import * as fs from "node:fs";
14
+ import * as path from "node:path";
15
+ import { fileURLToPath } from "node:url";
16
+ var _HERE = path.dirname(fileURLToPath(import.meta.url));
17
+ var _DEFAULT_ROOT = path.resolve(_HERE, "..", "..", "..");
18
+ function _deriveRoots(root) {
19
+ const packages = path.join(root, "packages");
20
+ const src = path.join(root, "src");
21
+ return {
22
+ ROOT: root,
23
+ LEGACY_SRC: path.join(root, ".agent-src.uncondensed"),
24
+ PACKAGES: packages,
25
+ PACKAGE_CORE: path.join(packages, "core"),
26
+ SRC: src,
27
+ SRC_SKILLS: path.join(src, "skills"),
28
+ SRC_RULES: path.join(src, "rules"),
29
+ SRC_AGENT: path.join(src, "agent-src"),
30
+ SRC_DOMAINS: path.join(src, "domains")
31
+ };
32
+ }
33
+ var _roots = _deriveRoots(_DEFAULT_ROOT);
34
+ function _isDir(p) {
35
+ try {
36
+ return fs.statSync(p).isDirectory();
37
+ } catch {
38
+ return false;
39
+ }
40
+ }
41
+ function _exists(p) {
42
+ try {
43
+ fs.statSync(p);
44
+ return true;
45
+ } catch {
46
+ return false;
47
+ }
48
+ }
49
+ function _iterdirSorted(p) {
50
+ let names;
51
+ try {
52
+ names = fs.readdirSync(p);
53
+ } catch {
54
+ return [];
55
+ }
56
+ names.sort();
57
+ return names.map((name) => path.join(p, name));
58
+ }
59
+ function artefact_roots() {
60
+ const roots = [];
61
+ if (_exists(_roots.LEGACY_SRC)) {
62
+ roots.push(_roots.LEGACY_SRC);
63
+ }
64
+ if (_exists(_roots.PACKAGES)) {
65
+ for (const pkg of _iterdirSorted(_roots.PACKAGES)) {
66
+ const sub = path.join(pkg, ".agent-src.uncondensed");
67
+ if (_isDir(sub)) {
68
+ roots.push(sub);
69
+ }
70
+ }
71
+ }
72
+ if (_isDir(_roots.SRC_AGENT)) {
73
+ roots.push(_roots.SRC_AGENT);
74
+ }
75
+ if (_isDir(_roots.SRC_SKILLS) || _isDir(_roots.SRC_RULES)) {
76
+ roots.push(_roots.SRC);
77
+ }
78
+ return roots;
79
+ }
80
+
81
+ // src/scripts/config/profiles.ts
82
+ var _require = createRequire(import.meta.url);
83
+ var PROFILE_ID_ENV = "AGENT_CONFIG_PROFILE_ID";
84
+ var DEFAULT_PROFILE_ID = "developer";
85
+ var PROFILES_DIRNAME = ".agent-src.uncondensed/profiles";
86
+ var SOURCE_PACK = "pack";
87
+ var SOURCE_USER = "user-settings";
88
+ var SOURCE_ENV = "env";
89
+ var SOURCE_RUNTIME = "runtime";
90
+ var SOURCE_DEFAULT = "default";
91
+ var SOURCE_MISSING = "missing";
92
+ var ResolvedProfile = class {
93
+ id;
94
+ audience;
95
+ preset_id;
96
+ packs;
97
+ personas;
98
+ skills_hint;
99
+ commands_hint;
100
+ docs_first_pointer;
101
+ source;
102
+ warning;
103
+ constructor(params) {
104
+ this.id = params.id;
105
+ this.audience = params.audience ?? {};
106
+ this.preset_id = params.preset_id ?? null;
107
+ this.packs = params.packs ?? [];
108
+ this.personas = params.personas ?? [];
109
+ this.skills_hint = params.skills_hint ?? [];
110
+ this.commands_hint = params.commands_hint ?? [];
111
+ this.docs_first_pointer = params.docs_first_pointer ?? null;
112
+ this.source = params.source ?? SOURCE_DEFAULT;
113
+ this.warning = params.warning ?? null;
114
+ }
115
+ };
116
+ var ProfileError = class extends Error {
117
+ constructor(message) {
118
+ super(message);
119
+ this.name = "ProfileError";
120
+ }
121
+ };
122
+ function _load_yaml(p) {
123
+ let YAML;
124
+ try {
125
+ YAML = _require("yaml");
126
+ } catch {
127
+ logger.info("PyYAML unavailable; profile %s returned empty", p);
128
+ return {};
129
+ }
130
+ let text;
131
+ try {
132
+ text = fs2.readFileSync(p, "utf-8");
133
+ } catch (exc) {
134
+ logger.warning("profile read failed for %s: %s", p, String(exc));
135
+ return {};
136
+ }
137
+ let data;
138
+ try {
139
+ data = YAML.parse(text, { version: "1.1" });
140
+ if (data === null || data === void 0) {
141
+ data = {};
142
+ }
143
+ } catch (exc) {
144
+ logger.warning("profile parse failed for %s: %s", p, String(exc));
145
+ return {};
146
+ }
147
+ return _isPlainDict(data) ? data : {};
148
+ }
149
+ function profile_file(project_root, profile_id) {
150
+ const legacy = path2.join(project_root, PROFILES_DIRNAME, `${profile_id}.yml`);
151
+ if (_exists2(legacy)) {
152
+ return legacy;
153
+ }
154
+ let roots;
155
+ try {
156
+ roots = artefact_roots();
157
+ } catch {
158
+ return legacy;
159
+ }
160
+ for (const root of roots) {
161
+ const candidate = path2.join(root, "profiles", `${profile_id}.yml`);
162
+ if (_exists2(candidate)) {
163
+ return candidate;
164
+ }
165
+ }
166
+ return legacy;
167
+ }
168
+ function _build_resolved(profile_id, raw, options) {
169
+ const block = _isPlainDict(raw["profile"]) ? raw["profile"] : {};
170
+ const audience_raw = _isPlainDict(block["audience"]) ? block["audience"] : {};
171
+ const defaults = _isPlainDict(block["defaults"]) ? block["defaults"] : {};
172
+ const surface = _isPlainDict(block["surface"]) ? block["surface"] : {};
173
+ const audience = {};
174
+ for (const k of Object.keys(audience_raw)) {
175
+ audience[String(k)] = String(audience_raw[k]);
176
+ }
177
+ const packs = _strTuple(block["packs"]);
178
+ const personas = _strTuple(defaults["personas"]);
179
+ const skills_hint = _strTuple(defaults["skills_hint"]);
180
+ const commands_hint = _strTuple(surface["commands_hint"]);
181
+ const docs_pointer = surface["docs_first_pointer"];
182
+ return new ResolvedProfile({
183
+ id: profile_id,
184
+ audience,
185
+ preset_id: defaults["preset_id"] ?? null,
186
+ packs,
187
+ personas,
188
+ skills_hint,
189
+ commands_hint,
190
+ docs_first_pointer: docs_pointer ? String(docs_pointer) : null,
191
+ source: options.source,
192
+ warning: options.warning ?? null
193
+ });
194
+ }
195
+ function _pick_id(pack_profile_id, user_settings, runtime_id) {
196
+ if (runtime_id) {
197
+ return [runtime_id, SOURCE_RUNTIME];
198
+ }
199
+ const env_id = process.env[PROFILE_ID_ENV];
200
+ if (env_id) {
201
+ return [env_id, SOURCE_ENV];
202
+ }
203
+ const block = _isPlainDict(user_settings) ? user_settings["profile"] : void 0;
204
+ if (_isPlainDict(block) && block["id"]) {
205
+ return [String(block["id"]), SOURCE_USER];
206
+ }
207
+ if (pack_profile_id) {
208
+ return [pack_profile_id, SOURCE_PACK];
209
+ }
210
+ return [null, SOURCE_MISSING];
211
+ }
212
+ function resolve_profile(params) {
213
+ const settings = params.user_settings ?? {};
214
+ const settings_file = path2.join(params.project_root, DEFAULT_PROJECT_FILE);
215
+ const [profile_id, source] = _pick_id(
216
+ params.pack_profile_id ?? null,
217
+ settings,
218
+ params.runtime_id ?? null
219
+ );
220
+ if (profile_id === null) {
221
+ if (_exists2(settings_file)) {
222
+ return new ResolvedProfile({
223
+ id: DEFAULT_PROFILE_ID,
224
+ source: SOURCE_MISSING,
225
+ warning: "no profile.id in .agent-settings.yml \u2014 run /onboard to pick an audience deliberately"
226
+ });
227
+ }
228
+ return _build_resolved(
229
+ DEFAULT_PROFILE_ID,
230
+ _load_yaml(profile_file(params.project_root, DEFAULT_PROFILE_ID)),
231
+ { source: SOURCE_DEFAULT }
232
+ );
233
+ }
234
+ const yaml_path = profile_file(params.project_root, profile_id);
235
+ if (!_exists2(yaml_path)) {
236
+ throw new ProfileError(
237
+ `profile.id=${_repr(profile_id)} (${source}) but ${yaml_path} not found`
238
+ );
239
+ }
240
+ return _build_resolved(profile_id, _load_yaml(yaml_path), { source });
241
+ }
242
+ function _exists2(p) {
243
+ try {
244
+ fs2.statSync(p);
245
+ return true;
246
+ } catch {
247
+ return false;
248
+ }
249
+ }
250
+ function _isPlainDict(value) {
251
+ return typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Map);
252
+ }
253
+ function _strTuple(value) {
254
+ if (!Array.isArray(value)) {
255
+ return [];
256
+ }
257
+ return value.map((v) => String(v));
258
+ }
259
+ function _repr(s) {
260
+ return `'${s.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
261
+ }
262
+
263
+ export {
264
+ artefact_roots,
265
+ PROFILE_ID_ENV,
266
+ SOURCE_MISSING,
267
+ ProfileError,
268
+ profile_file,
269
+ resolve_profile
270
+ };