Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Docs?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/kurone-kito-docs)
---
type: reference
title: Issue Authoring Skill Contract and Schema
description: Defines the stable contract and output schema for the agent-facing issue authoring skill that prepares IDD-ready issues.
tags: [issue-authoring, skill-contract]
---
# Issue Authoring Skill Contract and Schema
This document defines the stable contract and output schema for an
agent-facing issue authoring skill that prepares IDD-ready issues before
the normal Discover → Claim → Work loop begins.
The contract explains when the skill should run and how it should
behave. The schema explains what a ready orphan issue, roadmap issue,
or sub-issue must contain so the later IDD discover phase can consume
the result safely.
The canonical bundle in this repository lives at
`skills/issue-authoring/`. When adopters install it in another
repository, they should copy it into the agent-specific skill directory
their runtime reads, such as `.github/skills/`, `.claude/skills/`, or
`.agents/skills/`.
## Purpose
Use the issue authoring skill to turn a user request into a safe,
reviewable issue set when direct implementation would otherwise skip the
issue hygiene that IDD depends on.
The skill exists to improve issue quality before execution, especially
when work will span multiple tasks, dependencies, or agent sessions.
It is a source bundle, not the execution loop itself: the bundle lives
in `skills/issue-authoring/` here, while installed copies belong in the
skill directory for the runtime that will load them.
## Questions for operators
When an issue-authoring interview already needs a decision, assume the
operator is skilled in manual issue-driven development and GitHub Flow,
but unfamiliar with idd-skill-specific automation. Treat issue triage and
planning, branches, commits, pull requests, CI, reviews, and merges as
known. Explain the relevant idd-skill convention (for example, that
`## Candidate files` lists expected edit paths, and an unlisted path may
trigger the effort limit), say how the answer
changes the task, and request the exact action. When alternatives matter,
list each meaningful option with its main cost and recommend one. A current
explicit operator
instruction may specialize this presentation; otherwise use explicit
repository-local audience guidance, then this baseline. Repeated use alone
does not establish expertise or a standing preference (observed 2026-10-26
in issue `#4743`). Keep each question
self-contained and concise, without repeating context already present in
the same ask. This changes question wording only, not when
the workflow asks, who may approve, required evidence, or policy fields.
## Trigger policy
Invoke the skill when one or more of the following are true:
- the request is too large or ambiguous for a single direct
implementation pass
- the likely solution needs decomposition into multiple atomic tasks
- dependencies or execution order need to be made explicit before work
can start safely
- the user wants a roadmap, issue breakdown, or parallelizable work plan
- the repository would benefit from IDD-ready issue hygiene before any
implementation begins
Skip the skill and continue directly with implementation when all of the
following are true:
- the task is small enough to complete in one reviewable change
- verification is already clear
- no roadmap, dependency marker, or issue split is needed
- the user did not ask for issue drafting or planning first
## Stable phases
The skill uses two stable phases. These phase names are normative and
should be reused by later implementation work.
### 1. Intake and Clarification
In this phase, the agent:
- inspects the relevant code, docs, and existing issues
- identifies missing context, assumptions, and ambiguity that could
affect issue quality
- runs a secondary critique pass on the emerging interpretation
- asks the user only the questions that block safe issue drafting; for
the two interactive cases in Human-dependency isolation, the question
blocks publishing, so it is asked, unless the auto-decide branch there
applies and takes the recommended option instead
The secondary critique pass must be agent-neutral:
- if the agent runtime offers a subagent, rubber-duck helper, or
equivalent review primitive, it may use that
- otherwise, the agent performs an explicit self-critique pass locally
When that primitive is a subagent, prefer a non-context-inheriting
mechanism whenever the calling tool offers one. The same preference
covers any other subagent dispatch this skill makes for verification
or research that must not mutate GitHub state. A context-inheriting
mechanism is a fallback only, used when no non-context-inheriting
option exists. Claude Code's `fork` subagent type is the concrete
example this preference routes around: it inherits the calling
session's conversation, so a prose-only restriction in the dispatch
prompt is not a reliable boundary against the delegate completing the
calling session's broader task. Three in-session incidents motivate
the preference. On 2026-09-17 a worker's research-only verification
subagent published a roadmap plus 4 child issues and posted journal
markers. The same day, a top-level orchestrator's read-only
verification subagent ran a gist-triage pass, publishing a roadmap
plus 4 child issues and rewriting a personal gist. On 2026-09-24/25 a
read-only verification subagent, sent to fact-check two drafted issue
bodies, executed the full Stage 1 publish protocol instead. Each
dispatch prompt said not to mutate anything, and each delegate was a
context-inheriting subagent type. issue #3448 records those
incidents.
Clarification must converge. The skill should:
- use a bounded number of clarification rounds, with a default maximum
of 3 or the repository-local `issueAuthoring.maxClarificationRounds`
value when the target repository records one
- avoid asking questions that are merely nice to know
- prefer explicit assumptions when issue drafting is still safe without
immediate user input; the assumption path stays only for a gap that is
not one of the two interactive cases in Human-dependency isolation (the
auto-decide branch or the interactive rule there settles those) and still
leaves a stable ready draft
If bounded clarification is exhausted and safe drafting is still not
possible, the skill should stop and report the unresolved blockers
instead of looping indefinitely.
**Under-clarification stop rule.** If, after bounded clarification, the
skill still cannot name the concrete surface to edit or an objective
verification for a candidate task, it should apply the auto-decide branch in
Human-dependency isolation when it applies. When the branch does not apply or
can take no option, for an interactive choice it should ask first under the
interactive rule there; otherwise it should route that candidate to
`needs-decision`, instead of publishing a confidently-vague `ready` issue.
Reliability over speed. This is distinct from the "Under-specified"
specificity band below: that band judges an already-drafted body's wording,
while this rule stops publication earlier, during Intake, before a body is
even drafted.
### 2. Decompose and Draft
In this phase, the agent:
- restates the clarified request in implementation-facing terms
- breaks the work into atomic tasks
- evaluates whether each task is suitable for autonomous execution
- isolates low-autonomy work so it can be handled earlier, deferred, or
surfaced for human decision
- checks whether an existing issue can be reused or extended before
creating a new one
This phase may draft a roadmap issue, sub-issues, or orphan issues as
appropriate. The remaining sections of this document define the
normative rules for those outputs.
Before the completed-draft adversarial review and mechanical audit,
verify material factual claims that justify each draft's scope or design
against current sources:
repository behavior against current code and documentation, issue or
pull-request status and prior decisions against live GitHub records, and
runtime observations under the existing
[Live-observed claim citation](#live-observed-claim-citation) rule.
Correct, qualify, or remove any such unsupported claim, and put supporting file
references, GitHub permalinks, or read-only command evidence in the
review packet's existing `evidence` array. Route a materially unresolved
claim under the existing rules in
[Human-dependency isolation](#human-dependency-isolation) and
[A4.5 Suitability Gate Alignment](#alignment-with-a45-suitability-gate):
use `needs-decision` for unresolved product, policy, or design choices,
and `blocked-by-human` when verification waits on a person, credential,
asset, or outside system. This check adds no packet fields. It responds
to the factual-history error reported in [issue #4566](https://github.com/kurone-kito/idd-skill/issues/4566),
which concerns [issue #3838](https://github.com/kurone-kito/idd-skill/issues/3838)
and [issue #1019](https://github.com/kurone-kito/idd-skill/issues/1019).
The checklist placement is tracked in
[issue #4643](https://github.com/kurone-kito/idd-skill/issues/4643).
**Scope stop rule.** Before drafting, if a request needs a change at three
or more independent call sites, or in two or more modules with separate
owners, stop drafting. Report sized options to the operator: a single fix, a
split into children, or a decision issue. Choose a roadmap only after the
operator answers. This rule runs before drafting. The over-scope split
threshold under Effort hint runs after drafting, and it is unchanged.
## Output readiness model
The skill must score each candidate task on the following axes before it
decides whether to draft an issue, split the work, or route it into a
non-ready bucket.
### Required execution axes
- **Limited scope**: the task fits a small, reviewable change. If the
work is too broad for one issue, split it or create a roadmap.
- **Clear verification**: success can be checked through lint, tests,
CI, or other explicit verification steps. If verification depends on
unresolved product judgment, the work is not execution-ready.
- **Autonomous completion**: the work can finish without waiting for
credentials, unavailable systems, or a human choice that has not yet
been made.
These three axes align directly with the IDD viability gate in
`idd-discover.instructions.md`. A task is not draft-ready for execution
until all three pass.
### Supporting drafting axes
- **Dependency clarity**: dependencies are explicit, resolvable, and
encoded in a form the discover phase can parse safely.
- **Confidence**: the agent has enough evidence to draft a stable issue
instead of guessing at hidden scope or silently dropping uncertain
work.
These supporting axes determine whether a ready task becomes an orphan
issue, a roadmap plus sub-issues, or a non-ready bucket.
### Autopilot-suitability score
The **Autonomous completion** axis is also persisted as a graded
**autopilot-suitability score** (1-5, higher = more
autopilot-suitable) so the discover phase can rank and route
candidates without re-deriving the judgment. **Score every drafted
issue and emit it** as an end-of-body footer (a visible line plus
a hidden, prefix-aware marker
`<!-- {marker-prefix}-autopilot-suitability: N -->`). Discover
**ranks and routes** candidates by the score (roadmap #759, fully
merged); it stays advisory and fail-safe on absence. See the
[Autopilot-suitability score](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#autopilot-suitability-score)
section of the contract for the rubric, footer format, and binding
rules.
- `5` autopilot-ideal · `4` strongly autopilot-suitable ·
`3` borderline · `2` mostly human · `1` human-only.
- Scores below the configured floor (`autopilotSuitability.floor`,
default `3`) designate human-oriented issues that discover routes
to humans in autopilot runs.
- The score is an **advisory** ranking/routing hint only; it never
bypasses the A4.5/A5 gates, and a score of `1` must agree with the
configured `blocked-by-human` label (default `status:blocked-by-human`).
A missing or out-of-range score is treated as having no score
(evaluated normally, never skipped).
### Effort hint
Issues may also carry an author-time **effort hint** (`S | M | L`) that
captures _size_, distinct from the suitability score's _autonomy_. Emit
it as an optional end-of-body footer beside the suitability footer (a
visible line plus a hidden, prefix-aware marker
`<!-- {marker-prefix}-effort: S|M|L -->`). Discover consumes it as a
**soft selection tie-breaker** so autopilot tends to clear small issues
first and leave large ones for a fresh session. See the
[Effort hint](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#effort-hint)
section of the contract for the rubric, footer format, and binding
rules.
- `S` small · `M` medium · `L` large — each band is now defined on two
axes: **scope** (how many files or subsystems the change touches) and
**uncertainty** (how many design decisions remain open once the plan
is drafted). Observed agent token usage or wall-clock duration is a
calibration sanity-check only, never the unit.
- An estimate that does not fit even `L`'s scope-and-uncertainty
definition is a mis-scope smell: return to Decompose and Draft and
split at intent level instead of publishing one oversized issue.
- An orphan or child draft with an `S` or `M` hint and more candidate
files than the contract's
[over-scope split threshold](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#effort-hint)
table allows is split into a held roadmap with children before
publication, unless it carries a plain-text `Split out of #<n>` line;
`audit-authored-issue`'s `effort-candidate-file-limit` check enforces
that table.
- In Discover, the hint only reorders candidates **within** one
suitability-score band (after the score and optional desync rules,
before the lowest-issue-number tie-break). It never crosses a score band
or bypasses the A4.5/A5 gates. It never skips or gates, and a large issue
stays claimable when it is the only ready work. The one exception, which
overrides the claims above, is an `L` orphan candidate in an autopilot run
under `autopilotSuitability.effortL: refuse`: autopilot Discover routes it
to humans, whatever its score.
- Under `autopilotSuitability.effortL: refuse`, `effort-l-ready` refuses a
`ready` orphan or child body with a coherent `L` effort marker at
publication. Roadmaps, audits run with `--expect-bucket`, and bodies routed
to a human bucket (a coherent `needs-decision` or `blocked-by-human`
authoring-bucket marker, or a suitability score of `1`) are exempt. See the
[2026-10-13 review-loop audit](https://github.com/kurone-kito/idd-skill/blob/main/docs/idd-design-rationale.md#review-loop-audit-2026-10-13).
- A missing or invalid hint is **fail-safe**: it sorts as the neutral
middle, as-if `M`, per `idd-discover.instructions.md` A4 Step 2.
### Authoring-bucket marker
A newly published `needs-decision` or `blocked-by-human` issue carries a
hidden **authoring-bucket marker**
(`<!-- {marker-prefix}-authoring-bucket: needs-decision|blocked-by-human -->`)
so `audit-authored-issue.mts` can mechanically enforce the matching
label the same way it already enforces the configured `blocked-by-human`
label (default `status:blocked-by-human`) for a suitability score of `1`.
Publishing into either bucket runs the linter
with `--expect-bucket` (see
[Mechanical pre-publish gate](#mechanical-pre-publish-gate) below),
requiring the marker rather than treating its absence as fail-safe. See
the
[Authoring-bucket marker](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#authoring-bucket-marker)
section of the contract for the binding rules.
- Scoped to the two buckets that require a label (`needs-decision`,
`blocked-by-human`); `ready`, `deferred`, and `out-of-scope` carry no
marker.
- When present, it decides the suitability-1/`blocked-by-human` check's
applicability instead of the score; absent or malformed, that check
falls back to its pre-existing suitability-1-only rule (no backfill
onto issues published before this marker existed, or on an edit to
one).
### Upstream-candidate marker
A locally authored issue may carry a hidden **upstream-candidate
marker** (`<!-- {marker-prefix}-upstream-candidate: true -->`)
alongside the GitHub label `status:upstream-candidate`, recording that
its root cause was judged to be a defect in an `idd-template`-sourced
instruction, doc, or helper itself, not in the current repository.
Only produced when `upstreamEscalation.enabled` is `true` in
`.github/idd/config.json`. See
[Upstream-candidate escalation](https://github.com/kurone-kito/idd-skill/blob/main/idd-template/.github/instructions/idd-overview-appendix.instructions.md#upstream-candidate-escalation)
in the reference appendix for the qualifying criteria, and the
[Upstream-candidate marker](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#upstream-candidate-marker)
section of the contract for the binding rules.
- Never a cross-repository write: the marker and label exist entirely
within the current repository.
## Specificity target
Issue drafting should aim for a level of specificity where a
middle-tier cloud model can implement the task without drifting. This
is a practical drafting heuristic, not a hard model requirement. The
goal is to avoid both hidden assumptions that only a top-tier model can
infer and step-by-step runbooks that cost too much to author.
### Three specificity bands
| Band | Practical signal | Drafting response |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| **Under-specified** | Stable execution likely depends on a frontier cloud model class | Add missing constraints, split scope, or make acceptance criteria more explicit |
| **Target** | A middle-tier cloud model class can implement the issue without drifting | Treat this as the preferred drafting target when the execution axes already pass |
| **Over-specified** | Even a lightweight local or compact cloud model class could follow the issue mechanically because it has become a runbook | Remove procedural micromanagement while keeping invariants, file anchors, and checks |
The capability tiers above are practical heuristics, not a fixed
compatibility matrix or runtime requirement.
### How the specificity target interacts with readiness
This heuristic does not replace the IDD execution axes:
- **Limited scope** still decides whether the work fits one issue or
needs a roadmap.
- **Clear verification** still decides whether success is objectively
checkable.
- **Autonomous completion** still decides whether the task can finish
without outside coordination.
An issue can be specific yet still fail A4 or A4.5 because it is too
broad, not verifiable, or blocked on a human decision. Conversely, an
issue that passes those gates can still be under-specified if it leaves
too much implementation shape implicit. The drafting target is therefore
"ready and stable for a middle-tier model," not "maximally detailed."
## Executability gate for code spec-units
For a **code spec-unit** — a drafted unit whose acceptance criteria are
objectively executable (a script, function, or test the drafted issue
itself specifies) — an authoring session can validate the draft before
publishing by building a throwaway reference implementation against its
own stated acceptance check and accepting the draft only if that
reference implementation passes. This reuses the downstream execution
loop as an upstream ground-truth gate: it catches drafts whose
acceptance criteria are internally inconsistent, non-trivially
unsatisfiable, or otherwise not actually implementable, before a
downstream executor ever claims the issue. The reference implementation
is a discarded validation probe, never published — it does not cross the
publication boundary (this file's local "Approval boundary" section
below); only the drafted issue itself is published, and building the
probe does not start the IDD execution loop.
This is a **recommended practice for repositories or domains where a
drafted code spec-unit has an objectively executable acceptance
check**, not a change to this repository's own mechanical
`bin/idd-audit-authored-issue.mjs` checks or a new requirement on this
repository's own issue-authoring practice — most of this repository's
issues are multi-file engineering changes without a single executable
acceptance check to validate against.
- **Weak-model semantic self-review stays advisory.** When a weak
authoring model reviews its own draft for semantic quality, treat the
verdict as advisory only, never a hard veto on publishing — mirroring
the narrow-question guidance for weak-model judgment calls in
`docs/idd-workflow.md`'s Weak-model guardrails section.
- **Decompose and draft want different model traits.** Decomposition
(judgment about scope and structure) tolerates a verbose reasoning
model; the structured draft step (emitting the exact spec/acceptance-
criteria block) is more reliable on a leaner, more literal model,
whose chain-of-thought does not compete with the drafted block for
token budget. Pick the model per sub-task, not per pipeline, when both
are available.
- **Redraft and re-decomposition are limited rescue mechanisms, not
reliable fixes.** A bounded redraft loop tends to re-roll rather than
converge, because a weak author regenerates rather than incrementally
fixes. Re-decomposing a repeatedly-failing unit is usually low-value
too: most authoring failures are hard-but-atomic rather than
over-broad, and splitting a hard-but-atomic unit tends to produce
incoherent sub-units that do not recompose. Treat a code spec-unit
that repeatedly fails this gate as a candidate for `needs-decision` or
human/stronger-model authoring instead of looping indefinitely.
## Stable readiness buckets
Low-confidence or low-readiness work must not be silently deleted. The
skill should route it into one of these stable buckets:
- **ready**: the work passes the execution axes and can be drafted as an
orphan issue or as part of a roadmap.
- **deferred**: the idea is plausible, but priority, timing, or
decomposition is not strong enough to make it a ready execution item.
- **needs-decision**: the work depends on a product, policy, or design
choice that should be surfaced explicitly before execution.
- **blocked-by-human**: the work is waiting on a person, credential,
asset, or outside system and therefore cannot complete autonomously.
- **out-of-scope**: the request does not belong in the repository or is
materially outside the skill's target problem.
When the target repository keeps a secure-by-default issue-author
approval gate, a drafted issue can be execution-ready in content yet
still need a post-publication approval step before unattended execution
may start. In that case, keep the issue itself in the normal ready
shape, but state clearly that:
- the issue author is self-authorizing only when they satisfy the
repository's `maintainer-approval-actors` policy
- otherwise an explicit approval signal is still required after the
final issue content and generated-plan update are stable: the
configured ready label from `approvalSignals.readyLabelName`
(default: `idd:ready`) is accepted according to
`approvalSignals.labelFreshnessMode` (`presence-only` by default,
optional `event-freshness`), and standalone `IDD ready` comments from
a maintainer approval actor must stay fresh against the latest issue
edits and generated-plan update (or an equivalent draft-stability
signal)
- until that approval exists, later discovery should treat the issue as
part of the approval-needed fallback bucket rather than the normal
ready-to-start set
Do not treat organization `MEMBER` association alone or CODEOWNERS
coverage as a substitute for that repository-local approval rule.
Recommended routing rules:
- if only **limited scope** fails, split the work or draft a roadmap
- if **clear verification** fails because intent is unresolved, route to
`needs-decision`; unclear intent stays on that route, and only one of the
two interactive cases in Human-dependency isolation asks the operator first
or, when the auto-decide branch there applies, takes the recommended option
- if **autonomous completion** fails because a human must act, route to
`blocked-by-human`
- if **confidence** is too low but the request may still become valid,
route to `deferred`
- if the work does not belong in this repository, route to
`out-of-scope`
## Human-dependency isolation
Treat unresolved human dependency as a side effect that should be
isolated away from ready execution issues whenever possible.
- **Front-load** human-dependent work when coding cannot start safely
until a person provides a decision, credential, permission,
maintainer-only action, external setup, or policy choice, or until an
unavailable system becomes usable again.
- **Back-load** human-dependent work when the remaining dependency is
subjective review, publication choice, optional polish, or another
post-implementation judgment that should not block an otherwise
autonomous core change.
- Keep the central execution issue as close as possible to a pure
autonomous unit: clear repository-local scope, no hidden human handoff
in the implementation steps or acceptance criteria, and objective
verification.
- Preserve unavoidable human-dependent work in an explicit stable
bucket, dependency edge, or approval-needed hold rather than mixing it
into a ready issue.
- Route unresolved choices to `needs-decision`, route waiting on people,
credentials, maintainer-only actions, or unavailable systems to
`blocked-by-human`, use `deferred` when timing or decomposition is not
strong enough yet, and keep approval-gated ready work in the
approval-needed hold instead of the normal ready-to-start set.
- **Interactive choice.** This rule holds whenever the auto-decide branch
below does not apply. In an interactive session, meaning the operator
asked for issue authoring in the current conversation, a product,
policy, or design choice the operator can answer, and a candidate missing
either a concrete surface or an objective verification, are asked about
before they are published as `needs-decision`. The session asks in one
turn, covering every such choice in the current set, each with a
recommended option. That turn is one clarification round under
`issueAuthoring.maxClarificationRounds`. A choice not yet asked is asked,
not treated as silence, while the session is below the cap. A reply that
names a concrete surface and an objective verification, and does not park
the choice, is drafted into the ready scope. A reply that explicitly parks
the choice, or explicitly leaves it open, publishes `needs-decision` at any
cap, whether or not it names a surface or a verification. Any other reply
that leaves a surface or a verification unnamed is published neither as
`ready` nor as `needs-decision`. Below the cap, the session asks for that
missing item in the same turn, unless it was already asked in that turn; a
later round below the cap asks again. At or above the cap, the session does
not ask again. With no reply after the question was sent, nothing is
published for that choice, at, below, or above the cap. A later interactive
session starts a new count. A session that is not interactive keeps the
`needs-decision` route for these two cases, unless the auto-decide branch
applies. The other routes stay as they are:
an incomplete previously-declined search, a same-shape follow-up with
no new signal, unclear intent, a malformed body, possible incoherence, an
uncertain check outside these two cases, a `review-needs-decision`
follow-up, an unattended A1.5 gap filing, and a `credential`, another
person, or an unavailable system, which waits as `blocked-by-human`. An
unchanged route wins when a candidate also matches one of the two cases:
unclear intent, for example, stays on `needs-decision` even when the
candidate also lacks a surface or a verification.
- **Auto-decide branch.** The Interactive choice rule above asks the
operator, and a session that is not interactive publishes `needs-decision`.
When the operator has not asked for a hearing, this branch replaces both for
the same two cases. It applies the procedure "Auto-decide at a stop" in
`docs/idd-workflow.md` to issue authoring, and it loosens only those two
cases.
- **When it applies.** The procedure's Who conditions hold, which include a
trusted `idd-effective-config --trusted-auto-decide` read that reports the
`authoringChoice` class `enabled`, and the operator has not asked for a
hearing. Asking for a hearing means that an operator message in this
conversation asks to be consulted before publication. A plain request to
author issues is not such a request. One request covers the current
authoring set. In every other case today's rule holds: ask when
interactive, else publish `needs-decision`. That covers a class that is
not `enabled`, a trusted read that fails, a hearing that was asked for, a
cap that is reached or cannot be read, and an outcome in which the
procedure keeps today's behavior.
- **Options.** Draft at least two options. One of them is
`Keep today's behavior`, which the confirmation-issue linter requires by
name. Every other option cites repository evidence for its surface and for
its verification: an existing path, symbol, or command. An option backed by
cited evidence is not an invented option in the sense of the procedure.
When no option can cite such evidence, the branch does not apply, and
today's rule holds.
- **Taking the option.** The session takes the recommended option only when
it passes the procedure, the per-set cap included: the cap is counted from
the records of the target's authoring set, as the procedure's Caps step
says. It drafts that option into the ready scope. The body gains an
`## Auto-decided choice` section with one entry per auto-decided choice.
Each entry names the option, the alternatives, and the choice's `decision`
ID, and the section states that no hearing was asked for. The heading
differs from the provisional-decision wording that a needs-decision source
uses, because this target closes normally. The completed-draft review
packet lists each such choice under `constraints` as an agent choice with
its evidence, so a reviewer does not treat it as an operator decision
(preventive; no observed incident yet).
- **Publication order.** The session publishes the target under the
authoring hold first. It then files the confirmation issue with
`class=authoringChoice`, `source` set to the target, and `set` set to the
target's authoring set (see "Auto-decide confirmation issue" in the
contract). Whether that is a new issue or an appended record follows the
procedure's Record, then act step. A record counts only with the same
source as the confirmation issue's body record, so a later target of the
same set cannot append to an issue that another target opened: its record
does not count, so that decision is not recorded, and the not-recorded
branch below applies. The session then posts the link marker on the
target.
- **A confirmation that is not recorded.** The procedure's Record, then act
step says when that happens. A `held` outcome counts as recorded for this
class and is never voided.
- When the outcome left something behind (a `recovery-hold` issue with an
issue number, or an append that the check cannot confirm), the session
first posts the void marker for that decision on that confirmation
issue, as the procedure requires. It then comments the failure on the
target.
- Within the `## Auto-decided choice` section, every rewrite touches only
the failed choice's entry; the rewrites below also change the scope text
that depends on that choice. The `## Auto-decided choice` heading is
removed only when no recorded choice is left. A `## Decision` or
`## Decision needed` section may sit next to the remaining entries.
- In an interactive session below `issueAuthoring.maxClarificationRounds`,
the session asks the operator about the choice, and the ask counts as
one clarification round. A reply that confirms the choice, or picks
another option with a surface and a verification, replaces that entry
with a `## Decision` record of the operator's answer. In the second
case it also rewrites the target's scope to that option. A reply that
parks the choice or leaves it open leads to the needs-decision rewrite
below. Every other reply follows the Interactive choice rule as applied
to the held target. With no reply, the target stays held and the
session reports it.
- Unattended, or at or above the clarification cap, the session rewrites
the held target to the `needs-decision` route. The failed choice's entry
becomes a `## Decision needed` section that lists the open choice and
its options, today's route included. The chosen option is removed from
the proposed change and the acceptance criteria, and the body gains the
`authoring-bucket: needs-decision` marker.
- Every rewrite, on either route, runs in this order: prepare the body;
run the completed-draft review, because the rewrite can change the scope
or the readiness bucket; run the lint (for the needs-decision route,
with `--expect-bucket needs-decision` and both labels); when the route
needs the needs-decision label, run the conflict check and the renew
step for this set's anchor and target, add the label, and verify it;
then run the conflict check and the renew step again, immediately before
the body edit, as the contract's "Conflict check before every edit" and
"Renew before every edit" rules in Authoring hold and release require;
then edit the body. A held body with an extra label fails safe, and a
body with the marker but without the label would not (preventive; no
observed incident yet).
- If the review is unavailable, the label add cannot be verified, or
another step fails, the session makes no further edit, reports the
recovery, and stops. The target stays held in every case.
- **Resume and release.** A resumed authoring session that finds a held
target whose `## Auto-decided choice` section lists a `decision` ID
without a counting record takes the not-recorded branch above for that
choice. The procedure keys an authoring decision by its authoring set, so
the session reads the records of the target's set with
`idd-auto-decision-records --records --class authoringChoice --set <set ID>
--state all`, passing the trusted `--owner`, `--repo`, and `--base-ref` of
the procedure's Caps step, and matches each listed `decision` ID to a
returned record whose `source` is the target. When that read is
unreadable (exit 1), the session makes no rewrite,
reports it, and leaves the target held. The contract's Stage 2 release
checklist, in Authoring hold and release, carries the same check: every
`decision` ID listed under `## Auto-decided choice` has a counting record,
in any state, and the item fails while that read is unreadable.
- **Unchanged routes.** The routes that the Interactive choice rule lists at
its end stay as they are, and each wins over this branch when a candidate
also matches one of the two cases.
- **Release.** Releasing the target stays a person's action. When the
standing release approval (`standingApprovals.release`) acts, that
class's own rules apply. That approval could then release and run the
target before anyone reads the confirmation issue (preventive; no observed
incident yet).
- If a task cannot be expressed without unresolved human coordination in
the middle of implementation, it is not yet `ready`.
This principle complements the execution axes rather than replacing
them: it is a practical way to protect autonomous completion and clear
verification during issue drafting.
## Hidden human-dependency validation
Before publishing a `ready` issue, run a short pre-publication check for
hidden human dependency. Treat this as a routing aid, not a rigid
wording linter: the question is whether the work still depends on
unresolved human action, not whether the draft used one forbidden
phrase.
Ask these checks:
1. Does implementation require credentials, external access, hardware,
or infrastructure that the executing agent cannot already reach? If
yes, route the work to `blocked-by-human` unless that dependency can
be front-loaded into a separate prerequisite issue.
2. Does any implementation step or acceptance criterion depend on a
product, policy, or design decision that has not been made? If yes,
route the work to `needs-decision`, unless the interactive choice rule
in Human-dependency isolation applies, in which case ask the operator
first, or the auto-decide branch there applies, in which case that
branch takes the recommended option.
3. Do the acceptance criteria require subjective human approval instead
of objective verification? If yes, rewrite the ready issue around
measurable checks and back-load the optional review or publication
judgment.
4. Does a roadmap narrative hide human-dependent work inside prose while
the visible task list presents the item as execution-ready? If yes,
preserve that work in an explicit stable bucket, approval-needed
hold, or blocking issue instead of burying it in the narrative.
5. Is any dependency marker being used only to group related work or
express preference order? If yes, remove the fake blocker and use
task-list structure or sequencing notes instead. Keep dependency
edges only for true start blockers.
Normal post-implementation code review, merge approval, or publication
choice does not by itself make an otherwise autonomous issue non-ready.
The ready issue should still carry its own objective verification even
when a human will look at the result afterward.
## Codebase-fidelity validation
Before publishing a `ready` issue, run a short pre-publication check that
the spec stays faithful to the existing codebase. Treat this as a routing
aid, not a rigid wording linter: A4.5 suitability triage is structural and
does not read the codebase, so a spec that contradicts established
semantics can still pass that gate and only surface the mismatch in
advisory review, costing extra review-fix round-trips.
Ask these checks:
1. When an issue reuses an existing identifier or field name, confirm the
specified value matches that name's established semantics in the
codebase — do not overload a name with a new shape or source.
2. Flag values that are mutable at runtime — specify a live read at the
point of use rather than a one-time capture at construction.
3. When an issue proposes to **delete, replace, or "align to upstream"**
code, first check the target for an intentional-divergence signal — a
local change made on purpose to differ from upstream. If one is present,
require the issue body to acknowledge that divergence and justify
overriding it, rather than silently reverting hardening a consumer added
deliberately (blind "resync to upstream" resets are a recurring
Discover→plan-cycle waste when the divergence turns out to be
intentional). The recommended portable signal is a canonical inline
code-comment convention (for example a `do-not-revert:` / `idd-divergence:`
marker) — it travels with vendored files and needs no repo-wide label
taxonomy. An owner/CODEOWNERS marker or a referenced tracking issue may
also serve, but the code-comment convention is the recommended default.
Do not hard-code any single consumer's divergence-tracking mechanism.
4. When an issue drafts a **template resync or reimport** (pulling a
newer `idd-template/` revision into a repository that already
adopted IDD), consult the **upstream target ref's** copy of
`docs/customization.md`'s "Documentation lint compatibility"
section (added 2026-08-05, commit `6ceaa6dd`) before treating
`.markdownlint.yml` / `.markdownlint-cli2.yaml` / `.cspell.config.yml`
as unchanged. `docs/customization.md` is itself part of the
imported core file set, so it resolves in an installed or adopter
context once present — but an adopter whose prior import predates
that commit has no such section in their own local copy yet, which
is exactly the named gap to document in the resync issue, not a
documentation-consultation failure. Either the target ref's
`docs/customization.md` section or, from a source checkout of
`idd-skill` itself, `idd-template/ONBOARDING.md`'s "Re-importing"
section, documents the same named gap: an adopter's own rule
customizations for these files need a by-hand merge into the new
import rather than an assumed carry-forward, and
`idd-onboard.mjs --import` reports a `blockedOverwrites` finding
instead of silently keeping a same-named local file as-is, unless
the import used `--force`, which still writes the file and reports
it in the verdict JSON (`plan` as an `overwrite` entry,
`filesChanged`, and `written`) but omits it from
`blockedOverwrites` so the import is not blocked (observed
2026-08-12/13 on an
adopter repository, `setup.ubuntu`, kurone-kito/idd-skill#2012).
5. When drafting a resync issue's Background, run a mechanical
placeholder diff against the **upstream `idd-skill` source
repository's** `idd-template/` trees at the two relevant refs —
never a tree inside the target/adopter repository itself, which
retains no local `idd-template/` directory of its own once IDD is
imported.
- **Baseline ref.** Use the exact tag or commit SHA actually
imported at the adopter's prior onboarding when it is explicitly
recorded (for example in the original onboarding PR/commit
message) or when the operator can confirm it directly. Do not
infer it from the adopter's current file content: neither a diff
against the import commit nor a reverse- or forward-substitution
content-match against a candidate upstream tree reliably pins a
single ref — onboarding substitutes placeholder values and
permits legitimate post-substitution edits, an import commit's
diff itself only records the already-transformed adopter
snapshot, and more than one upstream commit can plausibly yield
the same imported subset. When no explicit record or operator
confirmation is available, report the baseline as
unresolved/ambiguous in the resync issue itself rather than
guessing one from content alone. Do not construct `v<iddVersion>`
(`.github/idd/config.json`) as the baseline without this check:
`iddVersion` is only a coarse signal and can be stale, an adopter
still on `0.1.0` has no matching tag at all (`CHANGELOG.md`
records that `0.1.0` predates the tag discipline), and an adopter
who pinned a raw
commit SHA at import time instead of a tag may have no
`v<iddVersion>` tag matching what they actually imported either.
- **Target ref.** The new release/ref the resync targets.
- **Scope.** Intersect both trees with the Step 2 "File list" core
file set as it reads **at the target ref**
(`idd-template/ONBOARDING.md`'s generated file-list block) plus
whichever optional profile artifacts the adopter selected, not
the complete `idd-template/` tree — a file such as
`idd-template/ONBOARDING.md` itself is never copied into an
adopter, so reporting it as changed is noise. Use the target
ref's manifest, not the baseline ref's: a file the target release
newly added to the core or a selected profile is exactly the kind
of change a resync issue must report, and the baseline ref's own
manifest predates it.
- **Token filter.** Compare each ref's own placeholder table in
effect at that ref, not today's list applied to both — a
placeholder added or removed between the two refs is itself
exactly the kind of token-identity change this check exists to
report, and reusing one ref's list for the other's tree would
hide that change. At a ref from commit `e55ccd9c` (2026-05-12)
onward, that table is Onboarding Reference — Placeholder Values'
"Final placeholder meanings" table
(`docs/onboarding/placeholders.md`). An older ref has no such
file — the placeholders were documented directly inside
`idd-template/ONBOARDING.md`'s own "Step 1C — Collect placeholder
values" section instead; use that section's list as the
allowlist for a baseline ref that old. Never match every
`{{...}}`-shaped span unfiltered either way — an unrestricted
match also catches ordinary GitHub Actions expressions such as
`${{ github.token }}` in an imported workflow file.
- **Excluded paths.** Skip `docs/onboarding/placeholders.md`,
`docs/customization.md`, and `docs/onboarding/policy-decisions.md`
— these deliberately keep `{{...}}` tokens literal to document
the placeholder syntax itself, so diffing them misidentifies
literal documentation as an outstanding substitution.
Compare the actual token identities per changed file, not only the
aggregate occurrence count: a same-count one-for-one placeholder
swap changes what an adopter must substitute without changing the
count. Name any file whose placeholder tokens changed, rather than
asserting a file needs no placeholder substitution as an unverified
default (observed 2026-08-12/13 on an adopter repository,
`setup.ubuntu`, kurone-kito/idd-skill#2012).
6. When a draft proposes changes to files covered by the target repository's
configured `bundleBudgets` or `instructionSizeBudgets` entries — including
`.github/instructions/` files, their `idd-template/` sources, and
onboarding documents — first
resolve that repository's own bundle-budget policy. For a changed
`idd-template/` source that is not itself listed in `bundleBudgets.files`,
resolve its generated target through the target repository's `syncPairs`
(or equivalent source-to-target mapping) before selecting bundles;
evaluate that target path as changed. For each applicable
`instructionSizeBudgets` entry covering a changed file, run its per-file
limit and near-ceiling-ratchet checks on banner-stripped byte totals before
claiming headroom. For every
configured
bundle containing a changed file, compare its measured,
banner-stripped total with its `bundleBudgets.limitBytes` and apply the
`contextCeiling.maxUtilizationPct` constraint before claiming byte-budget
headroom. Apply the same check when a draft adds a file to a bundle or
changes the `bundleBudgets`, `instructionSizeBudgets`, or
`contextCeiling` policy: evaluate the
proposed post-change bundle memberships and limits in addition to current
manifest entries. For a proposed `bundleBudgets.limitBytes` increase,
include the base-reference near-ceiling ratchet and full
`contextCeiling` policy in the proposed pass/fail result. Use the linked
Context ceiling section for threshold, absolute-limit, and exemption
mechanics. When the draft also changes `noticeUtilizationPct`, record the
lower of the base and proposed values for the near-ceiling-ratchet result.
Include every other applicable
manifest budget, including `instructionSizeBudgets` per-file limits and
their near-ceiling ratchets, when the draft changes a governed file or
proposes a budget-policy edit, using the target repository's own
configured values.
Record each affected bundle or file's measured total, configured limit,
utilization, applicable ceiling, ratchet status (`not applicable` when no
relevant increase is proposed), and pass/fail result in the draft's
headroom claim. If no applicable budget entry is configured, or the target
repository does not define these source-repository-only settings, do not
claim headroom: state that no repository-configured byte/context ceiling
was found or use the target's own declared budget checks when available.
These checks preserve the observed regressions in
[#1213](https://github.com/kurone-kito/idd-skill/issues/1213) (closed
2026-07-03) and [#1259](https://github.com/kurone-kito/idd-skill/issues/1259)
(closed 2026-07-04), where recovered headroom regressed without an upper
bound. Use the
[Context ceiling](policy-constants.md#context-ceiling) section as the
authoritative policy reference instead of copying its mechanics into
the issue.
7. When a draft changes a documented rule, default, threshold, name, or
behavior, find every restating site of the old statement, not only the
code and the main paragraph the issue names. Pick two or three
distinctive phrases of the old statement and run `git grep -n -F` once
per phrase across the directories and agent entry files the checkout
has (in this repository: `docs/`, `idd-template/`, `.github/`,
`schemas/`, `skills/`, `src/`, `tests/`, `AGENTS.md`, `CLAUDE.md`,
`GEMINI.md`, `.github/copilot-instructions.md`). `git grep` ignores a
path the checkout lacks, so the list may be trimmed to what exists, but
a directory left out is a restating site the search cannot find.
`git grep` cannot tell a comment from a rule, so judge each hit. List
every restating site that still states the old rule under
`## Candidate files`, or give a one-line reason in the body for leaving
it. Where a phrase is distinctive enough that its
return would be a regression, add an acceptance criterion that it
cannot return, such as a data-only `forbiddenPatterns` entry in
`audit/sync-manifest.json` enforced by `audit-docs --check`. A
restating site outside the issue's scope is filed as its own issue,
not left in a pull request description.
## Live-observed claim citation
When a drafted issue's Background section (or its `## Goal` / `## Why
this matters` equivalent, per the schema in use) asserts a "live
observed" runtime behavior claim (as opposed to a claim verifiable by
reading static source), cite a concrete, checkable artifact for it — a
permalink, a PR/comment/run ID, or an inline reproduction snippet —
rather than only a prose description of the observed event. A drafting
session that already has the artifact in hand (a PR review thread, a
workflow run, an adopter's own report) should cite it directly instead
of paraphrasing from memory; a worked example already exists elsewhere
in this file: "(observed 2026-08-12/13 on an adopter repository,
`setup.ubuntu`, kurone-kito/idd-skill#2012)".
This is not a mechanical `audit-authored-issue` gate check: a
live-observed claim is prose-level and not reliably machine-detectable
without a high false-positive risk. Apply this discipline at drafting
time instead, before an unsupported claim ships in one of these
sections that another session or reviewer cannot independently
re-verify.
## Alignment with A4.5 Suitability Gate
The IDD discover phase uses an A4.5 pre-claim suitability gate that
evaluates whether an already-published issue is suitable for autonomous
execution. This gate applies the same readiness buckets as the issue
authoring skill, **and adds new outcomes** for defects discovered at
discover time.
### Mapping authoring buckets to A4.5 outcomes
| Authoring Bucket | A4.5 Gate Checks | Pass/Fail | A4.5 Outcome |
| -------------------- | ---------------- | ---------------------- | ------------------ |
| **ready** | All 7 checks | All pass | **(pass)** → claim |
| **deferred** | (not published) | N/A during drafting | Not yet evaluated |
| **needs-decision** | Check 5 or 7 | Fail on decision block | `needs-decision` |
| **blocked-by-human** | Check 6 | Fail on autonomy block | `blocked-by-human` |
| **out-of-scope** | Check 1 | Fail on scope check | `out-of-scope` |
### New A4.5 outcomes not in authoring buckets
The A4.5 gate may discover new issues that should have been caught
during drafting:
| A4.5 Outcome | A4.5 Check | Meaning | Drafting Prevention |
| ------------- | ---------- | ------------------------------------- | --------------------------------------- |
| **unclear** | Check 2 | Issue body is malformed or incoherent | Run coherence validation before publish |
| **invalid** | Check 3 | Untrusted input or safety concern | Screen for markers and code injection |
| **duplicate** | Check 4 | Duplicate of existing work | Run reuse-first check before publish |
**Prevention during drafting**: Before publishing an issue, validate that
it will not fail A4.5 for coherence, safety, or uniqueness. If it would,
resolve the issue during drafting instead of publishing it.
### Completed-draft adversarial review
This review is distinct from the Intake and Clarification critique.
That earlier pass reviews the emerging interpretation, before a body
exists. This pass reviews each completed roadmap, child, or orphan
draft after drafting and before `audit-authored-issue` and before
publication.
Review and audit a roadmap shell while its `## Tracks` list may still
be empty, then publish and acquire that shell. Review and audit each
child before that child's publication. Writing the real child numbers
into `## Tracks` revises the roadmap: review that revised body, then
run the linter again, before saving the edit. Do not hold child
publication until the parent task list is final.
The reviewer receives the exact candidate title and body, plus only
this packet:
- the user's goal
- confirmed constraints and design choices
- relevant evidence or file references
- relationship context for a multi-issue set
- the issue-authoring critique checklist below
For a multi-issue set, map each hard edge in `relationships` to its
producer output and blocked work, and use `evidence` to support that
relationship. For a single issue, keep `relationships` empty and put
supporting evidence in `evidence`. Keep the packet aligned with the
concise rationale in the issue body; the packet schema stays unchanged.
The packet does not include the whole conversation or unbounded work
instructions.
**Issue-authoring critique checklist.**
- the title and body match the confirmed goal and constraints
- a concrete surface and an objective verification are named
- acceptance criteria are checkable without a hidden human decision,
credential, or subjective approval
- each dependency edge names the consumed predecessor output, blocked
operation or criterion, supporting evidence, and counterfactual with
other prerequisites retained. The body and packet agree; for a
multi-issue set, `relationships` maps each hard edge and `evidence`
supports it, while a single-issue packet keeps `relationships` empty
and uses `evidence` for support. Independent siblings stay in the
roadmap task list
- the set preserves natural cohesion without a parallelism quota or a
new approval gate
- the draft stays inside the specificity target range: no hidden
assumption that only a top-tier model could infer, and no
step-by-step runbook, so a middle-tier cloud model can implement it
without drifting
- candidate files, when present, are cues rather than an edit script
- a `review-needs-decision` body follows the body contract below,
including its headings, source-comment link, and quoting rules
- a change that loosens a fail-closed check names its region classifier and
its must-keep shapes under `Loosening a fail-closed check`, and the reviewer
checks both before the draft is published
- a draft that orders state-changing steps (claims, locks, POSTs, branch or
worktree mutations, releases) states, for each step that can fail after an
earlier step has changed state, the observable outcome and the next action; a
draft that cannot state that outcome is revised before the mechanical gate,
and if it still cannot after revision, it goes to needs-decision.
- a finding whose claim is identical to a `previously rejected:` string's
claim (wording may differ), in the same `draftSection`, is reported as a
repeat candidate that quotes that string, not as a new finding; the reviewer
does not decide that the rejection still holds, and the author applies the repeat
test (see
[Carry-forward of rejected findings](#carry-forward-of-rejected-findings))
- a draft that deletes, overwrites, recursively removes, records ownership of
a file, or writes to a path that could be a link gives each such operation
an acceptance criterion for each of the six cases under
[Destructive operations](#destructive-operations), or names the guard that
makes the case impossible; the reviewer flags a destructive operation whose
criteria leave a case unanswered
- a draft that deletes, renames, or moves a repository path or tree includes
the reference inventory under [Destructive operations](#destructive-operations):
repository references, including prose documentation that names the path, and
executable consumers (links, tests, hooks, workflows, templates, and scripts);
the reviewer flags a draft with no inventory, or one where a reference or
consumer is neither in Candidate files nor explained as still valid
#### Resolver
When a helper runtime can run it, resolve the delegate with
`idd-issue-authoring-delegate`. In this source repository the
equivalent is:
```sh
node scripts/idd-issue-authoring-delegate.mjs [--policy <path>] [--no-user-global]
```
The helper resolves `issueAuthoring.adversarialReview.delegate`. It
does not invoke the command, does not read a branch diff, and does not
read `critiqueLoop.delegate`.
If that resolver cannot be run (`instructions-only`, or the helper is
not available), use the agent-native reviewer or a structured
self-critique. A missing resolver is not a delegate failure.
`usable: false` (`not-configured`, `repository-local-explicit-disable`,
or `invalid-repository-local-delegate`) keeps that same native reviewer
or structured self-critique. An unusable delegate is not a failed
review.
When `usable` is true, apply one of four modes. They match the C/E
critique-delegate modes, for this delegate only. Whenever both
mechanisms run, union their findings.
| mode | delegate succeeded | delegate failed |
| -------------------- | ---------------------------- | ---------------------------- |
| `fallback` (default) | native reviewer does not run | native reviewer runs |
| `combined` | both run | both run |
| `on-success` | both run | native reviewer does not run |
| `never` | native reviewer does not run | native reviewer does not run |
Delegate failure applies only after `usable: true`. It means a missing
command, a non-zero exit, a timeout, cancellation, or findings that
cannot be read as a list. A readable empty list is a clean verdict. If
no mechanism that actually ran returns a readable list, stop
publication of the target. Do not create the target issue, do not update
its body, do not apply or remove a label on it, and do not append an
authoring marker for it. An issue that already exists under the
authoring hold keeps that label and its previous body. A failure is never
a clean review. Remaining held means the candidate does not become a
released, discoverable issue. The caller, never the reviewer, then
publishes the target's drafts in a draft carrier marked `Review: not
reviewed`, unless they already sit in one or one of the two local-draft
exceptions in [Draft carrier](#draft-carrier) applies; that carrier is the
only issue a failed review may create.
The reviewer must be read-only and review-scoped. It returns a findings
list only. It must not create or update issues, change labels, or
append authoring markers. This is a trust-based contract, not an
enforced sandbox: the configured command runs in the caller's
environment as executable configuration, so nothing in this workflow
technically stops it from mutating, and a prose-only restriction in a
dispatch prompt does not reliably stop a context-inheriting reviewer
either. Prefer a non-context-inheriting reviewer, and run the reviewer
under a read-only capability or sandbox wherever the harness offers
one.
issue #3448 records the observed risk: a context-inheriting
no-mutation dispatch can still publish.
Bound the delegated command with
`issueAuthoring.adversarialReview.waitCeiling`.
Use the resolver's `waitCeiling` when resolution ran, otherwise the
default `PT20M`. Enforce it through the caller's own bounded wait and
cleanup. Do not wrap the configured command in a timeout utility, the
same principle as issue #3449. This ceiling does not read
`critiqueLoop.subagentWaitCeiling`, and a user-global ceiling is
ignored. Use the same caller-side bound for the native reviewer, so a
hung native pass is not an unbounded substitute.
**Input.** The caller runs the resolved `command` as a shell command with
its working directory set to the root of the repository checkout the draft
is being authored for. It passes no extra argv and no file path, writes
exactly one UTF-8 JSON object to the command's stdin, and closes stdin. The
object has three fields: `title` (string, the exact candidate title), `body`
(string, the exact candidate body), and `packet` (object). `packet` has five
fields: `goal` (string), `constraints` (array of strings: confirmed
constraints and design choices), `evidence` (array of strings: evidence or
file references, where a file reference is a repository-relative path),
`relationships` (array of strings: relationship context for a multi-issue
set, empty for a single issue), and `checklist` (array of strings: the
issue-authoring critique checklist items). All eight fields are required,
`title`, `body`, `goal`, and every array item are non-empty strings, an array
itself may be empty, and no other field is allowed at either level. The packet
stays the bounded set defined above: it never carries the whole conversation
or unbounded work instructions. The shape is published as the
[issue-authoring review input schema][issue-authoring-review-input-schema].
The `evidence` array may also carry `previously rejected:` strings, which
the [carry-forward rule](#carry-forward-of-rejected-findings) adds.
**Output.** The command writes free-form findings to stdout, read the same way
a subagent's critique response is read; no machine-readable output schema is
introduced. The failure meaning, the mode table, the wait ceiling, and the
no-mutation boundary above are unchanged.
The configured command is trusted executable configuration and may
transmit the supplied draft and evidence packet.
#### Disposition
Record an explicit author disposition for every finding before
publication. When a disposition changes the title or body, run
`audit-authored-issue` on the revised text. When that revision changes
more than wording, run this review once more on the revised draft
before the linter. That includes a change to acceptance criteria,
candidate files, dependency edges, roadmap task-list or relationship
wiring, scope or the proposed change, or the readiness bucket.
Wording-only edits do not start another review. The body that enters
the linter is the reviewed body plus those wording-only edits.
A disposition for a repeat of a rejected finding follows the
[carry-forward rule](#carry-forward-of-rejected-findings): it cites the
ledger entry and re-reads that entry's evidence against the repository as it
stands now.
#### Carry-forward of rejected findings
Each round gives a fresh reviewer only the packet, so the reviewer cannot
see how an earlier round dispositioned a finding. Without a record, a claim
that an earlier round rejected is raised again in a later round, often with
different wording. Observed 2026-10-13 in one drafting session (recorded in
issue `#4101`): the pin list for the policy audit was flagged in two rounds,
and the recovery path for an empty handle in three rounds, each time with
different wording, at about 100,000 reviewer tokens per round.
**Ledger.** During a drafting session, keep a findings ledger in the namespace
that [Ledger storage](#ledger-storage) allocates, one JSON file per draft, named
for that draft: its issue number once one exists, or, before then, a token that
no other draft uses, such as a freshly generated UUID. When the draft gets its
issue number, rename the file to that number and keep every entry. No two drafts
or concurrent workers share a ledger file. The ledger is never written to the
repository or to a marker. Each entry has these members: `claim` (one sentence),
`draftSection` (the heading the finding concerns), `round`, `draftVersion` (the
draft revision the finding was raised against, counted from 1; recorded for
audit only), `disposition` (`fixed`, `rejected`, or `deferred`), `evidence`
(required for `rejected`: a file and line, or a read-only command and its
output), and `decidedAt`. If the namespace or the ledger is lost, for example
after a restart, or after the session loses the identity record that
[Ledger storage](#ledger-storage) keeps, including through context compaction,
the ledger is empty and the review runs as it does without one.
Record an entry for every finding as soon as its disposition is decided, before
the next review round. A later disposition of the same finding updates that
entry.
**Packet.** For each `rejected` entry that has evidence, add one string to the
packet's existing `evidence` array, in every review mode:
`previously rejected: <claim> (draftSection: <heading>; evidence: <evidence>)`.
Keep each string to one line, shortening longer evidence to the line that
decides it. Do not add a field. The packet keeps its five fields, so the
input schema does not change. Only these strings are added to the packet
from the ledger.
**Reviewer.** The checklist item above applies. A reviewer reports a finding
whose claim is identical to a `previously rejected:` string's claim, in the
same `draftSection`, as a repeat candidate that quotes that string. The
reviewer does not decide that the rejection still holds, and does not judge
whether the finding brings new information: the author applies the repeat test
to each reported repeat candidate.
**Repeat test.** A finding is a repeat only when its claim is identical to the
entry's claim, meaning the same substantive claim with wording ignored, and it
is in the same `draftSection`. A finding with a different claim, or only a
related topic in that section, is new. A finding that brings information the
earlier rejection did not address is new, even when its claim is identical to
an entry's claim. The author applies this test to each reported repeat
candidate.
**Author.** For each reported repeat candidate, first apply the repeat test.
Only a finding that passes it is a repeat. Then re-read the entry's evidence
against the repository as it stands now: the file and line, or the cited
read-only command re-run. If the evidence still holds, confirm that the
finding brings nothing the earlier rejection did not address, then record a
fresh disposition that cites the entry. The earlier disposition alone is not
proof. If the evidence changed, or the finding brings new information, the
finding reopens as a new finding.
**Carry-forward limits.**
- A rejected entry without evidence is not carried forward.
- A fixed entry is never carried forward; the revised draft is checked
against its claim again.
- A deferred entry stays open until the author decides, and a draft with an
open deferred entry is not published.
**Round cap.** A draft gets at most two completed-draft review rounds. A
verification review that the Disposition rule requires after a substantive
revision is not counted as a round. It may reopen a dispositioned finding when
new evidence shows that the disposition no longer holds, or when the revision
does not fix a finding marked `fixed`. A repeat of a rejected finding that
passes the carry-forward repeat test is not reopened without new evidence.
Within the counted rounds, after round two, a finding that breaks an acceptance
criterion or a safety invariant is fixed in the draft. Every other finding
becomes a separate follow-up issue or a needs-decision item, and it is not
added to the draft's body.
**Premise check.** Before a finding, or a residual that depends on a test
result, is recorded, reproduce the result with the test command that the
repository documents for its own tests. In the source repository that is the
`test:scripts` invocation in `package.json`, including its isolation import.
An installed copy in another repository uses that repository's own test
command. A result from any other invocation is not evidence. A finding that
does not depend on a test result needs no reproduction.
#### Ledger storage
A drafting session needs a private place for its ledger before the first ledger
write. This procedure needs one process that keeps the verified directory
handles and the exclusive lock open across every ledger operation of the
drafting session. An instructions-only or same-response self-critique run whose
commands run as separate shell calls cannot do this, because a handle or a lock
does not survive from one call to the next. Such a run, or any other run that
cannot keep them, decides this before any check below and stops the procedure
there: it creates no namespace and writes no ledger, and it never substitutes
pathname-based operations. It reports that no ledger is kept and runs the review
under the loss rule in the **Ledger** paragraph of
[Carry-forward of rejected findings](#carry-forward-of-rejected-findings): no
finding is carried forward, and every finding gets a fresh disposition. This
capability stop is not a storage stop: no storage was examined, so the review
can still finish. To keep a ledger, run the procedure and every ledger operation
in one long-lived process that follows the implementation notes below. If that
process ends before the drafting session does, the ledger is lost under the same
rule; never reopen the namespace by path. The rule against pathname-based
substitutes is preventive; no observed incident yet. Run the procedure once per
drafting session, before the first disposition is recorded. Every check below
fails closed: when a platform cannot supply one of the evidence values named
here, the storage is unreadable and the procedure stops.
**Evidence.** For each path, record its canonical path (symbolic links
resolved), its file type, its owner, its mode (POSIX) or ACL (Windows), plus
its ACL on any POSIX platform where the root checks below read one, its link
count, and its file identity (device and inode on POSIX, volume serial and file
index on Windows). A ledger's content is identified by its SHA-256. This
identity record lives only in the session's working context, never in a file, a
marker, or the repository. Loss of this record, including after context
compaction, is a lost-ledger trigger: the earlier namespace cannot be verified
again, so it is left untouched as evidence, and any new ledger goes in a new
namespace. The storage verdicts below decide whether to allocate one and under
which root; a missing record does not prove that no root was supplied. For Linux
root checks, also record the candidate root, each existing protected path, and
every nested mount point's mount ID, matching mountinfo fields, and derived
backing location; repeat the full inventory and comparison whenever the root
checks run.
**Roots.** A root is a directory that holds namespaces. A root that the user or
the runtime supplies, such as a named scratch directory or harness scratch
metadata, is the only candidate: if it is missing or fails a check, stop and
report under the storage verdicts below, and never try another root. Only when
session history affirmatively establishes that no root was supplied, try the
operating system's temporary directory, then the user state directory. The
temporary directory is the
absolute path returned by the runtime's standard-library temporary-directory
resolver or the equivalent OS API. The user state directory is
`$XDG_STATE_HOME`, else `$HOME/.local/state`, on POSIX, and `%LOCALAPPDATA%` on
Windows. One rule applies to every base variable here (`$XDG_STATE_HOME`,
`$HOME`, and `%LOCALAPPDATA%`): use it only when it is set, nonempty, and a fully
qualified absolute path, which starts with `/` on POSIX, or with a drive letter
and `:\` or with a UNC `\\` prefix on Windows. Skip any other value, including a
relative, drive-relative, or root-relative one, and never resolve it against the
current directory. The user state directory is used only when it already exists;
this procedure never creates it.
**Root checks.** A root must be an existing directory, not a symbolic link or
reparse point, whose canonical path lies outside every path reported by a
complete, successful `git worktree list --porcelain` run and outside every Git
directory. The trusted Git executable is the single absolute executable
resolved by the runtime's configured command lookup before the Git environment
is sanitized. Resolve it once, do not use a shell alias or function, and use
that same executable for every inventory command in this run. A command lookup
can be steered by the session's `PATH`, so before trusting the executable's
output, require that file and every directory on its canonical path to be owned
by the current user or a system administrator principal (POSIX UID 0; on
Windows, LocalSystem, TrustedInstaller, or the built-in Administrators group).
No user other than those principals may be able to write the file, and no
directory on that path may let another user rename or delete its entries: on
POSIX, none may grant group or other users write and search permission without
the sticky bit, and on Windows and macOS, none may have an ACL that lets another
user rename or delete child entries. If any of this cannot be
established, the protected-path inventory is unreadable. Run every inventory
command through that verified canonical path itself, never through the
looked-up path or a link to it, so that a link in a directory another user can
write cannot be retargeted after the check. The executable check is
preventive; no observed incident yet. Run that command
from the current worktree with that executable, `GIT_DIR`, `GIT_WORK_TREE`, `GIT_COMMON_DIR`,
`GIT_CEILING_DIRECTORIES`, and `GIT_DISCOVERY_ACROSS_FILESYSTEM` unset, and
Git's diagnostic locale fixed to C (`LC_ALL=C` where supported). Require exit
status 0 and parse all records. A missing executable, nonzero status,
malformed record, or incomplete output makes the protected-path inventory
unreadable; stop instead of treating it as empty.
For each existing reported worktree, run
`git -C <worktree> rev-parse --path-format=absolute --git-dir` and
`git -C <worktree> rev-parse --path-format=absolute --git-common-dir` with the
same trusted executable and sanitized environment. Require each command to
exit 0 and return exactly one absolute directory path; include both paths in
the protected-path inventory and deduplicate by filesystem identity. Any
failure, missing common directory, or malformed output makes the inventory
unreadable. A common directory protects linked-worktree administrative
records under its `worktrees/` subtree, including records for a registered
worktree whose checkout path is confirmed absent. Keep that common directory
in the inventory. The separate Git-administration-directory gap was identified
during security review of PR #4728 on 2026-10-28 (preventive; no observed
incident yet).
Confirm the last part by running `git -C <canonical root> rev-parse --git-dir`
with `GIT_DIR`, `GIT_WORK_TREE`, `GIT_COMMON_DIR`, `GIT_CEILING_DIRECTORIES`,
and `GIT_DISCOVERY_ACROSS_FILESYSTEM` unset, and Git's diagnostic locale fixed
to C (`LC_ALL=C` where supported). A successful result means the root is
inside a repository and fails the root check. A nonzero result proves
non-membership only when it is either the exact standard `fatal: not a git
repository (or any of the parent directories): .git` diagnostic, or the exact
two-line filesystem-boundary diagnostic whose first line is `fatal: not a git
repository (or any parent up to mount point <path>)` and whose second line is
`Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).`.
For the filesystem-boundary form, the reported mount point must be a verified
ancestor mount point of the canonical root. In either case, a no-follow walk
from the root through its ancestors must confirm that each is readable and
none is a Git directory or contains a `.git` entry (file or directory).
The filesystem-boundary diagnostic was reproduced with `/dev/shm` as a control
test during security review of PR #4728 on 2026-10-28 (preventive; no observed
incident yet).
If the walk finds Git metadata, cannot inspect an ancestor, or sees malformed
or ambiguous Git metadata, stop. Any other exit status or diagnostic,
including missing Git, permission, I/O, malformed repository metadata, or an
unclassifiable error, means the root is unreadable and must stop. Never treat
an arbitrary Git failure as proof that the path is outside a repository.
The root-ownership gap was identified during security review of PR #4728 on
2026-10-28 (preventive; no observed incident yet).
A sticky bit does not make a root owned by another local user trustworthy:
that directory owner can rename entries in the session namespace. The root
must be owned by the current user or a trusted system principal (POSIX UID
0 or the Windows LocalSystem SID), and must be writable by the current
user. On POSIX, reject a root that grants group or other users write and
search permission without the sticky bit, even when the current user owns
it. On Windows, reject a root whose ACL lets another user rename or delete child
entries. On Linux, a POSIX ACL entry for a named user or group is limited by the
ACL mask, which the group permission bits show, so the mode check above already
covers it. On macOS, an extended ACL entry can let another user delete child
entries without any change to the BSD mode bits: read the root's ACL from the
verified directory handle with Apple's
[`acl_get_fd_np`](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/acl_get_fd.3.html)
and reject a root whose ACL lets another user rename or delete child entries.
On any other POSIX platform, the mode bits may not show ACL entries either, so
apply the same check through that platform's handle-based ACL call. When that
call reports that the root has no ACL (on macOS, `acl_get_fd_np` returns no ACL
with `ENOENT`), the root has no extended entries and the mode check decides. On
macOS or any other POSIX platform, any other failure to read the root's ACL
through the verified handle fails this check. If this permission evidence is
unreadable, stop.
**Mount aliases.** A canonical pathname can look external while a bind mount
exposes a worktree or Git administration directory, or while a nested mount
inside a worktree is also reachable through an external path. The nested-mount
gap was reproduced as a control test in an isolated Linux mount namespace during
security review of PR #4728 on 2026-10-28 (preventive; no observed incident
yet). Check the
backing location as well as the visible path. For every protected path (each
reported worktree path and each discovered Git directory), first compare its
normalized absolute lexical path against the candidate root using
component-aware containment, even when a worktree path cannot be opened. Then
walk each existing component without following symbolic links or reparse
points.
If that walk confirms a registered worktree path is absent after checking
its readable ancestors, retain the worktree record and its Git common
directory, mark the protected-path inventory incomplete, and stop before
evaluating any candidate root. A missing checkout does not rule out an
external bind mount of one of its subdirectories; a ledger in that alias
could be staged after the checkout is remounted.
This control gap was identified during security review of PR #4728 on
2026-10-28 (preventive; no observed incident yet). The stop message names the
missing path and this operator recovery step. An absent path can mean a deleted
checkout, a worktree moved by hand, or one on unmounted storage, so the operator
must confirm that the checkout was deleted: a moved worktree is repaired with
`git worktree repair <new-path>`, and unmounted storage is mounted again; neither
record is removed. For a deleted checkout whose record is detached, the operator
first points a backup ref at its `HEAD` commit, so removing the record cannot
leave that commit unreachable. A locked record refuses removal, so if the
record is locked, the operator reads its lock reason, stops when the reason says
the checkout may come back (for example, a checkout on removable media), and
otherwise unlocks it with `git worktree unlock <path>`. Never pass `--force`
twice, which removes a locked record without that check. Only then, holding any
lock the clone uses for worktree changes, the operator re-checks that the path
is still absent (`test ! -e <path>`) immediately before removing only that
record with `git worktree remove --force <path>`; if the path has reappeared,
the operator stops. The next run repeats the full inventory. Never use a plain
`git worktree prune` here: it is clone-wide, so it can also
remove other records, such as one whose checkout is only on unmounted storage,
before anyone has checked them (preventive; no observed incident yet).
Automation never prunes or removes worktree records, and this recovery does not
bypass claim or worktree recovery.
Automation must never prune or edit Git metadata. Access denial,
an I/O or device error, a symbolic link or reparse point, or any ambiguous
result makes the root unreadable and fails closed. An existing protected path
still needs the full canonical-path and backing-location checks below. For
each existing protected path, also inventory every mounted filesystem whose
mount point is equal to or component-contained beneath that path. Validate each
nested mount point by a no-follow walk rooted at its protected-path handle, and
include it as a separate protected backing location. A nested mount that has
disappeared, cannot be opened, or cannot be matched unambiguously makes the
root unreadable and fails closed. Missing-path handling is preventive; no
observed incident yet.
On Linux, enumerate every `/proc/self/mountinfo` entry whose decoded mount
point is equal to or component-contained beneath an existing protected path.
For the candidate root, each existing protected path, and every such nested
mount point, obtain a mount ID from an already-open directory handle using
`statx(2)` with `AT_EMPTY_PATH`. When `statx` fails or does not provide
`STATX_MNT_ID`, read the single decimal
`mnt_id` field from `/proc/self/fdinfo/<fd>` for that same open
handle. Require either source to yield a valid ID, then read the matching
entries in `/proc/self/mountinfo` and verify that each handle's canonical path
and mount ID match the parsed entry. Dedupe repeated entries by mount ID;
conflicting mappings are ambiguous. Decode mountinfo's escaped fields, and
require each path to be at or below its entry's mount point. Map a path to its
backing location by joining the entry's `root` with the path relative to
its `mount point`, paired with the entry's `major:minor` device identity.
Reject the
candidate root when its backing location is equal to or below any protected
backing location on the same device, including each nested mount point's
backing location. This detects a bind-mounted alias
without rejecting a candidate merely because it is on a different mount from
`/`. Do not use `RESOLVE_NO_XDEV` as a blanket cross-mount rejection: an
operating-system temporary or state directory may legitimately be on another
mount. If neither mount-ID source works, mountinfo cannot be read, a mount
entry cannot be matched, or the mapping is ambiguous, treat the root as
unreadable and fail closed. On other platforms, use native mount or volume
evidence to enumerate nested mount points beneath each existing protected path
and make the same backing-location comparison; if the full inventory or
comparison cannot be established, fail closed. The mount-ID fallback is
preventive; no observed
incident yet. See [`statx(2)`](https://man7.org/linux/man-pages/man2/statx.2.html),
[`/proc/self/fdinfo/<fd>`](https://man7.org/linux/man-pages/man5/proc_pid_fdinfo.5.html),
[`/proc/self/mountinfo`](https://www.man7.org/linux/man-pages/man5/proc_pid_mountinfo.5.html),
and [`openat2(2)`](https://man7.org/linux/man-pages/man2/openat2.2.html).
For this contract, native mount or volume evidence means an OS-provided
inventory of every nested mount beneath each existing protected path plus a
stable volume identity and backing path for each verified open handle; device
numbers alone are insufficient. If that inventory or comparison cannot be
established, fail closed. On macOS, get a verified handle's canonical path from
the handle itself with `fcntl` and `F_GETPATH`, and compare that path with the
inventory; if the call fails, stop. Never reopen the path by name to establish
it.
**Storage verdicts.** Classify each supplied root and namespace with exactly one
verdict:
| Input | Verdict | Action |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| A supplied root that exists and passes the root checks | Supplied verified storage | Create a new namespace under it (step 1). |
| No root was supplied for this session, and the session has no identity record | No previously supplied allocation | Allocate under the first candidate root that passes the root checks (step 1). |
| The identity record is unavailable, including after context compaction, and retained history does not establish whether a root was supplied | Identity unknown | Stop before any ledger write and allocate nothing. Ask the operator whether a root was supplied, then classify again; until then, the review runs without a ledger under the loss rule. Never infer that no root was supplied. |
| A supplied root is missing or fails a check, or a namespace, ledger, or lock file of this session has an identity different from its record (see the ownership cases) | Unsafe, conflicting, or unreadable storage | Preserve everything, report the canonical path and exact failing evidence, and treat the review as unable to finish (see below). Never fall back to another root. |
A namespace from another session is never reused, and a new session has no
identity record to reuse. An older namespace is left untouched as evidence.
**Step 1 — allocate a namespace.** Re-check the root before creating anything in
it: its canonical path and identity must match the root checks, or the procedure
stops. Resolve the whole root path from a trusted filesystem root or volume handle:
on POSIX, open each component relative to the preceding verified handle with
`O_DIRECTORY | O_NOFOLLOW`, or use Linux `openat2(2)` with
`RESOLVE_NO_SYMLINKS | RESOLVE_IN_ROOT` from a trusted `/` descriptor (see
[openat2(2)](https://man7.org/linux/man-pages/man2/openat2.2.html)).
On Windows, open each component relative to a trusted volume or root handle
with `NtCreateFile` and `OBJ_DONT_REPARSE`.
Applying `O_NOFOLLOW` only to the final component is insufficient. If the
platform cannot prove that no component was followed, fail closed. Then open
the root as a directory handle without following a symbolic link or reparse
point through that verified component walk, and confirm its identity, canonical
path, and backing location from the root checks. Create
`issue-authoring-<uuid>` relative to that handle with exclusive, non-recursive
directory creation, never `mkdir -p`. Make the namespace owner-only as part of
creation: use POSIX mode 700, or on Windows pass an explicit security descriptor
through `OBJECT_ATTRIBUTES.SecurityDescriptor`, with a DACL granting access
only to the current user and both `SE_DACL_PRESENT` and `SE_DACL_PROTECTED` set
on that descriptor. If the platform cannot apply this restriction before the
directory is visible, fail closed. Open it relative to the root handle
without following links, then
record its canonical path, file identity, type, link count, owner, and mode or
ACL. Check that the mode or ACL is owner-only, its canonical path is the root
path plus the bare name, it lies outside every worktree and git directory, and
it is on the same device as the root. If any check fails, preserve the namespace
and report its path and the exact failing evidence; mark this candidate failed.
Do not remove it by path.
Retry with a fresh UUID only when the name already exists, at most three times.
Any other failure ends that attempt. If a root was supplied, stop and report
its path and error; do not try another root. Only when session history
affirmatively establishes that no root was supplied may the next candidate be
tried. When every candidate fails, stop and report each attempt's path and
error.
Keep the namespace handle open for the ledger
operations below. Create a stable `ledger.lock` file relative to this handle
with exclusive, no-follow, owner-only creation. Record its canonical path,
identity, type, owner, and mode or ACL; verify those values before use. Never
replace or unlink this lock file. If it cannot be created and verified,
preserve the namespace and stop.
**Step 2 — create the first ledger.** Each draft has its own ledger file,
`<uuid>.json`, in the namespace. Create it through the verified namespace
handle below, with exclusive creation and no-follow behavior.
Make every ledger file owner-only at creation: use POSIX mode 600, or on
Windows pass an explicit protected security descriptor through
`OBJECT_ATTRIBUTES.SecurityDescriptor`, with a DACL granting access only to the
current user and both `SE_DACL_PRESENT` and `SE_DACL_PROTECTED` set on that
descriptor. After opening the new file, verify its owner and owner-only mode or
ACL before writing its first byte. Record its canonical path, file identity,
type, link count, owner, mode or ACL. Write `[]`, then record its SHA-256. If the
platform cannot bind creation to the namespace handle or make the file private
before it is visible, treat storage as unreadable. If this step fails, the
partial-state rule below applies.
**Ownership check before each ledger operation.** Before every ledger read,
write, copy, rename, or unlink, acquire the namespace lock and compare the
namespace, lock file, and ledger with their records:
- The namespace's canonical path matches its record, no component of that path
is a symbolic link or reparse point, and its file identity matches.
- The `ledger.lock` file is a regular file with its recorded identity,
canonical path, owner, and owner-only mode or ACL, and has link count 1.
- The ledger is a regular file, not a symbolic link or reparse point, with a
link count of 1, the recorded file identity, and its recorded owner-only mode
or ACL.
Path checks alone do not bind a later operation to the checked directory. Use
native handle-relative operations with exclusive creation and no-follow checks
for child reads, temporary-file creation, replacement, copy, and unlink; never
reopen a child through the namespace path between validation and the operation.
All implementations must use this same stable lock for every ledger operation.
Acquire it exclusively before reading or changing ledger entries, recheck
ownership and hashes while holding it, and keep it held through the replacement
or unlink and its verification. On POSIX, use Python's
[`fcntl.flock`](https://docs.python.org/3/library/fcntl.html#fcntl.flock) with
`LOCK_EX` on the verified lock handle; on Windows, use Microsoft's
[`LockFileEx`](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-lockfileex)
with an exclusive lock
on a fixed byte range of that handle. If the lock file identity changes, the
lock cannot be acquired, or the platform cannot provide the required exclusive
lock, preserve all entries and fail closed. POSIX locks are advisory, so every
writer following this contract must acquire this lock; the lock file remains
with the namespace.
On POSIX, a standard-library Python implementation can use `os.open`,
`os.mkdir`, `os.stat`, `os.rename`, and `os.unlink` with directory-descriptor
parameters. Before allocation, confirm that every required function supports
the relevant descriptor parameters and that `os.stat` supports
`follow_symlinks=False`; open directories with `O_DIRECTORY | O_NOFOLLOW` and
new files with `O_CREAT | O_EXCL | O_NOFOLLOW`. Python documents `dir_fd` as
Unix-only in its [`os` reference](https://docs.python.org/3/library/os.html#os-supports-dir-fd).
On Windows, use a native binding that opens or creates child names with
`NtCreateFile`, setting `OBJECT_ATTRIBUTES.RootDirectory` to the verified
directory handle and `OBJ_DONT_REPARSE` in its attributes. Use
`CreateDisposition=FILE_CREATE` for exclusive child creation; create a
directory with `FILE_DIRECTORY_FILE`. For every ledger file creation — the
initial or recreated ledger, temporary replacement, and issue-number copy —
also pass an explicit protected owner-only security descriptor through
`OBJECT_ATTRIBUTES.SecurityDescriptor`. The namespace DACL does not establish
that a child file is private. Verify each created file's resulting owner-only
DACL before writing to it, and preserve that ACL in the ownership record. If
the descriptor cannot be applied at creation or the resulting ACL is not
owner-only, fail closed and preserve the entry. After the final identity and
SHA-256 checks, replace the owned ledger via `SetFileInformationByHandle` on
the verified temporary-file handle with `FileRenameInfo`,
`ReplaceIfExists=TRUE`, and `FILE_RENAME_INFO.RootDirectory` set to the namespace
handle. Open that file handle with `DELETE` access. After verifying
the copied issue-number file, mark the verified source handle for deletion with
`SetFileInformationByHandle` and `FileDispositionInfo` (`DeleteFile=TRUE`); it
also requires `DELETE` access. If access or an operation fails, preserve the
files and stop. See Microsoft's [`OBJECT_ATTRIBUTES`](https://learn.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_object_attributes),
[`FILE_RENAME_INFO`](https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_rename_info),
[`NtCreateFile`](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-ntcreatefile),
[`Security Descriptors for New Objects`](https://learn.microsoft.com/en-us/windows/win32/secauthz/security-descriptors-for-new-objects),
and [`SetFileInformationByHandle`](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-setfileinformationbyhandle)
references. Keep the directory handle open through each operation, then verify
that its path still resolves to the same canonical location outside every
worktree and git directory, including by backing-location comparison. If any
value changes, preserve the ledger and all copies, stop, and report. If the
host cannot bind an operation to the verified handle or supply the required
evidence, treat the storage as unreadable and stop.
The cases below are preventive; no observed incident yet records any of them, so
none is cited. Each mismatch falls under one of the cases below. On a mismatch,
preserve the ledger and any unverified temporary entry; never recurse into a
directory or adopt an entry this session did not create. Cleanup may remove only
an entry created by this session whose recorded identity still matches, under
the specific rules below. If cleanup cannot be verified, leave the entry and
report it.
- **Owned and unchanged.** The file identity and SHA-256 both match. Continue:
write the complete new JSON to a new exclusively created, owner-only
temporary file in the namespace, then verify and record its canonical path,
identity, type, link count, owner, mode or ACL, and SHA-256. Immediately before
replacement, while holding the exclusive namespace lock, repeat the ownership
check and verify that the existing ledger's
identity and SHA-256 still match the records, and that the temporary file
still matches its records. On any mismatch, preserve both files and stop
without replacement.
Replace the ledger
by renaming the verified temporary file over it, then record the new identity
and SHA-256. Remove the temporary file only when this write created it, its
recorded identity still matches, and the rename failed.
- **Owned but edited.** The file identity matches but the SHA-256 differs. Do
not overwrite it. Preserve it, treat the review as one that cannot finish, and
report its canonical path.
- **Missing (lost).** The record says this session created the ledger, but its
path is now absent. Treat it as a lost ledger: recreate an empty ledger at the
same path with exclusive creation, and the review starts empty under the
existing loss rule in the Ledger paragraph above. A missing destination
therefore succeeds. If the namespace itself is absent, allocate a new one
(step 1).
- **Unowned.** Something already exists at the name this session would create,
or a file appears in the namespace that this session did not record. Refuse.
Do not read it as a ledger, adopt it, rename it, or delete it. Preserve it,
treat the review as one that cannot finish, and report.
- **Replaced.** The path exists with a file identity or file type that differs
from its record. Treat it as a conflict with another owner. Refuse, preserve
both entries, and report.
- **Linked leaf.** The ledger is a symbolic link or reparse point, or its link
count is above 1. Refuse. Never follow it or write through it. Report.
- **Linked parent.** A component of the namespace path is a symbolic link or
reparse point, or the canonical path differs from the record. Refuse. Report.
**Partial first ledger.** When allocation succeeds but the first ledger cannot
be created safely (its exclusive creation fails, or its first write fails), keep
the namespace and any partial file, delete nothing, and report the exact path
and error. The review counts as one that cannot finish.
**Rename to the issue number.** Once the draft has its issue number, hold the
exclusive namespace lock from before creating the destination through its
verification and the final source unlink. Copy the
verified ledger to `<number>.json` with exclusive, owner-only creation, write
the same content, verify the resulting mode or ACL, and confirm that the copy's
SHA-256 equals the source ledger's recorded SHA-256. Record the copy's canonical
path, identity, type, link count, owner, mode or ACL, and SHA-256. If
`<number>.json` already exists, keep the `<uuid>.json` file, never
overwrite or adopt the existing file, and stop before publication to report the
conflict. Immediately before unlinking the source, verify that the namespace
identity still matches, the source identity and SHA-256 still match their
records, and the destination is a regular file with link count 1, the recorded
identity and SHA-256, and the canonical path `<namespace>/<number>.json`; also
confirm that the destination's SHA-256 still equals the source ledger's
recorded SHA-256. If any check fails, preserve both files and stop.
Unlink the source only after all checks pass. If the unlink fails, preserve both
files and report the error. The destination `<namespace>/<number>.json` is
authoritative only while its recorded identity and SHA-256 still match; treat
the source as a preserved, non-authoritative duplicate and perform no further
ledger writes. If the destination cannot be verified, stop without using either
copy.
**A review that cannot finish.** A storage stop, an unowned or conflicting
ledger, a failed first ledger, a copy that does not match its source, or a
failed source unlink means the review cannot finish. After a failed source
unlink, only the verified destination ledger at the canonical path recorded in
the identity record is authoritative; preserve the source duplicate and stop
all writes. The target is then not published as reviewed: its drafts go into a
draft carrier marked `Review: not reviewed` (see [Draft carrier](#draft-carrier)),
and the final message reports the namespace path, exact failing evidence, and
the drafts' local paths.
**Scope.** The procedure never automatically deletes an older or abandoned
namespace and adds no durable session registry. A lost identity record is not
permission to guess the supplied root or reuse another session's namespace.
Missing-worktree recovery is operator-only as described above. The procedure
may remove only a newly created entry whose recorded identity still matches, as
stated above.
Structural checks and a live run differ: the repository tests in
`tests/consistency.test.mts` confirm that these rules stay written in the
bundle, but they never run an authoring session. Only a live authoring run shows
that the storage procedure allocates a namespace and writes a ledger.
## Mechanical pre-publish gate
Before publishing a drafted `ready` **orphan, roadmap, or sub-issue**
body (the linter's `orphan|roadmap|child` shapes), run the
`audit-authored-issue` linter
(`scripts/audit-authored-issue.mjs` / `bin/idd-audit-authored-issue.mjs`)
against it when a helper runtime is available. Before publishing a draft
carrier (the `carrier` shape, described below), also run it with
`--shape carrier`; a carrier is never published without that check.
Before newly publishing
a body into the `needs-decision` or `blocked-by-human` bucket instead,
also run it, adding `--expect-bucket <needs-decision|blocked-by-human>`
(choose the one matching value) — without it, the marker/label checks
that key off `authoring-bucket` never fire, since a non-ready body is
otherwise never run through this gate at all (the exact gap #2636/#2637
hit). Passing `--expect-bucket` also skips the ready-shape-only checks
(the suitability footer and required headings) that a bucket body is
not mechanically required to carry; bucket-specific body structure is
checked by the completed-draft review instead. It mechanically
re-checks a subset of the structural rules this document states in
prose — the autopilot-suitability marker's exactly-one/coherent-value
rule, the one-directional check that a suitability score of `1` (or an
`authoring-bucket: blocked-by-human` marker, when present) carries the
configured `blocked-by-human` label (it does not check the reverse:
a non-`1` score paired with the label still passes), the equivalent
one-directional check for `authoring-bucket: needs-decision` and the
configured `needsDecisionLabelName` label, markerPrefix
consistency across every authoring marker, the declared shape's
required section headings, the roadmap-id/blocked-by dependency-marker
rules, and visible/hidden line agreement for the suitability and effort
footers.
For every `needs-decision` lint — initial Stage 1 publication, held-body
re-lint, and the Stage 2 release checklist — pass
`--expect-bucket needs-decision` and both configured labels: authoring
and needs-decision. The same applies to a `blocked-by-human` lint with
its matching expected bucket and labels. The gate also validates every
live defer-source comment against the shared defined-value set and
requires exactly one `Refs` origin. For `review-needs-decision`, pass
`--origin-issue <number>` matching that `Refs` issue; the check also
requires the configured authoring label and needs-decision bucket marker.
It also emits a **failing** finding, `dependency-line-grammar`: a
`Blocked by`/`Depends on` mention that the shared line-anchored grammar
(`dependency-grammar.mjs`, the same grammar every Discover helper uses)
would never resolve as a real dependency fails the audit outright,
naming the offending line number. This covers a mid-line mention (the
keyword appears after other prose, or hidden inside an HTML comment), a
near-miss line at the otherwise-correct position (an emphasis-wrapped
keyword, a hyphenated/camelCase spelling such as `Blocked-by` or
`BlockedBy`, a full-width colon, or a Markdown-link reference instead
of the three plain forms the grammar accepts), and a cross-repository
token on an otherwise well-formed line — the last one only when the
caller supplies `--current-repo` and it does not match, since without
that context a qualified reference is treated as unverifiable rather
than malformed (mirroring how the `roadmap-tracks-parse` check below
already treats an unverifiable qualified reference elsewhere in this
same file). A real `<!-- <marker-prefix>-blocked-by: ... -->` roadmap
marker is never mistaken for a near-miss, even when its own value
happens to look like an issue reference (e.g.
`<!-- idd-skill-blocked-by: #12 -->` — the extractor behind this
marker accepts any non-whitespace value, with no format restriction):
the check masks every well-formed marker of this shape out of its
near-miss scan before running it, using the same pattern the marker's
own extractor matches against, so the marker's value is never read as
the required trailing reference in the first place.
For the `orphan` and `child` shapes, it also runs the same A4 viability
and A4.5 suitability evaluators the IDD discover phase runs later, at
claim time (`triage-title-missing`, one `triage-a4-<criterion id>`
finding per A4 criterion, and one `triage-a45-<check id>` finding per
A4.5 check) — so a body that would fail A4 or A4.5 at claim time is
caught here, before it is ever published, instead of only after.
`triage-a45-duplicate_or_superseded` (Check 4) always reports "not
applicable" (it needs a live repository, which this offline linter never
has); the `roadmap` shape reports every one of these findings as not
applicable, since Discover never routes a roadmap node through A4 or
A4.5 in the first place. A title is required for these checks to
actually evaluate: pass `--title`, or lead the drafted body with a
`# <title>` line; without either, `triage-title-missing` fails and every
`triage-a45-*` finding reports "not evaluated" instead of a noisy Check
2/Coherence cascade (the three `triage-a4-*` findings still evaluate
normally, since A4's criteria are title-independent). With
`--expect-bucket`, a failing triage finding is downgraded to a warning
instead of failing the report, mirroring how this linter already treats
a bucket body as deliberately non-ready everywhere else.
For the `carrier` shape, the linter checks a **draft carrier**: an issue
that holds drafts which cannot yet be published as their final issues,
labelled with the configured authoring-only label. Its five checks
(`carrier-marker`, `carrier-forbidden-markers`,
`carrier-release-condition`, `carrier-drafts`, and `carrier-label`) and
the required `## Release condition`, `## Drafts`, and `## Review ledger`
headings are defined in the contract's
[Mechanical pre-publish gate](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#mechanical-pre-publish-gate)
section. A carrier is never an execution candidate, so every triage
finding reports "not applicable" for it.
For the `confirmation` shape, the linter checks an **auto-decide confirmation
issue**: an issue that records one stop an autonomous session decided, for the
operator to confirm by closing it. Its markers, body headings, trust rules, and
the `--confirmation-record` mode are defined in the contract's
[Auto-decide confirmation issue](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#auto-decide-confirmation-issue)
section. It needs `--current-repo`, takes no `--expect-bucket`, and exits `0`,
`1`, or `2` as the other shapes do.
It also emits one **advisory, warning-severity-only** finding
(`prose-dependency`): it flags an issue/PR reference (`#<digits>` or a
full GitHub issue/PR URL) used near coordination language (for example
"before", "after", "once", "until", "predates", "gate"/"gated",
"requires", "lands first") with no corresponding encoding for that
reference as one of three recognized forms — a `Blocked by #NNN` line,
a `Depends on #NNN` line, or a task-list checkbox item (`- [ ] #NNN`,
which counts regardless of which heading it sits under, so a roadmap's
own `## Tracks` membership list already satisfies this) — the
prose-only hard-precondition pattern the
[Hidden human-dependency validation](#hidden-human-dependency-validation)
check above warns about. A full-URL reference naming a different
repository is never flagged when the caller supplies the current
`owner/repo` (`--current-repo`, defaulting to `$GITHUB_REPOSITORY` in
CI) — a cross-repo dependency cannot be encoded with these
repository-local markers, so flagging it would recommend an impossible
fix; without that context a full-URL reference is still flagged by
default, unless its number happens to already match a local dependency
marker elsewhere in the body. A Markdown link's target may also carry
trailing content between the issue/PR number and the link's closing
paren — a URL fragment (`#issuecomment-123`), a trailing `/`, or a
quoted link title (`"..."` or `'...'`) — and is still recognized as one
link match rather than leaking its label's bare `#NNN` through to the
bare-`#` check. A local `owner/repo#N` shorthand (e.g.
`kurone-kito/idd-skill#4321`) is recognized too, but with the reverse
default from the full-URL case: it is flagged only when
`--current-repo` is supplied and case-insensitively matches
`owner/repo`; a different repository, or no `--current-repo` at all,
always excludes it. A reference-style Markdown link (`[text][ref]` with
a separate `[ref]: target` definition elsewhere in the body) is
recognized the same way as the inline-link form, including the same
`currentRepo` comparison; a `ref` with no matching definition falls
through to the bare-`#` check like any other unrecognized shape. A
quoted link title may contain a backslash-escaped quote matching its own
delimiter without ending the title early. An empty or whitespace-only
`--current-repo` (or `$GITHUB_REPOSITORY`) is treated the same as
omitting it, not as a known repository that can never match. A
nested/child list item's reference is evaluated together with its full
ancestor chain's coordination-language text instead of being scoped away
from it, while a same-depth sibling bullet still starts its own separate
scope. This holds for every nested child under a given parent, at any
depth -- not only the first. A continuation line resuming at an
ancestor's own indentation, after a deeper child has already opened, is
attributed to that ancestor rather than the deepest open child. A loose
list (a blank line between sibling items) preserves the same ancestor
scope across the blank line, as long as the following item's own marker
is no deeper than whatever is still open at the end of the preceding
item -- a same-depth sibling, or a resumption at a shallower ancestor's
own level -- and the preceding item ends in a list marker rather than
trailing plain prose (once plain prose follows the last marker, the
list reads as already having ended, so the blank line is not bridged).
A blank line directly followed by a more deeply indented marker is also
not bridged, to avoid grafting an unrelated item onto an open ancestor
as a false child. A
`prose-dependency` warning never flips `passed` to
`false` and never changes the linter's exit code; it prompts the author
to convert the prose into a proper dependency marker or consciously
confirm the reference is a mere breadcrumb.
For the `orphan` and `child` shapes, it emits a second **advisory,
warning-severity-only** finding, `required-edit-candidate-files`. A
required edit is a bullet that begins `Required edit:` and names one
backticked repository path. The finding names, in one warning, each such
path that `## Candidate files` does not list, because the effort limit
counts only the listed paths (a body that named a required edit and left
it out of the list was observed on closed issue `#4809`). It reads the
first backticked path of a bullet, including the bullet's wrapped
continuation lines, ignores a bullet quoted in a code block or an HTML
comment, and never warns a body that has no such bullet. The audit still
passes: the warning never flips `passed` to `false`, never changes the
linter's exit code, and never adds the path to the effort count. The
contract's
[Candidate files format](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#candidate-files-format)
section defines the bullet.
```sh
node scripts/audit-authored-issue.mjs \
--shape <orphan|roadmap|child|carrier|confirmation> \
--marker-prefix <resolved-target-prefix> \
--config <target-checkout>/.github/idd/config.json \
--title <drafted-title> --body-file <path-to-drafted-body> \
[--label <label>]... [--expect-bucket <needs-decision|blocked-by-human>]
```
**Always pass `--config`** with the target repository's
`.github/idd/config.json`, as with `--marker-prefix`. The linter reads that
file from the working directory by default. When the file is absent or
unreadable, `effortL` falls back to `allow`, so `effort-l-ready` would not
refuse an `L` body (preventive; no observed incident yet).
Omit `--title` when the drafted body already leads with a `# <title>`
line; for the `orphan` and `child` shapes, at least one of the two is
required for the `triage-a45-*` findings above to actually evaluate.
**Always keep `--marker-prefix`, and always replace the placeholder**
with the resolved target prefix before running the command — in this
source repository that value is `idd-skill` (already the
`.github/idd/config.json` default here, so the flag is redundant only
in this one repository), but auditing any other repository requires
substituting that repository's own prefix. Never copy the literal
`idd-skill` value into another repository's audit command. Omitting the
flag entirely is unsafe everywhere: without it, the linter falls back
to reading `.github/idd/config.json` from the current working
directory and silently defaults to `idd-skill` when that file is
missing or unreadable, producing a false pass or fail against the
wrong prefix instead of an error. See the bundled `contract.md`'s
[Target marker prefix](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#target-marker-prefix)
section for the adopter-facing prefix-resolution rule.
**No helper runtime available (`instructions-only` profile).** The
linter cannot run without Node.js and the vendored `scripts/`
directory, and `instructions-only` is a first-class supported fallback,
not a waiver — manually re-verify the same checks against this
document's prose and the [Draft schemas](#draft-schemas) before
publishing. A draft carrier has no manual route: without a helper runtime
it cannot be published (see [Draft carrier](#draft-carrier)).
A `passed: false` report (or non-zero exit, or a failed manual
re-verification) means the draft is not ready to publish yet. The
linter (or its manual equivalent) is a mechanical structural check, not
a substitute for the judgment-based checks above (human-dependency
isolation, codebase fidelity, reuse-first) — passing it is necessary,
not sufficient, for `ready`. See the bundled `contract.md`'s
[Mechanical pre-publish gate](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#mechanical-pre-publish-gate)
section for the adopter-facing version of this rubric.
## Authoring label lifecycle
The issue authoring skill must use the configured authoring label as
both the **draft marker** for held issues and the **claim-suppression
lock** that keeps Discover from selecting them, while it creates or
updates issues. The label name comes from
`issueAuthoring.authoringLabelName`, with `status:authoring` as the
distributed default.
`src/scripts/audit-authored-issue.mts`'s `authoring-owner-marker-trail`
check mechanically verifies, from pre-fetched comment data a caller
supplies, that an authoring-labeled issue carries a valid owner marker
and (for a newly created issue) the publication-token trail this
section defines -- structural/shape checking only, not the live
trust/permission re-verification the runtime protocol below still
owns. The module stays network-free; no caller currently wires it into
the publish flow below (Refs #2621, non-blocking).
During Stage 1 (author-and-publish), the skill must ensure the label
exists in the target repository before first use. For the bundled
GitHub CLI publication flow, create a missing label with
`gh label create` before applying it. Failure to create or apply the
label is a publishing blocker, not a warning.
For a `review-needs-decision` follow-up, use the additional label and
release rules in the narrow auto-release exception below.
For existing issues, apply the authoring label before updating issue
content. For new issues, require a capability-checked publication command
that creates the issue with the authoring label atomically and carries an
exact hidden publication token for target, anchor, set, and session, such as
`gh issue create --label` when the bundled GitHub CLI flow can use it. If the
target runtime cannot provide that operation, stop before creating the issue.
That stop leaves the drafts local under the second exception in
[Draft carrier](#draft-carrier), as the journal stop below does.
Never intentionally create an unlabeled issue for the
Stage 1 set. If an allegedly atomic request unexpectedly returns an
unlabeled issue, re-fetch its labels, body, current `claimed-by` state, and
paginated owner-marker log before closing. If a trusted claim or owner marker
from another session or set is present, do not close or overwrite the exposed
issue; report the ownership conflict and stop. If no competing claim is
present, apply and verify the authoring label as a safe hold, then re-fetch the
claim and owner logs again before closing. If that hold or final re-read cannot
be verified, leave the issue open and report the recovery hold. Deletion needs
admin permission the authoring agent typically lacks (and
`docs/permissions.md` forbids for normal IDD), so it is not the default
recovery path.
Generate the opaque `target` id and token for both markers below -- the
new issue's own number is not yet known. `anchor` in **both** markers
depends on the new issue's role in the set, not on a blanket "not yet
known" rule: when this new issue is itself the set anchor, `anchor`
reuses that same opaque `target` value (self-reference, since the
anchor's own number is equally unknown at this point) -- the
template's `<opaque-anchor-id>` placeholder below depicts this
self-anchor case only. For a **non-anchor child**, `anchor` is instead
the set anchor's **already-resolved real** `<owner>/<repo>#<number>`
reference, not an opaque id, since the anchor already exists with a
known number by the time a child is created. See also the CLI
`--help` text's `authoring-owner`/`authoring-publication-intent`
shape notes (`bin/idd-post-idd-marker.mjs --help`) for the related,
but not identical, per-marker-type distinction those two carry.
The exact hidden publication token is an HTML-first body line carried by the
atomic create:
```html
<!-- <marker-prefix>-authoring-publication: target=<opaque-target-id>; anchor=<opaque-anchor-id>; set=<opaque-set-id>; session=<opaque-session-id>; token=<opaque-publication-token> -->
```
The originating Stage 1 hold uses this append-only publication-intent
record, whose `anchor` field follows the same self-anchor/non-anchor-child
rule above:
```html
<!-- <marker-prefix>-authoring-publication-intent: target=<opaque-target-id>; anchor=<opaque-anchor-id>; set=<opaque-set-id>; session=<opaque-session-id>; token=<opaque-publication-token>; journal=<owner>/<repo>#<number>; issue=<owner>/<repo>#<number>|none; actor=<trusted-marker-actor>; state=<pending|member|cleanup|abandoned> -->
```
Append the visible note below immediately after this HTML comment, joined by
a single newline (no blank line between them, matching the `authoring-owner`
marker's own posted shape) -- this exact pairing is the canonical rendered
template `matchCanonicalAuthoringMarkerFamily` (`marker-helpers.mts`)
matches for the hide-on-supersede step below. Historical comments predating
this canonical pin may use a different separator, note text, or no note at
all (#2750); those never byte-exact-match the canonical template and are
correctly left visible -- expected fail-closed behavior, not retroactive
cleanup:
```text
_Issue-authoring publication-intent record. Do not edit or delete._
```
`issue` is the returned canonical issue identity or `none`. Append
`state=pending; issue=none` before creation, then append the returned identity
while it remains `pending`, append `member` only after the owner marker is
verified, and append `cleanup` before any safe-close mutation. Append
`abandoned` only after closed/label-absent verification. On resume, paginate
the hold log and select the latest valid record for the exact token tuple;
missing, conflicting, or out-of-order records fail closed, while `pending`
and `cleanup` remain recovery holds. When the originating hold is in a retired
journal (listed in `issueAuthoring.retiredJournalIssues`), paginate
`journalIssue` and every listed retired journal, and merge the records in time
order before selecting.
`journal` is the durable record location. For an existing set, use the
verified originating Stage 1 hold, or `issueAuthoring.journalIssue` when that
hold is in a retired journal; for a standalone set with no existing issue
or anchor, use the repository-level authoring journal target configured at
`issueAuthoring.journalIssue` in `.github/idd/config.json` (an
`owner/repo#number` reference to a pre-existing, durable, comment-only issue)
-- an unset `issueAuthoring.journalIssue` only blocks a standalone set; an
existing set with a verified Stage 1 hold needs no journal configuration at
all. Do not create that journal as part of the same set. If the applicable
location cannot be resolved -- no verified Stage 1 hold for an existing set,
or `issueAuthoring.journalIssue` unset or unverifiable for a standalone set --
stop with `blocked-by-human` before creating any target. On every paginated
replay,
require `actor` to equal the API author and verify that actor is a trusted
marker login with the required write-level permission or configured bot/app
trust. An untrusted, malformed, or conflicting exact-token record is not valid
evidence; fail closed and retain the hold.
Generate the opaque `target` id and token before creation because the new
issue's own number is not yet known, and generate `anchor` the same way
only when this new issue is the set anchor itself -- otherwise reuse the
anchor's already-resolved real reference, per the self-anchor/non-anchor-child
rule above. Before issuing the create, persist those
preallocated IDs, the exact token, and `state=pending` in that journal. After a
successful create, attach and verify the returned issue
identities on that pending record before appending the owner marker. If the
pre-create hold write cannot be verified, do not create; if the post-create
identity attachment cannot be verified, leave the returned issue held for
recovery. Transition that record to `member` only after the owner marker is
verified, or to `abandoned` only after the verified safe close and label
removal. On resume, match the exact token and persisted identities; an
incomplete scan or state mismatch is a recovery hold.
Immediately after a new issue is created and its authoring label is applied,
append a `mode=acquire` owner marker with the current set ID and a new owner
token. Re-fetch labels, body, and owner comments before treating the issue as
a set member. If marker append or verification is uncertain, reconcile the
returned comment ID and the paginated owner-marker log with bounded retries
before closing. If a trusted marker is found, retain the label and recover or
reopen the issue as a set member. Otherwise re-fetch labels, body, current
`claimed-by` state, and the paginated owner-marker log; if that final read
proves no competing claim or owner marker, append `state=cleanup` before
closing the issue or removing its authoring label. Re-fetch and verify
closed/label-absent state, then append `state=abandoned`. If any disposition or
cleanup read is uncertain, retain `state=cleanup`, leave the issue held, and
report the recovery hold.
An atomically labeled publication is not set membership until its owner marker
is verified. Persist each returned target identity in the durable journal before
appending the marker; when the set's originating hold is in a retired journal,
persist it in `issueAuthoring.journalIssue` instead. On resume, reconcile
recorded identities and only issues carrying this set's exact publication
token; an incomplete scan or unmarked match is a recovery hold, so never infer
membership or completion from the shared label alone.
### Per-target ownership and conflict handling
The configured authoring label is a shared **claim-suppression lock**, not
a session owner token. Before editing an existing issue or roadmap, take a
fresh target snapshot and resolve its complete claim state, including trusted
forced-handoff successors and activation-nonce winners, plus its active
`claimed-by` and open-PR state. A trusted forced-handoff successor is active
even without a new `claimed-by`; any active execution is a conflict, so do not
establish the hold. Apply the label if it is absent, and append a hidden owner
comment using the resolved marker prefix:
```html
<!-- <marker-prefix>-authoring-owner: target=<owner>/<repo>#<number>; anchor=<owner>/<repo>#<number>; mode=acquire|resume|bootstrap|heartbeat|release|release-guard|release-complete; owner=<opaque-owner-token>; set=<opaque-set-id>; session=<opaque-session-id>; body-sha256=<64-lowercase-hex|none>; snapshot-sha256=<64-lowercase-hex|none>; supersedes=<opaque-owner-token|none> -->
```
_Issue-authoring ownership marker. Do not edit or delete._
Join the HTML comment and the visible note above by a single newline (no
blank line between them) -- this exact pairing, for any `mode`, is the
canonical rendered template `matchCanonicalAuthoringMarkerFamily`
(`marker-helpers.mts`) matches for the hide-on-supersede step below.
Historical comments predating this canonical pin may use a blank-line
separator instead (#2750); those never byte-exact-match the canonical
template and are correctly left visible -- expected fail-closed behavior,
not retroactive cleanup.
The companion uses the same `body-sha256` and `snapshot-sha256` semantics as
the portable owner protocol. Target markers hash the exact UTF-8 body from the
fresh read immediately before posting; anchor-only `release-guard` uses
`body-sha256=none`, while anchor-only `release-complete` carries the required
canonical set snapshot digest. Persist the per-target body digests and
snapshot inputs in the originating hold and re-fetch/recompute them before
accepting completion. For `snapshot-sha256`, compute the SHA-256 digest over
the UTF-8 bytes of the whole target set's
`<owner>/<repo>#<number>:<body-sha256>` lines. Normalize each `<owner>` and
`<repo>` component with
`NFC(Unicode-default-lowercase(NFC(component)))`, join them with `/`, and
serialize each line with that normalized identity. Sort by the identity's
unsigned UTF-8 byte sequence (shorter equal prefixes first), then issue
number ascending, and join with a single `\n` and no trailing newline. New
markers missing these fields are not valid for a new generation; legacy
markers are migration input only. A legacy marker cannot prove completion
until its target body and required snapshot are re-fetched and recomputed
with the canonical algorithm. For this migration check, that algorithm is
the SHA-256 digest of the UTF-8 bytes of
`<owner>/<repo>#<number>:<body-sha256>` lines after normalizing each
owner/repository component with
`NFC(Unicode-default-lowercase(NFC(component)))`, joining the normalized
components with `/`, sorting by unsigned UTF-8 identity bytes (shorter
equal prefixes first) and then issue number ascending, joining with one
`\n`, and omitting a trailing newline. When the stored snapshot digest
matches that recomputation, the current verification may accept it.
Missing, mismatched, or otherwise unverifiable evidence fails closed.
This legacy-marker behavior is preventive; no observed incident yet.
Verify the returned comment ID and body after posting, then re-read the active
claim and open-PR state again. If execution began during acquisition, stop
without editing and leave the verified hold for explicit recovery.
Owner tokens are per target: never compare a child target's `owner` value
literally with the anchor's `owner` value. Every owner-marker log read for a
target or anchor must use paginated issue-comment retrieval (for example,
`gh api --paginate` or an API equivalent) and deterministic GitHub comment
order (`created_at`, then comment ID); never rely on a single API page.
Append this HTML-first body with a direct JSON `POST` to the issue-comments
endpoint; do not rely on `gh issue comment` or `gh api -f body=` for the owner
marker. Verify the returned comment ID and body after posting.
Resolve the set anchor before appending any target marker. `anchor` records
the canonical owner/repository/issue identity of that anchor; the anchor's
own marker uses its `target` as the `anchor`, and every other marker in the
set repeats the same value. A missing or mismatching `anchor` makes a marker
invalid for set membership, resume, or release. A legacy marker without an
anchor cannot resume a multi-target set; when no parent roadmap identifies the
anchor, stop and bootstrap a fresh explicitly designated anchor instead of
choosing a different lead implicitly.
Only a trusted target-repository marker actor makes a marker valid: the
current authenticated actor after posting and verifying it **and** passing a
Write/Maintain/Admin permission check, a configured trusted bot or app, or an
explicitly enabled Write/Maintain/Admin collaborator. Comment-only access is
insufficient. If permission cannot be verified and no explicit bot/app trust
applies, ignore and report the marker; syntax alone never grants ownership.
For an owner marker that must support a later session, the author's trust must
also be re-evaluable from a durable policy: a login in `trustedMarkerActors`, a
configured trusted bot or app, or an explicitly enabled collaborator whose
current permission can be re-read. The current-session actor path is
provisional and cannot make a historical marker trusted by itself. Without a
durable trust source, leave the label and hold in place and report recovery;
do not treat the marker as set membership or ownership evidence.
For `acquire`, `bootstrap`, and `resume`, `owner` is a newly generated
opaque per-target owner token; `supersedes=none` for `acquire` and
`bootstrap`, while `resume` names the prior owner token. For `release`, keep
the current owner token in `owner` and set `supersedes` to that same current
owner token; `supersedes=none` is invalid for a release marker.
For `heartbeat`, retain the current owner, set, and anchor, set `supersedes`
to that same owner token, and do not open or close a generation; it only
renews the current owner's freshness.
`release-guard` is valid only on the set anchor. It retains the anchor's
current owner, set, anchor, and session, and sets `supersedes` to that owner
token. Append and reconcile it after release-marker preflight but before the
first label removal. It is the Discover-visible guard for a provisional set
release: it does not close any generation, and it remains active until the
anchor's durable `release-complete` marker is reconciled.
`release-complete` is valid only on the set anchor. It retains the anchor's
current owner, set, anchor, and session, and sets `supersedes` to that owner
token. Append and verify it only after every target's release marker and label
removal has been verified. It is the durable terminal event for the set: a
later reapplication of the authoring label must start a fresh set generation
rather than resuming the completed set.
Within an open generation, the first valid acquisition, bootstrap, or
resume marker by GitHub comment order wins. A
`resume` marker opens a new generation only for the exact interrupted set
and matching prior owner token. A `release` marker must match the current
owner and set, but remains provisional while its set release is in
progress; an individual label removal never closes that target's
generation. During the owning set's own Stage 2 (observed 2026-09-09,
kurone-kito/idd-skill#2791), the heartbeat renewal and the pre-removal
ownership recheck must treat that set's provisional `mode=release`
markers and the anchor's `mode=release-guard` as the expected state
rather than as a competing generation; the acquisition-time rule that
a target carrying a release marker cannot be re-acquired until that
release's `release-complete` is found applies to a later session's
fresh acquisition of the child, not to the releasing set's own
rechecks or to a resume of the exact interrupted set, which stays the
established recovery path when `release-complete` is missing; the
releasing set's own rechecks never change the current winner, unlike
a valid resume marker for that exact set, which does. Only after a
fresh re-read
verifies every target's release marker
and label removal and the anchor's `release-complete` marker does the set-level
release close all target generations, after which a later `acquire` starts a
new generation. The
active generation's freshness is the GitHub `created_at` of
its latest trusted acquisition, bootstrap, resume, or heartbeat marker; a
resume marker refreshes that clock, and the label event alone never
supersedes a fresh owner marker.
The current generation's winner owns the target; any other session must stop
without editing and leave the label in place. Owner comments are append-only
and must not be edited or deleted.
For a new Stage 1 set, generate one opaque set ID and reuse it in every owner
marker for that set. When resuming an interrupted set, recover and verify its
persisted set ID from the exact trusted owner markers and reuse it instead of
generating a replacement. Persist the resolved anchor identity in every marker
as well. Before resuming, enumerate the anchor's `## Tracks` and a
repository-wide paginated issue-comment scan scoped to trusted owner markers
whose exact `anchor` and `set` match; merge the results by comment order and
block if enumeration is incomplete. These append-only comments are the durable
set, anchor, and target membership record; a resume may include only targets
whose valid markers identify that exact set and anchor. Never infer set
membership or the anchor from the shared label alone.
A non-anchor target cannot prove that its previous set finished from its local
owner-marker log alone. Before accepting a fresh `mode=acquire` for a child
whose prior generation has a `mode=release` or `mode=release-guard` marker,
follow its exact persisted `anchor` identity and fetch that anchor's paginated
owner-marker log. Require a trusted `mode=release-complete` marker for the
exact anchor/set/session generation represented by the child's current release
marker, including the current anchor owner for that release generation; never
accept an older or newer set's completion. Owner tokens are per target, so do
not compare the child owner token literally with the anchor owner token. If the
completion marker is absent, malformed, or cannot be fetched conclusively,
treat the prior release as interrupted: do not acquire the child as a new set,
and instead resume that exact set or leave its hold in place. A child log, an
absent label, or a session-local read is never completion evidence. Once the
anchor completion is reconciled, the old set is closed and a new acquisition
may start a new generation.
Acquire one set anchor before acquiring any other target: when the set has a
parent roadmap, first publish a valid roadmap shell under the authoring hold,
with all required roadmap headings/markers and an empty `## Tracks` list
allowed only until child issue numbers exist; then acquire and verify that
roadmap as the set anchor. Only after that anchor is verified may the session
publish and acquire child targets, and it must wire their real numbers into
`## Tracks` before release. When no parent roadmap exists, use the designated
lead target as the anchor. The anchor winner serializes acquisition for the
whole set; no session may publish or acquire children independently. Before
each child acquisition or resume, append and verify a same-owner heartbeat on
the anchor (or reuse one per the coalesce rule below), re-fetch the anchor's
paginated log, and require its current owner token, set, anchor, and session.
Append the child marker only after that validation, then immediately re-fetch
both anchor and child and require the same anchor ownership; if either read
changes, leave the child hold in place and stop rather than forming a split
set. If any target cannot be acquired under that anchor, stop all body and
relationship edits, leave labels and append-only markers in place, and
require an exact verified resume of that set rather than allowing a split
ownership set.
After each `acquire`/`resume`/`bootstrap` marker POST, wait the configured
`claim.verifySettleDelay`, replay the full paginated log, and choose the
winner by deterministic comment order; an immediate local read never
authorizes edits. Apply the same settle delay and full paginated replay after
every heartbeat before it authorizes an edit or label removal.
**Heartbeat coalescing (`issueAuthoring.heartbeatCoalesceWindow`, default
`PT2M`, #2768).** Before appending any heartbeat at this document's three
heartbeat sites (the anchor heartbeat above, the pre-edit heartbeat below,
and Stage 2's pre-label-removal heartbeat further below), first replay the
target's paginated owner-marker log. Reuse the latest trusted marker instead
of appending a new one when **all four** hold: it is for the same owner, set,
and session; its `mode` is `acquire`, `bootstrap`, `resume`, or `heartbeat`;
its GitHub `created_at` is younger than the configured window; and its
`body-sha256` equals the digest of the body just fetched. Re-fetch and verify
the reused marker exactly as a freshly posted one would be -- only the
redundant POST is skipped, never the replay or ownership verification. Any
other case -- an older marker, a different owner/set/session, a mode outside
that list, a changed body digest, or the marker cannot be found conclusively
-- keeps today's append-and-verify path. This window never applies to
`acquire`, `bootstrap`, `resume`, `release`, `release-guard`, or
`release-complete` markers; only a `heartbeat` append may be skipped.
**Hide superseded owner/publication-intent markers.** Opportunistic: see
the mandatory Stage 2 sweep below for the mechanism this contract
actually relies on. Measured 2026-09-11 across 22 issues published
after this per-post step first shipped (#2750/#2821): of 95
expected-hideable `authoring-owner`/`authoring-publication-intent`
comments, only 3 (about 3%) were actually minimized (#2896). Following
this step in the moment is correct and still worth doing when
convenient -- every comment it hides is one the Stage 2 sweep below does
not have to -- but it is not something this contract can depend on by
itself: a step invoked 3-9+ times per issue, buried mid-protocol with no
mechanical enforcement, is too easy to skip under load. Once a fresh
`authoring-owner` marker (any `mode`, including the first, generation-opening
`acquire`/`bootstrap`) or `authoring-publication-intent` record (any `state`)
has been posted and its own POST and re-fetch/verify above have both
succeeded -- never before, and never interleaved with posting -- scan that
same target's prior comments (the target issue for `authoring-owner`; the
journal issue named in the record's own `journal` field for
`authoring-publication-intent`, which naturally also fetches other
authoring sets' records on that shared journal -- intentional, since the
journal read path is the same paginated scan either way, but the
continuity-chain-identity restriction below means only the just-posted
record's own target (and, for `authoring-publication-intent`, its own
token too) is ever eligible for minimization, never a different set's)
and minimize (classifier `OUTDATED`) every prior
comment from a trusted marker actor whose body is a byte-exact match of the
canonical rendered template for the same marker family AND shares the
just-posted record's own continuity-chain identity (`target=` alone for
`authoring-owner`; `target=`+`token=` together for
`authoring-publication-intent`) -- on the journal-hosted
`authoring-publication-intent` family this excludes a different target's
record on the same shared journal, and a same-target record under a
different token, even though both byte-exact-match the family template;
this matches the mandatory Stage 2 sweep's own fixed classifier
(`classifyAuthoringMarkerFamily` in `marker-helpers.mts`) so the two
procedures never disagree about which prior record is eligible.
`matchCanonicalAuthoringMarkerFamily` (`marker-helpers.mts`, re-exported by
`protocol-helpers.mts`) implements the byte-exact-template half of that
check: it parses the candidate, re-renders the parsed fields with
`renderAuthoringOwnerMarker` / `renderAuthoringPublicationIntentMarker`,
and requires the result to equal the candidate's body exactly. A
candidate that deviates from the template in any way -- reordered or
extra fields, altered spacing, trailing content, a different visible
note -- is never minimized; leave it visible rather than guessing. Apply
the continuity-chain-identity half directly: parse each byte-exact
candidate the same way (`parseAuthoringOwnerComment` /
`parseAuthoringPublicationIntentComment`) and compare its `target=` field
(plus `token=` for `authoring-publication-intent`) against the
just-posted record's own fields -- the identical field comparison
`classifyAuthoringMarkerFamily`'s own (module-private)
`resolveAuthoringMarkerIdentity` performs internally for the Stage 2
sweep. Skip the just-posted comment itself and any candidate whose
`isMinimized` is already `true` (idempotent; the minimize helper's own probe
already enforces this).
Convert each eligible candidate's REST comment id to its GraphQL node id
(the paginated comment list already carries it as `node_id` -- no extra
fetch needed) and call the existing minimize helper -- reuse it rather than
reimplementing the mutation:
```sh
node scripts/minimize-superseded-markers.mjs --subject-ids <id1,id2,...> \
--classifier OUTDATED --trusted-marker-logins <trusted-login-1,...> \
--apply
```
Or, for npx/package-manager profiles, the equivalent
`idd-minimize-superseded-markers` command.
This step is best-effort and never blocking: a permission error, an
unreadable comment list, or an unavailable helper runtime
(`instructions-only` profile, or Node.js absent) skips it silently and
continues the normal marker-posting flow unmodified -- it must never
retry-loop or fail the authoring flow. Mirrors
`docs/idd-comment-minimization.md`'s framing: this is UI cleanup only and
never replaces the append-only audit trail.
In scope: `authoring-owner` and `authoring-publication-intent` only. Out of
scope: `authoring-publication` -- a body-line token embedded in the newly
created issue's own body at creation time, not a comment, so there is
nothing to minimize -- and every marker family already covered by the
post-merge F4 cleanup driver (for example `claimed-by`, `review-watermark`,
`advisory-wait`; see `docs/idd-comment-minimization.md`). Do not add
`authoring-owner`, `authoring-publication-intent`, or `authoring-publication`
to `OPERATIONAL_MARKERS`, and do not fold this step or the Stage 2 sweep
below into the F4 driver: minimization for this marker family stays a
separate, earlier-lifecycle behavior owned by the issue-authoring
protocol itself, not the post-merge cleanup driver -- whether triggered
opportunistically here or mandatorily at Stage 2 release.
Immediately before every body or roadmap relationship update, re-fetch both
the target and the set anchor (the same fresh snapshot serves both roles when
the target is the anchor). Require each target's expected owner token
independently, plus the same set, anchor, and owning session, and require the
expected body/label snapshot on the edited target to remain unchanged. Also
re-read its active `claimed-by` and open-PR state; any active claim or open PR
is a conflict. An unexpected change, competing owner, malformed owner marker,
or inability to prove a unique owner on either target is a conflict: do not
overwrite the target, leave the authoring label in place, and record a safe
alternative.
Prefer an atomic acquisition helper when the target runtime provides one;
otherwise this append-only conflict check is mandatory, including for
`instructions-only` installs.
After that conflict check and immediately before the body or relationship
mutation, append and verify a trusted `mode=heartbeat` marker for the set
anchor first (or reuse one per the coalescing rule above), then re-fetch and
verify its current owner, set, anchor, and session. Only after the anchor
renewal succeeds, append and verify the edited target's heartbeat when it is
distinct (reuse applies here too), then re-fetch both and require each
target's expected owner token independently, plus the same set, anchor, owning
session, and expected target snapshot. If either heartbeat cannot be
posted/reused or verified, or a newer owner appears, stop without editing. A
heartbeat never starts a new generation and never authorizes release.
A target already held by another set is unavailable. A later session may
resume only when the invocation identifies the exact interrupted set and
the hold is past `issueAuthoring.authoringStaleAge`; append a `mode=resume`
owner marker with a new owner token and `supersedes` value matching the prior
owner token before repeating the acquisition check. For a stale held target
with no valid owner marker, append a trusted `mode=bootstrap` marker with the
current set ID, a new owner token, and `supersedes=none`; this starts a new
generation and is not evidence of any prior set membership. The first valid
bootstrap marker wins. Staleness alone never authorizes takeover: use the
latest trusted generation marker's GitHub `created_at` for marked targets, and
the label event only for legacy-unowned bootstrap. A competing active marker
still stops the session.
Publishing under this label needs no separate user approval: once a
drafted roadmap, child, or orphan body, including one published into
`needs-decision` or `blocked-by-human`, passes the completed-draft
adversarial review and then the mechanical `audit-authored-issue` gate,
the skill publishes it directly (see
[Approval boundary](#approval-boundary) below for the exceptions).
The held issue **is** the draft (a draft carrier's body is the exception:
it is never edited after publication) — in-place body edits, roadmap
relationship wiring (publish/acquire the roadmap anchor first, then
publish/acquire children and wire their real issue numbers), and re-lint of
already-published bodies all happen on
the published issue itself, under the same label, rather than in a
session-local buffer a later session cannot see.
These guards keep partially published issue sets visible to the IDD
discover guard while the full set is still being wired. If a session
is interrupted before the set is stable, leave the label and owner markers
in place. The label suppresses Discover while the markers preserve set
identity and target membership for a later verified resume; a later session
must not infer either from the label alone.
Remove the label from all published issues only after: the release
checklist passes — every child issue is referenced from its parent roadmap's
`## Tracks` list, no unsubstituted placeholder remains in any published
body, the `audit-authored-issue` linter (or its manual fallback) is green
on every published body in the set, and every `decision` ID listed under
`## Auto-decided choice` in a published body has a counting record, in any
state (the item fails while that read is unreadable) — and the user explicitly
requests
release from the authoring hold (see the
[Narrow auto-release exception](#narrow-auto-release-exception)
below for the marker-scoped exceptions to this precondition; when
`standingApprovals.release` is enabled, the
[standing release approval](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#authoring-hold-and-release)
is one more exception). Keep the
set anchor held until every other
target's label removal is verified, and remove the anchor label last. Every
label removal in this release, the anchor label included, and every restore that
follows uses `gh issue edit <number> --remove-label "<authoring label>"` or `gh
issue edit <number> --add-label "<authoring label>"`, with `--repo
<owner>/<repo>` outside the repository. The IDD template's opt-in Claude Code
baseline denies the `gh api -X DELETE` spelling and does not allowlist `gh api`,
so that spelling is not used (observed on issue #3841, 2026-10-08; see
issue #3898). First re-fetch owner comments during release-marker preflight.
#### Per-target release checklist
Use this checklist for an explicit-request release, after the Stage 2
checks above pass and the user's release request is verified. Each entry
names its command. The verify, re-fetch, reuse, and restore rules are in
[Authoring hold and release](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#authoring-hold-and-release)
and are not repeated here. Each post is a dry run unless it has `--apply`, so
preview it first. For an issue in another repository, pass `--owner` and
`--repo` to the helper and `--repo <owner>/<repo>` to `gh`. Run the
entries in this order: entry 1 for every target, entry 2 once, entries 3
and 4 for each non-anchor target in turn, entries 3 and 4 for the anchor,
and entry 5 last. The defer-source auto-release exception adds a
sole-member check before the first label removal. This checklist does not
cover that path; follow the contract for it. When `standingApprovals.release`
is enabled, the standing release approval replaces the verified user request
with conditions the contract owns, so that request precondition does not apply
to it; follow
[Authoring hold and release](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#authoring-hold-and-release)
for those conditions.
1. **Preflight, every target.** Run the contract's sweep against the target
and the journal first (attempted, not blocking, so the command ends in
`|| true`). Use `owner/repo#number` for a journal in another repository.
Add one `--issue` for each listed retired journal.
```sh
node scripts/sweep-authoring-markers.mjs --issue <target-issue-number> \
--issue <journal-issue-number> \
--issue <retired-journal-owner/repo#number> \
--marker-prefix <resolved-target-prefix> \
--trusted-marker-logins <trusted-login-1,...> \
--deadline-ms 300000 --apply || true
```
Then append the release marker only when the re-fetched owner log has no
valid `mode=release` marker for this owner and set. Otherwise reuse the
earliest matching comment ID.
```sh
node scripts/post-idd-marker.mjs --type authoring-owner \
--target issue <target-number> \
--marker-target <owner>/<repo>#<target-number> \
--anchor <owner>/<repo>#<anchor-number> \
--mode release \
--marker-owner <opaque-owner-token> \
--set <opaque-set-id> \
--session <opaque-session-id> \
--snapshot-sha256 none \
--supersedes <opaque-owner-token> \
--marker-prefix <marker-prefix> \
--apply
```
2. **Release guard, anchor, once per set.** Before the first label removal,
append or reuse this marker. Post it once for the set, not per target.
```sh
node scripts/post-idd-marker.mjs --type authoring-owner \
--target issue <anchor-number> \
--marker-target <owner>/<repo>#<anchor-number> \
--anchor <owner>/<repo>#<anchor-number> \
--mode release-guard \
--marker-owner <opaque-owner-token> \
--set <opaque-set-id> \
--session <opaque-session-id> \
--body-sha256 none \
--snapshot-sha256 none \
--supersedes <opaque-owner-token> \
--marker-prefix <marker-prefix> \
--apply
```
3. **Heartbeat, before each label removal.** Post the anchor's heartbeat
first. Then post the target's own heartbeat when it is a different issue.
Use the owner token of the issue named by `--marker-target`.
```sh
node scripts/post-idd-marker.mjs --type authoring-owner \
--target issue <number> \
--marker-target <owner>/<repo>#<number> \
--anchor <owner>/<repo>#<anchor-number> \
--mode heartbeat \
--marker-owner <opaque-owner-token> \
--set <opaque-set-id> \
--session <opaque-session-id> \
--snapshot-sha256 none \
--supersedes <opaque-owner-token> \
--marker-prefix <marker-prefix> \
--apply
```
4. **Label removal, one target at a time, anchor last.** Re-fetch the issue
after each removal and confirm the label is gone before the next target.
To restore a label, use the add form below.
```sh
gh issue edit <number> --remove-label "<authoring label>"
gh issue view <number> --json labels
# restore on failure:
gh issue edit <number> --add-label "<authoring label>"
```
5. **Release complete, anchor, once per set.** After every target's label
removal is verified, run the anchor sweep first, with the anchor as the
target:
```sh
node scripts/sweep-authoring-markers.mjs --issue <anchor-issue-number> \
--issue <journal-issue-number> \
--issue <retired-journal-owner/repo#number> \
--marker-prefix <resolved-target-prefix> \
--trusted-marker-logins <trusted-login-1,...> \
--deadline-ms 300000 --apply || true
```
Add one `--issue` for each listed retired journal.
Then compute `<snapshot-sha256>` with the set-snapshot algorithm in the
same contract section, and post the completion marker.
```sh
node scripts/post-idd-marker.mjs --type authoring-owner \
--target issue <anchor-number> \
--marker-target <owner>/<repo>#<anchor-number> \
--anchor <owner>/<repo>#<anchor-number> \
--mode release-complete \
--marker-owner <opaque-owner-token> \
--set <opaque-set-id> \
--session <opaque-session-id> \
--body-sha256 none \
--snapshot-sha256 <snapshot-sha256> \
--supersedes <opaque-owner-token> \
--marker-prefix <marker-prefix> \
--apply
```
After entry 5 closes the set, the contract's closing sweep runs once more.
It is not one of the five entries above; see its **Closing sweep** bullet.
**Mandatory release-time hide-on-supersede sweep (#2896, #2935).** At
this same point -- before the reuse-or-append decision below, so a
retried or resumed release (which reuses an existing `release` marker
and never appends a new one) still runs the sweep every time this
preflight step is reached -- run the single fetch-driven sweep command
against the target issue and every journal named in this session's own
records (`issueAuthoring.journalIssue`, and each retired journal listed in
`issueAuthoring.retiredJournalIssues`):
```sh
node scripts/sweep-authoring-markers.mjs --issue <target-issue-number> \
--issue <journal-issue-number> \
--issue <retired-journal-owner/repo#number> \
--marker-prefix <resolved-target-prefix> \
--trusted-marker-logins <trusted-login-1,...> \
--deadline-ms 300000 --apply || true
```
The trailing `|| true` keeps this step's own non-zero exit (a fetch or
mutation failure) from aborting an automated `set -e` release script:
the sweep's exit code exists for a caller that wants to check its
outcome directly, not to make this attempted-not-blocking step itself
block release when run inline (#2935 review, round 5, Copilot) -- read
the sweep's own JSON/table report, not its exit status, to see whether
anything needs a human look.
The journal setting can itself name a **different** repository (a full
`owner/repo#number` reference); when it does, pass that shape to
`--issue` instead of a bare number -- that one `--issue` is fetched from
its own repository while every bare-number `--issue` in the same
invocation still uses the current repository (or `--owner`/`--repo`,
given together or not at all). Or, for
npx/package-manager profiles, the equivalent
`idd-sweep-authoring-markers` command. One invocation performs the whole
sweep that used to be an ~8-step manual procedure (#2935): it fetches
each `--issue`'s comments via GraphQL (selecting `isMinimized` directly
-- REST's issue-comments endpoint never carries that field, so this
command never falls back to REST), classifies every comment with
`matchCanonicalAuthoringMarkerFamily` (`marker-helpers.mts`, unchanged),
determines "newest" only among **trusted-actor** matches sharing the
same continuity-chain identity within each family (`target=` for
`authoring-owner`; `target=`+`token=` together for
`authoring-publication-intent`) -- #3167: a different target's later
match, even under the same family and `set=`, is never treated as
superseding this one; #2896 review, Codex -- an untrusted actor's
later byte-exact comment
must never be mistaken for the live marker to keep, since
`minimize-superseded-markers.mjs` itself refuses to minimize any comment
outside `--trusted-marker-logins` regardless of this selection, so
wrongly treating the untrusted comment as newest would instead select
the legitimate trusted marker for minimization -- exactly backwards;
mirrors `checkAuthoringMarkerMinimizationBacklog`'s own audit-side
rule -- the two share one implementation, `classifyAuthoringMarkerFamily`
in `marker-helpers.mts`, so they cannot drift), excludes any candidate
already `isMinimized: true`, and minimizes (classifier `OUTDATED`) every
remaining eligible candidate in one mutation pass -- reusing
`minimize-superseded-markers.mjs`'s own `runMinimize` rather than
reimplementing the mutation. `--deadline-ms` bounds the WHOLE invocation
(every `--issue`'s own GraphQL pagination plus the final minimize pass,
for example `--deadline-ms 300000` -- five minutes), guarding against
the same degraded-GitHub-API risk a large, long-lived shared journal's
full history would otherwise pose.
Attempt this once per target here, and once more on the anchor
immediately before the release-complete preflight below; this is the
sweep the contract depends on, but "mandatory" means **attempted**, not
blocking -- a failed invocation (permission error, an unreadable comment
list, or an unavailable helper runtime) skips silently and never stops
release, matching the opportunistic step's own best-effort framing. See
the
[Closing sweep](#closing-sweep-after-stage-2-closes-2896-review-codex)
section below for the third sweep point this preflight sweep alone does
not cover, and for the explicit `authoring-marker-minimization-backlog`
invocation that makes each sweep attempt's outcome a visible, countable
signal instead of silence.
If a valid
current-owner/set `mode=release` marker already exists, reuse the earliest
matching GitHub comment ID; otherwise append one with `supersedes` equal to
the current owner token, re-fetch to verify it, and record its comment ID.
Complete that preflight for the whole set before removing any label. A retry
of an open generation must reuse the recorded or earliest matching marker and
never append an indistinguishable duplicate. Then, before removing any label,
append or reuse the anchor-only `mode=release-guard` marker and re-fetch the
anchor's paginated owner-marker log with bounded retries, requiring the exact
current owner, set, anchor, session, and marker body. If that guard is not
found conclusively, leave all labels in place and stop. The guard suppresses
Discover for the whole set during the provisional label-removal window; it
does not close the set. When this release is proceeding under the narrow
[defer-source auto-release exception](#narrow-auto-release-exception) (a draft
carrier or a confirmation issue follows the sole-member check of its own
creation-hold exception)
instead of an explicit human release request, also verify here -- immediately before
the first label removal below, whether that removal is a non-anchor
target's or the anchor's own -- that the marked target is the sole member
of its authoring set: it carries no `<marker-prefix>-roadmap-id` marker
(never a roadmap anchor), and the read-only `authoring-set-members` helper
reports that this target is the only issue whose trusted `authoring-owner`
marker carries that exact `set`:
```sh
node scripts/authoring-set-members.mjs --set <id> --issue <target>
```
The `--issue` argument bounds the search to the issues updated since the
target's own first trusted marker for the set, so the proof does not scan the
whole repository history.
A zero exit whose JSON has `soleMember: true`, `issues` equal to that
one target, and no `skippedMarkers` entry with `namesRequestedSet: true`
is the only passing result (an edited entry's flag reflects only the
comment's current text). A `requested-set` entry on the target itself is
that target's own hidden marker, which the sweep routinely leaves behind,
so it does not block; one on any other issue already changes `issues` or
fails the scan. The helper exits non-zero when
enumeration does not finish, including a search response with
`incomplete_results` or an index-lag window that does not finish.
The candidate search is the owner-marker token, so an edited marker
that dropped the set is still fetched and fails closed. An
unparseable trusted comment that still carries the token fails
closed too. A trusted marker whose target names a different
issue than the comment's host fails closed as well. Each such reason ends
with a pointer to how a maintainer clears the comment:
`docs/idd-comment-minimization.md#clearing-a-comment-that-blocks-the-scan`.
**Exception:** a trusted owner marker that GitHub has minimized
with `minimizedReason: outdated` (case-insensitive) is not counted
as a member, because it cannot prove current membership. When it is
the set's only marker on its own issue, the helper fails closed
instead, naming that issue and comment. `skippedMarkers` lists each
skipped marker that could bear on the requested set, and
`skippedElsewhere` counts the markers of other sets. An edited,
unparseable or mistargeted skipped marker never fails the scan, but
its entry records whether it names the requested set
(`namesRequestedSet`).
Any other result is inconclusive and blocks this
exception the same way. A sibling's marker lives on the sibling's own
issue and never appears in the marked target's own comment log. If either
condition fails, or the helper cannot finish, the exception does not
authorize
removing any label for this release; fall back to the ordinary explicit
human release-request precondition for the whole set instead. Then,
immediately before each label removal, append and verify the set anchor's
`mode=heartbeat` first (or reuse one per the
coalescing rule above), re-fetching it and requiring its current owner, set,
anchor, and session. Only after that succeeds, append and verify the target
heartbeat when it is distinct (one marker serves both roles when they
coincide; reuse applies here too), then re-fetch both and require each
target's expected owner token independently, plus the shared set/anchor/session,
recorded release-marker comment, and expected label/body snapshot. Remove
non-anchor
labels one target at a time and re-fetch each result. After the
final anchor label removal is verified, re-fetch every target and verify its
current release marker, absent label, and expected body snapshot; any drift
leaves the set open and prevents completion. Immediately before the
release-complete reuse-or-append decision below, repeat the same
mandatory sweep once more -- the same `sweep-authoring-markers.mjs`
command above, now scoped to `--issue <anchor-issue-number> --issue
<journal-issue-number>` -- covering the anchor's own owner-marker log
and each journal's publication-intent log (plus one `--issue` for each listed
retired journal) -- idempotent with every
earlier target's own sweep above, since a comment either was already
minimized or was not yet the newest for its own continuity-chain
identity within the family either way. Then
reuse or
append the anchor-only
`mode=release-complete` marker and record its comment ID. Reconcile that ID
and the paginated anchor log with bounded retries; a successful POST or
verification timeout is inconclusive. If the trusted marker is found, keep
labels absent and close the set. If a complete fresh read conclusively proves
that no trusted marker was appended, reapply the authoring label to every
target and leave the set generations open. If reads remain inconclusive, keep
the release guard and current labels/state in place, leave the set held, and
record a recovery hold. Never infer marker absence or roll back from a
verification timeout. Do not infer completion from absent labels or a
session-local read. Treat every release marker, heartbeat,
label removal, and completion marker as provisional: no target generation
closes until every target's release marker and label removal are verified and
the durable completion marker is reconciled, at which point the set-level
release closes all target generations together. If any later mutation or
verification fails, re-fetch all already processed targets,
retrying a failed post-removal read with a bounded fresh read, restore their
labels while the current owner/set still match, and verify the restored set
state; leave every target generation open and stop. If restoration cannot be
completed or a newer owner has appeared, record a set-level recovery hold and
never claim a partial release. This release checklist plus the user's
explicit request together form the single approval boundary in this
contract, except for the narrow, marker-scoped exceptions below and, when
`standingApprovals.release` is enabled, the
[standing release approval](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#authoring-hold-and-release).
Removing the authoring label releases the Discover guard and
authorizes IDD execution for the released issues. Do it only as part
of that explicit release request, one of the narrow auto-release
exceptions below, or, when `standingApprovals.release` is enabled, the
[standing release approval](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#authoring-hold-and-release);
nothing else removes the label or starts Discover,
Claim, and Work on its own. A draft carrier's release authorizes no
execution: the carrier keeps its authoring-only label and never enters
the loop. An auto-decide confirmation issue's release authorizes no
execution either: the issue keeps its confirmation label, which keeps it
out of Discover. A released `review-needs-decision` follow-up remains
out of Discover while the label configured as
`labels.needsDecisionLabelName` is present (default:
`status:needs-decision`).
### Closing sweep (after Stage 2 closes, #2896 review, Codex)
The two sweep points above run _before_ Stage 2's own later marker
appends for the same generation -- the per-target `release` marker, the
pre-label-removal heartbeat each target receives immediately before its
own label removal, and (on the anchor) `release-guard` and
`release-complete` itself. None of those markers exist yet when their
target's preflight sweep runs, so the preflight sweep(s) alone can never
clear them, and a target's Stage 2 for a given generation runs only
once -- there is no future preflight sweep that would ever revisit them.
Once the set-level release actually closes (the successful-close branch
above: the trusted `release-complete` marker is found and every label is
confirmed absent), attempt the mandatory sweep one more time (#2935), in
a single invocation covering every target's now-final owner-marker log
(the anchor's included this time, not just its own) and each journal's
publication-intent log -- one `--issue` for `issueAuthoring.journalIssue` and
one more for each listed retired journal:
```sh
node scripts/sweep-authoring-markers.mjs --issue <target-1> \
--issue <target-2> ... --issue <anchor-issue-number> \
--issue <journal-issue-number-or-owner/repo#number> \
--issue <retired-journal-owner/repo#number> \
--marker-prefix <resolved-target-prefix> \
--trusted-marker-logins <trusted-login-1,...> \
--deadline-ms 300000 --apply || true
```
Same attempted-not-blocking framing (and the same `|| true` reasoning
above): a failed invocation here does not reopen the set or roll back
the close already recorded above.
**Make every sweep attempt's outcome visible.** Immediately after each
of the three sweep attempts in this section (per-target preflight,
anchor-before-release-complete, and this closing sweep), run
`audit-authored-issue.mjs`'s `authoring-marker-minimization-backlog`
check and note its reported count -- always with `--trusted-marker-logins`
(or the equivalent `trustedMarkerActors` option on `auditAuthoredIssue()`)
set to the same trusted actors the sweep itself used, so the check's own
eligibility rule matches what the sweep could actually clear; omitting
it makes the count overstate the real backlog by including
untrusted-authored matches the sweep was never going to touch.
Immediately after every sweep attempt above (each target's preflight, the
anchor before release-complete, and the closing sweep), also run that check for
each listed retired journal, with `--trusted-marker-logins` set as above and
`--journal-comments-file` holding only that journal's comments, with the sweep's
post-mutation result applied to that snapshot as described below. Report each
journal's count separately; a retired journal's count is never added to the
current journal's. The helper's carrier release runs only the carrier and
`journalIssue`, so a carrier whose hold is in a retired journal needs these runs
by hand (see the journal-rotation bullet in the contract).
**Normalize the author field before writing the comments-file JSON**
(#2896 review, Codex): the paginated GitHub REST/GraphQL response this
section already fetches exposes a comment's author nested as
`user.login` (REST) or `author.login` (GraphQL), never as a flat
`author` string -- write each entry's `--comments-file` /
`--journal-comments-file` JSON with `author` set to that nested login,
not passed through unmapped. Skipping this normalization does not
error: every comment silently loses its author, the trust filter above
then excludes every candidate as unknown-author, and the count falsely
reports zero backlog even when the sweep was skipped or failed entirely
-- the opposite failure mode from omitting `--trusted-marker-logins`
(that overstates; this understates to nothing).
**Feed it the sweep's own post-mutation result, never the pre-mutation
snapshot the sweep read.** The minimize mutation applies directly to
GitHub; it never updates an in-memory or on-disk comment snapshot.
Before running the check, update the just-fetched snapshot's
`isMinimized` field to `true` for every candidate the sweep command's
own report (`sweep-authoring-markers.mjs`'s `items[]`, each entry tagged
with the family it belongs to and keyed by subject id) lists with
**either** `status: "applied"` **or** `status: "skipped",
reason: "already-minimized"` -- the latter fires whenever the fetched
snapshot's own `isMinimized` was already stale or absent for a comment
GitHub already considers minimized (for example one an earlier sweep or
the opportunistic per-post step already cleared), and counts exactly the
same as a fresh `"applied"` for this update: both mean the comment is
minimized now, regardless of which attempt did it. Missing either status
keeps that comment's snapshot entry wrongly `isMinimized: false`.
Re-fetching the paginated log fresh **via GraphQL** (matching the
sweep's own fetch above) is an acceptable alternative to this snapshot
update, not merely a fallback -- either one produces the same accurate
post-sweep state. A REST re-fetch is not a valid alternative here
(#2896 review, Codex): REST's issue-comments endpoint never carries
`isMinimized` at all, so a REST re-fetch is exactly as blind to
minimization state as the stale pre-mutation snapshot this paragraph
exists to correct -- it produces a different but equally wrong
snapshot, not an accurate one. Skipping both and auditing the unmodified
pre-mutation snapshot reports every comment the sweep (or a prior one)
already minimized as still-outstanding backlog, making even a fully
successful, fully idempotent sweep look like it failed. A nonzero count
after this update means the sweep attempt genuinely did not fully clear
the backlog it was supposed to (a partial
permission failure or a genuine defect) -- record it, but never block
release on it; this is the mechanical signal that makes a skipped or
partially-failed sweep attempt visible instead of silent, the same kind
of gap that went unnoticed for weeks in the original per-post-only
instruction this section replaces (measured effectiveness cited above).
**When the backlog check itself cannot run, record that fact through a
runtime-independent path (#2896 review, Codex).** The check depends on
the same paginated comment snapshot and the same helper runtime
(Node.js) as the sweep it audits, so the one scenario this whole
mechanism exists to catch -- the sweep silently skipped because the
helper runtime is unavailable (`instructions-only` profile, or Node.js
absent), or because the paginated comment fetch itself failed -- is
exactly the scenario in which the mechanical count also cannot run,
leaving no signal at all if nothing else is done. When either the sweep
or the audit could not run for this reason, still post an explicit
plain-text note through a path that needs no helper runtime (a
`gh`/HTTP comment on the target, or the session's own live status
digest) -- for example "hide-on-supersede sweep skipped this cycle:
helper runtime unavailable" -- naming the reason. This never blocks
release either; it only ensures a fully-silent skip never happens even
in the one failure mode the mechanical signal cannot itself cover.
### Narrow auto-release exception
A single, non-roadmap follow-up issue whose body carried one exact
defined defer-source marker
`<!-- <marker-prefix>-authoring-defer-source: {defined-value} -->` at
Stage 1 publication time — part of the initial `authoring-publication` body
write, never added by a later edit — may complete the full release
checklist and label-removal sequence above without the "user explicitly
requests release" precondition, immediately after Stage 1 publication
completes for that issue. Every other precondition and mechanical gate
above (green checklist, release-marker preflight, release-guard,
heartbeat renewal, verified label removal for every target,
release-complete reconciliation) still applies in full — this exception
replaces only the human-request precondition, and only for the single
target carrying the marker, never a roadmap anchor or a sibling target
in the same authoring set that lacks it.
This exists because `idd-review-triage.instructions.md`'s round-count
or adopt-now-urgency defer trigger writes `review-fix-loop-cutoff` on a
follow-up issue during unattended autonomous execution, where no
human is present to issue a release request. Left under the ordinary
human-gated boundary above, that deferred work would sit under the
authoring label indefinitely on a fully autonomous repository,
silently defeating the point of deferring it at all (preventive; no
observed incident yet).
**Needs-decision publication and release (`review-needs-decision`).**
Use this value only for a follow-up that must wait for a person's
decision. Its exact defer-source marker is
`<!-- <marker-prefix>-authoring-defer-source: review-needs-decision -->`.
The body carries `authoring-bucket: needs-decision`, and the configured
needs-decision label is applied in the same capability-checked create
call as the authoring label. If the configured label is absent, create
it with `gh label create` before publication; a create or label-
application failure stops publication. The configured authoring and
needs-decision label names must be distinct: the audit rejects a
collision, and Discover fails closed if it encounters a marked
follow-up under a colliding configuration. For every initial lint,
held-body re-lint, and Stage 2 lint, pass
`--expect-bucket needs-decision`, `--origin-issue <claimed-issue>`, and
both configured labels. The expected origin must match the sole `Refs`
line. Before Stage 2 removes a label, re-fetch and verify both live
labels; remove only the authoring label, and only while the
needs-decision label
is present. If it is missing or cannot be verified, leave the issue
held. After authoring-label removal, the configured needs-decision label
keeps the follow-up out of Discover until a person clears it; label
removal alone does not authorize IDD execution.
The required body shape and quoting rules are in
`skills/issue-authoring/references/contract.md` under
`Needs-decision follow-up body`. Its fenced example is in
`skills/issue-authoring/references/draft-patterns.md`.
**Provenance check (`#2877`).** Before honoring this exception, the
releasing session must recompute the target's current body-sha256 from
a fresh read and compare it against that same target's own
`mode=acquire` owner marker's `body-sha256` (hashed from the fresh
read taken immediately before that marker was posted, so it already
reflects the published body — see "Per-target ownership" above). A
mismatch — the body changed since Stage 1 acquire — fails closed: the
auto-release exception does not apply for that release attempt (this
does not retroactively fail Stage 1 itself), and the target falls back
to the ordinary human-release-request precondition. Perform this
comparison immediately before the label-removal step itself, not only
once earlier in the sequence — matching this section's existing
discipline of re-verifying immediately before each removal for
owner/set/anchor/session and the expected label/body snapshot — so a
body edit landing between an earlier check and the actual removal
cannot silently bypass this precondition. The `authoring-owner-provenance`
helper (`node scripts/authoring-owner-provenance.mjs --issue <number>`;
see `docs/idd-helper-scripts.md`) performs and verifies this comparison
mechanically (`#2891`).
**Reused-issue provenance stays manual.** The
`authoring-owner-provenance` helper reads only the target's own
owner-marker log, under every verdict, and never follows an anchor to
another issue. It does not perform the anchor-log step of the rule for
a non-anchor target ("A non-anchor target cannot prove that its
previous set finished" above): the trusted `mode=release-complete`
check on the anchor's log before a fresh `mode=acquire` of an issue
that an earlier set released. That step is performed by hand, and no
verdict stands in for it: `pass` shows only that the target's first
acquire still matches the live body. On an issue an earlier set held,
the helper may report `not-found` (for example, its first acquire
names another anchor) or `mismatch` (the body changed since that
acquire), as on issue `#4703` (observed 2026-10-31) and issue
`#4694`. Either result means the helper did not do the step, and
neither authorizes acquiring the issue as a new set.
**Roadmap-anchor scope (accepted limitation, `#2877`).** The "never a
roadmap anchor" exclusion above is permanent, not a gap awaiting a fix:
a roadmap anchor carrying this marker under `issue-scope: roadmap`
with orphan discovery disabled still requires the ordinary human-gated
explicit release request, since this exception's single-target design
intentionally does not extend to anchor release. See
`docs/idd-autonomy-contract.md`'s Stage 2 label-removal row for the
same note in table form.
**Sequencing with the originating issue (`#2877`).** Either defer
trigger's follow-up issue also carries a `Refs #<originating-issue>`
line back to the deferred work (the D3 follow-up-issue rule in
`idd-pr-submit.instructions.md`). `discover-readiness-check.mts`
treats that specific `Refs` reference as a hard blocker — resolved the
same way an ordinary `Blocked by #<N>` line is — while
`#<originating-issue>` stays open, a narrow exception to `Refs`
otherwise being non-blocking everywhere else in this workflow. The
marked follow-up must carry exactly one `Refs` keyword line naming
exactly one issue: nothing in body text lets Discover safely tell the
true origin apart from an unrelated `Refs` citation that also starts
its own line, or apart from a second number on the same line, so more
than one line or more than one number fails closed instead of
guessing.
**Carrier creation-hold exception.** A draft carrier published by
`publish-authoring-hold --shape carrier` has its creation hold (the
authoring label) released by the same command, without a person's release
request, once the contract's sole-member, roadmap-id, carrier-audit,
body-digest, and label checks pass. The authoring-only label stays, and a
failed or inconclusive check leaves both labels for a person's release. The
preconditions and outcomes are in the contract's
[Authoring hold and release](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#authoring-hold-and-release)
section.
**Confirmation creation-hold exception.** An auto-decide confirmation issue
published by `publish-authoring-hold --shape confirmation` has its creation
hold (the authoring label) released by the same command, without a person's
release request, through the carrier's release, with the confirmation audit
in place of the carrier audit. Before anything is written, the command checks
the confirmation label name against the trusted policy at the default branch,
and a failed check refuses with nothing written. Only the authoring label is
removed: the confirmation label stays and keeps the issue out of Discover, so
the release never authorizes IDD execution. A failed or inconclusive release
precondition leaves both labels for a person's release. The preconditions
and outcomes are in the contract's
[Authoring hold and release](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#authoring-hold-and-release)
section.
### Rework adoption of a retained decision source
When the operator of an opted-in decision source chooses another option, the
same issue becomes its rework roadmap under the normal authoring hold. The
recorded handoff supplies the fresh set and session identities. It is not
ownership: the authoring label, the owner `acquire` marker, the handoff's own
journal hold, the body snapshots, and the anchor heartbeats all precede the
rewrite and each child, and the old creation token stays untouched as history.
`publish-authoring-hold --shape child --anchor <source>` verifies the adoption
from the trusted provisional records, with no flag, and leaves the whole set
held for a normal release. The bundled contract's "Rework adoption of a
retained decision source" section holds the full procedure and the checks.
## Draft carrier
A **draft carrier** is an issue that holds drafts which cannot be published
as their final issues yet, labelled with the authoring-only label, so that a
reviewed draft does not end in local files only. Publish one with
`publish-authoring-hold --shape carrier`, giving the required `--title` and
`--body-file` and running it with `--apply` (without `--apply` it only prints
its plan and writes nothing), after `audit-authored-issue --shape carrier`
passes. A duplicate search lists open
carriers and reads their drafts and comments. The cases that use a carrier,
the two exceptions that keep drafts local, the exact shape, the review
ledger, the release condition, the ordered re-authoring procedure with its
keep-open and split rules, and the observed incidents are defined in the
contract's
[Draft carrier](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#draft-carrier)
section.
When a ready child draft's original set no longer proves a held anchor,
the re-authoring procedure permits a fresh held roadmap set after the
verified no-worktree carrier claim, current branch and recent issue/PR
history checks. It requires reviewed and linted root and child bodies, a
trusted pre-create intent linking the draft to a unique token in the roadmap,
an immediate carrier mapping after root creation, and live reconciliation
before retrying any uncertain write. A defer-source child keeps its single
source `Refs` line instead of gaining a carrier reference. Before closure,
the procedure verifies that every mapped child appears in the live roadmap
`## Tracks` list (issue `#5061`). Observed 2026-11-05 on carrier issue
`#5054`; see the
[design rationale](idd-design-rationale.md#cite-the-observed-incident).
The old owner history remains unchanged, and the fresh roadmap and child stay
under the authoring hold for a separate Stage 2 release.
## Reuse-first issue policy
Before creating any new issue, the skill should check whether the work
already has a suitable home.
**Claim-state precondition (check this first).** Before reusing or
extending any existing issue, determine whether it has an active claim
(latest valid `claimed-by` newer than the configured `claim-stale-age`,
distributed default 24 h) or an open PR, or is otherwise actively
executing. If so, the skill **must not edit its body** — the working
agent snapshots the body into its B2 plan and never re-reads it, so a
post-claim edit is silently lost. A separate comment is allowed (never
an edit or append to the body) but must not be relied on to be picked
up; cover the change with a follow-up issue (or roadmap track), and the
skill **should** post a cross-reference comment on the claimed issue.
Stale or reclaimable claims (older than `claim-stale-age`) are exempt,
since the next claimer re-reads the latest body.
Then apply these checks in order:
1. If an existing open issue already matches the task and only lacks the
new schema details, extend that issue instead of cloning it.
2. If an existing open roadmap already owns the initiative, add or
refine task-list entries there instead of creating a competing
umbrella.
3. If an existing issue is close but too broad, split follow-up work out
of it rather than widening the original issue further. When the
issue being split is itself a roadmap child, the skill should update
the parent roadmap's `## Tracks` list in the same authoring action —
add the new issue's link and adjust any sequencing notes (a short
dated note is the observed good pattern) — subject to the
claim-state precondition above applied to the roadmap issue's own
claim/PR state, and record the provenance in the new issue's body
(e.g., `Split out of #<n>`).
4. If an existing issue has an active claim, an open PR, or is
otherwise being actively executed, do not edit its body or repurpose
it (see the claim-state precondition, which exempts stale/reclaimable
claims); create a follow-up issue or extend the roadmap around it
instead.
5. Create a brand-new issue only when no existing issue can absorb the
work without harming ownership, clarity, or reviewability.
The skill should report when it reuses, extends, or declines to reuse
an existing issue so a later session can follow the reasoning.
**Recent-window scan for just-discovered problems.** The checks above
assume the work already has a candidate home to reuse or extend. When
instead authoring an ad hoc issue for a problem **just discovered**
during the current session — a build-breaking regression noticed
mid-session, for example, rather than a task drafted from an existing
backlog — the skill should run a recent-window duplicate scan
immediately before publishing: list the newest issues regardless of
state and check whether a concurrent session already authored the
same problem.
```sh
gh issue list --repo <owner>/<repo> --state all --limit 20
# or, scoped to a recency window:
gh issue list --repo <owner>/<repo> --state all --search "created:>=<YYYY-MM-DD>"
```
A hit routes back into the checks above: extend the discovered issue
instead of publishing a duplicate. When the race slips past this scan
anyway (near-simultaneous discovery), the outcome is **anticipated and
self-resolving, not a coordination failure**: both sessions proceed
independently through their own claim and implementation cycle;
whichever PR merges first wins; the other session manually verifies
the fix already landed on the default branch, then closes its own
issue and (unmerged) PR as superseded, citing the verifying evidence.
This is the same manual verify-then-close judgment call the execution
loop's B2.0 supersession re-check (`idd-work.instructions.md`) applies
after claim — this scan only adds an earlier, pre-publish checkpoint.
A fast enough race can still surface even after B2.0; when it does, it
resolves the same way.
**Previously declined check.** Before treating a proposal as new, the
skill should check whether it was already declined. Vocabulary alone
can miss a match: the Groom outcome recorded on issue #2996 on
2026-09-15 closed it as not-planned, yet issue #3164's own later search
missed it six days after. The skill should search closed issues using
the proposal's core nouns rather than its new framing, plus at least
one alternative phrasing:
```sh
gh api -X GET search/issues --paginate \
-f q='repo:<owner>/<repo> is:issue is:closed reason:"not planned" <core-nouns>' \
-f per_page=100 \
--jq '(.items[] | "#\(.number) \(.title)"), "-- total=\(.total_count) incomplete=\(.incomplete_results) page=\(.items | length)"'
```
A fixed `--limit` cannot prove that nothing was missed: it stops at the limit
silently, and the search API caps every query at 1,000 results. The skill should
read the output by these outcomes. Complete: every summary line says
`incomplete=false`, the `page=` values add up to `total=`, and no `#number` line
appears twice. GitHub does not promise a snapshot across pages, so this is a
best-effort read: an item added and another removed during the traversal can
keep the totals equal, and a repeated run that gives the same result confirms
it. Search not finished: `incomplete=true` on any line, so retry once and then
narrow the query. Over the 1,000-result ceiling: every `gh` call exited 0 with
nothing on stderr, the `total=` values agree, and the `page=` values add up to
fewer than `total=`. Only then split the query with a `closed:` date range (do
not add nouns, which can hide the match). A short page sum without those guards
is a pagination failure or a result set that moved, not the ceiling. Not a
completed check: a non-zero exit, any stderr from `gh`, `total=` values that
differ between lines, or a `#number` line that appears twice. An incomplete
search is not a completed check, so the proposal is not published as `ready`
until a narrower query completes or it is routed to `needs-decision` with the
incompleteness recorded. Observed 2026-10-08: reproduced read-only on `cli/cli`
with the noun `pr`, where `--limit 100` returned 100 of 288 matches with exit 0
and empty stderr. That is a reproduction, not an incident recorded in this
repository, so the failure mode is preventive for adopters.
When the proposal changes an existing mechanism, the skill should
identify the PR that introduced or last reshaped it (for example from
`git log -S` on the mechanism's symbol, followed by its merge
commit's `Merge pull request #N` subject), then read that PR's review threads for
a **Rejected** disposition of the same idea — for example, review
comment `3983246464` on PR #2895 was dispositioned Rejected on
2026-09-10 as a deliberate trade-off; that rejection is recorded only
in that review thread. The skill should cite every match found
by either search in the drafted issue's Background, stating what
is new since that outcome. When nothing is new, do not publish the
issue as `ready` — route it to `needs-decision` or drop the proposal
and record why.
## Decomposition and roadmap planning rules
The skill should identify atomic execution units first, then decide how
to package them.
### Keep work as an orphan issue when all are true
- one atomic issue is enough to complete the request
- limited scope, clear verification, and autonomous completion all pass
- no roadmap-level dependency or parallel track is needed
- the work is unlikely to require multiple agent sessions
- the target repository discovers orphan issues — `issue-scope` is
`roadmap-first` (the default; orphans are the fallback when no roadmap
work is startable) or `orphan-first` — and any configured
`orphan-first-policy` approval step can happen after drafting; or the
draft explicitly tells the operator to switch to a discovering mode
before starting the execution loop (a `roadmap`/roadmap-only
repository does not discover orphans)
### Create a roadmap when any are true
- the request requires more than one autonomous issue
- the work has a dependency chain that should be visible before
execution starts
- two or more tracks can proceed in parallel and should be coordinated
- the request is likely to span multiple sessions or handoffs
- some tasks are ready now while others should be explicitly deferred,
blocked, or sequenced behind earlier work
### Create sub-issues when a roadmap exists
Each ready execution unit under the roadmap should become its own
sub-issue when:
- it can be reviewed independently
- it has its own acceptance criteria
- it can be claimed by one agent without owning the whole roadmap
### Avoid these anti-patterns
- do not create a roadmap only because a description is long
- do not keep multiple unrelated atomic changes in one sub-issue
- do not create an artificial serial chain when sibling tasks could be
reviewed and verified independently
- do not split one natural, cohesive change into artificial sibling
issues only to widen parallel execution
- do not use hidden dependency markers to group active sub-tasks under
an open roadmap
- do not hide low-confidence work by omitting it from the output
## Dependency minimization
Encode a dependency edge only when it reflects a true correctness,
availability, or ordering constraint.
- keep independent sibling tasks as roadmap task-list entries, with
short sequencing or parallelization notes when that helps reviewers or
later agents
- use visible or sequential dependency markers only when the issue
cannot start safely until the dependency resolves
- do not create an artificial serial chain when sibling tasks could be
reviewed and verified independently
- do not split one natural, cohesive change into artificial sibling
issues only to widen parallel execution
- whenever an issue's own narrative states that its work cannot safely
start until another named issue resolves, encode `Blocked by #NNN`
for that issue rather than leaving the constraint as prose-only
sequencing. Discover and A4.5 honor the hard `Blocked by` edge, not
a narrative "runs after #NNN" note: A4.5 Actionability inspects the
body, not completability, so a narrative-only dependency reports the
issue startable the moment its other filters pass, and claiming it
then means either violating the asserted constraint or doing the
referenced issue's unresolved work first. This rule is general, not
limited to a fixed list of cases; the two recurring patterns below
are illustrative, not exhaustive
- **example — docs or operator-help child that documents behavior
implemented by sibling issues**: encode `Blocked by #NNN` for those
implementation issues (or otherwise sequence the docs child to run
after they merge) so the documentation is written against **shipped**
behavior. Describing designed-but-unshipped behavior in the present
tense is a recurring advisory-review-thrash pattern; "describe shipped
behavior" is a true ordering constraint, so this edge is consistent
with the encode-only-a-real-constraint rule above
- **example — finalize or verify track whose acceptance criteria
assert state produced by sibling implementation tracks**: encode
`Blocked by #NNN` on **each** such sibling rather than stating the
ordering only in prose. A prose-sequenced finalize track reports
startable the moment its build foundation closes, and claiming it
then means either failing its acceptance criteria or doing
the siblings' unmerged work
- once a `Blocked by #NNN` / `Depends on #NNN` reference resolves —
the referenced issue closes **with its required outcome verified as
delivered**, not merely closed as not-planned, superseded without an
equivalent implementation, or later reopened — revisit the blocked
issue's own body and remove that reference and its explanatory wait
prose, rather than leaving it in place as inert history, but keep
any prose identifying the delivered artifact or interface this
issue's own scope depends on. A line naming several references
(`Blocked by #10, #11`) keeps the still-open ones — remove only the
resolved reference, and remove the whole line only once every
reference on it has resolved. When the
underlying constraint is not actually met, reopen the prerequisite
issue or repoint the dependency line at an open replacement issue
instead of leaving a stale edge in place:
`discover-readiness-check` blocks only on an `OPEN` referenced
issue, regardless of why it closed, so retaining the edge alone does
not keep the dependent issue blocked. (Observed 2026-08-13 on issue
#1994's `Blocked by #1985` note, after #1985 closed; reported in
#2002.) This cleanup is more than tidiness: stale wait-explaining
prose can trip `checkVerifiability`'s subjective-approval heuristic
in
`suitability-triage.mts`, which matches either a single line
combining a subjective-subject word (`maintainer`, `stakeholder`,
`human`, `opinion`, `judgment`/`judgement`, `ux`, or `feel` — not
only authority nouns) with a gate word (`approval`, `sign-off`/
`signoff`, `decision`, or `preference`), or a gate word followed
within 80 characters — including across lines — by a
subjective-subject word.
This still fires even though the structural dependency filter
already correctly treats the closed reference as unblocking
Common parentage, shared files, and generic correctness claims alone do
not establish an edge. The roadmap #4079 example is described in
[Per-edge rationale examples](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/draft-patterns.md#per-edge-rationale-examples)
(roadmap #4079 opened 2026-10-12); the shared-file-only and
generic-claim cases are preventive; no observed incident yet.
To justify each dependency edge, name the predecessor output, the
dependent operation or acceptance criterion it blocks, and the evidence
that supports the relationship. Ask what fails without that output while
keeping the other valid prerequisites. Keep the concise rationale in
the issue body. For a multi-issue set, map each hard edge in
`relationships` and support it with `evidence`. For a single issue,
keep the rationale in the body and supporting evidence in `evidence`;
`relationships` remains empty as the packet schema requires. Do not add
packet fields. Keep contention and preferred order in scheduling notes.
Review each edge against the body and packet, then review the set for
independent siblings and natural cohesion. Do not impose a parallelism
quota or another approval gate.
## Dependency encoding rules
The skill must encode dependencies in forms that the discover phase can
read safely.
**Prefix-first.** The examples below use this source repository's own
configured prefix, `idd-skill`, literally — this document describes
this repository's own convention. Resolve the target repository's
marker prefix before emitting any authoring marker in an installed
bundle; never assume `idd-skill` outside this source repository. A
prefix the operator already confirmed during an onboarding hearing
(Steps 1A-1C of `idd-template/ONBOARDING.md`) counts as a resolved
value under "user context" — even before it is committed anywhere in
the target repository's tree — and does not require asking again. See
the bundled `contract.md`'s
[Target marker prefix](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#target-marker-prefix)
section for the adopter-facing, prefix-parameterized version of this
rule.
### Roadmap identity marker
Every roadmap issue must include exactly one hidden roadmap marker in
its body:
```html
<!-- idd-skill-roadmap-id: <roadmap-id> -->
```
The `<roadmap-id>` should be stable, descriptive, and unique within the
repository.
### Roadmap membership
Ready sub-issues that belong under an active roadmap should be linked
from the roadmap body through task-list entries:
```md
- [ ] #123
- [ ] #124
```
This is the primary grouping mechanism for active roadmap work.
### Issue-to-issue dependencies
When one issue depends on a specific issue, use a visible dependency
line in the body:
```md
Blocked by #123
```
The line must open at the start of the line (after optional
indentation, blockquote `>` markers, and at most one list marker) with
the literal keyword `Blocked by` or `Depends on`, an optional `:`, and
the reference itself — a bare `#123`, a qualified `owner/repo#123`, or
a full GitHub issue URL. A mid-line mention (the keyword appearing
after other prose, or hidden inside an HTML comment) and a near-miss
spelling or shape (an emphasis-wrapped keyword, `Blocked-by`/
`BlockedBy`/`Depends-on`, a full-width colon, or a Markdown-link
reference instead of one of the three plain forms) are rejected
unconditionally by the `dependency-line-grammar` mechanical check
below — none of these produce a dependency Discover can actually
resolve. A cross-repository token on an otherwise well-formed line is
rejected only when the linter is given `--current-repo` and it does
not match; without that context the token is treated as unverifiable,
not malformed, since Discover's own live run resolves a same-repo
reference correctly regardless.
### Sequential roadmap dependency
Use a hidden `idd-skill-blocked-by` marker only when an issue must wait
for a separate roadmap to close before it becomes startable:
```html
<!-- idd-skill-blocked-by: <roadmap-id> -->
```
Do not use `idd-skill-blocked-by` to group children under the roadmap
that already owns them. Grouping belongs in the roadmap task list.
## Nested roadmap nodes
Use a nested roadmap when one roadmap track needs its own coordination
boundary, active child list, or multi-session handoff. A nested roadmap
is still a roadmap node, not a normal execution candidate.
Authoring rules:
- reference the nested roadmap from the parent roadmap task list instead
of hiding it in prose
- give the nested roadmap its own roadmap marker and `## Tracks` section
that links the active child work it coordinates
- treat the nested roadmap as a coordination/audit node for discovery
and roadmap audit; do not draft it as normal A3/A4/A5 execution work
- use two-level or three-level nesting only when the intermediate
roadmap has its own active child work or handoff boundary
- do not use `Blocked by #NNN` or
`<!-- <marker-prefix>-blocked-by: ... -->` only to group leaf issues
under an active nested roadmap; reserve those encodings for true
execution dependencies or sequential roadmap dependencies between
separate roadmaps
Validation expectations:
- each nested roadmap node is linked from its parent roadmap task list
- each nested roadmap node links its own active child work from its body
- cycles, duplicate references, and closed intermediate roadmaps with
hidden open descendants must be surfaced as validation failures or
explicit follow-up notes, not silently normalized away
## Gate-rule verdict table
A drafted issue that changes a rule which decides a verdict (a gate,
classifier, threshold, or routing rule) carries a verdict table in its
acceptance criteria. An orphan or child issue puts the table under
`## Acceptance criteria`. A roadmap issue puts it under
`## Success criteria`, the section that the roadmap shape defines. The
table has one row per decision-relevant input case, with three columns:
- **Input**: the observable inputs of the case, such as a reply's
author, its timing, its body shape, or a count.
- **Expected verdict**: the outcome the rule must return for that input.
- **Source decision**: the recorded decision or evidence that sets the
row's verdict.
For an unbounded value such as a count, a duration, or a timestamp, a
row covers an equivalence class or a boundary (below, at, and above a
threshold), not every value. Every recorded decision that changes such a
rule maps to at least one row. A decision that names a rule without its
edge cases leaves the gap the table closes.
Observed incidents:
- Observed 2026-10-10 to 2026-10-11, issue
`kurone-kito/idd-skill#3942` and PR `kurone-kito/idd-skill#4000`: the
cited-item disposition rule took 13 Copilot review rounds and 14 commits
to settle. The recorded decision did not name whether a **Rejected**
reply counts, under what evidence, or how an empty or count-mismatched
per-item view is judged.
- Observed 2026-10-10, issue `kurone-kito/idd-skill#3947`: the published
issue holds a recorded decision whose premise its own reproduction
contradicts, and the marker the decision names is absent from the source.
## Destructive operations
A drafted change that deletes a file, overwrites an existing file,
removes a tree recursively, records ownership of a file, or writes to a
path that could be a link gives each such operation an acceptance
criterion for each of the six cases below, or names the guard that makes
the case impossible. The completed-draft critique checklist asks the
reviewer to check this; `audit-authored-issue` does not.
1. **Ownership.** A file that the tool did not create is never recorded
as the tool's own, even when its content matches what the tool would
write. Pre-existing content that the tool did not create is left alone.
2. **User edits.** A file that the user edited, or added beside the
managed files, survives the operation. The operation refuses, instead
of removing it, and a refusal removes nothing.
3. **Overwrite.** The operation does not replace an existing file that it
does not own. An overwrite the operator wants is named in the body's
open questions for operator approval.
4. **Links.** Each existing component of the target path below the root is checked
with a no-follow stat before the first write or removal. A path component that
does not exist yet is created only after every existing component above it
has been checked. The write itself uses a no-follow open for the final
component, so a write to a final-component link is refused, and a removal
of a final-component link removes the link without following it. A write to
a file with more than one hard link is refused, because a no-follow stat
cannot show that another name for the same file lies outside the root;
removing one of its names leaves the others in place. If the
platform cannot close the window that remains between a check and the act,
the body states that window as an open risk for the operator to accept.
5. **Recursive removal.** A recursive removal finds every path it would remove
with no-follow stats before it removes anything, and it does not descend
through a symlink. It removes the link itself, and it refuses, removing
nothing, when any path it would remove lies outside the root.
6. **Root containment.** Nothing outside the root is written or removed. The
root is the directory the operation is given to work under, such as the
data directory an install writes into. This holds even through a link that
the tool created itself. A write or removal whose path has a symlinked
parent component below the root is refused, not followed: each such
component is found with a no-follow stat before the write or removal runs,
and a refusal removes nothing. A removal of a final-component link removes
the link itself, as item 4 says. This covers a non-recursive removal as
well as a recursive one.
In cases 4 to 6, anything that a no-follow check cannot settle is an open risk
that the body names for the operator to accept. Examples are the resolution of
the root itself when the root is a link, a link above the root, and the window
between a check and the act, which item 4 describes. The refusals in items 4
to 6 take precedence, so the open risk applies only where no item refuses the
case.
**Reference inventory.** This requirement applies on its own, whether or not
one of the six cases applies, and it replaces none of them. A drafted change
that deletes, renames, or moves a repository path or tree includes, before
publication, an inventory of the repository references to that path and of its
executable consumers. The inventory covers prose documentation that names the
path, and links, tests, hooks, workflows, templates, and scripts that read,
open, or point at it. Like the restating-site search in
[Codebase-fidelity validation](#codebase-fidelity-validation), it adds each
reference or consumer that must change to Candidate files, and the body names
each one that stays valid with the reason it remains valid; that statement is
body prose, not an acceptance criterion. The completed-draft critique checklist
asks the reviewer to check this; `audit-authored-issue` does not.
Observed incidents:
- Observed 2026-10-12 to 2026-10-13, PR `kurone-kito/idd-skill#4073`, closed
without merging, for issue `kurone-kito/idd-skill#3825`: the issue's
acceptance criteria said nothing about these cases, and review then found
an uninstall that deleted a file the user had added or edited inside the
payload (case 2, review thread), a byte-identical file that predated the
install and was recorded as installer-owned (case 1, comment 4249375122),
and managed data paths that followed a symlink component, so writes
resolved outside the data root (cases 4 and 6, comment 4249375009). Cases
3 and 5 have no observed incident yet; they are preventive.
- For the reference inventory, observed in issue `kurone-kito/dotfiles#680`,
closed 2026-10-28 on the merge of PR `kurone-kito/dotfiles#691`: its
Candidate files listed two instruction and skill directories, two docs, and
two helper tests. At the parent commit
`8681c44c7dfc4c0e1bbdc55f5ba74c58c8512f8f`, at least six references to the
removed paths sat outside that list, among them two tests that open an
instruction file, a doc that names one in prose, a docs index that links the
instruction set, an issue template that links the skill, and a hook that
points at an instruction file.
## Draft schemas
The following schemas are normative. The skill may add small
project-specific notes, but it should not omit the required structure.
### Orphan issue schema
Use an orphan issue for one ready, autonomous task that does not need a
roadmap and will remain discoverable under the target repository's
`issue-scope` setting.
Required content:
- title with a concise user-facing summary
- `## Background` or `## Goal`
- `## Proposed change`
- `## Acceptance criteria`
- an autopilot-suitability footer at the end of the body (visible line +
`<!-- idd-skill-autopilot-suitability: N -->` marker; see
[Autopilot-suitability score](#autopilot-suitability-score))
- an optional effort footer next to it (visible line +
`<!-- idd-skill-effort: S|M|L -->` marker; see
[Effort hint](#effort-hint)) — a soft Discover selection tie-breaker,
fail-safe on absence
Optional content:
- `## Candidate files`: required with at least one path when the effort
footer is `S` or `M`; optional for `L`, an absent effort footer, or a
malformed one
- `Blocked by #NNN`
- `## Notes`
Validation expectations:
- no `idd-skill-roadmap-id` marker
- no `idd-skill-blocked-by` marker
- acceptance criteria are testable or otherwise explicitly verifiable
- scope is narrow enough to pass the IDD viability gate as a single
issue
- the draft preserves discoverability by using a repository that
discovers orphans (`issue-scope: roadmap-first`, the default, via the
orphan fallback, or `orphan-first`), or by surfacing that
configuration change before the operator starts the Discover -> Claim
loop
- when the repository uses `orphan-first-policy: maintainer-approved`,
the draft includes a post-publication maintainer approval step after
the final title, body, and generated plan are stable
- exactly one autopilot-suitability footer with an integer 1-5 marker; a
score of `1` carries the configured `blocked-by-human` label (default
`status:blocked-by-human`), unless an
`authoring-bucket: needs-decision` marker substitutes the configured
needs-decision label instead (see
[Authoring-bucket marker](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#authoring-bucket-marker))
- passes the completed-draft adversarial review and then the
`audit-authored-issue` mechanical pre-publish gate for the
`orphan` shape (see
[Completed-draft adversarial review](#completed-draft-adversarial-review)
and [Mechanical pre-publish gate](#mechanical-pre-publish-gate))
### Roadmap issue schema
Use a roadmap issue when a request needs multiple issues, visible
sequencing, or parallel tracks.
Required content:
- title that describes the umbrella initiative
- `## Goal`
- `## Why this matters` or `## Background`
- `## Tracks`
- `## Success criteria`
- one `<!-- idd-skill-roadmap-id: <roadmap-id> -->` marker
- an autopilot-suitability footer at the end of the body (visible line +
`<!-- idd-skill-autopilot-suitability: N -->` marker)
- an optional effort footer next to it (visible line +
`<!-- idd-skill-effort: S|M|L -->` marker; see
[Effort hint](#effort-hint)) — a soft Discover selection tie-breaker,
fail-safe on absence
Recommended content inside `## Tracks`:
- track headings for major streams of work
- `- [ ] #NNN` task-list entries for ready child issues
- short sequencing or parallelization notes when they reduce collisions
Validation expectations:
- every active child issue or nested roadmap node is referenced from the
roadmap body
- the roadmap explains why multiple issues exist instead of hiding them
as narrative text
- dependency notes distinguish between active grouping and true
sequential blocking
- each dependency edge names its consumed predecessor output, blocked
operation or criterion, supporting evidence, and counterfactual with
other prerequisites retained; independent siblings stay in the
roadmap task list and the set preserves natural cohesion
- nested roadmap entries stay identifiable as coordination/audit nodes
instead of normal execution leaves
- the roadmap can survive multi-session handoffs without relying on
private session memory
- exactly one autopilot-suitability footer with an integer 1-5 marker; a
score of `1` carries the configured `blocked-by-human` label (default
`status:blocked-by-human`), unless an
`authoring-bucket: needs-decision` marker substitutes the configured
needs-decision label instead (see
[Authoring-bucket marker](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#authoring-bucket-marker))
- passes the completed-draft adversarial review and then the
`audit-authored-issue` mechanical pre-publish gate for the
`roadmap` shape (see
[Completed-draft adversarial review](#completed-draft-adversarial-review)
and [Mechanical pre-publish gate](#mechanical-pre-publish-gate))
### Sub-issue schema
Use a sub-issue for one atomic execution unit that belongs under a
roadmap.
Required content:
- title with a concrete task summary
- `## Background`
- `## Proposed change`
- `## Acceptance criteria`
- `## Candidate files` for ready children; a child with an
`authoring-bucket: needs-decision` or
`authoring-bucket: blocked-by-human` marker, or a suitability score of
`1`, may omit this section or leave it empty when no repository file
is expected to change. Do not guess paths for unresolved or
human-only work. This warning is preventive; no observed incident yet.
- an autopilot-suitability footer at the end of the body (visible line +
`<!-- idd-skill-autopilot-suitability: N -->` marker)
- an optional effort footer next to it (visible line +
`<!-- idd-skill-effort: S|M|L -->` marker; see
[Effort hint](#effort-hint)) — a soft Discover selection tie-breaker,
fail-safe on absence
Optional content:
- `Blocked by #NNN`
- `<!-- idd-skill-blocked-by: <roadmap-id> -->` when a separate roadmap
must close first
- `## Notes`
Validation expectations:
- the issue is referenced from its parent roadmap task list
- acceptance criteria are locally verifiable
- a ready child's required `## Candidate files` section lists the files
it is expected to touch and supplies input to A4's
`discover-shared-file-overlap` check; a child with an
`authoring-bucket: needs-decision` or
`authoring-bucket: blocked-by-human` marker, or a suitability score of
`1`, may omit the section or leave it empty when no repository file
is expected to change. Do not guess paths for unresolved or
human-only work. This warning is preventive; no observed incident yet.
- any dependency marker is resolvable, intentionally chosen, and
justified
- the issue can be claimed independently without absorbing sibling work
- exactly one autopilot-suitability footer with an integer 1-5 marker; a
score of `1` carries the configured `blocked-by-human` label (default
`status:blocked-by-human`), unless an
`authoring-bucket: needs-decision` marker substitutes the configured
needs-decision label instead (see
[Authoring-bucket marker](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#authoring-bucket-marker))
- passes the completed-draft adversarial review and then the
`audit-authored-issue` mechanical pre-publish gate using
`--shape child` (the linter's shape enum names this schema `child`,
matching `contract.md`'s "Child issue under a roadmap"; see
[Completed-draft adversarial review](#completed-draft-adversarial-review)
and [Mechanical pre-publish gate](#mechanical-pre-publish-gate))
## Drafted issue prose language
A drafted issue's human-readable prose sections — `## Background` (or
`## Goal`/`## Why this matters`), `## Proposed change`,
`## Acceptance criteria`, and the roadmap shape's `## Tracks` /
`## Success criteria` — follow the target repository's resolved
`authoringLanguage` value from `.github/idd/config.json`:
- A fixed BCP-47-shaped tag (for example `en`, `ja`, `fr`) makes the
drafted prose use that language.
- The literal `match-source` matches the operator's live conversational
language during an interactive/hearing issue-authoring session.
- An absent field defaults to English.
See
[Authoring Language](https://github.com/kurone-kito/idd-skill/blob/main/docs/customization.md#authoring-language)
for the full field definition.
**Marker/footer carve-out**: this never changes any HTML-comment
marker's machine-parsed format, nor any visible-line mirror whose exact
wording a mechanical regex parses. Concretely, the autopilot-suitability
and effort footers' visible lines (`_Autopilot suitability: N / 5 ...`
/ `_Effort: S | M | L ...`) must stay in their exact canonical English
wording regardless of `authoringLanguage`, since `audit-authored-issue`
matches them against a fixed English-phrase regex.
## Validation checklist for drafted output
Before reporting or publishing issue drafts, the skill should verify:
- each execution-ready issue passes limited scope, clear verification,
and autonomous completion
- no execution-ready issue hides unresolved human dependency that
belongs in `needs-decision`, `blocked-by-human`, `deferred`, or the
approval-needed fallback
- each deferred, blocked, or decision-dependent item was preserved in a
stable bucket instead of being dropped
- each roadmap has one roadmap marker and uses task-list links for child
issues
- each nested roadmap node is linked from the parent roadmap task list
and links its own active child work
- each nested roadmap remains identifiable as a coordination/audit node
instead of a normal execution candidate
- each dependency edge names its consumed predecessor output, blocked
operation or criterion, supporting evidence, and counterfactual with
other prerequisites retained; independent siblings stay in the
roadmap task list and the set preserves natural cohesion
- each `Blocked by #NNN` reference resolves to the intended issue
- each `idd-skill-blocked-by` marker points to a real roadmap and is
used only for true sequential dependencies, never to group nested
roadmap children
- each issue body is explicit enough that a later discover pass can
decide whether the issue is ready without reconstructing hidden
context
- reuse or extension decisions are recorded when the skill chose not to
create a new issue
- no reviewed draft ends in local files only, except the two exceptions in
[Draft carrier](#draft-carrier); a failed review publishes no target, and
its drafts go into a carrier unless an exception applies
- each draft carrier passes `audit-authored-issue --shape carrier`
- before the completed-draft adversarial review and mechanical audit,
each drafted roadmap, child, or orphan body has its material factual
claims verified against current sources under the
factual-claims
[rule](../skills/issue-authoring/references/contract.md#factual-claims-check),
with support in the
review packet's existing `evidence` array and unsupported claims
handled by the existing qualification and uncertainty routes
- each drafted roadmap, child, or orphan body passes the
completed-draft adversarial review and then the
`audit-authored-issue` mechanical pre-publish gate for its declared
shape, including a body published into `needs-decision` or
`blocked-by-human` (`--expect-bucket` for those two buckets). The
review still runs when no helper runtime is available. Only the
linter uses its manual fallback in that case (see
[Completed-draft adversarial review](#completed-draft-adversarial-review)
and
[Mechanical pre-publish gate](#mechanical-pre-publish-gate))
### Loosening a fail-closed check
**Region classifier:** names the parser or function that decides each region
class the change depends on, and the coordinate system of the text that it
reads (for example, raw lines or fence-stripped text).
**Must-keep shapes:** lists the rejected shapes that the change must still
reject, one per line. The list is not exhaustive. A reviewer checks the
change against it and adds any shape that the change would newly accept.
This subsection cites the observed incident: issue `#3891` and PR `#3934`,
observed 2026-10-09. See `docs/idd-design-rationale.md#cite-the-observed-incident`.
## Repository-local implementation surface
This document is the canonical contract and schema for the repository's
native issue authoring bundle at `skills/issue-authoring/`.
Keep the implementation split on purpose:
- `skills/issue-authoring/SKILL.md` should stay concise and point back
here for the normative rules, output schemas, and validation checklist
- `.github/instructions/*.instructions.md` remain the execution-layer
files for the normal IDD loop after issue drafting is approved
Do not treat the native skill bundle and the execution instructions as
interchangeable entry points. The native bundle prepares issues; the
instruction files execute them.
## Approval boundary
Issue authoring under the hold and IDD execution are separate
decisions, but drafting and publishing are not: by default, the skill
authors and publishes each `ready`, `needs-decision`, or
`blocked-by-human` body directly under the configured authoring label
(`issueAuthoring.authoringLabelName`,
default `status:authoring`), gated by the completed-draft adversarial
review and then the mechanical `audit-authored-issue` check — no prior
user
approval of the drafted body is required. Neither the interactive-choice ask
in Human-dependency isolation nor the confirmation issue of the auto-decide
branch there is an approval of the body, and this sentence waives neither. It
does not apply to a choice that the interactive rule holds unpublished, where
the auto-decide branch does not take it, such as a question with no reply yet.
A draft that cannot be published under the hold now (because of its shape,
because its final form waits on something else, a planned stop before the
review completes, or a failed review) is published
as a draft carrier instead, so a reviewed draft does not end in local files
only. A preview request also publishes a carrier, and the reply shows:
- the proposed issue set
- the rationale for the decomposition
- any assumptions, open questions, or deferred decisions
The drafts stay local in two cases only: the user explicitly says not to
publish (an instruction not to create any issue, not a request to see the
drafts first; the final message says that the drafts are not durable and
gives their local paths), or the carrier cannot be published either (no helper
runtime, `issueAuthoring.journalIssue` unset, or a failure before the create;
the final message says the same and asks the user where to keep the drafts).
See [Draft carrier](#draft-carrier).
Starting the IDD execution loop requires the user's explicit
hold-release request — the single approval boundary in this contract —
except for the [Narrow auto-release exception](#narrow-auto-release-exception)
and, when `standingApprovals.release` is enabled, the
[standing release approval](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#authoring-hold-and-release).
That same request also authorizes removing the authoring label (see
[Authoring label lifecycle](#authoring-label-lifecycle)). Publishing a
ready issue set under the hold does not by itself authorize the agent
to move into Discover or Claim.
This is the approval-authority section, so it is also where an
orchestrator and delegated-worker split needs stating explicitly:
for an ordinary human-gated release under such a split, the release
action itself must be performed by whichever party directly holds
the user's verified hold-release request, never relayed as a claim
for the other party to trust. This mirrors how Discover and Claim
already stay the orchestrator's own job under `docs/idd-workflow.md`'s
Orchestrator fan-out variant. A delegated worker that receives only a
relayed release claim must refuse it and require the party holding
the actual request to act directly, even when that party is its own
orchestrator. This rule does not extend to the
[Narrow auto-release exception](#narrow-auto-release-exception),
the carrier creation-hold exception, the confirmation creation-hold
exception, or, when `standingApprovals.release` is enabled, the
[standing release approval](https://github.com/kurone-kito/idd-skill/blob/main/skills/issue-authoring/references/contract.md#authoring-hold-and-release),
which by design run with no user
release request for any party to hold in the first place (observed
2026-09-17, kurone-kito/idd-skill#3102).
## Non-goals
This document does not define:
- the repository-local skill folder structure
- the exact prompt text used by a future `SKILL.md` implementation
- the GitHub API command sequences used to publish drafted issues
Those details should stay in the implementation layer so this document
can remain the stable contract and schema reference.
[issue-authoring-review-input-schema]: https://kurone-kito.github.io/idd-skill/schemas/issue-authoring-review-input.schema.json