@event4u/agent-config 1.16.0 → 1.18.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/.agent-src/commands/{agents-audit.md → agents/audit.md} +4 -3
- package/.agent-src/commands/{agents-cleanup.md → agents/cleanup.md} +12 -6
- package/.agent-src/commands/{agents-prepare.md → agents/prepare.md} +4 -3
- package/.agent-src/commands/agents.md +46 -0
- package/.agent-src/commands/{chat-history-checkpoint.md → chat-history/checkpoint.md} +4 -4
- package/.agent-src/commands/{chat-history-clear.md → chat-history/clear.md} +4 -4
- package/.agent-src/commands/{chat-history-resume.md → chat-history/resume.md} +4 -4
- package/.agent-src/commands/chat-history/show.md +107 -0
- package/.agent-src/commands/chat-history.md +33 -89
- package/.agent-src/commands/{commit-in-chunks.md → commit/in-chunks.md} +15 -13
- package/.agent-src/commands/commit.md +22 -2
- package/.agent-src/commands/{context-create.md → context/create.md} +4 -3
- package/.agent-src/commands/{context-refactor.md → context/refactor.md} +4 -3
- package/.agent-src/commands/context.md +44 -0
- package/.agent-src/commands/{copilot-agents-init.md → copilot-agents/init.md} +4 -3
- package/.agent-src/commands/{copilot-agents-optimize.md → copilot-agents/optimize.md} +4 -3
- package/.agent-src/commands/copilot-agents.md +44 -0
- package/.agent-src/commands/council/default.md +221 -0
- package/.agent-src/commands/{council-design.md → council/design.md} +6 -5
- package/.agent-src/commands/{council-optimize.md → council/optimize.md} +7 -6
- package/.agent-src/commands/{council-pr.md → council/pr.md} +6 -5
- package/.agent-src/commands/council.md +47 -212
- package/.agent-src/commands/{create-pr-description.md → create-pr/description-only.md} +4 -2
- package/.agent-src/commands/create-pr.md +26 -5
- package/.agent-src/commands/{feature-dev.md → feature/dev.md} +5 -10
- package/.agent-src/commands/{feature-explore.md → feature/explore.md} +4 -8
- package/.agent-src/commands/{feature-plan.md → feature/plan.md} +4 -8
- package/.agent-src/commands/{feature-refactor.md → feature/refactor.md} +4 -8
- package/.agent-src/commands/{feature-roadmap.md → feature/roadmap.md} +6 -10
- package/.agent-src/commands/feature.md +6 -12
- package/.agent-src/commands/{fix-ci.md → fix/ci.md} +4 -8
- package/.agent-src/commands/{fix-portability.md → fix/portability.md} +4 -8
- package/.agent-src/commands/{fix-pr-bot-comments.md → fix/pr-bots.md} +4 -8
- package/.agent-src/commands/{fix-pr-developer-comments.md → fix/pr-developers.md} +4 -8
- package/.agent-src/commands/{fix-pr-comments.md → fix/pr.md} +7 -11
- package/.agent-src/commands/{fix-references.md → fix/refs.md} +4 -8
- package/.agent-src/commands/{fix-seeder.md → fix/seeder.md} +4 -8
- package/.agent-src/commands/fix.md +7 -13
- package/.agent-src/commands/{do-and-judge.md → judge/on-diff.md} +4 -3
- package/.agent-src/commands/judge/solo.md +90 -0
- package/.agent-src/commands/{do-in-steps.md → judge/steps.md} +4 -3
- package/.agent-src/commands/judge.md +35 -70
- package/.agent-src/commands/{memory-add.md → memory/add.md} +4 -3
- package/.agent-src/commands/{memory-full.md → memory/load.md} +4 -3
- package/.agent-src/commands/{memory-promote.md → memory/promote.md} +4 -3
- package/.agent-src/commands/{propose-memory.md → memory/propose.md} +4 -3
- package/.agent-src/commands/memory.md +48 -0
- package/.agent-src/commands/{module-create.md → module/create.md} +4 -3
- package/.agent-src/commands/{module-explore.md → module/explore.md} +4 -3
- package/.agent-src/commands/module.md +44 -0
- package/.agent-src/commands/{optimize-agents.md → optimize/agents.md} +4 -8
- package/.agent-src/commands/{optimize-augmentignore.md → optimize/augmentignore.md} +4 -9
- package/.agent-src/commands/{optimize-rtk-filters.md → optimize/rtk.md} +4 -8
- package/.agent-src/commands/{optimize-skills.md → optimize/skills.md} +4 -8
- package/.agent-src/commands/optimize.md +4 -10
- package/.agent-src/commands/{override-create.md → override/create.md} +4 -3
- package/.agent-src/commands/{override-manage.md → override/manage.md} +4 -3
- package/.agent-src/commands/override.md +44 -0
- package/.agent-src/commands/{roadmap-create.md → roadmap/create.md} +4 -3
- package/.agent-src/commands/{roadmap-execute.md → roadmap/execute.md} +4 -3
- package/.agent-src/commands/roadmap.md +44 -0
- package/.agent-src/commands/{tests-create.md → tests/create.md} +4 -3
- package/.agent-src/commands/{tests-execute.md → tests/execute.md} +4 -3
- package/.agent-src/commands/tests.md +44 -0
- package/.agent-src/contexts/communication/rules-auto/artifact-engagement-recording-mechanics.md +72 -0
- package/.agent-src/contexts/communication/rules-auto/augment-portability-mechanics.md +79 -0
- package/.agent-src/contexts/communication/rules-auto/augment-source-of-truth-mechanics.md +98 -0
- package/.agent-src/contexts/communication/rules-auto/cli-output-handling-mechanics.md +87 -0
- package/.agent-src/contexts/communication/rules-auto/command-suggestion-policy-mechanics.md +62 -0
- package/.agent-src/contexts/communication/rules-auto/docs-sync-mechanics.md +78 -0
- package/.agent-src/contexts/communication/rules-auto/package-ci-checks-mechanics.md +85 -0
- package/.agent-src/contexts/communication/rules-auto/review-routing-awareness-mechanics.md +65 -0
- package/.agent-src/contexts/communication/rules-auto/roadmap-progress-sync-mechanics.md +78 -0
- package/.agent-src/contexts/communication/rules-auto/skill-quality-mechanics.md +62 -0
- package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +55 -0
- package/.agent-src/contexts/communication/rules-auto/ui-audit-gate-mechanics.md +53 -0
- package/.agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +77 -0
- package/.agent-src/contexts/judges/no-consolidate-rationale.md +102 -0
- package/.agent-src/contexts/judges/persona-voice-rubric.md +140 -0
- package/.agent-src/rules/artifact-engagement-recording.md +13 -69
- package/.agent-src/rules/ask-when-uncertain.md +27 -42
- package/.agent-src/rules/augment-portability.md +15 -61
- package/.agent-src/rules/augment-source-of-truth.md +27 -93
- package/.agent-src/rules/cli-output-handling.md +10 -76
- package/.agent-src/rules/command-suggestion-policy.md +18 -59
- package/.agent-src/rules/commit-conventions.md +17 -14
- package/.agent-src/rules/context-hygiene.md +6 -0
- package/.agent-src/rules/direct-answers.md +35 -59
- package/.agent-src/rules/docker-commands.md +5 -5
- package/.agent-src/rules/docs-sync.md +15 -69
- package/.agent-src/rules/language-and-tone.md +48 -72
- package/.agent-src/rules/missing-tool-handling.md +28 -22
- package/.agent-src/rules/no-cheap-questions.md +39 -53
- package/.agent-src/rules/no-roadmap-references.md +73 -0
- package/.agent-src/rules/onboarding-gate.md +7 -0
- package/.agent-src/rules/package-ci-checks.md +21 -61
- package/.agent-src/rules/preservation-guard.md +64 -29
- package/.agent-src/rules/review-routing-awareness.md +24 -43
- package/.agent-src/rules/roadmap-progress-sync.md +31 -65
- package/.agent-src/rules/rule-type-governance.md +28 -0
- package/.agent-src/rules/security-sensitive-stop.md +8 -8
- package/.agent-src/rules/skill-quality.md +16 -48
- package/.agent-src/rules/slash-command-routing-policy.md +7 -4
- package/.agent-src/rules/think-before-action.md +52 -42
- package/.agent-src/rules/tool-safety.md +19 -16
- package/.agent-src/rules/ui-audit-gate.md +24 -38
- package/.agent-src/rules/user-interaction.md +13 -68
- package/.agent-src/skills/ai-council/SKILL.md +2 -0
- package/.agent-src/skills/api-testing/SKILL.md +1 -1
- package/.agent-src/skills/check-refs/SKILL.md +59 -40
- package/.agent-src/skills/conventional-commits-writing/SKILL.md +86 -28
- package/.agent-src/skills/copilot-agents-optimization/SKILL.md +5 -5
- package/.agent-src/skills/developer-like-execution/SKILL.md +4 -4
- package/.agent-src/skills/finishing-a-development-branch/SKILL.md +101 -65
- package/.agent-src/skills/flux/SKILL.md +30 -10
- package/.agent-src/skills/github-ci/SKILL.md +2 -2
- package/.agent-src/skills/judge-code-quality/SKILL.md +7 -8
- package/.agent-src/skills/judge-security-auditor/SKILL.md +4 -5
- package/.agent-src/skills/judge-test-coverage/SKILL.md +3 -4
- package/.agent-src/skills/lint-skills/SKILL.md +57 -39
- package/.agent-src/skills/md-language-check/SKILL.md +61 -39
- package/.agent-src/skills/override-management/SKILL.md +5 -5
- package/.agent-src/skills/quality-tools/SKILL.md +2 -2
- package/.agent-src/skills/react-shadcn-ui/SKILL.md +116 -43
- package/.agent-src/skills/readme-reviewer/SKILL.md +30 -29
- package/.agent-src/skills/readme-writing/SKILL.md +78 -53
- package/.agent-src/skills/readme-writing-package/SKILL.md +50 -47
- package/.agent-src/skills/receiving-code-review/SKILL.md +52 -47
- package/.agent-src/skills/refine-prompt/SKILL.md +0 -1
- package/.agent-src/skills/requesting-code-review/SKILL.md +35 -30
- package/.agent-src/skills/security/SKILL.md +7 -2
- package/.agent-src/skills/security-audit/SKILL.md +7 -3
- package/.agent-src/skills/systematic-debugging/SKILL.md +68 -60
- package/.agent-src/skills/test-driven-development/SKILL.md +59 -57
- package/.agent-src/skills/test-performance/SKILL.md +0 -1
- package/.agent-src/skills/traefik/SKILL.md +4 -4
- package/.agent-src/skills/verify-completion-evidence/SKILL.md +28 -26
- package/.agent-src/templates/roadmaps.md +4 -0
- package/.claude-plugin/marketplace.json +22 -11
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +125 -1
- package/README.md +18 -17
- package/docs/architecture.md +4 -6
- package/docs/catalog.md +67 -39
- package/docs/contracts/STABILITY.md +13 -7
- package/docs/contracts/adr-chat-history-split.md +1 -3
- package/docs/contracts/adr-command-suggestion.md +0 -2
- package/docs/contracts/adr-implement-ticket-runtime.md +1 -2
- package/docs/contracts/adr-product-ui-track.md +3 -6
- package/docs/contracts/adr-prompt-driven-execution.md +3 -4
- package/docs/contracts/agent-memory-contract.md +6 -11
- package/docs/contracts/artifact-engagement-flow.md +6 -9
- package/docs/contracts/command-clusters.md +56 -46
- package/docs/contracts/command-suggestion-flow.md +1 -3
- package/docs/contracts/context-paths.md +99 -0
- package/docs/contracts/file-ownership-matrix.json +6722 -0
- package/docs/contracts/file-ownership-matrix.md +134 -0
- package/docs/contracts/implement-ticket-flow.md +6 -9
- package/docs/contracts/linear-ai-rules-inclusion.md +0 -1
- package/docs/contracts/linear-ai-three-layers.md +0 -2
- package/docs/contracts/load-context-budget-model.md +258 -0
- package/docs/contracts/load-context-schema.md +21 -3
- package/docs/contracts/roadmap-complexity-standard.md +137 -0
- package/docs/contracts/rule-interactions.md +0 -1
- package/docs/contracts/rule-priority-hierarchy.md +1 -1
- package/docs/contracts/ui-track-flow.md +7 -17
- package/docs/customization.md +2 -0
- package/docs/getting-started.md +5 -4
- package/docs/guidelines/agent-infra/ask-when-uncertain-demos.md +134 -0
- package/docs/guidelines/agent-infra/asking-and-brevity-examples.md +100 -0
- package/docs/guidelines/agent-infra/direct-answers-demos.md +145 -0
- package/docs/guidelines/agent-infra/verify-before-complete-demos.md +128 -0
- package/package.json +1 -1
- package/scripts/_phase2_shim_helper.py +109 -0
- package/scripts/agent-config +30 -0
- package/scripts/ai_council/one_off_archive/2026-05/README.md +45 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_2a4_acceptance.py +208 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_budget_v2_audit.py +206 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_context_layer_v1_estimate.py +67 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_context_layer_v1_review.py +292 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_followups_review.py +259 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_nondestructive_inline_audit.py +209 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_phase4_dispatch_latency.py +108 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_phase6_trigger_jaccard.py +92 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_phase_2a_budget_rebalance.py +257 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_phase_2a_post_revert.py +197 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_rule_hardening_v1.py +251 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_structural_open_questions.py +232 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_structural_optimization.py +144 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_structural_v3_gaps.py +252 -0
- package/scripts/ai_council/one_off_archive/2026-05/_one_off_structural_v3_review.py +240 -0
- package/scripts/build_rule_trigger_matrix.py +360 -0
- package/scripts/check_always_budget.py +402 -45
- package/scripts/check_cluster_patterns.py +159 -0
- package/scripts/check_command_count_messaging.py +14 -7
- package/scripts/check_context_paths.py +201 -0
- package/scripts/check_no_roadmap_refs.py +155 -0
- package/scripts/check_one_off_location.py +81 -0
- package/scripts/check_phase_coupling.py +148 -0
- package/scripts/check_portability.py +2 -0
- package/scripts/check_references.py +35 -2
- package/scripts/check_safety_floor_untouched.py +125 -0
- package/scripts/command_suggester/loader.py +4 -1
- package/scripts/compress.py +64 -15
- package/scripts/context_hygiene_hook.py +173 -0
- package/scripts/generate_index.py +6 -2
- package/scripts/generate_ownership_matrix.py +323 -0
- package/scripts/hooks/augment-context-hygiene.sh +55 -0
- package/scripts/hooks/augment-onboarding-gate.sh +55 -0
- package/scripts/hooks/augment-roadmap-progress.sh +57 -0
- package/scripts/install.py +105 -45
- package/scripts/lint_examples.py +98 -0
- package/scripts/lint_no_new_atomic_commands.py +12 -11
- package/scripts/lint_roadmap_complexity.py +127 -0
- package/scripts/onboarding_gate_hook.py +137 -0
- package/scripts/requirements-evals.txt +1 -0
- package/scripts/roadmap_progress_hook.py +159 -0
- package/scripts/schemas/command.schema.json +4 -3
- package/scripts/schemas/rule.schema.json +5 -0
- package/scripts/skill_linter.py +1 -0
- package/scripts/sync_agent_settings.py +25 -2
- package/scripts/update_counts.py +7 -0
- /package/scripts/ai_council/{_one_off_rebalancing_audit.py → one_off_archive/2026-05/_one_off_rebalancing_audit.py} +0 -0
- /package/scripts/ai_council/{_one_off_roundtrip.py → one_off_archive/2026-05/_one_off_roundtrip.py} +0 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
stability: beta
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# File-ownership matrix
|
|
6
|
+
|
|
7
|
+
> **Audience:** roadmap authors, phase reviewers, and CI gate writers
|
|
8
|
+
> who need to know which artefact reads which, and whether two phases
|
|
9
|
+
> can run concurrently without colliding.
|
|
10
|
+
> **Generator:** `scripts/generate_ownership_matrix.py`
|
|
11
|
+
> (run via `task generate-ownership-matrix`).
|
|
12
|
+
> **Validator:** `task check-ownership-matrix` (fails if the JSON drifts
|
|
13
|
+
> from a fresh regeneration).
|
|
14
|
+
> **Companion contracts:** [`load-context-schema.md`](load-context-schema.md),
|
|
15
|
+
> [`context-paths.md`](context-paths.md).
|
|
16
|
+
|
|
17
|
+
This contract defines the **schema** of the file-ownership matrix: the
|
|
18
|
+
machine-readable JSON at `docs/contracts/file-ownership-matrix.json` and
|
|
19
|
+
the human-readable mirror at
|
|
20
|
+
`agents/contexts/structural/file-ownership-matrix.md`. Both are
|
|
21
|
+
regenerated from `.agent-src.uncompressed/` by the generator and locked
|
|
22
|
+
by CI.
|
|
23
|
+
|
|
24
|
+
**Status:** internal-locked (`stability: beta`). Schema bumps require a
|
|
25
|
+
contract version increment plus a roadmap revision (per
|
|
26
|
+
`road-to-structural-optimization.md` § 0.1).
|
|
27
|
+
|
|
28
|
+
## Why the matrix exists
|
|
29
|
+
|
|
30
|
+
`road-to-structural-optimization` Phase 0.1 (CRITICAL) is the DAG
|
|
31
|
+
successor of Phase 0.6 (path conventions). Subsequent phases (1, 2A,
|
|
32
|
+
2B, 3, 6) extract material into context files, slim rules, and reorder
|
|
33
|
+
command surface. The matrix is the substrate that lets later phases
|
|
34
|
+
ask three questions deterministically:
|
|
35
|
+
|
|
36
|
+
1. **Which files does my edit reach transitively?** Answered by the
|
|
37
|
+
`READ_ONLY` edges plus their depth-2 closure.
|
|
38
|
+
2. **Can Phase X and Phase Y land in either order?** Answered by
|
|
39
|
+
intersecting per-phase `WRITE` sets — empty intersection = safe.
|
|
40
|
+
3. **Has the matrix drifted since the last green CI run?** Answered by
|
|
41
|
+
the `check-ownership-matrix` consistency gate.
|
|
42
|
+
|
|
43
|
+
## Schema (v1)
|
|
44
|
+
|
|
45
|
+
The JSON document is a single object:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"version": 1,
|
|
50
|
+
"generated_by": "scripts/generate_ownership_matrix.py",
|
|
51
|
+
"source_of_truth": ".agent-src.uncompressed/",
|
|
52
|
+
"files": {
|
|
53
|
+
"<repo-root-relative path>": {
|
|
54
|
+
"kind": "rule | skill | command | context | persona",
|
|
55
|
+
"rule_type": "always | auto | manual | null",
|
|
56
|
+
"load_context": ["<path>", ...],
|
|
57
|
+
"load_context_eager": ["<path>", ...]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"edges": [
|
|
61
|
+
{
|
|
62
|
+
"source": "<path>",
|
|
63
|
+
"target": "<path>",
|
|
64
|
+
"type": "READ_ONLY | WRITE | BLOCKS_IF_CONCURRENT",
|
|
65
|
+
"via": "load_context | load_context_eager | load_context_transitive | body_link",
|
|
66
|
+
"depth": 1
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Edge types**
|
|
73
|
+
|
|
74
|
+
| Type | Meaning | Populated in v1 |
|
|
75
|
+
|---|---|:-:|
|
|
76
|
+
| `READ_ONLY` | Source file reads target (frontmatter declaration or body markdown link). | ✅ |
|
|
77
|
+
| `WRITE` | Source file owns target. Self-edge for every file (`source == target`). | ✅ |
|
|
78
|
+
| `BLOCKS_IF_CONCURRENT` | Two phases would write the same file. Derived later from a phase manifest; reserved in v1. | ⏳ |
|
|
79
|
+
|
|
80
|
+
**Edge `via` values**
|
|
81
|
+
|
|
82
|
+
- `load_context` — frontmatter `load_context:` entry (lazy).
|
|
83
|
+
- `load_context_eager` — frontmatter `load_context_eager:` entry.
|
|
84
|
+
- `load_context_transitive` — depth-2 hop reached by following a target's own
|
|
85
|
+
`load_context*` declarations one level deeper.
|
|
86
|
+
- `body_link` — markdown link in body to a path inside one of the
|
|
87
|
+
scanned roots.
|
|
88
|
+
|
|
89
|
+
## Depth invariant (G2 — v3.1)
|
|
90
|
+
|
|
91
|
+
The generator computes the transitive closure of `load_context` /
|
|
92
|
+
`load_context_eager` edges **up to depth 2**. Any chain
|
|
93
|
+
`R → A → B → C` where every hop is a `load_context*` edge **fails the
|
|
94
|
+
build** with exit code 2. This duplicates the same nesting cap that
|
|
95
|
+
Phase 0.2.4 will enforce in `scripts/check_always_budget.py` — two
|
|
96
|
+
enforcement points, one invariant.
|
|
97
|
+
|
|
98
|
+
## Regeneration policy
|
|
99
|
+
|
|
100
|
+
| Trigger | What runs | What fails |
|
|
101
|
+
|---|---|---|
|
|
102
|
+
| `task generate-ownership-matrix` | Regenerates JSON + MD in place. | Depth-3 chain → exit 2. |
|
|
103
|
+
| `task check-ownership-matrix` (CI) | Regenerates to memory, diffs against committed JSON. | Diff non-empty → exit 1. Depth-3 → exit 2. |
|
|
104
|
+
| Pre-commit hook (Phase 2A — A1 fix) | Future: regenerate and diff on commits that touch contexts. | Same as `check-ownership-matrix`. |
|
|
105
|
+
|
|
106
|
+
Any commit that adds, moves, or modifies a context, rule, skill, or
|
|
107
|
+
command MUST regenerate the matrix in the same commit. CI is the
|
|
108
|
+
backstop; the consistency gate fails if regeneration drifts.
|
|
109
|
+
|
|
110
|
+
## Scope notes (v1)
|
|
111
|
+
|
|
112
|
+
- **Greppable surface:** `rules/`, `skills/`, `commands/`, `contexts/`,
|
|
113
|
+
`personas/` under `.agent-src.uncompressed/`. Generated tool
|
|
114
|
+
projections (`.augment/`, `.claude/`, `.cursor/`, …) are intentionally
|
|
115
|
+
ignored — they are downstream of the source of truth.
|
|
116
|
+
- **`skill:` frontmatter in rules** (named in roadmap 0.1.2) is reserved.
|
|
117
|
+
No rules currently declare it; the generator scans for it but emits
|
|
118
|
+
zero edges of that kind in v1.
|
|
119
|
+
- **Body link parser** is conservative: it only recognises markdown
|
|
120
|
+
link targets ending in `.md` whose path resolves under one of the
|
|
121
|
+
scanned roots. Bare backtick-name references (e.g., `` `skill-quality` ``)
|
|
122
|
+
are **not** edges in v1; they are too ambiguous to attribute.
|
|
123
|
+
- **Cycles** are not the matrix's concern — the existing
|
|
124
|
+
`lint_load_context.py` rejects them. The matrix generator follows
|
|
125
|
+
edges with a visited-set so a cycle, if one slipped through, cannot
|
|
126
|
+
loop forever; it would surface as a depth-3 abort.
|
|
127
|
+
|
|
128
|
+
## Versioning
|
|
129
|
+
|
|
130
|
+
`version: 1` is the initial lock. Schema-breaking changes (renaming a
|
|
131
|
+
field, removing an edge type, changing semantics of an existing
|
|
132
|
+
`via`) require a version bump and a roadmap revision. Additive changes
|
|
133
|
+
(new `via` values, new optional file fields) MAY land at the current
|
|
134
|
+
version with a `CHANGELOG.md` entry under `### Beta`.
|
|
@@ -4,10 +4,9 @@ stability: beta
|
|
|
4
4
|
|
|
5
5
|
# `/implement-ticket` — Flow Contract
|
|
6
6
|
|
|
7
|
-
> Technical contracts for the delivery orchestrator
|
|
8
|
-
>
|
|
9
|
-
>
|
|
10
|
-
> delivery.
|
|
7
|
+
> Technical contracts for the `/implement-ticket` delivery orchestrator.
|
|
8
|
+
> This document is the stable reference for engine boundaries, state
|
|
9
|
+
> schema, and replay protocol.
|
|
11
10
|
>
|
|
12
11
|
> - **Created:** 2026-04-22
|
|
13
12
|
> - **Status:** Phase 1 shipped 2026-04-23 — `DeliveryState` +
|
|
@@ -133,9 +132,9 @@ against actual engine output rather than synthetic fixtures.
|
|
|
133
132
|
Prompt envelopes (`input.kind="prompt"`) carry a free-form goal
|
|
134
133
|
instead of a refined ticket. The `refine` step routes on shape
|
|
135
134
|
(presence of `raw` key) and on the first pass emits an
|
|
136
|
-
`@agent-directive: refine-prompt` halt — the agent
|
|
137
|
-
matching skill, which reconstructs
|
|
138
|
-
`assumptions`. On the rebound, `scoring/confidence.py` produces a
|
|
135
|
+
`@agent-directive: refine-prompt` halt — the host agent is
|
|
136
|
+
instructed to run the matching skill, which reconstructs
|
|
137
|
+
`acceptance_criteria` + `assumptions`. On the rebound, `scoring/confidence.py` produces a
|
|
139
138
|
frozen `ConfidenceScore(band, score, dimensions, reasons,
|
|
140
139
|
ui_intent)` and the dispatcher branches on `band`:
|
|
141
140
|
|
|
@@ -616,8 +615,6 @@ are blocked by `freeze-guard.yml::manifest-integrity` at PR time.
|
|
|
616
615
|
|
|
617
616
|
## See also
|
|
618
617
|
|
|
619
|
-
- [`agents/roadmaps/road-to-implement-ticket.md`](../../agents/roadmaps/road-to-implement-ticket.md)
|
|
620
|
-
- [`agents/roadmaps/road-to-universal-execution-engine.md`](../../agents/roadmaps/road-to-universal-execution-engine.md)
|
|
621
618
|
- `tests/golden/` — capture sandbox, recipes, and Capture Packs
|
|
622
619
|
- [`../../tests/golden/harness.py`](../../tests/golden/harness.py) — Strict-Verb replay harness
|
|
623
620
|
- [`../../.github/workflows/freeze-guard.yml`](../../.github/workflows/freeze-guard.yml) — manifest-integrity + live-replay gates
|
|
@@ -4,7 +4,6 @@ stability: beta
|
|
|
4
4
|
|
|
5
5
|
# Linear AI — rules inclusion list
|
|
6
6
|
|
|
7
|
-
> Phase 3 Step 1 deliverable for [`road-to-universal-distribution.md`](../../agents/roadmaps/road-to-universal-distribution.md).
|
|
8
7
|
> Per-rule decision for the Linear AI rules digest. The digest is a
|
|
9
8
|
> Markdown blob the user pastes into Linear's `Settings → Agents →
|
|
10
9
|
> Additional guidance` (workspace / team / personal). The third-party
|
|
@@ -4,7 +4,6 @@ stability: beta
|
|
|
4
4
|
|
|
5
5
|
# Linear AI — three-layer split rationale
|
|
6
6
|
|
|
7
|
-
> Phase 3 Step 3 deliverable for [`road-to-universal-distribution.md`](../../agents/roadmaps/road-to-universal-distribution.md).
|
|
8
7
|
> Per-rule routing is in [`linear-ai-rules-inclusion.md`](linear-ai-rules-inclusion.md);
|
|
9
8
|
> this file documents *why* the split is workspace / team / personal and
|
|
10
9
|
> what belongs in each.
|
|
@@ -128,4 +127,3 @@ does not maintain `event4u/agent-config`.
|
|
|
128
127
|
- Per-rule decision: [`linear-ai-rules-inclusion.md`](linear-ai-rules-inclusion.md)
|
|
129
128
|
- Builder script: [`scripts/build_linear_digest.py`](../../scripts/build_linear_digest.py)
|
|
130
129
|
- Generated digests: `dist/linear/{workspace,team,personal}.md` (gitignored)
|
|
131
|
-
- Roadmap: [`road-to-universal-distribution.md`](../../agents/roadmaps/road-to-universal-distribution.md) Phase 3
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
---
|
|
2
|
+
stability: beta
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# `load_context:` Budget Accounting Model
|
|
6
|
+
|
|
7
|
+
> **Audience:** maintainers of `type: "always"` rules and the budget
|
|
8
|
+
> linter who need a single, deterministic answer to "how many chars
|
|
9
|
+
> does this rule cost the always-budget?".
|
|
10
|
+
> **Linter:** `scripts/check_always_budget.py`
|
|
11
|
+
> (run via `task check-always-budget`).
|
|
12
|
+
> **Companion:** [`load-context-schema.md`](load-context-schema.md) —
|
|
13
|
+
> frontmatter contract for citing a context from a rule.
|
|
14
|
+
> [`STABILITY.md § Budget contracts`](STABILITY.md#budget-contracts) —
|
|
15
|
+
> the numeric caps this model enforces.
|
|
16
|
+
|
|
17
|
+
This contract locks the **accounting model** by which a `type: "always"`
|
|
18
|
+
rule's `load_context:` declarations contribute to the always-rule
|
|
19
|
+
budget. It resolves the "is the rule its file size or its file size
|
|
20
|
+
plus everything it loads?" ambiguity surfaced by Round-2 council on
|
|
21
|
+
`road-to-structural-optimization` (Finding 7, CRITICAL).
|
|
22
|
+
|
|
23
|
+
**Status:** internal-locked. Changes require a contract version bump
|
|
24
|
+
and a roadmap revision (per
|
|
25
|
+
`road-to-structural-optimization.md` § Definitions). The 2 % tolerance
|
|
26
|
+
band on the retroactive test (G3 in v3.1) is the only legal way to
|
|
27
|
+
adjust the model parameters without a roadmap revision; an overshoot
|
|
28
|
+
above the band rejects the model and escalates to the council.
|
|
29
|
+
|
|
30
|
+
## The locked model — Model (b) literal
|
|
31
|
+
|
|
32
|
+
For any rule with frontmatter `type: "always"`:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
EffectiveSize(rule) = RawSize(rule)
|
|
36
|
+
+ Σ RawSize(c) for every c in transitive_closure(rule.load_context*)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Where:
|
|
40
|
+
|
|
41
|
+
- `load_context*` is the union of `load_context:` (lazy) **and**
|
|
42
|
+
`load_context_eager:` entries declared in frontmatter
|
|
43
|
+
(per [`load-context-schema.md`](load-context-schema.md)).
|
|
44
|
+
- `transitive_closure` walks `load_context:` declarations on
|
|
45
|
+
context files **up to depth 2** — see § Nesting cap below.
|
|
46
|
+
- `RawSize` is the byte size of the compressed file
|
|
47
|
+
(`.agent-src/...`), measured by `os.path.getsize()`. The
|
|
48
|
+
uncompressed source paths in frontmatter are mapped to their
|
|
49
|
+
compressed counterparts before sizing.
|
|
50
|
+
- A context loaded by N always-rules counts **N times** (once per
|
|
51
|
+
loading rule). Rationale: the always-budget protects context-window
|
|
52
|
+
utilization at activation time; if rule A and rule B both fire on
|
|
53
|
+
the same turn, the agent pays both costs.
|
|
54
|
+
|
|
55
|
+
### Why model (b) and not (a) or (c)
|
|
56
|
+
|
|
57
|
+
| Model | Definition | Why rejected |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| (a) rule chars only | `EffectiveSize = RawSize(rule)` | Ignores the cost of declared contexts. Phase-2A obligation extraction would *appear* free, allowing unbounded context bloat. |
|
|
60
|
+
| (b) literal *(this contract)* | `EffectiveSize = RawSize(rule) + Σ contexts` | Simplest invariant. Aligns with how the agent actually pays the cost when both rule and context fire on a turn. |
|
|
61
|
+
| (c) shared-divisor | `EffectiveSize = RawSize(rule) + Σ (RawSize(c) / N_loaders)` | Tempting for shared `commit-mechanics`-style contexts but breaks the "what does each rule cost in isolation" question. Reserved as the **first refinement step** if the 2 % tolerance band is exceeded. |
|
|
62
|
+
|
|
63
|
+
Council Round 3 converged A/A/A on the **separate-skills + shared-context**
|
|
64
|
+
extraction pattern (Q1) and the **one-rule + three-contexts** consolidation
|
|
65
|
+
(Q2); model (b) literal is the accounting that makes both patterns
|
|
66
|
+
honest about their cost.
|
|
67
|
+
|
|
68
|
+
## Load order (Q1) — file order in frontmatter
|
|
69
|
+
|
|
70
|
+
Locked by Phase 1.2 of `road-to-context-layer-maturity` (council
|
|
71
|
+
session `2026-05-03T17-56-21Z`, v2 lock).
|
|
72
|
+
|
|
73
|
+
When a rule declares multiple `load_context:` and / or
|
|
74
|
+
`load_context_eager:` entries, the agent processes them in the order
|
|
75
|
+
they appear in the YAML list, top to bottom. `load_context_eager:`
|
|
76
|
+
entries are concatenated into the active context in declaration
|
|
77
|
+
order; `load_context:` entries are available for lazy retrieval in
|
|
78
|
+
the same order, surfaced first-listed-first when the rule body cites
|
|
79
|
+
them in prose.
|
|
80
|
+
|
|
81
|
+
**Rejected alternatives:**
|
|
82
|
+
|
|
83
|
+
- *Citation order in prose* — non-machine-readable; would force every
|
|
84
|
+
rule to embed a sort hint and the linter to parse rule body text.
|
|
85
|
+
- *Priority field per entry* — adds frontmatter surface area without
|
|
86
|
+
observable benefit. The current rule with the most contexts
|
|
87
|
+
(`autonomous-execution`, 3 contexts) reads each in declaration
|
|
88
|
+
order without ambiguity.
|
|
89
|
+
|
|
90
|
+
This contract treats list order as the canonical signal. Authors
|
|
91
|
+
must order their `load_context:` entries from "load this first" to
|
|
92
|
+
"load this last" so prose citations and frontmatter agree.
|
|
93
|
+
|
|
94
|
+
## Per-rule context-count cap (Q2) — ≤ 3 contexts per rule
|
|
95
|
+
|
|
96
|
+
Locked by Phase 1.3 of `road-to-context-layer-maturity` (council
|
|
97
|
+
session `2026-05-03T17-56-21Z`, v2 lock). Enforced by
|
|
98
|
+
`scripts/check_always_budget.py` as `MAX_CONTEXTS_PER_RULE = 3`.
|
|
99
|
+
|
|
100
|
+
A rule's combined count of `load_context:` + `load_context_eager:`
|
|
101
|
+
top-level entries must not exceed **3**. The cap is on *declared*
|
|
102
|
+
entries (depth 1 from the rule), not transitive closure — depth-2
|
|
103
|
+
context citations are governed by the depth-2 nesting cap below.
|
|
104
|
+
|
|
105
|
+
**Rationale:**
|
|
106
|
+
|
|
107
|
+
- Empirical max in the current rule set is 3
|
|
108
|
+
(`autonomous-execution`); the cap locks the ceiling without forcing
|
|
109
|
+
any rewrite.
|
|
110
|
+
- A 4th declared context is the structural signal that the rule
|
|
111
|
+
should split (one rule, one obligation surface), not load more.
|
|
112
|
+
- Cross-platform mechanical: a count check is O(N), no semantic
|
|
113
|
+
analysis, identical observable on Augment and Claude Code.
|
|
114
|
+
|
|
115
|
+
The cap applies to **all rule types** (`always` and `auto`) — Q2 is
|
|
116
|
+
a structural constraint on rule shape, not a budget concern.
|
|
117
|
+
|
|
118
|
+
## Cross-rule sharing (Q3) — Model (b) literal locked
|
|
119
|
+
|
|
120
|
+
Locked by Phase 1.4 of `road-to-context-layer-maturity` (decision
|
|
121
|
+
3a). The accounting model in § The locked model above stands without
|
|
122
|
+
shared-context discount.
|
|
123
|
+
|
|
124
|
+
**Decision:** when context X is loaded by N rules, each rule pays
|
|
125
|
+
the full `RawSize(X)` under Model (b). No `chars(X) / N` discount.
|
|
126
|
+
|
|
127
|
+
**Rationale (3a over 3b):**
|
|
128
|
+
|
|
129
|
+
- The linter is correct as-is — `RECOVERY_BAND_ENABLED` plus the
|
|
130
|
+
per-rule allowlist is already a working ratchet to drive total
|
|
131
|
+
utilization below 100 %.
|
|
132
|
+
- 3b would require a linter rewrite plus a new failure-mode test
|
|
133
|
+
family (cross-rule attribution, divisor-stability invariants).
|
|
134
|
+
Phase 1.4a's 4-hour / 200-LOC feasibility cap was structured to
|
|
135
|
+
reject 3b on cost; with no current shared-context patterns
|
|
136
|
+
exceeding 1 loader per context (verified Phase 1.1 inventory), 3b
|
|
137
|
+
has no measurable upside.
|
|
138
|
+
- Phase 4c (shared-context discount) becomes a no-op under 3a.
|
|
139
|
+
Phase 4 leverage shifts to 4a (demote), 4b (merge), and 4d
|
|
140
|
+
(hard-compress) — see `road-to-context-layer-maturity` Phase 4
|
|
141
|
+
inputs gate.
|
|
142
|
+
|
|
143
|
+
**Reopener:** if a future inventory shows ≥ 3 shared-context loaders
|
|
144
|
+
and total utilization re-enters the 95–100 % zone after Phase 4
|
|
145
|
+
completes, run the Phase 1.4a feasibility spike and propose 3b via
|
|
146
|
+
contract version bump.
|
|
147
|
+
|
|
148
|
+
## Nesting cap — depth 2
|
|
149
|
+
|
|
150
|
+
A rule's `load_context:` may cite a context (depth 1). A context may
|
|
151
|
+
cite further contexts in its own frontmatter (depth 2). A depth-2
|
|
152
|
+
context citing a third context (depth 3) **aborts the build**.
|
|
153
|
+
|
|
154
|
+
Rationale: bounded recursion makes the linter terminate in O(N) and
|
|
155
|
+
prevents accidental cycles. Council Round-2 finding 9 (HIGH).
|
|
156
|
+
|
|
157
|
+
The check is enforced by `scripts/check_always_budget.py` as a
|
|
158
|
+
separate exit-code-1 condition (independent of the budget caps), so
|
|
159
|
+
that a depth violation surfaces with the violating chain, not as a
|
|
160
|
+
budget-cap breach.
|
|
161
|
+
|
|
162
|
+
## Known-breach allowlist (transitional)
|
|
163
|
+
|
|
164
|
+
Phase 2A targets `non-destructive-by-default` and `scope-control`
|
|
165
|
+
for slimming. Both rules currently exceed the **6,000-char per-rule
|
|
166
|
+
cap** under model (b) literal — this is expected and intentional:
|
|
167
|
+
Phase 0.2 lands the model and its measurement; Phase 2A brings the
|
|
168
|
+
breaches under the cap.
|
|
169
|
+
|
|
170
|
+
To keep CI green during the transition, the linter and the test
|
|
171
|
+
suite carry an explicit `KNOWN_PER_RULE_BREACHES` allowlist with the
|
|
172
|
+
**measured ceiling** for each entry. Each entry must:
|
|
173
|
+
|
|
174
|
+
- Be referenced by the Phase 2A roadmap step that will retire it.
|
|
175
|
+
- Have a documented expected-removal date or roadmap milestone.
|
|
176
|
+
- Fail the build the moment the breach **grows** above the recorded
|
|
177
|
+
ceiling (regression guard).
|
|
178
|
+
|
|
179
|
+
Phase 2A's success criterion (`budget delta ≥ −5 %`) is the trigger
|
|
180
|
+
to remove entries from the allowlist. The allowlist must be **empty**
|
|
181
|
+
before Phase 2A is marked complete.
|
|
182
|
+
|
|
183
|
+
## Retroactive test result (Phase 0.2.3)
|
|
184
|
+
|
|
185
|
+
PR #34's `autonomous-execution` split moved mechanics into three
|
|
186
|
+
contexts under `contexts/execution/`. Re-measuring under model (b)
|
|
187
|
+
literal:
|
|
188
|
+
|
|
189
|
+
| Metric | Value | Cap | Utilization |
|
|
190
|
+
|---|---:|---:|---:|
|
|
191
|
+
| Total extended budget | 49,311 chars | 49,000 | **100.6 %** |
|
|
192
|
+
| Top-3 extended | 22,248 chars | 24,500 | 90.8 % |
|
|
193
|
+
| Per-rule breaches | 2 of 9 | 0 | `non-destructive-by-default` (7,887), `scope-control` (8,529) |
|
|
194
|
+
|
|
195
|
+
The total sits **0.6 % over** the cap — within the 2 % tolerance band
|
|
196
|
+
(G3) which permits parameter refinement before model rejection. Per
|
|
197
|
+
the contract, the model is **accepted**; the per-rule breaches are
|
|
198
|
+
recorded in the transitional allowlist for Phase 2A.
|
|
199
|
+
|
|
200
|
+
`autonomous-execution` itself is `type: "auto"` and does not enter
|
|
201
|
+
the always-budget. Its own extended size (rule 5,196 + three contexts
|
|
202
|
+
8,453) = 13,649 chars is reported by the linter for Phase 2B
|
|
203
|
+
diagnostics but does not gate the always-budget cap.
|
|
204
|
+
|
|
205
|
+
## Linter contract
|
|
206
|
+
|
|
207
|
+
`scripts/check_always_budget.py` enforces:
|
|
208
|
+
|
|
209
|
+
1. `EffectiveSize` per always-rule against the per-rule cap (with
|
|
210
|
+
the transitional allowlist).
|
|
211
|
+
2. Sum of `EffectiveSize` across all always-rules against the total
|
|
212
|
+
cap (warn at 80 %, fail at ≥ 90 % — unchanged from PR #34).
|
|
213
|
+
3. Top-3 sum against the top-3 cap.
|
|
214
|
+
4. Depth ≤ 2 on every `load_context:` chain reachable from an
|
|
215
|
+
always-rule.
|
|
216
|
+
|
|
217
|
+
### Recovery band (Phase 2A → Phase 5 transitional)
|
|
218
|
+
|
|
219
|
+
Locked by AI Council session `2026-05-03T12-02-42Z` (verdict A1)
|
|
220
|
+
after Phase 2A was attempted and reverted: the 1:1 rule-to-context
|
|
221
|
+
split was uneconomical under Model (b) literal because the
|
|
222
|
+
frontmatter and citation-line tax on the new context file outweighed
|
|
223
|
+
the chars removed from the rule. Reverting Phase 2A left the budget
|
|
224
|
+
at 96.8 % — strictly better than the `main` baseline at 100.6 % but
|
|
225
|
+
inside the 90–100 % gap zone the linter rejects.
|
|
226
|
+
|
|
227
|
+
While `RECOVERY_BAND_ENABLED = True`, the linter accepts a branch in
|
|
228
|
+
the gap zone iff:
|
|
229
|
+
|
|
230
|
+
- `total_ext < baseline` (read from `.github/budget-baseline.txt`,
|
|
231
|
+
the chars at last-green `main`), AND
|
|
232
|
+
- every per-rule cap holds (allowlisted entries unchanged), AND
|
|
233
|
+
- top-3 cap holds, AND
|
|
234
|
+
- depth-2 cap holds.
|
|
235
|
+
|
|
236
|
+
A branch passing only the recovery band reports
|
|
237
|
+
`⚠️ WARN (recovery band, baseline N)`. The band is a one-way ratchet:
|
|
238
|
+
once a smaller branch lands on `main`, the baseline file must be
|
|
239
|
+
updated to the new total in the same commit. Phase 5 of
|
|
240
|
+
`road-to-structural-optimization` flips `RECOVERY_BAND_ENABLED` to
|
|
241
|
+
`False` and removes both the band and the G3 tolerance — the gate
|
|
242
|
+
collapses to `total < TOTAL_CAP` strict.
|
|
243
|
+
|
|
244
|
+
Exit codes: 0 = pass (or warn, including recovery band), 1 = any cap
|
|
245
|
+
breach or depth violation, 3 = internal error.
|
|
246
|
+
|
|
247
|
+
## What this contract intentionally does **not** promise
|
|
248
|
+
|
|
249
|
+
- **No claim about runtime cost.** The model treats every context
|
|
250
|
+
as if it were active when its rule fires. The agent may cache or
|
|
251
|
+
short-circuit lazy loads at runtime; the budget is the **upper
|
|
252
|
+
bound**, not the realised cost.
|
|
253
|
+
- **No claim about `type: "auto"` rules.** Auto rules enter the
|
|
254
|
+
agent's context only when their description matches; they have
|
|
255
|
+
their own per-rule LOC targets in Phase 2B (not a global budget).
|
|
256
|
+
- **No claim about commands or skills.** Commands and skills load
|
|
257
|
+
on user invocation. Their token cost is accounted by the
|
|
258
|
+
command-cluster and skill-family contracts, not here.
|
|
@@ -85,6 +85,26 @@ Single-rule contexts that don't fit one of the canonical topics live
|
|
|
85
85
|
directly under `contexts/` (see `contexts/model-recommendations.md`,
|
|
86
86
|
`contexts/skills-and-commands.md`).
|
|
87
87
|
|
|
88
|
+
## Per-rule context-count cap (Q2)
|
|
89
|
+
|
|
90
|
+
A rule's combined count of `load_context:` + `load_context_eager:`
|
|
91
|
+
top-level entries MUST be ≤ **3**. Enforced by
|
|
92
|
+
`scripts/check_always_budget.py` (`MAX_CONTEXTS_PER_RULE`); see
|
|
93
|
+
[`load-context-budget-model.md § Per-rule context-count cap (Q2)`](load-context-budget-model.md#per-rule-context-count-cap-q2--3-contexts-per-rule)
|
|
94
|
+
for the locking contract.
|
|
95
|
+
|
|
96
|
+
A 4th context is the structural signal that the rule should split,
|
|
97
|
+
not load more. Authors hitting the cap should extract a sibling rule
|
|
98
|
+
with its own obligation surface, not stretch the existing one.
|
|
99
|
+
|
|
100
|
+
## Load order
|
|
101
|
+
|
|
102
|
+
Entries load in **frontmatter list order**, top-to-bottom. Author
|
|
103
|
+
your list in "first read" order so prose citations and frontmatter
|
|
104
|
+
agree. See
|
|
105
|
+
[`load-context-budget-model.md § Load order (Q1)`](load-context-budget-model.md#load-order-q1--file-order-in-frontmatter)
|
|
106
|
+
for the locking rationale.
|
|
107
|
+
|
|
88
108
|
## Combined char-budget guard
|
|
89
109
|
|
|
90
110
|
`load_context_eager:` triggers a budget check:
|
|
@@ -93,9 +113,7 @@ directly under `contexts/` (see `contexts/model-recommendations.md`,
|
|
|
93
113
|
chars(rule.md) + sum(chars(eager_target.md) for each entry) ≤ rule_cap
|
|
94
114
|
```
|
|
95
115
|
|
|
96
|
-
`rule_cap` is the per-rule budget
|
|
97
|
-
[`road-to-rebalancing.md`](../../agents/roadmaps/road-to-rebalancing.md)
|
|
98
|
-
§ Target architecture:
|
|
116
|
+
`rule_cap` is the per-rule budget:
|
|
99
117
|
|
|
100
118
|
- Always rule: 2,500
|
|
101
119
|
- Auto rule: 4,000
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
stability: beta
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Roadmap Complexity Standard
|
|
6
|
+
|
|
7
|
+
> **Audience:** roadmap authors and reviewers in `agents/roadmaps/`.
|
|
8
|
+
> **Linter:** `scripts/lint_roadmap_complexity.py` (run via
|
|
9
|
+
> `task lint-roadmap-complexity`).
|
|
10
|
+
> **Source:** Phase 5 of the `road-to-context-layer-maturity` work
|
|
11
|
+
> (now archived); reviewer-flagged drift after the
|
|
12
|
+
> structural-optimization roadmap proved that "heavy" is correct for
|
|
13
|
+
> structural work but wrong for normal feature work.
|
|
14
|
+
|
|
15
|
+
Roadmaps drift toward heavyweight whenever the previous one was
|
|
16
|
+
heavyweight. This contract pins **two tiers**, names exemplars, and
|
|
17
|
+
hard-fails the lint on tier mismatch.
|
|
18
|
+
|
|
19
|
+
## Tiers
|
|
20
|
+
|
|
21
|
+
### Lightweight (default)
|
|
22
|
+
|
|
23
|
+
Almost every roadmap is lightweight. The shape:
|
|
24
|
+
|
|
25
|
+
- **≤ 6 phases** total
|
|
26
|
+
- **≤ 1 page per phase** (≈ 60 source lines including header + steps
|
|
27
|
+
+ exit gate; the linter doesn't enforce per-phase line budgets, but
|
|
28
|
+
reviewers do)
|
|
29
|
+
- **No nested council debates** inside the roadmap (no
|
|
30
|
+
`## Council Round 1`, `## Council Round 2`, `### Verdict` sections)
|
|
31
|
+
- **No 178-step backlogs** — phases are delivery-shaped, not
|
|
32
|
+
task-shaped
|
|
33
|
+
- **≤ 600 lines total** (frontmatter + body, blank lines counted)
|
|
34
|
+
- Frontmatter declares `complexity: lightweight`
|
|
35
|
+
|
|
36
|
+
**Exemplars:**
|
|
37
|
+
|
|
38
|
+
- `road-to-context-layer-maturity.md` (archived) — six phases,
|
|
39
|
+
~376 lines, no nested council; the seed roadmap that triggered this
|
|
40
|
+
standard. Self-tagged as `lightweight`.
|
|
41
|
+
- `road-to-rule-hardening.md` (archived) — five phases, ~263 lines;
|
|
42
|
+
mechanized the rule layer; sibling of the seed, also lightweight.
|
|
43
|
+
|
|
44
|
+
**Typical use:** feature work, follow-ups, bounded refactors,
|
|
45
|
+
mechanization passes, telemetry plumbing.
|
|
46
|
+
|
|
47
|
+
### Structural (rare)
|
|
48
|
+
|
|
49
|
+
Triggered only when the work changes a contract layer or a budget
|
|
50
|
+
invariant. The shape:
|
|
51
|
+
|
|
52
|
+
- Multi-round council, locked decisions, file-ownership matrix,
|
|
53
|
+
gating contracts on phase boundaries
|
|
54
|
+
- **> 600 lines** total (typical: 800 – 1500)
|
|
55
|
+
- May include `## Council Round N` / `### Verdict` blocks, ADR
|
|
56
|
+
cross-links, decision matrices
|
|
57
|
+
- Frontmatter declares `complexity: structural`
|
|
58
|
+
|
|
59
|
+
**Exemplars:**
|
|
60
|
+
|
|
61
|
+
- Archived `agents/roadmaps/_archived/road-to-structural-optimization.md`
|
|
62
|
+
(closed 2026-05-03 after 6 phases of council-driven budget work).
|
|
63
|
+
~1.5k lines, multi-round council, file-ownership matrix.
|
|
64
|
+
|
|
65
|
+
**Triggered by:** changes to a public contract surface in
|
|
66
|
+
`docs/contracts/`, a budget invariant in
|
|
67
|
+
[`load-context-budget-model.md`](load-context-budget-model.md), or a
|
|
68
|
+
priority hierarchy in
|
|
69
|
+
[`rule-priority-hierarchy.md`](rule-priority-hierarchy.md).
|
|
70
|
+
**Requires:** explicit user opt-in on creation. The agent must not
|
|
71
|
+
upgrade a lightweight roadmap to structural mid-flight without that
|
|
72
|
+
opt-in.
|
|
73
|
+
|
|
74
|
+
## Anti-game clause
|
|
75
|
+
|
|
76
|
+
The trigger is **contract-layer change**, not line count alone. A
|
|
77
|
+
heavy roadmap split into two lightweights to dodge the gate is a
|
|
78
|
+
linter-defeat — reviewers flag it on PR review. Conversely, a
|
|
79
|
+
roadmap that legitimately needs the structural shape but tries to
|
|
80
|
+
hide as `lightweight` to skip council overhead is the same defeat in
|
|
81
|
+
the other direction.
|
|
82
|
+
|
|
83
|
+
## Frontmatter
|
|
84
|
+
|
|
85
|
+
Every roadmap in `agents/roadmaps/` (including draft and archived
|
|
86
|
+
ones) declares its tier:
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
---
|
|
90
|
+
complexity: lightweight
|
|
91
|
+
---
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
or
|
|
95
|
+
|
|
96
|
+
```yaml
|
|
97
|
+
---
|
|
98
|
+
complexity: structural
|
|
99
|
+
status: draft
|
|
100
|
+
---
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Other frontmatter keys (`status:`, `owner:`, `target_release:`) are
|
|
104
|
+
permitted alongside but not required by this contract.
|
|
105
|
+
|
|
106
|
+
## Linter contract
|
|
107
|
+
|
|
108
|
+
`scripts/lint_roadmap_complexity.py` (≤ 150 LOC, stdlib only)
|
|
109
|
+
enforces the **measurable** subset of this standard:
|
|
110
|
+
|
|
111
|
+
| Check | Lightweight | Structural |
|
|
112
|
+
|---|---|---|
|
|
113
|
+
| `complexity:` frontmatter declared | required | required |
|
|
114
|
+
| Total line count | ≤ 600 | > 0 (no upper cap) |
|
|
115
|
+
| `## Phase N` heading count | ≤ 6 | no cap |
|
|
116
|
+
| `## Council Round N` / `### Verdict` blocks | forbidden | allowed |
|
|
117
|
+
| Council session cross-links (`agents/sessions/.../council-…`) | warn | allowed |
|
|
118
|
+
|
|
119
|
+
The linter runs on every roadmap file under `agents/roadmaps/` and
|
|
120
|
+
exits non-zero on any violation. Hooked into `task ci` via
|
|
121
|
+
`task lint-roadmap-complexity`.
|
|
122
|
+
|
|
123
|
+
**Out of scope for the linter** (reviewer judgment only): step count,
|
|
124
|
+
per-phase length, the contract-layer-change trigger for the
|
|
125
|
+
structural tier.
|
|
126
|
+
|
|
127
|
+
## Migration
|
|
128
|
+
|
|
129
|
+
Phase 5.3 of `road-to-context-layer-maturity` applies the standard
|
|
130
|
+
retroactively to all open roadmaps in `agents/roadmaps/`: each gets
|
|
131
|
+
a `complexity:` tag based on the rules above. No content rewrites
|
|
132
|
+
land in that step — only the tag.
|
|
133
|
+
|
|
134
|
+
Roadmaps that exceed the lightweight cap but plausibly should be
|
|
135
|
+
lightweight (e.g. they accumulated drift) are tagged `structural`
|
|
136
|
+
for now and may be split or trimmed in a follow-up. The migration
|
|
137
|
+
records existing reality, not aspirational reality.
|
|
@@ -104,4 +104,3 @@ junior (yields). For `complements`, ordering is documentary only.
|
|
|
104
104
|
|
|
105
105
|
- [`docs/contracts/STABILITY.md`](STABILITY.md) — public-surface stability tiers.
|
|
106
106
|
- [`docs/contracts/adr-chat-history-split.md`](adr-chat-history-split.md) — ADR pattern for major rule structural changes.
|
|
107
|
-
- [`agents/roadmaps/archive/road-to-post-pr29-optimize.md`](../../agents/roadmaps/archive/road-to-post-pr29-optimize.md) § P2.2 — anchor for this matrix.
|
|
@@ -64,7 +64,7 @@ which one's Iron Law gets the final say.
|
|
|
64
64
|
| Situation | Bands that fire | Winner | Why |
|
|
65
65
|
|---|---|---|---|
|
|
66
66
|
| Standing autonomy + roadmap step says "merge to `main`" | 1, 7 | **1** | Hard Floor predates and outranks autonomy; surface the merge, ask. |
|
|
67
|
-
| `/commit
|
|
67
|
+
| `/commit:in-chunks` on a diff that removes a directory | 1, 5 | **1** | Commit exception authorizes *commits*, not *bulk deletions*. Confirm diff this turn. |
|
|
68
68
|
| User asks "improve this" with no metric named | 4, 7 | **4** | Vague-request trigger fires before any autonomy decision; ask the one clarifying question. |
|
|
69
69
|
| Editing `app/Auth/PasswordReset.php` mid-feature | 2, 7 | **2** | Security-sensitive surface stops the edit until threat-model is recorded. |
|
|
70
70
|
| Agent about to claim "ready to merge" with no fresh test output | 5, 6 | **6** | Verification gate fires before the commit/push question is even valid. |
|