@zalom/plastic 2.0.0-alpha.20 → 2.0.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PLASTIC.md +20 -18
- package/bin/test +24 -4
- package/hooks/call-budget +4 -0
- package/hooks/hooks.json +12 -0
- package/package.json +1 -1
- package/scripts/doctor.rb +79 -4
- package/scripts/hook-call-budget +222 -0
- package/scripts/hook-session-start +307 -319
- package/scripts/insight-append +18 -4
- package/scripts/lib/compact_instructions.rb +5 -5
- package/scripts/lib/doctor_core.rb +2 -1
- package/scripts/lib/graph_edges.rb +16 -0
- package/scripts/lib/hook_registry.rb +14 -2
- package/scripts/lib/installer_core.rb +13 -5
- package/scripts/lib/meter_watch.rb +179 -0
- package/scripts/lib/node_packet.rb +27 -5
- package/scripts/lib/runner_dispatch.rb +29 -5
- package/scripts/lib/runner_policy.rb +31 -0
- package/scripts/lib/runner_proposals.rb +21 -0
- package/scripts/lib/session_usage.rb +190 -0
- package/scripts/meter-watch +57 -0
- package/scripts/read-config +3 -3
- package/scripts/runner +5 -0
- package/scripts/session-usage +56 -0
- package/scripts/skill-lint +115 -6
- package/skills/auto/SKILL.md +61 -63
- package/skills/auto/references/agent-architecture.md +10 -8
- package/skills/auto/references/human-report-contract.md +1 -1
- package/skills/conventions/references/completion-and-done.md +7 -7
- package/skills/conventions/references/locks-and-worktrees.md +3 -3
- package/skills/conventions/references/maintenance-and-revisions.md +1 -1
- package/skills/doctor/report.md +1 -1
- package/skills/intent-continuing/references/boarding-matrix.md +2 -2
- package/skills/intent-creating/SKILL.md +58 -133
- package/skills/intent-ending/SKILL.md +48 -56
- package/skills/intent-ending/evals/evals.json +1 -1
- package/skills/intent-executing/SKILL.md +39 -134
- package/skills/intent-speccing/SKILL.md +3 -0
- package/skills/releasing/SKILL.md +1 -1
- package/skills/releasing/references/release-lines.md +1 -1
- package/skills/tutorial/SKILL.md +2 -1
- package/skills/tutorial/references/track-1-guided.md +21 -40
- package/skills/tutorial/references/track-2-auto.md +2 -2
- package/templates/agents.md +2 -2
- package/templates/config.yml +3 -3
package/skills/auto/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plastic-auto
|
|
3
3
|
description: >-
|
|
4
|
-
Autonomous intent delivery - a background team takes a registered intent from How to
|
|
4
|
+
Autonomous intent delivery - a background team takes a registered intent from How to End.
|
|
5
5
|
Use when user says "auto", "take it from here", "deliver this", or when a thinking
|
|
6
6
|
conversation concludes and the user confirms autonomous execution. Requires an active intent
|
|
7
7
|
in INDEX.md.
|
|
@@ -13,20 +13,18 @@ user-invocable: true
|
|
|
13
13
|
Announce: "Taking over intent [ID] - [name] for autonomous delivery."
|
|
14
14
|
|
|
15
15
|
**Advisory (not a rule).** At auto-mode start, recommend once that the user run this
|
|
16
|
-
orchestrating
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
deliberately; the auto pipeline never dispatches them.
|
|
16
|
+
orchestrating session on the best available thinking model (Fable, Opus, or whatever supersedes
|
|
17
|
+
them); this is advice only, and dispatched agents keep their configured model, never resolving
|
|
18
|
+
to Fable without an explicit `agents.models.<name>` config override. `plastic-advisor` and
|
|
19
|
+
`plastic-faux-advisor` are consultation roles the user or this session summons deliberately;
|
|
20
|
+
the auto pipeline never dispatches them.
|
|
22
21
|
|
|
23
22
|
## Precondition
|
|
24
23
|
|
|
25
24
|
An active intent MUST exist in INDEX.md. If none exists, refuse: "No active intent found.
|
|
26
25
|
Create one first with /plastic-intent-creating."
|
|
27
26
|
|
|
28
|
-
If several active intents exist, ask
|
|
29
|
-
at boarding, before delivery starts).
|
|
27
|
+
If several active intents exist, ask which to deliver (the one question auto asks at boarding).
|
|
30
28
|
|
|
31
29
|
**Picking work when no intent is specified.** If the user says "auto" without naming an intent
|
|
32
30
|
and none is active, consult the roadmap first (the primary planning surface), then fall back to
|
|
@@ -42,9 +40,8 @@ frontier batch is still delivering, report it and wait, never dispatch a later b
|
|
|
42
40
|
`exhausted` means fall back to `ruby ~/.plastic/scripts/dashboard.rb all --json` and work its
|
|
43
41
|
`dispatchable_queue` in `rank` order, leaving `human_only` and `next_big_thing` for the user.
|
|
44
42
|
|
|
45
|
-
QMD-first (when available): when the user describes the work
|
|
46
|
-
`ruby ~/.plastic/scripts/qmd-sync search "<terms>"`
|
|
47
|
-
authoritative intent file for the hit you take over. The command is a no-op when QMD is absent.
|
|
43
|
+
QMD-first (when available): when the user describes the work instead of naming an intent, run
|
|
44
|
+
`ruby ~/.plastic/scripts/qmd-sync search "<terms>"` first, then open the hit's authoritative intent file; a no-op when QMD is absent.
|
|
48
45
|
|
|
49
46
|
## Take the intent (do this FIRST)
|
|
50
47
|
|
|
@@ -74,29 +71,29 @@ owner override. Do not proceed as the owner after an exit 1.
|
|
|
74
71
|
Read `../plastic-conventions/references/locks-and-worktrees.md` for what the lock and the
|
|
75
72
|
worktree mean and the station table behind them. Code edits happen only inside the worktree.
|
|
76
73
|
|
|
77
|
-
## The shape
|
|
74
|
+
## The shape
|
|
78
75
|
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
Work is a graph (`graph.md`: Goal, Decisions, Graph, Status; one `nodes/*.md` per node) or,
|
|
77
|
+
for work small enough to skip speccing, delivered inline with no separate plan review. There
|
|
78
|
+
is no intent tier and no stage agent; depth follows the work.
|
|
81
79
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
| 3. Execute, tests first | boot 2, `plastic-executor` | the red commit (the matrix's tests, failing), then the code, then a green suite |
|
|
87
|
-
| 4. Review by risk | boot 3 only when risk calls for it (below) | a pass or a list of fixes the executor applies |
|
|
88
|
-
| 5. One suite run, then close | this session | `outcome.md`, `end-intent`, the roadmap ledger |
|
|
80
|
+
`runner step` computes readiness and prints a spawn block per dispatched node - agent, model,
|
|
81
|
+
packet path, the test command, the call cap - fenced for a session to paste into the Agent
|
|
82
|
+
tool; the runner never spawns (327 D42). `runner status` renders the ledger; `runner answer`
|
|
83
|
+
closes a `needs_decision` node.
|
|
89
84
|
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
A lead is a choice, not a requirement (D8, 355). A lead earns its keep on a graph carrying a
|
|
86
|
+
decision node, weighing its `needs_decision` stop; a graph with none runs end to end from
|
|
87
|
+
`runner step` alone. When this session leads, it is the `plastic-enforcer` role, never a
|
|
88
|
+
dispatched agent.
|
|
92
89
|
|
|
93
90
|
## Team
|
|
94
91
|
|
|
95
|
-
- **plastic-enforcer**: this session. Writes the Why and How record, dispatches,
|
|
96
|
-
verifies, closes.
|
|
92
|
+
- **plastic-enforcer**: this session. Writes the Why and How record, dispatches, applies
|
|
93
|
+
review findings, verifies, closes.
|
|
97
94
|
- **plastic-executor**: one dispatch per intent, implements the consolidated action tests first,
|
|
98
95
|
ticks the checklist, appends `## Insights`, drives the suite green.
|
|
99
|
-
- **the plan reviewer**:
|
|
96
|
+
- **the plan reviewer**: an optional dispatch before code, from `plastic-intent-executing`'s
|
|
100
97
|
`plan-reviewer-prompt.md`; a fresh agent, never the lead.
|
|
101
98
|
- **the post-execution reviewer**: dispatched only by the risk rule, from
|
|
102
99
|
`code-quality-reviewer-prompt.md`; a fresh agent, never the maker.
|
|
@@ -148,12 +145,11 @@ each one as a delegate before (or when) it needs to write into the intent dir:
|
|
|
148
145
|
|
|
149
146
|
Only the owner can delegate. Delegates cannot re-delegate or release.
|
|
150
147
|
|
|
151
|
-
Headless note: in a headless or background run the session id may be unset; the arm verb then
|
|
152
|
-
|
|
153
|
-
written path. Verify the lock with `plastic-lock status` rather than assuming.
|
|
148
|
+
Headless note: in a headless or background run the session id may be unset; the arm verb then keys the lock by a derived key and the record hook still writes the ledger.
|
|
149
|
+
Verify with `plastic-lock status` rather than assuming.
|
|
154
150
|
|
|
155
151
|
Solo fallback: on a harness with no agent dispatch (Codex CLI today), this session walks the
|
|
156
|
-
|
|
152
|
+
graph (or the plan) itself, still writing the matrix and the tests first and reviewing its own
|
|
157
153
|
plan against the matrix before code, saying so in `## Insights`.
|
|
158
154
|
|
|
159
155
|
## Stage-Aware Entry
|
|
@@ -168,7 +164,7 @@ ledger is missing (then rebuild it with `Savepoint.rebuild_savepoint`).
|
|
|
168
164
|
| `Why spec.md created` | How |
|
|
169
165
|
| `How plan.md created` / `How checklist.md created` / `Exec started` | Exec (verify plan, matrix, checklist) |
|
|
170
166
|
| `Exec outcome.md created` | Exec done; complete the intent |
|
|
171
|
-
| `
|
|
167
|
+
| A terminal savepoint line (`delivered` or `abandoned`) | Terminal; do not resume |
|
|
172
168
|
| A node or `Intent` transition line (`n1 running ...`, `Intent needs_decision ...`) | Exec; a graph delivery is in progress - drive it through `scripts/runner`'s three public verbs, `step` (one turn of the dispatch loop), `status` (renders ledger state, safe to poll constantly), and `answer` (closes a `needs_decision` node) - read node status through `NodeLedger.status` before dispatching anything, never re-derive it by eye |
|
|
173
169
|
|
|
174
170
|
Filesystem fallback, in order: `checklist.md` with items checked means resume Exec from the
|
|
@@ -179,42 +175,43 @@ Announce which stage you are entering and why.
|
|
|
179
175
|
|
|
180
176
|
## Why (the lead)
|
|
181
177
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
178
|
+
For a graph delivery, Why is already written into `graph.md`'s Goal and Decisions; nothing
|
|
179
|
+
else to do here. For work with no graph: read `## Context` and `### Decisions`, assess the
|
|
180
|
+
gaps, research them yourself (code, docs, related intents through `## Links`, the web if
|
|
181
|
+
needed; no questions to the human), record each decision in `## Context > ### Decisions` with
|
|
182
|
+
its rationale, log it in `## Insights` with the `(autonomous)` marker through
|
|
183
|
+
`scripts/insight-append`, and write `spec.md` only when the intent needs one (speccing is
|
|
184
|
+
optional). Then How.
|
|
189
185
|
|
|
190
186
|
## How (the lead), then the plan review
|
|
191
187
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
188
|
+
For a graph delivery, How is `graph.md` itself: no `plan.md`, no separate plan review (D1,
|
|
189
|
+
341). For work with no graph: write `plan.md` (numbered steps) and at least one real
|
|
190
|
+
`actions/ACTION_N.md` carrying the failure-mode matrix (one row per operation, the failure
|
|
191
|
+
mode, the test that catches it; a `.gitkeep`-only `actions/` is not a finished How), then
|
|
192
|
+
`checklist.md` covering every action. The plan reviewer is optional, not a required step:
|
|
193
|
+
when the delivery warrants review before code, dispatch it (boot 1) with
|
|
194
|
+
`plastic-intent-executing`'s `plan-reviewer-prompt.md`, the spawn preamble, and the intent
|
|
195
|
+
directory, apply every finding to the spec, the matrix, and the tests, and record what was
|
|
196
|
+
dropped and why in the action file's review notes. A REVISE verdict is applied and not
|
|
197
|
+
re-reviewed unless a finding changes a decision.
|
|
198
|
+
|
|
199
|
+
Print `ruby ~/.plastic/scripts/report-screen plan <intent_dir>` as the first characters of
|
|
200
|
+
the reply, nothing before it, no fence, before dispatching the executor (see
|
|
201
|
+
`references/human-report-contract.md` for the full binding table). It informs; it does not wait.
|
|
206
202
|
|
|
207
203
|
Then Exec.
|
|
208
204
|
|
|
209
205
|
## Exec (the executor)
|
|
210
206
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
with the missing context; BLOCKED stops under the error procedure.
|
|
217
|
-
|
|
207
|
+
For a graph delivery, `runner step` prints the spawn block for the next ready node; paste it
|
|
208
|
+
into the Agent tool, verbatim. For work with no graph, dispatch `plastic-executor` (boot 2)
|
|
209
|
+
through `plastic-intent-executing` with the whole consolidated action pasted in.
|
|
210
|
+
|
|
211
|
+
1. Read the executor's return by code: DONE or DONE_WITH_CONCERNS proceeds; NEEDS_CONTEXT
|
|
212
|
+
re-dispatches with the missing context; BLOCKED stops under the error procedure.
|
|
213
|
+
2. Tick the checklist as items land (the executor does this); verify tick-versus-diff against
|
|
214
|
+
the diff. A mismatch is a review finding, not a lead cleanup.
|
|
218
215
|
|
|
219
216
|
## Review by risk (boot 3, only when a rule fires)
|
|
220
217
|
|
|
@@ -224,13 +221,14 @@ holds, each checkable from disk with no judgment; otherwise the green suite is t
|
|
|
224
221
|
1. `git diff --name-only <red-commit>..HEAD` touches a path on the risk list in
|
|
225
222
|
`references/agent-architecture.md` (hooks, the lock, the arming module, the installer, a
|
|
226
223
|
release file).
|
|
227
|
-
2. A row of any `actions/ACTION_N.md`
|
|
228
|
-
diff, or a test the green run did not execute.
|
|
224
|
+
2. A row of any failure-mode matrix (an `actions/ACTION_N.md` or a `nodes/*.md` file) names a
|
|
225
|
+
test file that is not in that diff, or a test the green run did not execute.
|
|
229
226
|
3. The executor's completion report carries a status other than `delivered`, or a non-empty
|
|
230
227
|
`deviations` or `blockers` field.
|
|
231
228
|
|
|
232
229
|
The reviewer returns a pass or a list of fixes; the executor (re-dispatched) applies them, then
|
|
233
|
-
the suite runs once more.
|
|
230
|
+
the suite runs once more. On a graph, the risk rule maps onto the verify nodes named in
|
|
231
|
+
`graph.md`'s decisions; at most one review-fix round, never more.
|
|
234
232
|
## Project Creation
|
|
235
233
|
|
|
236
234
|
If the plan calls for creating a new project, determine the path from `~/.plastic/config.yml`
|
|
@@ -29,12 +29,13 @@ in 2.0, intent 304; the lead writes the Why and How record itself):
|
|
|
29
29
|
- **plastic-executor** (Exec): commits the matrix's tests red, writes the code, checks off
|
|
30
30
|
`checklist.md`, appends `## Insights`, and drives the suite green.
|
|
31
31
|
- **the plan reviewer**: a fresh agent on `plastic-intent-executing`'s
|
|
32
|
-
`plan-reviewer-prompt.md`,
|
|
32
|
+
`plan-reviewer-prompt.md`, an optional dispatch before any code exists.
|
|
33
33
|
- **the post-execution reviewer**: a fresh agent on `code-quality-reviewer-prompt.md`,
|
|
34
34
|
dispatched only when the auto skill's risk rule fires; never the maker.
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
One agent boot (the executor) is the minimum delivery; the plan reviewer is a second,
|
|
37
|
+
optional boot when the lead calls for review before code, and the post-execution reviewer is
|
|
38
|
+
a third only when risk calls for it.
|
|
38
39
|
|
|
39
40
|
### Handoff Contracts
|
|
40
41
|
|
|
@@ -44,8 +45,8 @@ the code, the red and green commits, a checked-off checklist, `## Insights`, and
|
|
|
44
45
|
report. Dispatch is sequential on a single branch, because the deliverables share files.
|
|
45
46
|
|
|
46
47
|
The chain: intent `## Intent` / `## Context`, then enriched `## Context` plus `### Decisions`,
|
|
47
|
-
then `spec.md`, then `plan.md` plus `actions/` plus `checklist.md`, then
|
|
48
|
-
the code changes plus a checked-off checklist plus `## Insights`.
|
|
48
|
+
then `spec.md`, then `plan.md` plus `actions/` plus `checklist.md`, then an optional plan
|
|
49
|
+
review, then the code changes plus a checked-off checklist plus `## Insights`.
|
|
49
50
|
|
|
50
51
|
### Spawn Preamble (L2 live-state injection)
|
|
51
52
|
|
|
@@ -88,9 +89,10 @@ not revoke the registered delegate's authorization.
|
|
|
88
89
|
|
|
89
90
|
### Review Ownership
|
|
90
91
|
|
|
91
|
-
The lead owns every review decision: it dispatches the plan reviewer before code
|
|
92
|
-
|
|
93
|
-
never delegates that decision, and neither reviewer is ever
|
|
92
|
+
The lead owns every review decision: it dispatches the plan reviewer before code when one
|
|
93
|
+
runs, takes the review into its own record, and decides from the risk rule whether the
|
|
94
|
+
post-execution reviewer runs. It never delegates that decision, and neither reviewer is ever
|
|
95
|
+
the maker of what it reviews.
|
|
94
96
|
Nothing blocks a write in 2.0 (the gate hooks were removed, intent 302); the lock, the
|
|
95
97
|
worktree, and the record are how the team keeps one delivery in one place.
|
|
96
98
|
|
|
@@ -78,7 +78,7 @@ an executor's intermediate commit, or an agent going idle is NOT one of them:
|
|
|
78
78
|
|
|
79
79
|
| Trigger | Scope |
|
|
80
80
|
|---|---|
|
|
81
|
-
| A savepoint line lands (a stage boundary: Why, How, Exec started, outcome written,
|
|
81
|
+
| A savepoint line lands (a stage boundary: Why, How, Exec started, outcome written, End) | that intent |
|
|
82
82
|
| A review verdict returns (plan review or post-execution review), naming what it changed | that intent |
|
|
83
83
|
| A blocker or needs-input is logged | that intent |
|
|
84
84
|
| A merge or a release lands | that intent |
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
# Completion and
|
|
1
|
+
# Completion and the End Tail
|
|
2
2
|
|
|
3
3
|
This chapter holds what "intent done" means and the End-stage tail.
|
|
4
4
|
|
|
5
5
|
#### What "intent done" means (intent 93)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Completion is one law with three signals, and they must agree. INDEX `## Completed` /
|
|
8
8
|
`## Abandoned` is the single canonical terminal marker: it is the store-wide ledger a fresh
|
|
9
9
|
session reads first, so it wins on any conflict. `outcome.md` is the "deliverable exists"
|
|
10
|
-
signal, and the savepoint `
|
|
11
|
-
agree; when they disagree, INDEX is authoritative and `doctor` flags the mismatch (the
|
|
10
|
+
signal, and the savepoint's terminal `delivered|abandoned` line is the audit echo. All three
|
|
11
|
+
must agree; when they disagree, INDEX is authoritative and `doctor` flags the mismatch (the
|
|
12
12
|
`done_signals` check: `outcome.md` real but still under `## Active`, or terminal without a
|
|
13
|
-
real `outcome.md`, or a terminal intent whose savepoint carries no
|
|
13
|
+
real `outcome.md`, or a terminal intent whose savepoint carries no terminal disposition line).
|
|
14
14
|
|
|
15
15
|
`outcome.md` is mandatory at every terminal transition, delivered and abandoned alike. It
|
|
16
16
|
self-declares its disposition through a `disposition: delivered|abandoned` frontmatter
|
|
@@ -18,8 +18,8 @@ header. The delivered path authors it with the result; the abandoned path author
|
|
|
18
18
|
the abandonment reason and no longer leaves the scaffolded placeholder sentinel in place.
|
|
19
19
|
|
|
20
20
|
The canonical End tail runs in this order, and the QMD reindex is always LAST, after the
|
|
21
|
-
purge: `outcome.md -> INDEX terminal -> savepoint
|
|
22
|
-
-> Lock.release -> purge) -> QMD reindex`. Running the reindex last keeps the index from
|
|
21
|
+
purge: `outcome.md -> INDEX terminal -> the terminal savepoint line -> commit -> disarm
|
|
22
|
+
(Worktree.release -> Lock.release -> purge) -> QMD reindex`. Running the reindex last keeps the index from
|
|
23
23
|
ever referencing a bridge or lock that disarm is about to remove.
|
|
24
24
|
|
|
25
25
|
`scripts/end-intent` performs this order's disarm step (verify the code worktree is clean,
|
|
@@ -84,13 +84,13 @@ Provisioning fails open for intents that touch no project code (pure research or
|
|
|
84
84
|
intents in the global store, or a non-git repo): those get the lock only, and the worktree
|
|
85
85
|
block stays unprovisioned. The fail-open path is always logged, never silent.
|
|
86
86
|
|
|
87
|
-
Cleanup is part of
|
|
87
|
+
Cleanup is part of the End tail: it merges the branch, then removes the worktree. Never leave
|
|
88
88
|
an orphaned worktree behind, and clear a stale worktree reference with `git worktree prune`.
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
#### Intent delivery, station by station
|
|
92
92
|
|
|
93
|
-
How one auto-team intent travels from boarding to
|
|
93
|
+
How one auto-team intent travels from boarding to the End tail, and what the lock, the pointer, and
|
|
94
94
|
the record hook do at each station. Nothing in the third column blocks; the fourth column is
|
|
95
95
|
what gets written down.
|
|
96
96
|
|
|
@@ -101,7 +101,7 @@ what gets written down.
|
|
|
101
101
|
| Why | `spec.md` | owner writes refresh the lease (lock file mtime heartbeat) | savepoint `Why started`, `Why spec.md created` |
|
|
102
102
|
| How | `plan.md`, `actions/ACTION_N.md` (at least one), `checklist.md` | heartbeat on writes | savepoint `How started`, `How plan.md created`, `How checklist.md created`, `Exec started` |
|
|
103
103
|
| Exec | code on the intent branch, checklist checked off | heartbeat; code edits confined to the provisioned worktree; delegates write under the owner's lock | checklist boxes; savepoint milestones; the day-ledger line promotes when a project file lands |
|
|
104
|
-
| End (done) | mandatory `outcome.md` (`disposition: delivered\|abandoned`), INDEX moves to Completed or Abandoned | ordered End tail: verify, merge and remove worktrees, disarm clears `delivery.lock`, then the pointer is purge-eligible, and the QMD reindex runs LAST (after purge); `end-intent` backfills a placeholder `outcome.md` from the record and its structure check reports (never refuses) | savepoint `
|
|
104
|
+
| End (done) | mandatory `outcome.md` (`disposition: delivered\|abandoned`), INDEX moves to Completed or Abandoned | ordered End tail: verify, merge and remove worktrees, disarm clears `delivery.lock`, then the pointer is purge-eligible, and the QMD reindex runs LAST (after purge); `end-intent` backfills a placeholder `outcome.md` from the record and its structure check reports (never refuses) | the savepoint's terminal `delivered` (or `abandoned`) line; takeover audits, if any, remain in savepoint.md |
|
|
105
105
|
| Maintenance (Future, Terminal, or Active-with-a-stale-or-no-lock) | `revisions.md` move-and-record entries | detects (never acquires) `delivery.lock`; defers and reports while the target's lock is FRESH (`Lock.fresh?`); a stale or absent lock is not-active, maintenance proceeds | append-only, rule-tagged `revisions.md` entry written in the same operation as the change, or the change is refused; lands via a fresh branch off store main merged back as one closed op, never `git add -A` |
|
|
106
106
|
|
|
107
107
|
## The write guard is not residue
|
|
@@ -8,7 +8,7 @@ Plastic separates two different things an earlier doctrine blurred under one wor
|
|
|
8
8
|
"immutable." WORK is the delivered CONTENT an intent produced: the code and project files a
|
|
9
9
|
delivery changed, the research it recorded, the outcome it wrote. Once the intent is terminal
|
|
10
10
|
(Completed or Abandoned), that content is immutable - the only way to change it is another
|
|
11
|
-
intent that continues or reverts it. Editing a
|
|
11
|
+
intent that continues or reverts it. Editing a terminal intent's own artifacts so it looks like it
|
|
12
12
|
delivered something different, or that parts are missing, is forbidden (the book analogy:
|
|
13
13
|
never rewrite the text on the pages of an old, valuable book).
|
|
14
14
|
|
package/skills/doctor/report.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
core_files -> "Core Files"
|
|
19
19
|
project_stores -> "Project Stores"
|
|
20
20
|
deprecations -> "Deprecations"
|
|
21
|
-
done_signals -> "
|
|
21
|
+
done_signals -> "Completion Signals"
|
|
22
22
|
session_ledger -> "Session Ledger" (global store only)
|
|
23
23
|
4. For each check within a category, emit one line with the status icon
|
|
24
24
|
and the check message. If the check has non-empty details, list them
|
|
@@ -12,7 +12,7 @@ Classify from the last line alone, then verify only that line's artifact is real
|
|
|
12
12
|
| `How started` / `How plan.md created` | (How in progress) | **How** | finish `plan.md` and `checklist.md` |
|
|
13
13
|
| `How checklist.md created` / `Exec started` | How | **Exec** | do the work, check off the checklist |
|
|
14
14
|
| `Exec outcome.md created` | Exec | **ready to complete** | the ending procedure (`plastic-intent-ending`) |
|
|
15
|
-
| `
|
|
15
|
+
| A terminal savepoint line (`delivered` or `abandoned`) | terminal | **report only** | immutable; ask what is next |
|
|
16
16
|
| A node or `Intent` transition line (`n1 running ...`, `Intent needs_decision ...`) | Exec | **Exec** | a graph delivery is in progress; read node status through `NodeLedger.status`, never re-derive it by eye |
|
|
17
17
|
|
|
18
18
|
## Per-stage behaviour (what "continue" means)
|
|
@@ -24,7 +24,7 @@ Classify from the last line alone, then verify only that line's artifact is real
|
|
|
24
24
|
The first unchecked `checklist.md` item is the next step; the newest `## Insights` entry
|
|
25
25
|
supplies the context.
|
|
26
26
|
- **ready to complete**: `outcome.md` is real; run the ending procedure.
|
|
27
|
-
- **
|
|
27
|
+
- **End**: terminal. Report the outcome, ask what is next. Never reopen; `INDEX.md` is
|
|
28
28
|
authoritative.
|
|
29
29
|
|
|
30
30
|
## Notes
|
|
@@ -6,110 +6,51 @@ user-invocable: true
|
|
|
6
6
|
|
|
7
7
|
# Creating an Intent
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Creating writes the thought to disk: an id, a directory, a born-complete intent file.
|
|
10
|
+
Nothing else runs here; specifying, planning, and execution are separate, later skills.
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
10
13
|
- User starts new work ("build X", "fix Y", "research Z")
|
|
11
14
|
- No active intent matches the current task
|
|
12
15
|
- User explicitly says "new intent" or "create intent"
|
|
13
16
|
- An agent discovers work needed during implementation
|
|
14
17
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
When creating a tactical intent in a project store:
|
|
33
|
-
- Read the project's `AGENTS.md` for project context and decisions
|
|
34
|
-
- Link back to the project's governing intent (from `projects.yml` `parent` field) via `sources` (the project genuinely is formed from its founding intent, a true formative edge, reciprocated on the founding intent's `chain`)
|
|
35
|
-
- Add `[[global:<parent_ID>]]` backlink in `## Links`
|
|
36
|
-
- The intent's Folgezettel ID is scoped to the project store (run `folgezettel-id` against the project's store at `~/.plastic/projects/{slug}/store/`)
|
|
37
|
-
|
|
38
|
-
## Workflow
|
|
18
|
+
## Decide the store and the shape, before scaffolding
|
|
19
|
+
|
|
20
|
+
- **CWD inside a registered project** (`~/.plastic/projects.yml`), or the user names a
|
|
21
|
+
project by slug -> **project intent (tactical)**, `~/.plastic/projects/{slug}/store/`,
|
|
22
|
+
linked back to the project's governing intent (`projects.yml` `parent` field) via
|
|
23
|
+
`sources`, with `[[global:<parent_ID>]]` in `## Links` and a Folgezettel id scoped to
|
|
24
|
+
that store.
|
|
25
|
+
- **No match** -> **global intent (strategic)**, `~/.plastic/store/`.
|
|
26
|
+
- **Duplicate or predecessor check (QMD-first):** before allocating an id, run
|
|
27
|
+
`ruby ~/.plastic/scripts/qmd-sync search "<terms>"` (a no-op when QMD is absent, fall
|
|
28
|
+
back to INDEX.md) so a near-duplicate is reused and a true predecessor lands in
|
|
29
|
+
`--sources`.
|
|
30
|
+
- **Branch vs root**, decided by meaning, not by "a parent in mind": branch
|
|
31
|
+
(`--parent <parent_id>`) when the intent only makes sense as part of the parent's work;
|
|
32
|
+
root with `--sources <ascendant_id>` when it was created from another intent's
|
|
33
|
+
lifecycle; root with no `--sources` when it is merely related (record that relation on
|
|
34
|
+
the PREDECESSOR's `chain` instead - topic similarity alone is never a `sources` edge).
|
|
39
35
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
### 2. Check for a Duplicate or Predecessor (QMD-first)
|
|
46
|
-
|
|
47
|
-
QMD-first (when available): before scanning the store with grep/Read, run
|
|
48
|
-
`ruby ~/.plastic/scripts/qmd-sync search "<terms>"` to surface candidate, prior, or duplicate
|
|
49
|
-
intents, then open the authoritative intent file for any hit you act on. The command is a no-op
|
|
50
|
-
when QMD is absent, so fall back to the existing INDEX.md / file scan. Do this before allocating
|
|
51
|
-
the id so a near-duplicate can be reused and a true predecessor can be set in `--sources`.
|
|
52
|
-
|
|
53
|
-
### 3. Decide Branch vs Root
|
|
36
|
+
When a branch intent exists because a late ruling arrived AFTER its parent was already
|
|
37
|
+
completed, the parent is restored to v1 via `scripts/restore-intent-v1`, never a hand-run
|
|
38
|
+
`git checkout`/revert (see `plastic-conventions > references/maintenance-and-revisions.md`,
|
|
39
|
+
WORK vs MAINTENANCE).
|
|
54
40
|
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
`## Links` is a DERIVED view of `sources`/`chain`: never hand-write a `## Links` line, add
|
|
42
|
+
the frontmatter edge and reproject. Links follow context influence (a `chain` edge needs
|
|
43
|
+
the candidate's context to materially help deliver this intent), never shared files or a
|
|
44
|
+
similarity score; `scripts/link-suggest` and `scripts/project-links` gather candidates.
|
|
45
|
+
Read `../plastic-conventions/references/knowledge-graph.md` for the full linking doctrine:
|
|
46
|
+
the tiers of influence, sources versus chain, and how `## Links` is derived.
|
|
57
47
|
|
|
58
|
-
|
|
59
|
-
makes sense as part of the parent's work. Pass `--parent <parent_id>`.
|
|
60
|
-
- **Root (`15`, `16`)**: an independent thought. Two cases, decided by ORIGIN:
|
|
61
|
-
- **Created from another intent** (it emerged from that intent's lifecycle): make it a
|
|
62
|
-
root and set `--sources <ascendant_id>`. `sources` is reserved for true created-from /
|
|
63
|
-
direct-ascendant provenance (D1).
|
|
64
|
-
- **Merely related to / inspired by another intent** (it did NOT come out of that
|
|
65
|
-
intent's lifecycle): carry NO `--sources`. Record the relation on the PREDECESSOR's
|
|
66
|
-
`chain` instead (the related-but-not-spawned rule); the `## Links` section follows
|
|
67
|
-
from that edge, you do not write it by hand.
|
|
68
|
-
- **Rule of thumb:** if the intent could exist without its parent, make it a root; only set
|
|
69
|
-
`--sources` when it was genuinely created from / emerged from that intent's lifecycle.
|
|
70
|
-
Topic similarity alone is not a `sources` edge.
|
|
48
|
+
## Scaffold
|
|
71
49
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
`
|
|
76
|
-
rule and the tool.
|
|
77
|
-
|
|
78
|
-
`## Links` is a DERIVED view of `sources`/`chain`. Never hand-write a `## Links` line; add the
|
|
79
|
-
frontmatter edge and reproject. Links are decided by context influence (a `chain` edge has a high
|
|
80
|
-
bar: the candidate's context must materially help deliver this intent), not by shared files or a
|
|
81
|
-
similarity score. To gather candidates with their context and record an edge, use the
|
|
82
|
-
`scripts/link-suggest` and `scripts/project-links`.
|
|
83
|
-
|
|
84
|
-
Read `../plastic-conventions/references/knowledge-graph.md` for the full linking doctrine: the
|
|
85
|
-
tiers of influence, sources versus chain, and how the `## Links` projection is derived. This path
|
|
86
|
-
resolves relative to this skill's own installed directory.
|
|
87
|
-
|
|
88
|
-
### 4. Determine Intent Properties
|
|
89
|
-
|
|
90
|
-
Ask or infer from context:
|
|
91
|
-
- **intent**: one-line description
|
|
92
|
-
- **slug**: short hyphenated handle for the directory name
|
|
93
|
-
- **author**: `human` | `claude-code` | other agent name
|
|
94
|
-
- **sources**: the direct ascendant(s) this intent was created from / emerged from the
|
|
95
|
-
lifecycle of (formation, not topic similarity), e.g., `4a1`. For a project intent,
|
|
96
|
-
include the governing intent's id. A branch's structural parent is ALSO recorded in
|
|
97
|
-
`sources` (the ID carries it for the human/paper tree, `sources` carries it for
|
|
98
|
-
software), which `new-intent` does automatically (see `new-intent:126`).
|
|
99
|
-
- **tags**: freeform list (use `project-<name>` for project membership)
|
|
100
|
-
|
|
101
|
-
`chain` carries what this intent spawns AND related-but-not-spawned successors it leads to;
|
|
102
|
-
it starts empty and is populated later. See
|
|
103
|
-
[`how-plastic-sources-and-chains-intents.md`](https://github.com/zalom/plastic/blob/main/docs/concepts/how-plastic-sources-and-chains-intents.md) for the full model.
|
|
104
|
-
Place the intent in `## Active` or `## Future` in INDEX.md (status is
|
|
105
|
-
convention-derived, not a frontmatter field).
|
|
106
|
-
|
|
107
|
-
### 5. Scaffold via new-intent (single call)
|
|
108
|
-
|
|
109
|
-
Delegate id allocation, directory and file creation, the born-complete intent
|
|
110
|
-
file, the sentinel placeholder lifecycle files, the reciprocal file links, and
|
|
111
|
-
self-validation to one `new-intent` invocation. Do NOT hand-author any of these
|
|
112
|
-
files.
|
|
50
|
+
One call does the rest: id allocation, the directory, `actions/` and `resources/`, the
|
|
51
|
+
born-complete intent file, sentinel placeholder lifecycle files (each marked
|
|
52
|
+
`<!-- plastic:placeholder -->` so no stage detector reads them as reached), reciprocal
|
|
53
|
+
`[[id]]` links, and self-validation. Do NOT hand-author any of these files.
|
|
113
54
|
|
|
114
55
|
```bash
|
|
115
56
|
ruby ~/.plastic/scripts/new-intent \
|
|
@@ -118,47 +59,31 @@ ruby ~/.plastic/scripts/new-intent \
|
|
|
118
59
|
[--sources "id,id"] [--tags "project-<slug>,tag"]
|
|
119
60
|
```
|
|
120
61
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
placeholder `spec.md`/`plan.md`/`checklist.md`/`outcome.md` (each marked
|
|
125
|
-
`<!-- plastic:placeholder -->` so no stage detector reads them as reached), wires
|
|
126
|
-
the reciprocal `[[id]]` links, and self-validates (frontmatter plus the sanctioned
|
|
127
|
-
`##` sections). It prints the created directory path and exits 0.
|
|
128
|
-
|
|
129
|
-
It does NOT touch INDEX.md, git, or project creation: those stay in this skill
|
|
130
|
-
(steps 6 to 9 below).
|
|
131
|
-
|
|
132
|
-
If `new-intent` exits non-zero, read the stderr report and fix the inputs (slug,
|
|
133
|
-
intent, sources). Do not commit or announce an intent that did not scaffold
|
|
134
|
-
cleanly, and do not work around the failure by hand-writing the files.
|
|
135
|
-
|
|
136
|
-
### 6. If Implementation Intent Spawns a Project
|
|
137
|
-
|
|
138
|
-
When the user says "start building" or the plan calls for a new project, invoke the
|
|
139
|
-
`plastic-project-creating` skill; it owns project directory creation, AGENTS.md
|
|
140
|
-
population, projects.yml registration, store provisioning, and the auto-commit of
|
|
141
|
-
both stores. Add `project-<slug>` to this intent's `tags` array either before
|
|
142
|
-
invoking it or as part of that skill's handoff.
|
|
143
|
-
|
|
144
|
-
### 7. Update INDEX.md
|
|
62
|
+
It does NOT touch INDEX.md, git, or project creation (Finish, below). If it exits
|
|
63
|
+
non-zero, read the stderr report, fix the inputs (slug, intent, sources), and retry;
|
|
64
|
+
never work around a failed scaffold by hand-writing the files.
|
|
145
65
|
|
|
146
|
-
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
### 8. Auto-commit
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
cd <store-root> && git add . && git commit -m "feat: create intent ID - [name]"
|
|
155
|
-
```
|
|
66
|
+
`chain` carries what this intent spawns AND related-but-not-spawned successors it leads
|
|
67
|
+
to; it starts empty and is populated later. See
|
|
68
|
+
[`how-plastic-sources-and-chains-intents.md`](https://github.com/zalom/plastic/blob/main/docs/concepts/how-plastic-sources-and-chains-intents.md)
|
|
69
|
+
for the full model.
|
|
156
70
|
|
|
157
|
-
|
|
71
|
+
## Finish
|
|
158
72
|
|
|
159
|
-
|
|
73
|
+
1. **Global intent:** add a line to `~/.plastic/INDEX.md` under `## Active` (or
|
|
74
|
+
`## Future`) and the right cluster. **Project intent:** no global INDEX.md change.
|
|
75
|
+
2. When the user says "start building" or the plan calls for a new project, invoke
|
|
76
|
+
`plastic-project-creating`; it owns project directory creation, AGENTS.md population,
|
|
77
|
+
`projects.yml` registration, store provisioning, and the auto-commit of both stores.
|
|
78
|
+
Add `project-<slug>` to this intent's `tags` either before invoking it or as part of
|
|
79
|
+
that skill's handoff.
|
|
80
|
+
3. Commit: `cd <store-root> && git add . && git commit -m "feat: create intent ID - [name]"`.
|
|
81
|
+
4. Announce: "Created intent ID - [name]. Placed in: [Active|Future]. Store:
|
|
82
|
+
[global|project:<slug>]."
|
|
160
83
|
|
|
161
84
|
## References
|
|
162
85
|
|
|
163
|
-
- Read `references/lifecycle.md` for the full What
|
|
164
|
-
-
|
|
86
|
+
- Read `references/lifecycle.md` for the full What->Why->How->Exec stage detail and the
|
|
87
|
+
filesystem-as-schema conventions.
|
|
88
|
+
- Read `references/wikilinks.md` for the wikilink syntax table when hand-checking a
|
|
89
|
+
`## Links` projection.
|