@event4u/agent-config 7.0.1 → 7.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.
Files changed (103) hide show
  1. package/.claude-plugin/marketplace.json +8 -1
  2. package/CHANGELOG.md +99 -0
  3. package/README.md +4 -2
  4. package/dist/agent-src/commands/council/default.md +28 -20
  5. package/dist/agent-src/commands/evals/fix.json +5 -1
  6. package/dist/agent-src/commands/fix/comments.md +101 -0
  7. package/dist/agent-src/commands/fix.md +5 -2
  8. package/dist/agent-src/contexts/execution/auto-dispatch-classification.md +65 -0
  9. package/dist/agent-src/contexts/execution/auto-orchestration-activation.md +68 -0
  10. package/dist/agent-src/contexts/execution/host-capability-manifest.md +68 -0
  11. package/dist/agent-src/contexts/execution/orchestration-benchmark-gate.md +62 -0
  12. package/dist/agent-src/contexts/execution/orchestration-telemetry.md +59 -0
  13. package/dist/agent-src/contexts/execution/roadmap-process-loop.md +8 -3
  14. package/dist/agent-src/contexts/execution/subagent-response-contract.md +56 -0
  15. package/dist/agent-src/contexts/execution/subagent-routing.md +57 -0
  16. package/dist/agent-src/contexts/execution/subagent-spawn-contract.md +54 -0
  17. package/dist/agent-src/contexts/execution/subagent-steering.md +71 -0
  18. package/dist/agent-src/contexts/execution/verify-budget.md +50 -0
  19. package/dist/agent-src/rules/delegation-policy.md +84 -0
  20. package/dist/agent-src/rules/design-fidelity.md +98 -0
  21. package/dist/agent-src/rules/domain-safety-pii.md +22 -0
  22. package/dist/agent-src/rules/legal-safety-floor.md +144 -0
  23. package/dist/agent-src/rules/lethal-trifecta-guard.md +25 -22
  24. package/dist/agent-src/scripts/archive_completed_roadmaps.ts +102 -15
  25. package/dist/agent-src/scripts/update_roadmap_progress.ts +52 -7
  26. package/dist/agent-src/skills/ai-council/SKILL.md +28 -1
  27. package/dist/agent-src/skills/contract-review/SKILL.md +124 -0
  28. package/dist/agent-src/skills/contract-review/evals/triggers.json +17 -0
  29. package/dist/agent-src/skills/dpa-review/SKILL.md +129 -0
  30. package/dist/agent-src/skills/dpa-review/evals/triggers.json +17 -0
  31. package/dist/agent-src/skills/laravel/SKILL.md +1 -0
  32. package/dist/agent-src/skills/legal-intake-triage/SKILL.md +127 -0
  33. package/dist/agent-src/skills/legal-intake-triage/evals/triggers.json +17 -0
  34. package/dist/agent-src/skills/legal-practice-profile/SKILL.md +100 -0
  35. package/dist/agent-src/skills/legal-practice-profile/evals/triggers.json +17 -0
  36. package/dist/agent-src/skills/nda-triage/SKILL.md +113 -0
  37. package/dist/agent-src/skills/nda-triage/evals/triggers.json +17 -0
  38. package/dist/agent-src/skills/reasoning-orchestrator/SKILL.md +36 -9
  39. package/dist/agent-src/skills/recursive-verification/SKILL.md +186 -0
  40. package/dist/agent-src/skills/roadmap-management/SKILL.md +17 -0
  41. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +14 -0
  42. package/dist/agent-src/templates/agent-settings.md +64 -19
  43. package/dist/discovery/deprecation-report.md +1 -1
  44. package/dist/discovery/discovery-manifest.json +278 -23
  45. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  46. package/dist/discovery/discovery-manifest.summary.md +12 -4
  47. package/dist/discovery/orphan-report.md +1 -1
  48. package/dist/discovery/packs.json +50 -8
  49. package/dist/discovery/trust-report.md +7 -5
  50. package/dist/discovery/workspaces.json +34 -6
  51. package/dist/mcp/registry-manifest.json +3 -3
  52. package/dist/router.json +1 -1
  53. package/dist/server/schemas/settings.js +14 -0
  54. package/dist/server/schemas/settings.js.map +1 -1
  55. package/docs/architecture.md +4 -4
  56. package/docs/benchmark.md +46 -0
  57. package/docs/catalog.md +18 -6
  58. package/docs/command-flows.md +7 -1
  59. package/docs/contracts/ai-council-config.md +17 -10
  60. package/docs/contracts/audit-log-v1.md +7 -0
  61. package/docs/contracts/auto-orchestration-v1.md +70 -0
  62. package/docs/contracts/command-clusters.md +1 -1
  63. package/docs/contracts/discovery-manifest.schema.json +2 -2
  64. package/docs/decisions/ADR-013-discovery-frontmatter-contract.md +19 -0
  65. package/docs/decisions/ADR-020-global-only-consumer-scope.md +13 -6
  66. package/docs/decisions/ADR-049-configuration-trust-boundary.md +11 -1
  67. package/docs/decisions/ADR-093-ai-council-config-user-global.md +10 -4
  68. package/docs/decisions/ADR-104-ai-council-config-global-only.md +119 -0
  69. package/docs/decisions/ADR-105-automatic-subagent-orchestration.md +102 -0
  70. package/docs/decisions/ADR-106-recursive-verification-benchmark-gate.md +126 -0
  71. package/docs/decisions/ADR-107-legal-domain-pack-adoption.md +51 -0
  72. package/docs/decisions/ADR-108-open-source-forever-no-commercial-tier.md +46 -0
  73. package/docs/decisions/INDEX.md +5 -0
  74. package/docs/getting-started.md +2 -2
  75. package/docs/guidelines/agent-infra/domain-eval-anti-pattern.md +53 -0
  76. package/docs/guidelines/agent-infra/domain-pack-architecture.md +55 -0
  77. package/package.json +1 -1
  78. package/src/config/agent-settings.template.yml +72 -3
  79. package/src/config/discovery/packs.yml +13 -0
  80. package/src/config/discovery/workspaces.yml +7 -0
  81. package/src/scripts/_lib/auto_dispatch.ts +95 -0
  82. package/src/scripts/_lib/host_capability.ts +59 -0
  83. package/src/scripts/_lib/orchestration_gate.ts +98 -0
  84. package/src/scripts/_lib/subagent_bundle.ts +154 -0
  85. package/src/scripts/_lib/subagent_response.ts +82 -0
  86. package/src/scripts/_lib/subagent_routing.ts +81 -0
  87. package/src/scripts/_lib/subagent_spawn.ts +97 -0
  88. package/src/scripts/_lib/subagent_steering.ts +64 -0
  89. package/src/scripts/_lib/verify_budget.ts +54 -0
  90. package/src/scripts/ai_council/advisors.ts +4 -2
  91. package/src/scripts/ai_council/clients.ts +7 -1
  92. package/src/scripts/ai_council/config.ts +22 -17
  93. package/src/scripts/bench_ab_v2_run.ts +127 -0
  94. package/src/scripts/bench_ab_v2_stats.ts +39 -0
  95. package/src/scripts/check_council_config_location.ts +6 -5
  96. package/src/scripts/lint_discovery_vocabulary.ts +6 -0
  97. package/src/scripts/lint_framework_leakage_allowlist.json +21 -0
  98. package/src/scripts/lint_legal_pack.ts +139 -0
  99. package/src/scripts/probe_projection_fidelity.ts +7 -1
  100. package/src/scripts/rdp_gate_classify.ts +131 -0
  101. package/src/scripts/rdp_quality_eval.ts +437 -0
  102. package/src/scripts/schemas/agent-settings.schema.json +11 -0
  103. package/src/scripts/skill_linter.ts +3 -0
