@homericintelligence/athena-opencode 0.5.1 → 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 (40) hide show
  1. package/package.json +1 -1
  2. package/skills/_cli.py +7 -4
  3. package/skills/_plugin.json +1 -0
  4. package/skills/_support/docs/dependency-resolution.md +49 -38
  5. package/skills/_support/docs/policies/development.md +16 -2
  6. package/skills/_support/docs/principles/README.md +191 -168
  7. package/skills/_support/docs/principles/details/p065-verify-before-claiming-completion.md +7 -5
  8. package/skills/_support/docs/review/README.md +5 -1
  9. package/skills/_support/docs/review/behavior-first-testing.md +5 -0
  10. package/skills/_support/docs/review/common.md +44 -9
  11. package/skills/_support/docs/review/issue-planning.md +36 -9
  12. package/skills/advise/SKILL.md +82 -74
  13. package/skills/advise/scripts/list_retrievable_skills.py +17 -5
  14. package/skills/advise/scripts/resolve_knowledge_checkout.py +533 -0
  15. package/skills/brainstorm/SKILL.md +3 -0
  16. package/skills/change-review/scripts/resolve_scope.py +25 -11
  17. package/skills/finalize-plan/SKILL.md +10 -3
  18. package/skills/git-worktrees/SKILL.md +1 -1
  19. package/skills/git-worktrees/scripts/prepare_worktree.py +18 -5
  20. package/skills/learn/SKILL.md +136 -59
  21. package/skills/pr-review/SKILL.md +33 -15
  22. package/skills/pr-review/references/criteria.md +3 -0
  23. package/skills/pr-review/references/delivery.md +136 -18
  24. package/skills/pr-review/references/evidence.md +92 -12
  25. package/skills/pr-review/scripts/collect_evidence.py +101 -22
  26. package/skills/pr-review/scripts/deliver_go.py +701 -0
  27. package/skills/pr-review/scripts/diff_context.py +28 -11
  28. package/skills/pr-review/scripts/materialize_snapshot.py +29 -10
  29. package/skills/pr-review/scripts/resolve_pr.py +24 -10
  30. package/skills/realign/SKILL.md +516 -0
  31. package/skills/realign/references/aislop-integration.md +215 -0
  32. package/skills/realign/references/architecture-and-structure.md +271 -0
  33. package/skills/realign/references/control-flow-and-errors.md +344 -0
  34. package/skills/realign/references/tests-dependencies-and-security.md +261 -0
  35. package/skills/realign/scripts/resolve_assessment.py +1525 -0
  36. package/skills/simplify/SKILL.md +174 -0
  37. package/skills/systematic-debugging/SKILL.md +2 -0
  38. package/skills/systematic-debugging/scripts/repository_evidence.py +17 -4
  39. package/skills/tidy/SKILL.md +13 -1
  40. package/skills/tidy/scripts/run_tidy.py +51 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homericintelligence/athena-opencode",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Athena provides workflow skills as an opencode plugin.",
5
5
  "license": "BSD-3-Clause",
6
6
  "type": "module",
