cp-skill-write-multistage · diff
git:20260826.db23bd2 to git:20260828.d8eb9d8
213 added, 229 removed. Audit A to A.
---
name: cp-skill-write-multistage
- description: Write or rebuild a KB artifact through reconstruction, claim disposition, drafting, audit, and promotion. Use when claims need grounding, synthesis, or separation across multiple artifacts; avoid it for settled local edits.
+ description: Write or rebuild a KB artifact with source-first reconstruction, consolidated authorship, independent review, and guarded promotion. Use when claims need grounding, synthesis, or separation across multiple artifacts; avoid it for settled local edits.
type: kb/types/instruction.md
user-invocable: true
allowed-tools: Read, Edit, Write, Grep, Glob, Bash, Skill, Task
argument-hint: "[target path | collection/type/topic] [source paths or brief]"
context: fork
---
# cp-skill-write-multistage
+ Produce one supported KB artifact without exposing source reconstruction to the incumbent or promoting bytes an independent reviewer did not accept.
+
## EXECUTE NOW
**Target and inputs: $ARGUMENTS**
- Develop one substantive KB artifact through independent reconstruction, claim disposition, a claim skeleton, drafting, audit, and reconciliation. Keep every intermediate artifact under one `kb/work/multistage/` workshop. Do not add workflow-state fields to the target artifact's frontmatter, and do not write the target until promotion.
-
- This workflow requires fresh sub-agent contexts. If the runtime cannot create them, initialize the workshop, record the limitation, and stop before source reconstruction. Do not imitate source-first independence in a context that has already read the incumbent draft.
-
- ## Step 1 - Resolve The Target And Contract
-
- Determine whether this is:
-
- - **Edit mode:** `$ARGUMENTS` identifies one existing Markdown artifact.
- - **New-write mode:** `$ARGUMENTS` identifies a collection, type, topic, or intended path.
-
- **Conditional external-literature disposition.** If the task explicitly asks
- whether an existing claim-bearing artifact duplicates, restates, or is
- subsumed by external literature, or asks whether to keep, rewrite, thin, merge,
- retire, or remove it from a cohort on that basis, load the framework procedure
- `assess-a-claim-bearing-artifact-against-external-literature.md` before
- continuing. In an installed project, read it from
- `kb/commonplace/instructions/`; in the Commonplace source checkout, read it
- from `kb/instructions/`. Treat that procedure as the governing source-selection
- and disposition contract, add its required assessment records to this skill's
- workshop checklist, and use this skill's later stages to realize any selected
- artifact change. Do not load it for ordinary named-source grounding, synthesis,
- or local revision.
-
- Resolve the target collection to a directory under `kb/` with a local `COLLECTION.md`, and read that file in full.
-
- In edit mode, read `type:` from the incumbent frontmatter and open that type specification. If the file has frontmatter but no `type:`, stop and repair that structural problem first. If it has no frontmatter, treat it as implicit `text`; do not invent a type or type specification.
-
- In new-write mode, default an unspecified collection and type to `kb/notes/` and `kb/types/note.md`. If the user or calling workflow supplied a type path, open it and verify from its own frontmatter that it is a type spec. For a shorthand type name, search Markdown files under `kb/types/` and every collection `types/` directory below `kb/`, inspect their own opening frontmatter, and require exactly one type-spec doc with that `name:`. If none or several match, stop and report the matching paths; do not guess or apply collection-specific precedence. Type lookup identifies the contract rather than collection eligibility, which `commonplace-validate` owns at promotion. Do not add a `kb/work/` branch. An explicit request for `text` means frontmatter-free Markdown rather than a type path.
-
- In new-write mode, run one targeted near-duplicate search using distinctive title or topic terms. Prefer revising a near-duplicate over creating another artifact. Derive a provisional lowercase-hyphenated target path with a filename of at most 70 characters from the requested title or topic before creating the workshop. Use this initial path as the immutable run key. Treat a user-supplied path as fixed unless it violates the collection or type contract; otherwise, if the final title changes the destination, update the current target in `README.md` without changing the run key.
-
- In edit mode, read the incumbent in full, run one backlinks lookup, and preserve a copy as `original.md` in the workshop. Remove `user-verified` from the eventual candidate after any substantive edit unless the user explicitly re-verifies it.
-
- When the task is a mechanical update, a local prose edit, or a straightforward write whose claims, evidence, and structure are already settled, stop and explain why the multistage path is unnecessary. Ask whether the user wants to continue with `cp-skill-write`, and invoke it only after explicit confirmation. When no library artifact is yet intended, explain that the task belongs in an exploratory workshop and ask before creating one.
-
- ## Step 2 - Create Or Resume The Workshop
-
- Search `kb/work/multistage/` for an unfinished multistage workshop whose declared immutable run key or current intended target path exactly matches this run; do not match paths mentioned only in pending handoffs or prose. If exactly one exists, resume it. If several exist, stop and ask which one to use. Otherwise create:
-
- ```text
- kb/work/multistage/multistage-write-<short-topic>-<YYYYMMDD>/
- ```
-
- If that directory already exists for another target, append the smallest available numeric suffix, beginning with `-2`.
-
- Create `README.md` with:
-
- - the immutable run key, current intended target path, mode, collection, and type;
- - the workshop's source/input paths;
- - a checklist for `brief.md`, `reconstruction.md`, `claim-disposition.md`, `claim-skeleton.md`, `draft.md`, `audit.md`, `candidate.md`, conditional `acceptance.md`, and promotion;
- - unresolved human decisions and blockers;
- - pending handoffs, each with its target, proposed delta, user authorization, and order when known;
- - whether acceptance review is required, not required, or complete.
-
- The checklist and stage files are the workflow state. Do not introduce a `stage` frontmatter field. Mark a stage complete only after its file is non-empty, contains the required items for that step, and has no blocker that the next step would hide. If an upstream artifact changes, uncheck and regenerate every dependent stage before promotion.
-
- Add a one-line entry for the active run to `kb/work/README.md`. Preserve unrelated edits in that file; if an overlapping uncommitted change makes the update unsafe, record the pending index update in the workshop `README.md` and report it rather than overwriting another agent's work.
-
- ## Step 3 - Write The Brief
-
- Write `brief.md` before delegating any prose. Include only information fixed by the task:
-
- - the question or decision the artifact must address;
- - intended audience and what the reader should understand, infer, or do;
- - intended target path, mode, collection, and type;
- - target claim or purpose supplied by the user, without expanding it;
- - scope, exclusions, required terminology, and collection/type constraints;
- - source and evidence paths available to the run;
- - user directions and retained intent supplied to the run, with each memory input's source, subject, scope, and authoritative or advisory role, distinguishing inputs that can select intent from evidence that can warrant claims;
- - known uncertainties, missing evidence, and decisions reserved for the user.
-
- Repository and collection contracts may supply the acceptable contribution class, quality bar, and a default audience. They do not by themselves select the artifact's governing question, claim, or purpose. Carry choices already fixed by the task, incumbent artifact, or supplied retained intent into the brief without asking the user to restate them. Current user direction prevails. If retained intent conflicts with the incumbent or another applicable input and no explicit precedence resolves the conflict, leave the choice unresolved. Do not treat remembered intent as meaning extracted from the bare request, model prior, or factual warrant. This skill consumes memory supplied through the retained-intent input but does not search raw interaction history itself.
-
- If several materially different contributions still fit, record `DECISION NEEDED: intended contribution (specification gap)` in `brief.md` and the workshop `README.md`, then stop before reconstruction. A stronger model may use supplied context better, but greater capability does not make one of several compatible commissions authoritative. Source reconstruction must not choose the commission.
-
- Acquire or ingest every named input needed to answer the governing question before continuing. Do not use search snippets as evidence. Missing intent is **blocking** when it leaves materially different commissions open. Missing evidence is **blocking** when the artifact cannot answer its governing question without asserting the missing claim. Pause at this step for either kind of blocker. A gap is **non-blocking** when the claim can be omitted or the uncertainty can honestly remain part of the final artifact; record it for reconstruction.
-
- ## Step 4 - Reconstruct From Sources In A Fresh Context
-
- Launch one fresh, single-use sub-agent. Give it only `brief.md` and the exact source/evidence paths listed there. Do not give it `original.md`, any prior draft, or conclusions from another reviewer. Tell it not to search for or read those files.
-
- Have it write `reconstruction.md` containing:
-
- - the material facts, mechanisms, distinctions, quantities, and definitions supported by the inputs;
- - the source or user direction supporting each material item;
- - conflicts among inputs and differences in evidential strength;
- - inferences stated as inferences rather than source facts;
- - unresolved questions and explicit `EVIDENCE NEEDED`, `DEFINE`, or `DECISION NEEDED` markers where appropriate;
- - details that are available but irrelevant to the target question, so they are not reintroduced merely because they are concrete.
-
- Keep the reconstruction proportional to the inputs. Do not repeat the same limitation under several headings, derive unrequested statistics, or enumerate unavailable details that do not affect the target claim. Do not ask for polished prose. The reconstruction is an independent account against which later prose can be audited.
-
- ## Step 5 - Dispose Candidate Claims Before Choosing The Artifact Shape
-
- Launch a new single-use claim architect with `brief.md`, `reconstruction.md`, and the target collection/type contracts. Do not initially give it `original.md` or any draft. It may run targeted title and description searches and open plausible existing notes for each candidate claim discovered during reconstruction. In edit mode, give it the current target path as an exclusion: it must not open that file even when a search surfaces it.
-
- Have it write a `## Source-first disposition` section in `claim-disposition.md`. Inventory every candidate durable claim needed to answer the governing question and record:
-
- - the claim in one sentence;
- - its relation to the user-supplied target;
- - its evidential basis;
- - whether an existing artifact already states it adequately;
- - one disposition: `central contribution`, `cite existing`, `fold into existing`, `separate new artifact`, `support/example/scope only`, or `omit/retain in workshop`;
- - the existing or proposed target path when applicable;
- - why the disposition preserves a useful citation and revision boundary.
-
- In edit mode, wait until the source-first section is saved before giving the same architect `original.md`. Then have it append `## Incumbent reconciliation` without rewriting the source-first section. It must inventory every material incumbent commitment that the source-first pass omitted, merge duplicates explicitly, and give each remaining commitment the same disposition fields. The incumbent can reveal a claim that needs evaluation, but it is not evidence for that claim. If retaining or revising an incumbent commitment requires support absent from `reconstruction.md`, mark `EVIDENCE NEEDED` and return to Step 4 after acquiring the exact evidence path and adding it to `brief.md`. An unsupported commitment may be explicitly omitted only when the governing question and supplied intent do not require it; otherwise treat the missing evidence as blocking under Step 3. The architect must not open the live target or any draft during this reconciliation.
+ Use this when grounding, synthesis, or separation leaves claims, evidence, or artifact shape unsettled.
+ Confirm before routing a settled edit to `cp-skill-write` or work without a library target to a workshop.
- For a claim-bearing artifact, default to one atomic central contribution: one proposition another artifact can cite as a premise without inheriting an independent claim cluster. Evidence, mechanism, consequences, examples, and scope may remain when they establish, apply, or bound that proposition. A section that could be removed while leaving the central argument intact, and that another artifact may need to cite independently, is a separate claim rather than supporting completeness.
+ The invoking agent is the **parent**. It owns admission, brief and evidence, run state, decisions,
+ invalidation, grounding, scheduling, integration, live mutation, concurrency, promotion, validation,
+ lineage, recovery, cleanup, and reporting. The target stays untouched until promotion; workflow state never enters its frontmatter.
- Do not use the `synthesis` trait merely because reconstruction produced several relevant claims. Use it only when the composition or inferential relation among already-citable components is itself the central contribution and no newly introduced component needs an independent citation or revision boundary. Definitions, specifications, articles, instructions, and other types whose contracts require multiple commitments keep their type-appropriate shape, but still dispose independent transferable claims instead of hiding them inside the artifact.
+ The universal writing path uses only three worker roles: isolated source reconstructor, consolidated
+ candidate author, and fresh independent reviewer. Do not add a core planner, skeleton writer,
+ draft-only writer, auditor, acceptor, or repairer. No core worker may delegate. A loaded conditional
+ procedure may use only the workers, artifacts, and callee-internal calls it explicitly authorizes;
+ the parent still schedules and integrates them, and no other delegation is allowed. If fresh contexts
+ are unavailable, initialize the run and stop before reconstruction.
- Apply these decision gates:
+ ## 1. Admit and initialize
- - If the task and evidence do not determine which of several claims is central, record `DECISION NEEDED: central contribution`, update the workshop `README.md`, and ask the user.
- - If a discovered claim should substantively change an existing artifact other than the current target, record the proposed target and delta, then ask the user before folding it. Merely citing an adequate existing claim does not require confirmation.
- - If more than one independent new artifact is warranted, record each proposed artifact and ask the user which to produce first and whether to create separate runs for the others. If the user already authorized the set and order, record that direction and continue with only the current artifact; every additional artifact gets its own run.
- - Do not ask about claims classified as support, example, scope, omission, or adequate existing premises.
+ Resolve one target, mode, collection, type, authority, and done state.
- After a user decision, clear the corresponding decision marker in the workshop `README.md` and add the direction to `brief.md`. Before invalidating `claim-disposition.md`, copy every authorized but non-current fold or additional artifact into the README's pending handoffs.
+ Resolve the target collection to a directory under `kb/`, require a local `COLLECTION.md`, and read
+ that contract in full. Stop if the selected collection has no local contract.
- If the decision changes target identity, mode, collection, or type—not merely the provisional filename of a new artifact within the same collection and type—return to Step 1 first. Re-resolve the target and contracts and replace target-specific incumbent and backlink inputs. Synchronize the target path, mode, collection, type, and source paths in `brief.md` and the workshop `README.md`, and replace the collection/type constraints in `brief.md`. If the selected target is an additional artifact rather than a replacement for the current one, leave it as a Step 10 handoff instead of retargeting this run.
+ - **Edit:** require an existing Markdown target. Read its frontmatter type spec when present.
+ Frontmatter without `type:` stops; no frontmatter means implicit `text`. Run one backlinks
+ query. Before workers run, save byte-exact `original.md` and its lowercase SHA-256. The incumbent
+ is a reconciliation input, drift baseline, and rollback source, never evidence for itself.
+ - **New:** resolve the supplied collection, type, topic, or path. Default to `kb/notes/` and
+ `kb/types/note.md`; an instruction without a collection goes to `kb/instructions/`. Reject
+ `kb/work/`. Verify an explicit type path. Resolve shorthand across global and collection-local
+ type specs and require exactly one matching `name:`; stop on zero or several. Explicit `text`
+ means no frontmatter. Run one targeted near-duplicate search. Keep a valid user path fixed;
+ otherwise use a provisional lowercase-hyphenated filename of at most 70 characters.
- Because the brief or target inputs changed, uncheck reconstruction and every dependent stage, then resume at Step 4. Do not regenerate only `claim-disposition.md`. Continue only when the rebuilt disposition names exactly one current central contribution or one type-appropriate practical purpose with no unresolved decision marker.
+ A filename may change later only for the same provisional new artifact. A change of identity, mode,
+ collection, or type restarts setup. Never mutate a near duplicate or retarget without authority.
- ## Step 6 - Build The Claim Skeleton In A Fresh Context
+ Create or resume
+ `kb/work/multistage/multistage-write-<short-topic>-<YYYYMMDD>/` with an immutable run key. Resume
+ one matching unfinished run; ask if several match. Add a suffix only after proving a collision is a
+ different valid run. A matching or ambiguous directory without valid state is a recovery stop.
+ Maintain its exact `kb/work/README.md` line without overwriting unrelated work; if overlap prevents
+ that, record and report the pending index update.
- Launch a new single-use sub-agent with `brief.md`, `reconstruction.md`, and `claim-disposition.md`. It may read a named source only to resolve an explicit reconstruction ambiguity. It must not read `original.md` or any draft.
+ Keep a small run `README.md`: identity and contracts, sources, current step, one blocker, handoffs,
+ grounding results, candidate/review digests, whether post-review reconciliation was used, and checks. Keep `brief.md`,
+ `reconstruction.md`, `claim-disposition.md`, `candidate.md`, immutable review records, and
+ edit-only `original.md`. Do not require claim architecture, skeleton, separate draft, mutable audit,
+ separate acceptance, or copied sources; pin only for a concrete identity risk. Scratch is not run state.
- Have it write `claim-skeleton.md` as a compact ordered plan containing:
+ ## 2. Freeze intent and evidence
- - the one central claim or type-appropriate practical purpose fixed by `claim-disposition.md`;
- - the work each section or paragraph must perform;
- - each material assertion, its scope and confidence, and its evidential basis;
- - the inferential links needed to move from evidence to conclusion;
- - definitions or comparisons needed for truth conditions;
- - unresolved markers, each classified as blocking, omittable, or suitable for an explicit published limitation or open question;
- - tempting but irrelevant branches to omit.
+ Write `brief.md` from current direction or named retained intent with an explicit authoritative or
+ advisory role. Current direction prevails; conflict stops. Do not search raw interaction history,
+ derive purpose from the incumbent, or let contracts choose the contribution. Label parent proposals.
- Every planned paragraph must change what the reader understands, infers, or can do. Do not add setup, summary, or praise merely to make the artifact sound complete.
+ Record question, contribution, audience, scope, done state, acceptance, constraints, privileged facts,
+ external commitments, coupling, target authority, evidence paths and roles, exclusions, and reserved
+ choices. Acquire and verify every source needed for the governing question before reconstruction.
+ When a required source lacks a readable authorized path, use the `cp-skill-ground` call and result
+ contract in Section 5 with the tracked ingest or authorized canonical URL and the exact source-side
+ question. Obtain user authority first for an agent-nominated untracked URL. Include substantive
+ evidence produced here in the first reconstruction. For a blocker use `DECISION NEEDED: intended contribution (specification gap)`,
+ `DECISION NEEDED: central contribution`, `EVIDENCE NEEDED`, or `DEFINE`; record owner and resume point, then stop.
- Do not proceed while a blocking marker remains. For each non-blocking marker, either omit the dependent claim or explicitly authorize its conversion into a published uncertainty, limitation, or open question. Update the workshop checklist and resume from reconstruction when new evidence changes the skeleton.
+ Only for an explicit external duplication, subsumption, or keep/rewrite/thin/merge/retire/cohort
+ question, execute `assess-a-claim-bearing-artifact-against-external-literature.md` from
+ `kb/instructions/` in the source checkout or `kb/commonplace/instructions/` when installed. It
+ owns source candidacy, comparison, disposition, and calls to `cp-skill-ground`; do not duplicate it.
+ Add its required assessment records to this run. When that procedure authorizes bilateral isolation,
+ its fresh target worker, target-blind source/grounding worker, and isolated comparison worker may
+ write `target-claim-inventory.md`, `source-reconstruction.md`, and `isolated-comparison.md`; this is
+ the exact conditional exception to the three-role core. The multistage parent retains final
+ authorship, review, promotion, and integration. Separate source-only records from incumbent-aware
+ records when constructing later packets. Do not load it for ordinary grounding, synthesis, or
+ revision. Stop on an interface or authority gap.
- ## Step 7 - Draft In A Fresh Context
+ ## 3. Reconstruct in isolation
- Launch a new single-use writer with `brief.md`, `reconstruction.md`, `claim-disposition.md`, `claim-skeleton.md`, and the target collection/type contracts. Do not give it `original.md`.
+ Launch a fresh report-only worker with this complete packet:
- Have it write `draft.md`. Require it to:
+ - **Result and constraints:** reconstruct enough authorized source evidence to answer `brief.md`.
+ Separate support from inference; retain source roles, conflicts, scope, uncertainty, and proportional
+ detail; invent no precision; do not delegate.
+ - **Inputs and exclusions:** read only `brief.md`, its exact source-only paths, and named collection
+ or type contracts. Exclude the target, `original.md`, incumbent-aware assessments, earlier
+ reconstruction/disposition, planning or scratch, candidate, reviews, and incumbent-derived text.
+ The brief must therefore contain no incumbent paraphrase.
+ - **Output and coordination:** write only `reconstruction.md`; the parent alone schedules and
+ integrates it, and no other writer touches it.
+ - **Verification and stop:** record material facts, mechanisms, distinctions, quantities, definitions,
+ evidence strength, conflicts, labeled inferences, gaps, and irrelevant detail with each material
+ basis and boundary. Stop on a missing input or governing gap with `EVIDENCE NEEDED` or `DEFINE`.
- - realize the skeleton rather than discover new claims through fluent prose;
- - preserve qualifiers, scope, uncertainty, and source distinctions;
- - name mechanisms, comparison bases, and applicable scope where they affect the claim;
- - express authorized uncertainty in reader-facing prose, but never copy workshop markers such as `EVIDENCE NEEDED` or `DECISION NEEDED` into the draft;
- - use the simplest structure and language that carry the argument;
- - omit frontmatter fields that the collection/type contract does not authorize.
+ The parent verifies and freezes the output before incumbent-aware work. Never append reconciliation
+ or review findings. Changed premises require a new fresh run of this role.
- The writer must not silently introduce a new commitment. When the prose appears to need one, insert `NEW COMMITMENT FOR AUDIT:` with the proposed claim instead of treating it as established.
+ ## 4. Author disposition and candidate
- ## Step 8 - Audit Commitments Before Polishing
+ Launch one author role with staged incumbent reveal and this complete packet:
- Launch a new single-use auditor. Give it `brief.md`, `reconstruction.md`, `claim-disposition.md`, `claim-skeleton.md`, `draft.md`, the relevant contracts and sources, and `original.md` in edit mode.
+ - **Result and constraints:** write a complete disposition, then exact target-compatible candidate
+ bytes. Preserve evidence roles, scope, qualifiers, uncertainty, definitions, dependencies, simple
+ wording, and target contracts. Add no undisposed claim; do not delegate or infer mutation authority.
+ - **Output and coordination:** write only `claim-disposition.md` and `candidate.md`. The parent
+ controls reveals, decisions, and feedback. The worker cannot mutate target, run state, sources,
+ ingests, lineage, index, siblings, near duplicates, citers, or other artifacts.
- Have it write `audit.md` with anchored findings. Each finding begins with `Status: open` and recommends one action: `keep`, `remove`, `ground`, `clarify`, or `ask user`. `Keep` means that the cited draft text is already justified; the finding must name that basis. Audit in this order:
+ **First reveal:** provide only brief, frozen reconstruction, exact target contracts, source-only
+ literature records, and any bounded read-only duplicate/premise search whose scope and purpose the
+ packet names and which excludes the target. Exclude original, target, incumbent-aware comparisons,
+ prior dispositions, candidates, and reviews. The author writes only `## Source-first disposition`.
+ For every material reconstructed commitment, record basis, scope, qualifiers, dependencies,
+ definitions, unsupported status or gap, independent-claim boundary, and one treatment:
+ central/type-required content, support/example/scope, cite existing, proposed fold, separate-artifact
+ handoff, omit, or evidence/authority gap. Name the existing or proposed target and the useful
+ citation or revision boundary when relevant. A claim-bearing note normally has one importable central
+ proposition; `synthesis` requires the relation among citable components to be central; instructions
+ and similar types may have their required multiple commitments.
- 1. **Claim delta:** identify every draft commitment absent from the skeleton, every planned commitment omitted or altered, and every change in causality, scope, confidence, quantity, or recommendation. In edit mode, also verify that every material incumbent commitment appears in the incumbent reconciliation, then identify incumbent commitments the draft drops or changes.
- 2. **Artifact shape:** check every independent claim against `claim-disposition.md`. For a claim-bearing target, verify that the title, description, opening, and body expose one importable central proposition; flag any second cluster that should be cited, revised, folded, or promoted independently. Reject a `synthesis` trait used only to waive extraction.
- 3. **Grounding:** check material assertions against the reconstruction and sources. Distinguish source fact, user direction, inference, and unsupported completion.
- 4. **Specificity:** flag ambiguity that changes truth conditions, support, or implications. Ask for mechanism, comparison basis, or scope only where it is load-bearing; do not demand decorative detail.
- 5. **Relevance and audience:** flag undefined dependencies, displaced implications, irrelevant facts, and paragraphs that do no new work.
- 6. **Compression and prose:** only after the content audit, identify repetition, filler, unnecessary framing, and sentences whose syntax hides the claim.
+ The parent verifies and freezes that section. **Second reveal:** give the same role byte-exact
+ `original.md` and named incumbent-aware assessments, or confirm new mode. It appends
+ `## Incumbent reconciliation`, mapping each material incumbent commitment to keep/change/omit and
+ making replacement, fold, retitle, merge, retirement, and artifact-set effects explicit. The
+ incumbent supplies no warrant.
- Do not rewrite the draft in the audit. If a correct recommendation requires evidence or intent not present in the inputs, use `ask user` rather than guessing.
+ - **Stop:** before prose, return any user-owned central contribution or mutation choice and its resume
+ point. Broader work is only a handoff.
+ - **Complete and verify:** after gates clear, write `candidate.md`. The author chooses decomposition,
+ order, paragraphs, examples, and wording. Preserve valid metadata and links unless authorized
+ change requires otherwise; remove `user-verified` after substantive change unless a human verifies
+ these bytes; resolve links from the final destination. A new commitment first updates disposition
+ or returns upstream. The parent checks both disposition sections, claim coverage, contracts, and
+ write scope.
- ## Step 9 - Reconcile Into A Candidate
+ Feedback returns through the parent. A premise change before any completed review invalidates the
+ affected stages and repeats both reveals with a fresh author when source-first isolation was lost; it
+ does not consume the post-review reconciliation allowance.
- The orchestrating agent reads all workshop artifacts and writes `candidate.md` as a complete target artifact, including valid frontmatter when the selected type uses it. Preserve frontmatter-free implicit `text` as frontmatter-free text.
+ ## 5. Ground named source dependencies
- Resolve every audit finding explicitly in `audit.md`: add `Status: resolved` and a `Resolution:` naming the candidate change or the reason the text was kept. Use `Status: blocked` when evidence or a user decision is still missing. Do not promote while any finding remains open or blocked.
+ Before review, identify each new or materially changed candidate claim that depends on a named external
+ source; unchanged edit wording and passing mentions do not retrigger the gate. For an exact dependency
+ already grounded by the external-literature procedure, consume and verify its current grounding
+ result instead of calling the skill again. For each new or unresolved dependency, invoke
+ `cp-skill-ground` with exactly:
- When reconciliation introduces material evidence not covered by `reconstruction.md`, return to Step 4. When it changes the central contribution, any claim disposition, or the justification for synthesis without new evidence, return to Step 5. When it changes only ordering or expression, continue.
+ ```text
+ Target: <exact ingest path or authorized canonical source URL>
+ Claim needed: <source-side proposition or question>
+ ```
- For public-facing, high-stakes, causal, or quantitative work—or whenever the audit found material drift—launch one final fresh acceptance reviewer. Give it `brief.md`, `reconstruction.md`, `claim-disposition.md`, `claim-skeleton.md`, `audit.md`, `candidate.md`, the relevant contracts and sources, and `original.md` in edit mode. Have it write `acceptance.md` with `Verdict: PASS` or `Verdict: BLOCK` followed by anchored blockers only. Reconcile a block and rerun once, replacing `acceptance.md` with the current verdict; if material disagreement remains, ask the user. When review is not required, mark it `not required` in `README.md`.
+ Never include target prose or target-specific transfer reasoning. Get user authority before passing
+ an agent-nominated untracked URL because the callee may invoke `cp-skill-ingest`. The callee owns
+ resolution, permitted ingest creation, and the only allowed reuse or append in an ingest's Quotes
+ section; it validates or restores that mutation and never edits target or other ingest sections. This
+ parent never edits or creates an ingest.
- ## Step 10 - Promote And Validate
+ For `quotes sufficient` or `quotes added`, read complete Quotes, use only its verbatim extracts,
+ apply `semantic/grounding-alignment`, and use an unmarked ingest link; record path and returned
+ appended text for `quotes added`. For `snapshot required`, follow the returned name-paired snapshot
+ and gate requirements and retain the exact `(snapshot required)` marker. Any blocker, including the
+ exact `re-ingest.md` route, stops the run; never bypass it or invoke `cp-skill-ingest` directly.
+ Substantive new evidence invalidates reconstruction. Waiting is not completion.
- Promote only when:
+ ## 6. Review and reconcile
- - all workshop blockers and unintended unresolved markers are gone;
- - `claim-disposition.md` names one current contribution, all independent claims have explicit dispositions, and every required user decision is recorded;
- - each material commitment has an authorized basis, with inferences, uncertainties, and open work labeled appropriately;
- - the candidate follows the collection and type contracts;
- - every audit finding is resolved;
- - any required acceptance review passes.
+ After grounding, hash exact candidate bytes. Launch a fresh reviewer who did not author or revise
+ them; changed bytes require a different fresh reviewer. Its complete packet is:
- Before promotion, inspect `candidate.md` for every addition or material change
- that depends on a named external source, regardless of the target collection.
- This includes a source, URL, or ingest supplied as support; an added or changed
- attribution, quotation, empirical result, or borrowed mechanism tied to a named
- source; and a review finding that asks for exact claim/source grounding. A
- passing mention or adjacent example not used as support is not a dependency.
- In edit mode, compare against `original.md` and do not retrigger the guard for
- unchanged source-dependent wording.
+ - **Result and constraints:** decide whether those exact bytes may be promoted. Use only authorized
+ inputs; anchor findings; edit nothing; do not delegate; return exactly `accept` or `block`.
+ - **Inputs and exclusions:** read candidate and full SHA-256, brief, reconstruction, disposition,
+ edit-only original when present, exact target contracts, parent-supplied grounding results, and
+ every authorized external-literature assessment record when that branch ran. Exclude target,
+ parent conversation, scratch, prior reviews, and every unnamed path.
+ - **Output and coordination:** write only immutable `review-01.md`, or `review-02.md` after
+ reconciliation, naming the full digest. The parent verifies and acts; the reviewer neither contacts
+ the author nor repairs.
+ - **Verification and stop:** check candidate/incumbent delta against disposition, then intent and
+ omissions, shape, evidence and grounding, specificity/audience/relevance, and compression/prose.
+ Each finding gives anchor, basis, byte-change requirement, and a block's upstream return. End with
+ a line containing only `accept` when no byte change is required, otherwise `block`; absent or
+ mismatched input requires `block`.
- For each guarded dependency, resolve exactly one direct tracked
- `kb/sources/<slug>.ingest.md` from the supplied ingest, canonical source URL, or
- unambiguous source identity. Read its complete Quotes section and the
- `semantic/grounding-alignment` gate from the installed framework gate catalog.
+ Recompute the digest after return. Acceptance applies only to matching unchanged bytes. Never mutate
+ a review record. A malformed, missing, or unavailable review is a worker-failure stop; it neither
+ authorizes promotion nor consumes semantic reconciliation. Every admitted run,
+ including a no-change candidate, needs final `accept`.
- - When the retained verbatim quotes contain enough source material for the
- gate to judge the candidate's use, apply the gate directly to that use. Link
- the ingest without a snapshot marker, ignore every ingest section outside
- Quotes as source support, and keep target-specific transfer reasoning in the
- target.
- - Use the snapshot route only when an earlier grounding run returned `snapshot
- required`. Put the exact marker `(snapshot required)` in the ingest link
- text. Derive the exact name-paired snapshot, require its exact-byte SHA-256
- and canonical source to match the ingest, read it, and apply the same gate to
- the candidate's use. Stop if the snapshot is absent, mismatched, or does not
- support the use.
- - Otherwise, if Quotes is insufficient and the ingest exists, invoke
- `cp-skill-ground` with `Target: <ingest path>` and `Claim needed: <the
- source-side proposition or question>`, then act on its route: `quotes
- sufficient` or `quotes added` — re-read the Quotes section and apply the gate
- as in the first bullet; `snapshot required` — take the snapshot route above;
- a blocker — add it to the workshop `README.md` with the exact dependency and
- retain `candidate.md` and the workshop without changing the live target.
- Record every `quotes added` result, with the ingest path, in the workshop
- `README.md` and the final report so the append is never a silent side effect
- of a write.
- - If the dependency names a URL with no tracked ingest, add a blocker naming
- the exact URL for a separate `cp-skill-ingest` run; this writer does not
- create source records.
+ The run has one post-review reconciliation allowance. Consume it the first time candidate bytes
+ change after a well-formed completed review, whether that review returned `accept` or `block`.
+ Missing evidence returns to evidence then reconstruction; missing authority returns to the user then
+ disposition; a supported finding within settled claims returns to the author. Update upstream
+ artifacts and rerun grounding. Changed bytes get a new digest and different fresh reviewer. A second
+ `block`, or any further need to change candidate bytes after review, stops with records and workshop
+ retained. Metadata, whitespace, links, validator repair, and rebase are byte changes.
- If neither an exact ingest nor a canonical URL can be resolved, record that
- source-identity blocker and ask for the missing identity. This writer invokes
- the grounding skill but never edits an ingest itself, never creates one, and
- introduces no separate result protocol. It reads a source snapshot only for a
- declared `snapshot required` dependency. Do not begin any promotion write while a
- source-dependency blocker remains. If applying the source gate or changing the
- link materially changes the audited candidate, return to Step 9 and renew any
- affected audit or acceptance work before promotion.
+ Clear every dependent completion:
- Identify each focused local source whose collection authorizes a source-to-target lineage footer. Validate it in its current state, and preserve a workshop copy of every source that will change. If a source is already invalid, stop before promotion.
+ | Change | Resume |
+ |---|---|
+ | Target identity, mode, collection, or type | Setup |
+ | Question, result, audience-bearing acceptance, evidence, or substantive new evidence | Reconstruction |
+ | Choice among reconstructed claims or authority for replacement, fold, retitle, merge, retirement, or artifact set | Disposition |
+ | Disposition only | Candidate |
+ | Candidate bytes | Fresh review |
+ | Live-target drift | Stop for abandon/rebase; authorized unchanged-evidence rebase returns to disposition |
- Before writing, verify the candidate's frontmatter when applicable, required sections, and relative links as they will resolve from the target directory. Write `candidate.md` to the resolved target path. Preserve valid incumbent metadata and links unless the revision requires changing them. For a new artifact, derive a lowercase hyphenated filename of at most 70 characters from its title unless the user supplied a path. Never grant `user-verified` implicitly.
+ ## 7. Promote and close
- Run:
+ Only the parent promotes. Require no blocker; grounding passed; candidate SHA-256 equals final
+ `accept`; destination-relative frontmatter, required sections, and links pass preflight; and the
+ live edit target still equals `original.md`, or the new target is absent. Never auto-overwrite or
+ auto-rebase. A digest is not a lock; compare and write in one parent-controlled sequence.
- ```bash
- commonplace-validate path/to/target.md
- ```
+ An edit retitle needs explicit authority and stays separate from substantive replacement. Dry-run
+ `commonplace-relocate-note <old-path> --to <final-path>`; require the destination absent and inspect
+ every reported move, Markdown rewrite, and ProperDocs change. Stop if the report includes
+ `original.md`, `candidate.md`, a frozen reconstruction/disposition, or an immutable review record.
+ Before `--apply`, require mutation and separate-commit authority plus a concrete authorized recovery
+ mechanism covering the move, destination absence, every reported Markdown file, and ProperDocs. If
+ that complete recovery path is unavailable, stop after the dry run and report the retitle blocker.
- Fix validation failures immediately. If they cannot be fixed within the established claim and contract, restore `original.md` byte-for-byte in edit mode or remove the newly created target in new-write mode, retain the workshop, and report the blocker.
+ Re-run the exact command with `--apply`. The command is non-transactional. On error, stop, inventory
+ the actual state, execute only the preauthorized recovery, and verify every affected path before any
+ other edit. On success, require the old path absent and destination present; require the diff to
+ contain only the reported address-preserving mutations; re-hash candidate and accepting review
+ against their pre-apply hashes; and validate the relocated target, every changed Markdown file, and
+ the redirect map when ProperDocs changed. Any mismatch or invalid output stops and uses the recovery
+ path. Keep a successful address-only relocation pure and separate under repository commit policy.
+ Capture byte-exact `relocated-original.md` as the new drift and substantive rollback baseline;
+ before replacement require it unchanged. Candidate title, frontmatter, and links must already fit
+ the destination. The command does not change the title or frontmatter and does not preserve review
+ freshness.
- After the target validates, add the authorized lineage footers and validate every changed source. Do not add a target-to-source lineage footer merely for symmetry. If a lineage edit cannot be made valid, restore every changed source and the target to their pre-promotion state, retain the workshop, and report the blocker.
+ Write only accepted candidate bytes, then run `commonplace-validate <target>`. On failure restore
+ `original.md`, or `relocated-original.md` after relocation, byte for byte; remove a new target.
+ Verify recovery, retain the workshop, and report failures. Never patch live bytes after acceptance;
+ repair and fresh review are allowed only while the post-review reconciliation allowance is unused.
- After successful validation, remove the exact completed workshop directory and its `kb/work/README.md` entry unless the user asked to inspect or retain the run as an experiment or audit record, or any recorded user decision remains unexecuted — such as a confirmed fold into another artifact or an authorized additional artifact awaiting its own run. If retained, mark its state in `README.md` and keep its index entry. Treat such pending work as a handoff: report each fold or additional artifact and let the user decide what to do next; do not start another run automatically. When the user directs that a handoff has been declined or completed, mark it resolved and remove this workshop once no retention reason remains. Report what was removed or retained. Suggest `cp-skill-connect` for broader graph discovery.
+ After target validation, add only authorized source-to-target lineage. Prevalidate and preserve each
+ source, add its collection-authorized footer without a reverse edge merely for symmetry, and validate
+ each changed source. On failure restore all sources and target to their pre-promotion substantive
+ bytes and verify them. A prior address relocation remains separate; do not claim this reverses it.
- ## Verify
+ Before cleanup assemble the final account: commission and decisions; replacement/fold/merge/
+ retirement/retitle choices; grounding results including `quotes added` text; final candidate and
+ review paths/digests; validation, promotion, relocation, lineage, and recovery; removed or retained
+ paths; and handoffs. Extra artifacts or sibling changes converge only by explicit decline, user
+ acceptance, or separate completion; never launch them automatically. A composition mismatch blocks
+ promotion. `cp-skill-connect` is only an optional suggestion.
- - The target remained untouched until a reconciled candidate was ready.
- - Source reconstruction occurred in a fresh context that never saw the incumbent or draft.
- - In edit mode, source-first disposition was saved before the incumbent was revealed, and every material incumbent commitment was then reconciled without treating it as evidence.
- - Claim disposition preceded the skeleton; existing claims were cited or proposed for confirmed folding, and additional new artifacts were separated into their own user-authorized runs.
- - A direction added to the brief after a user decision caused reconstruction and every dependent stage to be rebuilt.
- - A claim-bearing target exposes one importable central proposition unless the disposition establishes that an irreducible synthesis is itself the contribution.
- - The skeleton preceded prose and every material draft addition was audited.
- - Missing knowledge remained visible instead of becoming plausible filler.
- - Content review preceded compression and sentence polish.
- - Workflow state lives only in the workshop, not in library frontmatter.
- - The promoted artifact passes deterministic validation.
+ Remove only the exact workshop and index line after target and lineage validation, a complete closing
+ account, no unexecuted authorized decision, and no retention reason. Retain blocked, failed,
+ inspection, and experiment runs; report cleanup and pending index work.