@zalom/plastic 1.0.0-beta.22 → 1.0.0-beta.24

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 CHANGED
@@ -20,6 +20,7 @@ store/
20
20
  actions/ # optional — individual work items
21
21
  resources/ # optional — research, references, screenshots, diagrams
22
22
  savepoint.md # optional — deterministic cycle-step ledger (auto-written)
23
+ revisions.md # optional - append-only structural-maintenance audit trail
23
24
  ```
24
25
 
25
26
  Lifecycle files (`spec.md`, `plan.md`, `checklist.md`, `outcome.md`) have defined
@@ -27,6 +28,33 @@ roles. Supporting artifacts that aren't lifecycle deliverables — research repo
27
28
  reference docs, external API snapshots, screenshots, diagrams — go in `resources/`.
28
29
  Name files inside as `{type}--{description}.md` (e.g., `deep-research--gsd-core.md`).
29
30
 
31
+ `revisions.md` is an optional, append-only structural-maintenance audit trail. It is not a
32
+ lifecycle deliverable and is never scaffolded at intent birth. Its mere existence signals that
33
+ the intent underwent structural (not conceptual) change. Structural maintenance is move-and-record:
34
+ it removes a misplaced section, file, or ref from its artifact and preserves that content in full
35
+ inside `revisions.md` (newest entry at the bottom, one entry per relocated item), so no record is
36
+ lost and the delivered meaning is never altered. Changing what an intent delivered is a new intent,
37
+ not a revision.
38
+
39
+ ### Structural maintenance and revisions.md
40
+
41
+ When a delivered intent accumulates structural junk (an unsanctioned section, a stray file, a
42
+ frontmatter edge to an intent that no longer exists), the intent-curator relocates it into
43
+ `revisions.md` instead of reopening the work. Each entry is a versioned, dated header
44
+ (`## Revision vN - YYYY-MM-DD-HH:MM`) plus `Why` (one sentence naming the broken rule, ending
45
+ with `[rule: <tag>]`), `Prior location`, and either `Content held` (the verbatim removed
46
+ content) or, for a frontmatter edit, a one-line `Change` (before and after). A stray file has
47
+ its full content embedded and the original is deleted.
48
+
49
+ Violation tags (starter set, free-text tags allowed):
50
+ - `unsanctioned-section`: a top-level section the sanctioned-section rule now rejects
51
+ - `phantom-section`: a section referenced but not present or not sanctioned
52
+ - `stray-file`: a file that does not belong in the intent directory
53
+ - `dangling-ref`: a link or reference to something that no longer exists
54
+ - `broken-chain`: a chain frontmatter edge to an intent that no longer exists
55
+ - `broken-source`: a sources frontmatter edge to an intent that no longer exists
56
+ - `misplaced-content`: content that belongs in a different artifact or section
57
+
30
58
  ## Frontmatter
31
59
 
32
60
  Identity and knowledge graph only. Nothing operational.
@@ -23,6 +23,7 @@ You are the Plastic Intent Curator. Your role is to maintain the health and navi
23
23
  3. **Link discovery** — suggest connections between intents that share topics but aren't linked
24
24
  4. **Cluster management** — create new clusters when 3+ unlinked intents share tags, merge or rename clusters as topics evolve
25
25
  5. **Orphan detection** — flag intents with no links and no cluster membership
26
+ 6. **Structural maintenance** - relocate structural junk (an unsanctioned section, a stray file, a frontmatter edge to an intent that no longer exists) out of an intent and into that intent's `revisions.md`, without altering what the intent delivered
26
27
 
27
28
  ## How You Work
28
29
 
@@ -32,11 +33,13 @@ You are the Plastic Intent Curator. Your role is to maintain the health and navi
32
33
  3. Compare: are there intents not in any cluster? Missing from Active/Completed/Abandoned? Status mismatches?
33
34
  4. Make targeted edits to INDEX.md and intent frontmatter/links
34
35
  5. On a terminal-state transition: whenever you move an intent to Completed OR Abandoned, refresh the QMD index for that store so the new outcome (or abandonment rationale) is searchable. This is mandatory on any terminal-state move and a no-op when QMD is absent, and it runs in the background so it never blocks: `ruby ~/.plastic/scripts/qmd-sync reindex --store <store-root> --async`
