@kontextmind/kxm 0.6.0 → 0.7.4

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 (136) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.kxm/agents/coordinator.yaml +9 -0
  3. package/.kxm/agents/critic-arch.yaml +13 -0
  4. package/.kxm/agents/critic-cli.yaml +13 -0
  5. package/.kxm/agents/implementer.yaml +13 -0
  6. package/.kxm/gates.yaml +8 -0
  7. package/.kxm/producers.yaml +22 -0
  8. package/.kxm/project.yaml +15 -0
  9. package/.kxm/roles/writer.yaml +7 -0
  10. package/.kxm/workflows/default.yaml +47 -0
  11. package/CHANGELOG.md +39 -7
  12. package/README.md +1 -0
  13. package/docs/README.md +4 -0
  14. package/docs/agent-skills.md +121 -0
  15. package/docs/architecture.md +1 -1
  16. package/docs/assignment-runner.md +21 -8
  17. package/docs/configuration.md +11 -2
  18. package/docs/getting-started.md +21 -0
  19. package/docs/kxm-handbook.md +3 -3
  20. package/docs/operations.md +24 -0
  21. package/docs/operator-pi-packages.md +63 -0
  22. package/docs/skills/repo-work-delivery.md +107 -0
  23. package/docs/skills.md +2 -0
  24. package/docs/test-matrix.md +4 -3
  25. package/docs/troubleshooting.md +41 -1
  26. package/docs/vnext/validation.md +9 -0
  27. package/docs/webhook-workflows.md +2 -2
  28. package/examples/README.md +1 -1
  29. package/package.json +16 -17
  30. package/plugins/kxm/.claude-plugin/plugin.json +1 -1
  31. package/plugins/kxm/README.md +1 -1
  32. package/plugins/kxm/dist/cli.js +8955 -3934
  33. package/plugins/kxm/dist/core.js +271 -34
  34. package/plugins/kxm/dist/extension.js +7759 -86
  35. package/plugins/kxm/dist/mcp-server.js +75 -21
  36. package/plugins/kxm/dist/runtime.js +5637 -1125
  37. package/plugins/kxm/dist/server.js +3125 -2260
  38. package/plugins/kxm/dist/vnext-runtime-supervisor.js +5808 -565
  39. package/plugins/kxm/package.json +1 -1
  40. package/plugins/kxm/skills/SUITE.md +5 -0
  41. package/plugins/kxm/skills/hints.json +73 -0
  42. package/plugins/kxm/skills/kxm/SKILL.md +30 -83
  43. package/plugins/kxm/skills/kxm-context-memory/SKILL.md +69 -0
  44. package/plugins/kxm/skills/kxm-definitions/SKILL.md +65 -0
  45. package/plugins/kxm/skills/kxm-harness-auth/SKILL.md +34 -0
  46. package/plugins/kxm/skills/kxm-harvest/SKILL.md +48 -0
  47. package/plugins/kxm/skills/kxm-hub-ops/SKILL.md +43 -0
  48. package/plugins/kxm/skills/kxm-insights/SKILL.md +48 -0
  49. package/plugins/kxm/skills/kxm-mind/SKILL.md +59 -0
  50. package/plugins/kxm/skills/kxm-peer/SKILL.md +110 -0
  51. package/plugins/kxm/skills/kxm-project-setup/SKILL.md +42 -0
  52. package/plugins/kxm/skills/kxm-projects/SKILL.md +43 -0
  53. package/plugins/kxm/skills/kxm-protocol/SKILL.md +66 -0
  54. package/plugins/kxm/skills/kxm-query/SKILL.md +45 -0
  55. package/plugins/kxm/skills/kxm-routing-improve/SKILL.md +30 -0
  56. package/plugins/kxm/skills/kxm-runs/SKILL.md +29 -0
  57. package/plugins/kxm/skills/kxm-setup/SKILL.md +55 -0
  58. package/plugins/kxm/skills/kxm-skill-lifecycle/SKILL.md +31 -0
  59. package/plugins/kxm/skills/kxm-tasks/SKILL.md +33 -0
  60. package/plugins/kxm/skills/kxm-triage/SKILL.md +47 -0
  61. package/plugins/kxm/skills/kxm-work/SKILL.md +44 -0
  62. package/plugins/kxm/skills/kxm-workflow/SKILL.md +45 -0
  63. package/plugins/kxm/src/autocomplete.ts +9 -3
  64. package/plugins/kxm/src/cli.ts +1637 -73
  65. package/plugins/kxm/src/commands.ts +150 -8
  66. package/plugins/kxm/src/completion-install.ts +223 -0
  67. package/plugins/kxm/src/config.ts +7 -4
  68. package/plugins/kxm/src/context-packet.ts +172 -0
  69. package/plugins/kxm/src/database.ts +1 -1
  70. package/plugins/kxm/src/extension.ts +36 -1
  71. package/plugins/kxm/src/external-effects.ts +357 -8
  72. package/plugins/kxm/src/hub-env.ts +193 -0
  73. package/plugins/kxm/src/hub.ts +2 -4
  74. package/plugins/kxm/src/improve.ts +72 -0
  75. package/plugins/kxm/src/init-guide-setup.ts +547 -0
  76. package/plugins/kxm/src/local-snapshot.ts +1 -1
  77. package/plugins/kxm/src/mcp-server.ts +1 -1
  78. package/plugins/kxm/src/model-inventory.ts +127 -0
  79. package/plugins/kxm/src/policy-draft.d.mts +55 -0
  80. package/plugins/kxm/src/policy-draft.mjs +565 -0
  81. package/plugins/kxm/src/price-calc.ts +17 -18
  82. package/plugins/kxm/src/prices.ts +32 -16
  83. package/plugins/kxm/src/producers.ts +71 -0
  84. package/plugins/kxm/src/protocol.ts +111 -0
  85. package/plugins/kxm/src/restricted-yaml.d.mts +31 -0
  86. package/plugins/kxm/src/restricted-yaml.mjs +145 -0
  87. package/plugins/kxm/src/role.ts +710 -0
  88. package/plugins/kxm/src/routing.ts +99 -1
  89. package/plugins/kxm/src/safety-integrity.ts +76 -0
  90. package/plugins/kxm/src/session-work.ts +9 -2
  91. package/plugins/kxm/src/sqlite.ts +76 -0
  92. package/plugins/kxm/src/store.ts +1 -1
  93. package/plugins/kxm/src/studio-layout.ts +660 -17
  94. package/plugins/kxm/src/suggest.ts +7 -13
  95. package/plugins/kxm/src/telemetry.ts +82 -0
  96. package/plugins/kxm/src/tui.ts +140 -0
  97. package/plugins/kxm/src/vnext-bindings.ts +1 -1
  98. package/plugins/kxm/src/vnext-config.ts +53 -111
  99. package/plugins/kxm/src/vnext-engine-command.ts +2 -0
  100. package/plugins/kxm/src/vnext-engine.ts +214 -62
  101. package/plugins/kxm/src/vnext-harness.ts +267 -83
  102. package/plugins/kxm/src/vnext-oneshot-evidence.ts +85 -0
  103. package/plugins/kxm/src/vnext-oneshot-process.ts +166 -0
  104. package/plugins/kxm/src/vnext-oneshot-producer.ts +179 -224
  105. package/plugins/kxm/src/vnext-runtime-store.ts +36 -2
  106. package/plugins/kxm/src/vnext-runtime-supervisor.ts +120 -5
  107. package/plugins/kxm/src/vnext-runtime.ts +14 -0
  108. package/plugins/kxm/src/workflow-manager.ts +392 -0
  109. package/plugins/kxm/src/workflow-tui.ts +255 -0
  110. package/plugins/kxm/src/workflow.ts +144 -0
  111. package/schemas/policy-draft/README.md +17 -0
  112. package/schemas/policy-draft/model.v2.schema.json +140 -0
  113. package/schemas/policy-draft/role.v2.schema.json +91 -0
  114. package/schemas/vnext/role.schema.json +76 -0
  115. package/schemas/vnext/run-event.schema.json +1 -0
  116. package/scripts/assignment-run.d.mts +1 -1
  117. package/scripts/assignment-run.mjs +44 -35
  118. package/scripts/check-generated.mjs +33 -9
  119. package/scripts/emit-codex-artifacts.mjs +255 -11
  120. package/scripts/harness-run.d.mts +12 -4
  121. package/scripts/harness-run.mjs +65 -17
  122. package/scripts/kxm-bump-version.mjs +146 -0
  123. package/scripts/kxm-hub.mjs +150 -2
  124. package/scripts/kxm-publish-npm.mjs +3 -1
  125. package/scripts/kxm-release-github.mjs +3 -1
  126. package/scripts/kxm.mjs +0 -0
  127. package/scripts/native-critic.d.mts +5 -0
  128. package/scripts/native-critic.mjs +60 -0
  129. package/.kxm/config/README.md +0 -5
  130. package/.kxm/config/agents.json +0 -43
  131. package/.kxm/config/env.example +0 -56
  132. package/.kxm/config/update.example.yaml +0 -9
  133. package/.kxm/config/workflows/fix.json +0 -160
  134. package/.kxm/config/workflows/jira-development.json +0 -116
  135. package/.kxm/config/workflows/provenance-quorum.json +0 -150
  136. package/.kxm/config/workflows/v04-dogfood.json +0 -72
