Docs

Retrospecting

Task close

On every merge the Archivist posts a provenance block built from facts the merge already froze, flags anything missing as DANGLING, and closes and confirms the task Issue.

Archivist
Provenance
On every merge
Ring 2

About task close

Task close makes one merged task durable. Months later, it is still clear what shipped, from what intent, and who checked it.

The rule is assemble, never author. Every field in the record is copied from a fact the merge already froze. A fact that is missing is recorded as missing, never filled in.

Task close has two halves:

HalfRunsCovers
MechanicalAutomatically on every push to main, in the post-merge job of the generated .github/workflows/vinaya-archivist.ymlThe provenance comment and the explicit Issue close
JudgementA dispatched Archivist turn, agent or humanDocs coherence, non-derivable facts as Issues, docs-index.md, token rows, lessons notes, follow-up Issues. It also re-confirms the mechanical half.
RolePart in task close
ArchivistRuns both halves. Its only precondition: the pull request is merged, as read from the forge.
Reviewer, SecurityTheir verdict comments are copied into the block.
PrincipalActs on flagged cleanups, such as a stale branch or a leftover worktree.

How it works

The mechanical half is vinaya archive --merge-sha=<sha>.

  1. 1

    Check the switch

    If rings.ring2_asyncAudits is false, it prints a skip line and exits 0.

  2. 2

    Find the pull request

    It resolves the pull request from the merge commit. If there is none, it skips and exits 0.

  3. 3

    Check the pull request is a task

    Either signal is enough: the head branch is task/<tranche>/<id> or task/issue-<n>, or the Issue the body closes carries a vinaya/tranche:* label. With neither, it skips.

  4. 4

    Skip work already done

    A pull request that already has a comment containing ### AEG provenance is skipped. An Issue may collect several merged pull requests; each gets its own block.

  5. 5

    Build and post the block

    It builds the block from the pull-request body, metadata and comments, appends the Archivist's own Tokens: line (or a DANGLING (tokens): note), and posts it as a pull-request comment.

  6. 6

    Close the Issue and confirm

    It closes the Issue with gh issue close, reads its state back, and fails (exit 1) unless it is CLOSED. With no Closes #N, no Issue is closed.

The provenance block

### AEG provenance — task <id> (tranche <slug>)      (or "task (backlog Issue #<n>)")
- Issue:        #N  (closed by merge)
- Tier:         0|1|3
- Brief:        <url of the aeg:brief:v1 comment>
- Project(s):   <from the PR body Project: field>
- Model/agent:  <from the PR body For: field>
- Code review:  <verdict extracted from comments>
- Security:     <verdict extracted from comments>
- Ticket:       <Ticket: field, or none>
- Merged:       <merge sha> at <mergedAt>
DANGLING: <list>
Tokens: …

Fields are read only from the header region of the pull-request body (or from an AEG: anchor pair where present). That is the same region the pull-request gate reads.

Dangling facts

Each missing or odd fact becomes a DANGLING entry, and its field shows DANGLING — ….

Missing or odd factEffect
No Closes #N in the bodyIssue field dangling; no Issue is closed
Closes #N found outside the header blockFlagged; still used
Extra Closes referencesOnly the first is closed; the rest are flagged
No Tier: fieldTier dangling
No frozen brief comment found for the IssueBrief dangling
No Project: fieldProject(s) dangling
No For: fieldModel/agent dangling
No code-review or security verdictThat verdict's dangling note
Metering available but zero tokensArchivist Tokens: line left out; DANGLING (tokens) note

A missing token row never blocks the provenance post or the Issue close.

The Archivist turn

The judgement half is a dispatched turn. The Archivist:

  1. Re-confirms the Issue is closed and the provenance comment landed, and investigates any DANGLING field.
  2. Checks that the docs the brief listed actually changed and agree with what merged. CI checked that they are present; the Archivist checks that they are true.
  3. Opens an ordinary Issue for any non-derivable fact the task surfaced.
  4. Updates docs-index.md when files were added, removed or renamed.
  5. Collects token rows from the Log's usage events for dispatched roles, and from principal-written Tokens: lines in verdict comments. No .tokens.md file is created; the no-disk-state check refuses one.
  6. Adds a new comment on the pinned lessons Issue for every BLOCKER or MAJOR finding that merged.
  7. Opens a follow-up Issue for every STALE-SPEC finding, unless one exists.
  8. Flags, but never performs, cleanups: orphaned or stale task/<tranche>/<n> branches, and local worktree removal.

It reports CLOSE-OUT: task N (PR #M) — COMPLETE | INCOMPLETE, with DONE, PROVENANCE, DANGLING and VERDICT sections.

Gates

MechanismRingFails red
Post-merge task archive (vinaya archive)2Yes, on any gh or permission error, or if the Issue does not confirm CLOSED. Skips (exit 0) a non-task or already-archived pull request.
Archivist entry gate—Refuses when the pull request is not merged

Task close runs none of the 37 checks. A missing provenance block is what the Tranche Archivist's entry check reads later; see Tranche and Milestone close.

Configuration

KeyEffect
rings.ring2_asyncAuditsfalse skips the whole mechanical half: no provenance, no Issue close
principalsWhose Tokens: lines count
tokensHow the Archivist's own usage is collected

What gets logged

ActLog events
A vinaya archive runoperation · completed
A dispatched Archivist turndispatch, role_attempt, usage

The provenance comment is a forge record, not a Log event. vinaya archive writes to the forge with gh directly, so it emits no effect · verified event.

What's next