@homericintelligence/athena-opencode 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/README.md +30 -17
  2. package/package.json +2 -2
  3. package/plugin.js +20 -5
  4. package/skills/TECHNICAL_ENGLISH.md +78 -0
  5. package/skills/_cli.py +33 -22
  6. package/skills/_plugin.json +1 -0
  7. package/skills/_support/docs/dependency-resolution.md +203 -0
  8. package/skills/_support/docs/policies/development.md +131 -0
  9. package/skills/_support/docs/policies/evidence-integrity.md +40 -0
  10. package/skills/_support/docs/principles/README.md +565 -0
  11. package/skills/_support/docs/principles/details/p001-kiss.md +114 -0
  12. package/skills/_support/docs/principles/details/p002-yagni.md +109 -0
  13. package/skills/_support/docs/principles/details/p003-dry.md +126 -0
  14. package/skills/_support/docs/principles/details/p004-solid.md +165 -0
  15. package/skills/_support/docs/principles/details/p005-modularity.md +123 -0
  16. package/skills/_support/docs/principles/details/p006-principle-of-least-astonishment.md +115 -0
  17. package/skills/_support/docs/principles/details/p007-subtraction-over-addition.md +113 -0
  18. package/skills/_support/docs/principles/details/p008-understand-before-subtracting.md +115 -0
  19. package/skills/_support/docs/principles/details/p009-general-mechanisms-over-special-cases.md +108 -0
  20. package/skills/_support/docs/principles/details/p010-scope-fidelity.md +117 -0
  21. package/skills/_support/docs/principles/details/p011-minimal-coherent-change.md +128 -0
  22. package/skills/_support/docs/principles/details/p012-evidence-before-modification.md +115 -0
  23. package/skills/_support/docs/principles/details/p013-avoid-hasty-abstractions.md +112 -0
  24. package/skills/_support/docs/principles/details/p014-preserve-unrequested-behavior.md +110 -0
  25. package/skills/_support/docs/principles/details/p015-architecture-conformance.md +124 -0
  26. package/skills/_support/docs/principles/details/p016-separation-of-concerns.md +125 -0
  27. package/skills/_support/docs/principles/details/p017-high-cohesion-low-coupling.md +130 -0
  28. package/skills/_support/docs/principles/details/p018-information-hiding.md +128 -0
  29. package/skills/_support/docs/principles/details/p019-explicit-contracts.md +134 -0
  30. package/skills/_support/docs/principles/details/p020-executable-architecture.md +130 -0
  31. package/skills/_support/docs/principles/details/p021-evolutionary-and-reversible-design.md +126 -0
  32. package/skills/_support/docs/principles/details/p022-test-behavior-not-implementation.md +129 -0
  33. package/skills/_support/docs/principles/details/p023-parameterized-table-driven-testing.md +129 -0
  34. package/skills/_support/docs/principles/details/p024-boundary-value-testing.md +128 -0
  35. package/skills/_support/docs/principles/details/p025-property-based-testing-for-invariants.md +133 -0
  36. package/skills/_support/docs/principles/details/p026-regression-before-repair.md +134 -0
  37. package/skills/_support/docs/principles/details/p027-deterministic-and-hermetic-tests.md +128 -0
  38. package/skills/_support/docs/principles/details/p028-test-failure-paths.md +133 -0
  39. package/skills/_support/docs/principles/details/p029-generalize-error-policy-preserve-specific-cause.md +131 -0
  40. package/skills/_support/docs/principles/details/p030-nearest-responsible-error-boundary.md +133 -0
  41. package/skills/_support/docs/principles/details/p031-propagate-rather-than-swallow.md +131 -0
  42. package/skills/_support/docs/principles/details/p032-handle-once-preserve-causality.md +137 -0
  43. package/skills/_support/docs/principles/details/p033-state-safe-failure-semantics.md +140 -0
  44. package/skills/_support/docs/principles/details/p034-fail-fast.md +132 -0
  45. package/skills/_support/docs/principles/details/p035-fail-secure-fail-closed.md +137 -0
  46. package/skills/_support/docs/principles/details/p036-graceful-degradation.md +137 -0
  47. package/skills/_support/docs/principles/details/p037-idempotency-before-retry.md +139 -0
  48. package/skills/_support/docs/principles/details/p038-bounded-retry.md +145 -0
  49. package/skills/_support/docs/principles/details/p039-bounded-waiting.md +151 -0
  50. package/skills/_support/docs/principles/details/p040-bounded-resources.md +138 -0
  51. package/skills/_support/docs/principles/details/p041-backpressure-and-load-shedding.md +141 -0
  52. package/skills/_support/docs/principles/details/p042-fault-isolation-bulkheads.md +140 -0
  53. package/skills/_support/docs/principles/details/p043-circuit-breakers.md +148 -0
  54. package/skills/_support/docs/principles/details/p044-atomicity-where-possible.md +141 -0
  55. package/skills/_support/docs/principles/details/p045-compensation-where-atomicity-is-impossible.md +163 -0
  56. package/skills/_support/docs/principles/details/p046-resumability.md +138 -0
  57. package/skills/_support/docs/principles/details/p047-observability-is-part-of-correctness.md +134 -0
  58. package/skills/_support/docs/principles/details/p048-secure-by-design.md +132 -0
  59. package/skills/_support/docs/principles/details/p049-secure-by-default.md +126 -0
  60. package/skills/_support/docs/principles/details/p050-least-privilege.md +123 -0
  61. package/skills/_support/docs/principles/details/p051-complete-mediation.md +124 -0
  62. package/skills/_support/docs/principles/details/p052-separation-of-duties.md +129 -0
  63. package/skills/_support/docs/principles/details/p053-validate-at-trust-boundaries.md +126 -0
  64. package/skills/_support/docs/principles/details/p054-defense-in-depth.md +135 -0
  65. package/skills/_support/docs/principles/details/p055-minimize-attack-surface.md +133 -0
  66. package/skills/_support/docs/principles/details/p056-secrets-stay-out-of-code-and-context.md +137 -0
  67. package/skills/_support/docs/principles/details/p057-supply-chain-integrity.md +135 -0
  68. package/skills/_support/docs/principles/details/p058-bounded-agent-authority.md +137 -0
  69. package/skills/_support/docs/principles/details/p059-data-is-not-instruction.md +130 -0
  70. package/skills/_support/docs/principles/details/p060-constrain-sub-agents.md +136 -0
  71. package/skills/_support/docs/principles/details/p061-separate-decision-from-high-impact-execution.md +131 -0
  72. package/skills/_support/docs/principles/details/p062-human-approval-for-irreversible-or-high-risk-actions.md +129 -0
  73. package/skills/_support/docs/principles/details/p063-requirement-to-code-traceability.md +116 -0
  74. package/skills/_support/docs/principles/details/p064-requirement-to-test-traceability.md +116 -0
  75. package/skills/_support/docs/principles/details/p065-verify-before-claiming-completion.md +131 -0
  76. package/skills/_support/docs/principles/details/p066-preserve-existing-work.md +114 -0
  77. package/skills/_support/docs/principles/details/p067-no-test-cheating.md +126 -0
  78. package/skills/_support/docs/principles/details/p068-no-validation-bypass.md +119 -0
  79. package/skills/_support/docs/principles/details/p069-independent-review-for-high-risk-changes.md +129 -0
  80. package/skills/_support/docs/principles/details/p070-code-health-must-not-regress.md +116 -0
  81. package/skills/_support/docs/principles/details/p071-consistency-over-personal-preference.md +117 -0
  82. package/skills/_support/docs/principles/details/p072-technical-evidence-over-preference.md +122 -0
  83. package/skills/_support/docs/principles/details/p073-optimize-only-with-evidence.md +123 -0
  84. package/skills/_support/docs/principles/details/p074-prefer-existing-mechanisms.md +121 -0
  85. package/skills/_support/docs/principles/details/p075-make-invalid-states-hard-to-represent.md +128 -0
  86. package/skills/_support/docs/principles/details/p076-parse-then-validate-then-operate.md +133 -0
  87. package/skills/_support/docs/principles/details/p077-separate-policy-from-mechanism.md +112 -0
  88. package/skills/_support/docs/principles/details/p078-single-source-of-truth.md +131 -0
  89. package/skills/_support/docs/principles/details/p079-explicit-ownership-and-lifetimes.md +124 -0
  90. package/skills/_support/docs/principles/details/p080-make-concurrency-deliberate.md +122 -0
  91. package/skills/_support/docs/principles/details/p081-forward-progress-with-safety.md +125 -0
  92. package/skills/_support/docs/principles/details/p082-design-for-cancellation.md +133 -0
  93. package/skills/_support/docs/principles/details/p083-irreversible-actions-last.md +124 -0
  94. package/skills/_support/docs/principles/details/p084-prefer-local-reasoning.md +131 -0
  95. package/skills/_support/docs/principles/details/p085-explicit-is-better-than-implicit.md +123 -0
  96. package/skills/_support/docs/principles/details/p086-readability-counts.md +113 -0
  97. package/skills/_support/docs/principles/details/p087-comments-explain-why-code-explains-what.md +120 -0
  98. package/skills/_support/docs/principles/details/p088-delete-dead-code.md +125 -0
  99. package/skills/_support/docs/principles/details/p089-delete-obsolete-configuration-and-dependencies.md +125 -0
  100. package/skills/_support/docs/principles/details/p090-prefer-negative-code.md +134 -0
  101. package/skills/_support/docs/principles/details/p091-test-driven-development.md +149 -0
  102. package/skills/_support/docs/review/README.md +63 -0
  103. package/skills/_support/docs/review/behavior-first-testing.md +78 -0
  104. package/skills/_support/docs/review/common.md +400 -0
  105. package/skills/_support/docs/review/design-docs.md +74 -0
  106. package/skills/_support/docs/review/issue-planning.md +247 -0
  107. package/skills/_support/docs/review/language-routing.md +141 -0
  108. package/skills/_support/docs/review/repository-scorecard.md +170 -0
  109. package/skills/advise/SKILL.md +108 -74
  110. package/skills/advise/scripts/list_retrievable_skills.py +20 -8
  111. package/skills/advise/scripts/resolve_knowledge_checkout.py +533 -0
  112. package/skills/brainstorm/SKILL.md +163 -127
  113. package/skills/change-review/SKILL.md +91 -71
  114. package/skills/change-review/references/scope-resolution.md +69 -46
  115. package/skills/change-review/scripts/resolve_scope.py +144 -84
  116. package/skills/finalize-plan/SKILL.md +205 -139
  117. package/skills/git-worktrees/SKILL.md +100 -80
  118. package/skills/git-worktrees/scripts/prepare_worktree.py +34 -15
  119. package/skills/issue-review/SKILL.md +136 -79
  120. package/skills/learn/SKILL.md +359 -192
  121. package/skills/myrmidon-swarm/SKILL.md +126 -86
  122. package/skills/plan-issue/SKILL.md +122 -81
  123. package/skills/pr-review/SKILL.md +184 -116
  124. package/skills/pr-review/references/criteria.md +61 -37
  125. package/skills/pr-review/references/delivery.md +277 -101
  126. package/skills/pr-review/references/evidence.md +346 -149
  127. package/skills/pr-review/references/prevalidated.md +93 -61
  128. package/skills/pr-review/scripts/collect_evidence.py +312 -162
  129. package/skills/pr-review/scripts/deliver_go.py +701 -0
  130. package/skills/pr-review/scripts/diff_context.py +34 -15
  131. package/skills/pr-review/scripts/materialize_snapshot.py +141 -130
  132. package/skills/pr-review/scripts/pr_identity.py +27 -15
  133. package/skills/pr-review/scripts/resolve_pr.py +77 -41
  134. package/skills/realign/SKILL.md +516 -0
  135. package/skills/realign/references/aislop-integration.md +215 -0
  136. package/skills/realign/references/architecture-and-structure.md +271 -0
  137. package/skills/realign/references/control-flow-and-errors.md +344 -0
  138. package/skills/realign/references/tests-dependencies-and-security.md +261 -0
  139. package/skills/realign/scripts/resolve_assessment.py +1525 -0
  140. package/skills/repo-review/SKILL.md +202 -131
  141. package/skills/simplify/SKILL.md +174 -0
  142. package/skills/systematic-debugging/SKILL.md +212 -192
  143. package/skills/systematic-debugging/scripts/repository_evidence.py +26 -8
  144. package/skills/test-driven-development/SKILL.md +126 -96
  145. package/skills/tidy/SKILL.md +104 -59
  146. package/skills/tidy/scripts/run_tidy.py +54 -6