35
- 6. Report what you changed
36
+ 6. Structural maintenance is move-and-record: remove the misplaced section, file, or ref from its artifact, then create or append `revisions.md` in that intent directory (copy the FORM from `~/.plastic/templates/revisions.md`). One entry per relocated item, newest at the bottom: a `## Revision vN - YYYY-MM-DD-HH:MM` header, a one-sentence `Why` ending with `[rule: <tag>]`, `Prior location`, and either `Content held` (verbatim) or a one-line `Change` for a frontmatter edit. For a stray file, embed its full content and delete the original. The violation-tag catalog is canonical in PLASTIC.md.
37
+ 7. Report what you changed
36
38
 
37
39
  ## Constraints
38
40
 
39
41
  - You only edit `~/.plastic/INDEX.md` (or project INDEX.md) and `~/.plastic/store/*/ID--slug.md` (or project store) files
40
42
  - You never create new intents — that's the creating-intent skill's job
41
- - You never modify `## Insights`, `## Context`, or `## Outcome` content sections — those belong to the worker
43
+ - You never modify `## Insights`, `## Context`, or `## Outcome` content sections — those belong to the worker. Relocating a whole misplaced block out of an intent and into `revisions.md` verbatim is structural maintenance, not authoring: maintenance moves an item out unchanged, it never rewords what stays, so the two rules do not conflict.
44
+ - For structural maintenance you may edit any Plastic artifact in an intent directory (intent file, `spec.md`, `plan.md`, `checklist.md`, `outcome.md`, frontmatter, or a stray file) and may create or append `revisions.md`. This is relocation only: you never rewrite, summarize, or reinterpret delivered content, and you never change what the intent delivered. A change to delivered meaning is a new intent, not a revision.
42
45
  - For discovery, put QMD first when available (`qmd-sync search`), then fall back to Read and grep/find; use Edit for targeted changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zalom/plastic",
3
- "version": "1.0.0-beta.22",
3
+ "version": "1.0.0-beta.24",
4
4
  "description": "Intent-driven idea development system for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/scripts/doctor.rb CHANGED
@@ -472,7 +472,10 @@ class Doctor
472
472
  category: "conventions", name: "section_structure", status: "warn",
473
473
  message: "#{bad_sections.size} intent file(s) have non-sanctioned ## sections",
474
474
  details: bad_sections.map { |b| "#{b[:dir]}: #{b[:issues].join(", ")}" },
475
- fixable: false
475
+ fixable: true,
476
+ fix_hint: "Dispatch plastic-intent-curator to relocate each unsanctioned section into the " \
477
+ "intent's revisions.md via move-and-record (a missing required section is restored " \
478
+ "or reprojected instead); see PLASTIC.md > Structural maintenance and revisions.md"
476
479
  )
477
480
  end
478
481
 
@@ -698,7 +701,9 @@ class Doctor
698
701
  checks << graph_finding_check(
699
702
  "graph_i4_danglers", i4,
700
703
  "Every sources/chain id resolves to a real intent (I4)",
701
- "Fix or remove the dangling id reference"
704
+ "Dispatch plastic-intent-curator to record the dangling sources/chain edge as a " \
705
+ "broken-source/broken-chain move-and-record entry in the intent's revisions.md (see " \
706
+ "PLASTIC.md > Structural maintenance and revisions.md), or restore the missing intent"
702
707
  )
703
708
  checks
704
709
  end
@@ -236,6 +236,7 @@ class InstallerCore
236
236
  "templates/plan.md" => "templates/plan.md",
237
237
  "templates/checklist.md" => "templates/checklist.md",
238
238
  "templates/outcome.md" => "templates/outcome.md",
239
+ "templates/revisions.md" => "templates/revisions.md",
239
240
  "scripts/spawn-preamble" => "scripts/spawn-preamble",
240
241
  "scripts/lib/store_provisioning.rb" => "scripts/lib/store_provisioning.rb",
241
242
  "scripts/provision-project-store" => "scripts/provision-project-store",
@@ -119,9 +119,12 @@ Use the `fix_hint` value to determine the correct action:
119
119
  | "Inject the missing required frontmatter field(s)" | Edit the intent's `{ID}--{slug}.md` frontmatter to add the missing key (e.g. `chain: []`) without touching other keys |