@@ -0,0 +1,51 @@
1
+ ---
2
+ adr: 107
3
+ status: accepted
4
+ date: 2026-06-24
5
+ decision: legal-domain-pack-adoption
6
+ supersedes: —
7
+ superseded_by: —
8
+ phase: road-to-legal-pack
9
+ type: prospective
10
+ ---
11
+
12
+ # ADR-107 — Legal domain-pack adoption (EU/DE-scoped, procedure-only, evaluated honestly)
13
+
14
+ ## Status
15
+
16
+ **Accepted** · 2026-06-24 · three AI-council rounds (anthropic/claude-sonnet-4-5 + openai/gpt-4o; the curl-timeout fix landed mid-series so rounds 2–3 ran two-voice). Implementing roadmap: road-to-legal-pack (archived on completion).
17
+
18
+ ## Context
19
+
20
+ `event4u/agent-config` had legal-adjacent anchors (`contracts-cognition`, `privacy-review`, `data-handling-judgment`, `data-flow-mapper`, `domain-safety-disclaimer` legal sector) but no legal **domain pack**. Opening one is a `domain-adoption-policy` decision (three gates: demand signal, named maintenance owner, CI-tooling). External legal-plugin references (a first-party suite + community packs) showed reusable patterns but enforce everything via prompt instructions only (empty hooks).
21
+
22
+ ## Decision
23
+
24
+ Open a single, narrow `legal` pack — **not** a multi-plugin / multi-agent parity clone.
25
+
26
+ 1. **Scope: EU/DE-only, hard refusal.** Every selectable jurisdiction is an implicit currency promise; for a single maintainer the smallest correct cut is EU/DE with "consult local counsel" for everything else. Encoded in the `legal-safety-floor` rule + the pack description; surfaced via a machine-checkable `Jurisdiction:` tag.
27
+ 2. **Safety-floor first.** `rule:legal-safety-floor` + its deterministic linters land before any drafting skill (a drafting skill before its floor is the exact liability the floor prevents).
28
+ 3. **Skills ship procedure + output template only — no default legal positions.** Positions live in a practice profile (`legal-practice-profile`).
29
+ 4. **Deterministic hardening is the differentiator.** Disclaimer-presence, jurisdiction-tag, and freshness linters; privilege markers extend `domain-safety-pii` + `lethal-trifecta-guard` (no new hook unless the extension demonstrably fails).
30
+ 5. **Eval = regression/consistency harness, not a correctness oracle.** Self-labeled fixtures narrowed to the maintainer's genuine-competence domain (EU DPA / GDPR Art. 28) with spot-validation; a multi-attorney gold set (inter-annotator ≥0.7) is a **demand+funding-gated** track, NOT parity-gated (legal matching is classification, not the finding-count distributions the cross-model-parity keystone calibrates). The eval achieves *measurement* objectivity (reliable regression detection), never *ground-truth* objectivity — correctness stays attorney review.
31
+ 6. **No personas** — procedure-not-personality; role focus lives in skill tags + the practice profile.
32
+ 7. **Conditional product-liability gate** — commercial (Pro-tier) ship would require licensed-attorney review of the pack itself. **Resolved N/A 2026-06-24:** the suite is open-source forever, no commercial tier (ADR-108) — the gate never fires; the non-removable disclaimer + per-output attorney-review line cover end-user reliance.
33
+
34
+ ## Rejections (recorded)
35
+
36
+ matter-workspace (too heavy), scheduled watchers, community-skill installer hub, US-state employment tests, full litigation depth, bar-prep, Swiss cantonal depth, non-EU/DE jurisdictions, the cross-model-parity dependency for the eval (a false blocker, corrected in the full critique round).
37
+
38
+ ## Consequences
39
+
40
+ - The pack ships `trust_level_default: experimental` / `surface_tier: lab` as the **conservative default for a high-risk legal domain**. Gate 2 was **resolved 2026-06-24 by maintainer decision: no named-owner / external-qualification gate** — the protection is the always-present, **test-enforced** not-legal-advice notice (every skill · chat output · README · dedicated legal-pack notice; `tests/scripts/legal-disclaimer-presence.test.ts`) plus the RDG individual-case guardrail. Tier promotion is a separate future decision.
41
+ - A reusable domain-pack sequence (Safety-Floor → Enforcement → Evals → Skills → Practice-Profile) is **documented retrospectively**, validated against a second domain before promotion to a rule (per `domain-pack-extraction-when-triggered`, N=2) — it does not drive legal's design.
42
+
43
+ ## Alternatives considered
44
+
45
+ Jurisdiction-neutral-with-EU-default (rejected — maximizes the maintenance surface the binding constraint exists to cut); objective eval pack at N=1 (rejected — manufactures false objectivity without a funded attorney gold set); ≤2 legal personas (rejected — decoration with maintenance cost, no incremental safety).
46
+
47
+ ## References
48
+
49
+ - road-to-legal-pack — the implementing roadmap (archived on completion)
50
+ - [ADR-013 — Discovery Frontmatter Contract](ADR-013-discovery-frontmatter-contract.md) (vocabulary amendment, same series)
51
+ - `rule:legal-safety-floor`, `rule:domain-adoption-policy`, `rule:domain-safety-disclaimer`
@@ -0,0 +1,46 @@
1
+ ---
2
+ adr: 108
3
+ status: accepted
4
+ date: 2026-06-24
5
+ decision: open-source-forever-no-commercial-tier
6
+ supersedes: —
7
+ superseded_by: —
8
+ phase: road-to-legal-pack
9
+ type: standing
10
+ ---
11
+
12
+ # ADR-108 — The suite is open-source forever; no commercial / Pro tier
13
+
14
+ ## Status
15
+
16
+ **Accepted** · 2026-06-24 · maintainer decision. Standing commitment for the whole `event4u/agent-config` suite, surfaced while resolving the legal pack's conditional product-liability gate (ADR-107 § 0.6).
17
+
18
+ ## Context
19
+
20
+ The legal pack (ADR-107) carried a *conditional* product-liability gate: "if shipped commercially (Pro tier), a licensed attorney must review the pack itself before ship." That conditional only matters if a commercial/Pro tier is on the table. The maintainer's standing position is that it is not — and should be made durable so the question is not relitigated and so no future change silently introduces provider liability.
21
+
22
+ ## Decision
23
+
24
+ **The entire `event4u/agent-config` suite is and remains open-source. There is no commercial tier, no Pro tier, no paid distribution — now or in the future.**
25
+
26
+ Consequences for governance:
27
+
28
+ 1. **The legal pack's conditional product-liability gate (ADR-107 § 0.6) never fires.** There is no provider selling the pack; the only liability surface is end-user reliance, which is addressed by the non-removable disclaimer and the per-output attorney-review line in `legal-safety-floor`.
29
+ 2. **Liability disclaimer is permanent.** Every legal-pack output is a research-and-drafting aid, not legal advice, not a substitute for a licensed attorney, and not something anyone may rely on as definitive. This holds independent of distribution model.
30
+ 3. **Reopening requires a superseding ADR.** Introducing any paid/commercial tier would be a new, explicit decision that supersedes this ADR — and would re-activate the ADR-107 § 0.6 attorney-review-of-the-pack gate before any paid distribution.
31
+
32
+ ## Consequences
33
+
34
+ - `legal-safety-floor` § Distribution states the open-source-forever stance and that the conditional gate is closed by decision.
35
+ - ADR-107 § 0.6 is resolved as **N/A** (not applicable under this standing decision).
36
+
37
+ ## Alternatives considered
38
+
39
+ - **Keep 0.6 purely conditional, no standing decision** (rejected — leaves the door open to silently introducing provider liability; the maintainer wanted it hardened for the future).
40
+ - **A CI lint enforcing "no commercial tier"** (rejected — over-engineering; an ADR + the floor statement are the right durable surface, and there is no machine signal of "commercial intent" to lint).
41
+
42
+ ## References
43
+
44
+ - [ADR-107 — Legal domain-pack adoption](ADR-107-legal-domain-pack-adoption.md) (§ 0.6 conditional gate, now resolved N/A)
45
+ - `rule:legal-safety-floor` § Distribution + § What this pack is — and is not
46
+ - road-to-legal-pack § 0.6 (archived on completion)
@@ -107,6 +107,11 @@ _Auto-generated by `scripts/adr/regenerate_index.py`. Do not edit._
107
107
  | [ADR-101](ADR-101-ticket-bundle-emission.md) | Ticket Bundle Emission | proposed | 2026-06-15 | — |
