@aopslabs/aops 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/LICENSE +19 -0
  2. package/NOTICE +7 -0
  3. package/README.md +203 -0
  4. package/assets/agent-assets/core/SKILL.md +49 -0
  5. package/assets/agent-assets/core/references/agentspace/SKILL.md +78 -0
  6. package/assets/agent-assets/core/references/aops-cli-core/SKILL.md +108 -0
  7. package/assets/agent-assets/core/references/chatv3/SKILL.md +48 -0
  8. package/assets/agent-assets/core/references/collaborative-work/SKILL.md +85 -0
  9. package/assets/agent-assets/core/references/discuss/SKILL.md +66 -0
  10. package/assets/agent-assets/core/references/docman/SKILL.md +69 -0
  11. package/assets/agent-assets/core/references/hosted-chat/SKILL.md +64 -0
  12. package/assets/agent-assets/core/references/mission/SKILL.md +54 -0
  13. package/assets/agent-assets/core/references/projectman/SKILL.md +86 -0
  14. package/assets/agent-assets/core/references/sys/SKILL.md +36 -0
  15. package/assets/agent-assets/core/references/view/SKILL.md +58 -0
  16. package/assets/agent-assets/core/references/working-disciplines/SKILL.md +69 -0
  17. package/assets/agent-assets/core/user-guides/agent-assets.md +81 -0
  18. package/assets/agent-assets/core/user-guides/agentspace.md +1098 -0
  19. package/assets/agent-assets/core/user-guides/aops-cli.md +1107 -0
  20. package/assets/agent-assets/core/user-guides/aops-system.md +63 -0
  21. package/assets/agent-assets/core/user-guides/chatv3.md +113 -0
  22. package/assets/agent-assets/core/user-guides/docman.md +162 -0
  23. package/assets/agent-assets/core/user-guides/projectman.md +212 -0
  24. package/assets/agent-assets/core/user-guides/sys.md +94 -0
  25. package/assets/agent-assets/core/user-guides/working-disciplines.md +588 -0
  26. package/assets/agent-assets/gateway/aops/SKILL.md +14 -0
  27. package/assets/r6-remote-session-baseline.json +19 -0
  28. package/assets/skills/aops-install/SKILL.md +231 -0
  29. package/assets/skills/aops-install/agents/openai.yaml +4 -0
  30. package/dist/commands/activity.js +352 -0
  31. package/dist/commands/agent-profile.js +653 -0
  32. package/dist/commands/agent.js +710 -0
  33. package/dist/commands/agents-md.js +125 -0
  34. package/dist/commands/api.js +84 -0
  35. package/dist/commands/archive.js +873 -0
  36. package/dist/commands/artifact.js +535 -0
  37. package/dist/commands/assets.js +1414 -0
  38. package/dist/commands/auth/device-login.js +1 -0
  39. package/dist/commands/auth/legacy-export.js +177 -0
  40. package/dist/commands/auth/login.js +426 -0
  41. package/dist/commands/chat.js +1363 -0
  42. package/dist/commands/chatv3.js +1684 -0
  43. package/dist/commands/checkpoint.js +549 -0
  44. package/dist/commands/commercial-artifact.js +475 -0
  45. package/dist/commands/commercial-license.js +594 -0
  46. package/dist/commands/community-auth.js +62 -0
  47. package/dist/commands/community-cockpit.js +185 -0
  48. package/dist/commands/community-console.js +109 -0
  49. package/dist/commands/community-doctor.js +335 -0
  50. package/dist/commands/community-server.js +2062 -0
  51. package/dist/commands/community-setup.js +284 -0
  52. package/dist/commands/discuss.js +1448 -0
  53. package/dist/commands/doc.js +5219 -0
  54. package/dist/commands/experience.js +922 -0
  55. package/dist/commands/host.js +1127 -0
  56. package/dist/commands/init.js +118 -0
  57. package/dist/commands/memory.js +3129 -0
  58. package/dist/commands/mission.js +562 -0
  59. package/dist/commands/official-catalog.js +134 -0
  60. package/dist/commands/plan.js +84 -0
  61. package/dist/commands/playbook.js +415 -0
  62. package/dist/commands/pm/context.js +6 -0
  63. package/dist/commands/pm/index.js +701 -0
  64. package/dist/commands/pm/projectman.js +6266 -0
  65. package/dist/commands/project.js +1080 -0
  66. package/dist/commands/prompt.js +1024 -0
  67. package/dist/commands/repo-sync.js +1907 -0
  68. package/dist/commands/resource.js +527 -0
  69. package/dist/commands/skill.js +1211 -0
  70. package/dist/commands/start-disciplines.js +510 -0
  71. package/dist/commands/start.js +1343 -0
  72. package/dist/commands/target.js +309 -0
  73. package/dist/commands/version.js +42 -0
  74. package/dist/commands/view.js +1852 -0
  75. package/dist/launchers/cockpit.js +28 -0
  76. package/dist/launchers/options.js +74 -0
  77. package/dist/launchers/server.js +41 -0
  78. package/dist/lib/agent-assets/envelope.js +83 -0
  79. package/dist/lib/agent-assets/gateway.js +15 -0
  80. package/dist/lib/agent-assets/guards.js +23 -0
  81. package/dist/lib/agent-assets/hosted-discovery.js +148 -0
  82. package/dist/lib/agent-assets/hosted-package-input.js +154 -0
  83. package/dist/lib/agent-assets/legacy-pointer-migration.js +677 -0
  84. package/dist/lib/agent-assets/native-fs.js +589 -0
  85. package/dist/lib/agent-assets/package-manifest.js +324 -0
  86. package/dist/lib/agent-assets/portable-path.js +67 -0
  87. package/dist/lib/agent-assets/release-input.js +177 -0
  88. package/dist/lib/agent-assets/roots.js +45 -0
  89. package/dist/lib/agent-assets/runtime-binding-reader.js +545 -0
  90. package/dist/lib/agent-assets/runtime-targets.js +50 -0
  91. package/dist/lib/agent-assets/store-reader.js +1212 -0
  92. package/dist/lib/agent-assets/store-types.js +1 -0
  93. package/dist/lib/agent-assets/store-writer.js +1484 -0
  94. package/dist/lib/agent-assets/types.js +1 -0
  95. package/dist/lib/agent-assets/unicode-case-folding-v15-1.generated.js +1548 -0
  96. package/dist/lib/commercial-final-readiness.js +504 -0
  97. package/dist/lib/commercial-lifecycle-smoke-isolation.js +236 -0
  98. package/dist/lib/commercial-managed-postgres-docker-adapter.js +274 -0
  99. package/dist/lib/commercial-setup-readiness-adapter.js +179 -0
  100. package/dist/lib/community-client-contract.js +164 -0
  101. package/dist/lib/community-cockpit-lifecycle.js +601 -0
  102. package/dist/lib/community-command-abort.js +59 -0
  103. package/dist/lib/community-diagnostic.js +237 -0
  104. package/dist/lib/community-docker-adapter.js +498 -0
  105. package/dist/lib/community-home.js +31 -0
  106. package/dist/lib/community-instance-contract.js +148 -0
  107. package/dist/lib/community-instance-layout.js +97 -0
  108. package/dist/lib/community-lifecycle.js +1631 -0
  109. package/dist/lib/community-migration-snapshot.js +770 -0
  110. package/dist/lib/community-native-application-recovery.js +425 -0
  111. package/dist/lib/community-native-child.js +240 -0
  112. package/dist/lib/community-native-database-recovery.js +456 -0
  113. package/dist/lib/community-native-lifecycle.js +2458 -0
  114. package/dist/lib/community-native-migration.js +339 -0
  115. package/dist/lib/community-native-postgres.js +596 -0
  116. package/dist/lib/community-operation-journal.js +773 -0
  117. package/dist/lib/community-operation-lock.js +596 -0
  118. package/dist/lib/community-release-resolver.js +291 -0
  119. package/dist/lib/community-release-verifier.js +475 -0
  120. package/dist/lib/community-repo-discovery.js +252 -0
  121. package/dist/lib/community-setup-server-env.js +203 -0
  122. package/dist/lib/external-url.js +110 -0
  123. package/dist/lib/official-catalog-gateway.js +108 -0
  124. package/dist/lib/official-catalog.js +364 -0
  125. package/dist/lib/server-bootstrap.js +240 -0
  126. package/dist/lib/setup-agent-assets-bridge.js +176 -0
  127. package/dist/lib/setup-agent-assets-release.js +52 -0
  128. package/dist/lib/setup-external-postgres.js +108 -0
  129. package/dist/lib/setup-init-orchestrator.js +990 -0
  130. package/dist/lib/setup-install-guide.js +52 -0
  131. package/dist/lib/setup-installer-release.js +47 -0
  132. package/dist/lib/setup-local-postgres.js +329 -0
  133. package/dist/lib/setup-official-catalog-bridge.js +148 -0
  134. package/dist/lib/setup-readiness.js +888 -0
  135. package/dist/lib/tui-launcher.js +59 -0
  136. package/dist/main.js +150 -0
  137. package/dist/seeds/agents-md.js +54 -0
  138. package/dist/utils/agent-gateway.js +275 -0
  139. package/dist/utils/agents-md.js +281 -0
  140. package/dist/utils/api.js +255 -0
  141. package/dist/utils/chatv3-session-store.js +185 -0
  142. package/dist/utils/command.js +67 -0
  143. package/dist/utils/community-host-runtime.js +376 -0
  144. package/dist/utils/config.js +1015 -0
  145. package/dist/utils/discussion-workspace.js +552 -0
  146. package/dist/utils/experience-workspace.js +326 -0
  147. package/dist/utils/guide-paths.js +67 -0
  148. package/dist/utils/hosted-sugar.js +56 -0
  149. package/dist/utils/hosted-workspace.js +229 -0
  150. package/dist/utils/memory-workspace.js +537 -0
  151. package/dist/utils/operator-runtime.js +199 -0
  152. package/dist/utils/password-crypto.js +39 -0
  153. package/dist/utils/playbook-workspace.js +479 -0
  154. package/dist/utils/project-context.js +255 -0
  155. package/dist/utils/prompts.js +70 -0
  156. package/dist/utils/refresh-race.js +28 -0
  157. package/dist/utils/repo-config.js +109 -0
  158. package/dist/utils/repo-first-projectman.js +194 -0
  159. package/dist/utils/repo-first-storage.js +13 -0
  160. package/dist/utils/repo-first-view.js +305 -0
  161. package/dist/utils/session-guidance.js +278 -0
  162. package/dist/utils/session-state.js +137 -0
  163. package/dist/utils/table.js +39 -0
  164. package/dist/utils/transient-fs.js +49 -0
  165. package/dist/utils/workspace-root.js +1 -0
  166. package/launchers/aops-cockpit.ps1 +15 -0
  167. package/launchers/aops-cockpit.sh +16 -0
  168. package/launchers/aops-server.ps1 +15 -0
  169. package/launchers/aops-server.sh +16 -0
  170. package/native/tui/win32-x64/aops-tui.exe +0 -0
  171. package/package.json +81 -0
