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:
| Half | Runs | Covers |
|---|---|---|
| Mechanical | Automatically on every push to main, in the post-merge job of the generated . | The provenance comment and the explicit Issue close |
| Judgement | A dispatched Archivist turn, agent or human | Docs coherence, non-derivable facts as Issues, docs-index.md, token rows, lessons notes, follow-up Issues. It also re-confirms the mechanical half. |
| Role | Part in task close |
|---|---|
| Archivist | Runs both halves. Its only precondition: the pull request is merged, as read from the forge. |
| Reviewer, Security | Their verdict comments are copied into the block. |
| Principal | Acts on flagged cleanups, such as a stale branch or a leftover worktree. |
How it works
The mechanical half is vinaya archive -.
- 1
Check the switch
If
rings.isring2_ asyncAudits false, it prints a skip line and exits 0. - 2
Find the pull request
It resolves the pull request from the merge commit. If there is none, it skips and exits 0.
- 3
Check the pull request is a task
Either signal is enough: the head branch is
task/or<tranche>/ <id> task/issue-<n>, or the Issue the body closes carries avinaya/tranche:*label. With neither, it skips. - 4
Skip work already done
A pull request that already has a comment containing
### AEG provenanceis skipped. An Issue may collect several merged pull requests; each gets its own block. - 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 aDANGLING (tokens):note), and posts it as a pull-request comment. - 6
Close the Issue and confirm
It closes the Issue with
gh issue close, reads its state back, and fails (exit 1) unless it isCLOSED. With noCloses #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 fact | Effect |
|---|---|
No Closes #N in the body | Issue field dangling; no Issue is closed |
Closes #N found outside the header block | Flagged; still used |
Extra Closes references | Only the first is closed; the rest are flagged |
No Tier: field | Tier dangling |
| No frozen brief comment found for the Issue | Brief dangling |
No Project: field | Project(s) dangling |
No For: field | Model/agent dangling |
| No code-review or security verdict | That verdict's dangling note |
| Metering available but zero tokens | Archivist 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:
- Re-confirms the Issue is closed and the provenance comment landed, and investigates any DANGLING field.
- 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.
- Opens an ordinary Issue for any non-derivable fact the task surfaced.
- Updates
docs-index.mdwhen files were added, removed or renamed. - Collects token rows from the Log's
usageevents for dispatched roles, and from principal-writtenTokens:lines in verdict comments. No.tokens.mdfile is created; theno-disk-statecheck refuses one. - Adds a new comment on the pinned lessons Issue for every
BLOCKERorMAJORfinding that merged. - Opens a follow-up Issue for every
STALE-SPECfinding, unless one exists. - Flags, but never performs, cleanups: orphaned or stale
task/branches, and local worktree removal.<tranche>/ <n>
It reports CLOSE-, with DONE, PROVENANCE, DANGLING and VERDICT sections.
Gates
| Mechanism | Ring | Fails red |
|---|---|---|
Post-merge task archive (vinaya archive) | 2 | Yes, 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
| Key | Effect |
|---|---|
rings. | false skips the whole mechanical half: no provenance, no Issue close |
principals | Whose Tokens: lines count |
tokens | How the Archivist's own usage is collected |
What gets logged
| Act | Log events |
|---|---|
A vinaya archive run | operation · completed |
| A dispatched Archivist turn | dispatch, 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.