arcane-cli 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/.arcane/governance/decision-documentation-standard.md +37 -1
- package/dist/assets/.arcane/governance/development-methodology.md +20 -0
- package/dist/assets/.arcane/spells/spell-arcane-version.md +26 -0
- package/dist/assets/.arcane/spells/spell-close-session.md +33 -1
- package/dist/assets/.arcane/spells/spell-feedback.md +9 -0
- package/dist/assets/.arcane/spells/spell-manifest.md +18 -0
- package/dist/assets/.arcane/spells/spell-open-session.md +5 -0
- package/dist/assets/.arcane/spells/spell-save-idea.md +2 -0
- package/dist/assets/.arcane/spells/spell-todo.md +84 -2
- package/dist/index.js +317 -64
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -36,7 +36,43 @@ Arcane separates framework-level decisions from org-specific ones using two pref
|
|
|
36
36
|
- If the decision would apply to any organization using Arcane, it is `ARC-NNN`.
|
|
37
37
|
- If the decision is specific to how your organization operates, it is `ADR-NNN`.
|
|
38
38
|
- When uncertain, default to `ADR-NNN` in ops; promote to `ARC-NNN` later if the decision proves framework-generic. **Enforcement: explicitly advisory prose (ARC-023) — whether a decision is framework-generic enough for `ARC-NNN` (this rule and the two prefix-scoping rules above) is a judgment call; no script evaluates a decision's content to confirm the chosen prefix.**
|
|
39
|
-
- Never renumber existing entries in either sequence. **Enforcement: explicitly advisory prose (ARC-023) — `scripts/check-distributed-adr-references.ts` only verifies that a bare `ADR-NNN` citation resolves to a heading declared in `framework-decisions.md` (and separately flags certain `ARC-NNN`/`EF-NNN` link forms as cross-repo hazards); it never checks that numbers are sequential, unique, or never reused.**
|
|
39
|
+
- Never renumber existing entries in either sequence. **Enforcement: explicitly advisory prose (ARC-023) — `scripts/check-distributed-adr-references.ts` only verifies that a bare `ADR-NNN` citation resolves to a heading declared in `framework-decisions.md` (and separately flags certain `ARC-NNN`/`EF-NNN` link forms as cross-repo hazards); it never checks that numbers are sequential, unique, or never reused. Uniqueness alone has an executable check in Arcane's own repository only: `scripts/check-stale-claims.ts` (run in CI as `npm run check:stale-claims`) fails when two decision headings in its `DECISIONS.md` share an ID (ARC-050). That check does not ship to consuming repositories, and it cannot tell a renumbered entry from a new one.**
|
|
40
|
+
|
|
41
|
+
## Allocating Decision Numbers
|
|
42
|
+
|
|
43
|
+
Decision numbers are a shared sequence (ARC-028 R4). Two sessions on separate branches that each take
|
|
44
|
+
"the next number" both take the same one. The collision surfaces at merge, or never, and
|
|
45
|
+
cross-references then point at the wrong decision. ARC-050 sets how a number is allocated:
|
|
46
|
+
|
|
47
|
+
1. **Fetch, then take the maximum.** Before allocating a decision number, fetch the trunk when a
|
|
48
|
+
usable remote exists. "Usable" is the classification `spell-open-session`'s Mutation Guard uses: a
|
|
49
|
+
supported provider with authenticated provider tooling, where a remote URL alone is not enough.
|
|
50
|
+
Then allocate `max(highest number on the local branch, highest number on the remote trunk) + 1`.
|
|
51
|
+
2. **A local-only repository allocates from the local maximum and says so**, so the number is
|
|
52
|
+
visibly unchecked against any other branch.
|
|
53
|
+
|
|
54
|
+
**Enforcement (rules 1 and 2): structured spell gate (ARC-023) — `spell-close-session` step 3
|
|
55
|
+
requires the observed trunk maximum, or its stated local-only line, before it writes a new entry.
|
|
56
|
+
A decision written outside that spell, by hand or by another workflow, follows these rules as
|
|
57
|
+
explicitly advisory prose: nothing else fetches or compares for it.**
|
|
58
|
+
3. **No reservation markers.** Never commit a placeholder or "reserved" entry to claim a number. A
|
|
59
|
+
marker is itself an edit to the same shared sequence, so it collides the same way. **Enforcement:
|
|
60
|
+
explicitly advisory prose (ARC-023) — no script recognizes a placeholder entry as a reservation.**
|
|
61
|
+
4. **Several decisions at once are allocated once.** A program that drafts several decisions
|
|
62
|
+
allocates all of them at the start of the wave that needs them, from the fetched trunk. Its
|
|
63
|
+
parallel lanes use those numbers and never allocate their own. A single session that records
|
|
64
|
+
several decisions allocates them consecutively from one fetched maximum. **Enforcement:
|
|
65
|
+
explicitly advisory prose (ARC-023) — no spell gate or script tracks which numbers a program
|
|
66
|
+
pre-allocated.**
|
|
67
|
+
5. **When a collision still happens, the unmerged branch renumbers.** Fetching narrows the race but
|
|
68
|
+
does not close it: two sessions can fetch before either pushes. "Never renumber existing entries"
|
|
69
|
+
applies to merged entries. When two branches hold the same number, the branch that has not merged
|
|
70
|
+
yet renumbers its own entry and every reference to it on that branch. **Enforcement: explicitly
|
|
71
|
+
advisory prose (ARC-023) for the renumbering — no script performs it or checks which branch did
|
|
72
|
+
it. Detecting the collision is an executable check in Arcane's own repository only:
|
|
73
|
+
`scripts/check-stale-claims.ts`, run in CI as `npm run check:stale-claims`, fails when two
|
|
74
|
+
decision headings share an ID. It matches any `## <PREFIX>-<number>` heading, not only `ARC`, so
|
|
75
|
+
a consuming repository can adopt it, but it is not installed there.**
|
|
40
76
|
|
|
41
77
|
## Problem Statement
|
|
42
78
|
|
|
@@ -161,6 +161,26 @@ GitHub Issues has no configurable work-item-type hierarchy the way Azure DevOps
|
|
|
161
161
|
- **Jira (`external_provider=jira`)** — TODO: define issue-type mapping, parent-child/epic linkage strategy, and command examples.
|
|
162
162
|
- **Other providers (`external_provider=other`)** — TODO: define required metadata contract and fallback behavior before enabling automation.
|
|
163
163
|
|
|
164
|
+
### Tracker-ID Suffix on Captured Items
|
|
165
|
+
|
|
166
|
+
When `tracking_mode=external` and a `TODO.md` item or an `IDEAS.md` entry corresponds to a tracker work item that already exists, the item carries that work item's id as a suffix, in the provider's own reference format. This is the one definition of the suffix; `spell-todo`, `spell-save-idea` and `spell-manifest` point here rather than restating it.
|
|
167
|
+
|
|
168
|
+
| `external_provider` | Suffix | Example |
|
|
169
|
+
| --- | --- | --- |
|
|
170
|
+
| `github` | `[#<number>]` | `- [ ] Add export button [#123]` |
|
|
171
|
+
| `ado` | `[AB#<id>]` | `- [ ] Add export button [AB#123]` |
|
|
172
|
+
| `jira` | `[<issue key>]` — the key exactly as Jira prints it | `- [ ] Add export button [PROJ-123]` |
|
|
173
|
+
| `other` | no suffix until that provider's metadata contract is defined (see External Provider TODOs) | — |
|
|
174
|
+
|
|
175
|
+
- **Placement:** at the end of the item's text, after any file reference, and before a trailing `<!-- status: … -->` comment on an idea entry.
|
|
176
|
+
- **Only a real id:** the suffix records an id that exists — one the operator supplied, or one a spell just got back from the tracker. Never guess an id, and never file a work item just to have a suffix.
|
|
177
|
+
- **One suffix per item:** an item that already carries a suffix keeps it; it is not duplicated or rewritten.
|
|
178
|
+
- **`tracking_mode=internal`:** no suffix. Items are written exactly as they are without this section.
|
|
179
|
+
|
|
180
|
+
The suffix uses the same reference forms as the commit-link syntax `spell-bug` writes (`Fixes AB#{id}` for Azure DevOps, `Fixes #{id}` for GitHub Issues — the GitHub form is also under GitHub Issues Conventions above), so an item and the commit that closes it point at the work item the same way.
|
|
181
|
+
|
|
182
|
+
**Enforcement: explicitly advisory prose (ARC-023) — no script checks that an externally tracked item carries its suffix or that a suffix matches the provider's format; the three spells apply it at write time and compliance depends on the executing agent.**
|
|
183
|
+
|
|
164
184
|
### Fresh Context Per Iteration
|
|
165
185
|
|
|
166
186
|
Each implementation iteration starts with clean context. The only memory between iterations is:
|
|
@@ -70,6 +70,32 @@ If the npm registry is unreachable, report:
|
|
|
70
70
|
ℹ Could not reach npm registry — update check skipped.
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
+
### Setup questions from an AI harness (no interactive terminal, PRD D-02 / #282)
|
|
74
|
+
|
|
75
|
+
This spell itself stays read-only. If the operator then asks you to run `spell update`, note that a
|
|
76
|
+
harness shell is not an interactive terminal. The CLI then skips every unanswered manifest question
|
|
77
|
+
and prints ``! Skipped N manifest question(s) (<fields>) — no interactive terminal. Run `spell update` from a terminal, or answer by flags:``,
|
|
78
|
+
followed by the exact line to re-run, such as
|
|
79
|
+
`spell update --tracking-mode <internal|external> --push-policy <open|guarded|blocked>`.
|
|
80
|
+
`spell init --profile <profile>` prints the same kind of `spell update` line when it leaves
|
|
81
|
+
questions unanswered. Do not send the operator off to find a terminal. Instead:
|
|
82
|
+
|
|
83
|
+
1. Ask the operator each skipped question through the harness's own question UI (a plain chat
|
|
84
|
+
question if the harness has none): one question per flag the CLI printed, offering exactly the
|
|
85
|
+
values that flag lists. The flags are `--role`, `--tracking-mode`, `--external-provider`,
|
|
86
|
+
`--content-sensitivity`, `--push-policy` and `--subject-root`. `--tracking-mode external` also
|
|
87
|
+
needs `--external-provider <ado|github|jira|other>`, so ask that too when the answer is
|
|
88
|
+
`external`.
|
|
89
|
+
2. Re-run `spell update` with the flags the CLI printed, filled with the operator's answers, for
|
|
90
|
+
example `spell update --tracking-mode internal --push-policy guarded`.
|
|
91
|
+
3. Never pass a flag the operator did not answer. No guessed, default or "recommended" value stands
|
|
92
|
+
in for an answer. An unanswered question stays unset: the next interactive run asks it, and the
|
|
93
|
+
next harness run reports it skipped again.
|
|
94
|
+
4. Never loosen `push_policy` by flag. `--push-policy` only answers an unset question or tightens a
|
|
95
|
+
recorded policy, and the CLI refuses a loosening. Moving a repository from `blocked` or `guarded`
|
|
96
|
+
toward `open` is only ever `spell unblock-push`, which the operator runs from an interactive
|
|
97
|
+
terminal (ARC-034 decision 6, ARC-049 decision 6). Tell them so; do not try to run it for them.
|
|
98
|
+
|
|
73
99
|
## Step 3 — Component Detail (optional)
|
|
74
100
|
|
|
75
101
|
Only include this section when the user passed "components" as the prompt argument.
|
|
@@ -53,13 +53,39 @@ Workflow:
|
|
|
53
53
|
- Journal entries must include:
|
|
54
54
|
- `### Prompt Context` — original prompt text or a faithful paraphrase of the multi-turn request when the session began from a substantive user ask. Include follow-up scope inputs if they materially changed the direction of the work.
|
|
55
55
|
- `### What Got Done` — numbered list of concrete outcomes with file/ADR references. Only list an outcome here if step 1b classified it `succeeded` (or it never involved async work at all, e.g. a local file edit). A `pending`/`dispatched`/`unverifiable` item belongs in Open Items Carried Forward, not here — do not let this section imply completion step 1b couldn't confirm.
|
|
56
|
-
- `### Decisions Made` — table of ADR number, decision, and rationale. If no decisions were made, omit this section.
|
|
56
|
+
- `### Decisions Made` — table of ADR number, decision, and rationale. If no decisions were made, omit this section. Take every number in this table from step 3's allocation rule (ARC-050). If step 3 has not allocated yet, run that allocation now and use the same numbers in both places. Never write a number from memory or from this branch's `DECISIONS.md` alone.
|
|
57
57
|
- `### Lessons Learned` — one heading per lesson with enough context to prevent the mistake again. Use narrative, not bullet fragments.
|
|
58
58
|
- `### Open Items Carried Forward` — items that remain undone from this session, including every `pending`/`dispatched`/`failed`/`unverifiable` item from step 1b.
|
|
59
59
|
|
|
60
|
+
2b. **Lesson routing: send each lesson where it can be acted on.** A lesson left only in the journal never reaches the people who could fix its cause. Skip this step when step 2 wrote no `### Lessons Learned`, or when the invocation includes `--no-route`. With `--no-route`, the lessons stay in the journal only; say `Lesson routing skipped (--no-route)` in the closure report.
|
|
61
|
+
- **Classify each lesson** written in step 2 into exactly one class:
|
|
62
|
+
- **Framework-shaped:** the fix belongs in Arcane itself, meaning a spell prompt, template, governance doc, playbook, or CLI behavior this repository installed rather than authored. This is `spell-feedback` Step 3's definition. Destination: `FEEDBACK.md`, queued for upstream.
|
|
63
|
+
- **Product idea:** the lesson suggests something to build in this repository's own product. Destination: `spell-save-idea`.
|
|
64
|
+
- **Repo-local:** anything about this repository's own content, configuration, or way of working. Destination: the journal only. It is already there, so nothing more is written.
|
|
65
|
+
- **Show one batch proposal and ask once.** List every lesson with its class and destination, then ask a single question: `Route these lessons? (yes / edit / skip)`. `edit` lets the operator change a class or drop a lesson, then shows the proposal again. Route nothing before an explicit `yes`. A timeout, a cancellation, a delegated or host-generated response, or assent given to something else is not approval. Neither is an autonomous run with no operator to ask. In each of those cases route nothing, keep the lessons in the journal, and list the proposal in the closure report as not routed. `skip` is a complete, valid answer.
|
|
66
|
+
- **Framework-shaped, after `yes`:** append **one** block to `FEEDBACK.md` at the repository root, in `spell-feedback`'s Step 5 block format. Create the file with a `# Feedback Log` header first if it is missing. Fill the block this way:
|
|
67
|
+
- Heading: `## Feedback — <the spell or doc the lessons concern, or "Arcane workflow" when they span several> (<YYYY-MM-DD>)`.
|
|
68
|
+
- `**Session:**` names this session and adds `(routed by spell-close-session from Lessons Learned)`.
|
|
69
|
+
- `**Rating:**` and `**Would use again:**` are `N/A`, because nobody rated anything.
|
|
70
|
+
- Friction Points: one line per lesson saying what happened.
|
|
71
|
+
- Improvement Items: one imperative item per lesson, each line ending with `<!-- upstream: queued -->`.
|
|
72
|
+
- Raw Notes: cite the journal file and each lesson's heading.
|
|
73
|
+
- **Product idea, after `yes`:** hand each one to `spell-save-idea` as a one-sentence idea, citing the journal file. That spell appends it to the idea book.
|
|
74
|
+
- **No public write from this step.** Close-session never files an issue and never runs `gh issue create`. It also never runs `spell-feedback`'s Step 6 filing flow. Queuing is the whole outcome here. The `yes` above approves local appends only. Filing upstream still needs `spell-feedback`'s own literal `disclose` confirmation on each item, given in a later `spell-feedback` or `spell-feedback --flush` run, which re-offers every queued item through its genericize-and-`disclose` flow.
|
|
75
|
+
- **Append-only.** Add new entries to `FEEDBACK.md` and the idea book. Never edit, reorder, or remove an existing entry in either.
|
|
76
|
+
- Enforcement: structured spell gate (ARC-023) — nothing is routed without the one explicit batch `yes`, and it fails closed. The no-public-write and append-only rules are explicitly advisory prose: no hook stops this step from running `gh` or rewriting a book, so they hold by the step's own instructions. Classifying a lesson is a judgment call, and the operator checks it at the batch proposal.
|
|
77
|
+
|
|
60
78
|
3. **Update [DECISIONS.md](../../DECISIONS.md).**
|
|
61
79
|
- Add ADRs for any decisions made during the session (naming choices, tool preferences, workflow standards, security policies, etc.).
|
|
62
80
|
- Use the next sequential ADR number.
|
|
81
|
+
- **Allocate that number against the trunk, not only this branch (ARC-050; ARC-028 R4 names decision numbers a shared sequence).** Another session on another branch may already have taken "the next number". Do this immediately before writing the first new entry:
|
|
82
|
+
- **Classify the remote first.** Use the classification from step 9's remote-capability check, which is the same one `spell-open-session`'s Mutation Guard uses. A usable remote is a supported provider (`github.com`, `dev.azure.com`, or `visualstudio.com`) with authenticated provider tooling; a remote URL alone is not enough. Resolve `<remote>` and `<trunk>` from observed state as step 10 does. Never assume `origin` or `main`.
|
|
83
|
+
- **Usable remote: fetch, then take the maximum.** Run `git fetch <remote> <trunk>`. Read the highest decision ID (the number in the log's `## <PREFIX>-NNN` headings) from this branch's `DECISIONS.md`, and from the trunk's copy with `git show <remote>/<trunk>:DECISIONS.md`. A trunk with no `DECISIONS.md` has no maximum. Allocate `max(highest ID on this branch, highest ID on <remote>/<trunk>) + 1`. In the Decision Updates output, name both maxima and the number allocated.
|
|
84
|
+
- **Local-only: allocate from the local maximum and say so.** When there is no usable remote, allocate `highest ID in the local DECISIONS.md + 1`. Say so in the Decision Updates output: `Allocated <PREFIX>-NNN from the local maximum only; not checked against any other branch.` Treat a usable remote whose fetch fails the same way, and name the failed fetch in that line.
|
|
85
|
+
- **Several decisions in one session:** allocate them consecutively from the one maximum you just computed, in a single pass.
|
|
86
|
+
- **No reservation markers.** Never commit a placeholder or "reserved" entry to claim a number before the real entry exists. A marker is itself an edit to the same shared sequence, so it collides the same way.
|
|
87
|
+
- **If a collision still surfaces later** (two sessions fetched before either pushed), the branch that has not merged yet renumbers its own entry and every reference to it on that branch. Merged entries are never renumbered (`decision-documentation-standard.md`).
|
|
88
|
+
- Enforcement: structured spell gate (ARC-023) — this step requires the observed trunk maximum, or the stated local-only line, before a new entry is written. The renumbering rule above is explicitly advisory prose: nothing in this spell detects a collision after the fact.
|
|
63
89
|
- Follow the existing format: Date, Status, Context, Decision, Reasoning, Rejected alternatives.
|
|
64
90
|
|
|
65
91
|
4. **Update [TODO.md](../../TODO.md).**
|
|
@@ -224,9 +250,15 @@ Output format:
|
|
|
224
250
|
|
|
225
251
|
- Exact file updates made.
|
|
226
252
|
|
|
253
|
+
## Lesson Routing
|
|
254
|
+
|
|
255
|
+
- Each lesson from step 2b with its class and where it went: `FEEDBACK.md` (queued for upstream), `spell-save-idea`, or journal only.
|
|
256
|
+
- Or one of: `Lesson routing skipped (--no-route)`, `No lessons recorded`, or `Not routed (no explicit yes)` followed by the proposal.
|
|
257
|
+
|
|
227
258
|
## Decision Updates
|
|
228
259
|
|
|
229
260
|
- ADRs added or note that none were needed.
|
|
261
|
+
- For each ADR added, how its number was allocated (step 3): `max(<this branch's highest>, <remote>/<trunk>'s highest) + 1`, or the local-only line.
|
|
230
262
|
|
|
231
263
|
## TODO Updates
|
|
232
264
|
|
|
@@ -127,6 +127,15 @@ For each framework-shaped item:
|
|
|
127
127
|
|
|
128
128
|
Maintainer side is unchanged: GitHub issues are arcane's normal public intake; triage into arcane's own `IDEAS.md`/`DECISIONS.md` happens in arcane sessions like any other issue. This spell never writes to a hub's venture books and never reads `ventures/registry.json` — framework feedback and venture ideas are different channels on purpose (venture ideas → hub books → `spell-manifest`; framework lessons → here → arcane's GitHub).
|
|
129
129
|
|
|
130
|
+
## Entry Point — Lessons Routed by `spell-close-session`
|
|
131
|
+
|
|
132
|
+
`FEEDBACK.md` has a second writer. `spell-close-session`'s lesson-routing step (step 2b) classifies each of the session's Lessons Learned. After one batch confirmation, it appends the framework-shaped ones as a single block in Step 5's format:
|
|
133
|
+
- `**Session:**` carries `(routed by spell-close-session from Lessons Learned)`.
|
|
134
|
+
- `**Rating:**` and `**Would use again:**` are `N/A`.
|
|
135
|
+
- Each improvement item ends with `<!-- upstream: queued -->`.
|
|
136
|
+
|
|
137
|
+
That step never files anything publicly. Its entries reach `{ARCANE_UPSTREAM_REPO}` only through this spell: `spell-feedback --flush` picks them up with every other queued item and runs Step 6 on each one (genericize, the literal `disclose` confirmation, then file or re-queue). A routed entry gets no shortcut, because close-session's batch confirmation approved a local append, not a public issue. An `N/A` rating is not a low rating, so it never triggers the `⚠️ LOW RATING` flag. **Enforcement: structured spell gate (ARC-023) — Step 6's literal `disclose` confirmation gates filing a routed item exactly as it gates any other; nothing in this spell distinguishes a routed item that could skip it.**
|
|
138
|
+
|
|
130
139
|
## Rules
|
|
131
140
|
|
|
132
141
|
- Never overwrite existing feedback — always append.
|
|
@@ -30,6 +30,18 @@ Parse `status: new` entries from the hub root `IDEAS.md` and every `{BUSINESS_RO
|
|
|
30
30
|
|
|
31
31
|
Tolerate operator YAML frontmatter above a book's header — entries always live below the `---` divider. Malformed entries (missing timestamp, unparseable status comment) are listed under a `Skipped` heading with `file:line`, never silently dropped.
|
|
32
32
|
|
|
33
|
+
**Status-comment grammar.** A status comment is `<!-- status: <state>[; <key>: <value>]... -->`. The first field is the status itself, unchanged from before: `new`, `promoted → <dest> YYYY-MM-DD`, or `dropped YYYY-MM-DD` with an optional `(reason)`. Zero or more `; <key>: <value>` fields may follow it. `spell-todo --sweep --validate` writes three of them: `value` and `fit` (each `y`, `n` or `?`) and `dup` (`none`, or a short reference). Both forms parse:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
<!-- status: new -->
|
|
37
|
+
<!-- status: new; value: y; fit: y; dup: none -->
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- **Splitting:** split the comment body on `; ` only where the next segment starts with a lowercase `key: `. A `; ` anywhere else — inside a drop reason, say — stays part of the field it is in.
|
|
41
|
+
- **Deciding `new`:** only the first field does. An entry is collected when that field is exactly `status: new`, with or without fields after it.
|
|
42
|
+
- **Unknown fields:** an unknown key, or a known key with an unexpected value, is ignored and shown as-is. It never moves the entry to `Skipped`.
|
|
43
|
+
- **Unparseable:** a comment is unparseable, and the entry goes to `Skipped`, when it does not open with `status:`, is not closed with `-->`, or its first field is not exactly `new`, `promoted …` or `dropped …` (a typo such as `status: nwe` or `status: New` is reported, never silently left out of both lists).
|
|
44
|
+
|
|
33
45
|
## Step 2 — List
|
|
34
46
|
|
|
35
47
|
Print one numbered list, grouped by book, oldest entry first within each group. Numbering is session-scoped — it does not persist across runs.
|
|
@@ -45,6 +57,8 @@ ventures/ordovica/TODO.md
|
|
|
45
57
|
3. [ ] Confirm cart snapshot order (open item, no status comment — todo-book entries are listed as-is)
|
|
46
58
|
```
|
|
47
59
|
|
|
60
|
+
An entry whose status comment carries validation fields (Step 1's grammar) shows them after its text — for example `(value: y, fit: n, dup: none)` — so that the operator can leave out `fit: n` entries, or ones marked as duplicates, when selecting in Step 3. An entry without them is listed exactly as before.
|
|
61
|
+
|
|
48
62
|
## Step 3 — Select
|
|
49
63
|
|
|
50
64
|
Ask: `Promote which? (numbers/ranges, e.g. 1,3,5-8, or "all")`. Accept a single answer covering the whole batch. `all` selects every listed entry, including ones in books outside `--venture` if no filter was given.
|
|
@@ -114,8 +128,12 @@ book:<other-slug>/IDEAS.md
|
|
|
114
128
|
|
|
115
129
|
Any marker whose destination repository is public ends in ` (disclosed)` — whichever route landed it, because Step 5 gated it as a disclosure.
|
|
116
130
|
|
|
131
|
+
**Tracker-id suffix.** When route (c) files a tracker item, append the new work item's id to the hub entry's text as a suffix — before its status comment — in the format [governance/development-methodology.md](../../.arcane/governance/development-methodology.md) defines once under "Tracker-ID Suffix on Captured Items" for that tracker's provider (`[AB#<id>]` Azure DevOps, `[#<id>]` GitHub, the issue key for Jira). Use only the id the create command returned. The promoted marker still names the repo (`github:<slug>#<id>`), which is what disambiguates a GitHub suffix inside a hub book. An entry that already carries a suffix keeps it unchanged wherever it lands. No tracker item filed means no suffix: entries routed without a tracker (and every internal-mode flow) are written exactly as before.
|
|
132
|
+
|
|
117
133
|
Dropped entries get `<!-- status: dropped YYYY-MM-DD -->`, optionally with a trailing `(reason)`.
|
|
118
134
|
|
|
135
|
+
Validation fields already in an entry's comment (Step 1's grammar) are kept after the new first field when it is marked, e.g. `<!-- status: dropped 2026-09-27; value: n; fit: y; dup: none -->`. An entry without them gets exactly the marker above.
|
|
136
|
+
|
|
119
137
|
Before any downstream write, grep the target file for the entry's normalized first ~40 characters — if already present, treat this entry as already-landed, mark the hub entry promoted, and skip the write. This is what makes an interrupted or re-run batch safe.
|
|
120
138
|
|
|
121
139
|
## Step 7 — Leak Scan
|
|
@@ -99,6 +99,11 @@ Before anything else, check:
|
|
|
99
99
|
- Run `npm view arcane-cli version` to get the latest published version.
|
|
100
100
|
- **(a) Managed files behind the installed CLI** (installed CLI version is newer than the version recorded in `.arcane.json`): surface a warning: `⚠️ Managed files out of date: files at <installed> → CLI at <cli>. Run spell update to resync files.`
|
|
101
101
|
- **(b) Installed CLI behind the latest published version** (latest published is newer than the installed CLI): surface a warning: `⚠️ Arcane CLI update available: CLI at <cli> → latest <latest>. Upgrade the CLI, then run spell update.`
|
|
102
|
+
- **Setup questions from an AI harness (no interactive terminal, PRD D-02 / #282):** if you run `spell update` yourself — a repository write, so apply the Mutation Guard first — note that a harness shell is not an interactive terminal. The CLI then skips every unanswered manifest question and prints ``! Skipped N manifest question(s) (<fields>) — no interactive terminal. Run `spell update` from a terminal, or answer by flags:``, followed by the exact line to re-run, such as `spell update --tracking-mode <internal|external> --push-policy <open|guarded|blocked>`. `spell init --profile <profile>` prints the same kind of `spell update` line when it leaves questions unanswered. Do not send the operator off to find a terminal. Instead:
|
|
103
|
+
1. Ask the operator each skipped question through the harness's own question UI (a plain chat question if the harness has none): one question per flag the CLI printed, offering exactly the values that flag lists. The flags are `--role`, `--tracking-mode`, `--external-provider`, `--content-sensitivity`, `--push-policy` and `--subject-root`. `--tracking-mode external` also needs `--external-provider <ado|github|jira|other>`, so ask that too when the answer is `external`.
|
|
104
|
+
2. Re-run `spell update` with the flags the CLI printed, filled with the operator's answers, for example `spell update --tracking-mode internal --push-policy guarded`.
|
|
105
|
+
3. Never pass a flag the operator did not answer. No guessed, default or "recommended" value stands in for an answer. An unanswered question stays unset: the next interactive run asks it, and the next harness run reports it skipped again.
|
|
106
|
+
4. Never loosen `push_policy` by flag. `--push-policy` only answers an unset question or tightens a recorded policy, and the CLI refuses a loosening. Moving a repository from `blocked` or `guarded` toward `open` is only ever `spell unblock-push`, which the operator runs from an interactive terminal (ARC-034 decision 6, ARC-049 decision 6). Tell them so; do not try to run it for them.
|
|
102
107
|
- **If either axis shows drift, emit the canonical version-drift diagram beside the warning(s)** — per the generated state diagrams convention (rule 8, ARC-036). One commit per *distinct* version value among the three readings, in the order repo-files → installed-CLI → npm-latest; collapse consecutive identical values into a single shared commit rather than repeating it. Branch off immediately after the commit for each axis that drifts — `repo-files` after the repo-files-version commit if axis A drifts, `installed-cli` after the installed-CLI-version commit if axis B drifts. Tag the final commit `"latest"`. The dangling branch(es) *are* the drifting axis/axes — no legend needed:
|
|
103
108
|
```mermaid
|
|
104
109
|
gitGraph
|
|
@@ -76,7 +76,9 @@ Entry format:
|
|
|
76
76
|
|
|
77
77
|
- Get the real local date and time from the system (e.g., run `date`) rather than guessing — a wrong timestamp silently corrupts the append-only log.
|
|
78
78
|
- The `status: new` HTML comment lets later triage mark entries as `promoted` / `dropped` without deleting history.
|
|
79
|
+
- This spell always writes the plain `<!-- status: new -->`. Later, `spell-todo --sweep --validate` may add `; value: …; fit: …; dup: …` fields to the comment after an operator's batch confirmation. The grammar that reads both forms is in `spell-manifest` Step 1.
|
|
79
80
|
- Include `[#tag]` only if a tag was inferred; otherwise omit it.
|
|
81
|
+
- **Tracker-id suffix (`tracking_mode: external` only):** if `.arcane.json`'s tracking mode is `external` and the idea names a work item that already exists, end the idea text with that id's suffix in the provider's format, before the status comment — defined once in [governance/development-methodology.md](../../.arcane/governance/development-methodology.md) under "Tracker-ID Suffix on Captured Items" (e.g. `[#123]` GitHub, `[AB#123]` Azure DevOps, the issue key for Jira). Never guess an id and never file a work item from here — this spell stays instant. In `tracking_mode: internal`, the entry format above is unchanged.
|
|
80
82
|
|
|
81
83
|
If `IDEAS.md` does not exist yet, create it with this header first, then append:
|
|
82
84
|
|
|
@@ -12,18 +12,22 @@ agent: agent
|
|
|
12
12
|
- It reads the current TODO landscape and repo structure to avoid duplicates and pick the right home.
|
|
13
13
|
- Use this any time you have an idea mid-session and don't want to lose it or park it in the wrong place.
|
|
14
14
|
- If the idea is ADR-worthy or journal-worthy, it flags that and routes accordingly.
|
|
15
|
+
- `--prune` removes checked items from a TODO book — report first, outcome recorded or migrated before anything is deleted, one fingerprinted batch approval, and unchecked items are never touched.
|
|
15
16
|
- **In a hub repo:** "add a todo for <venture>" targets that venture's own `TODO.md` book instead of the hub root. `--sweep` skips elaboration entirely and reports new/open counts across every book (hub root + every venture).
|
|
16
17
|
|
|
17
18
|
---
|
|
18
19
|
|
|
19
|
-
Resolve `{BUSINESS_ROOT}` from `.arcane.json`'s `business_root` field (default `ventures/` if unset) before
|
|
20
|
+
Resolve `{BUSINESS_ROOT}` from `.arcane.json`'s `business_root` field (default `ventures/` if unset) before any mode below.
|
|
20
21
|
|
|
21
22
|
## Sweep Mode (`--sweep`)
|
|
22
23
|
|
|
23
24
|
If the argument is (or starts with) `--sweep`, skip every other step in this spell entirely and run this instead:
|
|
24
25
|
|
|
25
|
-
- **In a hub repo:** report `status: new` counts and oldest-entry age for the hub root `TODO.md` plus every `{BUSINESS_ROOT}/<slug>/TODO.md` that exists. Group by book, point at `spell-manifest` for entries ready to promote. Report-only — no edits.
|
|
26
|
+
- **In a hub repo:** report `status: new` counts and oldest-entry age for the hub root `TODO.md` plus every `{BUSINESS_ROOT}/<slug>/TODO.md` that exists. Group by book, point at `spell-manifest` for entries ready to promote. Report-only — no edits (the one exception is the opt-in `--validate` below).
|
|
26
27
|
- **In a consumer repo:** report the same, for the repo-root `TODO.md` only (no venture books exist there).
|
|
28
|
+
- **Idea books too:** report the same `status: new` counts for the idea books that sit beside those TODO books — the hub root `IDEAS.md` and each venture's own `IDEAS.md` in a hub, the repo-root `IDEAS.md` in a consumer repo. Still report-only.
|
|
29
|
+
|
|
30
|
+
**Sweep scope is hub-local (PRD D-08).** The sweep reads only books and journals inside this repository: in a hub, the hub's TODO books, the hub's IDEAS books, and the hub's own `journal/`. **It never reads a consumer repo's clone — not even a registered clone on this machine.** In a consumer repo it reads only that repo's own root books and `journal/`. Reaching into other repositories would widen what this spell touches, a privacy and scope change nobody asked for.
|
|
27
31
|
|
|
28
32
|
Output format:
|
|
29
33
|
|
|
@@ -32,8 +36,84 @@ Todo sweep — N books, M open items
|
|
|
32
36
|
|
|
33
37
|
hub TODO.md 12 open, oldest 2026-07-14
|
|
34
38
|
ventures/ordovica/TODO.md 3 open, oldest 2026-08-10
|
|
39
|
+
hub IDEAS.md 5 new, oldest 2026-08-02
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Unrouted lessons (part of every `--sweep`)
|
|
43
|
+
|
|
44
|
+
The sweep also lists lessons from this repository's own journal that nothing has picked up yet. This pass is report-only, like the rest of the sweep: no writes, no moves, no filing, and no network calls.
|
|
45
|
+
|
|
46
|
+
- **Where:** the hub's own `journal/` only — or, in a consumer repo, that repo's own `journal/` — within the hub-local scope above. Never a consumer clone's journal.
|
|
47
|
+
- **Window:** journal entries dated on or after `--since YYYY-MM-DD`. Without `--since`, the last 30 days. The sweep is report-only, so it keeps no marker of when it last ran: to cover "since the last sweep", pass that sweep's date as `--since`. The output header states the window used.
|
|
48
|
+
- **What counts as a lesson:** each heading directly under a `### Lessons Learned` section — one level deeper, e.g. `#### <lesson>` — because `spell-close-session` writes one heading per lesson. The pass reads headings only. **Bold sentences and bullet items are not read as lessons.** A `### Lessons Learned` section with no per-lesson headings (the older bullet style) is reported as one line — `<path>: Lessons Learned has no per-lesson headings — not harvested` — so it is never silently skipped.
|
|
49
|
+
- **Routed or unrouted:** a lesson is routed when something references it:
|
|
50
|
+
- a `FEEDBACK.md` item;
|
|
51
|
+
- an idea-book entry or a TODO item within the sweep's scope — a reference is the lesson's heading text, or a link to its journal file with the lesson's heading anchor;
|
|
52
|
+
- an issue link in the lesson's own body (`#123`, `AB#123`, a Jira key, or an issue URL).
|
|
53
|
+
|
|
54
|
+
Everything else is unrouted. A lesson that `spell-close-session`'s Lessons Learned routing step (#274) already sent to `FEEDBACK.md` or an idea book is referenced there, so it drops out here.
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
Lessons since 2026-08-28 (hub journal) — 2 unrouted
|
|
58
|
+
journal/2026-09-11-cache-rollout.md
|
|
59
|
+
- The stated risk was work that did not exist
|
|
60
|
+
- Building the state first beat reading the plan
|
|
61
|
+
journal/2026-09-02-release-prep.md: Lessons Learned has no per-lesson headings — not harvested
|
|
62
|
+
Promote with spell-feedback (framework), spell-save-idea (product idea), or spell-todo (task).
|
|
35
63
|
```
|
|
36
64
|
|
|
65
|
+
### Idea validation (`--sweep --validate`, opt-in)
|
|
66
|
+
|
|
67
|
+
Without `--validate`, the sweep never edits anything. With it, the sweep also asks two or three quick yes/no questions per idea entry, so that `spell-manifest` can later see which ideas are worth promoting. Capture itself (`spell-save-idea`) stays unchanged.
|
|
68
|
+
|
|
69
|
+
1. **Candidates:** idea-book entries, within the hub-local scope above, whose status comment is `status: new` and does not yet carry a `value:` field. TODO-book items have no status comment and are not validated.
|
|
70
|
+
2. **Ask, per entry** — show the entry's text and book, then ask:
|
|
71
|
+
- `value` — Is this valuable to the people who use what this repo builds? (`y` / `n` / `?`)
|
|
72
|
+
- `fit` — Does it belong here, rather than in another venture, another repo, or a consumer's own product? (`y` / `n` / `?`)
|
|
73
|
+
- `dup` — Does it duplicate an existing idea entry, TODO item or tracker issue? (`none`, or a short reference such as `#123` or `IDEAS.md 2026-08-02 14:10`; never containing `;` or `--`)
|
|
74
|
+
|
|
75
|
+
`skip` leaves the entry unanswered; `stop` ends the questions and goes on to the confirmation with what has been answered so far. **Nothing is written while the questions are being asked** — the answers are held until step 3.
|
|
76
|
+
3. **One batch confirmation.** Print every change as `file:line`, the old comment, and the new one. Then ask once: `Write N status comments? (write / cancel)`. Only the operator's own literal `write` writes. A timeout, a cancellation, a host-generated fallback or ordinary conversational assent is not confirmation, and nothing is written. If a book changed since it was read, re-read it and confirm again. **Enforcement: structured spell gate (ARC-023) — answers are written only after the operator's single batch `write`; the check is agent-administered, not tool-verified.**
|
|
77
|
+
4. **Write only the status comment.** The entry text, timestamp and tag stay untouched, and the books stay append-only. The answers are added as fields after the status. The grammar is `spell-manifest`'s Step 1 "Status-comment grammar", which reads both forms:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
<!-- status: new --> before
|
|
81
|
+
<!-- status: new; value: y; fit: y; dup: none --> after
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Update `last_updated` in the frontmatter of every touched book. Do not commit; hand off to `spell-commit-work`.
|
|
85
|
+
|
|
86
|
+
## Prune Mode (`--prune`)
|
|
87
|
+
|
|
88
|
+
If the argument is (or starts with) `--prune`, skip every other step in this spell entirely and run this instead. It removes resolved items from a TODO book only after proving each one's outcome is recorded somewhere durable. (Not to be confused with `spell update --prune`, which removes orphaned managed files.)
|
|
89
|
+
|
|
90
|
+
**Target book:** this repo's root `TODO.md`. In a hub, `--prune --venture <slug>` targets that venture's own `TODO.md` instead, resolved through the registry's aliases exactly as Step 0 below does. One book per run.
|
|
91
|
+
|
|
92
|
+
1. **Collect checked items only.** A candidate is a checked item — `- [x]` or `- [X]` — together with its indented continuation lines, and only when every item it is nested under is checked too: a checked sub-item under an unchecked parent belongs to that open item and is never a candidate. **An unchecked item (`- [ ]`) is never a candidate: it is never deleted, moved or edited by this mode.** A checked item with any unchecked sub-item is kept whole and reported as `has open sub-items — kept`.
|
|
93
|
+
2. **Check each outcome is recorded durably.** For each candidate, look for the record of what happened, in this order:
|
|
94
|
+
- the item's own reference — a file link, a PR or issue link, an ADR id, a tracker-id suffix — followed and confirmed to exist and to describe the outcome;
|
|
95
|
+
- otherwise, a search of `journal/`, `DECISIONS.md`, `CHANGELOG.md`, and the repo's audit log and playbooks where they exist, for the item's key terms.
|
|
96
|
+
|
|
97
|
+
Classify each candidate as `recorded → <where>` (path, plus heading or line) or `unrecorded`. A merged PR or closed issue counts as durable only when the item links it; an unlinked guess ("probably PR #40") is `unrecorded`.
|
|
98
|
+
3. **Report first — no edits yet.** Print every candidate with its classification. For each `unrecorded` one, print the outcome migration you propose: a short outcome note (what was done, when, where it can be seen) appended to today's journal entry, `journal/YYYY-MM-DD-<topic-slug>.md`, under a `### Pruned TODO outcomes` heading. If you cannot tell what the outcome was, say so and leave that item out of the batch — never invent an outcome.
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
Todo prune — TODO.md, 5 checked items
|
|
102
|
+
|
|
103
|
+
1. [x] Add export button recorded → CHANGELOG.md (1.4.0)
|
|
104
|
+
2. [x] Decide on ADR numbering recorded → DECISIONS.md (numbering entry)
|
|
105
|
+
3. [x] Document the retrofit path unrecorded → migrate to journal/2026-09-27-todo-prune.md
|
|
106
|
+
4. [x] Wire the push hook has open sub-items — kept
|
|
107
|
+
5. [x] Try the new cache outcome unknown — kept (tell me what happened, or leave it)
|
|
108
|
+
|
|
109
|
+
Delete 3 items (1 after migration). Fingerprint: 3f9c1a…
|
|
110
|
+
```
|
|
111
|
+
4. **One batch approval, fingerprinted.** This is the same gate `spell-commit-work` step 8 uses for a commit. Compute an approval fingerprint from the exact deletion list (book path, line, full item text for every item to delete) plus the exact migration text. Present the list, the migration text and the fingerprint through a structured approval control, and wait for an authenticated operator response tied to that fingerprint. One approval covers the whole batch; there are no per-item prompts. A timeout, a cancellation, a host-generated fallback, a delegated response, or ordinary conversational assent is not approval: halt with nothing written. Recompute the fingerprint immediately before writing. If the book or the migration text changed, the approval is void; ask again. **Enforcement: structured spell gate (ARC-023) — nothing is written until the operator approves the fingerprinted batch; the fingerprint comparison is agent-administered, not tool-verified.**
|
|
112
|
+
5. **Migrate, then delete.** Write every migration first and confirm each one landed. Then delete exactly the approved lines, and nothing else. An item whose migration failed stays in the book. Update `last_updated` in the frontmatter of every touched file.
|
|
113
|
+
6. **Record the deletion; do not commit.** `governance/records-conventions.md` ("Retention and deletion") requires an approved deletion to be recorded. Propose a commit message whose body lists each deleted item and where its outcome is recorded, and hand off to `spell-commit-work`. No separate completed-items ledger is written: `records-conventions.md` defines no home for one, and the commit body plus the migrated journal notes are the record.
|
|
114
|
+
|
|
115
|
+
**Speed rule:** a book with no checked items reports `Nothing to prune — 0 checked items` and stops.
|
|
116
|
+
|
|
37
117
|
## Step 0 — Venture Targeting (Hub Only)
|
|
38
118
|
|
|
39
119
|
If the input names a venture ("add a todo for ordo", `--venture <slug>`), resolve it through `{BUSINESS_ROOT}/registry.json`'s aliases first (exact slug → alias → closest match offered — never guessed). Unknown slug:
|
|
@@ -104,6 +184,8 @@ Expand the idea into one or more concrete TODO items. Each item must:
|
|
|
104
184
|
- Include a file reference if a canonical home doc already exists (e.g., `— see [[DECISIONS]]`)
|
|
105
185
|
- Be specific enough to act on without further clarification
|
|
106
186
|
|
|
187
|
+
**Tracker-id suffix (`tracking_mode: external` only):** when `.arcane.json`'s tracking mode is `external` and an item corresponds to a work item that already exists (the operator gave its id, or the idea names it), end the item with that id's suffix in the provider's format — defined once in [governance/development-methodology.md](../../.arcane/governance/development-methodology.md) under "Tracker-ID Suffix on Captured Items" (e.g. `[#123]` GitHub, `[AB#123]` Azure DevOps, the issue key for Jira). Never guess an id or file a work item just to get one. In `tracking_mode: internal`, items are written without a suffix, exactly as before.
|
|
188
|
+
|
|
107
189
|
If the idea naturally decomposes into multiple sub-items (e.g., "build dashboard" → design, implement, deploy, document), list them individually — do not bundle vague compound items.
|
|
108
190
|
|
|
109
191
|
If the idea is an `adr-candidate`, also draft a one-sentence ADR title suggestion (e.g., `ADR-NNN: Use GitHub Actions for CI instead of Azure Pipelines`).
|