@@ -1,116 +0,0 @@
1
- [
2
- {
3
- "id": "jira-development",
4
- "source": "jira",
5
- "project": "product",
6
- "target": "coordinator",
7
- "secretEnv": "JIRA_WEBHOOK_SECRET",
8
- "signalSecretEnv": "WORKFLOW_SIGNAL_SECRET",
9
- "event": "jira:issue_updated",
10
- "filter": {
11
- "path": "issue.fields.status.name",
12
- "equals": "In Progress"
13
- },
14
- "delivery": "followUp",
15
- "ttlMs": 604800000,
16
- "promptTemplate": "Take ownership of Jira issue {{issue.key}} — {{issue.fields.summary}}.\n\nDescription:\n{{issue.fields.description}}\n\nIssue URL: {{issue.self}}\n\nUse the kxm workflow tools as the durable record. Preserve Jira issue {{issue.key}} as the correlation key. Only perform push, merge, or Jira mutations when the current harness permissions and repository policy authorize them.",
17
- "stages": [
18
- {
19
- "id": "intake",
20
- "area": "workflow",
21
- "label": "Intake and ownership",
22
- "instructions": "Validate the webhook context, repository, scope, permissions, and acceptance criteria. Confirm that the issue is actually In Progress.",
23
- "requiredEvidence": ["issue key", "acceptance criteria", "repository and branch", "authorization boundary"],
24
- "maxAttempts": 2
25
- },
26
- {
27
- "id": "reproduce",
28
- "area": "implementation",
29
- "label": "Reproduce the issue",
30
- "instructions": "Reproduce the defect before changing production code. Prefer a deterministic failing automated test and capture environment details.",
31
- "requiredEvidence": ["reproduction steps", "observed failure", "expected behavior", "failing test or diagnostic artifact"],
32
- "maxAttempts": 3
33
- },
34
- {
35
- "id": "plan-moa",
36
- "area": "workflow",
37
- "label": "Plan with single-agent or three-agent mixture of agents",
38
- "instructions": "For simple work, produce one plan. For ambiguous or high-risk work, ask three strong planning peers independently, compare assumptions and tradeoffs, record contradictions, and synthesize the best evidence-backed plan.",
39
- "requiredEvidence": ["candidate plans", "contradictions and resolutions", "selected plan", "ownership boundaries"],
40
- "maxAttempts": 3
41
- },
42
- {
43
- "id": "plan-review",
44
- "area": "workflow",
45
- "label": "Review the plan",
46
- "instructions": "Have an independent reviewer challenge correctness, security, migration, test, and rollback assumptions. Revise the plan when findings are material.",
47
- "requiredEvidence": ["review findings", "accepted and rejected feedback", "revised plan"],
48
- "maxAttempts": 3
49
- },
50
- {
51
- "id": "implementation",
52
- "area": "implementation",
53
- "label": "Implementation",
54
- "instructions": "Implement the reviewed plan with explicit file ownership. Keep changes focused and preserve unrelated user work.",
55
- "requiredEvidence": ["changed paths", "implementation decisions", "tests added or updated"],
56
- "maxAttempts": 3
57
- },
58
- {
59
- "id": "local-gates",
60
- "area": "gates",
61
- "label": "Local code checks",
62
- "instructions": "Run the repository-defined lint, build/typecheck, security scan, and Playwright suite. A warning or failure must be recorded, corrected, and rerun; do not downgrade a gate silently.",
63
- "requiredEvidence": ["lint result", "build or typecheck result", "security result", "Playwright result"],
64
- "maxAttempts": 5
65
- },
66
- {
67
- "id": "repository-gates",
68
- "area": "gates",
69
- "label": "Repository and CodeRabbit gates",
70
- "instructions": "Reproduce required repository checks locally where possible. Address CodeRabbit or equivalent review findings by evidence and rerun affected gates.",
71
- "requiredEvidence": ["repository gate results", "review findings", "resolutions or justified dismissals"],
72
- "maxAttempts": 5
73
- },
74
- {
75
- "id": "documentation",
76
- "area": "documentation",
77
- "label": "Documentation",
78
- "instructions": "Update user, operator, architecture, changelog, and test-matrix material affected by the change.",
79
- "requiredEvidence": ["documentation paths", "behavior and operational changes", "examples updated"],
80
- "maxAttempts": 3
81
- },
82
- {
83
- "id": "push-watch",
84
- "area": "gates",
85
- "label": "Push, open review, and watch",
86
- "instructions": "When authorized, push the branch and open or update the review. Call kxm_workflow_wait with commit, pull-request, and resolved-warning evidence, then watch the example `ci` check with `kxm gate github watch --run-id <id> --stage-id push-watch --signal-key <key> --repo <owner/name> --pr <n> --required ci` so the durable wait receives exact `github.check:ci` evidence. Replace `ci` in this template and command with the repository's real required check names. Record every warning or failure, fix it, push again, and continue watching until required checks pass.",
87
- "requiredEvidence": ["commit", "pull request", "resolved warnings and failures", "github.check:ci"],
88
- "maxAttempts": 10
89
- },
90
- {
91
- "id": "merge",
92
- "area": "security",
93
- "label": "Merge",
94
- "instructions": "Merge only when approvals, required checks, branch policy, and user authorization permit it. Capture the resulting merge commit.",
95
- "requiredEvidence": ["approval state", "required checks", "merge commit"],
96
- "maxAttempts": 3
97
- },
98
- {
99
- "id": "jira-update",
100
- "area": "workflow",
101
- "label": "Update Jira",
102
- "instructions": "Update the Jira issue through an authorized integration with the outcome, implementation and test evidence, pull request, merge commit, and any follow-up risk. Transition it according to team policy.",
103
- "requiredEvidence": ["Jira transition", "Jira comment or fields", "links to pull request and merge"],
104
- "maxAttempts": 3
105
- },
106
- {
107
- "id": "retrospective",
108
- "area": "workflow",
109
- "label": "Continuous-improvement retrospective",
110
- "instructions": "Review the run journal. Turn recurring errors, contradictions, delays, flaky gates, and harness friction into an evidence-linked improvement backlog. Do not apply policy changes automatically.",
111
- "requiredEvidence": ["lessons by area", "prioritized improvements", "owner or next action", "success measure"],
112
- "maxAttempts": 3
113
- }
114
- ]
115
- }
116
- ]
@@ -1,150 +0,0 @@
1
- [
2
- {
3
- "id": "kxm-provenance",
4
- "source": "generic",
5
- "project": "kxm-provenance",
6
- "target": "provenance-coordinator",
7
- "secretEnv": "KXM_V04_WORKFLOW_SECRET",
8
- "signalSecretEnv": "KXM_V04_SIGNAL_SECRET",
9
- "event": "extension.provenance_requested",
10
- "delivery": "followUp",
11
- "ttlMs": 604800000,
12
- "promptTemplate": "Deliver issue {{issue}} for {{repository}}: provenance-bound peer evidence and quorum workflow gates.\n\nIssue URL: {{issueUrl}}\nProject board: {{projectBoard}}\n\nYou are the sole code writer. Ask provenance-grok and provenance-gemini independently for research, plans, and final review through pi-mesh. Bind every claimed peer result to its durable message ID in the run record. Record plans, decisions, contradictions, errors, and lessons under .kxm. Keep the issue and project board current. The user authorizes branch-local implementation, tests, documentation, commits, pushes, pull requests, CI monitoring, and merge only after all required checks and independent review pass. Preserve backward compatibility and never claim exactly-once execution.",
13
- "stages": [
14
- {
15
- "id": "research",
16
- "area": "workflow",
17
- "label": "Independent research",
18
- "instructions": "Ask provenance-grok and provenance-gemini independently to analyze issue 22 and the current workflow, message, persistence, CLI, MCP, retrospective, and migration contracts. Send each request with workflowContext for this run, research stage, the matching required-evidence key, and the current one-based attempt. At checkpoint, cite the replied message IDs through evidenceRefs. Capture agreements, contradictions, threat cases, and acceptance criteria in a research synthesis under .kxm/assets.",
19
- "requiredEvidence": [
20
- "Grok message ID and replied result",
21
- "Gemini message ID and replied result",
22
- "current-state trace",
23
- "contradictions and resolutions",
24
- "acceptance criteria"
25
- ],
26
- "evidencePolicies": {
27
- "Grok message ID and replied result": {
28
- "kind": "peer-reply",
29
- "minProducers": 1,
30
- "eligibleAgents": ["provenance-grok"],
31
- "acceptedStatuses": ["replied"]
32
- },
33
- "Gemini message ID and replied result": {
34
- "kind": "peer-reply",
35
- "minProducers": 1,
36
- "eligibleAgents": ["provenance-gemini"],
37
- "acceptedStatuses": ["replied"]
38
- }
39
- },
40
- "maxAttempts": 3
41
- },
42
- {
43
- "id": "plan",
44
- "area": "workflow",
45
- "label": "Reviewed architecture plan",
46
- "instructions": "Ask both peers for independent implementation plans using one shared workflowContext bound to this run, plan stage, the independent-plan-message-IDs requirement, and the current attempt. Synthesize a backward-compatible schema for evidence type, producer identity or role, quorum, terminal state, message binding, and explicit degraded policy. Define persistence and migration, validation boundaries, all affected interfaces, tests, documentation, rollout, and rollback. Cite both replied message IDs through evidenceRefs.",
47
- "requiredEvidence": [
48
- "independent plan message IDs",
49
- "selected schema and invariants",
50
- "migration and compatibility",
51
- "security boundaries",
52
- "test and rollout plan"
53
- ],
54
- "evidencePolicies": {
55
- "independent plan message IDs": {
56
- "kind": "peer-reply",
57
- "minProducers": 2,
58
- "eligibleAgents": ["provenance-grok", "provenance-gemini"],
59
- "acceptedStatuses": ["replied"]
60
- }
61
- },
62
- "maxAttempts": 3
63
- },
64
- {
65
- "id": "implement",
66
- "area": "implementation",
67
- "label": "Implementation",
68
- "instructions": "Implement the reviewed plan as the sole writer. Verify peer evidence against durable hub state and unique producers. Pending, expired, cancelled, duplicated, wrong-run, wrong-stage, or coordinator-authored substitute evidence must not satisfy a peer quorum. Permit degradation only through an explicit journaled policy branch. Preserve readable legacy string evidence and keep Pi, MCP, webhook, CLI, retrospective, documentation, and generated bundles aligned.",
69
- "requiredEvidence": [
70
- "changed paths",
71
- "schema and migration",
72
- "verification logic",
73
- "interface parity",
74
- "tests and documentation"
75
- ],
76
- "maxAttempts": 6
77
- },
78
- {
79
- "id": "local-gates",
80
- "area": "gates",
81
- "label": "Complete local gates",
82
- "instructions": "Run the complete repository validation gate, generated-artifact check, strict Claude marketplace validation, package inspection, and isolated packed CLI/hub smoke on supported Node engines. Record and resolve every warning or failure.",
83
- "requiredEvidence": [
84
- "test and coverage results",
85
- "typecheck and docs lint",
86
- "generated artifacts",
87
- "Claude validation",
88
- "package and engine smoke"
89
- ],
90
- "maxAttempts": 5
91
- },
92
- {
93
- "id": "review",
94
- "area": "gates",
95
- "label": "Independent implementation review",
96
- "instructions": "Give Grok and Gemini the actual diff and ask them independently to review provenance integrity, authorization, uniqueness, correlation, migration, degradation visibility, interface parity, tests, portability, and documentation. Send each request with workflowContext bound to this run, review stage, its matching review requirement, and the current attempt; cite both replied message IDs through evidenceRefs. Resolve every material finding and rerun affected gates.",
97
- "requiredEvidence": [
98
- "Grok review message ID",
99
- "Gemini review message ID",
100
- "accepted and rejected findings",
101
- "resolved findings",
102
- "rerun gates"
103
- ],
104
- "evidencePolicies": {
105
- "Grok review message ID": {
106
- "kind": "peer-reply",
107
- "minProducers": 1,
108
- "eligibleAgents": ["provenance-grok"],
109
- "acceptedStatuses": ["replied"]
110
- },
111
- "Gemini review message ID": {
112
- "kind": "peer-reply",
113
- "minProducers": 1,
114
- "eligibleAgents": ["provenance-gemini"],
115
- "acceptedStatuses": ["replied"]
116
- }
117
- },
118
- "maxAttempts": 5
119
- },
120
- {
121
- "id": "delivery",
122
- "area": "gates",
123
- "label": "Deliver and watch",
124
- "instructions": "Commit and push the reviewed increment, open a pull request closing issue 22, add it to Project 3, and watch every required GitHub check. Merge only when all required checks pass and the evidence verifier confirms the independent-review quorum.",
125
- "requiredEvidence": [
126
- "commit",
127
- "pull request",
128
- "green required checks",
129
- "verified peer quorum",
130
- "merge and project status"
131
- ],
132
- "maxAttempts": 5
133
- },
134
- {
135
- "id": "retrospective",
136
- "area": "workflow",
137
- "label": "Continuous-improvement retrospective",
138
- "instructions": "Export and review the durable retrospective. Record timing, contradictions, errors, degraded paths, manual interventions, and measurable follow-ups. Separate verified peer evidence from coordinator synthesis and do not silently promote proposed policy.",
139
- "requiredEvidence": [
140
- "retrospective Markdown",
141
- "retrospective JSON",
142
- "evidence provenance audit",
143
- "review decision",
144
- "remaining backlog"
145
- ],
146
- "maxAttempts": 3
147
- }
148
- ]
149
- }
150
- ]
@@ -1,72 +0,0 @@
1
- [
2
- {
3
- "id": "kxm-v04",
4
- "source": "generic",
5
- "project": "kxm-v04",
6
- "target": "coordinator",
7
- "secretEnv": "KXM_V04_WORKFLOW_SECRET",
8
- "signalSecretEnv": "KXM_V04_SIGNAL_SECRET",
9
- "event": "extension.v04_requested",
10
- "delivery": "followUp",
11
- "ttlMs": 604800000,
12
- "promptTemplate": "Deliver the dogfood-driven v0.4 increment for {{repository}}.\n\nIssues: {{issues}}\nProject board: {{projectBoard}}\n\nYou are the sole code writer. Use grok-researcher and gemini-reviewer for independent research, planning, and review. Use the mesh workflow tools as the durable execution record. Record plans, decisions, contradictions, errors, and lessons. Keep GitHub issues and the project board current. The user authorizes branch creation, commits, pushes, pull requests, CI monitoring, and merge only after required checks pass. Never expose credentials, raw private prompts, or unrestricted model output. Preserve explicit authorization boundaries for third-party mutations performed by future workflows.",
13
- "stages": [
14
- {
15
- "id": "research",
16
- "area": "workflow",
17
- "label": "Research",
18
- "instructions": "Ask both peers independently to analyze issues 5, 6, 10, 11, 12, and 13. Inspect the existing implementation and dogfood logs. Identify root causes, portability and security risks, compatible CLI patterns, recovery semantics, GitHub signal behavior, retrospective redaction, and a practical real-Pi smoke topology. Record disagreements and write a research synthesis under .kxm/assets.",
19
- "requiredEvidence": ["independent Grok research", "independent Gemini research", "dogfood evidence", "contradictions and resolutions", "acceptance criteria"],
20
- "maxAttempts": 3
21
- },
22
- {
23
- "id": "plan",
24
- "area": "workflow",
25
- "label": "Plan",
26
- "instructions": "Ask both peers for independent production plans, then synthesize one architecture and rollout plan. Keep scope bounded and backward compatible. Define command contracts, safe diagnostic taxonomy, interrupted-tool recovery envelope, retrospective schemas, GitHub watcher semantics, cross-platform process behavior, tests, documentation, migrations, and rollback. Update all six issues with the selected plan.",
27
- "requiredEvidence": ["independent plans", "selected architecture", "security boundaries", "file ownership", "test and rollout plan"],
28
- "maxAttempts": 3
29
- },
30
- {
31
- "id": "implement",
32
- "area": "implementation",
33
- "label": "Implement",
34
- "instructions": "Implement the reviewed plan as the sole writer. Prefer composable commands over hidden automation. Keep all workspace material under .kxm, produce bounded machine-readable output, preserve secret redaction, and require explicit authority for external mutations. Add deterministic tests for every command, diagnostic, recovery transition, export, and GitHub signal state. Add an opt-in real-Pi smoke harness without making model downloads or credentials part of ordinary CI.",
35
- "requiredEvidence": ["changed paths", "command examples", "security tests", "recovery tests", "GitHub adapter tests", "retrospective snapshots", "multi-Pi smoke harness"],
36
- "maxAttempts": 6
37
- },
38
- {
39
- "id": "local-gates",
40
- "area": "gates",
41
- "label": "Local gates",
42
- "instructions": "Run npm ci and the complete repository validation gate, including coverage thresholds, strict typecheck, documentation lint, version consistency, package inspection, and Claude manifest validation. Run command examples in isolated temporary workspaces. Record and fix every warning or failure, then rerun affected gates.",
43
- "requiredEvidence": ["clean install", "test and coverage results", "typecheck", "documentation lint", "package dry-run", "manifest validation", "isolated command smoke"],
44
- "maxAttempts": 5
45
- },
46
- {
47
- "id": "review",
48
- "area": "gates",
49
- "label": "Independent review",
50
- "instructions": "Have Grok and Gemini independently review the actual diff for correctness, security, portability, recovery durability, command usability, GitHub idempotency, redaction, test quality, documentation, and upgrade compatibility. Resolve every material finding and rerun affected gates.",
51
- "requiredEvidence": ["independent Grok review", "independent Gemini review", "accepted and rejected findings", "resolved findings", "rerun gates"],
52
- "maxAttempts": 5
53
- },
54
- {
55
- "id": "delivery",
56
- "area": "gates",
57
- "label": "Deliver and watch",
58
- "instructions": "Commit and push the reviewed increment, open a pull request that links all six issues, and watch required GitHub checks. Use the GitHub signal adapter when available. Merge only when required checks are green, update project status, and leave infrastructure-dependent smoke work open if no labeled real-Pi runner is configured.",
59
- "requiredEvidence": ["commit", "pull request", "green required checks", "merge or explicit blocker", "project status"],
60
- "maxAttempts": 5
61
- },
62
- {
63
- "id": "retrospective",
64
- "area": "workflow",
65
- "label": "Retrospective",
66
- "instructions": "Export and review the durable run retrospective. Record recurring errors, unresolved contradictions, manual interventions, timing, and measurable follow-up actions. Do not silently turn proposed improvements into policy.",
67
- "requiredEvidence": ["retrospective Markdown", "retrospective JSON", "review decision", "remaining backlog"],
68
- "maxAttempts": 3
69
- }
70
- ]
71
- }
72
- ]