transition-decision
Apply a human ratify, reject, or defer verdict to a recovered decision candidate; ratification creates a Proposed ADR or observation.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- transition-decision
- metadata
- { "tags": "arch, decision-recovery, adr, observations, ratification", "bundles": "crux-docs", "triggers": "ratify decision <id> | reject decision <id> | defer decision <id> | ratify decision <id> as observation", "risk_level": "low", "requires_access": "write-tree" }
- description
- Apply a human ratify, reject, or defer verdict to a recovered decision candidate; ratification creates a Proposed ADR or observation.
- disable-model-invocation
- true
03 SKILL.md 正文
transition-decision
The human gate for decision recovery. recover-decisions proposes observed candidates; this skill dispositions them. It is the sole writer of the adr op on the recovery path — and, on the observation terminal, the sole writer of the observation op on that same path.
Ratify has two terminals under one gate (amends the earlier rule that ratify always creates an ADR, per docs/AGENTS.md §17.2): the ADR path (default, unchanged from before) and the observation path (--as observation). Both are human-invoked; neither is reachable from recover-decisions itself.
The pipeline
0. Resolve per-repo configuration
Run python3 "${CRUX_PLUGIN_ROOT}/scripts/bionic-config.py" (compat: crux-config.py) from the repo root; use the resolved docs_dir wherever this skill says docs/, and accept prefixed ids. On exit 1, STOP and surface the error.
This step runs BEFORE every operation below, including the state.yml read that starts all three, because <docs_dir> is the root of every path this skill touches: the candidate state file, the ADR concern, the observations concern, manifest.yml, and two indexes. Without it the loader's textual docs_dir refusal and its symlink-containment check never run, and artifact_prefix stays unresolved even though step 3 of the observation terminal performs a dual-form prefix scan per docs/AGENTS.md §14.3. The observation terminal is the reason this is load-bearing here rather than inherited: the ADR terminal delegates its scaffolding to propose-adr, which resolves the config itself, while the observation terminal inlines the scaffolding and so must resolve it here.
Operations
ratify <id> [--as adr|observation]— the candidate is real and worth recording. Default--as adr.--as adr(default) — the candidate is a real, worth-recording decision.- Read the candidate from
<docs_dir>/arch/_recovered/state.yml. - Idempotency first: call
find_ratified_adr(adrs_dir, id). If a Proposed ADR already carriesrecovered_id: <id>, do not create another — just complete the state write (recovery from a crash between the two writes). - Otherwise invoke
propose-adrwritingprovenance: recoveredandrecovered_id: <id>into the new ADR's frontmatter; the candidate's source reference is reference material for the human-authored body. - Set the candidate row
state: ratified, adr_id: ADR-NNNNand save. Record theadrop through the log writer: runoperation-log.py appendwith--op adrand a subject naming the ADR id and the candidate id (docs/AGENTS.md§6),[^log-writer] then run the commit step of §6 over the result'scommit_pathsandrestore_paths.
- Read the candidate from
--as observation— the candidate is a fact worth recording, but nobody decided it: it belongs in theobservationsconcern, not the ADR concern (seedocs/AGENTS.md§17). This is the mined ramp;propose-observationis the sibling reconstructed ramp for a human-read fact, and both write the same record shape.- Read the candidate from
<docs_dir>/arch/_recovered/state.yml. - Idempotency first: call
find_ratified_observation(observations_dir, id)— it correlates onanchor_id. For a plain candidate the id already IScandidate_id(anchor_kind, canonical_anchor), the same value the record'sanchor_idcarries, so the check is exact. If a record already carries thatanchor_id, do not create a second — just complete the candidate state write (crash recovery between the two writes). For a successor candidate, pass the third argument. A successor's key is<anchor_id>+<n>, so the anchor is recoverable from it, but two records sit on that anchor while the predecessor is still live. Pass thepredecessor_idthe candidate row carries —find_ratified_observation(observations_dir, id, predecessor_id)— and the check is exact there too. Called without it, a successor correlates onto its PREDECESSOR's record and the successor is never created. - Otherwise allocate the next
OBS-NNNNfromobservation.next_numberin<docs_dir>/manifest.yml(monotonic, never reused, dual-form prefix scan perdocs/AGENTS.md§14.3), and scaffold the record from${CRUX_PLUGIN_ROOT}/templates/OBS-template.md, writingstatus: observedandprovenance: recovered(the mined ramp's value — contrastpropose-observation, the reconstructed ramp, which writesprovenance: reconstructed). Carry the candidate'sanchor_id, itsrule, and itsevidenceonto the record verbatim — theruleinto the record'sgovernsentry, theevidenceinto the record'sevidence. Verbatim matters:recover-decisionsdecides whether a re-mine has found something new by comparingclaim_digest(rule, evidence)against the recorded claim, so a record that paraphrases or reformats the candidate it came from is not round-trip stable — the very next re-mine of unchanged code would read the difference as a changed claim and open a successor candidate against the record just created. The canonical frontmatter contract — field set, types, required/optional — isdocs/AGENTS.md§17.1; this skill does not restate it, and neither does the template it fills in from.evidenceispath:line-rangeonly, repo-relative, never a code excerpt, in the frontmatter and in the body. - Add the concern index row under
<docs_dir>/observations/, and bump thedocs/index.md## Observations (N)rollup. - Set the candidate row
state: ratified, observation_id: OBS-NNNNand save (the observation-path analog ofadr_id: ADR-NNNN). Record theobservationop through the log writer: runoperation-log.py appendwith--op observationand a subject naming the record id and the candidate id (docs/AGENTS.md§6), then run the commit step of §6 over the result'scommit_pathsandrestore_paths— NOT theadrop; the record is not an ADR. A refused append keeps this skill's other writes and adds no entry: fix the cause it names, then rerun the append alone (§6).
- Read the candidate from
reject <id>— not worth an ADR or an observation. Setstate: rejected. The id stays suppressed on future scans until its anchor leaves the code (thenrecover-decisionsprunes it).defer <id> [--until YYYY-MM-DD]— revisit later. Setstate: deferred, defer_until: <date>. Re-surfaces only afterdefer_until.
The writer boundary and the successor path (docs/AGENTS.md §17.2)
This terminal is human-invoked, exactly as the ADR terminal is. On --as observation it writes status: observed and nothing else — no machine path sets any state past observed. transition-observation is the only single-record route past observed, to ratified, rejected, retired, or decided, and the batch sign-off (survey-signoff) is the only batch route. Both are human-invoked. recover-decisions itself creates neither an ADR nor an observation on any path; it writes only its own candidate state file, including the stale-anchor SIGNAL (StateFile.signal_stale_anchors) and any successor candidate.
A ratified record's claim is immutable. A re-mine that finds a recorded anchor_id carrying changed rule text or changed evidence does not touch the record — it opens a successor candidate, in observed, on that same anchor_id (emit_candidate / successor_id). At most one successor is open per anchor: a later re-mine that finds the claim changed again refreshes that row rather than opening a second, so the pending set stays bounded by the anchors themselves. Ratifying the successor and retiring its predecessor is a transition-observation act, never an edit here.
Rules
ratifyis the only ADR- or observation-creating path in recovery. Therecover-decisionsextraction code cannot create either.- Idempotent ratify, both terminals. Never create a second ADR for a candidate that already has one (
recovered_idis the correlation key); never create a second observation record for a candidate whoseanchor_idis already recorded (find_ratified_observationis the correlation check). The check covers both candidate forms — a successor needs itspredecessor_idpassed, per step 2. --as observationwritesstatus: observedandprovenance: recovered— neverratifiedand neverprovenance: reconstructed(that value belongs topropose-observation).- Never hand-edit
state.ymloutside this skill; it is written single-writer via atomic replace, fail-closed on a parse error.
Red flags — STOP and reconsider
- About to write
status: ratifiedon the observation record because the user said "ratify". This skill's observation terminal writesobserved; ratification of the record itself is a separate act throughtransition-observation. - About to write
provenance: reconstructedon this path.--as observationis the mined ramp; its value is alwaysrecovered. - About to skip
find_ratified_observationand scaffold a duplicate record for ananchor_idalready on disk. - About to call
find_ratified_observationon a successor candidate WITHOUT itspredecessor_id. That call answers a different question — "does the predecessor have a record?" — and its answer is always yes. - About to start any operation without step 0. Every path below is rooted at
<docs_dir>; resolving it after the first read is resolving it too late. - About to restate the §17.1 field list here "for convenience". Point at
docs/AGENTS.md§17.1 and the template; do not copy the keyset.
See also
recover-decisions— emits the candidates this skill dispositions, and the source offind_ratified_observation,emit_candidate,successor_id, andStateFile.signal_stale_anchors.propose-adr— invoked byratify --as adrto create the Proposed ADR.propose-observation— the sibling reconstructed on-ramp for the observations concern; writes the same record shape from a human-read fact rather than a mined candidate.transition-observation— the human gate that moves an observation record pastobserved; this skill never reaches past it.docs/AGENTS.md§17 — the observations-concern contract (§17.1 frontmatter schema, §17.2 lifecycle, writer boundary, and immutable claim).- The decision-recovery decision this implements, and its later amendment adding the observation terminal (see the ADR log).
[^log-writer]: rule:log-entries-go-through-the-log-writer, rule:no-writer-writes-the-legacy-log-file
04 同仓库更多 Skills
whiteboarding
Explore an idea through docs-informed dialogue before committing to a design. Capture the exploration for later filing as a brief.
verify-code-docs
Check generated code documentation against source and report drift without regenerating it.
transition-observation
Apply a human disposition to an observation's lifecycle state without changing its claim or body.
transition-invariant
Ratify, reject, or retire an invariant on human direction. Update lifecycle metadata without changing the invariant's body.
transition-brief
Publish or abandon a draft brief, updating lifecycle metadata and indexes without changing its body.
transition-adr
Accept, deprecate, supersede, or retract an existing ADR, or promote in-run guidance on the owner's instruction ("promote ADR-NNNN: rules N"). Update status and relationships without changing its narrative body.