package/skills/_cli.py CHANGED
@@ -114,11 +114,14 @@ def require_unambiguous_git_merge_base(
114
114
 
115
115
 
116
116
  def plugin_version() -> str:
117
- """Return the version from the canonical Codex plugin manifest."""
118
- manifest = PLUGIN_ROOT / ".codex-plugin" / "plugin.json"
117
+ """Return this corpus's generated version or its adjacent canonical manifest."""
118
+ corpus = Path(__file__).resolve().parent
119
+ manifest = corpus / "_plugin.json"
120
+ if not manifest.exists() and corpus.name == "skills":
121
+ manifest = PLUGIN_ROOT / ".codex-plugin" / "plugin.json"
119
122
  document = json.loads(manifest.read_text(encoding="utf-8"))
120
123
  version = document.get("version") if isinstance(document, dict) else None
121
- if not isinstance(version, str):
124
+ if not isinstance(version, str) or not version.strip():
122
125
  raise TypeError(
123
126
  f"The plugin manifest does not contain a string version: '{manifest}'."
124
127
  )
@@ -138,7 +141,7 @@ class _PluginVersionAction(argparse.Action):
138
141
  del namespace, values, option_string
139
142
  try:
140
143
  version = plugin_version()
141
- except (OSError, TypeError, json.JSONDecodeError) as error:
144
+ except (OSError, TypeError, UnicodeError, json.JSONDecodeError) as error:
142
145
  parser.exit(
143
146
  1,
144
147
  f"{parser.prog}: error: The tool cannot read the plugin version: "
@@ -0,0 +1 @@
1
+ {"version": "0.5.2"}
@@ -1,54 +1,64 @@
1
- # Required repository resolution
1
+ # Repository resolution
2
2
 
3
3
  Apply the [ASD-STE100 technical-English policy](../../TECHNICAL_ENGLISH.md) to all English technical prose
4
4
  in this document.
5
5
 
6
- **Why:** Athena must use trusted and current knowledge and automation. It must not use a repository
7
- only because it has a similar name. It must not use a stale checkout or an unverified remote.
6
+ **Why:** Athena must use trusted and current repositories when it changes Mnemosyne or executes
7
+ Hephaestus. Read-only knowledge can use a validated local checkout and then try a best-effort
8
+ refresh. Athena must not report an unverified remote or stale checkout as current.
8
9
 
9
10
  ## At a glance
10
11
 
11
- During normal resolution, Athena does these steps:
12
+ During normal resolution for a write or automation execution, Athena does these steps:
12
13
 
13
14
  1. It resolves a trusted owner.
14
15
  2. It synchronizes an exact checkout.
15
16
  3. It binds use to the reported revision.
16
17
 
17
- A trust, authentication, checkout, or update failure stops the dependent skill.
18
+ A trust, authentication, checkout, or update failure stops that write or automation execution.
18
19
 
19
- In planning mode, an explicit read-only path can use an existing checkout as a best-effort source.
20
- This path does not synchronize with the upstream repository. It must do these actions:
20
+ All read-only Mnemosyne paths validate the local checkout first. If `gh`, authentication, and
21
+ network access are available, Athena then tries a best-effort refresh. If the refresh cannot run
22
+ or fails, Athena keeps the validated local checkout and reports the freshness limit. This path
23
+ must do these actions:
21
24
 
22
25
  - bind use to the current `HEAD`;
23
- - report the current `HEAD`;
26
+ - report the current `HEAD` or the refreshed revision;
24
27
  - report the freshness and trust limits;
25
28
  - never substitute a different repository; and
26
- - never make a durable write.
29
+ - never make a durable write from that checked state.
27
30
 
28
- A skill can impose stricter requirements. The `learn` skill requires a usable checkout before it
29
- starts discovery or writes a lesson. In planning mode, its discovery path does not create a checkout.
31
+ If local knowledge is unavailable, stop only knowledge retrieval. Continue the primary task. The
32
+ `learn` skill can classify a candidate, but it must complete normal resolution and duplicate checks
33
+ before a durable write.
30
34
 
31
35
  ```mermaid
32
36
  flowchart LR
33
- A["Resolve dependency"] --> B{"Is there an explicit owner?"}
34
- B -->|yes| C["Validate override"]
35
- B -->|no| D{"Is there a trusted organization fork?"}
36
- D -->|yes| E["Use maintained fork"]
37
- D -->|no| F["Use canonical upstream"]
38
- C --> G["Verify origin and clean checkout"]
39
- E --> G
40
- F --> G
41
- G --> H{"Is this the read-only planning path?"}
42
- H -->|yes| I["Inspect existing checkout; bind current HEAD; report limits"]
43
- H -->|no| J["Fetch, fast-forward, and bind SHA"]
44
- J --> K["Revalidate automatic-fork trust before use"]
37
+ A["Resolve dependency"] --> B{"Read-only Mnemosyne use?"}
38
+ B -->|yes| C{"Is a local checkout readable?"}
39
+ C -->|no| E["Report no local guidance; continue primary task"]
40
+ C -->|yes| D["Bind local HEAD and report limits"]
41
+ D --> F{"Can gh auth and discovery run?"}
42
+ F -->|yes| G["Try refresh, then report the updated revision or the local fallback"]
43
+ F -->|no| H["Keep the validated local revision and report the freshness limit"]
44
+ B -->|no| I{"Is there an explicit owner?"}
45
+ I -->|yes| J["Validate override"]
46
+ I -->|no| K{"Is there a trusted organization fork?"}
47
+ K -->|yes| L["Use maintained fork"]
48
+ K -->|no| M["Use canonical upstream"]
49
+ J --> N["Verify origin and clean checkout"]
50
+ L --> N
51
+ M --> N
52
+ N --> O["Fetch, fast-forward, and bind SHA"]
53
+ O --> P["Revalidate automatic-fork trust before use"]
45
54
  ```
46
55
 
47
56
  ## Component details
48
57
 
49
58
  ### Owner selection
50
59
 
51
- For dependency `<Repository>` with environment override `<OWNER_VARIABLE>`, use these steps:
60
+ For a route that needs normal resolution of dependency `<Repository>` with environment override
61
+ `<OWNER_VARIABLE>`, use these steps:
52
62
 
53
63
  1. If `<OWNER_VARIABLE>` is not empty, select `<value>/<Repository>`.
54
64
 
@@ -123,7 +133,8 @@ information:
123
133
 
124
134
  ### Checkout and revalidation
125
135
 
126
- Normal resolution requires these capabilities:
136
+ Normal resolution applies to Mnemosyne delivery and Hephaestus execution. It requires these
137
+ capabilities:
127
138
 
128
139
  - authenticated GitHub CLI (`gh`);
129
140
  - `git`; and
@@ -140,7 +151,7 @@ repository. For an existing checkout, do these checks and actions:
140
151
  - Report the resolved repository and commit SHA.
141
152
 
142
153
  For an automatically selected same-owner fork, repeat the trust checks immediately before use. Do
143
- this before you read knowledge or execute automation. Re-query these values:
154
+ this before you write knowledge or execute automation. Re-query these values:
144
155
 
145
156
  - the Organization owner of the current repository;
146
157
  - the permission of the viewer;
@@ -153,15 +164,15 @@ Require these values to agree with the reported trust decision. Require the chec
153
164
  agree with the re-queried tip SHA. Stop if a value does not agree. This check closes the race between
154
165
  resolution and use.
155
166
 
156
- ### Read-only local best effort
167
+ ### Read-only knowledge access
157
168
 
158
- Use this exception only for a read-only planning path or a `learn` discovery path. The path can
159
- inspect an existing checkout. It can bind use to the current `HEAD` without these actions:
169
+ Use this path for all read-only Mnemosyne retrieval. Inspect the existing checkout first. Bind use
170
+ to the current `HEAD`. If `gh`, authentication, and network access are available, try a refresh. If
171
+ the refresh cannot run or fails, keep the validated local checkout and report the freshness limit.
160
172
 
161
- - clone;
162
- - fetch;
163
- - fast-forward; or
164
- - revalidation of an automatic fork.
173
+ Do not require the local checkout to have the newest Mnemosyne revision. Do not require its
174
+ revision to agree with the installed Athena revision. The installed skill supplies its own
175
+ retrieval contract.
165
176
 
166
177
  Report this information:
167
178
 
@@ -170,11 +181,11 @@ Report this information:
170
181
  - the trust basis or trust uncertainty; and
171
182
  - the freshness limit.
172
183
 
173
- If the checkout is missing or inspection fails, stop the dependent knowledge retrieval. The caller
174
- can continue its primary plan only when its skill contract permits planning without guidance. The
175
- `learn` skill does not permit this fallback. It blocks without an existing usable checkout.
184
+ If the checkout is missing or inspection fails, stop the dependent knowledge retrieval. Continue the
185
+ primary task. `learn` can classify an undelivered candidate, but it cannot make a duplicate decision
186
+ or publish a write until normal resolution succeeds.
176
187
 
177
- For normal execution and the `learn` delivery boundary, these conditions are fatal:
188
+ For Hephaestus execution and the `learn` delivery boundary, these conditions are fatal:
178
189
 
179
190
  - an authentication failure;
180
191
  - a missing repository;
@@ -185,7 +196,7 @@ For normal execution and the `learn` delivery boundary, these conditions are fat
185
196
  - a fetch failure; or
186
197
  - a fast-forward failure.
187
198
 
188
- The read-only local exception never permits pull-request creation before upstream synchronization.
199
+ Read-only local access never permits pull-request creation before upstream synchronization.
189
200
 
190
201
  Mnemosyne writes use isolated worktrees and always end in a pull request. Athena reads or executes
191
202
  Hephaestus from its canonical checkout. Athena never edits Hephaestus unless the user explicitly asks
@@ -25,9 +25,15 @@ or failure requirement to make text shorter.
25
25
 
26
26
  - Target `main`.
27
27
  - Keep the scope aligned with one issue or one coherent maintenance objective.
28
+ - Before you create a pull request, run each new or changed test with a focused local command.
29
+ Confirm that the command selects that test and that the test passes.
30
+ - Continuous integration and continuous delivery (CI/CD) workflows, not pre-commit, run the
31
+ automatic pytest tiers. Focused local validation does not replace CI/CD validation.
28
32
  - If an issue tracks the work, put `Closes #N` on its own line in the body.
29
33
  - Run required checks against the current head revision. The checks must be successful, current, and
30
34
  not incorrectly skipped.
35
+ - Do not say that a check passed in the PR description unless the description can cite the current
36
+ head receipt that supports the claim.
31
37
  - Before auto-merge or merge, get an independent strict review.
32
38
  - Use a merge method that the repository supports. Do not guess or impose an organization-wide
33
39
  fallback.
@@ -90,10 +96,17 @@ or failure requirement to make text shorter.
90
96
 
91
97
  - Add such an artifact only when a current consumer requires it. The owner and update method must be
92
98
  explicit.
99
+ - The marked development-principles block in root `AGENTS.md` is generated data that the fleet
100
+ agent-contract validator consumes. `docs/principles/README.md` owns its content. The
101
+ agent-contract renderer owns its update method. Do not edit the block manually.
102
+ - Use this sequence for each change: remove, reuse, consolidate, simplify, then add. Add only when
103
+ the earlier choices cannot meet the requirement.
93
104
  - Tests must verify computable behavior, data contracts, security properties, or executable artifact
94
105
  structure.
95
106
  - Do not test prose wording, headings, paragraph presence, document counts, or duplicated text
96
107
  strings.
108
+ - Exact machine-consumed fields are data contracts, not editorial prose. This exception includes
109
+ the root `CLAUDE.md` pointer and the generated development-principles block.
97
110
  - Markdown lint and link checks can verify document syntax and link resolution. They must not freeze
98
111
  editorial content.
99
112
  - Prefer stable public outcomes to these types of assertions:
@@ -113,5 +126,6 @@ or failure requirement to make text shorter.
113
126
 
114
127
  Human review and Code Owner review are optional for Athena changes. They are not required.
115
128
  `CODEOWNERS` records advisory ownership. The baseline ruleset does not require an approval count or a
116
- Code Owner approval. Workflow, release, dependency, and security-control changes remain subject to
117
- the required checks and requested-scope boundaries of the repository.
129
+ Code Owner approval. The baseline ruleset still requires extra approval for unattributed changes.
130
+ Workflow, release, dependency, and security-control changes remain subject to the required checks
131
+ and requested-scope boundaries of the repository.
@@ -38,8 +38,45 @@ ungranted high-impact actions. A different party does an independent review. The
38
38
  qualifications sufficient for the risk. Human review is necessary only when applicable policy specifies
39
39
  a human.
40
40
 
41
+ ## Topic anchors
42
+
43
+ Review contracts use these stable topic anchors to classify a surface. The numeric catalog below is
44
+ authoritative. Each detail page describes relationships with other principles.
45
+
41
46
  ## Simplicity and change
42
47
 
48
+ Use this topic for scope, change size, reversibility, deletion, and necessary complexity.
49
+
50
+ ## Architecture, interfaces, and state
51
+
52
+ Use this topic for boundaries, dependencies, interfaces, ownership, and state.
53
+
54
+ ## Testing and evidence
55
+
56
+ Use this topic for test design, traceability, verification, and evidence.
57
+
58
+ ## Error handling
59
+
60
+ Use this topic for failures, diagnostics, recovery, and cleanup.
61
+
62
+ ## Distributed reliability
63
+
64
+ Use this topic for concurrency, retries, idempotency, coordination, and operations.
65
+
66
+ ## Security and supply chain
67
+
68
+ Use this topic for trust boundaries, validation, dependencies, provenance, and least privilege.
69
+
70
+ ## Agent authority
71
+
72
+ Use this topic for scope, permissions, external effects, and human approval.
73
+
74
+ ## Stewardship and judgment
75
+
76
+ Use this topic for preservation, code health, technical evidence, and delivery.
77
+
78
+ ## Canonical catalog
79
+
43
80
  ### P001
44
81
 
45
82
  [KISS — Keep It Simple, Stupid](details/p001-kiss.md) — Select the design with minimum complexity that
@@ -55,6 +92,22 @@ configuration, and infrastructure only for a specified current requirement.
55
92
  [DRY — Don't Repeat Yourself](details/p003-dry.md) — Give each authoritative rule or item of
56
93
  knowledge one canonical representation.
57
94
 
95
+ ### P004
96
+
97
+ [SOLID](details/p004-solid.md) — Give each responsibility one clear owner. Connect each extension seam
98
+ to a requirement. Make substitutions keep contracts. Make each interface applicable to its consumer.
99
+ Keep high-level policy free from dependencies on details that can change.
100
+
101
+ ### P005
102
+
103
+ [Modularity](details/p005-modularity.md) — Make cohesive modules with narrow interfaces and low
104
+ coupling. Thus, local changes have local effects.
105
+
106
+ ### P006
107
+
108
+ [POLA — Principle of Least Astonishment](details/p006-principle-of-least-astonishment.md) — Make
109
+ interfaces, defaults, behavior, and failures agree with user expectations that evidence shows.
110
+
58
111
  ### P007
59
112
 
60
113
  [Subtraction Over Addition](details/p007-subtraction-over-addition.md) — Before you add a component,
@@ -97,57 +150,6 @@ show the same stable concept, generalize. When the alternative is an incorrect a
97
150
  [Preserve Unrequested Behavior](details/p014-preserve-unrequested-behavior.md) — Unless a specified
98
151
  requirement changes them, keep current observable contracts.
99
152
 
100
- ### P021
101
-
102
- [Evolutionary and Reversible Design](details/p021-evolutionary-and-reversible-design.md) — Select
103
- incremental, migration-safe steps. Each step must let an author make sure that the step is correct,
104
- use a bounded rollback, or use a bounded roll-forward path.
105
-
106
- ### P073
107
-
108
- [Optimize Only With Evidence](details/p073-optimize-only-with-evidence.md) — Measure first. When
109
- measurements show a constraint or bottleneck, add optimization complexity.
110
-
111
- ### P074
112
-
113
- [Prefer Existing Mechanisms](details/p074-prefer-existing-mechanisms.md) — Before you make a new
114
- mechanism, select an applicable repository, language, framework, or standard-library mechanism.
115
-
116
- ### P088
117
-
118
- [Delete Dead Code](details/p088-delete-dead-code.md) — Remove code that no execution path or consumer
119
- uses. Also remove unreachable, superseded, or obsolete code. First, make sure that deletion is safe.
120
-
121
- ### P089
122
-
123
- [Delete Obsolete Configuration and Dependencies](details/p089-delete-obsolete-configuration-and-dependencies.md)
124
- — After evidence shows that no consumer uses the artifact, remove the configuration, dependencies,
125
- tests, documentation, and scaffolding.
126
-
127
- ### P090
128
-
129
- [Prefer Negative Code](details/p090-prefer-negative-code.md) — For equally correct and clear
130
- solutions, select less code and maintenance. Also select less state, configuration, dependency surface,
131
- and conceptual complexity.
132
-
133
- ## Architecture, interfaces, and state
134
-
135
- ### P004
136
-
137
- [SOLID](details/p004-solid.md) — Give each responsibility one clear owner. Connect each extension seam
138
- to a requirement. Make substitutions keep contracts. Make each interface applicable to its consumer.
139
- Keep high-level policy free from dependencies on details that can change.
140
-
141
- ### P005
142
-
143
- [Modularity](details/p005-modularity.md) — Make cohesive modules with narrow interfaces and low
144
- coupling. Thus, local changes have local effects.
145
-
146
- ### P006
147
-
148
- [POLA — Principle of Least Astonishment](details/p006-principle-of-least-astonishment.md) — Make
149
- interfaces, defaults, behavior, and failures agree with user expectations that evidence shows.
150
-
151
153
  ### P015
152
154
 
153
155
  [Architecture Conformance](details/p015-architecture-conformance.md) — If the requirement does not
@@ -180,54 +182,11 @@ inputs, outputs, invariants, ownership, side effects, concurrency, and failure b
180
182
  [Executable Architecture](details/p020-executable-architecture.md) — When resources are sufficient and
181
183
  the check decreases risk, use executable checks for important architecture rules. Do not let prose be the only control.
182
184
 
183
- ### P075
184
-
185
- [Make Invalid States Hard to Represent](details/p075-make-invalid-states-hard-to-represent.md) — Use
186
- types, schemas, construction boundaries, and state machines to prevent invalid combinations.
187
-
188
- ### P076
189
-
190
- [Parse, Then Validate, Then Operate](details/p076-parse-then-validate-then-operate.md) — Parse
191
- each external representation one time. Validate all parts of the parsed structure. Let core logic use
192
- trusted data.
193
-
194
- ### P077
195
-
196
- [Separate Policy from Mechanism](details/p077-separate-policy-from-mechanism.md) — Keep a clear
197
- boundary that divides policy from mechanism. Policy selects an action. The mechanism does the action.
198
-
199
- ### P078
200
-
201
- [Single Source of Truth](details/p078-single-source-of-truth.md) — Give each authoritative mutable
202
- state or policy one explicit owner. Do not give authority to replicas that have different values.
203
-
204
- ### P079
205
-
206
- [Explicit Ownership and Lifetimes](details/p079-explicit-ownership-and-lifetimes.md) — Give resources,
207
- tasks, locks, and temporary state a clear owner and deterministic cleanup or termination.
208
-
209
- ### P084
210
-
211
- [Prefer Local Reasoning](details/p084-prefer-local-reasoning.md) — Give a reader sufficient information about a component
212
- without access to hidden state or control flow in other components.
213
-
214
- ### P085
215
-
216
- [Explicit Is Better Than Implicit](details/p085-explicit-is-better-than-implicit.md) — Make important
217
- dependencies, transitions, configuration, conversions, and side effects clear.
218
-
219
- ### P086
220
-
221
- [Readability Counts](details/p086-readability-counts.md) — Use clear names, simple control flow,
222
- cohesive functions, and clear data structures to make correct behavior and maintenance easier.
223
-
224
- ### P087
225
-
226
- [Comments Explain Why, Code Explains What](details/p087-comments-explain-why-code-explains-what.md) —
227
- Make mechanics clear in code. Write comments only for rationale, constraints, invariants, and context
228
- that code cannot show.
185
+ ### P021
229
186
 
230
- ## Testing and evidence
187
+ [Evolutionary and Reversible Design](details/p021-evolutionary-and-reversible-design.md) — Select
188
+ incremental, migration-safe steps. Each step must let an author make sure that the step is correct,
189
+ use a bounded rollback, or use a bounded roll-forward path.
231
190
 
232
191
  ### P022
233
192
 
@@ -268,47 +227,6 @@ test results are the same.
268
227
  is correct for invalid input and failures that can occur in operation. Include dependency failure,
269
228
  timeout, cancellation, cleanup, and progress that stops before the end.
270
229
 
271
- ### P063
272
-
273
- [Requirement-to-Code Traceability](details/p063-requirement-to-code-traceability.md) — For each artifact
274
- change, give a link to a requirement, acceptance criterion, defect, invariant, or necessary dependency.
275
-
276
- ### P064
277
-
278
- [Requirement-to-Test Traceability](details/p064-requirement-to-test-traceability.md) — Give each
279
- changed behavior a test that is applicable to its contract and risk.
280
-
281
- ### P065
282
-
283
- [Verify Before Claiming Completion](details/p065-verify-before-claiming-completion.md) — After you
284
- complete the work, examine the change. Before a completion statement, do the applicable repository
285
- checks. Give information about all coverage gaps.
286
-
287
- ### P067
288
-
289
- [No Test Cheating](details/p067-no-test-cheating.md) — Do not change an applicable test to hide an
290
- implementation defect. Do not disable an applicable test to hide an implementation defect.
291
-
292
- ### P068
293
-
294
- [No Validation Bypass](details/p068-no-validation-bypass.md) — If an applicable gate shows a problem,
295
- correct the problem. When an approved narrow exception applies, record the exception. Without an approved
296
- exception, do not disable the gate.
297
-
298
- ### P069
299
-
300
- [Independent Review for High-Risk Changes](details/p069-independent-review-for-high-risk-changes.md)
301
- — Send work with high risk to security or availability to independent review. Reviewer qualifications must
302
- agree with the risk and applicable policy requirements.
303
-
304
- ### P091
305
-
306
- [Test-Driven Development](details/p091-test-driven-development.md) — For behavior changes, write a
307
- narrow test that shows the missing behavior. Make the smallest change that gives a correct test result. Then,
308
- refactor while test results stay correct.
309
-
310
- ## Error handling
311
-
312
230
  ### P029
313
231
 
314
232
  [Generalize Error Policy; Preserve Specific Cause](details/p029-generalize-error-policy-preserve-specific-cause.md)
@@ -352,8 +270,6 @@ available, select that state.
352
270
  [Graceful Degradation](details/p036-graceful-degradation.md) — When a capability has a noncritical
353
271
  failure, continue only in a mode that keeps security and correct operation. Use less functionality in that mode.
354
272
 
355
- ## Distributed reliability
356
-
357
273
  ### P037
358
274
 
359
275
  [Idempotency Before Retry](details/p037-idempotency-before-retry.md) — Use idempotency, keys,
@@ -413,30 +329,6 @@ work can continue safely.
413
329
  structured evidence with a correlation identifier. Do not record sensitive data. This evidence lets
414
330
  operators find causes of operation outcomes.
415
331
 
416
- ### P080
417
-
418
- [Make Concurrency Deliberate](details/p080-make-concurrency-deliberate.md) — When measurements show that
419
- concurrency helps the system, add concurrency. Give explicit definitions for shared state, synchronization,
420
- failure, and cancellation.
421
-
422
- ### P081
423
-
424
- [Forward Progress With Safety](details/p081-forward-progress-with-safety.md) — Make bounded progress.
425
- If progress is not possible, stop with a clear recoverable failure. When the result is unknown, do
426
- not wait without a limit.
427
-
428
- ### P082
429
-
430
- [Design for Cancellation](details/p082-design-for-cancellation.md) — Give rules for cancellation
431
- propagation and resource release after interruption. Keep state correct.
432
-
433
- ### P083
434
-
435
- [Irreversible Actions Last](details/p083-irreversible-actions-last.md) — Before the known point for an
436
- irreversible action, complete validation and reversible work.
437
-
438
- ## Security and supply chain
439
-
440
332
  ### P048
441
333
 
442
334
  [Secure by Design](details/p048-secure-by-design.md) — Make security controls and new trust boundaries
@@ -488,8 +380,6 @@ exception is correct only for an explicit requirement. Use the applicable protec
488
380
  [Supply-Chain Integrity](details/p057-supply-chain-integrity.md) — Keep the dependency count low.
489
381
  Examine each dependency. Use trusted sources. Keep locks, provenance, and integrity for build inputs and artifacts.
490
382
 
491
- ## Agent authority
492
-
493
383
  ### P058
494
384
 
495
385
  [Bounded Agent Authority](details/p058-bounded-agent-authority.md) — Give an agent only the scope,
@@ -517,13 +407,44 @@ Give permissions with a clear decision. Output can be untrusted input. Thus, val
517
407
  — Get action-bound approval from a person. Approval is necessary when the task and applicable
518
408
  contract do not give specified authority.
519
409
 
520
- ## Stewardship and judgment
410
+ ### P063
411
+
412
+ [Requirement-to-Code Traceability](details/p063-requirement-to-code-traceability.md) — For each artifact
413
+ change, give a link to a requirement, acceptance criterion, defect, invariant, or necessary dependency.
414
+
415
+ ### P064
416
+
417
+ [Requirement-to-Test Traceability](details/p064-requirement-to-test-traceability.md) — Give each
418
+ changed behavior a test that is applicable to its contract and risk.
419
+
420
+ ### P065
421
+
422
+ [Verify Before Claiming Completion](details/p065-verify-before-claiming-completion.md) — After you
423
+ complete the work, examine the change. Before a completion statement, do the applicable repository
424
+ checks. Give information about all coverage gaps.
521
425
 
522
426
  ### P066
523
427
 
524
428
  [Preserve Existing Work](details/p066-preserve-existing-work.md) — Do not change existing work that
525
429
  is not in the request.
526
430
 
431
+ ### P067
432
+
433
+ [No Test Cheating](details/p067-no-test-cheating.md) — Do not change an applicable test to hide an
434
+ implementation defect. Do not disable an applicable test to hide an implementation defect.
435
+
436
+ ### P068
437
+
438
+ [No Validation Bypass](details/p068-no-validation-bypass.md) — If an applicable gate shows a problem,
439
+ correct the problem. When an approved narrow exception applies, record the exception. Without an approved
440
+ exception, do not disable the gate.
441
+
442
+ ### P069
443
+
444
+ [Independent Review for High-Risk Changes](details/p069-independent-review-for-high-risk-changes.md)
445
+ — Send work with high risk to security or availability to independent review. Reviewer qualifications must
446
+ agree with the risk and applicable policy requirements.
447
+
527
448
  ### P070
528
449
 
529
450
  [Code Health Must Not Regress](details/p070-code-health-must-not-regress.md) — A change must not
@@ -540,3 +461,105 @@ evidence shows that a change is necessary, use established repository convention
540
461
  [Technical Evidence Over Preference](details/p072-technical-evidence-over-preference.md) — Select an
541
462
  alternative with requirements, measurements, tests, specifications, architecture, and established
542
463
  principles. Do not use personal preference.
464
+
465
+ ### P073
466
+
467
+ [Optimize Only With Evidence](details/p073-optimize-only-with-evidence.md) — Measure first. When
468
+ measurements show a constraint or bottleneck, add optimization complexity.
469
+
470
+ ### P074
471
+
472
+ [Prefer Existing Mechanisms](details/p074-prefer-existing-mechanisms.md) — Before you make a new
473
+ mechanism, select an applicable repository, language, framework, or standard-library mechanism.
474
+
475
+ ### P075
476
+
477
+ [Make Invalid States Hard to Represent](details/p075-make-invalid-states-hard-to-represent.md) — Use
478
+ types, schemas, construction boundaries, and state machines to prevent invalid combinations.
479
+
480
+ ### P076
481
+
482
+ [Parse, Then Validate, Then Operate](details/p076-parse-then-validate-then-operate.md) — Parse
483
+ each external representation one time. Validate all parts of the parsed structure. Let core logic use
484
+ trusted data.
485
+
486
+ ### P077
487
+
488
+ [Separate Policy from Mechanism](details/p077-separate-policy-from-mechanism.md) — Keep a clear
489
+ boundary that divides policy from mechanism. Policy selects an action. The mechanism does the action.
490
+
491
+ ### P078
492
+
493
+ [Single Source of Truth](details/p078-single-source-of-truth.md) — Give each authoritative mutable
494
+ state or policy one explicit owner. Do not give authority to replicas that have different values.
495
+
496
+ ### P079
497
+
498
+ [Explicit Ownership and Lifetimes](details/p079-explicit-ownership-and-lifetimes.md) — Give resources,
499
+ tasks, locks, and temporary state a clear owner and deterministic cleanup or termination.
500
+
501
+ ### P080
502
+
503
+ [Make Concurrency Deliberate](details/p080-make-concurrency-deliberate.md) — When measurements show that
504
+ concurrency helps the system, add concurrency. Give explicit definitions for shared state, synchronization,
505
+ failure, and cancellation.
506
+
507
+ ### P081
508
+
509
+ [Forward Progress With Safety](details/p081-forward-progress-with-safety.md) — Make bounded progress.
510
+ If progress is not possible, stop with a clear recoverable failure. When the result is unknown, do
511
+ not wait without a limit.
512
+
513
+ ### P082
514
+
515
+ [Design for Cancellation](details/p082-design-for-cancellation.md) — Give rules for cancellation
516
+ propagation and resource release after interruption. Keep state correct.
517
+
518
+ ### P083
519
+
520
+ [Irreversible Actions Last](details/p083-irreversible-actions-last.md) — Before the known point for an
521
+ irreversible action, complete validation and reversible work.
522
+
523
+ ### P084
524
+
525
+ [Prefer Local Reasoning](details/p084-prefer-local-reasoning.md) — Give a reader sufficient information about a component
526
+ without access to hidden state or control flow in other components.
527
+
528
+ ### P085
529
+
530
+ [Explicit Is Better Than Implicit](details/p085-explicit-is-better-than-implicit.md) — Make important
531
+ dependencies, transitions, configuration, conversions, and side effects clear.
532
+
533
+ ### P086
534
+
535
+ [Readability Counts](details/p086-readability-counts.md) — Use clear names, simple control flow,
536
+ cohesive functions, and clear data structures to make correct behavior and maintenance easier.
537
+
538
+ ### P087
539
+
540
+ [Comments Explain Why, Code Explains What](details/p087-comments-explain-why-code-explains-what.md) —
541
+ Make mechanics clear in code. Write comments only for rationale, constraints, invariants, and context
542
+ that code cannot show.
543
+
544
+ ### P088
545
+
546
+ [Delete Dead Code](details/p088-delete-dead-code.md) — Remove code that no execution path or consumer
547
+ uses. Also remove unreachable, superseded, or obsolete code. First, make sure that deletion is safe.
548
+
549
+ ### P089
550
+
551
+ [Delete Obsolete Configuration and Dependencies](details/p089-delete-obsolete-configuration-and-dependencies.md)
552
+ — After evidence shows that no consumer uses the artifact, remove the configuration, dependencies,
553
+ tests, documentation, and scaffolding.
554
+
555
+ ### P090
556
+
557
+ [Prefer Negative Code](details/p090-prefer-negative-code.md) — For equally correct and clear
558
+ solutions, select less code and maintenance. Also select less state, configuration, dependency surface,
559
+ and conceptual complexity.
560
+
561
+ ### P091
562
+
563
+ [Test-Driven Development](details/p091-test-driven-development.md) — For behavior changes, write a
564
+ narrow test that shows the missing behavior. Make the smallest change that gives a correct test result. Then,
565
+ refactor while test results stay correct.