@@ -0,0 +1,510 @@
1
+ export const START_DISCIPLINES = ['solo-pm-loop', 'build-review-chat', 'design-first-consensus', 'coordinator-loop'];
2
+ export const START_DISCIPLINE_SIGNAL_MAPPING = [
3
+ {
4
+ signal: 'decisionUncertainty',
5
+ matches: 'high',
6
+ discipline: 'design-first-consensus',
7
+ reason: 'material design uncertainty needs final stances and operator approval before implementation',
8
+ },
9
+ {
10
+ signal: 'operatorInterface',
11
+ matches: 'delegated',
12
+ discipline: 'coordinator-loop',
13
+ reason: 'operator delegates the session to one coordinator agent that directs implementer agents',
14
+ },
15
+ {
16
+ signal: 'mode',
17
+ matches: 'chat-room',
18
+ discipline: 'build-review-chat',
19
+ reason: 'chat-room is coordination transport for live implementer/reviewer work',
20
+ },
21
+ {
22
+ signal: 'agentCount',
23
+ matches: '>1',
24
+ discipline: 'build-review-chat',
25
+ reason: 'more than one active agent needs per-slice PM review gates and chat wakes',
26
+ },
27
+ {
28
+ signal: 'workSize+decisionUncertainty',
29
+ matches: 'large+medium',
30
+ discipline: 'design-first-consensus',
31
+ reason: 'large work with non-trivial uncertainty should settle the design before coding',
32
+ },
33
+ {
34
+ signal: 'default',
35
+ matches: 'otherwise',
36
+ discipline: 'solo-pm-loop',
37
+ reason: 'single-agent or low-uncertainty work can iterate through PM and memory without live review',
38
+ },
39
+ ];
40
+ export const START_GUARDRAIL_REGISTRY = [
41
+ {
42
+ id: 'pm-task-sprint-before-implementation',
43
+ title: 'PM task and sprint before implementation',
44
+ description: 'Substantive engineering work starts from Projectman task/sprint truth instead of prose-only chat state.',
45
+ disciplines: ['solo-pm-loop', 'build-review-chat', 'design-first-consensus', 'coordinator-loop'],
46
+ phase: 'execution',
47
+ evidence: ['projectman.kanban-task', 'projectman.sprint'],
48
+ enforcementLevel: 'advisory',
49
+ },
50
+ {
51
+ id: 'microtask-slice-rhythm',
52
+ title: 'Slice work through microtasks',
53
+ description: 'Multi-step work uses sprint phases and microtasks so progress and review scope stay inspectable.',
54
+ disciplines: ['solo-pm-loop', 'build-review-chat', 'design-first-consensus', 'coordinator-loop'],
55
+ phase: 'execution',
56
+ evidence: ['projectman.sprint.phases.microtasks'],
57
+ enforcementLevel: 'advisory',
58
+ },
59
+ {
60
+ id: 'verify-first-initial-stance',
61
+ title: 'Verify-first initial stance',
62
+ description: 'Before formal discuss or live implementation on material multi-agent work, each active role records whether the problem is real, which truth source was checked, and whether consensus is needed.',
63
+ disciplines: ['build-review-chat', 'design-first-consensus'],
64
+ phase: 'execution',
65
+ evidence: ['chatv3.message'],
66
+ enforcementLevel: 'advisory',
67
+ },
68
+ {
69
+ id: 'coordinator-independent-research',
70
+ title: 'Coordinator independent research',
71
+ description: 'The coordinator verifies scope in code, PM, and docs before assigning work to an implementer.',
72
+ disciplines: ['coordinator-loop'],
73
+ phase: 'execution',
74
+ evidence: ['projectman.kanban-task', 'projectman.sprint'],
75
+ enforcementLevel: 'advisory',
76
+ },
77
+ {
78
+ id: 'single-operator-interface',
79
+ title: 'Single operator interface',
80
+ description: 'Implementers route questions and decisions to the coordinator, never directly to the operator; the coordinator escalates only operator-owned decisions.',
81
+ disciplines: ['coordinator-loop'],
82
+ phase: 'execution',
83
+ evidence: ['chatv3.message'],
84
+ enforcementLevel: 'advisory',
85
+ },
86
+ {
87
+ id: 'assignment-via-canonical-refs',
88
+ title: 'Assignment via canonical refs',
89
+ description: 'Assignments carry mission/ktask/plan refs; chat prose alone is not an assignment.',
90
+ disciplines: ['coordinator-loop'],
91
+ phase: 'execution',
92
+ evidence: ['agentspace.mission', 'projectman.kanban-task', 'projectman.sprint'],
93
+ enforcementLevel: 'advisory',
94
+ },
95
+ {
96
+ id: 'idle-window-improvement',
97
+ title: 'Idle-window improvement work',
98
+ description: 'The coordinator uses implementer work windows for doc/skill/tooling improvements and files findings as PM issues or feedback.',
99
+ disciplines: ['coordinator-loop'],
100
+ phase: 'execution',
101
+ evidence: ['projectman.issue', 'projectman.feedback'],
102
+ enforcementLevel: 'advisory',
103
+ },
104
+ {
105
+ id: 'review-request-per-slice',
106
+ title: 'Review request per implementation slice',
107
+ description: 'Live build/review work opens a PM review request for every code slice and posts the ref into chat.',
108
+ disciplines: ['build-review-chat', 'coordinator-loop'],
109
+ phase: 'execution',
110
+ evidence: ['projectman.review-request', 'chatv3.message'],
111
+ enforcementLevel: 'advisory',
112
+ },
113
+ {
114
+ id: 'verify-in-code',
115
+ title: 'Verify in code',
116
+ description: 'Reviewer approval is based on inspecting the actual changed code and tests, not only status prose.',
117
+ disciplines: ['build-review-chat', 'coordinator-loop'],
118
+ phase: 'execution',
119
+ evidence: [],
120
+ enforcementLevel: 'advisory',
121
+ },
122
+ {
123
+ id: 'smoke-before-accept',
124
+ title: 'Smoke before accept',
125
+ description: 'The review result records direct validation or an explicit reason the smoke could not be run.',
126
+ disciplines: ['build-review-chat', 'coordinator-loop'],
127
+ phase: 'execution',
128
+ evidence: [],
129
+ enforcementLevel: 'advisory',
130
+ },
131
+ {
132
+ id: 'explicit-pathspec-commit',
133
+ title: 'Explicit pathspec commit',
134
+ description: 'Atomically commit only the reviewed slice paths and leave unrelated worktree drift to its owner.',
135
+ disciplines: ['build-review-chat', 'coordinator-loop'],
136
+ phase: 'execution',
137
+ evidence: [],
138
+ enforcementLevel: 'advisory',
139
+ },
140
+ {
141
+ id: 'no-fake-validation',
142
+ title: 'No fake validation',
143
+ description: 'Do not report tests, builds, smokes, or review checks that were not actually run in the session.',
144
+ disciplines: ['build-review-chat', 'coordinator-loop'],
145
+ phase: 'execution',
146
+ evidence: [],
147
+ enforcementLevel: 'advisory',
148
+ },
149
+ {
150
+ id: 'material-findings-become-issues',
151
+ title: 'Material findings become PM issues',
152
+ description: 'Review blockers and defects are tracked as explicit Projectman issues instead of being buried in chat.',
153
+ disciplines: ['solo-pm-loop', 'build-review-chat', 'design-first-consensus', 'coordinator-loop'],
154
+ phase: 'execution',
155
+ evidence: ['projectman.issue'],
156
+ enforcementLevel: 'advisory',
157
+ },
158
+ {
159
+ id: 'memory-checkpoint-cadence',
160
+ title: 'Memory checkpoint cadence',
161
+ description: 'Durable carry-forward context is written to Agentspace memory at meaningful phase or session boundaries.',
162
+ disciplines: ['solo-pm-loop', 'build-review-chat', 'design-first-consensus', 'coordinator-loop'],
163
+ phase: 'execution',
164
+ evidence: ['agentspace.memory-item'],
165
+ enforcementLevel: 'advisory',
166
+ },
167
+ {
168
+ id: 'consensus-before-implementation',
169
+ title: 'Consensus before implementation',
170
+ description: 'Material design forks require discuss final stances and operator approval before code changes begin.',
171
+ disciplines: ['design-first-consensus'],
172
+ phase: 'execution',
173
+ evidence: ['agentspace.discussion-topic.final-stance', 'operator.approval'],
174
+ enforcementLevel: 'advisory',
175
+ },
176
+ {
177
+ id: 'no-conclude-before-final-stance',
178
+ title: 'No conclude before final stances',
179
+ description: 'Design-first work does not conclude the discuss topic until each required agent records a final stance.',
180
+ disciplines: ['design-first-consensus'],
181
+ phase: 'execution',
182
+ evidence: [],
183
+ enforcementLevel: 'advisory',
184
+ },
185
+ {
186
+ id: 'no-tbd-output',
187
+ title: 'No TBD outputs',
188
+ description: 'Concluded consensus outputs must be filled and must not carry placeholder TBD sections.',
189
+ disciplines: ['design-first-consensus'],
190
+ phase: 'execution',
191
+ evidence: [],
192
+ enforcementLevel: 'advisory',
193
+ },
194
+ {
195
+ id: 'chat-is-coordination-only',
196
+ title: 'Chat is coordination only',
197
+ description: 'Chat wakes peers and carries refs; PM, discuss, and memory remain the truth ledgers.',
198
+ disciplines: ['build-review-chat', 'design-first-consensus', 'coordinator-loop'],
199
+ phase: 'execution',
200
+ evidence: ['projectman.review-request', 'agentspace.discussion-topic', 'agentspace.memory-item'],
201
+ enforcementLevel: 'advisory',
202
+ },
203
+ {
204
+ id: 'no-hosted-mirror-hand-edit',
205
+ title: 'No hosted mirror hand edits',
206
+ description: 'Hosted prompt, skill, and Docman mirrors are read-only snapshots; canonical changes go through their owner commands.',
207
+ disciplines: ['solo-pm-loop', 'build-review-chat', 'design-first-consensus', 'coordinator-loop'],
208
+ phase: 'execution',
209
+ evidence: [],
210
+ enforcementLevel: 'advisory',
211
+ },
212
+ {
213
+ id: 'closeout-handoff-memory',
214
+ title: 'Closeout writes handoff memory',
215
+ description: 'Session closeout leaves a handoff or resume memory item with next action, validation state, and source refs.',
216
+ disciplines: ['solo-pm-loop', 'build-review-chat', 'design-first-consensus', 'coordinator-loop'],
217
+ phase: 'closeout',
218
+ evidence: ['agentspace.memory-item'],
219
+ enforcementLevel: 'soft-preflight',
220
+ },
221
+ {
222
+ id: 'closeout-triage-open-reviews',
223
+ title: 'Closeout triages open review requests',
224
+ description: 'Open review requests are accepted, linked to follow-up work, or explicitly deferred with an owner before leaving the session.',
225
+ disciplines: ['solo-pm-loop', 'build-review-chat', 'design-first-consensus', 'coordinator-loop'],
226
+ phase: 'closeout',
227
+ evidence: ['projectman.review-request'],
228
+ enforcementLevel: 'soft-preflight',
229
+ },
230
+ {
231
+ id: 'closeout-triage-open-issues',
232
+ title: 'Closeout triages open issues',
233
+ description: 'Open issues are resolved, linked to follow-up work, or explicitly deferred with an owner according to the mission policy.',
234
+ disciplines: ['solo-pm-loop', 'build-review-chat', 'design-first-consensus', 'coordinator-loop'],
235
+ phase: 'closeout',
236
+ evidence: ['projectman.issue'],
237
+ enforcementLevel: 'soft-preflight',
238
+ },
239
+ {
240
+ id: 'closeout-mission-status-finalized',
241
+ title: 'Closeout finalizes mission status',
242
+ description: 'The mission is left in a truthful status such as handoff or completed instead of a stale active state.',
243
+ disciplines: ['solo-pm-loop', 'build-review-chat', 'design-first-consensus', 'coordinator-loop'],
244
+ phase: 'closeout',
245
+ evidence: ['agentspace.mission.status'],
246
+ enforcementLevel: 'soft-preflight',
247
+ },
248
+ {
249
+ id: 'closeout-resume-readiness',
250
+ title: 'Closeout proves resume readiness',
251
+ description: 'The mission resume pack has enough objective, policy, plan, memory, review, issue, and next-action context for the next session.',
252
+ disciplines: ['solo-pm-loop', 'build-review-chat', 'design-first-consensus', 'coordinator-loop'],
253
+ phase: 'closeout',
254
+ evidence: ['agentspace.mission.resume-pack'],
255
+ enforcementLevel: 'soft-preflight',
256
+ },
257
+ {
258
+ id: 'closeout-session-summary',
259
+ title: 'Closeout records session summary',
260
+ description: 'A concise session summary captures what changed, what was validated, and what remains next.',
261
+ disciplines: ['solo-pm-loop', 'build-review-chat', 'design-first-consensus', 'coordinator-loop'],
262
+ phase: 'closeout',
263
+ evidence: ['agentspace.memory-item'],
264
+ enforcementLevel: 'soft-preflight',
265
+ },
266
+ {
267
+ id: 'closeout-slice-review-accounted',
268
+ title: 'Closeout accounts for slice review',
269
+ description: 'Build/review closeout accounts for every slice review request as accepted, linked to an issue, or explicitly deferred with owner.',
270
+ disciplines: ['build-review-chat', 'coordinator-loop'],
271
+ phase: 'closeout',
272
+ evidence: ['projectman.review-request', 'projectman.issue'],
273
+ enforcementLevel: 'soft-preflight',
274
+ },
275
+ {
276
+ id: 'closeout-commit-scope-recorded',
277
+ title: 'Closeout records commit scope',
278
+ description: 'Build/review closeout records commit hash, reviewed path scope, and validation evidence for the accepted slice.',
279
+ disciplines: ['build-review-chat', 'coordinator-loop'],
280
+ phase: 'closeout',
281
+ evidence: ['git.commit', 'projectman.review-request', 'chatv3.message'],
282
+ enforcementLevel: 'soft-preflight',
283
+ },
284
+ {
285
+ id: 'closeout-assignment-queue-truthful',
286
+ title: 'Closeout leaves the assignment queue truthful',
287
+ description: 'Coordinator closeout binds every operator request to mission/ktask/plan records, marks it completed, or defers it explicitly with an owner.',
288
+ disciplines: ['coordinator-loop'],
289
+ phase: 'closeout',
290
+ evidence: ['agentspace.mission', 'projectman.kanban-task'],
291
+ enforcementLevel: 'soft-preflight',
292
+ },
293
+ {
294
+ id: 'closeout-discuss-output-finalized',
295
+ title: 'Closeout finalizes discuss outputs',
296
+ description: 'Design-first closeout confirms final stances, consensus, disagreement, and open-question outputs are finalized without placeholders.',
297
+ disciplines: ['design-first-consensus'],
298
+ phase: 'closeout',
299
+ evidence: ['agentspace.discussion-topic.outputs'],
300
+ enforcementLevel: 'soft-preflight',
301
+ },
302
+ {
303
+ id: 'closeout-decision-carried-to-execution',
304
+ title: 'Closeout carries decision to execution truth',
305
+ description: 'Design-first closeout carries the decision ref into PM task, sprint, issue, or feedback records before implementation resumes.',
306
+ disciplines: ['design-first-consensus'],
307
+ phase: 'closeout',
308
+ evidence: ['projectman.kanban-task', 'projectman.sprint', 'projectman.issue', 'projectman.feedback'],
309
+ enforcementLevel: 'soft-preflight',
310
+ },
311
+ ];
312
+ export const START_DISCIPLINE_PROFILES = {
313
+ 'solo-pm-loop': {
314
+ id: 'solo-pm-loop',
315
+ version: 's1',
316
+ title: 'Solo PM loop',
317
+ whenToUse: ['single agent', 'low or medium uncertainty', 'review is optional or asynchronous'],
318
+ plan: {
319
+ owner: 'projectman',
320
+ rhythm: 'task/sprint plus microtask iteration; review when risk warrants it',
321
+ },
322
+ review: {
323
+ owner: 'projectman.review-request',
324
+ timing: 'async optional at slice or session boundary',
325
+ required: false,
326
+ },
327
+ issue: {
328
+ owner: 'projectman.issue',
329
+ timing: 'create when validation or review finds a material blocker',
330
+ },
331
+ memory: {
332
+ owner: 'agentspace.memory-item',
333
+ cadence: 'checkpoint at meaningful phase boundaries; summary at session end',
334
+ },
335
+ guardrailIds: [
336
+ 'pm-task-sprint-before-implementation',
337
+ 'microtask-slice-rhythm',
338
+ 'material-findings-become-issues',
339
+ 'memory-checkpoint-cadence',
340
+ 'no-hosted-mirror-hand-edit',
341
+ ],
342
+ closeoutGuardrailIds: [
343
+ 'closeout-handoff-memory',
344
+ 'closeout-triage-open-reviews',
345
+ 'closeout-triage-open-issues',
346
+ 'closeout-mission-status-finalized',
347
+ 'closeout-resume-readiness',
348
+ 'closeout-session-summary',
349
+ ],
350
+ },
351
+ 'build-review-chat': {
352
+ id: 'build-review-chat',
353
+ version: 's1',
354
+ title: 'Build + review over chat',
355
+ whenToUse: ['live implementer and reviewer', 'chat-room coordination', 'per-slice review needed'],
356
+ plan: {
357
+ owner: 'projectman',
358
+ rhythm: 'slice equals microtask; open RR, post chat wake, resolve before commit',
359
+ },
360
+ review: {
361
+ owner: 'projectman.review-request',
362
+ timing: 'instant per implementation slice before commit',
363
+ required: true,
364
+ },
365
+ issue: {
366
+ owner: 'projectman.issue',
367
+ timing: 'material RRR findings become linked issues before re-review',
368
+ },
369
+ memory: {
370
+ owner: 'agentspace.memory-item',
371
+ cadence: 'checkpoint after accepted slice or handoff-relevant review result',
372
+ },
373
+ guardrailIds: [
374
+ 'pm-task-sprint-before-implementation',
375
+ 'microtask-slice-rhythm',
376
+ 'verify-first-initial-stance',
377
+ 'review-request-per-slice',
378
+ 'verify-in-code',
379
+ 'smoke-before-accept',
380
+ 'explicit-pathspec-commit',
381
+ 'no-fake-validation',
382
+ 'material-findings-become-issues',
383
+ 'memory-checkpoint-cadence',
384
+ 'chat-is-coordination-only',
385
+ 'no-hosted-mirror-hand-edit',
386
+ ],
387
+ closeoutGuardrailIds: [
388
+ 'closeout-handoff-memory',
389
+ 'closeout-triage-open-reviews',
390
+ 'closeout-triage-open-issues',
391
+ 'closeout-mission-status-finalized',
392
+ 'closeout-resume-readiness',
393
+ 'closeout-session-summary',
394
+ 'closeout-slice-review-accounted',
395
+ 'closeout-commit-scope-recorded',
396
+ ],
397
+ },
398
+ 'design-first-consensus': {
399
+ id: 'design-first-consensus',
400
+ version: 's1',
401
+ title: 'Design-first consensus',
402
+ whenToUse: ['high design uncertainty', 'irreversible or cross-owner changes', 'consensus needed before coding'],
403
+ plan: {
404
+ owner: 'projectman',
405
+ rhythm: 'discuss first, carry consensus ref into sprint plan, then slice implementation',
406
+ },
407
+ review: {
408
+ owner: 'projectman.review-request',
409
+ timing: 'after final stances and operator approval define the implementation slice',
410
+ required: true,
411
+ },
412
+ issue: {
413
+ owner: 'projectman.issue',
414
+ timing: 'open issues for unresolved blockers; do not hide them in discussion prose',
415
+ },
416
+ memory: {
417
+ owner: 'agentspace.memory-item',
418
+ cadence: 'record accepted consensus and implementation handoff checkpoints',
419
+ },
420
+ guardrailIds: [
421
+ 'pm-task-sprint-before-implementation',
422
+ 'microtask-slice-rhythm',
423
+ 'verify-first-initial-stance',
424
+ 'material-findings-become-issues',
425
+ 'memory-checkpoint-cadence',
426
+ 'consensus-before-implementation',
427
+ 'no-conclude-before-final-stance',
428
+ 'no-tbd-output',
429
+ 'chat-is-coordination-only',
430
+ 'no-hosted-mirror-hand-edit',
431
+ ],
432
+ closeoutGuardrailIds: [
433
+ 'closeout-handoff-memory',
434
+ 'closeout-triage-open-reviews',
435
+ 'closeout-triage-open-issues',
436
+ 'closeout-mission-status-finalized',
437
+ 'closeout-resume-readiness',
438
+ 'closeout-session-summary',
439
+ 'closeout-discuss-output-finalized',
440
+ 'closeout-decision-carried-to-execution',
441
+ ],
442
+ },
443
+ 'coordinator-loop': {
444
+ id: 'coordinator-loop',
445
+ version: 's1',
446
+ title: 'Coordinator loop',
447
+ whenToUse: [
448
+ 'operator delegates the session to one coordinator agent',
449
+ 'one or more implementers work under coordinator direction',
450
+ 'free-form multi-task session that needs adaptive task intake',
451
+ ],
452
+ plan: {
453
+ owner: 'projectman',
454
+ rhythm: 'operator request -> coordinator research -> mission/ktask/plan authoring -> chat assignment with canonical refs -> per-slice RR -> instructed pathspec commit',
455
+ },
456
+ review: {
457
+ owner: 'projectman.review-request',
458
+ timing: 'per implementation slice; reviewer defaults to the coordinator; commit on coordinator instruction',
459
+ required: true,
460
+ },
461
+ issue: {
462
+ owner: 'projectman.issue',
463
+ timing: 'material findings and policy-doc gaps become issues/feedback as they are found',
464
+ },
465
+ memory: {
466
+ owner: 'agentspace.memory-item',
467
+ cadence: 'coordinator checkpoints at assignment, accepted-slice, and closeout boundaries',
468
+ },
469
+ guardrailIds: [
470
+ 'pm-task-sprint-before-implementation',
471
+ 'microtask-slice-rhythm',
472
+ 'coordinator-independent-research',
473
+ 'single-operator-interface',
474
+ 'assignment-via-canonical-refs',
475
+ 'idle-window-improvement',
476
+ 'review-request-per-slice',
477
+ 'verify-in-code',
478
+ 'smoke-before-accept',
479
+ 'explicit-pathspec-commit',
480
+ 'no-fake-validation',
481
+ 'material-findings-become-issues',
482
+ 'memory-checkpoint-cadence',
483
+ 'chat-is-coordination-only',
484
+ 'no-hosted-mirror-hand-edit',
485
+ ],
486
+ closeoutGuardrailIds: [
487
+ 'closeout-handoff-memory',
488
+ 'closeout-triage-open-reviews',
489
+ 'closeout-triage-open-issues',
490
+ 'closeout-mission-status-finalized',
491
+ 'closeout-resume-readiness',
492
+ 'closeout-session-summary',
493
+ 'closeout-slice-review-accounted',
494
+ 'closeout-commit-scope-recorded',
495
+ 'closeout-assignment-queue-truthful',
496
+ ],
497
+ },
498
+ };
499
+ export function startGuardrailsForDiscipline(discipline) {
500
+ const profile = START_DISCIPLINE_PROFILES[discipline];
501
+ const ids = new Set([...profile.guardrailIds, ...profile.closeoutGuardrailIds]);
502
+ return START_GUARDRAIL_REGISTRY.filter((guardrail) => ids.has(guardrail.id));
503
+ }
504
+ export function startGuardrailGroupsForDiscipline(discipline) {
505
+ const guardrails = startGuardrailsForDiscipline(discipline);
506
+ return {
507
+ execution: guardrails.filter((guardrail) => guardrail.phase === 'execution'),
508
+ closeout: guardrails.filter((guardrail) => guardrail.phase === 'closeout'),
509
+ };
510
+ }