@zalom/plastic 2.0.0-alpha.1 → 2.0.0-alpha.11

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 (55) hide show
  1. package/bin/lib/context_budget.rb +453 -0
  2. package/bin/plastic-bench +78 -0
  3. package/hooks/hooks.json +12 -0
  4. package/hooks/message-display +81 -0
  5. package/hooks/savepoint +5 -5
  6. package/package.json +1 -1
  7. package/scripts/agent-report +8 -2
  8. package/scripts/append-ledger +16 -3
  9. package/scripts/dashboard.rb +39 -10
  10. package/scripts/day-summary +53 -0
  11. package/scripts/doctor.rb +163 -0
  12. package/scripts/end-intent +93 -0
  13. package/scripts/hook-capture +21 -8
  14. package/scripts/hook-close +3 -1
  15. package/scripts/hook-message-display +74 -0
  16. package/scripts/hook-record +12 -4
  17. package/scripts/hook-savepoint +45 -0
  18. package/scripts/hook-session-start +34 -1
  19. package/scripts/intent-screen +77 -0
  20. package/scripts/lib/arm.rb +26 -1
  21. package/scripts/lib/compact_instructions.rb +56 -0
  22. package/scripts/lib/day_summary.rb +211 -0
  23. package/scripts/lib/doctor_core.rb +52 -3
  24. package/scripts/lib/doctor_session_ledger.rb +52 -0
  25. package/scripts/lib/handoff.rb +184 -0
  26. package/scripts/lib/hook_registry.rb +14 -0
  27. package/scripts/lib/installer_core.rb +117 -11
  28. package/scripts/lib/intent_screen.rb +309 -0
  29. package/scripts/lib/intent_screen_ansi.rb +262 -0
  30. package/scripts/lib/message_display.rb +290 -0
  31. package/scripts/lib/report_screen.rb +671 -0
  32. package/scripts/lib/savepoint.rb +14 -0
  33. package/scripts/lib/screen_paint.rb +276 -0
  34. package/scripts/lib/session_close.rb +22 -2
  35. package/scripts/lib/session_git.rb +49 -18
  36. package/scripts/lib/session_ledger.rb +124 -0
  37. package/scripts/plastic-lock +8 -1
  38. package/scripts/read-config +3 -0
  39. package/scripts/report-screen +157 -0
  40. package/scripts/rollback.rb +6 -0
  41. package/scripts/savepoint-note +67 -0
  42. package/scripts/spawn-preamble +9 -2
  43. package/scripts/write-handoff +60 -0
  44. package/skills/auto/SKILL.md +15 -8
  45. package/skills/auto/references/human-report-contract.md +59 -53
  46. package/skills/conventions/references/locks-and-worktrees.md +12 -0
  47. package/skills/intent-continuing/SKILL.md +31 -22
  48. package/skills/intent-continuing/references/boarding-matrix.md +5 -5
  49. package/skills/intent-continuing/references/context-management.md +1 -1
  50. package/skills/intent-ending/SKILL.md +8 -2
  51. package/skills/intent-executing/SKILL.md +6 -0
  52. package/templates/config.yml +5 -0
  53. package/templates/intent-screen.md +17 -0
  54. package/templates/outcome.md +14 -1
  55. package/templates/report-state.md +11 -0
@@ -1,8 +1,8 @@
1
- # Boarding matrix: which station a resume lands at
1
+ # Boarding matrix: which stage a resume lands at
2
2
 
3
- The station is derived from `savepoint.md`'s last line plus the real artifacts on disk.
3
+ The stage is derived from `savepoint.md`'s last line plus the real artifacts on disk.
4
4
  Classify from the last line alone, then verify only that line's artifact is real
5
- (sentinel-aware). On drift, rebuild the ledger from disk and note it.
5
+ (sentinel-aware). When the ledger is stale, rebuild it from disk and note it.
6
6
 
7
7
  | savepoint last line | latest delivered | lands at | continue with |
8
8
  |---|---|---|---|
@@ -10,11 +10,11 @@ Classify from the last line alone, then verify only that line's artifact is real
10
10
  | `Why started` (spec still sentinel) | What | **Why** | continue the conversation; rulings land as insights |
11
11
  | `Why spec.md created` | Why | **How** | the action files, `plan.md`, `checklist.md` |
