lgtm-specs 0.0.7 → 0.0.8
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/AGENTS.md +9 -7
- package/README.md +19 -8
- package/VERSION +1 -1
- package/agents/README.md +11 -85
- package/agents/flows/README.md +19 -0
- package/agents/flows/audit/README.md +16 -0
- package/agents/flows/audit/build_consensus.md +9 -0
- package/agents/flows/audit/build_panel.md +7 -0
- package/agents/flows/audit/review_panel.md +7 -0
- package/agents/flows/audit/review_synthesize.md +8 -0
- package/agents/flows/build/README.md +15 -0
- package/agents/flows/build/delivery_production.md +7 -0
- package/agents/flows/build/delivery_prototype.md +7 -0
- package/agents/flows/build/execute_fast.md +9 -0
- package/agents/flows/build/execute_high_assurance.md +9 -0
- package/agents/flows/investigate/README.md +11 -0
- package/agents/flows/investigate/hooks.md +10 -0
- package/agents/flows/plan/README.md +13 -0
- package/agents/flows/plan/build.md +9 -0
- package/agents/flows/plan/hack.md +13 -0
- package/agents/flows/plan/review.md +10 -0
- package/agents/modes/README.md +5 -1
- package/agents/modes/build.md +64 -35
- package/agents/modes/hack.md +55 -33
- package/agents/modes/review.md +51 -26
- package/agents/roles/README.md +14 -0
- package/agents/roles/counsel/README.md +11 -0
- package/agents/roles/counsel/default.md +50 -0
- package/agents/roles/counsel/role.yaml +28 -0
- package/agents/roles/explorer/README.md +11 -0
- package/agents/roles/explorer/default.md +42 -0
- package/agents/roles/explorer/role.yaml +28 -0
- package/agents/roles/implementer/README.md +12 -0
- package/agents/roles/implementer/init.md +35 -0
- package/agents/roles/implementer/resolve.md +2 -0
- package/agents/roles/implementer/role.yaml +37 -0
- package/agents/roles/investigator/README.md +13 -0
- package/agents/roles/investigator/init.md +31 -0
- package/agents/roles/investigator/resolve.md +2 -0
- package/agents/roles/investigator/role.yaml +43 -0
- package/agents/roles/investigator/worker.md +41 -0
- package/agents/roles/lead/README.md +12 -0
- package/agents/roles/lead/arbitrator.md +33 -0
- package/agents/roles/lead/orchestrator.md +23 -0
- package/agents/roles/lead/role.yaml +36 -0
- package/agents/roles/librarian/README.md +11 -0
- package/agents/roles/librarian/default.md +39 -0
- package/agents/roles/librarian/role.yaml +28 -0
- package/agents/roles/planner/README.md +12 -0
- package/agents/roles/planner/init.md +36 -0
- package/agents/roles/planner/resolve.md +2 -0
- package/agents/roles/planner/role.yaml +36 -0
- package/agents/roles/reviewer/README.md +13 -42
- package/agents/roles/reviewer/auditor.md +31 -0
- package/agents/roles/reviewer/lite.md +39 -47
- package/agents/roles/reviewer/logic.md +33 -47
- package/agents/roles/reviewer/performance.md +31 -43
- package/agents/roles/reviewer/plan.md +34 -44
- package/agents/roles/reviewer/quality.md +36 -48
- package/agents/roles/reviewer/reassess.md +1 -0
- package/agents/roles/reviewer/role.yaml +85 -0
- package/agents/roles/reviewer/security.md +31 -45
- package/agents/roles/reviewer/test.md +34 -47
- package/agents/templates/README.md +3 -1
- package/agents/templates/flow.md +14 -0
- package/agents/templates/mode.md +59 -23
- package/agents/templates/role.md +82 -65
- package/docs/README.md +1 -1
- package/docs/adr/0005-agent-specialization.md +3 -3
- package/docs/adr/0007-operating-modes-and-gates.md +11 -7
- package/docs/adr/0009-modularizing-modes-into-reusable-flows.md +108 -87
- package/docs/adr/0010-hierarchical-stage-managers.md +731 -0
- package/docs/adr/0011-investigation-flow-fixed-five-panel.md +482 -0
- package/docs/adr/0012-roles-modes-flows-layered-architecture.md +243 -0
- package/docs/adr/0013-yaml-sidecar-contracts-for-agent-metadata.md +148 -0
- package/docs/adr/0014-roles-are-prompts-modes-flows-are-specs.md +110 -0
- package/docs/adr/0015-runtime-owned-state-manager-owned-stage-outcomes.md +215 -0
- package/docs/adr/0016-manager-centric-stage-profiles.md +181 -0
- package/docs/adr/README.md +22 -1
- package/docs/agent_architecture.md +50 -41
- package/docs/context_lifecycle.md +73 -46
- package/docs/contribute/add-agent.md +23 -21
- package/docs/contribute/checklist.md +7 -3
- package/docs/contribute/update-models.md +30 -60
- package/docs/contribute/verification.md +7 -2
- package/docs/engineering_principles.md +7 -0
- package/docs/meta/README.md +11 -0
- package/docs/meta/domains/git/01-workflow.md +1 -1
- package/docs/meta/languages/typescript/03-async.md +1 -1
- package/docs/meta/workflow.md +1 -1
- package/docs/philosophy.md +11 -2
- package/integrate/README.md +92 -64
- package/integrate/agent_builder.md +209 -150
- package/integrate/agent_schema.yaml +105 -0
- package/integrate/artifacts.md +275 -97
- package/integrate/context_injection.md +9 -1
- package/integrate/context_limits.md +49 -31
- package/integrate/counsel_contract.md +9 -13
- package/integrate/example_flow.md +121 -48
- package/integrate/implementation_reference.md +140 -0
- package/integrate/input_packets/README.md +19 -0
- package/integrate/input_packets/conventions.md +111 -0
- package/integrate/input_packets/core_packets.md +346 -0
- package/integrate/input_packets/investigation.md +287 -0
- package/integrate/input_packets/routing.md +53 -0
- package/integrate/input_packets/stage_decisions.md +258 -0
- package/integrate/input_packets.md +35 -173
- package/integrate/model_resolver.md +85 -27
- package/integrate/test_vectors/build/lead_orchestrator.md +33 -0
- package/integrate/test_vectors/fixtures/README.md +10 -0
- package/integrate/test_vectors/fixtures/mock_indices.md +1 -0
- package/integrate/test_vectors/fixtures/mock_injected_rules_full.md +29 -0
- package/integrate/test_vectors/fixtures/mock_injected_rules_trimmed.md +15 -0
- package/integrate/test_vectors/fixtures/mock_review_feedback.md +2 -0
- package/integrate/test_vectors/hack/lead_orchestrator.md +31 -0
- package/integrate/test_vectors/review/lead_orchestrator.md +31 -0
- package/integrate/test_vectors/shared/README.md +26 -0
- package/integrate/test_vectors/shared/counsel_default.md +52 -0
- package/integrate/test_vectors/shared/explorer_default.md +44 -0
- package/integrate/test_vectors/shared/implementer_init.md +65 -0
- package/integrate/test_vectors/shared/implementer_resolve.md +6 -0
- package/integrate/test_vectors/shared/investigator_init.md +33 -0
- package/integrate/test_vectors/shared/investigator_resolve.md +6 -0
- package/integrate/test_vectors/shared/investigator_worker.md +57 -0
- package/integrate/test_vectors/shared/lead_arbitrator.md +35 -0
- package/integrate/test_vectors/shared/librarian_default.md +41 -0
- package/integrate/test_vectors/shared/planner_init.md +52 -0
- package/integrate/test_vectors/shared/planner_resolve.md +6 -0
- package/integrate/test_vectors/shared/reviewer_auditor.md +33 -0
- package/integrate/test_vectors/shared/reviewer_lite.md +59 -0
- package/integrate/test_vectors/shared/reviewer_logic.md +56 -0
- package/integrate/test_vectors/shared/reviewer_performance.md +54 -0
- package/integrate/test_vectors/shared/reviewer_plan.md +58 -0
- package/integrate/test_vectors/shared/reviewer_quality.md +59 -0
- package/integrate/test_vectors/shared/reviewer_reassess.md +3 -0
- package/integrate/test_vectors/shared/reviewer_security.md +54 -0
- package/integrate/test_vectors/shared/reviewer_test.md +57 -0
- package/integrate/test_vectors.md +86 -0
- package/integrate/versioning.md +8 -8
- package/models/README.md +19 -68
- package/models/registry.yaml +6 -6
- package/package.json +7 -2
- package/rules/constitution/CONS-00027-transparency.md +9 -0
- package/rules/constitution/CONS-00032-documentation.md +8 -2
- package/rules/laws/go/GO-00017-comments.md +4 -1
- package/rules/laws/go/GO-00022-observability.md +6 -1
- package/rules/laws/go/GO-00023-dependency-management.md +1 -1
- package/rules/laws/typescript/TS-00003-async.md +1 -1
- package/rules/policies/default.md +7 -0
- package/scripts/README.md +49 -1
- package/scripts/compose_mode_workflow.py +144 -0
- package/scripts/generate_test_vectors.py +307 -0
- package/scripts/render_prompt.py +225 -0
- package/scripts/validate_specs.py +463 -53
- package/agents/modes/build/README.md +0 -11
- package/agents/modes/build/code.md +0 -43
- package/agents/modes/build/delivery.md +0 -9
- package/agents/modes/build/panel.md +0 -30
- package/agents/modes/build/panel_consensus.md +0 -71
- package/agents/modes/build/plan.md +0 -28
- package/agents/modes/hack/README.md +0 -9
- package/agents/modes/hack/code.md +0 -42
- package/agents/modes/hack/delivery.md +0 -6
- package/agents/modes/hack/plan.md +0 -29
- package/agents/modes/review/README.md +0 -9
- package/agents/modes/review/audit.md +0 -33
- package/agents/modes/review/plan.md +0 -24
- package/agents/modes/review/synthesize.md +0 -18
- package/agents/roles/counsel.md +0 -96
- package/agents/roles/explorer.md +0 -77
- package/agents/roles/implementer.md +0 -122
- package/agents/roles/lead.md +0 -122
- package/agents/roles/librarian.md +0 -63
- package/agents/roles/planner.md +0 -98
- package/agents/roles/reviewer/BASE.md +0 -10
- package/agents/roles/reviewer/OUTPUT_FORMAT.md +0 -17
package/AGENTS.md
CHANGED
|
@@ -20,7 +20,7 @@ bun run check
|
|
|
20
20
|
What this runs:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
# Validation (graph structure, indexing,
|
|
23
|
+
# Validation (graph structure, indexing, role contracts, VERSION sync)
|
|
24
24
|
bun run validate
|
|
25
25
|
# or:
|
|
26
26
|
python3 scripts/validate_specs.py
|
|
@@ -113,6 +113,8 @@ Tags and writing:
|
|
|
113
113
|
Indexing:
|
|
114
114
|
|
|
115
115
|
- Every directory with content MUST have a `README.md` indexing its files.
|
|
116
|
+
- Exception: role prompt-chunk directories (`agents/roles/<role>/prompts/<profile>/`) may contain prompt templates
|
|
117
|
+
without a profile-local `README.md` when indexed by `agents/roles/<role>/README.md`.
|
|
116
118
|
- Any new file must be added to the parent directory index `README.md`.
|
|
117
119
|
|
|
118
120
|
### 2.2 Agent Specs (`agents/**`)
|
|
@@ -120,12 +122,12 @@ Indexing:
|
|
|
120
122
|
Contracts (external tools parse these; see `integrate/README.md`):
|
|
121
123
|
|
|
122
124
|
- Do not remove placeholders like `{{injected_rules}}` / `{{indices}}`.
|
|
123
|
-
- Modes
|
|
124
|
-
- Roles
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
- Modes are pure Markdown specs (no role prompt section tags) and compose flows via `{{flow_*}}`.
|
|
126
|
+
- Roles are directory contracts: `agents/roles/<role>/role.yaml` + profile-scoped
|
|
127
|
+
`agents/roles/<role>/<profile>.md` (or `prompts/<profile>/*.md`) templates.
|
|
128
|
+
- Prompt templates are plain Markdown (no role prompt section tags).
|
|
129
|
+
- Role contracts must include `model_tier: critical|standard|economy`, profile `compose`/`allowed_injections`, and
|
|
130
|
+
optional profile `rule_render`/`rule_scope` per `integrate/agent_schema.yaml`.
|
|
129
131
|
|
|
130
132
|
### 2.3 Python Tooling (`scripts/**/*.py`)
|
|
131
133
|
|
package/README.md
CHANGED
|
@@ -31,7 +31,9 @@ Start here:
|
|
|
31
31
|
## Workflows
|
|
32
32
|
|
|
33
33
|
LGTM runs as operating modes that orchestrate a specialist team (Lead, Explorer, Counsel, Planner, Implementer,
|
|
34
|
-
|
|
34
|
+
Reviewer, Investigator).
|
|
35
|
+
|
|
36
|
+
Modes are thin entrypoints composed from reusable flow contracts under `agents/flows/**`.
|
|
35
37
|
|
|
36
38
|
Modes:
|
|
37
39
|
|
|
@@ -41,12 +43,17 @@ Modes:
|
|
|
41
43
|
|
|
42
44
|
Core roles:
|
|
43
45
|
|
|
44
|
-
- 🧠 [Lead](agents/roles/lead.
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
46
|
+
- 🧠 [Lead (orchestrator profile)](agents/roles/lead/role.yaml): orchestrates workflows and synthesis.
|
|
47
|
+
- 🧭 [Lead (arbitrator profile)](agents/roles/lead/role.yaml): arbitrates disputed findings.
|
|
48
|
+
- 🗺️ [Explorer](agents/roles/explorer/role.yaml): maps the target repo.
|
|
49
|
+
- ⚖️ [Counsel](agents/roles/counsel/role.yaml): selects minimal relevant rule paths.
|
|
50
|
+
- 🗂️ [Planner](agents/roles/planner/role.yaml): owns plan-stage drafting, revisions, and planning decisions.
|
|
51
|
+
- 🧱 [Implementer](agents/roles/implementer/role.yaml): owns build-stage implementation, remediation, and decisions.
|
|
52
|
+
- 🛡️ [Reviewer (auditor + specialist lenses)](agents/roles/reviewer/README.md): runs panel gates,
|
|
53
|
+
report synthesis, and lens-based audits.
|
|
54
|
+
- 🔎 [Investigator](agents/roles/investigator/role.yaml): owns investigation-stage decisions and fixed-slot worker
|
|
55
|
+
analysis.
|
|
56
|
+
- 📚 [Librarian](agents/roles/librarian/role.yaml): optional external source lookup.
|
|
50
57
|
|
|
51
58
|
Start here:
|
|
52
59
|
|
|
@@ -88,7 +95,11 @@ You are implementing integration for the LGTM specs repo (yyforyongyu/lgtm-specs
|
|
|
88
95
|
Goal: wire this repo into a coding tool so it can run the LGTM agent workflows.
|
|
89
96
|
|
|
90
97
|
Read and follow `integrate/README.md` exactly, including:
|
|
91
|
-
- Parsing `agents
|
|
98
|
+
- Parsing role contracts under `agents/roles/**/role.yaml` and composing role prompts from
|
|
99
|
+
profile-scoped templates under `agents/roles/**/<profile>.md` (or `agents/roles/**/prompts/<profile>/*.md`), plus
|
|
100
|
+
composing mode contracts from `agents/modes/*.md`:
|
|
101
|
+
- inject `Lead Stage Contract` to `lead/orchestrator`,
|
|
102
|
+
- compose `Workflow Contract (Runtime Reference)` from `agents/flows/**` for runtime routing/policy.
|
|
92
103
|
- Running Counsel and enforcing its JSON output schema.
|
|
93
104
|
- Hydrating rule paths into rule content and injecting role-appropriate subsets per reviewer.
|
|
94
105
|
- Resolving models using `models/registry.yaml` in list order (preference order) with deterministic availability checks.
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.8
|
package/agents/README.md
CHANGED
|
@@ -1,90 +1,16 @@
|
|
|
1
1
|
# Agent Workforce
|
|
2
2
|
|
|
3
|
-
This directory
|
|
3
|
+
This directory contains LGTM agent specifications: invocable role contracts plus non-invocable mode/flow orchestration
|
|
4
|
+
specs. Treat this README as a top-level signpost and use subfolder indexes for details.
|
|
4
5
|
|
|
5
|
-
-
|
|
6
|
-
|
|
6
|
+
Current architecture uses a stage-owner model: `lead/orchestrator` delegates to stage-owner profiles
|
|
7
|
+
(`planner/init`, `implementer/init`, `reviewer/auditor`, `investigator/init`) while runtime owns transition mechanics.
|
|
8
|
+
For implementation contracts and routing matrices, start at `integrate/README.md`.
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
For a human-facing overview, see [Agent Architecture](../docs/agent_architecture.md).
|
|
10
|
+
## Index
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- [
|
|
14
|
-
- [
|
|
15
|
-
- [
|
|
16
|
-
|
|
17
|
-
## Roles
|
|
18
|
-
|
|
19
|
-
- [@Lead](roles/lead.md): Orchestrator and arbitrator.
|
|
20
|
-
- [@Planner](roles/planner.md): Execution/audit plan author.
|
|
21
|
-
- [@Counsel](roles/counsel.md): Rule/policy selection (paths + reasons).
|
|
22
|
-
- [@Explorer](roles/explorer.md): Codebase mapping and policy discovery (Context Map).
|
|
23
|
-
- [@Implementer](roles/implementer.md): Implementation + required proof (inner loop).
|
|
24
|
-
- [@Librarian](roles/librarian.md): External documentation/spec research with citations.
|
|
25
|
-
|
|
26
|
-
## Review Panel
|
|
27
|
-
|
|
28
|
-
- [@Reviewer](roles/reviewer/README.md): Panel index (specialists).
|
|
29
|
-
- [@Plan-Reviewer](roles/reviewer/plan.md): Plan critique (feasibility/alignment).
|
|
30
|
-
- [@Reviewer-Lite](roles/reviewer/lite.md): Atomic diff sanity gate (fast).
|
|
31
|
-
- [@Reviewer-Logic](roles/reviewer/logic.md): Correctness audit.
|
|
32
|
-
- [@Reviewer-Quality](roles/reviewer/quality.md): Maintainability + docs audit.
|
|
33
|
-
- [@Reviewer-Test](roles/reviewer/test.md): Test coverage + rigor audit.
|
|
34
|
-
- [@Reviewer-Security](roles/reviewer/security.md): Trust boundary + safety audit.
|
|
35
|
-
- [@Reviewer-Performance](roles/reviewer/performance.md): Efficiency + resource usage audit.
|
|
36
|
-
|
|
37
|
-
## Templates (For Maintainers)
|
|
38
|
-
|
|
39
|
-
- Role template: [templates/role.md](templates/role.md)
|
|
40
|
-
- Mode template: [templates/mode.md](templates/mode.md)
|
|
41
|
-
|
|
42
|
-
## Directory Structure
|
|
43
|
-
|
|
44
|
-
```text
|
|
45
|
-
agents/
|
|
46
|
-
├── modes/
|
|
47
|
-
│ ├── README.md
|
|
48
|
-
│ ├── build.md
|
|
49
|
-
│ ├── hack.md
|
|
50
|
-
│ ├── review.md
|
|
51
|
-
│ ├── build/
|
|
52
|
-
│ │ ├── README.md
|
|
53
|
-
│ │ ├── plan.md
|
|
54
|
-
│ │ ├── code.md
|
|
55
|
-
│ │ ├── panel.md
|
|
56
|
-
│ │ ├── panel_consensus.md
|
|
57
|
-
│ │ └── delivery.md
|
|
58
|
-
│ ├── hack/
|
|
59
|
-
│ │ ├── README.md
|
|
60
|
-
│ │ ├── plan.md
|
|
61
|
-
│ │ ├── code.md
|
|
62
|
-
│ │ └── delivery.md
|
|
63
|
-
│ └── review/
|
|
64
|
-
│ ├── README.md
|
|
65
|
-
│ ├── plan.md
|
|
66
|
-
│ ├── audit.md
|
|
67
|
-
│ └── synthesize.md
|
|
68
|
-
├── templates/
|
|
69
|
-
│ ├── README.md
|
|
70
|
-
│ ├── role.md
|
|
71
|
-
│ └── mode.md
|
|
72
|
-
└── roles/
|
|
73
|
-
├── lead.md
|
|
74
|
-
├── planner.md
|
|
75
|
-
├── counsel.md
|
|
76
|
-
├── explorer.md
|
|
77
|
-
├── implementer.md
|
|
78
|
-
├── librarian.md
|
|
79
|
-
└── reviewer/
|
|
80
|
-
├── BASE.md
|
|
81
|
-
├── OUTPUT_FORMAT.md
|
|
82
|
-
├── README.md
|
|
83
|
-
├── plan.md
|
|
84
|
-
├── lite.md
|
|
85
|
-
├── logic.md
|
|
86
|
-
├── quality.md
|
|
87
|
-
├── security.md
|
|
88
|
-
├── performance.md
|
|
89
|
-
└── test.md
|
|
90
|
-
```
|
|
12
|
+
- [modes/README.md](modes/README.md)
|
|
13
|
+
- [flows/README.md](flows/README.md)
|
|
14
|
+
- [roles/README.md](roles/README.md)
|
|
15
|
+
- [templates/README.md](templates/README.md)
|
|
16
|
+
- [../integrate/README.md](../integrate/README.md)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Reusable Flows
|
|
2
|
+
|
|
3
|
+
Non-invocable orchestration contracts composed by mode specs.
|
|
4
|
+
|
|
5
|
+
Flow contracts describe lead-visible stage transitions only (handoff -> expected outcome -> next decision).
|
|
6
|
+
Role behavior details and runtime mechanics stay authoritative in `agents/roles/**` and `integrate/**`.
|
|
7
|
+
|
|
8
|
+
Placeholder contract:
|
|
9
|
+
|
|
10
|
+
- `{{flow_<family>_<variant>}}` -> `agents/flows/<family>/<variant>.md`
|
|
11
|
+
- families: `plan`, `build`, `audit`, `investigate`
|
|
12
|
+
|
|
13
|
+
## Index
|
|
14
|
+
|
|
15
|
+
- [plan/README.md](plan/README.md): planning flow contracts
|
|
16
|
+
- [build/README.md](build/README.md): implementation and delivery flow contracts
|
|
17
|
+
- [audit/README.md](audit/README.md): review-panel and synthesis flow contracts
|
|
18
|
+
- [investigate/README.md](investigate/README.md): shared investigation hook contracts
|
|
19
|
+
- [../roles/README.md](../roles/README.md): role/profile contract index
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Audit Flow Contracts
|
|
2
|
+
|
|
3
|
+
Panel/synthesis contracts keyed by `{{flow_audit_<variant>}}`.
|
|
4
|
+
|
|
5
|
+
These flows define lead-visible audit-stage handoffs to [@Reviewer](/agents/roles/reviewer/role.yaml),
|
|
6
|
+
plus synthesis/escalation decisions by [@Lead](/agents/roles/lead/role.yaml).
|
|
7
|
+
|
|
8
|
+
## Index
|
|
9
|
+
|
|
10
|
+
- [build_panel.md](build_panel.md): build-mode full panel barrier
|
|
11
|
+
- [build_consensus.md](build_consensus.md): build-mode resolve/remediate consensus loop
|
|
12
|
+
- [review_panel.md](review_panel.md): review-mode panel execution
|
|
13
|
+
- [review_synthesize.md](review_synthesize.md): review-mode synthesis/reporting
|
|
14
|
+
- [/agents/roles/reviewer/README.md](/agents/roles/reviewer/README.md): reviewer role profiles
|
|
15
|
+
- [/agents/roles/implementer/README.md](/agents/roles/implementer/README.md): implementer role contract
|
|
16
|
+
- [/agents/roles/planner/README.md](/agents/roles/planner/README.md): planner role contract
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## Panel Consensus (Build)
|
|
2
|
+
|
|
3
|
+
Runtime delta over mode `Lead Stage Contract`:
|
|
4
|
+
|
|
5
|
+
1. Interpret each audit-stage outcome into remediation dispatch, arbitration dispatch, or gate-close action.
|
|
6
|
+
2. On remediation action, route to [@Implementer](/agents/roles/implementer/role.yaml) (`init`) then schedule the next
|
|
7
|
+
panel-audit pass.
|
|
8
|
+
3. On dispute action, route to [@Lead](/agents/roles/lead/role.yaml) (`arbitrator`) then return to panel audit.
|
|
9
|
+
4. Close gate only on explicit approval, allowed override, or terminal abort outcome.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## Panel Audit (Build)
|
|
2
|
+
|
|
3
|
+
Runtime delta over mode `Lead Stage Contract`:
|
|
4
|
+
|
|
5
|
+
1. Enforce panel round barrier before accepting audit-stage outcome payloads.
|
|
6
|
+
2. Persist panel artifacts and accepted audit-stage decision payload for consensus routing.
|
|
7
|
+
3. Carry scoped diff/context evidence refs forward for remediation and re-audit continuity.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## Panel Audit (Review)
|
|
2
|
+
|
|
3
|
+
Runtime delta over mode `Lead Stage Contract`:
|
|
4
|
+
|
|
5
|
+
1. Include approved audit-plan refs in reviewer/auditor packets when present.
|
|
6
|
+
2. Enforce audit round barrier and persist panel artifacts before synthesis transition.
|
|
7
|
+
3. If stage outcome escalates disputed findings, schedule arbitration before final synthesis.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## Synthesize & Report (Review)
|
|
2
|
+
|
|
3
|
+
Runtime delta over mode `Lead Stage Contract`:
|
|
4
|
+
|
|
5
|
+
1. Synthesis consumes persisted panel artifacts and finding-provenance mappings.
|
|
6
|
+
2. Clarification pass is one bounded follow-up turn through [@Reviewer](/agents/roles/reviewer/role.yaml)
|
|
7
|
+
(`auditor`) before finalization.
|
|
8
|
+
3. Final report output must include severity grouping, evidence references, and residual-risk notes.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Build Flow Contracts
|
|
2
|
+
|
|
3
|
+
Implementation/delivery contracts keyed by `{{flow_build_<variant>}}`.
|
|
4
|
+
|
|
5
|
+
These flows define lead-visible build-stage handoffs to [@Implementer](/agents/roles/implementer/role.yaml),
|
|
6
|
+
escalation paths, and delivery closure expectations.
|
|
7
|
+
|
|
8
|
+
## Index
|
|
9
|
+
|
|
10
|
+
- [execute_high_assurance.md](execute_high_assurance.md): `@Build` execution loop
|
|
11
|
+
- [execute_fast.md](execute_fast.md): `@Hack` fast execution loop
|
|
12
|
+
- [delivery_production.md](delivery_production.md): production delivery closure
|
|
13
|
+
- [delivery_prototype.md](delivery_prototype.md): prototype delivery closure
|
|
14
|
+
- [/agents/roles/implementer/README.md](/agents/roles/implementer/README.md): implementer role contract
|
|
15
|
+
- [/agents/roles/planner/README.md](/agents/roles/planner/README.md): planner role contract
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## Delivery
|
|
2
|
+
|
|
3
|
+
Runtime delta over mode `Lead Stage Contract`:
|
|
4
|
+
|
|
5
|
+
1. Assemble delivery evidence from final stage outcomes, verification results, and approved/overridden findings.
|
|
6
|
+
2. Finalize output only when gate-approval/allowed-override conditions are satisfied.
|
|
7
|
+
3. If unresolved required rejects remain without allowed override, emit blocked status (not success).
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
## Delivery
|
|
2
|
+
|
|
3
|
+
Runtime delta over mode `Lead Stage Contract`:
|
|
4
|
+
|
|
5
|
+
1. Finalize as draft/experimental output and label it `Prototype / Not Production Ready`.
|
|
6
|
+
2. Prefer explicit prototype signaling in branch/PR metadata (for example `[Hack]` / `[Prototype]`).
|
|
7
|
+
3. Production graduation path requires rerun under `@Build` rather than silent direct merge.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## Execute (Fast)
|
|
2
|
+
|
|
3
|
+
Runtime delta over mode `Lead Stage Contract`:
|
|
4
|
+
|
|
5
|
+
1. Execute as lightweight task loop with direct-task or planned-task entries.
|
|
6
|
+
2. Permit immediate remediation chaining from accepted build-stage outcomes without planner re-entry,
|
|
7
|
+
unless scope repair is explicitly required.
|
|
8
|
+
3. Persist each accepted build-stage outcome before next dispatch.
|
|
9
|
+
4. Route escalations to [@Lead](/agents/roles/lead/role.yaml) (`arbitrator`) and stop on terminal outcomes.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## Execute (High Assurance)
|
|
2
|
+
|
|
3
|
+
Runtime delta over mode `Lead Stage Contract`:
|
|
4
|
+
|
|
5
|
+
1. Execute as per-task loop: one build-stage packet per approved plan step/remediation unit.
|
|
6
|
+
2. Persist each accepted build-stage outcome before dispatching the next task/remediation unit.
|
|
7
|
+
3. If escalation is emitted, route to [@Lead](/agents/roles/lead/role.yaml) (`arbitrator`) and block further dispatch
|
|
8
|
+
until arbitration outcome is recorded.
|
|
9
|
+
4. Stop loop on terminal abort/escalation outcomes; otherwise continue until no open tasks remain.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Investigate Flow Contracts
|
|
2
|
+
|
|
3
|
+
Shared investigation contracts keyed by `{{flow_investigate_<variant>}}`.
|
|
4
|
+
|
|
5
|
+
Investigation stays stage-owner mediated: [@Investigator](/agents/roles/investigator/role.yaml) coordinates
|
|
6
|
+
analysis runs and returns stage outcomes under runtime transition policy.
|
|
7
|
+
|
|
8
|
+
## Index
|
|
9
|
+
|
|
10
|
+
- [hooks.md](hooks.md): shared invocation/return constraints for investigation flow
|
|
11
|
+
- [/agents/roles/investigator/README.md](/agents/roles/investigator/README.md): investigator role profiles
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## Investigation Hooks (Shared Contract)
|
|
2
|
+
|
|
3
|
+
1. Treat investigation as analysis-only and stage-owner mediated.
|
|
4
|
+
2. [@Investigator](/agents/roles/investigator/role.yaml) (`init`) owns worker dispatch, synthesis, and return/terminal
|
|
5
|
+
stage outcome decisions.
|
|
6
|
+
3. [@Investigator](/agents/roles/investigator/role.yaml) (`worker`) outputs analysis only
|
|
7
|
+
(`findings/hypotheses/options`), never final compliance verdicts.
|
|
8
|
+
4. Transition-edge IDs, worker-slot configuration, invocation-source policy, and auto-edge policy are runtime
|
|
9
|
+
contracts in
|
|
10
|
+
`/integrate/input_packets/README.md` and `/integrate/README.md`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Plan Flow Contracts
|
|
2
|
+
|
|
3
|
+
Shared planning contracts keyed by `{{flow_plan_<variant>}}`.
|
|
4
|
+
|
|
5
|
+
These flows keep [@Lead](/agents/roles/lead/role.yaml) at cross-stage control and define plan-stage
|
|
6
|
+
handoff/outcome checkpoints via [@Planner](/agents/roles/planner/role.yaml).
|
|
7
|
+
|
|
8
|
+
## Index
|
|
9
|
+
|
|
10
|
+
- [build.md](build.md): high-assurance plan flow for `@Build`
|
|
11
|
+
- [hack.md](hack.md): lightweight sketch flow for `@Hack`
|
|
12
|
+
- [review.md](review.md): audit planning flow for `@Review`
|
|
13
|
+
- [/agents/roles/planner/README.md](/agents/roles/planner/README.md): planner role contract
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## Clarify & Plan (Build)
|
|
2
|
+
|
|
3
|
+
Runtime delta over mode `Lead Stage Contract`:
|
|
4
|
+
|
|
5
|
+
1. Plan sign-off gate is runtime-enforced before execution handoff.
|
|
6
|
+
2. Waiver path requires persisted waiver rationale/residual-risk notes before routing to
|
|
7
|
+
[@Implementer](/agents/roles/implementer/role.yaml) (`init`).
|
|
8
|
+
3. Planner outcomes map to transitions: `approve_plan -> execution`, `revise_plan -> planner continuation`,
|
|
9
|
+
`abort -> terminal`, escalation path -> [@Lead](/agents/roles/lead/role.yaml) (`arbitrator`).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## Sketch (Hack)
|
|
2
|
+
|
|
3
|
+
Runtime delta over mode `Lead Stage Contract`:
|
|
4
|
+
|
|
5
|
+
1. If critical-path scope is detected and the user still keeps `@Hack`, persist explicit risk acknowledgement.
|
|
6
|
+
2. Planning remains optional at runtime: trivial scope can route directly to
|
|
7
|
+
[@Implementer](/agents/roles/implementer/role.yaml) (`init`), planned scope routes to
|
|
8
|
+
[@Planner](/agents/roles/planner/role.yaml) (`init`).
|
|
9
|
+
3. Planned-path outcomes map to transitions: `approve_plan -> implementer/init`,
|
|
10
|
+
`revise_plan -> planner continuation`, `abort -> terminal`, escalation path ->
|
|
11
|
+
[@Lead](/agents/roles/lead/role.yaml) (`arbitrator`).
|
|
12
|
+
4. If stricter compliance was requested, persist selected [@Counsel](/agents/roles/counsel/role.yaml)
|
|
13
|
+
rule-set references in runtime artifacts.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## Map & Plan (Review)
|
|
2
|
+
|
|
3
|
+
Runtime delta over mode `Lead Stage Contract`:
|
|
4
|
+
|
|
5
|
+
1. Runtime triage gate decides trivial fast-path (direct audit) vs planned path.
|
|
6
|
+
2. Planned-path outcomes map to transitions: `approve_plan -> reviewer/auditor`,
|
|
7
|
+
`revise_plan -> planner continuation`, `abort -> terminal`, escalation path ->
|
|
8
|
+
[@Lead](/agents/roles/lead/role.yaml) (`arbitrator`).
|
|
9
|
+
3. When routing to [@Reviewer](/agents/roles/reviewer/role.yaml) (`auditor`), attach approved audit-plan
|
|
10
|
+
references when available.
|
package/agents/modes/README.md
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Mode specs define the canonical orchestration workflows for the LGTM workforce.
|
|
4
4
|
|
|
5
|
-
Each mode
|
|
5
|
+
Each mode defines:
|
|
6
|
+
|
|
7
|
+
- `Lead Stage Contract`: compact lead-visible handoff/outcome map injected into `lead/orchestrator`.
|
|
8
|
+
- `Workflow Contract (Runtime Reference)`: runtime sequencing reference composed from non-invocable
|
|
9
|
+
flow contracts under `agents/flows/**` using `{{flow_<family>_<variant>}}` placeholders.
|
|
6
10
|
|
|
7
11
|
## Index
|
|
8
12
|
|
package/agents/modes/build.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
# Mode: @Build
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Type: High-Assurance Engineering Workflow.
|
|
5
|
-
Brain: Uses **[@Lead](../roles/lead.md)** for arbitration and orchestration decisions.
|
|
3
|
+
## Type
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
High-Assurance Engineering Workflow.
|
|
6
|
+
|
|
7
|
+
## Brain
|
|
8
|
+
|
|
9
|
+
Uses **[@Lead](../roles/lead/role.yaml)** with profile `orchestrator` for orchestration and profile `arbitrator` for
|
|
10
|
+
dispute rulings.
|
|
11
|
+
|
|
12
|
+
## Trigger
|
|
8
13
|
|
|
9
14
|
- New Feature implementation.
|
|
10
15
|
- Refactoring critical paths (Auth, Payments, Cryptography).
|
|
@@ -13,52 +18,76 @@ Trigger:
|
|
|
13
18
|
- "Production Ready" work.
|
|
14
19
|
- (For rapid prototypes, use **[@Hack](hack.md)** instead).
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
## Safety Profile
|
|
17
22
|
|
|
18
23
|
- Strict gates (plan sign-off, verification, and panel review).
|
|
19
24
|
- Overrides allowed only with explicit risk rationale.
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
## Coordination Model
|
|
27
|
+
|
|
28
|
+
- `@Lead` (`orchestrator`) owns cross-stage decomposition, stage-owner handoff, and final synthesis.
|
|
29
|
+
- Stage owners (`planner|implementer|reviewer/auditor|investigator`) own stage-local loops and decision payloads.
|
|
30
|
+
- `@Lead` (`arbitrator`) handles disputed findings/plan decisions escalated from stage loops.
|
|
31
|
+
|
|
32
|
+
## Delegation Boundary
|
|
33
|
+
|
|
34
|
+
- `@Build` routes only across stage owners (`planner/init`, `implementer/init`, `reviewer/auditor`,
|
|
35
|
+
`investigator/init`).
|
|
36
|
+
- Stage-owner internals (worker choice, panel composition, remediation loops) stay in role contracts and runtime
|
|
37
|
+
packet policy.
|
|
22
38
|
|
|
23
|
-
|
|
24
|
-
- **Planner**: **[@Planner](../roles/planner.md)**.
|
|
25
|
-
- **Compliance**: **[@Counsel](../roles/counsel.md)**.
|
|
26
|
-
- **Researcher**: **[@Librarian](../roles/librarian.md)** (Optional).
|
|
27
|
-
- **Maker**: **[@Implementer](../roles/implementer.md)**.
|
|
28
|
-
- **Cartographer**: **[@Explorer](../roles/explorer.md)**.
|
|
29
|
-
- **Plan Reviewer**: **[@Plan-Reviewer](../roles/reviewer/plan.md)**.
|
|
30
|
-
- **Micro-Critic**: **[@Reviewer-Lite](../roles/reviewer/lite.md)**.
|
|
31
|
-
- **Critics**: **[@Reviewer](../roles/reviewer/README.md)** (Panel).
|
|
32
|
-
</Meta>
|
|
39
|
+
## Goal
|
|
33
40
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
Ship Features, Refactors, and Production Code.
|
|
42
|
+
|
|
43
|
+
## Lead Stage Contract
|
|
44
|
+
|
|
45
|
+
1. Scope with `@Explorer`; route rule selection/application through `@Counsel` when needed.
|
|
46
|
+
2. Delegate planning to `planner/init`; expect `approve_plan|revise_plan|abort|escalate` stage outcomes.
|
|
47
|
+
3. Require explicit user sign-off on approved plans unless the user explicitly waives review.
|
|
48
|
+
4. Delegate each approved task/remediation unit to `implementer/init` and consume build-stage outcomes.
|
|
49
|
+
5. Delegate the audit gate to `reviewer/auditor` and consume audit-stage outcomes.
|
|
50
|
+
6. When audit returns actionable findings, route remediation to `implementer/init` and then re-enter audit.
|
|
51
|
+
7. Route disputed findings/decisions to `lead/arbitrator` only when escalated by a stage outcome.
|
|
52
|
+
8. Invoke `investigator/init` only when a stage outcome requests investigation under runtime transition policy.
|
|
53
|
+
9. Finalize only on audit gate approval, explicit allowed override, or terminal abort.
|
|
54
|
+
|
|
55
|
+
## Output Contract
|
|
37
56
|
|
|
38
|
-
<OutputFormat>
|
|
39
57
|
**Result**: Markdown with:
|
|
40
58
|
|
|
41
59
|
- **PR/Commit**: PR URL or commit hash.
|
|
42
60
|
- **Verification**: Commands run and outcomes.
|
|
43
61
|
- **Notes**: Overrides/arbitrations (if any) and residual risk.
|
|
44
62
|
|
|
45
|
-
|
|
63
|
+
## Workflow Contract (Runtime Reference)
|
|
64
|
+
|
|
65
|
+
Runtime-owned sequencing reference for packet routing and transition policy.
|
|
66
|
+
This section is not injected as lead model context.
|
|
67
|
+
|
|
68
|
+
Follow these flow contracts in order; each role emits only role-local decisions/artifacts.
|
|
69
|
+
|
|
70
|
+
{{flow_plan_build}}
|
|
71
|
+
{{flow_build_execute_high_assurance}}
|
|
72
|
+
{{flow_audit_build_panel}}
|
|
73
|
+
{{flow_audit_build_consensus}}
|
|
74
|
+
{{flow_investigate_hooks}}
|
|
75
|
+
{{flow_build_delivery_production}}
|
|
46
76
|
|
|
47
|
-
|
|
48
|
-
{{flow_build_plan}}
|
|
49
|
-
{{flow_build_code}}
|
|
50
|
-
{{flow_build_panel}}
|
|
51
|
-
{{flow_build_panel_consensus}}
|
|
52
|
-
{{flow_build_delivery}}
|
|
77
|
+
## Constraints
|
|
53
78
|
|
|
54
|
-
|
|
79
|
+
Mode-level constraints for lead and stage owners:
|
|
55
80
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- [ ]
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
81
|
+
- [ ] Do not proceed to Phase 2 until the Plan is explicitly approved, unless the user explicitly waives review;
|
|
82
|
+
record waiver rationale before proceeding.
|
|
83
|
+
- [ ] Every code-producing implementer task MUST include explicit `Files` and `Verification`
|
|
84
|
+
(from the plan step or from `@Lead`/implementer remediation dispatch).
|
|
85
|
+
If either is missing, route to `planner/init` for repair/derivation.
|
|
86
|
+
- [ ] Assessment/disposition routing is owned by `implementer/init`; it may dispatch remediation without re-entering
|
|
87
|
+
a separate assessment role.
|
|
62
88
|
- [ ] Never skip required verification.
|
|
89
|
+
- [ ] Reviewer packets SHOULD default to scoped `Diff`/`Context Snippets`; use `Diff Command` only as fallback.
|
|
63
90
|
- [ ] Unanimous approval is required by default; any override MUST include an explicit risk rationale.
|
|
64
|
-
|
|
91
|
+
- [ ] Investigation flow is analysis-only. Implementation remains `implementer/init`; certification remains
|
|
92
|
+
reviewer/audit gates.
|
|
93
|
+
- [ ] Keep this mode contract stable; invocation-specific details belong in per-step context.
|