108
108
  | [ADR-102](ADR-102-ticket-handoff-paste-and-mcp.md) | Ticket Handoff Paste And Mcp | accepted | 2026-06-16 | — |
109
109
  | [ADR-103](ADR-103-global-knowledge-default-off-until-measured.md) | Global Knowledge Default Off Until Measured | accepted | 2026-06-16 | — |
110
+ | [ADR-104](ADR-104-ai-council-config-global-only.md) | Ai Council Config Global Only | accepted | 2026-06-22 | 093 |
111
+ | [ADR-105](ADR-105-automatic-subagent-orchestration.md) | Automatic Subagent Orchestration | accepted | 2026-06-23 | — |
112
+ | [ADR-106](ADR-106-recursive-verification-benchmark-gate.md) | Recursive Verification Benchmark Gate | accepted | 2026-06-23 | — |
113
+ | [ADR-107](ADR-107-legal-domain-pack-adoption.md) | Legal Domain Pack Adoption | accepted | 2026-06-24 | — |
114
+ | [ADR-108](ADR-108-open-source-forever-no-commercial-tier.md) | Open Source Forever No Commercial Tier | accepted | 2026-06-24 | — |
110
115
  | [ADR-200](ADR-200-python-to-typescript-migration.md) | Python To Typescript Migration | accepted | 2026-06-11 | — |