@@ -1,178 +1,244 @@
1
1
  ---
2
2
  name: finalize-plan
3
3
  license: BSD-3-Clause
4
- description: Materialize one exact, actor-owned, GO-reviewed issue-planning epoch into its implementation-facing issue body. Use after plan-issue and issue-review approve a plan; `--draft` is read-only and every missing, foreign, stale, ambiguous, or unverifiable input fails closed.
4
+ description: Create an issue body after `plan-issue` and `issue-review` approve one exact actor-owned epoch with `GO`. `--draft` is read-only. Stop if an input is missing, foreign, stale, ambiguous, or not verifiable.
5
5
  argument-hint: "[--draft] ISSUE_NUMBER_OR_URL"
6
6
  allowed-tools: [Read, Bash, Grep, Glob]
7
7
  ---
8
8
 
9
9
  # Finalize an approved issue plan
10
10
 
11
- Why: an approved plan should be the readable implementation entry point without
12
- turning review history, suggestions, or a generated body into new requirements.
11
+ Purpose: Make the approved plan the implementation entry point. Do not convert review history,
12
+ suggestions, or generated text into requirements.
13
13
 
14
- Use the shared [issue-planning contract](../../docs/review/issue-planning.md),
15
- [review contract](../../docs/review/common.md),
16
- [design-document structure](../../docs/review/design-docs.md),
17
- [language routing](../../docs/review/language-routing.md), and
18
- [behavior-first testing](../../docs/review/behavior-first-testing.md).
14
+ Apply the [ASD-STE100 technical-English policy](../TECHNICAL_ENGLISH.md) to this skill and to all
15
+ prose that it produces.
16
+
17
+ Use the shared [issue-planning contract](../_support/docs/review/issue-planning.md),
18
+ [review contract](../_support/docs/review/common.md),
19
+ [design-document structure](../_support/docs/review/design-docs.md),
20
+ [language routing](../_support/docs/review/language-routing.md), and
21
+ [behavior-first testing](../_support/docs/review/behavior-first-testing.md).
19
22
 