120
120
  | "Run: provision-project-store {slug}" | Run `provision-project-store <slug>` (or invoke the `plastic-add-project-store` skill) to create the missing store |
121
121
  | "Re-run installer" | Run `npx @zalom/plastic@latest --agent` |
122
+ | "Dispatch plastic-intent-curator ... revisions.md ..." | Invoke the `plastic-intent-curator` (or the agent) to relocate the flagged section or ref into the intent's `revisions.md` via move-and-record (one dated, `[rule: <tag>]`-tagged entry per item), per PLASTIC.md > Structural maintenance and revisions.md. For a missing required section, restore or reproject it instead. |
122
123
 
123
124
  For fixes the agent cannot handle automatically, explain what the user needs
124
- to do manually.
125
+ to do manually. The `revisions.md` remedy is curator-applied (a move-and-record
126
+ relocation, not a mechanical edit) and stays human-gated by the Step 4
127
+ Fix / Select / Skip prompt.
125
128
 
126
129
  ### Step 6: Verify
127
130
 
@@ -0,0 +1,58 @@
1
+ # revisions.md
2
+
3
+ <!--
4
+ FORM reference. A live revisions.md exists in an intent directory ONLY when structural
5
+ maintenance actually happened. It is never scaffolded at intent birth, it carries no
6
+ placeholder sentinel, and its mere presence signals that this intent underwent structural
7
+ (not conceptual) change.
8
+
9
+ Rules:
10
+ - Append-only. Newest entry at the BOTTOM. Never edit or reorder past entries.
11
+ - One entry per relocated item (one section, one file, or one ref per entry).
12
+ - Move-and-record: remove the misplaced thing from its artifact and preserve it IN FULL
13
+ here. Never rewrite, summarize, or reinterpret delivered meaning. A change to delivered
14
+ meaning is a new intent, not a revision.
15
+ - Header form: "## Revision vN - YYYY-MM-DD-HH:MM" (N increments by one per entry).
16
+
17
+ Fields:
18
+ - Why: one sentence naming the broken rule, ending with "[rule: <tag>]".
19
+ - Prior location: the artifact plus the section or path the content came from.
20
+ - Content held: the verbatim removed content, as an indented block (block form), OR
21
+ - Change: a one-line "removed X (before: ... -> after: ...)" for a frontmatter
22
+ edit, used instead of a Content held block.
23
+
24
+ Stray file: embed the file's full content as the Content held block and delete the
25
+ original; Prior location names the filename. revisions.md is the single container.
26
+
27
+ Violation-tag catalog (starter set; free-text tags are allowed):
28
+ - unsanctioned-section : a top-level section the sanctioned-section rule now rejects
29
+ - phantom-section : a section referenced but not present or not sanctioned
30
+ - stray-file : a file that does not belong in the intent directory
31
+ - dangling-ref : a link or reference to something that no longer exists
32
+ - broken-chain : a chain frontmatter edge to an intent that no longer exists
33
+ - broken-source : a sources frontmatter edge to an intent that no longer exists
34
+ - misplaced-content : content that belongs in a different artifact or section
35
+
36
+ The examples below show the three variants. Delete them when you write the first real
37
+ entry; keep the "# revisions.md" title line above.
38
+ -->
39
+
40
+ ## Revision v1 - 2026-06-30-14:35
41
+ - Why: unsanctioned top-level section left over from an early draft [rule: unsanctioned-section]
42
+ - Prior location: intent.md - ## Scope
43
+ - Content held:
44
+
45
+ ## Scope
46
+ <the full content that was removed, verbatim>
47
+
48
+ ## Revision v2 - 2026-06-30-15:02
49
+ - Why: chain edge to an intent that no longer exists [rule: broken-chain]
50
+ - Prior location: intent.md frontmatter - chain
51
+ - Change: removed "99x" (before: ["4a1a", "99x"] -> after: ["4a1a"])
52
+
53
+ ## Revision v3 - 2026-06-30-15:20
54
+ - Why: a stray notes file that does not belong in the intent directory [rule: stray-file]
55
+ - Prior location: notes-old.md
56
+ - Content held:
57
+
58
+ <the full content of notes-old.md, verbatim; the original file is then deleted>