111
116
 
112
117
  ## Unnumbered (legacy)
@@ -129,7 +129,7 @@ Your agent is now:
129
129
  - **Respecting your codebase** — no conflicting patterns
130
130
  - **Following standards** — consistent code quality
131
131
 
132
- This is enforced automatically by 88 rules. No configuration needed.
132
+ This is enforced automatically by 91 rules. No configuration needed.
133
133
 
134
134
  ---
135
135
 
@@ -169,7 +169,7 @@ Your agent now understands slash commands:
169
169
  | `/quality-fix` | Run and fix all quality checks |
170
170
  | `/chat-history import` | Pull a prior session into the current chat (resume) |
171
171
 
172
- → [Browse all 161 active commands](../dist/agent-src/commands/)
172
+ → [Browse all 162 active commands](../dist/agent-src/commands/)
173
173
 
174
174
  ---
175
175
 
@@ -0,0 +1,53 @@
1
+ # Domain-eval anti-pattern — manufactured false objectivity at N=1
2
+
3
+ > A retrospective from the legal pack (council round 3). It exists so the next
4
+ > domain does not repeat the mistake. The short version: **do not call a
5
+ > self-labeled regression harness an "objective" correctness gate.**
6
+
7
+ ## The anti-pattern
8
+
9
+ Gating skill ship on *"≥X% match to expert ground-truth"* and calling it "the
10
+ objective replacement for reviewer sign-off" — when:
11
+
12
+ 1. **The ground-truth is unsourced or self-generated.** If the maintainer guesses
13
+ what an expert would flag, the eval measures "does the skill match the
14
+ maintainer's guess," i.e. reviewer subjectivity wearing a quantitative costume.
15
+ 2. **Expert agreement is not truth.** Even an attorney-validated gold set at
16
+ inter-annotator agreement ≥0.7 is *inter-subjective expert consensus*, not
17
+ ground truth — `0.7 ≠ 1.0` admits the domain is contested ~30% of the time.
18
+ The honest goal is **measurement objectivity** (reliably detect change), not
19
+ **ground-truth objectivity** (the labels are correct).
20
+ 3. **Model capability caps below the threshold.** Clause-extraction caps at
21
+ ~F1 0.62; any passable threshold therefore measures "not worse than a mediocre
22
+ baseline," i.e. regression detection — never correctness.
23
+ 4. **The statistical language is borrowed from infra that does not exist.**
24
+ Calibrating a threshold "from cross-model distributions" requires a built
25
+ cross-model-parity layer. Borrowing the vocabulary before the layer exists is
26
+ false precision.
27
+
28
+ ## The honest alternative
29
+
30
+ - **Ship a regression / consistency harness.** Self-labeled fixtures, explicitly
31
+ marked "regression-only, not correctness, not objective." It catches "did a
32
+ change make a skill worse than its own baseline."
33
+ - **Keep correctness with the human.** Licensed-expert review on material use,
34
+ baked into the skill's output, not a footnote.
35
+ - **Make the objective eval a separate, gated track.** Attorney/expert-validated
36
+ gold set + inter-annotator ≥0.7 is real but expensive; gate it on **validated
37
+ demand + funding**, not on a phase timeline — and note it is classification, so
38
+ it does **not** depend on a cross-model-parity keystone.
39
+
40
+ ## The false-blocker corollary
41
+
42
+ When you scope an eval, check what it *actually* depends on. The legal eval was
43
+ briefly gated on the cross-model-parity keystone; the full critique round showed
44
+ that was wrong — legal fixture matching is **classification** (clause
45
+ present/absent/ambiguous), not the finding-count distributions that keystone
46
+ calibrates. The real dependency was labeled-gold-set tooling, buildable in-pack.
47
+ A false structural blocker is as much an error as false objectivity.
48
+
49
+ ## See also
50
+
51
+ - [ADR-107 — Legal domain-pack adoption](../../decisions/ADR-107-legal-domain-pack-adoption.md)
52
+ - `domain-pack-architecture.md` — the retrospective sequence this is part of.
53
+ - `src/domains/legal/evals/README.md` — the regression harness in practice.
@@ -0,0 +1,55 @@
1
+ # Domain-pack architecture — a retrospective observation (NOT a design driver)
2
+
3
+ > **Status: retrospective hypothesis, N=1.** This documents the sequence the
4
+ > **legal** pack happened to follow. It is **not** a rule and **not** a template
5
+ > that future packs must fit. Validate it against a *second* domain before
6
+ > promoting any of it to a rule or building scaffolding tooling — per
7
+ > `domain-adoption-policy` and the `domain-pack-extraction-when-triggered` (N=2)
8
+ > roadmap. Designing a new pack to fit this speculative pattern would invert the
9
+ > lever: build the domain correctly on its own legs, then observe whether the
10
+ > pattern recurred.
11
+
12
+ ## The sequence legal followed
13
+
14
+ 1. **Safety floor first** — a domain `*-safety-floor` rule (Iron-Law-shaped,
15
+ ~100 lines) before any drafting skill. A drafting skill shipped before its
16
+ floor is the exact liability the floor prevents.
17
+ 2. **Enforcement teeth** — the floor's machine-checkable elements become a
18
+ deterministic linter (`lint_legal_pack`) wired into CI. Prompt rules are not
19
+ governance; lint rules are. This is the differentiator vs prompt-only suites.
20
+ 3. **Eval = regression harness, not a correctness oracle** — self-labeled
21
+ fixtures in the maintainer's genuine-competence sub-domain; the *objective*
22
+ eval (attorney-validated gold set, inter-annotator ≥0.7) is a separate,
23
+ demand-and-funding-gated track. See `domain-eval-anti-pattern.md`.
24
+ 4. **Skills = procedure + output template only** — no default domain positions;
25
+ positions live in a practice profile, so one skill set behaves
26
+ team-specifically and the pack stays portable.
27
+ 5. **Practice profile (the keystone)** — a cold-start interview writing a
28
+ plain-prose profile into `.agent-settings.yml` / the setup wizard; skills read
29
+ it and halt on unresolved placeholders.
30
+ 6. **Deferred by default** — personas, scheduled watchers, installer hubs, and
31
+ broader scope are recorded as rejected/gated, not built, until evidence pulls
32
+ them in.
33
+
34
+ ## Why it is NOT yet a rule
35
+
36
+ - **N=1.** Finance might need real-time-data evals; security might need red-team
37
+ evals; neither looks like "clause extraction + self-labeled fixtures." The
38
+ shape that fit legal may not fit them.
39
+ - **Premature tooling is the maintainer's enemy.** No `domain-pack:new`
40
+ scaffolding ships from this observation. Extraction waits for N=2, where a
41
+ second domain either confirms the sequence (promote to a rule) or diverges
42
+ (document the delta, keep both bespoke).
43
+
44
+ ## What to do at N=2
45
+
46
+ Build the second domain on its own merits. *Then* compare: which steps generalised,
47
+ which broke. If the sequence held twice, promote it to a rule and consider
48
+ scaffolding. If it diverged, this note records why a one-size pattern was wrong —
49
+ itself a useful result.
50
+
51
+ ## See also
52
+
53
+ - [ADR-107 — Legal domain-pack adoption](../../decisions/ADR-107-legal-domain-pack-adoption.md)
54
+ - `domain-adoption-policy` (rule) — the three gates before opening any domain.
55
+ - `domain-eval-anti-pattern.md` — why the legal eval is a regression harness, not an objective gate.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@event4u/agent-config",
3
- "version": "7.0.1",
3
+ "version": "7.1.0",
4
4
  "description": "Universal AI Agent OS — audited skills, governance rules, commands, and templates for AI coding tools (Claude Code, Cursor, Windsurf, Copilot).",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -393,12 +393,81 @@ quality:
