Files
octopus-workflow/core/rules/artifact-index-guards.md
T

39 lines
2.1 KiB
Markdown

> Core 中立版(Increment 4 改写)。术语对照见 core/adapters/TERMINOLOGY.md;本组织实例表述见 dogfood 对应文件。
## Artifact-Index Guards (mandatory)
> Check-mechanized (injection-budget batch-3, [org-internal #3699]): guards
> 1-3's checkable invariants run in the repo's artifact-index-check script
> (`<artifact-index-check-cmd> <ticket>`, see the term mapping; exit 4 =
> violation, `--json` summary; tolerant of wild archive-marker dialects).
> This file is the normative definition, NOT in any `agents_md` injection
> whitelist since 2026-08-29 — do not re-add; the checks run at write/close
> time regardless. Full spec: Pattern 10 in the shared write-patterns doc —
> this rule is its on-demand distill.
### 1. Legacy-prefix scan (never create a duplicate)
Before creating a `## 工件索引` comment, scan the issue's existing comments
for the legacy prefix `## Pipeline 工件追踪表`. If found, UPGRADE it
in place (edit, not create) and rename. NEVER create a second index comment
(DEFECT-1 / [org-internal #1924]). Mechanized: reports the comment_id to edit.
### 2. Never-duplicate invariant (single-comment)
Exactly ONE index comment per source issue, maintained by in-place
comment-edit via the ticket-backend comment API (reuse the same
`comment_id`). Each skill adds/updates ONLY its own rows, never deletes
another skill's rows. Mechanized: >1 prefixed comment (either prefix) →
exit 4.
### 3. Archive-at-close (issue close → archive, by ANY closing agent)
When a source issue is CLOSED — by ANY agent, verify ran or not — the closing
agent edits the index comment in place: (a) add the canonical archive banner
(Pattern 10) ABOVE the table with the actual close date; (b) set EVERY row's
重读 column to `ARCHIVE`. Do NOT delete rows or change 位置-column URLs;
reversible in-place edit. Mechanized: closed-ticket marker + 重读
completeness → exit 4. Sequence/actor notes: the issue-checklist-sync rule
§ 归档动作; primary path `verify` Phase 5.6 (Verifier); verify-skipping routes
(audit-only, documentation, standalone/bugfix) — the closing agent does it.