12
12
  | `How started` / `How plan.md created` | (How in progress) | **How** | finish `plan.md` and `checklist.md` |
13
- | `How checklist.md created` / `Exec started` | How | **Exec** | do the work, tick the checklist |
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
  | `Done delivered` / `Done abandoned` | terminal | **report only** | immutable; ask what is next |
16
16
 
17
- ## Per-station behaviour (what "continue" means)
17
+ ## Per-stage behaviour (what "continue" means)
18
18
 
19
19
  - **Why**: continue the conversation, or run the work directly when the request is already
20
20
  clear; every ruling is recorded as it lands.
@@ -19,7 +19,7 @@ step looks stale):
19
19
  (see `SKILL.md`'s `## Conditional Ledger-Resume` for the full state table).
20
20
  2. Confirm the artifact that line implies (`plan.md`, `checklist.md`, `outcome.md`, ...) is
21
21
  present and non-empty on disk.
22
- 3. If the two disagree, the ledger has drifted: rebuild it rather than hand-editing:
22
+ 3. If the two disagree, the ledger is stale: rebuild it rather than hand-editing:
23
23
  `ruby -r ~/.plastic/scripts/lib/savepoint -e 'Savepoint.rebuild_savepoint("<intent_dir>")'`
24
24
  4. Re-read the rebuilt last line and re-derive the next step from `checklist.md`'s first
25
25
  unchecked item.
@@ -63,8 +63,14 @@ on disk is what the record becomes, so before the call:
63
63
 
64
64
  Author outcome.md yourself when it deserves prose: copy `templates/outcome.md`,
65
65
  set the frontmatter to `disposition: delivered` or `disposition: abandoned`, and
66
- fill `## Summary`, `## Delivered`, `## Verification`, `## Follow-ups`. On
67
- abandon, `## Summary` states the abandonment reason and the trail (see Pivot
66
+ fill `## Summary`, `## Delivered`, `## Verification`, `## Follow-ups`. `## Delivered` is a
67
+ `| Row | What |` table: one row per thing delivered, in plain wording a reader
68
+ recognizes, not a method name or an implementation summary (that detail
69
+ belongs in `## Summary`). Each row's label must appear as a standalone token
70
+ in an action-file heading (`### S1 - ...` proves row S1); that heading's
71
+ matrix rows become the row's Proven-by cell on `report-screen delivered`'s
72
+ post-delivery screen. `## Needs you` is the literal None or a
73
+ `| N | What | Why |` table. On abandon, `## Summary` states the abandonment reason and the trail (see Pivot
68
74
  below). A placeholder outcome.md is backfilled from the record instead, with the
69
75
  close's disposition and the `--outcome-summary` line as its summary. Also author
70
76
  the rich INDEX entry note now (a short line in the store's existing
@@ -61,6 +61,8 @@ Run Step 0 (Sync Worktree First) before this step.
61
61
 
62
62
  Dispatch ONE executor subagent and give it the whole delivery: every task's full text from `plan.md` (pasted in, never a file reference), every action file with its failure-mode matrix, the checklist items it must tick, the project context from CLAUDE.md, the active intent context from `{ID}--{slug}.md`, and the worktree path. In auto mode this is the `plastic-executor` agent; elsewhere use the `implementer-prompt.md` template. The executor writes the matrix's tests and commits them red, implements the consolidated action in order, ticks each item as it lands (see `## Tick-as-you-land`), and drives the test suite green.
63
63
 
64
+ After each commit lands (the red commit and every commit after it), append a `Commit` line to the savepoint ledger: `ruby ~/.plastic/scripts/savepoint-note <intent_dir> --kind Commit --text "<sha> <what it proves>"` (intent 317, D17). This is what feeds `report-screen delay`; a commit with no line is a gap the delay report cannot explain.
65
+
64
66
  Read its response by code:
65
67
  - DONE or DONE_WITH_CONCERNS → proceed to Step 3.
66
68
  - NEEDS_CONTEXT → provide the missing context, re-dispatch the executor.
@@ -69,6 +71,10 @@ Read its response by code:
69
71
  ### Step 3: Review by Risk
70
72
  Apply the auto skill's risk rule to the executor's return and the diff: a matrix row no test could prove, a diff touching a hook, the lock, the worktree code, the installer, or a release file, a DONE_WITH_CONCERNS or a deviation from the matrix, or an owner-facing surface no test pins. When a rule fires, dispatch the post-execution reviewer with `code-quality-reviewer-prompt.md` (a separate agent with fresh context, never the maker); if it returns changes, re-dispatch the executor to fix them, then run the suite once more. When no rule fires, the green suite is the review.
71
73
 
74
+ Whenever a review verdict returns - the plan review before code, or the post-execution review above - the lead appends a `Review` line: `ruby ~/.plastic/scripts/savepoint-note <intent_dir> --kind Review --text "<verdict, what changed>"` (intent 317, D17). This is the other half of what `report-screen delay` reads.
75
+
76
+ **The D19 heading convention.** An action file's `## Delivered` row (in `outcome.md`) is proven by whichever `actions/ACTION_N.md` heading carries that row's label as a standalone token - `### Row A -` proves row A, `### S1 -` proves row S1. Write action-file section headings so the label they prove is unambiguous (never a substring another label could also match, like `A` inside `AB`); `report-screen delivered`'s Proven-by column renders `not recorded` when no heading matches.
77
+
72
78
  ### Step 4: Update Intent and Complete
73
79
  Capture observations in `## Insights`. When ALL checklist items are checked:
74
80
 
@@ -2,6 +2,11 @@ version: 3
2
2
  project_roots:
3
3
  - ~/.plastic/projects
4
4
  stale_threshold_days: 3
5
+ # When to compact. Absolute token counts for a 1M window (35 and 50 percent), not
6
+ # percentages: models are reliable only to roughly 50 to 65 percent of advertised
7
+ # context, so a percentage that is right at 200k floats to an untested size at 1M.
8
+ context_offer_tokens: 350000
9
+ context_insist_tokens: 500000
5
10
  execution_mode: subagent-driven
6
11
  hash_length: 6
7
12
  hash_algorithm: sha256-base36
@@ -0,0 +1,17 @@
1
+ ## ▶ {{id}} · {{name}}
2
+
3
+ | | | |
4
+ | --- | --- | --- |
5
+ | **Store** | {{store}} | {{store.note}} |
6
+ | **Status** | {{status}} | {{status.note}} |
7
+ | **Stage** | {{stage}} | {{stage.note}} |
8
+ | **Savepoint** | {{savepoint}} | {{savepoint.note}} |
9
+ | **Progress** | {{progress.bar}} {{progress.done}} / {{progress.total}} | {{progress.note}} |
10
+ | **Next** | {{next}} | {{next.note}} |
11
+ | **Insight** | {{insight}} | {{insight.note}} |
12
+
13
+ **Steps**
14
+
15
+ | Step | Status | What |
16
+ | --- | --- | --- |
17
+ {{steps.rows}}
@@ -7,10 +7,23 @@ disposition: delivered|abandoned
7
7
  (what was delivered)
8
8
 
9
9
  ## Delivered
10
- - ...
10
+ <!-- One row per thing delivered, in plain wording a reader recognizes, not
11
+ an implementation summary; the technical detail belongs in ## Summary. Each
12
+ row's label must appear as a standalone token in an actions/*.md heading
13
+ (for example "### S1 - ..." proves row S1): that heading's matrix rows become
14
+ the row's Proven-by cell on the delivered screen (intent 317 D19, 317a). -->
15
+ | Row | What |
16
+ | --- | --- |
17
+ | S1 | ... |
11
18
 
12
19
  ## Verification
13
20
  - <acceptance criterion> — verified by ... → result
14
21
 
22
+ ## Needs you
23
+ <!-- The literal None, or a table shaped | N | What | Why | with one row per
24
+ open owner action. Prose is tolerated by the reader but renders as a single
25
+ untyped row - write the table. -->
26
+ None
27
+
15
28
  ## Follow-ups
16
29
  None
@@ -0,0 +1,11 @@
1
+ ## ▶ {{id}} · {{name}}
2
+
3
+ | | | |
4
+ | --- | --- | --- |
5
+ {{fields.rows}}
6
+
7
+ **Steps**
8
+
9
+ | Step | Status | What |
10
+ | --- | --- | --- |
11
+ {{steps.rows}}