20
23
  ## Engineering principles
21
24
 
22
- Apply the canonical [engineering-principles catalog](../../docs/principles/README.md) through these
25
+ Use the canonical [engineering-principles catalog](../_support/docs/principles/README.md) to make these
23
26
  finalization decisions:
24
27
 
25
- - [P010 Scope Fidelity](../../docs/principles/README.md#p010),
26
- [P061 Separate Decision from High-Impact Execution](../../docs/principles/README.md#p061), and
27
- [P062 Human Approval for Irreversible or High-Risk Actions](../../docs/principles/README.md#p062)
28
- constrain writes to the exact verified epoch and the authority already granted by this skill's
29
- delivery contract; P062 does not introduce a redundant approval for that authorized write.
30
- - [P063 Requirement-to-Code Traceability](../../docs/principles/README.md#p063) requires a lossless
31
- source-to-final-body mapping, while
32
- [P065 Verify Before Claiming Completion](../../docs/principles/README.md#p065) requires exact
33
- readback evidence before the body replacement is reported as successful.
34
- - [P044 Atomicity Where Possible](../../docs/principles/README.md#p044) keeps the body replacement to
35
- one logical update;
36
- [P083 Irreversible Actions Last](../../docs/principles/README.md#p083) delays comment deletion until
37
- that update is verified; and
38
- [P031 Propagate Rather Than Swallow](../../docs/principles/README.md#p031) preserves partial or
39
- unknown outcomes instead of hiding or blindly retrying them.
28
+ - [P010 Scope Fidelity](../_support/docs/principles/README.md#p010): Change only the issue body and the two
29
+ sealed, actor-owned comments for the verified epoch.
30
+ - [P061 Separate Decision from High-Impact Execution](../_support/docs/principles/README.md#p061): Before a
31
+ write, make sure that the epoch and authority agree with this skill's delivery contract.
32
+ - [P062 Human Approval for Irreversible or High-Risk Actions](../_support/docs/principles/README.md#p062):
33
+ If the delivery contract gives authority for the write, continue without a second approval.
34
+ - [P063 Requirement-to-Code Traceability](../_support/docs/principles/README.md#p063): Map each source
35
+ requirement to the issue body without information loss.
36
+ - [P065 Verify Before Claiming Completion](../_support/docs/principles/README.md#p065): Before you report
37
+ that finalization is completed, read the issue body. Make sure that it is the same as the approved
38
+ body.
39
+ - [P044 Atomicity Where Possible](../_support/docs/principles/README.md#p044): Use one body update for the
40
+ replacement.
41
+ - [P083 Irreversible Actions Last](../_support/docs/principles/README.md#p083): Do not remove an applicable
42
+ comment before you verify the body update.
43
+ - [P031 Propagate Rather Than Swallow](../_support/docs/principles/README.md#p031): Report each partial or
44
+ unknown outcome. Do not report a different outcome. Do not automatically retry the update.
40
45
 
41
46
  ## Scope and delivery
42
47
 
43
- `--draft` is read-only. Without it, after the immediate authority and target revalidation required by
44
- [P061 Separate Decision from High-Impact Execution](../../docs/principles/README.md#p061), this skill
45
- may replace the resolved issue
46
- body once and, only after exact body readback, delete the two sealed,
47
- actor-owned plan and review comments. It must not update the title, labels,
48
- assignment, milestone, project fields, state, branches, pull requests, or
49
- repository files. The finalized body retains the required provenance after
50
- those intermediate comments are removed.
51
-
52
- Use the forge's native issue-body mechanism. If the host cannot authenticate the
53
- actor, enumerate and delete exact comments, read the issue body, compare
54
- identities, or make and read back one exact body update, return a
55
- ready-to-publish draft and identify the capability gap. Never create, adopt,
56
- edit, or replace plan or review comments to make finalization possible.
48
+ `--draft` is read-only. If you do not use `--draft`, first revalidate the authority and target under
49
+ [P061 Separate Decision from High-Impact Execution](../_support/docs/principles/README.md#p061). This skill
50
+ can then replace the resolved issue body one time. Only after an exact body readback, it can delete
51
+ the two sealed, actor-owned plan and review comments. Do not update these items:
52
+
53
+ - title;
54
+ - labels;
55
+ - assignment;
56
+ - milestone;
57
+ - project fields;
58
+ - state;
59
+ - branches;
60
+ - pull requests; or
61
+ - repository files.
62
+
63
+ After the skill removes the intermediate comments, the finalized body must retain the required
64
+ provenance.
65
+
66
+ Use the forge's native issue-body mechanism. The host must have these capabilities:
67
+
68
+ - authenticate the actor;
69
+ - enumerate exact comments;
70
+ - delete exact comments;
71
+ - read the issue body;
72
+ - compare identities;
73
+ - make one exact body update; and
74
+ - read back that body update.
75
+
76
+ If one capability is not available, return a ready-to-publish draft. Identify the capability gap.
77
+ Do not create plan or review comments to make finalization possible. Do not adopt plan or review
78
+ comments for this purpose. Do not edit plan or review comments for this purpose. Do not replace plan
79
+ or review comments for this purpose.
57
80
 
58
81
  ## Finalized planning epoch
59
82
 
60
- An epoch has these sealed source identities:
83
+ A planning epoch is one set of these sealed source identities:
84
+
85
+ - `R` is the canonical digest of the original issue requirements. It contains the exact issue ID,
86
+ title, body, and acceptance criteria before finalization.
87
+ - `P` identifies one actor-owned `<!-- HomericIntelligence:plan-issue -->` comment ID and its canonical plan-content
88
+ digest.
89
+ - `V` identifies one actor-owned `<!-- HomericIntelligence:issue-review -->` comment ID and its review-content
90
+ digest.
91
+
92
+ `P` and `V` must identify different comment IDs. Do not use one comment as both plan and review.
61
93
 
62
- - `R`: the canonical digest of the original issue requirements: exact issue ID,
63
- title, body, and acceptance criteria before finalization;
64
- - `P`: one actor-owned `<!-- athena:plan-issue -->` comment ID and canonical
65
- plan-content digest; and
66
- - `V`: one actor-owned `<!-- athena:issue-review -->` comment ID and
67
- review-content digest.
94
+ The review must contain the same issue, `R`, plan-comment ID, and `P`. These values must match
95
+ exactly. The review must have the exact `GO` disposition. It must not have an unresolved `critical`,
96
+ `major`, or other `required` finding. Do not write if an artifact is conditional, partial,
97
+ malformed, stale, foreign, duplicated, absent, or not verifiable.
68
98
 
69
- The review must embed and exactly match the same issue, `R`, plan-comment ID,
70
- and `P`. It must have an exact `GO` disposition with no unresolved `critical`,
71
- `major`, or other `required` finding. A conditional, partial, malformed, stale,
72
- foreign, duplicated, absent, or unverifiable artifact is not authorization.
99
+ Record exactly one marker in the rendered body:
100
+ `<!-- HomericIntelligence:finalize-plan R=<R> P=<P> V=<V> F=<F> -->`. Before you calculate `F`, use the literal
101
+ `<F>` placeholder as the marker's `F` value. Calculate `F` from the final body. Do not calculate a
102
+ digest from a marker that contains its own digest. The marker identifies the sealed source
103
+ identities separately from the generated body. It also permits later readback verification without
104
+ recursion.
73
105
 
74
- The rendered body records exactly one marker:
75
- `<!-- athena:finalize-plan R=<R> P=<P> V=<V> F=<F> -->`. Define `F` by hashing
76
- the final body after replacing that marker's `F` value with the literal
77
- `<F>` placeholder; do not hash a marker containing its own digest. The marker
78
- lets a host distinguish sealed source identities from the generated body and
79
- verify later readback without recursion.
106
+ For migration only, resolve the exact actor-owned legacy aliases in the shared issue-planning contract.
107
+ Resolve an existing exact `<!-- athena:finalize-plan R=<R> P=<P> V=<V> F=<F> -->` body marker only as
108
+ sealed historical evidence. New finalizations must write the `HomericIntelligence` markers. Do not emit
109
+ both marker versions.
80
110
 
81
111
  ## Finalize
82
112
 
83
- 1. Resolve one exact issue, including node or URL, title, body, state, and
84
- authenticated actor. Enumerate every current comment before interpreting a
85
- marker.
86
- 2. Resolve exactly one actor-owned plan marker and one actor-owned review marker.
87
- Compute `R`, `P`, and `V`, then verify the review's embedded bindings and
88
- clean GO result. Any ownership, multiplicity, binding, disposition, or
89
- required-finding failure returns no write.
90
- 3. Build a compact, lossless synthesis. Apply
91
- [P001 KISS Keep It Simple, Stupid](../../docs/principles/README.md#p001) only
92
- within the sealed content: simplify presentation without dropping requirements or reinterpreting
93
- the approved architecture. Lead with **Why** (the preserved
94
- original problem, outcome, and non-negotiable requirements), then include a
95
- compact system-shape diagram only when it makes at least three relationships,
96
- boundaries, or state transitions materially clearer. Follow with architecture
97
- breakdown, implementation plan, operations, and provenance.
98
- 4. Preserve every acceptance criterion, implementation boundary, validation,
99
- migration or cutover step, rollback condition, dependency, residual risk, and
100
- out-of-scope decision. Record review suggestions as optional residual context
101
- unless the reviewed canonical plan already adopted them. Do not invent files,
102
- commands, requirements, architecture, implementation results, or validation
103
- evidence; do not copy historical revision transcripts or duplicate the plan
104
- and review verbatim when a smaller lossless synthesis suffices.
105
- 5. Add the finalized marker and compute `F` over its non-self-referential
106
- canonical representation. In `--draft`, return the complete body, `R/P/V/F`,
107
- source links, and all withheld-write reasons without invoking a forge write.
108
- 6. Immediately before publication, revalidate authority under
109
- [P061 Separate Decision from High-Impact Execution](../../docs/principles/README.md#p061), then
110
- resolve the issue, actor, every comment and
111
- marker, `R/P/V`, review disposition, and target body again. If any input
112
- drifted, return the ready-to-publish body as stale; do not write.
113
- 7. Publish exactly one issue-body replacement under
114
- [P044 Atomicity Where Possible](../../docs/principles/README.md#p044). Read the issue back
115
- immediately and verify the exact body, marker, `R/P/V`, and `F` under
116
- [P065 Verify Before Claiming Completion](../../docs/principles/README.md#p065). A timeout,
117
- indeterminate
118
- response, or mismatched readback is an unknown outcome: do not retry or make
119
- another mutation.
120
- 8. Under [P083 Irreversible Actions Last](../../docs/principles/README.md#p083), only after successful
121
- body readback, re-read each sealed comment by its exact ID,
122
- actor, marker, and digest, then delete the plan comment and review comment.
123
- Delete no foreign, replacement, or drifted comment. A failed, timed-out, or
124
- indeterminate deletion is a partial-cleanup unknown outcome: do not retry,
125
- compensate, or remove the finalized body; report the surviving identities.
126
-
127
- When the finalized material contains architecture, test, error, or security decisions, preserve the
128
- already-reviewed applications of [P015 Architecture Conformance](../../docs/principles/README.md#p015),
129
- [P022 Test Behavior, Not Implementation](../../docs/principles/README.md#p022),
130
- [P029 Generalize Error Policy; Preserve Specific Cause](../../docs/principles/README.md#p029), and
131
- [P048 Secure by Design](../../docs/principles/README.md#p048); finalization does not reopen those
132
- decisions or invent new ones.
133
-
134
- ## Re-finalization and restart
135
-
136
- If the live body exactly verifies its finalized marker and both sealed comments
137
- are absent, re-running for that epoch returns a documented no-change result. A
138
- surviving sealed comment is partial cleanup, not authorization to retry a prior
139
- deletion. If the marker is absent, malformed, foreign, or its canonical `F` does
140
- not match, the epoch is not valid evidence. A later material human edit is a new
141
- requirements state and must pass a fresh `plan-issue` plus `issue-review` cycle
142
- before another finalization. Do not treat generated plan text or provenance
143
- fields as newly authored requirements.
113
+ 1. Resolve one exact issue with its node or URL, title, body, state, and authenticated actor.
114
+ 2. Before you interpret a marker, enumerate each current comment.
115
+ 3. Resolve exactly one actor-owned plan marker.
116
+ 4. Resolve exactly one actor-owned review marker.
117
+ 5. Calculate `R/P/V`.
118
+ 6. Verify the review bindings and the clean `GO` result.
119
+ 7. If ownership, multiplicity, binding, disposition, or required-finding verification fails, do not
120
+ write.
121
+ 8. Build a compact and lossless final body.
122
+ 9. Apply [P001 KISS Keep It Simple, Stupid](../_support/docs/principles/README.md#p001) only to the
123
+ sealed content.
124
+ 10. Make the presentation simple.
125
+ 11. Do not remove a requirement.
126
+ 12. Do not change the meaning of the approved architecture.
127
+ 13. Start the final body with **Why**.
128
+ 14. Preserve the original problem, outcome, and requirements that cannot change.
129
+ 15. If a system diagram makes at least three relationships, boundaries, or state transitions
130
+ clearer, include it.
131
+ 16. Include the architecture description, implementation plan, operations, and provenance.
132
+ 17. Preserve all items in this list:
133
+
134
+ - acceptance criteria;
135
+ - implementation boundaries;
136
+ - validation;
137
+ - migration or cutover steps;
138
+ - rollback conditions;
139
+ - dependencies;
140
+ - residual risks; and
141
+ - out-of-scope decisions.
142
+
143
+ 18. Unless the reviewed canonical plan adopted a review suggestion, record the suggestion as optional
144
+ residual context.
145
+ 19. Do not invent files, commands, requirements, architecture, implementation results, or validation
146
+ evidence.
147
+ 20. If a smaller lossless result is sufficient, do not copy historical revision transcripts.
148
+ 21. If a smaller lossless result is sufficient, do not duplicate the plan and review verbatim.
149
+ 22. Add the finalized marker.
150
+ 23. Calculate `F` from its canonical representation that does not contain its own value.
151
+ 24. If the user selects `--draft`, return the complete body, `R`, `P`, `V`, `F`, and source links.
152
+ 25. For `--draft`, return all reasons for withheld writes.
153
+ 26. For `--draft`, do not make a forge write.
154
+ 27. Immediately before publication, apply
155
+ [P061 Separate Decision from High-Impact Execution](../_support/docs/principles/README.md#p061).
156
+ 28. For this check, resolve the issue, actor, each comment and marker, `R`, `P`, `V`, review
157
+ disposition, and target body again.
158
+ 29. If an input changed, return the ready-to-publish body with the `stale` status.
159
+ 30. After an input changes, do not write.
160
+ 31. Under [P044 Atomicity Where Possible](../_support/docs/principles/README.md#p044), publish exactly one
161
+ issue-body replacement.
162
+ 32. Immediately read the issue again.
163
+ 33. Under [P065 Verify Before Claiming Completion](../_support/docs/principles/README.md#p065), verify the
164
+ exact body, marker, `R`, `P`, `V`, and `F`.
165
+ 34. If a timeout, indeterminate response, or readback mismatch occurs, report `unknown-outcome`.
166
+ 35. After a timeout, indeterminate response, or readback mismatch, do not retry.
167
+ 36. After a timeout, indeterminate response, or readback mismatch, do not make another mutation.
168
+ 37. Only after a successful body readback, use
169
+ [P083 Irreversible Actions Last](../_support/docs/principles/README.md#p083) to read each sealed comment
170
+ again.
171
+ 38. Verify the exact ID, actor, marker, and digest of each sealed comment.
172
+ 39. Delete the plan comment only after its exact verification.
173
+ 40. Delete the review comment only after its exact verification.
174
+ 41. Do not delete a foreign, replacement, or changed comment.
175
+ 42. If deletion fails, times out, or has an indeterminate result, report `partial-cleanup`.
176
+ 43. State that an indeterminate deletion result is unknown.
177
+ 44. After a deletion failure, timeout, or indeterminate result, do not retry.
178
+ 45. After a deletion failure, timeout, or indeterminate result, do not compensate.
179
+ 46. After a deletion failure, timeout, or indeterminate result, do not remove the finalized body.
180
+ 47. After a deletion failure, timeout, or indeterminate result, report the identities of the comments
181
+ that remain.
182
+
183
+ If the final material contains architecture, test, error, or security decisions, preserve the
184
+ reviewed use of these principles:
185
+
186
+ - [P015 Architecture Conformance](../_support/docs/principles/README.md#p015);
187
+ - [P022 Test Behavior, Not Implementation](../_support/docs/principles/README.md#p022);
188
+ - [P029 Generalize Error Policy; Preserve Specific Cause](../_support/docs/principles/README.md#p029); and
189
+ - [P048 Secure by Design](../_support/docs/principles/README.md#p048).
190
+
191
+ Finalization does not reopen these decisions. Do not make new decisions.
192
+
193
+ ## Finalize again or restart
194
+
195
+ If the live body verifies its finalized marker exactly and both sealed comments are absent, a second
196
+ run returns a documented `no-change` result. If a sealed comment remains, report
197
+ `partial-cleanup`. Its presence does not authorize another deletion attempt. If the marker is absent,
198
+ malformed, foreign, or has a canonical `F` mismatch, do not use the epoch as evidence. A later
199
+ substantive edit by a person creates a new requirements state. Before another finalization, this new
200
+ state must pass a new `plan-issue` and `issue-review` cycle. Do not treat generated plan text or
201
+ provenance fields as new requirements from a person.
144
202
 
145
203
  ## Behavior-first verification
146
204
 
147
- Use controlled issue, comment, actor, and forge fixtures to demonstrate:
205
+ Use controlled issue, comment, actor, and forge fixtures to demonstrate these behaviors:
148
206
 
149
- - one clean GO plan/review epoch preserves requirements and operational details;
150
- - `--draft` returns the body without a forge mutation;
151
- - publish performs one body update, verifies its exact readback, then deletes
152
- only the two sealed actor-owned comments;
153
- - an unchanged sealed epoch is idempotent; and
154
- - every absent, foreign, duplicate, mismatched, stale, NO-GO, required-finding,
155
- drift, unsupported-write, timeout, readback-mismatch, or deletion-uncertainty
156
- case fails before an unsafe mutation or retry.
207
+ - A clean `GO` plan and review epoch preserves requirements and operational details.
208
+ - `--draft` returns the body without a forge mutation.
209
+ - Publication makes one body update. It verifies the exact readback. Then it deletes only the two
210
+ sealed actor-owned comments.
211
+ - A sealed epoch that did not change is idempotent.
212
+ - Each absent, foreign, duplicate, mismatched, stale, `NO-GO`, required-finding, drift,
213
+ unsupported-write, timeout, readback-mismatch, or deletion-uncertainty case stops before an unsafe
214
+ mutation or retry.
157
215
 
158
- Assert identities, ordering classes, preservation, mutation count and scope, and
159
- failure-before-write behavior. Do not freeze editorial wording, headings,
160
- paragraph counts, or an example issue body.
216
+ Verify the identities and order classes. Verify content preservation and the number and scope of
217
+ mutations. Verify that failures occur before a write. Do not make tests depend on editorial wording,
218
+ headings, paragraph counts, or an example issue body.
161
219
 
162
220
  ## Failed approaches
163
221
 
164
- - Re-finalizing an epoch without a fresh request or a new requirements state.
165
- - Treating generated plan text or sealed provenance fields as newly authored, executable
166
- requirements.
167
- - Bypassing behavior-first verification for wording checks, or inventing files, commands, or
222
+ - Do not finalize an epoch again without a new request or a new requirements state.
223
+ - Do not treat generated plan text or sealed provenance fields as new executable requirements from
224
+ a person.
225
+ - Do not replace behavior-first verification with wording checks. Do not invent files, commands, or
168
226
  validation evidence during synthesis.
169
- - Retrying after a timeout, readback mismatch, or indeterminate deletion instead of reporting the
170
- unknown outcome.
227
+ - After a timeout or readback mismatch, do not retry. Report `unknown-outcome`.
228
+ - After an indeterminate deletion, do not retry. Report `partial-cleanup`. State that the deletion
229
+ result is unknown.
171
230
 
172
231
  ## Result
173
232
 
174
- Return the issue and actor identities; `R/P/V/F`; GO decision and finding
175
- summary; requirement-preservation map; draft, no-change, published, stale,
176
- partial-cleanup, or unknown-outcome status; body-update receipt, readback
177
- evidence, deleted-comment receipts when present; and every unresolved capability
178
- or residual risk.
233
+ Return these items:
234
+
235
+ - issue and actor identities;
236
+ - `R/P/V/F`;
237
+ - the `GO` decision and finding summary;
238
+ - the requirement-preservation map;
239
+ - the exact `draft`, `no-change`, `published`, `stale`, `partial-cleanup`, or `unknown-outcome`
240
+ status;
241
+ - the body-update receipt;
242
+ - readback evidence;
243
+ - deleted-comment receipts, if present; and
244
+ - each unresolved capability or residual risk.