morphisms 0.1.0-beta.1

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 (32) hide show
  1. package/LICENSE +45 -0
  2. package/bin/mor-workbench.js +3 -0
  3. package/bin/mor.js +3 -0
  4. package/bin/morphisms.js +9 -0
  5. package/lib/cli.js +28 -0
  6. package/lib/files.js +49 -0
  7. package/lib/forward.js +45 -0
  8. package/lib/init.js +190 -0
  9. package/lib/platform.js +40 -0
  10. package/lib/update.js +45 -0
  11. package/lib/workbench.js +120 -0
  12. package/package.json +24 -0
  13. package/templates/README.md +21 -0
  14. package/templates/agent/.gitkeep +0 -0
  15. package/templates/agent/skills/morphisms/SKILL.md +86 -0
  16. package/templates/claude/.gitkeep +0 -0
  17. package/templates/claude/skills/morphisms/SKILL.md +86 -0
  18. package/templates/contract/README.md +57 -0
  19. package/templates/contract/contract.mor +247 -0
  20. package/templates/contract/personas/investigator.md +20 -0
  21. package/templates/contract/personas/operator-facing-intake.md +16 -0
  22. package/templates/contract/personas/plan-reviewer.md +20 -0
  23. package/templates/contract/personas/scoper.md +23 -0
  24. package/templates/contract/personas/triager.md +22 -0
  25. package/templates/contract/schemas/investigation-report.schema.json +28 -0
  26. package/templates/contract/schemas/operator-decision.schema.json +13 -0
  27. package/templates/contract/schemas/plan-review.schema.json +26 -0
  28. package/templates/contract/schemas/scoped-plan.schema.json +25 -0
  29. package/templates/contract/schemas/triage-decision.schema.json +25 -0
  30. package/templates/instructions/starter-issues-agent-manual.md +232 -0
  31. package/templates/instructions/workspace-agent-manual.md +22 -0
  32. package/templates/manifest.json +22 -0
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: morphisms
3
+ description: Run Morphisms starter issue workflows from an agent session. Use when the user asks to start Morphisms onboarding, orchestrate Morphisms issues, or move records through the starter issues front-half contract.
4
+ ---
5
+
6
+ # Morphisms starter issue loop
7
+
8
+ You are the orchestrator. Keep this session focused on coordination; delegate one worker per actionable record when your harness supports delegation.
9
+
10
+ ## Orient first
11
+
12
+ 1. Run `mor agent instructions` and read the S1/S2/S3 paths it reports. If you need the fully rendered prompt, run `mor agent instructions preview`.
13
+ 2. Open Workbench at `http://localhost:4400/#workbench` unless local init printed a different port. Use Workbench, not legacy graph routes.
14
+ 3. If you are inside a MOR Workbench thread capsule, narrate with `mor-thread reply` and propose viewer movement with `mor-thread suggest`; otherwise narrate in the current agent conversation and include the Workbench deep-link.
15
+
16
+ ## Frontier
17
+
18
+ Use the active starter store alias `issue`:
19
+
20
+ ```bash
21
+ mor issue ls
22
+ ```
23
+
24
+ For each non-terminal, non-human-only record, hydrate the exact current node before doing anything:
25
+
26
+ ```bash
27
+ mor issue hydrate ISS0001 journey.triage
28
+ mor issue inspect ISS0001 --packet journey.triage --inline-persona
29
+ ```
30
+
31
+ The packet is the authority: persona, context, legal moves, required witnesses, and refusal diagnostics beat memory or guesses.
32
+
33
+ ## Delegation policy
34
+
35
+ - Start **one fresh worker per actionable record**. Parallel workers are allowed when your harness supports them; each gets a hydration command, target node, and the exact artifact/edge it may attempt.
36
+ - Do not let workers invent hidden phases. One worker produces evidence for one current node, attaches it, attempts at most one edge, verifies the new state, and reports back.
37
+ - `attention.awaiting_operator` is human-only. Do not spawn an autonomous worker for it; summarize the ambiguity and wait for the operator decision artifact.
38
+
39
+ ## Worker brief template
40
+
41
+ Give each worker a brief like:
42
+
43
+ ```text
44
+ You are working one Morphisms node turn for issue ISS0001.
45
+ Run: mor issue hydrate ISS0001 journey.investigating
46
+ Use the packet/persona as authority. Produce a real investigation_report with file:line citations, attach it with mor issue enrich, then attempt only journey.submit_standard_investigation. If MOR refuses, report the refusal and do not work around it.
47
+ ```
48
+
49
+ ## Evidence and movement
50
+
51
+ Attach typed artifacts before walking evidence-gated edges:
52
+
53
+ ```bash
54
+ mor issue enrich ISS0001 triage_decision --role triage_decision --payload /tmp/triage.json
55
+ mor issue walk ISS0001 journey.choose_standard_investigation
56
+ mor issue enrich ISS0001 investigation_report --role investigation_report --payload /tmp/investigation.json
57
+ mor issue walk ISS0001 journey.submit_standard_investigation
58
+ mor issue enrich ISS0001 scoped_plan --role scoped_plan --payload /tmp/scoped-plan.json
59
+ mor issue walk ISS0001 journey.complete_scoped_plan
60
+ ```
61
+
62
+ A refusal is a success signal from the runtime, not a CLI problem. Read the diagnostic, attach the missing witness or choose the correct edge, then retry only when the packet supports it.
63
+
64
+ ## Starter issue vocabulary
65
+
66
+ - Store: `issues`, alias `issue`, record ids `ISS0001`, `ISS0002`, ...
67
+ - Dimensions:
68
+ - `journey`: `triage` -> `investigating` -> `scoping` -> `plan_review` -> `done`
69
+ - `attention`: `autonomous_entry` -> `autonomous` <-> `awaiting_operator`
70
+ - Human-only node: `attention.awaiting_operator`
71
+ - Artifacts: `triage_decision`, `investigation_report`, `scoped_plan`, `plan_review`, `operator_decision`
72
+ - Common edges:
73
+ - `journey.choose_quick_scope`, `journey.choose_standard_investigation`, `journey.choose_rigorous_investigation`
74
+ - `journey.close_discarded_from_triage`, `journey.close_duplicate_from_triage`
75
+ - `journey.submit_standard_investigation`, `journey.submit_rigorous_investigation`
76
+ - `journey.complete_scoped_plan`, `journey.close_blocked_from_scoping`
77
+ - `journey.submit_rigorous_plan_review`, `journey.revise_rigorous_plan`, `journey.approve_rigorous_plan`
78
+ - `attention.start_autonomous`, `attention.request_operator_from_entry`, `attention.request_operator`, `attention.return_to_autonomous`
79
+
80
+ ## Concierge trigger
81
+
82
+ If `.mor/onboarding-complete` is missing, follow the S3 concierge onboarding section before normal orchestration. At the end, write one line to `.mor/onboarding-complete`:
83
+
84
+ ```text
85
+ <ISO-8601 date> <first issue id>
86
+ ```
File without changes
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: morphisms
3
+ description: Run Morphisms starter issue workflows from Claude Code. Use when the user says to start Morphisms onboarding, orchestrate Morphisms issues, or move records through the starter issues front-half contract.
4
+ ---
5
+
6
+ # Morphisms starter issue loop
7
+
8
+ You are the orchestrator. Keep this Claude Code session focused on coordination; spawn one subagent per actionable record and let each worker handle exactly one node turn.
9
+
10
+ ## Orient first
11
+
12
+ 1. Run `mor agent instructions` and read the S1/S2/S3 paths it reports. If you need the fully rendered prompt, run `mor agent instructions preview`.
13
+ 2. Open Workbench at `http://localhost:4400/#workbench` unless local init printed a different port. Use Workbench, not legacy graph routes.
14
+ 3. If you are inside a MOR Workbench thread capsule, narrate with `mor-thread reply` and propose viewer movement with `mor-thread suggest`; otherwise narrate in the current Claude conversation and include the Workbench deep-link.
15
+
16
+ ## Frontier
17
+
18
+ Use the active starter store alias `issue`:
19
+
20
+ ```bash
21
+ mor issue ls
22
+ ```
23
+
24
+ For each non-terminal, non-human-only record, hydrate the exact current node before doing anything:
25
+
26
+ ```bash
27
+ mor issue hydrate ISS0001 journey.triage
28
+ mor issue inspect ISS0001 --packet journey.triage --inline-persona
29
+ ```
30
+
31
+ The packet is the authority: persona, context, legal moves, required witnesses, and refusal diagnostics beat memory or guesses.
32
+
33
+ ## Spawn policy
34
+
35
+ - Spawn **one Claude Code subagent per actionable record**. Parallel subagents are allowed; each receives a hydration command, the target node, and the exact artifact/edge it may attempt.
36
+ - Do not let workers invent hidden phases. One worker produces evidence for one current node, attaches it, attempts at most one edge, verifies the new state, and reports back.
37
+ - `attention.awaiting_operator` is human-only. Do not spawn an autonomous worker for it; summarize the ambiguity and wait for the operator decision artifact.
38
+
39
+ ## Worker brief template
40
+
41
+ Give each worker a brief like:
42
+
43
+ ```text
44
+ You are working one Morphisms node turn for issue ISS0001.
45
+ Run: mor issue hydrate ISS0001 journey.investigating
46
+ Use the packet/persona as authority. Produce a real investigation_report with file:line citations, attach it with mor issue enrich, then attempt only journey.submit_standard_investigation. If MOR refuses, report the refusal and do not work around it.
47
+ ```
48
+
49
+ ## Evidence and movement
50
+
51
+ Attach typed artifacts before walking evidence-gated edges:
52
+
53
+ ```bash
54
+ mor issue enrich ISS0001 triage_decision --role triage_decision --payload /tmp/triage.json
55
+ mor issue walk ISS0001 journey.choose_standard_investigation
56
+ mor issue enrich ISS0001 investigation_report --role investigation_report --payload /tmp/investigation.json
57
+ mor issue walk ISS0001 journey.submit_standard_investigation
58
+ mor issue enrich ISS0001 scoped_plan --role scoped_plan --payload /tmp/scoped-plan.json
59
+ mor issue walk ISS0001 journey.complete_scoped_plan
60
+ ```
61
+
62
+ A refusal is a success signal from the runtime, not a CLI problem. Read the diagnostic, attach the missing witness or choose the correct edge, then retry only when the packet supports it.
63
+
64
+ ## Starter issue vocabulary
65
+
66
+ - Store: `issues`, alias `issue`, record ids `ISS0001`, `ISS0002`, ...
67
+ - Dimensions:
68
+ - `journey`: `triage` -> `investigating` -> `scoping` -> `plan_review` -> `done`
69
+ - `attention`: `autonomous_entry` -> `autonomous` <-> `awaiting_operator`
70
+ - Human-only node: `attention.awaiting_operator`
71
+ - Artifacts: `triage_decision`, `investigation_report`, `scoped_plan`, `plan_review`, `operator_decision`
72
+ - Common edges:
73
+ - `journey.choose_quick_scope`, `journey.choose_standard_investigation`, `journey.choose_rigorous_investigation`
74
+ - `journey.close_discarded_from_triage`, `journey.close_duplicate_from_triage`
75
+ - `journey.submit_standard_investigation`, `journey.submit_rigorous_investigation`
76
+ - `journey.complete_scoped_plan`, `journey.close_blocked_from_scoping`
77
+ - `journey.submit_rigorous_plan_review`, `journey.revise_rigorous_plan`, `journey.approve_rigorous_plan`
78
+ - `attention.start_autonomous`, `attention.request_operator_from_entry`, `attention.request_operator`, `attention.return_to_autonomous`
79
+
80
+ ## Concierge trigger
81
+
82
+ If `.mor/onboarding-complete` is missing, follow the S3 concierge onboarding section before normal orchestration. At the end, write one line to `.mor/onboarding-complete`:
83
+
84
+ ```text
85
+ <ISO-8601 date> <first issue id>
86
+ ```
@@ -0,0 +1,57 @@
1
+ # Starter issues front-half contract
2
+
3
+ This is the default Morphisms starter contract for new users. It captures an `issues` store and moves each issue through the front half of work: triage, optional investigation, scoping, optional review, and a single terminal `done` state.
4
+
5
+ The contract intentionally stops before execution. It produces ready `scoped_plan` evidence and a pasteable `handoff_prompt`; it does not create tasks, branches, worktrees, or execution records.
6
+
7
+ ## Store
8
+
9
+ - Store: `issues` (CLI alias `issue`)
10
+ - Required fields: `title`, `kind`, `summary`
11
+ - `kind`: `bug | idea | feature`
12
+
13
+ ## Journey lanes
14
+
15
+ All lanes share the same `journey` dimension and states rather than using parallel lane dimensions.
16
+
17
+ - **Quick:** `triage -> scoping -> done`
18
+ - Use when triage can choose `quick` because the issue is already clear enough to scope.
19
+ - **Standard:** `triage -> investigating -> scoping -> done`
20
+ - Use when one evidence-gathering investigation is needed before scoping.
21
+ - **Rigorous:** `triage -> investigating -> scoping -> plan_review -> done`, with `plan_review -> scoping` on revise.
22
+ - Use when a plan should be explicitly reviewed before becoming ready.
23
+
24
+ The single terminal state is `done`. Terminal means the record's journey in this dimension is complete, not that the work succeeded. Typed outcomes live on the closing artifact:
25
+
26
+ - `triage_decision.closing_outcome`: `discarded | duplicate`
27
+ - `scoped_plan.plan_outcome`: `ready_for_execution | blocked`
28
+ - `plan_review.review_outcome`: `ready_for_execution`
29
+
30
+ ## Evidence gates
31
+
32
+ - `triage_decision`: chooses `quick`, `standard`, `rigorous`, `discard`, or `duplicate`.
33
+ - `investigation_report`: required for investigated lanes; schema requires a non-empty `citations` array with `file`, `line`, `excerpt`, and `why_it_matters`.
34
+ - `scoped_plan`: contains `plan_round`, `problem`, `evidence`, `approach`, `acceptance_criteria`, `handoff_prompt`, and `plan_outcome`.
35
+ - `plan_review`: rigorous lane only; includes `review_round` and `reviewed_plan_round`; `PASS` closes, `REVISE` returns to scoping.
36
+
37
+ Rigorous review freshness uses the generic `latest_attachment_after_edge` precondition. After `revise_rigorous_plan`, the next `submit_rigorous_plan_review` requires a scoped plan attached after that REVISE. `revise_rigorous_plan` and `approve_rigorous_plan` require a plan review attached after the current `submit_rigorous_plan_review`. The round fields make the human-readable loop explicit; the runtime enforces attachment freshness.
38
+
39
+ ## Provisional operator routing
40
+
41
+ A second dimension, `attention`, models v0 operator routing on the same store:
42
+
43
+ ```text
44
+ autonomous_entry -> autonomous -> awaiting_operator -> autonomous
45
+ \-> awaiting_operator
46
+ ```
47
+
48
+ The compiled contract includes an entry-only bootstrap state, `autonomous_entry`, because Morphisms initial states cannot be targeted by return edges. A new record has two legal first attention moves:
49
+
50
+ - `attention.start_autonomous` when no operator input is needed.
51
+ - `attention.request_operator_from_entry` when first triage immediately needs the operator.
52
+
53
+ After that, the operative loop is `autonomous -> awaiting_operator -> autonomous` via `attention.request_operator` and `attention.return_to_autonomous`.
54
+
55
+ The out-edge from `awaiting_operator` requires an `operator_decision` artifact. To keep first-time semantics simple, `operator_decision.decision` is limited to values coherent with returning to autonomous work: `resume | revise_scope`. Abandon/discard/duplicate/block outcomes belong on journey artifacts (`triage_decision` or `scoped_plan`), not on the attention dimension.
56
+
57
+ This mechanism is **PROVISIONAL**: the longer-term cross-store operator queue / W3 actor-states design question is still open, so downstream code and docs should treat this as swappable.
@@ -0,0 +1,247 @@
1
+ distro starter_issues_front_half version v1
2
+
3
+ store issues {
4
+ alias issue
5
+ identity prefix "ISS" width 4
6
+ storage table "starter_issues_front_half_issues"
7
+ field title: text required patchable(false)
8
+ field kind: enum [bug, idea, feature] required patchable(false)
9
+ field summary: text required patchable
10
+ field reporter_context: text patchable default("")
11
+ field source_anchor: text patchable default("")
12
+ field priority: enum [low, medium, high] patchable default(medium)
13
+ field triage_decision_ref: artifact_ref patchable(false) managed(artifact_cache_ref)
14
+ field investigation_report_ref: artifact_ref patchable(false) managed(artifact_cache_ref)
15
+ field scoped_plan_ref: artifact_ref patchable(false) managed(artifact_cache_ref)
16
+ field plan_review_ref: artifact_ref patchable(false) managed(artifact_cache_ref)
17
+ field operator_decision_ref: artifact_ref patchable(false) managed(artifact_cache_ref)
18
+
19
+ artifact triage_decision {
20
+ schema "schemas/triage-decision.schema.json"
21
+ allowed_in journey.triage
22
+ attach role triage_decision cardinality many
23
+ cache latest_ref triage_decision_ref
24
+ }
25
+
26
+ artifact investigation_report {
27
+ schema "schemas/investigation-report.schema.json"
28
+ allowed_in journey.investigating
29
+ attach role investigation_report cardinality many
30
+ cache latest_ref investigation_report_ref
31
+ }
32
+
33
+ artifact scoped_plan {
34
+ schema "schemas/scoped-plan.schema.json"
35
+ allowed_in journey.scoping
36
+ attach role scoped_plan cardinality many
37
+ cache latest_ref scoped_plan_ref
38
+ }
39
+
40
+ artifact plan_review {
41
+ schema "schemas/plan-review.schema.json"
42
+ allowed_in journey.plan_review
43
+ attach role plan_review cardinality many
44
+ cache latest_ref plan_review_ref
45
+ }
46
+
47
+ artifact operator_decision {
48
+ schema "schemas/operator-decision.schema.json"
49
+ allowed_in attention.awaiting_operator
50
+ attach role operator_decision cardinality many
51
+ cache latest_ref operator_decision_ref
52
+ }
53
+
54
+ dimension journey {
55
+ state_field journey_state
56
+
57
+ initial state triage
58
+ state investigating
59
+ state scoping
60
+ state plan_review
61
+ terminal state done
62
+ plateau rigorous_review_loop [scoping, plan_review]
63
+
64
+ edge choose_quick_scope: triage -> scoping {
65
+ doc "Choose the quick lane when the issue is already clear enough to scope."
66
+ when_to_use "Use only after a triage_decision whose decision is quick."
67
+ requires all {
68
+ artifact_field_equals(kind: triage_decision, role: triage_decision, latest: true, field: decision, value: quick)
69
+ }
70
+ }
71
+
72
+ edge choose_standard_investigation: triage -> investigating {
73
+ doc "Choose the standard lane when one investigation pass is needed before scoping."
74
+ when_to_use "Use only after a triage_decision whose decision is standard."
75
+ requires all {
76
+ artifact_field_equals(kind: triage_decision, role: triage_decision, latest: true, field: decision, value: standard)
77
+ }
78
+ }
79
+
80
+ edge choose_rigorous_investigation: triage -> investigating {
81
+ doc "Choose the rigorous lane when investigation plus plan review is warranted."
82
+ when_to_use "Use only after a triage_decision whose decision is rigorous."
83
+ requires all {
84
+ artifact_field_equals(kind: triage_decision, role: triage_decision, latest: true, field: decision, value: rigorous)
85
+ }
86
+ }
87
+
88
+ edge close_discarded_from_triage: triage -> done {
89
+ doc "Complete the journey at triage when the issue should be discarded."
90
+ when_to_use "Use only when the triage_decision records decision discard and closing_outcome discarded."
91
+ requires all {
92
+ artifact_field_equals(kind: triage_decision, role: triage_decision, latest: true, field: decision, value: discard)
93
+ artifact_field_equals(kind: triage_decision, role: triage_decision, latest: true, field: closing_outcome, value: discarded)
94
+ }
95
+ }
96
+
97
+ edge close_duplicate_from_triage: triage -> done {
98
+ doc "Complete the journey at triage when the issue duplicates another known record."
99
+ when_to_use "Use only when the triage_decision records decision duplicate and closing_outcome duplicate."
100
+ requires all {
101
+ artifact_field_equals(kind: triage_decision, role: triage_decision, latest: true, field: decision, value: duplicate)
102
+ artifact_field_equals(kind: triage_decision, role: triage_decision, latest: true, field: closing_outcome, value: duplicate)
103
+ }
104
+ }
105
+
106
+ edge submit_standard_investigation: investigating -> scoping {
107
+ doc "Finish standard-lane fact-finding and move to scoping."
108
+ when_to_use "Use after attaching an investigation_report with file/line citations."
109
+ requires all {
110
+ artifact_field_equals(kind: triage_decision, role: triage_decision, latest: true, field: decision, value: standard)
111
+ latest_attachment_exists(kind: investigation_report, role: investigation_report, latest: true)
112
+ }
113
+ }
114
+
115
+ edge submit_rigorous_investigation: investigating -> scoping {
116
+ doc "Finish rigorous-lane fact-finding and move to scoping before review."
117
+ when_to_use "Use after attaching an investigation_report with file/line citations."
118
+ requires all {
119
+ artifact_field_equals(kind: triage_decision, role: triage_decision, latest: true, field: decision, value: rigorous)
120
+ latest_attachment_exists(kind: investigation_report, role: investigation_report, latest: true)
121
+ }
122
+ }
123
+
124
+ edge complete_scoped_plan: scoping -> done {
125
+ doc "Complete quick or standard lane with a ready scoped plan."
126
+ when_to_use "Use for quick or standard lanes after scoped_plan has outcome ready_for_execution."
127
+ requires all {
128
+ artifact_field_equals(kind: scoped_plan, role: scoped_plan, latest: true, field: plan_outcome, value: ready_for_execution)
129
+ any {
130
+ artifact_field_equals(kind: triage_decision, role: triage_decision, latest: true, field: decision, value: quick)
131
+ artifact_field_equals(kind: triage_decision, role: triage_decision, latest: true, field: decision, value: standard)
132
+ }
133
+ }
134
+ }
135
+
136
+ edge close_blocked_from_scoping: scoping -> done {
137
+ doc "Complete any lane as blocked when scoping exposes a blocker instead of an executable plan."
138
+ when_to_use "Use after scoped_plan records plan_outcome blocked and explains the blocker."
139
+ requires all {
140
+ artifact_field_equals(kind: scoped_plan, role: scoped_plan, latest: true, field: plan_outcome, value: blocked)
141
+ }
142
+ }
143
+
144
+ edge submit_rigorous_plan_review: scoping -> plan_review {
145
+ doc "Send a rigorous-lane scoped plan to explicit plan review."
146
+ when_to_use "Use only for rigorous lane after investigation and a ready scoped_plan are attached."
147
+ requires all {
148
+ artifact_field_equals(kind: triage_decision, role: triage_decision, latest: true, field: decision, value: rigorous)
149
+ latest_attachment_exists(kind: investigation_report, role: investigation_report, latest: true)
150
+ artifact_field_equals(kind: scoped_plan, role: scoped_plan, latest: true, field: plan_outcome, value: ready_for_execution)
151
+ latest_attachment_after_edge(kind: scoped_plan, role: scoped_plan, edge: "journey.revise_rigorous_plan")
152
+ }
153
+ }
154
+
155
+ edge revise_rigorous_plan: plan_review -> scoping {
156
+ doc "Return rigorous work to scoping when a fresh plan review asks for revision."
157
+ when_to_use "Use when the latest plan_review gate is REVISE and that review was attached after this review round began."
158
+ requires all {
159
+ artifact_field_equals(kind: plan_review, role: plan_review, latest: true, field: gate, value: REVISE)
160
+ latest_attachment_after_edge(kind: plan_review, role: plan_review, edge: "journey.submit_rigorous_plan_review", edge_required: true)
161
+ }
162
+ }
163
+
164
+ edge approve_rigorous_plan: plan_review -> done {
165
+ doc "Complete rigorous lane after a fresh plan review passes the scoped plan."
166
+ when_to_use "Use when the latest plan_review gate is PASS, review_outcome is ready_for_execution, and the review was attached after this review round began."
167
+ requires all {
168
+ artifact_field_equals(kind: plan_review, role: plan_review, latest: true, field: gate, value: PASS)
169
+ artifact_field_equals(kind: plan_review, role: plan_review, latest: true, field: review_outcome, value: ready_for_execution)
170
+ latest_attachment_after_edge(kind: plan_review, role: plan_review, edge: "journey.submit_rigorous_plan_review", edge_required: true)
171
+ }
172
+ }
173
+ }
174
+
175
+ dimension attention {
176
+ state_field attention_state
177
+
178
+ initial state autonomous_entry
179
+ state autonomous
180
+ state awaiting_operator
181
+ plateau operator_loop [autonomous, awaiting_operator]
182
+
183
+ edge start_autonomous: autonomous_entry -> autonomous {
184
+ doc "Enter the normal autonomous attention state after record creation."
185
+ when_to_use "Use once after add; the explicit entry state keeps the loop from targeting the compiler's entry-only initial state."
186
+ }
187
+
188
+ edge request_operator_from_entry: autonomous_entry -> awaiting_operator {
189
+ doc "Pause immediately after record creation when first triage needs the human operator."
190
+ when_to_use "Use for product-owner ambiguity before attention.start_autonomous has been walked."
191
+ }
192
+
193
+ edge request_operator: autonomous -> awaiting_operator {
194
+ doc "Pause autonomous work when product-owner ambiguity needs the human operator."
195
+ when_to_use "Use sparingly for genuine ambiguity after the record is in attention.autonomous."
196
+ }
197
+
198
+ edge return_to_autonomous: awaiting_operator -> autonomous {
199
+ doc "Resume autonomous work after the operator answers or redirects."
200
+ when_to_use "Use only after attaching an operator_decision artifact."
201
+ requires all {
202
+ latest_attachment_exists(kind: operator_decision, role: operator_decision, latest: true)
203
+ }
204
+ }
205
+ }
206
+
207
+ profile journey.triage persona "personas/triager.md"
208
+ profile journey.investigating persona "personas/investigator.md"
209
+ profile journey.scoping persona "personas/scoper.md"
210
+ profile journey.plan_review persona "personas/plan-reviewer.md"
211
+ profile attention.awaiting_operator persona "personas/operator-facing-intake.md"
212
+
213
+ context journey.triage {
214
+ record(fields: [title, kind, summary, reporter_context, source_anchor, priority], as: issue)
215
+ artifacts(kind: triage_decision, role: triage_decision, latest: false, limit: 3, as: prior_triage_decisions)
216
+ }
217
+
218
+ context journey.investigating {
219
+ record(fields: [title, kind, summary, reporter_context, source_anchor, priority], as: issue)
220
+ artifacts(kind: triage_decision, role: triage_decision, latest: true, required: true, as: triage_decision)
221
+ artifacts(kind: investigation_report, role: investigation_report, latest: false, limit: 3, as: investigation_reports)
222
+ }
223
+
224
+ context journey.scoping {
225
+ record(fields: [title, kind, summary, reporter_context, source_anchor, priority], as: issue)
226
+ artifacts(kind: triage_decision, role: triage_decision, latest: true, required: true, as: triage_decision)
227
+ artifacts(kind: investigation_report, role: investigation_report, latest: true, as: investigation_report)
228
+ artifacts(kind: scoped_plan, role: scoped_plan, latest: false, limit: 3, as: scoped_plans)
229
+ artifacts(kind: plan_review, role: plan_review, latest: true, as: latest_plan_review)
230
+ }
231
+
232
+ context journey.plan_review {
233
+ record(fields: [title, kind, summary, reporter_context, source_anchor, priority], as: issue)
234
+ artifacts(kind: triage_decision, role: triage_decision, latest: true, required: true, as: triage_decision)
235
+ artifacts(kind: investigation_report, role: investigation_report, latest: true, required: true, as: investigation_report)
236
+ artifacts(kind: scoped_plan, role: scoped_plan, latest: true, required: true, as: scoped_plan)
237
+ artifacts(kind: plan_review, role: plan_review, latest: false, limit: 3, as: prior_plan_reviews)
238
+ }
239
+
240
+ context attention.awaiting_operator {
241
+ record(fields: [title, kind, summary, reporter_context, source_anchor, priority], as: issue)
242
+ artifacts(kind: triage_decision, role: triage_decision, latest: true, as: triage_decision)
243
+ artifacts(kind: investigation_report, role: investigation_report, latest: true, as: investigation_report)
244
+ artifacts(kind: scoped_plan, role: scoped_plan, latest: true, as: scoped_plan)
245
+ artifacts(kind: operator_decision, role: operator_decision, latest: false, limit: 3, as: operator_decisions)
246
+ }
247
+ }
@@ -0,0 +1,20 @@
1
+ # Issue investigator persona
2
+
3
+ You are a Claude Code agent operating from a hydrated Morphisms packet for `journey.investigating`.
4
+
5
+ Goal: turn uncertainty into cited facts.
6
+
7
+ Attention routing:
8
+ - If the packet's `attention_state` is `autonomous_entry` and you need the operator, walk `attention.request_operator_from_entry`.
9
+ - If it is `autonomous` and you need the operator, walk `attention.request_operator`.
10
+ - Otherwise continue with the journey edge instructions.
11
+
12
+ Checklist:
13
+ - Inspect the codebase or repository evidence relevant to the issue.
14
+ - Produce an `investigation_report` with at least one `citations` entry naming `file`, integer `line`, `excerpt`, and `why_it_matters`.
15
+ - Prefer concrete file:line evidence over broad claims.
16
+ - Record reproduction steps when applicable; say when reproduction is not available.
17
+ - Walk the standard or rigorous investigation edge only after the report is attached and accepted.
18
+ - Use operator routing only when the next choice depends on product-owner judgment rather than code facts.
19
+
20
+ Do not implement fixes or materialize tasks.
@@ -0,0 +1,16 @@
1
+ # Operator-facing intake persona
2
+
3
+ You are a Claude Code agent handling `attention.awaiting_operator` for an issue record.
4
+
5
+ Goal: present the smallest useful question to the human operator, then encode the answer.
6
+
7
+ Checklist:
8
+ - Summarize current issue state, latest artifacts, and the exact ambiguity.
9
+ - Ask for a product-owner decision in plain language.
10
+ - Attach an `operator_decision` artifact with `decision`, `rationale`, and any `instructions` or `answered_questions`.
11
+ - Use only `decision: resume` or `decision: revise_scope`; both mean autonomous work should continue with the operator's guidance.
12
+ - Walk `attention.return_to_autonomous` only after the artifact is accepted.
13
+ - After returning to autonomous, continue using the journey-state persona and legal `mor` commands.
14
+ - Do not encode abandon/discard/duplicate as operator decisions. If the operator answer means the journey should end, return to autonomous and attach the appropriate `triage_decision` or `scoped_plan` closing artifact on the journey dimension.
15
+
16
+ This attention mechanism is v0-provisional and single-store. Do not depend on it as a permanent cross-record operator queue.
@@ -0,0 +1,20 @@
1
+ # Rigorous plan reviewer persona
2
+
3
+ You are a Claude Code agent operating from a hydrated Morphisms packet for `journey.plan_review`.
4
+
5
+ Goal: review whether the scoped plan is safe, evidenced, and executable.
6
+
7
+ Attention routing:
8
+ - If the packet's `attention_state` is `autonomous_entry` and you need the operator, walk `attention.request_operator_from_entry`.
9
+ - If it is `autonomous` and you need the operator, walk `attention.request_operator`.
10
+
11
+ Checklist:
12
+ - Compare the `scoped_plan` to the triage decision and investigation report.
13
+ - Attach a fresh `plan_review` after entering `plan_review`; stale reviews from prior rounds cannot legally drive PASS or REVISE.
14
+ - Set `review_round` to the next review attempt number and `reviewed_plan_round` to the scoped plan's `plan_round`.
15
+ - PASS only when the problem, evidence, approach, acceptance criteria, and handoff prompt are coherent enough for a future executor.
16
+ - Attach `plan_review` with `gate: PASS` and `review_outcome: ready_for_execution` before walking `approve_rigorous_plan`.
17
+ - Use `gate: REVISE` with concrete `required_changes` before walking `revise_rigorous_plan`.
18
+ - Ask the operator only for genuine product ambiguity, not for routine review work.
19
+
20
+ Do not execute the plan or spawn implementation tasks.
@@ -0,0 +1,23 @@
1
+ # Issue scoper persona
2
+
3
+ You are a Claude Code agent operating from a hydrated Morphisms packet for `journey.scoping`.
4
+
5
+ Goal: produce a scoped front-half output that another agent can execute later.
6
+
7
+ Attention routing:
8
+ - If the packet's `attention_state` is `autonomous_entry` and you need the operator, walk `attention.request_operator_from_entry`.
9
+ - If it is `autonomous` and you need the operator, walk `attention.request_operator`.
10
+
11
+ Attach a `scoped_plan` with:
12
+ - `plan_round`: start at `1`; after a rigorous `plan_review` with `gate: REVISE`, attach a new scoped plan with the next round number.
13
+ - `based_on_review_round`: set to the REVISE review round the new plan answers, when applicable.
14
+ - `problem`: the precise user/codebase problem.
15
+ - `evidence`: concise citations or facts from the record and investigation.
16
+ - `approach`: implementation approach at planning depth, not code changes.
17
+ - `acceptance_criteria`: testable bullets.
18
+ - `handoff_prompt`: a pasteable prompt for a future execution agent.
19
+ - `plan_outcome`: `ready_for_execution` or `blocked`.
20
+
21
+ For quick and standard lanes, a ready or blocked scoped plan can close the journey. For rigorous lanes, submit ready plans to review. The runtime requires the scoped plan to be attached after the latest rigorous REVISE before re-entering review. If blocked, explain the blocker instead of inventing certainty.
22
+
23
+ Do not create a task store entry or perform the implementation.
@@ -0,0 +1,22 @@
1
+ # Issue triager persona
2
+
3
+ You are a Claude Code agent operating from a `mor issue hydrate <id> journey.triage --inline-persona --json` packet.
4
+
5
+ Goal: decide the smallest honest lane for this issue.
6
+
7
+ Attention bootstrap:
8
+ - Check the packet's `attention_state` before asking the operator.
9
+ - If it is `autonomous_entry` and you need the operator now, walk `attention.request_operator_from_entry`.
10
+ - If it is `autonomous` and you need the operator, walk `attention.request_operator`.
11
+ - If no operator help is needed and attention is still `autonomous_entry`, you may walk `attention.start_autonomous` once, then continue the journey.
12
+
13
+ Checklist:
14
+ - Read the record fields before inferring severity or scope.
15
+ - Attach one `triage_decision` artifact before walking journey lane edges.
16
+ - Choose `quick` only when the issue is already concrete enough to scope.
17
+ - Choose `standard` when one investigation pass should collect facts.
18
+ - Choose `rigorous` when the plan needs investigation plus explicit review.
19
+ - Choose `discard` or `duplicate` only with a closing outcome and rationale.
20
+ - If product-owner ambiguity blocks an honest choice, use the attention edge above instead of guessing.
21
+
22
+ Do not create tasks, branches, worktrees, or implementation plans here. This contract is the front half only.
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "description": "Investigation report with mandatory source citations. Each citation names a file and line number.",
5
+ "required": ["finding", "summary", "citations"],
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "finding": {"type": "string", "enum": ["confirmed", "not_reproduced", "needs_scope", "blocked"]},
9
+ "summary": {"type": "string", "minLength": 1},
10
+ "reproduction_steps": {"type": "array", "items": {"type": "string", "minLength": 1}, "default": []},
11
+ "citations": {
12
+ "type": "array",
13
+ "minItems": 1,
14
+ "items": {
15
+ "type": "object",
16
+ "required": ["file", "line", "excerpt", "why_it_matters"],
17
+ "additionalProperties": false,
18
+ "properties": {
19
+ "file": {"type": "string", "minLength": 1},
20
+ "line": {"type": "integer", "minimum": 1},
21
+ "excerpt": {"type": "string", "minLength": 1},
22
+ "why_it_matters": {"type": "string", "minLength": 1}
23
+ }
24
+ }
25
+ },
26
+ "open_questions": {"type": "array", "items": {"type": "string", "minLength": 1}, "default": []}
27
+ }
28
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "description": "Human operator decision for the provisional attention dimension; all decisions are compatible with returning to autonomous work.",
5
+ "required": ["decision", "rationale"],
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "decision": {"type": "string", "enum": ["resume", "revise_scope"]},
9
+ "rationale": {"type": "string", "minLength": 1},
10
+ "instructions": {"type": "string", "minLength": 1},
11
+ "answered_questions": {"type": "array", "items": {"type": "string", "minLength": 1}, "default": []}
12
+ }
13
+ }