393
393
  # themselves (default — saves agent runtime and tokens)
394
394
  wait_for_remote_ci: false
395
395
 
396
+ # --- Design fidelity ---
397
+ #
398
+ # Controls how strictly the agent must follow a user-provided, finished
399
+ # design — a prototype, mockup, screenshot, or design-system file. Consumed
400
+ # by the `design-fidelity` rule. The provided design is the spec, not a
401
+ # starting point for the agent's own taste.
402
+ design:
403
+ # strict | structural | hard-floor (default: strict)
404
+ #
405
+ # strict = build it 1:1. EVERY visible deviation (font, control type,
406
+ # component, layout, spacing, colour, an omitted/added element)
407
+ # needs explicit confirmation. A "better" idea is surfaced as a
408
+ # numbered option, never executed.
409
+ # structural = structure is locked (fonts, control types, component set,
410
+ # layout, no omissions still need confirmation). Where the spec
411
+ # is genuinely silent (hover / empty / error states), the agent
412
+ # may fill the gap in the spec's style and MUST state the
413
+ # assumption.
414
+ # hard-floor = any deviation is a Hard-Floor action (never autonomous; no
415
+ # autonomy setting, roadmap, or standing instruction lifts it).
416
+ fidelity_mode: strict
417
+
396
418
  # --- Subagent orchestration ---
397
419
  #
398
- # Controls model selection and parallelism for subagent-based workflows
399
- # (/do-and-judge, /do-in-steps, /judge). Empty values fall back to the
400
- # runtime defaults described in .augment/contexts/subagent-configuration.md.
420
+ # Controls model selection, parallelism, and AUTOMATIC orchestration for
421
+ # subagent-based workflows (/do-and-judge, /do-in-steps, /judge, and the
422
+ # auto-dispatch layer). Empty values fall back to the runtime defaults
423
+ # described in .augment/contexts/subagent-configuration.md and
424
+ # .augment/contexts/execution/auto-orchestration-activation.md.
401
425
  subagents:
426
+ # Global master switch for the whole subagent layer.
427
+ # true (default) = the layer is available; false = fully disabled, the
428
+ # canonical kill-switch (no auto-dispatch, no model routing, in-session only).
429
+ enabled: true
430
+
431
+ # Automatic-dispatch mode: off | ask | on
432
+ #
433
+ # off = never auto-dispatch; subagents only via an explicit command.
434
+ # ask = classify the task; when delegable, ask once before dispatching.
435
+ # on = auto-dispatch delegable tasks without asking (surface the choice
436
+ # in one line).
437
+ #
438
+ # Initial SHIPPED default is `ask` on hosts whose capability manifest reports
439
+ # `subagent_spawn: true`, and `off` on hosts without a subagent primitive.
440
+ # The shipped default flips toward `on` (host-gated) only behind the Phase-6
441
+ # benchmark gate of road-to-auto-subagent-orchestration.md — never on an
442
+ # unmeasured claim. Auto-dispatch is also a no-op wherever the host manifest
443
+ # reports `subagent_spawn: false`, regardless of this value.
444
+ auto: ask
445
+
446
+ # Route delegable sub-tasks to the lowest-capable model tier (cost + speed
447
+ # via model downshift). true (default) = downshift per declared model_tier;
448
+ # false = every subagent runs on the session tier.
449
+ downshift: true
450
+
451
+ # Prefer a separate-quota-pool model for delegable sub-tasks WHERE the host
452
+ # manifest reports `separate_quota_pool: true` (e.g. a subscription whose
453
+ # Sonnet allowance is distinct from Opus). Optional bonus only — behaviour is
454
+ # identical (minus the quota win) where unsupported. Never load-bearing.
455
+ quota_arbitrage: true
456
+
457
+ # Optional per-tier model map for downshift routing. Empty value = use the
458
+ # tier's runtime default (see model-recommendations.md). Keys are the
459
+ # vendor-neutral capability bands.
460
+ model_map:
461
+ lite: ""
462
+ medium: ""
463
+ high: ""
464
+
465
+ # Optional host-capability override (see
466
+ # .augment/contexts/execution/host-capability-manifest.md). Any field set
467
+ # here wins; any field omitted falls back to the all-false safe default.
468
+ # Leave empty to let the agent resolve the manifest from host knowledge.
469
+ host_capabilities: {}
470
+
402
471
  # Model for implementer subagents (empty = same tier as the session model)
403
472
  implementer_model: ""
404
473
 
@@ -240,6 +240,19 @@
240
240
  workspaces: [construction]
241
241
  trust_level_default: professional
242
242
 
243
+ - id: legal
244
+ label: Legal
245
+ description: "NOT LEGAL ADVICE — a research/drafting aid, not a substitute for a lawyer. In-house legal — EU/DE-scoped contract/NDA/DPA review and triage, procedure-only (no default legal positions); general information + templates only, never individual-case examination; every output a draft for attorney review. See LEGAL_NOTICE.md."
246
+ workspaces: [legal]
247
+ trust_level_default: experimental # gated: ships lab-tier until the Gate-2 maintenance owner + qualification is confirmed (road-to-legal-pack Phase 0.2)
248
+ surface_tier: lab
249
+ domain: legal
250
+ size_class: medium
251
+ onboarding:
252
+ first_win_doc: FIRST_WIN.md
253
+ example_workflow: dpa-review
254
+ time_to_first_value_minutes: 8
255
+
243
256
  - id: ai-video
244
257
  label: AI Video
245
258
  description: AI video pipeline.
@@ -64,6 +64,13 @@
64
64
  default_packs: [construction]
65
65
  optional_packs: []
66
66
 
67
+ - id: legal
68
+ label: Legal
69
+ description: In-house legal — contract/NDA/DPA review, privacy, legal triage (EU/DE scope).
70
+ example_roles: [In-house Counsel, DPO, Legal Ops]
71
+ default_packs: [legal]
72
+ optional_packs: []
73
+
67
74
  - id: agent-config-maintainer
68
75
  label: Maintainer
