changeledger 0.6.2 → 0.6.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "changeledger",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Turn conversations into buildable changes.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -7,9 +7,9 @@ import { resolveChange } from '../repo.mjs';
7
7
 
8
8
  const MODES = ['implement', 'review', 'spec', 'release'];
9
9
  const MODE_CONTEXT = {
10
- implement: ['implement', 'readiness'],
11
- review: ['review'],
12
- spec: ['spec', 'readiness'],
10
+ implement: ['implement', 'delegation', 'readiness', 'handoff'],
11
+ review: ['review', 'delegation', 'handoff'],
12
+ spec: ['spec', 'delegation', 'readiness'],
13
13
  release: ['release'],
14
14
  };
15
15
  const STATUS_CONTEXT = {
@@ -17,7 +17,7 @@ const STATUS_CONTEXT = {
17
17
  approved: { mode: 'implement', fragments: MODE_CONTEXT.implement },
18
18
  'in-progress': { mode: 'implement', fragments: MODE_CONTEXT.implement },
19
19
  'in-review': { mode: 'review', fragments: MODE_CONTEXT.review },
20
- blocked: { mode: 'blocked', fragments: ['blocked'] },
20
+ blocked: { mode: 'blocked', fragments: ['blocked', 'handoff'] },
21
21
  'in-validation': { mode: 'validation', fragments: ['validation'] },
22
22
  done: { mode: 'close', fragments: ['close'] },
23
23
  discarded: { mode: 'discarded', fragments: ['discarded'] },
@@ -1,6 +1,12 @@
1
1
  # Blocked — Resolve Before Implementing
2
2
 
3
- Do not resume implementation merely because context was requested. Inspect the
4
- blocked task and Log. If the impediment is resolved within authorized scope,
5
- record the decision, restore the task and move `blocked in-progress`. If it
6
- requires scope or product judgment, ask the human. Never bypass the block.
3
+ Do not resume implementation merely because context was requested. A change can
4
+ be blocked by a `[!]` blocked task, an external impediment or a review escalation.
5
+ Inspect the relevant task when one exists and read the Log for the recorded
6
+ reason.
7
+
8
+ If the impediment is resolved within authorized scope, record the decision,
9
+ restore or update the task when applicable and move `blocked → in-progress`. If
10
+ resolution requires scope or product judgment, ask the human. After moving to
11
+ `in-progress`, run `changeledger context <id>` before modifying implementation.
12
+ Never bypass the block.
@@ -1,18 +1,42 @@
1
1
  # Closing Accepted Work
2
2
 
3
- The human accepted this change. Graduate persistent truth before archiving:
3
+ The human accepted this change. Resolve persistent truth before archiving.
4
+ Changes describe a journey; `.changeledger/specs/*.md` describe the current
5
+ capability, architecture or domain truth that code reflects.
4
6
 
5
- - `changeledger graduate <id> <spec-slug>` creates a new spec.
7
+ Specs have no lifecycle or `status`. They use minimal frontmatter and free
8
+ Markdown:
9
+
10
+ ```yaml
11
+ ---
12
+ title: Short title
13
+ updated: 2026-06-30T10:00:00Z
14
+ tags: []
15
+ ---
16
+ ```
17
+
18
+ Choose one graduation outcome:
19
+
20
+ - `changeledger graduate <id> <spec-slug>` creates a new spec seeded from the
21
+ change's Specification and Proposal; refine its wording manually.
6
22
  - `changeledger graduate <id> <spec-slug> --into` links an existing spec and
7
23
  refreshes `updated` without overwriting the spec body (the agent edits the body manually).
8
24
  - `changeledger graduate <id> --skip [reason]` records that no persistent truth
9
25
  changed.
10
- - `changeledger graduate --pending` lists unresolved graduation decisions.
11
- - `changeledger archive <id>` hides the completed record from the default board.
26
+ - `changeledger graduate --pending` lists accepted changes whose decision is
27
+ unresolved.
28
+
29
+ Graduation and skip both set `reviewed: true` on the change: it means the
30
+ persistent-truth question was settled, not necessarily that a spec was created.
31
+ The graduation link remains derivable from the Log marker `graduado a spec`,
32
+ which carries the spec link, rather than from the boolean flag.
33
+
34
+ Operational inspection and visibility:
12
35
 
13
- Specs have no lifecycle: minimal frontmatter (`title`, `updated`, `tags`) plus
14
- free Markdown describing current capabilities, architecture or domain truth.
15
- The change is the journey; the spec is the destination.
36
+ - `changeledger list [--status S] [--type T] [--json]`
37
+ - `changeledger show <id> [--json]`
38
+ - `changeledger archive <id>` / `changeledger unarchive <id>`
16
39
 
17
- After closure, share a brief retrospective. New work needs a new authorized
40
+ Use Mermaid where it communicates persistent relationships better than prose.
41
+ After closure, share a brief retrospective. New work needs a newly authorized
18
42
  change; `done` never reopens.
@@ -36,6 +36,18 @@ done directly. If unsure, document it in ChangeLedger.
36
36
 
37
37
  Humans consume changes in `changeledger view`; write for the rendered view.
38
38
 
39
+ ## Files and delegation
40
+
41
+ Files are the source of truth and may be edited directly. CLI helpers are
42
+ optional and preferred for error-prone operations such as timestamps, lifecycle
43
+ transitions and task markers.
44
+
45
+ Delegate only with a clear boundary and benefit. Each delegation prompt states
46
+ ownership, expected output and integration criterion; coding agents must know
47
+ they share the codebase and must not revert others' work. Do not over-shard or
48
+ overlap write surfaces without an explicit integration plan. Size the model to
49
+ the task's difficulty and risk.
50
+
39
51
  ## Lifecycle
40
52
 
41
53
  ```text
@@ -58,9 +70,11 @@ in-validation → in-progress [human rejection]
58
70
  - `discarded`: terminal tombstone; never reopen it.
59
71
 
60
72
  `changeledger status <id> <status>` enforces agent-owned transitions and does not accept `done` or `discarded`.
61
- Humans approve and validate in the viewer; use
62
- `changeledger discard <id> "<reason>"` for a discarded change. `done` and `discarded`
63
- never reopen.
73
+ The viewer owns `draft → approved` and `in-validation → done|in-progress`; the
74
+ agent performs the other non-terminal moves. Use
75
+ `changeledger discard <id> "<reason>"`: the discard reason is required and
76
+ logged, and dependencies remain resolvable. `done` and `discarded` never reopen;
77
+ later reconsideration needs a newly authorized change.
64
78
 
65
79
  ## Context modes
66
80
 
@@ -0,0 +1,56 @@
1
+ # Economical Delegation
2
+
3
+ ChangeLedger is agnostic to how work is executed. Delegate when it reduces main
4
+ context pressure, lowers cost with a sufficient model, parallelizes genuinely
5
+ independent work or supplies independent verification. Do not delegate when the
6
+ coordination costs more than the expected improvement in quality, speed or
7
+ context control.
8
+
9
+ ## Delegate a real boundary
10
+
11
+ A good delegation unit is a question, module, package, test area, migration
12
+ slice or independent verification. The boundary must state what the delegate
13
+ owns, what it returns and how the result integrates.
14
+
15
+ - Request and Investigation may split independent codebase questions across
16
+ explorers.
17
+ - Proposal and Specification may use stronger reasoning when ambiguity,
18
+ architecture, safety or product judgment is high.
19
+ - Implementation may split only when write sets are disjoint and integration is
20
+ obvious.
21
+ - Verification may be delegated when it catches risk without merely repeating
22
+ the implementer's work.
23
+ - Configured review is special: a fresh clean-context subagent is a correctness
24
+ requirement, not an optimization.
25
+
26
+ ## Do not over-shard
27
+
28
+ Do not create one subagent per file, line or tiny mechanical edit. For the same
29
+ small change across many files, prefer one scoped delegate, a batch edit or a
30
+ script verified by the main agent. Do not run parallel agents over the same
31
+ files or conceptual surface unless overlap and integration are explicit.
32
+
33
+ If you cannot state why the task is independent, what output you expect and how
34
+ you will integrate it, keep the work in the main thread or regroup it.
35
+
36
+ ## Size the model to the work
37
+
38
+ Use the strongest available models for ambiguous scope, architecture,
39
+ security-sensitive reasoning and difficult reviews. Use sufficient cheaper
40
+ models for inventories, localized exploration, mechanical edits and narrow
41
+ checks. Escalate when uncertainty or risk rises; de-escalate when the work is
42
+ well specified and mostly execution.
43
+
44
+ ## Delegation prompt contract
45
+
46
+ Every prompt states:
47
+
48
+ - why the work is delegated;
49
+ - the owned files, area or investigation question;
50
+ - the expected output;
51
+ - the difficulty or risk that informed model choice;
52
+ - the integration criterion.
53
+
54
+ Tell coding delegates they share the codebase: stay inside assigned ownership,
55
+ do not revert others' edits and report overlapping changes instead of silently
56
+ resolving them.
@@ -0,0 +1,22 @@
1
+ # Handoff Triage
2
+
3
+ ## Triage friction at handoff; retrospect after completion
4
+
5
+ Before handing completed or blocked work to the human, classify friction and
6
+ unfinished observations instead of silently mixing them into the active change:
7
+
8
+ - If necessary to fulfill the purpose of an active change, update its
9
+ Specification, Plan and Log; this is not a new concern.
10
+ - If it is an operational step such as verify, commit, graduate, archive or
11
+ close, execute or record it in the current flow.
12
+ - If independent, too large or materially broader, keep it outside the active
13
+ change; propose its type, title, and reason to the human.
14
+ Create the draft only after explicit authorization; batch related proposals
15
+ when practical.
16
+ - If too vague for backlog, mention it in the handoff without
17
+ creating a file.
18
+
19
+ Do not mix independent concerns into active work or block otherwise-ready human
20
+ validation. When a change reaches `done`, also share a brief retrospective about
21
+ what went well and what caused friction. `discarded` records a decision, not a
22
+ completed implementation cycle.
@@ -1,52 +1,68 @@
1
1
  # Implementing an Approved Change
2
2
 
3
- 1. Keep one concern per change. Work necessary for the authorized objective may
4
- update Specification, Plan and Log. If related work materially expands observable scope, obtain explicit human
5
- authorization before adding it; propose independent work separately.
6
- 2. Never implement approved changes on `main`, `master`, or `dev`. Inspect the
7
- worktree first. If unrelated changes exist, do not include them silently.
8
- 3. Commit the approved change documentation before touching implementation code.
9
- Implement one change at a time.
10
- 4. Commit a completed unit before continuing when another task or shared edit makes attribution
11
- ambiguous. Commit messages reference the id. If shared files make a combined commit
12
- unavoidable, record it explicitly and name every change sharing the surface.
13
- 5. Keep the change current with `changeledger task`, `changeledger log`,
14
- `changeledger owner` and `changeledger status`.
15
- 6. Follow the Specification exactly. Write a failing test from each criterion,
16
- make it pass, then refactor. Do not silently drift the document.
17
- 7. Leave no TODO/FIXME, dead code or unrelated residue without explicit agreement.
18
- 8. When implementation and tasks are complete, move to `in-review` if the type
19
- requires independent review; otherwise move to `in-validation` and stop.
3
+ ## Scope and truth
20
4
 
21
- ## Correction isolation
5
+ Keep one concern per change. Work necessary for the authorized objective belongs
6
+ in its Specification, Plan and Log. If related work materially expands observable scope, obtain explicit human
7
+ authorization before adding it; propose independent work separately.
22
8
 
23
- After review `fail --retry`, keep the candidate correction uncommitted while a
24
- fresh clean-context reviewer checks it. If it fails again, iterate on that diff.
25
- After `pass`, commit the confirmed correction and ledger truth before asking for
26
- human validation.
9
+ Follow the Specification exactly. If code and document diverge, update code;
10
+ never quietly drift the approved contract. Keep status, tasks, owner and Log
11
+ current throughout execution.
12
+
13
+ ## Git protects traceability
27
14
 
28
- After human rejection (`in-validation in-progress`), keep the correction
29
- uncommitted until the human confirms it. Do not start another task or change
30
- while a correction waits; the worktree is the isolation boundary.
15
+ Never implement approved changes on `main`, `master`, or `dev`; create or switch
16
+ to a work branch or ask the human before continuing. Inspect the worktree first. If
17
+ unrelated changes exist, do not include them silently; ask the human whether to
18
+ stash, commit, ignore or include them before changing the worktree.
31
19
 
32
- ## Triage friction at handoff; retrospect after completion
20
+ Commit the approved change documentation before touching implementation code.
21
+ Implement one change at a time. Commit a completed unit before continuing when
22
+ another task, change or edit of the same surface could make attribution
23
+ ambiguous; do not wait until the end to reconstruct mixed diffs.
33
24
 
34
- Before handing the human completed or blocked work, classify discovered
35
- friction:
25
+ Commit messages use the canonical shape:
36
26
 
37
- - If necessary to fulfill the purpose of an active change, update that change.
38
- - If it is an operational step such as verify, commit, graduate or archive,
39
- execute or record it in the current flow.
40
- - If independent or materially larger, propose its type, title, and reason to
41
- the human. Create the draft only after explicit authorization.
42
- - If too vague for backlog, mention it without creating a file.
27
+ ```text
28
+ feat(scope): description [#20260629-234939]
29
+ ```
43
30
 
44
- When a change reaches `done`, also share a brief retrospective with the human.
31
+ Use the actual change id and the appropriate conventional type. If shared files make a combined commit
32
+ unavoidable, record it in Log or the handoff and name every change sharing the
33
+ surface.
45
34
 
46
- ## Useful commands
35
+ ## Execute the Plan
36
+
37
+ Write the failing test from each criterion, make it pass, then refactor. Tick
38
+ tasks as they become true, not in a batch at the end. Leave no TODO/FIXME, dead
39
+ code or unrelated residue without explicit agreement.
40
+
41
+ Useful mutation commands:
47
42
 
48
43
  - `changeledger status <id> <status>`
49
44
  - `changeledger task <id> done|block <n> [reason]`
50
45
  - `changeledger log <id> "<message>"`
51
46
  - `changeledger owner <id> <name|->`
52
47
  - `changeledger check [id]`
48
+
49
+ When implementation and every task are complete, move to `in-review` if the
50
+ type requires independent review; otherwise move to `in-validation` and stop.
51
+
52
+ ## Correction isolation
53
+
54
+ After review `fail --retry`, keep the candidate correction uncommitted while a
55
+ fresh clean-context reviewer checks it. If it fails again, iterate on that same
56
+ diff. Do not start another task or change while a correction waits: the
57
+ worktree is its isolation boundary. After `pass`, commit the confirmed correction
58
+ with its related ledger truth before asking for human validation.
59
+
60
+ After human rejection (`in-validation → in-progress`), run
61
+ `changeledger context <id>` before modifying implementation; keep the correction
62
+ uncommitted until the human confirms it fixes the reported failure. Do not start
63
+ another task or change while a correction waits; iterate on
64
+ the same diff if it does not. After human acceptance, graduate or record a skip,
65
+ then commit the correction with its ledger truth.
66
+
67
+ These exceptions prevent false fix attempts from becoming permanent history;
68
+ they do not relax intermediate commits for already verified units.
@@ -1,19 +1,42 @@
1
1
  # Definition of Ready
2
2
 
3
- With `tdd: true`, an approved change is ready only when:
3
+ ChangeLedger supports a deliberate split: a strong model documents and a less
4
+ capable but able model implements. The approved change must contain enough
5
+ precision that implementation does not redefine what should be tested.
4
6
 
5
- 1. Every behavioral requirement is a concrete `CRn` with actual inputs, exact
6
- outputs/effects and literal errors. Edge cases get separate criteria.
7
- 2. Every implementation task names target file(s)/area(s), verification, and the
8
- criteria it satisfies. It is sized to one red-green cycle.
9
- 3. TDD is explicit: write the failing test from the criterion, make it pass, then
10
- refactor. The implementer chooses how, not what, to test.
7
+ The `tdd` flag in `.changeledger/config.yml` defaults to `true`; set `tdd` to
8
+ `false` only for exploratory repos where behavior is intentionally still being
9
+ discovered.
11
10
 
12
- Repos may configure `readiness.target_patterns` and
13
- `readiness.verification_patterns`. For manual checks, prefer a structural rule
14
- such as `verification_patterns: ["verify:"]`, then write evidence like
15
- `verify: manual Android device check` instead of listing every possible manual phrase.
11
+ With `tdd: true`, a change is ready only when:
12
+
13
+ 1. **Specification is test-grade.** Every behavioral requirement is a `CRn`
14
+ with actual inputs rather than “a valid input”, exact outputs/effects and
15
+ literal error messages. Give every edge case its own criterion. Nothing that
16
+ must hold may live only in prose.
17
+ 2. **Plan is the implementation contract.** Every implementation task cites at
18
+ least one CR, names target file(s)/area(s) and contains concrete verification
19
+ in its description before the final `(CRn)` block. Size it to one red-green
20
+ cycle.
21
+ 3. **TDD is explicit.** Write the failing test from the criterion, make it pass,
22
+ then refactor. The implementer chooses how to test, not what behavior to
23
+ prove.
24
+
25
+ Verification may be a colocated test, conventional test directory, concrete
26
+ command or manual `verify:` clause. Examples:
27
+
28
+ ```markdown
29
+ - [ ] Update `src/parser.mjs`; verify: `node --test test/parser.test.mjs` (CR1)
30
+ - [ ] Update Android rendering; verify: manual Android device check (CR2)
31
+ ```
32
+
33
+ Repos tune recognition with `readiness.target_patterns` and
34
+ `readiness.verification_patterns`. For device/manual checks, prefer the stable
35
+ structural convention `verification_patterns: ["verify:"]`; put the actual
36
+ evidence in the task instead of listing every possible manual phrase in config.
16
37
 
17
38
  `changeledger check` reports missing Given/When/Then, uncovered or unknown CRs,
18
- tasks without traceability, and CR-bearing tasks without a configured target and
19
- verification (`draft` warnings; approved/in-progress errors).
39
+ tasks without traceability and CR-bearing tasks without configured target and
40
+ verification. Gaps are warnings in `draft` and errors in `approved` or
41
+ `in-progress`. Truly operational `(support)` tasks are exempt; observable
42
+ implementation is not.
@@ -7,6 +7,10 @@
7
7
  - `changeledger release record <version>` records exactly that plan in
8
8
  `.changeledger/releases/<version>.yml`.
9
9
 
10
+ `changeledger release plan --json` is the handoff contract for the operating
11
+ agent: consume that exact machine-readable membership and version when applying
12
+ stack-specific release steps.
13
+
10
14
  Defaults live under `release.impacts` in `.changeledger/config.yml`; a change may
11
15
  override its type with `release_impact` (`none|patch|minor|major`).
12
16
 
@@ -1,19 +1,30 @@
1
1
  # Independent Review
2
2
 
3
3
  Review-required work must be checked by a fresh subagent with clean context and
4
- a model sized to the difficulty. Independence is correctness, not an
5
- optimization. The reviewer verifies every criterion, every Plan task, tests,
6
- the actual diff and absence of residue; it does not trust the implementer's
7
- summary.
4
+ a model sized to the review difficulty. Independence is correctness, not an
5
+ optimization; do not trust the implementer's summary.
8
6
 
9
- Delegate for a clear reason and boundary. Do not over-shard by file or tiny edit,
10
- and do not overlap write surfaces without an explicit integration plan.
7
+ Inspect the selected change, every `CRn`, every Plan task, tests, the actual diff
8
+ and absence of TODO/FIXME, dead code or unrelated residue. Confirm tasks are
9
+ true rather than merely checked off and that implementation did not drift from
10
+ the approved document.
11
11
 
12
- - Pass: `changeledger review <id> pass` `in-validation`.
13
- - Fixable defect: `changeledger review <id> fail --retry "<reason>"`
14
- `in-progress`.
15
- - Scope/decision escalation: `changeledger review <id> fail --block "<reason>"`
16
- → `blocked` for the human.
12
+ Deep security, SAST and lint belong to dedicated tools. The reviewer may run
13
+ them and record their evidence; ChangeLedger does not reimplement them.
17
14
 
18
- After a retry, the correction stays uncommitted until another clean reviewer
19
- passes it. Then commit correction + ledger before asking for human validation.
15
+ Record exactly one verdict:
16
+
17
+ - `changeledger review <id> pass` — criteria and Plan pass; move to
18
+ `in-validation`.
19
+ - `changeledger review <id> fail --retry "<reason>"` — fixable defect inside the
20
+ authorized contract; return to `in-progress`.
21
+ - `changeledger review <id> fail --block "<reason>"` — correction requires scope
22
+ or product judgment; move to `blocked` for the human.
23
+
24
+ After `fail --retry`, the correction remains uncommitted until another fresh
25
+ reviewer passes it. After the transition, run `changeledger context <id>` before
26
+ modifying implementation. After pass, commit correction + ledger before asking
27
+ for human validation.
28
+
29
+ Types without `review_required` move directly from `in-progress` to
30
+ `in-validation`; do not invent a review gate for them.
@@ -1,6 +1,6 @@
1
1
  # Authoring a Change
2
2
 
3
- ## Repository layout
3
+ ## Repository layout and creation
4
4
 
5
5
  ```text
6
6
  .changeledger/
@@ -11,42 +11,65 @@ AGENTS.md
11
11
  CLAUDE.md # optional
12
12
  ```
13
13
 
14
- The project-owned `AGENTS.md` contains the ChangeLedger bootstrap. Run
15
- `changeledger context` before acting; no per-machine contract link is required.
14
+ The project-owned `AGENTS.md` contains the bootstrap. Run `changeledger context`
15
+ before acting. Create a change with:
16
+
17
+ ```text
18
+ changeledger new <type> <slug> "<title>"
19
+ ```
20
+
21
+ The CLI generates the UTC id, filename and active stages. The slug is structural
22
+ and must be English; title and narrative follow the configured language. Files
23
+ remain the source of truth and may be edited directly, but prefer the CLI for
24
+ timestamps, enums and markers that are easy to mistype.
25
+
26
+ One concern per change. If a request mixes unrelated concerns, propose separate
27
+ changes and create them only after explicit human authorization. Work necessary
28
+ for an already authorized objective stays in that change's Specification, Plan
29
+ and Log. If related work materially expands observable scope, obtain explicit
30
+ human authorization; independent work belongs in a separate change.
16
31
 
17
32
  ## Change document
18
33
 
19
- A change is one Markdown file with YAML frontmatter and fixed English stage
20
- headings. Required frontmatter:
34
+ A change is one Markdown file: YAML frontmatter plus fixed English stage
35
+ headings. Required and optional frontmatter:
21
36
 
22
37
  ```yaml
23
38
  ---
24
39
  id: "20260613-134548"
25
40
  title: Short, clear title
26
- type: feature
27
- status: draft
28
- created: 2026-06-13T13:45:48Z
29
- depends_on: []
30
- owner: ana # optional
31
- release_impact: minor # optional: none | patch | minor | major
41
+ type: feature # feature | bug | audit | refactor | chore
42
+ status: draft # lifecycle value
43
+ created: 2026-06-13T13:45:48Z # full ISO 8601 UTC
44
+ depends_on: [] # change ids or external project:id refs
45
+ owner: ana # optional
46
+ release_impact: minor # optional: none | patch | minor | major
32
47
  ---
33
48
  ```
34
49
 
35
- `owner` is assigned on `approved → in-progress` when absent, preferring the
36
- GitHub login and falling back to `git config user.name`.
50
+ `owner` means responsibility for the change. On `approved → in-progress`, it is
51
+ assigned when absent from the GitHub login (`gh api user --jq .login`), falling
52
+ back to `git config user.name`. Override or clear it with
53
+ `changeledger owner <id> <name|->`; absence means unassigned.
37
54
 
38
- Stages use this order:
55
+ Keep each fact in one stage and link to it from the others. Do not let summaries
56
+ or plans become competing versions of the same truth.
57
+
58
+ ## Stages
59
+
60
+ Use fixed English `##` headings in this order and only when activated for the
61
+ type in `config.yml`:
39
62
 
40
63
  | Key | Heading | Purpose |
41
64
  |---|---|---|
42
65
  | request | `## Request` | Ask, context and why |
43
- | investigation | `## Investigation` | Current state, evidence, constraints, risks |
44
- | proposal | `## Proposal` | Chosen solution and discarded alternatives |
45
- | specification | `## Specification` | Testable acceptance criteria |
46
- | plan | `## Plan` | Actionable checklist |
47
- | log | `## Log` | Chronological execution decisions |
66
+ | investigation | `## Investigation` | Evidence, constraints and risks; root cause for bugs, core analysis for audits |
67
+ | proposal | `## Proposal` | Chosen solution, discarded alternatives and scenarios |
68
+ | specification | `## Specification` | Testable requirements and acceptance criteria |
69
+ | plan | `## Plan` | Actionable task checklist |
70
+ | log | `## Log` | Chronological decisions and execution changes |
48
71
 
49
- Use only the stages activated for the type in `config.yml`. Defaults are:
72
+ Default activation matrix:
50
73
 
51
74
  | Type | request | investigation | proposal | specification | plan | log |
52
75
  |---|:---:|:---:|:---:|:---:|:---:|:---:|
@@ -56,39 +79,83 @@ Use only the stages activated for the type in `config.yml`. Defaults are:
56
79
  | refactor | ✓ | — | ✓ | — | ✓ | ✓ |
57
80
  | chore | ✓ | — | — | — | ✓ | — |
58
81
 
82
+ The configured matrix is authoritative. For bugs, Investigation contains the
83
+ root cause; for audits, it is the core analysis. Proposal includes the chosen
84
+ solution, discarded alternatives and scenarios.
85
+
86
+ When a relationship, flow or architecture is clearer visually, use a Mermaid
87
+ block and keep its text as the source; the viewer renders it.
88
+
59
89
  ## Acceptance criteria
60
90
 
61
- Each criterion is a separate `### CRn — name` block:
91
+ Every behavioral requirement is a separate structured scenario:
62
92
 
63
93
  ```markdown
64
94
  ### CR1 — Short name
65
95
  - **Given** concrete precondition
66
96
  - **When** concrete action
67
97
  - **Then** exact result
68
- - **And** optional additional result
98
+ - **And** optional additional step
69
99
  ```
70
100
 
71
- The heading, ids and Given/When/Then/And keywords are fixed English. Localized
72
- headings, inline criteria and `#### CR1` are not machine-readable.
101
+ Use one `### CRn` block per scenario. Heading, ids and
102
+ Given/When/Then/And keywords stay English; scenario content follows the repo
103
+ language. Localized headings, translated keywords, inline criteria and
104
+ `#### CR1` are not machine-readable.
105
+
106
+ ## Plan task grammar
73
107
 
74
- ## Plan tasks
108
+ Markers encode state and the final parenthesized block encodes traceability:
75
109
 
76
110
  ```markdown
77
- - [ ] Update `src/foo.mjs`; verify: `node --test test/foo.test.mjs` (CR1)
78
- - [x] Update `src/foo.mjs`; verify: `node --test test/foo.test.mjs` (CR1) — 2026-06-13T14:20:00Z
79
- - [!] Update `src/foo.mjs`; verify: `node --test test/foo.test.mjs` (CR1) — reason
80
- - [ ] Operational step with no observable behavior (support)
111
+ - [ ] Update `src/app/foo.ts`; verify: `pnpm test` (CR1)
112
+ - [x] Update `src/app/foo.ts`; verify: `pnpm test` (CR1) — 2026-06-13T14:20:00Z
113
+ - [!] Update `src/app/foo.ts`; verify: `pnpm test` (CR1) — blocked reason
114
+ - [ ] Run the complete test suite after implementation (support)
81
115
  ```
82
116
 
83
- The final `(CRn)` block provides traceability. Put target and verification text
84
- before it; the trailing em-dash suffix is reserved for done timestamps or block
85
- reasons. `(support)` is only for truly operational work.
117
+ For a CR-bearing task, target and verification belong in the description before
118
+ the final `(CRn)` block. Only that final block supplies traceability; mentions of
119
+ `CR1` earlier in the sentence are prose. A task may cover several criteria with
120
+ `(CR1, CR2)`.
121
+
122
+ The trailing `— ...` suffix is resolution metadata only: an ISO UTC timestamp
123
+ for `[x]` or a required reason for `[!]`. Pending tasks have no suffix. This form
124
+ is invalid:
125
+
126
+ ```markdown
127
+ - [ ] Update `src/app/foo.ts` (CR1) — verify: `pnpm test`
128
+ ```
129
+
130
+ The parser removes `— verify: ...` before readiness checks, so the task retains
131
+ CR traceability but appears to have no verification. Write verification before
132
+ the criteria block as shown in the valid examples.
133
+
134
+ `(support)` is reserved for operational work that does not directly implement
135
+ observable behaviour: running a test suite, reading before refactoring,
136
+ evaluating blast radius or scaffolding. Support tasks do not require a CR and do
137
+ not run target/verification readiness checks. `(support)` must be the final
138
+ parenthesized marker and is not a substitute for a missing criterion on
139
+ observable behaviour.
86
140
 
87
141
  ## IDs and language
88
142
 
89
- The id is the UTC creation instant in `YYYYMMDD-HHMMSS` form. Filename is
90
- `{id}-{english-slug}.md`; the slug is always English and kebab ASCII.
143
+ The id is the UTC creation instant in `YYYYMMDD-HHMMSS`, derived from `created`:
144
+ `2026-06-13T15:04:02Z` becomes `20260613-150402`. The filename is
145
+ `{id}-{english-slug}.md`. Timestamp ids sort chronologically and avoid central
146
+ coordination; abbreviated viewer ids are display-only.
147
+
148
+ Always English: frontmatter keys, enum values, stage headings, CR ids and step
149
+ keywords, task markers, filenames/directories and CLI. Configured language:
150
+ title, stage prose, scenario content and task descriptions.
151
+
152
+ ## Authoring helpers
153
+
154
+ - `changeledger new <type> <slug> "<title>"` — scaffold a change with an English slug.
155
+ - `changeledger check [id]` — validate one change or the repository.
156
+ - `changeledger list [--status S] [--type T] [--json]` — inspect/filter changes.
157
+ - `changeledger show <id> [--json]` — inspect one resolved change.
158
+ - `changeledger owner <id> <name|->` — set or clear responsibility.
91
159
 
92
- Frontmatter keys/enums, stage headings, criterion keywords, markers, filenames
93
- and CLI stay English. Titles, prose and task descriptions follow the configured
94
- language.
160
+ Run `changeledger <command> --help` for exact options; the commands support the
161
+ file contract rather than replacing it.
@@ -4,6 +4,7 @@ Implementation and required review are complete. Do not modify the result or
4
4
  mark it done. Ask the human to test the whole change in the viewer.
5
5
 
6
6
  Acceptance reaches `done`. Rejection requires a reason and returns the same
7
- change to `in-progress`; update Specification/Plan as needed and repeat review
8
- when configured. The agent never accepts on the human's behalf. `done` and
9
- `discarded` never reopen.
7
+ change to `in-progress`; run `changeledger context <id>` before modifying
8
+ implementation, update Specification/Plan as needed and repeat review when
9
+ configured. The agent never accepts on the human's behalf. `done` and `discarded`
10
+ never reopen.