transition-observation
Apply a human disposition to an observation's lifecycle state without changing its claim or body.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- transition-observation
- metadata
- { "tags": "observations, state-machine, ratification, human-gate", "bundles": "crux-docs", "triggers": "ratify observation OBS-NNNN | reject observation OBS-NNNN | retire observation OBS-NNNN | mark observation OBS-NNNN decided | transition observation", "risk_level": "low", "requires_access": "write-tree" }
- description
- Apply a human disposition to an observation's lifecycle state without changing its claim or body.
- disable-model-invocation
- true
03 SKILL.md 正文
Transition Observation
<!-- BEGIN GENERATED: runtime-compat -->
Runtime compatibility
This skill is portable across Claude Code, Codex, OpenCode, and OMP (Oh My Pi). This section overrides platform-specific labels below.
- Before running a command that uses
CRUX_PLUGIN_ROOT, set it to the installed plugin root. In Claude Code, use the value ofCLAUDE_PLUGIN_ROOT. In Codex, OpenCode, and OMP, derive it from the absolute path of this selectedSKILL.md: the plugin root is the parent of itsskills/directory (in OMPbash,skill://<name>resolves to the skill directory). In a source checkout, use the checkoutcrux/directory. - For project-local skills, use
.claude/skillsin Claude Code,.agents/skillsin Codex,.opencode/skillsin OpenCode (which also reads the singular.opencode/skill), and.omp/skillsin OMP. SetCRUX_LOCAL_SKILLS_DIRto that path before following any command below that uses it. - Translate Claude Code tool labels such as
Agent,Read,Write,Bash,WebSearch, andWebFetchto the matching capability in the current session. Codex names its own capabilities; OpenCode uses the lowercase formssubagent,read,edit,shell,websearch, andwebfetch, whereeditcovers bothEditandWrite; OMP usestask,read,edit,write,bash,grep,glob,find,todo, andweb_search(wherereadalso handles URLs andskill://URIs). Do not attempt to invoke the Claude Code labels as literal commands on another host. - Install the generated role agents before delegating:
install-codex-agentsin Codex,install-opencode-agentsin OpenCode,install-omp-agentsin OMP. Codex names themcrux_architect,crux_brainstormer,crux_commander,crux_dev_lead,crux_developer,crux_historian,crux_librarian,crux_night_gardener,crux_reviewer, andcrux_wayfinder; OpenCode and OMP use the bare role namesarchitect,brainstormer,commander,dev-lead,developer,historian,librarian,night-gardener,reviewer, andwayfinder(in OMP,scoutmay also be used for reconnaissance alongsidewayfinder). If a required role or capability is unavailable, report that truthfully instead of claiming it ran. - Argument placeholders such as
$adrand$bookbind only in Claude Code. On a host without argument binding they are unset — take the value from the user's phrase. The "Fields OpenCode ignores" section ofOPENCODE_GUIDE.mdnames the invocation-control fields OpenCode ignores. <!-- END GENERATED: runtime-compat -->
Overview
The lifecycle state machine for observation records — the human gate of the machine-proposes/human-disposes model (see docs/AGENTS.md §17.2). propose-observation and transition-decision ratify --as observation write records as status: observed; nothing but a human disposes of them, through one of exactly two routes: this skill, the only single-record route, and survey-signoff, the only batch route (docs/AGENTS.md §17.5). It is the observations-concern sibling of transition-invariant: it operates ONLY on the lifecycle frontmatter of an existing record, and it never touches the record's claim or its body.
Core principle: the state machine is the contract, and nothing but a human sets a state past observed. Every transition that is not explicitly allowed is refused with a clear error.
observed ──ratify──▶ ratified ──retire──▶ retired
│ │
│ └──decide──▶ decided
└──reject──▶ rejected
Allowed transitions, exhaustively (the §17.2 table):
| From | Op | To | Notes |
|---|---|---|---|
| observed | ratify | ratified | A human affirms the record describes the code. |
| observed | reject | rejected | A human judges the record wrong or not worth keeping. |
| ratified | retire | retired | The code moved away from what the record describes. |
| ratified | decide | decided | A human authored an ADR for the same rule; decided_by names it. |
Everything else is REFUSED with an error naming the current status and the requested op. The lifecycle is forward-only: there is no path back into observed (that is the on-ramps' entry state only), and no rejected/retired/decided → anything. A revived observation is a new record.
The immutable claim. A ratified record's claim never changes; docs/AGENTS.md §17.2 names exactly which fields the claim spans, and this skill reads that list there rather than carrying a second copy. When a re-mine finds the same anchor_id carrying different text or different evidence, it opens a successor candidate; the human ratifies the successor and retires its predecessor here, or rejects it. Revision is not a state this gate admits.
When to use
- User says: "ratify observation OBS-NNNN", "reject observation OBS-NNNN", "retire observation OBS-NNNN", "mark observation OBS-NNNN decided", "transition observation OBS-NNNN", "this observation is now an ADR".
- Immediately after a human review of
observedrecords produced bypropose-observationor bytransition-decision ratify --as observation. - After a re-mine reports a stale anchor: the code moved, and the human retires the record here. Anchor loss is a signal, never a transition.
- After
propose-adrrecords the same rule as a decision:decidelinks the record to the ADR as its provenance trail.
Do not use this skill for:
- Creating a record — that is
propose-observation(reconstructed ramp) ortransition-decision ratify --as observation(mined ramp). - Editing a record's claim (the fields
docs/AGENTS.md§17.2 names), itsid, itstitle, or its body — refuse. A changed claim is a successor record, never an edit. - Auto-ratifying on the machine's behalf.
ratifiedis reachable ONLY by explicit, per-record human instruction; a batch or automatic "ratify all observed" is refused. A human who wants to dispose of many records in one reading usessurvey-signoff, the batch sign-off over a sheet they filled in (docs/AGENTS.md§17.5) — a separate human gate, never this skill in a loop. - Transitioning an ADR (
transition-adr), a brief (transition-brief), an invariant pin (transition-invariant), or a decision candidate (transition-decision).
Inputs
Subcommand form: transition-observation <op> <id> where <op> ∈ ratify | reject | retire | decide and <id> is the record id (e.g. OBS-0007), with or without an artifact prefix (§14.3).
--decided-by ADR-NNNN— required fordecide, refused for every other op. The id of the ADR that records this rule as a decision, with or without an artifact prefix.
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.
1. Resolve the record
- Locate the file under
<docs_dir>/observations/whose frontmatteridequals<id>(glob the concern dir; match onid, not filename guesswork; accept the dual-form spelling([A-Z][A-Z0-9]{1,9}-)?OBS-(\d{4})). Zero or multiple matches → STOP with a BROKEN error. - Read the file. Parse frontmatter. Read the current
status. - The frontmatter contract is
docs/AGENTS.md§17.1; this skill reads the fields it mutates by name from there and restates none of it.
2. Validate the transition
Look up (current_status, op) in the allowed table. If absent → REFUSE with a message naming the current status and the requested op. Specific refusals:
(observed, retire)→ "Only aratifiedobservation can be retired; anobservedrecord is rejected, not retired."(observed, decide)→ "Only aratifiedobservation can be decided; ratify it first, or reject it."(ratified, ratify)/ already in destination → "OBS-NNNN is already${current}; no-op refused."- any
rejected/retired/decidedsource → "The observation lifecycle is forward-only out ofobserved/ratified; a revived observation is a new record (propose-observationortransition-decision ratify --as observation)." - a batch or wildcard id, or an instruction to ratify more than one record → REFUSE. Ratification is a per-record human act. Name the alternative in the refusal: a batch is reviewed on a sheet and signed by
survey-signoff, never approximated by repeating this gate.
Op-specific preconditions:
ratify: everyevidenceentry must resolve on disk. A ratified record that cites an unresolvable path is BROKEN underdocs/AGENTS.md§17.3 CHK-OBS-EVIDENCE, so refuse rather than ratify into a defect; name the path.decide:--decided-byis required. Resolve it under<docs_dir>/adrs/and<docs_dir>/adrs/archive/by frontmatterid(dual-form spelling accepted). If no file resolves → REFUSE: "deciderequires an ADR that exists on disk;${decided_by}does not resolve." This gate never creates the ADR — that ispropose-adr.
3. Mutate ONLY the lifecycle frontmatter
${TODAY} = today's date.
- Set
status: <new_state>. - Set
date: ${TODAY}. - Set the one
*_datefield that matches the new state to${TODAY}(§17.1 names it). Every other date field keeps its value. - On
decideonly: setdecided_by: ${decided_by}. - Those are the ONLY keys this skill writes. Every other frontmatter key, whatever §17.1 lists, keeps its bytes, and so does every body byte between the closing
---and EOF. State the rule this way round — an allow-list of four keys, not a deny-list of the rest — so a field added to §17.1 is immutable here by default rather than by a list somebody remembered to extend. - Preserve frontmatter key order + formatting outside the mutated keys.
4. Successor consistency (audited write)
- On
retire, check whether a record inobservedorratifiedcarries the sameanchor_id. If one does, name it in the hand-off: the retirement makes it the sole live record on that anchor. - On
ratify, if anotherratifiedrecord carries the sameanchor_id, STOP and surface it: two live claims on one anchor is the drift the immutable-claim rule exists to prevent. The human retires the predecessor first, then ratifies the successor. - The rule these two steps enforce is CHK-OBS-ANCHOR, stated in
docs/AGENTS.md§17.2/§17.3 and checked bycheck_observations.py:anchor_idmatches^[0-9a-f]{16}$, and no twoobserved/ratifiedrecords share one. This skill applies it at write time; it does not own it, and it carries no second copy of it. The audit finds after the fact what this gate refuses beforehand — the same relationshiptransition-invarianthas with its reconciliation check. If the write would leave two live claims on one anchor, STOP.
5. Update indexes
<docs_dir>/observations/index.md: update the record's row (new status;decided_bywhere the index carries it). The index visibly marks non-ratifiedrecords (observed/rejected/retired/decided are not hidden — survey debt must be legible).docs/index.md: the## Observations (N)count is unchanged on a transition (the record still exists); update_Last updated:.
6. Record the observation operation
Write the entry through the log writer (docs/AGENTS.md §6).[^log-writer] Write the body (record id, the transition, one line; on decide, the decided_by id) to a file outside the tree, then run:
uv run "${CRUX_PLUGIN_ROOT}/scripts/operation-log.py" append --repo-root <repo-root> \
--op observation --subject 'OBS-NNNN: <old> → <new>' --date YYYY-MM-DD --body-file <path>
The entry it writes at the top of the current month's detail file docs/log/YYYY-MM.md:
## [YYYY-MM-DD] observation | OBS-NNNN: <old> → <new>
The observation op is a member of the docs/AGENTS.md §6 op enum (both the current-writer and historical-reader regexes) — emit it directly. A refused append keeps this skill's other writes and adds no entry: fix the cause it names, then rerun the append alone (§6). Then run the commit step of §6 over the result's commit_paths and restore_paths.
7. Hand off
Confirm the new status + file path. Remind: no scan, scaffold, or re-mine reaches ratified. Two human routes reach it and no third does — this skill is the only single-record route, and survey-signoff is the only batch route (docs/AGENTS.md §17.5). For ratify, note the record's claim is now immutable.
Then tell the user to regenerate both projections, in this order:
uv run "${CRUX_PLUGIN_ROOT}/scripts/summarize-adrs.py"
uv run "${CRUX_PLUGIN_ROOT}/scripts/compile-doctrine.py"
Both projections read the ratified observation records (field contract: docs/AGENTS.md §17.1) and hash them, so ratify, retire, and decide each drift <docs_dir>/adrs/summaries/ and <docs_dir>/adrs/doctrine/. The order is fixed because doctrine is compiled from the summaries projection. Skipping a step leaves drift that the matching --dry-run gate reports and that CI fails on — both jobs watch the observations concern.
For retire or decide, note the record's disposition; on decide, the summaries projection resolves the record's handle onto the deciding ADR's handles. For retire, name any successor candidate awaiting ratification.
Verification checklist
- [ ] Exactly one record resolved by
id. - [ ] The transition was one of the four allowed; any other refused with a message naming the current status and the op.
- [ ]
statusequals the new state;dateand the one matching*_dateequal today; ondecide,decided_bynames an ADR that resolves on disk. - [ ] No other frontmatter key and no body byte changed — diff the file and confirm the only differing lines are
status,date, the one matching*_date, and (ondecide)decided_by. - [ ] No two live (
observed/ratified) records share ananchor_idafter the write, or the write was refused. - [ ]
<docs_dir>/observations/index.mdrow updated; the record remains visibly marked if non-ratified. - [ ]
docs/index.md## Observations (N)count unchanged;_Last updated:bumped. - [ ] The current month's detail file
docs/log/YYYY-MM.mdhas the transition entry at the top under theobservationop, written byoperation-log.py append. - [ ] No record was ratified without an explicit per-record human instruction (no auto/batch ratify).
- [ ] Any batch request was redirected to
survey-signoffrather than served here one record at a time.
Red flags — STOP and reconsider
- About to ratify without explicit human instruction (e.g. "ratify all observed", or ratifying inside a scan, a scaffold, or a cycle run). The whole safety property is that ratification is a human, per-record act. Refuse batch/auto ratify. Redirect a batch request to
survey-signoff; a loop over this gate is not a batch sign-off and leaves no receipt. - About to edit a record's
governs,evidence,anchor_id,provenance, or body "while I'm in here". This skill flips ONLY the lifecycle fields. A changed claim is a successor record. - About to move a record back to
observed, or out ofrejected/retired/decided. Forward-only; a revived observation is a new record. - About to
decideagainst an ADR id that does not resolve on disk, or to create the ADR yourself. Refuse;propose-adrcreates ADRs, anddecideruns after it. - About to
retirea record because a re-mine reported a stale anchor, without a human saying so. The signal is the machine's; the transition is the human's. - About to ratify a record whose
evidencepath no longer resolves. That ratifies into a BROKEN finding; refuse and name the path. - About to leave two
ratifiedrecords on oneanchor_id. Retire the predecessor first.
Rationalization table
| Excuse | Reality |
|---|---|
| "The record is obviously right — I'll ratify it as part of the scaffold / the re-mine / the cycle." | Nothing but a human sets a state past observed. ratified is reachable only by an explicit per-record transition. That is the safety property. |
| "I'll retire this observed record nobody wants." | observed records are rejected, not retired. Retirement is for a previously-ratified record whose code moved. |
| "The re-mine says the anchor is stale, so I'll retire it automatically." | Anchor loss is a signal, never a transition. The human retires through this gate. |
| "While flipping status I'll fix the rule text — it's slightly off." | The claim is immutable. A changed claim is a successor record: ratify the successor, retire the predecessor. |
"The user wrote the ADR in their head — I'll decide now and they'll file it later." |
decide requires an ADR that resolves on disk. propose-adr first; decide after. |
| "Twelve records look fine — I'll ratify them in one pass to save the user time." | One record, one instruction, one transition. A batch ratify is refused. The batch route exists and is survey-signoff: a human fills in a review sheet and signs it under one receipt. |
See also
propose-observation— the reconstructed on-ramp that writesobservedrecords this skill disposes of.transition-decision— the mined on-ramp (ratify --as observation) and the gate for decision candidates.recover-decisions— the miner whose re-mine proposes successor candidates and stale-anchor signals, and never touches a record.survey-signoff— the only batch route pastobserved: one human sign-off over one human-filled review sheet, under one digest-bound receipt.survey-sheet— the scaffold that writes the review sheetsurvey-signoffsigns.transition-invariant— the invariants state machine this mirrors (frontmatter-only mutation, clear refusals, audited write).propose-adr— creates the ADR adecidetransition names.audit-docs— the CHK-OBS rules (docs/AGENTS.md§17.3) that read the status this skill sets.docs/AGENTS.md§17 — the observations-concern contract (§17.1 frontmatter schema, §17.2 lifecycle, writer boundary, and immutable claim, §17.3 audit rules).- The observation-record decision this implements (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-invariant
Ratify, reject, or retire an invariant on human direction. Update lifecycle metadata without changing the invariant's body.
transition-decision
Apply a human ratify, reject, or defer verdict to a recovered decision candidate; ratification creates a Proposed ADR or observation.
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.