69
76
  description: Skills/rules/commands that maintain this package.
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Auto-dispatch classification (v1 — deterministic).
3
+ *
4
+ * Pure, no-I/O encoding of the rule-based classifier described in
5
+ * `src/agent-src/contexts/execution/auto-dispatch-classification.md`.
6
+ *
7
+ * Decides whether a task is delegable to subagents and which
8
+ * `subagent-orchestration` mode fits — with NO per-turn LLM meta-call.
9
+ *
10
+ * Contract highlights:
11
+ * - A task is delegable only on an enumerated structural signal.
12
+ * - Trivial tasks below the size floor never delegate.
13
+ * - Ambiguity → `ask` (when `auto == 'ask'`) or in-session, never speculative
14
+ * spawn.
15
+ * - The activation gate (`enabled`, `auto != off`, `subagent_spawn`) runs
16
+ * first; any failure short-circuits to in-session.
17
+ */
18
+
19
+ /** Minimum task-size estimate (exclusive) below which a task never delegates. */
20
+ export const SIZE_FLOOR = 1;
21
+
22
+ export type AutoMode = 'off' | 'ask' | 'on';
23
+ export type DispatchMode = 'do-in-steps' | 'do-in-parallel';
24
+ export type DispatchAction = 'dispatch' | 'ask' | 'in-session';
25
+
26
+ /** Task descriptor — structural signals only, no task body. */
27
+ export interface TaskSignals {
28
+ /** Frontmatter `parallelizable:` value of the skill/command in play, if any. */
29
+ parallelizable?: 'steps' | 'files' | 'independent' | null;
30
+ /** Task is an explicit ordered plan (numbered steps / phase / checklist). */
31
+ ordered_plan?: boolean;
32
+ /** Count of independent same-shape targets (e.g. 5 files to review). */
33
+ independent_slices?: number;
34
+ /** Orchestrator's pre-dispatch size estimate (abstract units). */
35
+ size_estimate: number;
36
+ }
37
+
38
+ /** Activation inputs resolved from settings + the host-capability manifest. */
39
+ export interface ActivationInputs {
40
+ enabled: boolean;
41
+ auto: AutoMode;
42
+ subagent_spawn: boolean;
43
+ }
44
+
45
+ export interface Classification {
46
+ delegable: boolean;
47
+ action: DispatchAction;
48
+ mode: DispatchMode | null;
49
+ reason: string;
50
+ }
51
+
52
+ function inSession(reason: string): Classification {
53
+ return { delegable: false, action: 'in-session', mode: null, reason };
54
+ }
55
+
56
+ /**
57
+ * Classify a task for auto-dispatch. Activation gate first, then the
58
+ * deterministic delegable-signal rules.
59
+ */
60
+ export function classifyTask(signals: TaskSignals, activation: ActivationInputs): Classification {
61
+ // ── Activation gate — any failure short-circuits to in-session ──
62
+ if (!activation.enabled) return inSession('subagents.enabled is false');
63
+ if (activation.auto === 'off') return inSession('subagents.auto is off');
64
+ if (!activation.subagent_spawn) return inSession('host has no subagent_spawn primitive');
65
+
66
+ // ── Size floor — trivial tasks never delegate ──
67
+ if (!(signals.size_estimate > SIZE_FLOOR)) {
68
+ return inSession(`task below size floor (${signals.size_estimate} <= ${SIZE_FLOOR})`);
69
+ }
70
+
71
+ // ── Delegable-signal rules (enumerated; ambiguity never spawns) ──
72
+ const slices = signals.independent_slices ?? 0;
73
+ let mode: DispatchMode | null = null;
74
+ let reason = '';
75
+
76
+ if (signals.parallelizable === 'steps' || signals.ordered_plan === true) {
77
+ mode = 'do-in-steps';
78
+ reason = signals.parallelizable === 'steps' ? 'declared parallelizable: steps' : 'ordered-plan structure';
79
+ } else if (signals.parallelizable === 'files' || signals.parallelizable === 'independent' || slices >= 2) {
80
+ mode = 'do-in-parallel';
81
+ reason = signals.parallelizable ? `declared parallelizable: ${signals.parallelizable}` : `independent slices (${slices})`;
82
+ }
83
+
84
+ if (mode === null) {
85
+ // No enumerated signal matched → ambiguous. Ask under `ask`, else in-session.
86
+ if (activation.auto === 'ask') {
87
+ return { delegable: false, action: 'ask', mode: null, reason: 'no delegable signal — borderline, ask' };
88
+ }
89
+ return inSession('no enumerated delegable signal matched');
90
+ }
91
+
92
+ // Matched a signal. Dispatch under `on`, ask under `ask`.
93
+ const action: DispatchAction = activation.auto === 'on' ? 'dispatch' : 'ask';
94
+ return { delegable: true, action, mode, reason };
95
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Host-capability manifest normalizer.
3
+ *
4
+ * Pure, no-I/O helper that takes a partial / unknown object (typically the
5
+ * `subagents.host_capabilities` override from `.agent-settings.yml`, or the
6
+ * agent's own host-knowledge object) and returns a fully-populated manifest.
7
+ *
8
+ * Contract — see `src/agent-src/contexts/execution/host-capability-manifest.md`:
9
+ *
10
+ * - Safe default is ALL boolean fields `false` — an unknown host is assumed to
11
+ * have no subagent primitive.
12
+ * - A missing or non-boolean field resolves to `false`, never `true`.
13
+ * - `schema_version` is always forced to `1`.
14
+ */
15
+
16
+ /** Resolved host-capability manifest. All booleans, `schema_version` fixed at 1. */
17
+ export interface HostCapabilityManifest {
18
+ schema_version: 1;
19
+ subagent_spawn: boolean;
20
+ parallel_spawn: boolean;
21
+ status_polling: boolean;
22
+ separate_quota_pool: boolean;
23
+ }
24
+
25
+ /** Safe default — unknown host assumes no subagent primitive. */
26
+ const SAFE_DEFAULT: HostCapabilityManifest = {
27
+ schema_version: 1,
28
+ subagent_spawn: false,
29
+ parallel_spawn: false,
30
+ status_polling: false,
31
+ separate_quota_pool: false,
32
+ };
33
+
34
+ /** Coerce one field: only a strict boolean `true` survives; everything else is `false`. */
35
+ function asBool(value: unknown): boolean {
36
+ return value === true;
37
+ }
38
+
39
+ /**
40
+ * Normalize a partial / unknown object into a full {@link HostCapabilityManifest}.
41
+ *
42
+ * Any missing or invalidly-typed field falls back to the all-`false` safe
43
+ * default; `schema_version` is always forced to `1`.
44
+ */
45
+ export function normalizeHostManifest(input: unknown): HostCapabilityManifest {
46
+ if (input === null || typeof input !== 'object') {
47
+ return { ...SAFE_DEFAULT };
48
+ }
49
+
50
+ const src = input as Record<string, unknown>;
51
+
52
+ return {
53
+ schema_version: 1,
54
+ subagent_spawn: asBool(src.subagent_spawn),
55
+ parallel_spawn: asBool(src.parallel_spawn),
56
+ status_polling: asBool(src.status_polling),
57
+ separate_quota_pool: asBool(src.separate_quota_pool),
58
+ };
59
+ }
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Default-flip decision gate (Phase 6).
3
+ *
4
+ * Pure, no-I/O. Encodes the Phase-6 falsification gate: the SHIPPED default for
5
+ * `subagents.auto` flips toward `on` ONLY when a real benchmark shows a net
6
+ * token-or-time win at held quality, and only on hosts with a subagent
7
+ * primitive. Honest-null exit (no win, or quality regressed) keeps the
8
+ * conservative default. Contract:
9
+ * `src/agent-src/contexts/execution/orchestration-benchmark-gate.md`.
10
+ *
11
+ * This helper decides; it never runs the benchmark. The measurement is the
12
+ * empirical bench:ab step, authorised + run out of band.
13
+ */
14
+
15
+ export interface BenchmarkResult {
16
+ /** Net token OR wall-clock win on the delegable-task subset. */
17
+ net_win: boolean;
18
+ /** Output quality held at or above the single-agent baseline. */
19
+ quality_held: boolean;
20
+ }
21
+
22
+ export type GateVerdict = 'pass' | 'fail';
23
+ export type ShippedDefault = 'on' | 'ask' | 'off';
24
+
25
+ /** Gate verdict: pass requires BOTH a net win AND held quality. */
26
+ export function gateVerdict(r: BenchmarkResult): GateVerdict {
27
+ return r.net_win && r.quality_held ? 'pass' : 'fail';
28
+ }
29
+
30
+ /**
31
+ * Resolve the shipped default for `subagents.auto` after a benchmark.
32
+ *
33
+ * - Gate fail (no win or quality regressed) → keep conservative: `ask` on a
34
+ * subagent-capable host, `off` elsewhere (honest-null exit).
35
+ * - Gate pass → `on` on a subagent-capable host, `off` elsewhere.
36
+ *
37
+ * `host_subagent_spawn` gates the result so the default is never `on`/`ask`
38
+ * where the host cannot spawn at all.
39
+ */
40
+ export function resolveShippedDefault(r: BenchmarkResult, host_subagent_spawn: boolean): ShippedDefault {
41
+ if (!host_subagent_spawn) return 'off';
42
+ return gateVerdict(r) === 'pass' ? 'on' : 'ask';
43
+ }
44
+
45
+ /**
46
+ * Recursive-verification gate (ADR-106).
47
+ *
48
+ * Decides whether `verification.recursive` ships on for a (host, family) cell.
49
+ * Pure, no-I/O — the measurement is the empirical bench:ab step. Encodes the
50
+ * council-locked two-branch rule: capability-only is NOT the gate, because it
51
+ * assumes (without measuring) that recursion's discipline lift is redundant
52
+ * with the always-on rules. The `D₂ − D₁` (recursion over rules-only) baseline
53
+ * makes redundancy a measured fact, gated behind a concrete cost ceiling and a
54
+ * human-preference pre-test. Contract:
55
+ * `docs/decisions/ADR-106-recursive-verification-benchmark-gate.md`.
56
+ */
57
+ export interface RecursiveBenchmarkResult {
58
+ /** Capability-axis lift is significant (McNemar/scorer p<0.05, effect≥0.5). */
59
+ capability_lift_significant: boolean;
60
+ /** Novel discipline lift `D₂ − D₁` (recursion over rules-only) exceeds ε_disc. */
61
+ novel_discipline_lift_significant: boolean;
62
+ /** Per-task cost is within the concrete ceiling (token-multiplier / $). */
63
+ cost_within_ceiling: boolean;
64
+ /** Phase 3a-pre human-preference rate (fraction preferring the recursion output). */
65
+ human_preference_rate: number;
66
+ }
67
+
68
+ /** Human-preference floor from ADR-106: below this the discipline branch cannot pass. */
69
+ export const RECURSIVE_HUMAN_PREFERENCE_FLOOR = 0.6;
70
+
71
+ /**
72
+ * Gate verdict for recursive verification (ADR-106 two-branch rule):
73
+ * pass iff capability_lift_significant
74
+ * OR (novel_discipline_lift_significant AND cost_within_ceiling
75
+ * AND human_preference_rate > floor)
76
+ * The human-preference test gates the discipline branch only — a capability
77
+ * lift passes on its own.
78
+ */
79
+ export function recursiveGateVerdict(r: RecursiveBenchmarkResult): GateVerdict {
80
+ if (r.capability_lift_significant) return 'pass';
81
+ const disciplineBranch =
82
+ r.novel_discipline_lift_significant &&
83
+ r.cost_within_ceiling &&
84
+ r.human_preference_rate > RECURSIVE_HUMAN_PREFERENCE_FLOOR;
85
+ return disciplineBranch ? 'pass' : 'fail';
86
+ }
87
+
88
+ /**
89
+ * Resolve the shipped default for `verification.recursive`.
90
+ *
91
+ * Default stays `off` until a cell passes (ADR-106) — an honest-null keeps it
92
+ * `off`, never `ask`. `host_supported` gates the result so a host where
93
+ * recursion is not viable always resolves `off`.
94
+ */
95
+ export function resolveRecursiveDefault(r: RecursiveBenchmarkResult, host_supported: boolean): ShippedDefault {
96
+ if (!host_supported) return 'off';
97
+ return recursiveGateVerdict(r) === 'pass' ? 'on' : 'off';
98
+ }