@homericintelligence/athena-opencode 0.5.0 → 0.5.1
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.
- package/README.md +30 -17
- package/package.json +2 -2
- package/plugin.js +20 -5
- package/skills/TECHNICAL_ENGLISH.md +78 -0
- package/skills/_cli.py +26 -18
- package/skills/_support/docs/dependency-resolution.md +192 -0
- package/skills/_support/docs/policies/development.md +117 -0
- package/skills/_support/docs/policies/evidence-integrity.md +40 -0
- package/skills/_support/docs/principles/README.md +542 -0
- package/skills/_support/docs/principles/details/p001-kiss.md +114 -0
- package/skills/_support/docs/principles/details/p002-yagni.md +109 -0
- package/skills/_support/docs/principles/details/p003-dry.md +126 -0
- package/skills/_support/docs/principles/details/p004-solid.md +165 -0
- package/skills/_support/docs/principles/details/p005-modularity.md +123 -0
- package/skills/_support/docs/principles/details/p006-principle-of-least-astonishment.md +115 -0
- package/skills/_support/docs/principles/details/p007-subtraction-over-addition.md +113 -0
- package/skills/_support/docs/principles/details/p008-understand-before-subtracting.md +115 -0
- package/skills/_support/docs/principles/details/p009-general-mechanisms-over-special-cases.md +108 -0
- package/skills/_support/docs/principles/details/p010-scope-fidelity.md +117 -0
- package/skills/_support/docs/principles/details/p011-minimal-coherent-change.md +128 -0
- package/skills/_support/docs/principles/details/p012-evidence-before-modification.md +115 -0
- package/skills/_support/docs/principles/details/p013-avoid-hasty-abstractions.md +112 -0
- package/skills/_support/docs/principles/details/p014-preserve-unrequested-behavior.md +110 -0
- package/skills/_support/docs/principles/details/p015-architecture-conformance.md +124 -0
- package/skills/_support/docs/principles/details/p016-separation-of-concerns.md +125 -0
- package/skills/_support/docs/principles/details/p017-high-cohesion-low-coupling.md +130 -0
- package/skills/_support/docs/principles/details/p018-information-hiding.md +128 -0
- package/skills/_support/docs/principles/details/p019-explicit-contracts.md +134 -0
- package/skills/_support/docs/principles/details/p020-executable-architecture.md +130 -0
- package/skills/_support/docs/principles/details/p021-evolutionary-and-reversible-design.md +126 -0
- package/skills/_support/docs/principles/details/p022-test-behavior-not-implementation.md +129 -0
- package/skills/_support/docs/principles/details/p023-parameterized-table-driven-testing.md +129 -0
- package/skills/_support/docs/principles/details/p024-boundary-value-testing.md +128 -0
- package/skills/_support/docs/principles/details/p025-property-based-testing-for-invariants.md +133 -0
- package/skills/_support/docs/principles/details/p026-regression-before-repair.md +134 -0
- package/skills/_support/docs/principles/details/p027-deterministic-and-hermetic-tests.md +128 -0
- package/skills/_support/docs/principles/details/p028-test-failure-paths.md +133 -0
- package/skills/_support/docs/principles/details/p029-generalize-error-policy-preserve-specific-cause.md +131 -0
- package/skills/_support/docs/principles/details/p030-nearest-responsible-error-boundary.md +133 -0
- package/skills/_support/docs/principles/details/p031-propagate-rather-than-swallow.md +131 -0
- package/skills/_support/docs/principles/details/p032-handle-once-preserve-causality.md +137 -0
- package/skills/_support/docs/principles/details/p033-state-safe-failure-semantics.md +140 -0
- package/skills/_support/docs/principles/details/p034-fail-fast.md +132 -0
- package/skills/_support/docs/principles/details/p035-fail-secure-fail-closed.md +137 -0
- package/skills/_support/docs/principles/details/p036-graceful-degradation.md +137 -0
- package/skills/_support/docs/principles/details/p037-idempotency-before-retry.md +139 -0
- package/skills/_support/docs/principles/details/p038-bounded-retry.md +145 -0
- package/skills/_support/docs/principles/details/p039-bounded-waiting.md +151 -0
- package/skills/_support/docs/principles/details/p040-bounded-resources.md +138 -0
- package/skills/_support/docs/principles/details/p041-backpressure-and-load-shedding.md +141 -0
- package/skills/_support/docs/principles/details/p042-fault-isolation-bulkheads.md +140 -0
- package/skills/_support/docs/principles/details/p043-circuit-breakers.md +148 -0
- package/skills/_support/docs/principles/details/p044-atomicity-where-possible.md +141 -0
- package/skills/_support/docs/principles/details/p045-compensation-where-atomicity-is-impossible.md +163 -0
- package/skills/_support/docs/principles/details/p046-resumability.md +138 -0
- package/skills/_support/docs/principles/details/p047-observability-is-part-of-correctness.md +134 -0
- package/skills/_support/docs/principles/details/p048-secure-by-design.md +132 -0
- package/skills/_support/docs/principles/details/p049-secure-by-default.md +126 -0
- package/skills/_support/docs/principles/details/p050-least-privilege.md +123 -0
- package/skills/_support/docs/principles/details/p051-complete-mediation.md +124 -0
- package/skills/_support/docs/principles/details/p052-separation-of-duties.md +129 -0
- package/skills/_support/docs/principles/details/p053-validate-at-trust-boundaries.md +126 -0
- package/skills/_support/docs/principles/details/p054-defense-in-depth.md +135 -0
- package/skills/_support/docs/principles/details/p055-minimize-attack-surface.md +133 -0
- package/skills/_support/docs/principles/details/p056-secrets-stay-out-of-code-and-context.md +137 -0
- package/skills/_support/docs/principles/details/p057-supply-chain-integrity.md +135 -0
- package/skills/_support/docs/principles/details/p058-bounded-agent-authority.md +137 -0
- package/skills/_support/docs/principles/details/p059-data-is-not-instruction.md +130 -0
- package/skills/_support/docs/principles/details/p060-constrain-sub-agents.md +136 -0
- package/skills/_support/docs/principles/details/p061-separate-decision-from-high-impact-execution.md +131 -0
- package/skills/_support/docs/principles/details/p062-human-approval-for-irreversible-or-high-risk-actions.md +129 -0
- package/skills/_support/docs/principles/details/p063-requirement-to-code-traceability.md +116 -0
- package/skills/_support/docs/principles/details/p064-requirement-to-test-traceability.md +116 -0
- package/skills/_support/docs/principles/details/p065-verify-before-claiming-completion.md +129 -0
- package/skills/_support/docs/principles/details/p066-preserve-existing-work.md +114 -0
- package/skills/_support/docs/principles/details/p067-no-test-cheating.md +126 -0
- package/skills/_support/docs/principles/details/p068-no-validation-bypass.md +119 -0
- package/skills/_support/docs/principles/details/p069-independent-review-for-high-risk-changes.md +129 -0
- package/skills/_support/docs/principles/details/p070-code-health-must-not-regress.md +116 -0
- package/skills/_support/docs/principles/details/p071-consistency-over-personal-preference.md +117 -0
- package/skills/_support/docs/principles/details/p072-technical-evidence-over-preference.md +122 -0
- package/skills/_support/docs/principles/details/p073-optimize-only-with-evidence.md +123 -0
- package/skills/_support/docs/principles/details/p074-prefer-existing-mechanisms.md +121 -0
- package/skills/_support/docs/principles/details/p075-make-invalid-states-hard-to-represent.md +128 -0
- package/skills/_support/docs/principles/details/p076-parse-then-validate-then-operate.md +133 -0
- package/skills/_support/docs/principles/details/p077-separate-policy-from-mechanism.md +112 -0
- package/skills/_support/docs/principles/details/p078-single-source-of-truth.md +131 -0
- package/skills/_support/docs/principles/details/p079-explicit-ownership-and-lifetimes.md +124 -0
- package/skills/_support/docs/principles/details/p080-make-concurrency-deliberate.md +122 -0
- package/skills/_support/docs/principles/details/p081-forward-progress-with-safety.md +125 -0
- package/skills/_support/docs/principles/details/p082-design-for-cancellation.md +133 -0
- package/skills/_support/docs/principles/details/p083-irreversible-actions-last.md +124 -0
- package/skills/_support/docs/principles/details/p084-prefer-local-reasoning.md +131 -0
- package/skills/_support/docs/principles/details/p085-explicit-is-better-than-implicit.md +123 -0
- package/skills/_support/docs/principles/details/p086-readability-counts.md +113 -0
- package/skills/_support/docs/principles/details/p087-comments-explain-why-code-explains-what.md +120 -0
- package/skills/_support/docs/principles/details/p088-delete-dead-code.md +125 -0
- package/skills/_support/docs/principles/details/p089-delete-obsolete-configuration-and-dependencies.md +125 -0
- package/skills/_support/docs/principles/details/p090-prefer-negative-code.md +134 -0
- package/skills/_support/docs/principles/details/p091-test-driven-development.md +149 -0
- package/skills/_support/docs/review/README.md +59 -0
- package/skills/_support/docs/review/behavior-first-testing.md +73 -0
- package/skills/_support/docs/review/common.md +365 -0
- package/skills/_support/docs/review/design-docs.md +74 -0
- package/skills/_support/docs/review/issue-planning.md +220 -0
- package/skills/_support/docs/review/language-routing.md +141 -0
- package/skills/_support/docs/review/repository-scorecard.md +170 -0
- package/skills/advise/SKILL.md +93 -67
- package/skills/advise/scripts/list_retrievable_skills.py +3 -3
- package/skills/brainstorm/SKILL.md +160 -127
- package/skills/change-review/SKILL.md +91 -71
- package/skills/change-review/references/scope-resolution.md +69 -46
- package/skills/change-review/scripts/resolve_scope.py +119 -73
- package/skills/finalize-plan/SKILL.md +198 -139
- package/skills/git-worktrees/SKILL.md +100 -80
- package/skills/git-worktrees/scripts/prepare_worktree.py +16 -10
- package/skills/issue-review/SKILL.md +136 -79
- package/skills/learn/SKILL.md +276 -186
- package/skills/myrmidon-swarm/SKILL.md +126 -86
- package/skills/plan-issue/SKILL.md +122 -81
- package/skills/pr-review/SKILL.md +164 -114
- package/skills/pr-review/references/criteria.md +58 -37
- package/skills/pr-review/references/delivery.md +156 -98
- package/skills/pr-review/references/evidence.md +265 -148
- package/skills/pr-review/references/prevalidated.md +93 -61
- package/skills/pr-review/scripts/collect_evidence.py +211 -140
- package/skills/pr-review/scripts/diff_context.py +6 -4
- package/skills/pr-review/scripts/materialize_snapshot.py +112 -120
- package/skills/pr-review/scripts/pr_identity.py +27 -15
- package/skills/pr-review/scripts/resolve_pr.py +53 -31
- package/skills/repo-review/SKILL.md +202 -131
- package/skills/systematic-debugging/SKILL.md +210 -192
- package/skills/systematic-debugging/scripts/repository_evidence.py +9 -4
- package/skills/test-driven-development/SKILL.md +126 -96
- package/skills/tidy/SKILL.md +92 -59
- package/skills/tidy/scripts/run_tidy.py +3 -3
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# P060 — Constrain Sub-Agents
|
|
2
|
+
|
|
3
|
+
## Definition
|
|
4
|
+
|
|
5
|
+
Constrain Sub-Agents means that delegation keeps or narrows the parent task scope and authority. A
|
|
6
|
+
child receives only its necessary objective, context, permissions, credentials, tools, and resource
|
|
7
|
+
budget. The parent classifies child output as untrusted input and validates it.
|
|
8
|
+
|
|
9
|
+
**Aliases:** bounded delegation, capability-safe delegation, constrained multi-agent execution.
|
|
10
|
+
|
|
11
|
+
## Provenance
|
|
12
|
+
|
|
13
|
+
**Classification:** Athena synthesis.
|
|
14
|
+
|
|
15
|
+
This principle adapts confinement, least-privilege, and secure delegation concepts to workflows with
|
|
16
|
+
two or more agents. Historical confinement literature did not give this rule.
|
|
17
|
+
|
|
18
|
+
## Decision rule
|
|
19
|
+
|
|
20
|
+
Delegate only a specified, bounded partition with no more authority than the parent. Before the
|
|
21
|
+
parent accepts a child result, verify the result provenance, scope, and evidence. Verify that
|
|
22
|
+
requested effects comply with the parent contract.
|
|
23
|
+
|
|
24
|
+
## How to apply
|
|
25
|
+
|
|
26
|
+
- Give the child a specified objective, inputs, authorized outputs, constraints, and stop condition.
|
|
27
|
+
- Give the child the minimum necessary context. Do not copy full histories, secrets, or customer
|
|
28
|
+
data that does not apply.
|
|
29
|
+
- Give the child narrower, short-lived capabilities.
|
|
30
|
+
- Do not give the child the parent's credentials.
|
|
31
|
+
- Do not automatically give all tools from the parent.
|
|
32
|
+
- Give only the constrained tool subset that the child task needs.
|
|
33
|
+
- Limit recursion, child count, concurrency, retries, time, tokens, cost, and persistent memory.
|
|
34
|
+
- When identity is important, authenticate inter-agent messages and validate their structured
|
|
35
|
+
contents.
|
|
36
|
+
- Examine outputs and reconcile shared-state changes. When the task ends, revoke access and cancel
|
|
37
|
+
descendants.
|
|
38
|
+
|
|
39
|
+
## Diagram
|
|
40
|
+
|
|
41
|
+
```mermaid
|
|
42
|
+
flowchart TD
|
|
43
|
+
A["Parent task and authority"] --> B["Record a bounded child partition"]
|
|
44
|
+
B --> C["Narrow context, tools, and resource limits"]
|
|
45
|
+
C --> D["Child does assigned work"]
|
|
46
|
+
D --> E["Parent validates result and shared state"]
|
|
47
|
+
E --> F{"Is result in parent contract?"}
|
|
48
|
+
F -- "No" --> G["Reject or return for correction"]
|
|
49
|
+
F -- "Yes" --> H["Accept result and revoke child access"]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Language examples
|
|
53
|
+
|
|
54
|
+
The two examples give a child one page, read-only research access, and a fixed time limit.
|
|
55
|
+
|
|
56
|
+
### Python
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
task = ChildTask(
|
|
60
|
+
paths={"docs/principles/details/p060-constrain-sub-agents.md"},
|
|
61
|
+
tools={Tool.READ_SOURCE},
|
|
62
|
+
deadline=clock.now() + MINUTES_10,
|
|
63
|
+
)
|
|
64
|
+
result = child.run(task)
|
|
65
|
+
validate_result(result, parent.authority)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Rust
|
|
69
|
+
|
|
70
|
+
```rust
|
|
71
|
+
let task = ChildTask {
|
|
72
|
+
paths: HashSet::from(["docs/principles/details/p060-constrain-sub-agents.md"]),
|
|
73
|
+
tools: HashSet::from([Tool::ReadSource]),
|
|
74
|
+
deadline: clock::now() + MINUTES_10,
|
|
75
|
+
};
|
|
76
|
+
let result = child.run(task)?;
|
|
77
|
+
validate_result(&result, &parent.authority)?;
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Boundaries and tensions
|
|
81
|
+
|
|
82
|
+
A sub-agent can make decisions in its assigned partition. The parent does not control each small
|
|
83
|
+
decision. Delegation cannot authorize an action that the parent cannot do. A child
|
|
84
|
+
recommendation cannot expand authority.
|
|
85
|
+
|
|
86
|
+
Agents from one team do not automatically share one trust domain. Concurrent children must have
|
|
87
|
+
specified file or state ownership. Specified ownership prevents accidental replacement of correct
|
|
88
|
+
work.
|
|
89
|
+
|
|
90
|
+
## Examples
|
|
91
|
+
|
|
92
|
+
### Positive
|
|
93
|
+
|
|
94
|
+
A documentation coordinator assigns one child a fixed page set, read-only source access, and a time
|
|
95
|
+
limit. The child cannot commit, publish, access credentials, or edit a different child's partition.
|
|
96
|
+
|
|
97
|
+
### Misuse
|
|
98
|
+
|
|
99
|
+
A parent sends its full conversation, production token, and filesystem access with no scope limits
|
|
100
|
+
to a child. The parent also gives delegation authority with no limit. The child has a one-file
|
|
101
|
+
research task.
|
|
102
|
+
|
|
103
|
+
### Athena and agent workflows
|
|
104
|
+
|
|
105
|
+
Each Athena specialist receives an actor-owned deliverable and specified write paths. Before
|
|
106
|
+
integration, the coordinator examines the returned change and evidence. It does not execute
|
|
107
|
+
embedded commands.
|
|
108
|
+
|
|
109
|
+
## Related principles
|
|
110
|
+
|
|
111
|
+
- [P050 — Least Privilege](p050-least-privilege.md)
|
|
112
|
+
- [P058 — Bounded Agent Authority](p058-bounded-agent-authority.md)
|
|
113
|
+
- [P059 — Data Is Not Instruction](p059-data-is-not-instruction.md)
|
|
114
|
+
- [P069 — Independent Review for High-Risk Changes](p069-independent-review-for-high-risk-changes.md)
|
|
115
|
+
|
|
116
|
+
## References
|
|
117
|
+
|
|
118
|
+
### Source information
|
|
119
|
+
|
|
120
|
+
- [Lampson, *A Note on the Confinement Problem*](https://doi.org/10.1145/362375.362389) is an
|
|
121
|
+
important analysis of limits on a program's information effects. It gives related information,
|
|
122
|
+
not requirements for AI delegation.
|
|
123
|
+
|
|
124
|
+
### Applicable information
|
|
125
|
+
|
|
126
|
+
- [OWASP AI Agent Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/AI_Agent_Security_Cheat_Sheet.html)
|
|
127
|
+
gives context isolation, least privilege, bounded recursion, and checks between agents.
|
|
128
|
+
- [OWASP Top 10 for Agentic Applications 2026](https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/)
|
|
129
|
+
shows identity, privilege, context, communication, and cascade failure risks in agent systems.
|
|
130
|
+
|
|
131
|
+
### More information
|
|
132
|
+
|
|
133
|
+
- [NIST AI 600-1, Generative AI Profile](https://doi.org/10.6028/NIST.AI.600-1) gives a larger
|
|
134
|
+
life cycle risk framework for generative AI systems and human oversight.
|
|
135
|
+
|
|
136
|
+
[Back to the principles catalog](../README.md#p060)
|
package/skills/_support/docs/principles/details/p061-separate-decision-from-high-impact-execution.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# P061 — Separate Decision from High-Impact Execution
|
|
2
|
+
|
|
3
|
+
## Definition
|
|
4
|
+
|
|
5
|
+
Make a decision for a high-impact action independently of the execution mechanism.
|
|
6
|
+
At execution, do a new check of authorization, scope, target, parameters, and necessary approval.
|
|
7
|
+
Before a destructive, privileged, persistent, financial, administrative, or public effect, complete
|
|
8
|
+
these checks.
|
|
9
|
+
|
|
10
|
+
**Aliases:** decision/execution separation, execution-time authorization, two-stage action.
|
|
11
|
+
|
|
12
|
+
## Provenance
|
|
13
|
+
|
|
14
|
+
**Classification:** Athena synthesis.
|
|
15
|
+
|
|
16
|
+
No verified source specifies this rule. The rule uses separation-of-duties controls,
|
|
17
|
+
transaction authorization, and current guidance for human-AI oversight. The rule does not make two
|
|
18
|
+
persons necessary for each operation.
|
|
19
|
+
|
|
20
|
+
## Decision rule
|
|
21
|
+
|
|
22
|
+
A proposal does not give sufficient authority for a high-impact action. Immediately before
|
|
23
|
+
execution, resolve the specified action. Validate its authority and safeguards for the current
|
|
24
|
+
state.
|
|
25
|
+
|
|
26
|
+
## How to apply
|
|
27
|
+
|
|
28
|
+
- Before the side effect, make a reviewable action description.
|
|
29
|
+
- Bind validation to the resolved target, operation, parameters, identity, and current revision.
|
|
30
|
+
- When possible, remove the high-impact capability from plan and dry-run phases.
|
|
31
|
+
- Find state changes between the decision and execution. After a change, validate the action again.
|
|
32
|
+
- When an audit trail is applicable, record the actor, authorization basis, action, and result.
|
|
33
|
+
|
|
34
|
+
## Diagram
|
|
35
|
+
|
|
36
|
+
```mermaid
|
|
37
|
+
flowchart LR
|
|
38
|
+
A["Propose specified action"] --> B["Resolve current target and state"]
|
|
39
|
+
B --> C{"Are safeguards correct?"}
|
|
40
|
+
C -- "No" --> D["Stop"]
|
|
41
|
+
C -- "Yes" --> E{"Does authority include action?"}
|
|
42
|
+
E -- "No" --> F["Receive action-bound approval"]
|
|
43
|
+
F --> G{"Does approval include action?"}
|
|
44
|
+
G -- "No" --> D
|
|
45
|
+
G -- "Yes" --> H["Execute high-impact action"]
|
|
46
|
+
E -- "Yes" --> H
|
|
47
|
+
H --> I["Record result"]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Language examples
|
|
51
|
+
|
|
52
|
+
The two examples validate the resolved target and authorization at the execution boundary.
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
def execute(plan, current, authorize):
|
|
56
|
+
same_action = (
|
|
57
|
+
plan.target == current.target
|
|
58
|
+
and plan.revision == current.revision
|
|
59
|
+
and plan.action_digest == current.action_digest
|
|
60
|
+
)
|
|
61
|
+
if not same_action or not authorize(plan, current):
|
|
62
|
+
raise PermissionError("execution rejected")
|
|
63
|
+
current.apply(plan)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
```rust
|
|
67
|
+
fn execute(plan: &Plan, current: &mut State) -> Result<(), Error> {
|
|
68
|
+
let same_action = plan.target == current.target
|
|
69
|
+
&& plan.revision == current.revision
|
|
70
|
+
&& plan.action_digest == current.action_digest;
|
|
71
|
+
if !same_action || !authorize(plan, current) {
|
|
72
|
+
return Err(Error::Rejected);
|
|
73
|
+
}
|
|
74
|
+
current.apply(plan);
|
|
75
|
+
Ok(())
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Boundaries and tensions
|
|
80
|
+
|
|
81
|
+
This principle does not make a second person or more than one confirmation necessary for each
|
|
82
|
+
reversible action. An authorized operation can continue after execution-time validation unless
|
|
83
|
+
policy specifies a second gate.
|
|
84
|
+
[P062 Human Approval](p062-human-approval-for-irreversible-or-high-risk-actions.md)
|
|
85
|
+
specifies that approval gate. [P052 Separation of Duties](p052-separation-of-duties.md) can specify
|
|
86
|
+
different actors for sensitive work. A ceremonial confirmation with missing or stale details does
|
|
87
|
+
not satisfy this principle.
|
|
88
|
+
|
|
89
|
+
## Examples
|
|
90
|
+
|
|
91
|
+
**Positive:** A deployment plan specifies an immutable release digest and target environment. The
|
|
92
|
+
deployment step validates the digest, target, caller authority, necessary checks, and approval
|
|
93
|
+
before it changes production.
|
|
94
|
+
|
|
95
|
+
**Misuse:** An agent decides to delete a resource. The target and repository state then change. The
|
|
96
|
+
agent uses the stored command.
|
|
97
|
+
|
|
98
|
+
**Athena/agent workflow:** A skill can examine a proposed GitHub change without write authority. The
|
|
99
|
+
executor resolves the repository and target again. It validates current authorization immediately
|
|
100
|
+
before the external change.
|
|
101
|
+
|
|
102
|
+
## Related principles
|
|
103
|
+
|
|
104
|
+
- [P052 Separation of Duties](p052-separation-of-duties.md)
|
|
105
|
+
- [P058 Bounded Agent Authority](p058-bounded-agent-authority.md)
|
|
106
|
+
- [P062 Human Approval for Irreversible or High-Risk Actions](p062-human-approval-for-irreversible-or-high-risk-actions.md)
|
|
107
|
+
- [P083 Irreversible Actions Last](p083-irreversible-actions-last.md)
|
|
108
|
+
|
|
109
|
+
## References
|
|
110
|
+
|
|
111
|
+
### Source information
|
|
112
|
+
|
|
113
|
+
- [NIST SP 800-53 Rev. 5, control AC-5](https://doi.org/10.6028/NIST.SP.800-53r5) includes
|
|
114
|
+
separation of duties as a security control. It agrees with this rule but does not contain the full
|
|
115
|
+
Athena rule.
|
|
116
|
+
|
|
117
|
+
### Applicable information
|
|
118
|
+
|
|
119
|
+
- [OWASP Transaction Authorization Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Transaction_Authorization_Cheat_Sheet.html)
|
|
120
|
+
states that the authorizer must see important transaction data. It also protects the sequence from
|
|
121
|
+
authorization to execution.
|
|
122
|
+
- [NIST AI RMF 1.0](https://doi.org/10.6028/NIST.AI.100-1) recommends clear roles,
|
|
123
|
+
responsibilities, and oversight for human-AI configurations.
|
|
124
|
+
|
|
125
|
+
### More information
|
|
126
|
+
|
|
127
|
+
- [OWASP LLM06:2025 Excessive Agency](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/)
|
|
128
|
+
gives information about transaction safeguards and independent approval for high-impact agent
|
|
129
|
+
actions.
|
|
130
|
+
|
|
131
|
+
[Back to the engineering principles catalog](../README.md#p061)
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# P062 — Human Approval for Irreversible or High-Risk Actions
|
|
2
|
+
|
|
3
|
+
## Definition
|
|
4
|
+
|
|
5
|
+
Before an unauthorized action can cause an irreversible or high-risk effect, receive action-bound
|
|
6
|
+
human approval. Such effects include data loss, production changes, privilege changes, secret
|
|
7
|
+
exposure, external communication, and high cost. The approval must identify the material action.
|
|
8
|
+
General trust in an actor or tool is not approval for that action.
|
|
9
|
+
|
|
10
|
+
**Aliases:** human-in-the-loop approval, confirmation gate, approval-bound execution.
|
|
11
|
+
|
|
12
|
+
## Provenance
|
|
13
|
+
|
|
14
|
+
**Classification:** Athena synthesis.
|
|
15
|
+
|
|
16
|
+
No verified source specifies this rule. The rule adapts transaction authorization, safety
|
|
17
|
+
interlocks, and current guidance about excessive agent authority.
|
|
18
|
+
|
|
19
|
+
## Decision rule
|
|
20
|
+
|
|
21
|
+
When specified authority does not include the specified action, stop before the action causes an
|
|
22
|
+
irreversible or high-risk effect. Before execution resumes, receive approval for the target, scope,
|
|
23
|
+
and material parameters.
|
|
24
|
+
|
|
25
|
+
## How to apply
|
|
26
|
+
|
|
27
|
+
- Classify impact from the destination, data, privilege, cost, and reversibility.
|
|
28
|
+
- Show the approver the specified action and important parameters in clear terms.
|
|
29
|
+
- When the target, scope, material parameters, or risk changes, receive new approval.
|
|
30
|
+
- Protect approval credentials and execution state from substitution or replay.
|
|
31
|
+
- Pair approval with technical safeguards. Approval without these safeguards does not make a
|
|
32
|
+
dangerous action safe.
|
|
33
|
+
|
|
34
|
+
## Diagram
|
|
35
|
+
|
|
36
|
+
```mermaid
|
|
37
|
+
flowchart TD
|
|
38
|
+
A["Resolve specified action and impact"] --> B{"Irreversible or high risk?"}
|
|
39
|
+
B -- "No" --> C["Use standard authorized path"]
|
|
40
|
+
B -- "Yes" --> D{"Does current authority include action?"}
|
|
41
|
+
D -- "Yes" --> E["Validate safeguards and execute"]
|
|
42
|
+
D -- "No" --> F["Receive action-bound human approval"]
|
|
43
|
+
F --> G{"Approval matches current action?"}
|
|
44
|
+
G -- "No" --> H["Stop"]
|
|
45
|
+
G -- "Yes" --> E
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Language examples
|
|
49
|
+
|
|
50
|
+
Each trusted verifier uses an atomic operation to authenticate the human issuer and validate target,
|
|
51
|
+
digest, freshness, nonce, and replay state.
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
def deploy(plan, token, trusted_verifier, replay):
|
|
55
|
+
trusted_verifier.verify_human_once(
|
|
56
|
+
token=token,
|
|
57
|
+
target=plan.target,
|
|
58
|
+
digest=plan.digest,
|
|
59
|
+
replay=replay,
|
|
60
|
+
now=trusted_now(),
|
|
61
|
+
)
|
|
62
|
+
plan.execute()
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```rust
|
|
66
|
+
fn deploy(
|
|
67
|
+
plan: &Plan,
|
|
68
|
+
token: &ApprovalToken,
|
|
69
|
+
verifier: &TrustedApprovalVerifier,
|
|
70
|
+
replay: &mut ReplayStore,
|
|
71
|
+
) -> Result<(), Error> {
|
|
72
|
+
verifier.verify_human_once(
|
|
73
|
+
token, &plan.target, &plan.digest, replay, trusted_now(),
|
|
74
|
+
)?;
|
|
75
|
+
plan.execute();
|
|
76
|
+
Ok(())
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Boundaries and tensions
|
|
81
|
+
|
|
82
|
+
Do not make prompts that are not necessary. When the user and task authorize the scope, Athena
|
|
83
|
+
authorizes constructive Git, GitHub, and Hephaestus actions. Public visibility does not make a second
|
|
84
|
+
approval necessary. Action-bound approval is necessary for destructive, privileged, production,
|
|
85
|
+
secret-exposure, high-cost, or unauthorized high-risk actions. Repository policy can specify a
|
|
86
|
+
stricter gate. Approval cannot override a higher-priority instruction or security control.
|
|
87
|
+
|
|
88
|
+
## Examples
|
|
89
|
+
|
|
90
|
+
**Positive:** Before deletion of a production dataset, the system shows the environment, dataset
|
|
91
|
+
identifier, retention result, and recovery status. It executes only after approval for those
|
|
92
|
+
details.
|
|
93
|
+
|
|
94
|
+
**Misuse:** An access checkbox without a specified limit grants resource management. The system uses
|
|
95
|
+
that checkbox as permanent approval for each future deletion or deployment.
|
|
96
|
+
|
|
97
|
+
**Athena/agent workflow:** A user request for a named GitHub issue authorizes that scoped,
|
|
98
|
+
constructive write. Approval is necessary before removal of a worktree with uncommitted changes
|
|
99
|
+
because removal can cause data loss.
|
|
100
|
+
|
|
101
|
+
## Related principles
|
|
102
|
+
|
|
103
|
+
- [P050 Least Privilege](p050-least-privilege.md)
|
|
104
|
+
- [P058 Bounded Agent Authority](p058-bounded-agent-authority.md)
|
|
105
|
+
- [P061 Separate Decision from High-Impact Execution](p061-separate-decision-from-high-impact-execution.md)
|
|
106
|
+
- [P083 Irreversible Actions Last](p083-irreversible-actions-last.md)
|
|
107
|
+
|
|
108
|
+
## References
|
|
109
|
+
|
|
110
|
+
### Source information
|
|
111
|
+
|
|
112
|
+
- [OWASP Transaction Authorization Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Transaction_Authorization_Cheat_Sheet.html)
|
|
113
|
+
documents the established practice that binds authorization to important transaction data. It
|
|
114
|
+
is not the initial source for the full Athena rule.
|
|
115
|
+
|
|
116
|
+
### Applicable information
|
|
117
|
+
|
|
118
|
+
- [OWASP LLM06:2025 Excessive Agency](https://genai.owasp.org/llmrisk/llm062025-excessive-agency/)
|
|
119
|
+
recommends human approval before high-impact agent actions. It also recommends limits for
|
|
120
|
+
available extensions and permissions.
|
|
121
|
+
- [NIST AI RMF 1.0, Appendix C](https://airc.nist.gov/airmf-resources/airmf/appendices/app-c-ai-risk-management-and-human-ai-interaction/)
|
|
122
|
+
gives information about human roles and oversight that agree with system context and risk.
|
|
123
|
+
|
|
124
|
+
### More information
|
|
125
|
+
|
|
126
|
+
- [NIST AI RMF Core](https://airc.nist.gov/airmf-resources/airmf/5-sec-core/) gives risk-based
|
|
127
|
+
governance outcomes for different oversight responsibilities.
|
|
128
|
+
|
|
129
|
+
[Back to the engineering principles catalog](../README.md#p062)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# P063 — Requirement-to-Code Traceability
|
|
2
|
+
|
|
3
|
+
## Definition
|
|
4
|
+
|
|
5
|
+
Each important code or artifact change must trace to a requirement, acceptance criterion, defect,
|
|
6
|
+
invariant, or necessary implementation dependency. A reviewer must find the applicable trace link.
|
|
7
|
+
Standard work does not make a large traceability matrix necessary.
|
|
8
|
+
|
|
9
|
+
**Aliases:** requirements traceability, change-to-requirement map, implementation provenance.
|
|
10
|
+
|
|
11
|
+
## Provenance
|
|
12
|
+
|
|
13
|
+
**Classification:** established principle.
|
|
14
|
+
|
|
15
|
+
Requirements traceability developed in systems engineering and software engineering. No verified
|
|
16
|
+
inventor owns the practice. Formal standards frequently specify bidirectional links between
|
|
17
|
+
requirements, design, code, and verification. Athena applies the same discipline in proportion to
|
|
18
|
+
risk.
|
|
19
|
+
|
|
20
|
+
## Decision rule
|
|
21
|
+
|
|
22
|
+
For each important change, identify its accepted requirement or documented dependency. If there is
|
|
23
|
+
no link, do one of these actions:
|
|
24
|
+
|
|
25
|
+
- Remove the change.
|
|
26
|
+
- Isolate the work.
|
|
27
|
+
- Before implementation, record the missing requirement.
|
|
28
|
+
|
|
29
|
+
## How to apply
|
|
30
|
+
|
|
31
|
+
- Before implementation, state the requirement and acceptance criteria.
|
|
32
|
+
- Keep each change narrow. Make its issue, plan, or pull-request rationale clear.
|
|
33
|
+
- Map important design and code decisions to their requirements.
|
|
34
|
+
- Identify migrations, compatibility work, and other support changes as recorded dependencies.
|
|
35
|
+
- When requirements or implementation ownership change, update the trace links.
|
|
36
|
+
|
|
37
|
+
## Diagram
|
|
38
|
+
|
|
39
|
+
```mermaid
|
|
40
|
+
flowchart LR
|
|
41
|
+
A["Accept requirement or defect"] --> B["Specify acceptance criteria"]
|
|
42
|
+
B --> C["Map design decision"]
|
|
43
|
+
C --> D["Map code change"]
|
|
44
|
+
D --> E{"Does the trace link contain all necessary data?"}
|
|
45
|
+
E -- "No" --> F["Remove, isolate, or record missing requirement"]
|
|
46
|
+
E -- "Yes" --> G["Submit focused change"]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Language examples
|
|
50
|
+
|
|
51
|
+
The two examples associate the function with REQ-17 and implement the accepted REQ-17 rule.
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
def normalize_email(value):
|
|
55
|
+
"""REQ-17: Return a lowercase email address without outer spaces."""
|
|
56
|
+
normalized = value.strip().lower()
|
|
57
|
+
return normalized
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```rust
|
|
61
|
+
/// REQ-17: Return a lowercase email address without outer spaces.
|
|
62
|
+
fn normalize_email(value: &str) -> String {
|
|
63
|
+
value.trim().to_lowercase()
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Boundaries and tensions
|
|
68
|
+
|
|
69
|
+
Traceability proves the link between a requirement and the intent. It does not make a comment or
|
|
70
|
+
ticket ID necessary on each line.
|
|
71
|
+
Mechanical edits, generated artifacts, and refactors can inherit the rationale of one coherent
|
|
72
|
+
parent change. Security or correctness work can be necessary when the initial request omits it.
|
|
73
|
+
Then, record the dependency. Do not use traceability to keep an incorrect
|
|
74
|
+
implementation or to bypass
|
|
75
|
+
[P072 Technical Evidence](p072-technical-evidence-over-preference.md).
|
|
76
|
+
|
|
77
|
+
## Examples
|
|
78
|
+
|
|
79
|
+
**Positive:** A schema field, migration, compatibility reader, and removal trigger all reference the
|
|
80
|
+
same data-transition requirement that the project accepted.
|
|
81
|
+
|
|
82
|
+
**Misuse:** A feature pull request includes a dependency update and large refactor that the feature
|
|
83
|
+
does not make necessary. No requirement makes the dependency update or the refactor necessary.
|
|
84
|
+
|
|
85
|
+
**Athena/agent workflow:** A plan assigns an acceptance criterion to each implementation step. It
|
|
86
|
+
omits files and process artifacts that have no demonstrated product consumer.
|
|
87
|
+
|
|
88
|
+
## Related principles
|
|
89
|
+
|
|
90
|
+
- [P010 Scope Fidelity](p010-scope-fidelity.md)
|
|
91
|
+
- [P011 Minimal Coherent Change](p011-minimal-coherent-change.md)
|
|
92
|
+
- [P064 Requirement-to-Test Traceability](p064-requirement-to-test-traceability.md)
|
|
93
|
+
- [P072 Technical Evidence Over Preference](p072-technical-evidence-over-preference.md)
|
|
94
|
+
|
|
95
|
+
## References
|
|
96
|
+
|
|
97
|
+
### Source information
|
|
98
|
+
|
|
99
|
+
- [NASA SWE-064: Bidirectional Traceability Between Software Design and Software Code](https://swehb.nasa.gov/spaces/7150/pages/16450496/SWE-064%2B-%2BBidirectional%2BTraceability%2BBetween%2BSoftware%2BDesign%2Band%2BSoftware%2BCode)
|
|
100
|
+
documents an established systems-engineering treatment of code traceability. This page does not
|
|
101
|
+
identify the initial source.
|
|
102
|
+
|
|
103
|
+
### Applicable information
|
|
104
|
+
|
|
105
|
+
- [NASA SWE-050: Software Requirements](https://swehb.nasa.gov/spaces/SWEHBVD/pages/102695421/SWE-050%2B-%2BSoftware%2BRequirements)
|
|
106
|
+
lists requirement properties and bidirectional lifecycle traceability in the current Software
|
|
107
|
+
Engineering Handbook.
|
|
108
|
+
- [NIST SSDF 1.1](https://csrc.nist.gov/pubs/sp/800/218/final) links secure design and code practices
|
|
109
|
+
to documented security requirements and release evidence.
|
|
110
|
+
|
|
111
|
+
### More information
|
|
112
|
+
|
|
113
|
+
- [Google Engineering Practices: Small CLs](https://google.github.io/eng-practices/review/developer/small-cls.html)
|
|
114
|
+
shows why reviewers can more easily understand one self-contained conceptual change.
|
|
115
|
+
|
|
116
|
+
[Back to the engineering principles catalog](../README.md#p063)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# P064 — Requirement-to-Test Traceability
|
|
2
|
+
|
|
3
|
+
## Definition
|
|
4
|
+
|
|
5
|
+
Each behavior change must have verification for its requirement, acceptance criterion, defect, or
|
|
6
|
+
invariant. Evidence can include a behavior test, property, integration check, type rule, static
|
|
7
|
+
analysis, build check, or a different risk-based method.
|
|
8
|
+
|
|
9
|
+
**Aliases:** requirements-to-verification traceability, test coverage traceability.
|
|
10
|
+
|
|
11
|
+
## Provenance
|
|
12
|
+
|
|
13
|
+
**Classification:** established principle.
|
|
14
|
+
|
|
15
|
+
Systems and safety engineering use bidirectional requirements-to-test traceability. No verified
|
|
16
|
+
inventor owns the practice. Athena uses "test" to include applicable executable verification. The
|
|
17
|
+
evidence must exercise the changed behavior.
|
|
18
|
+
|
|
19
|
+
## Decision rule
|
|
20
|
+
|
|
21
|
+
For each behavior change, identify evidence that fails when the necessary behavior fails. If
|
|
22
|
+
evidence is missing, add it. If a risk-based alternative applies, record its evidence.
|
|
23
|
+
|
|
24
|
+
## How to apply
|
|
25
|
+
|
|
26
|
+
- Turn acceptance criteria and invariants into observable verification targets.
|
|
27
|
+
- Select the lowest-cost test level that proves the contract.
|
|
28
|
+
- When the risk makes boundary integration tests necessary, add them.
|
|
29
|
+
- Record the requirement for each non-obvious test or verification group.
|
|
30
|
+
- Do a check of failure paths, boundaries, and representative success cases.
|
|
31
|
+
- When the accepted contract changes, update the requirement and its tests.
|
|
32
|
+
|
|
33
|
+
## Diagram
|
|
34
|
+
|
|
35
|
+
```mermaid
|
|
36
|
+
flowchart LR
|
|
37
|
+
A["Accept behavior requirement"] --> B["Specify observable result"]
|
|
38
|
+
B --> C["Select risk-based check"]
|
|
39
|
+
C --> D["Break behavior in a controlled test"]
|
|
40
|
+
D --> E{"Check finds defect?"}
|
|
41
|
+
E -- "No" --> F["Improve or replace check"]
|
|
42
|
+
F --> D
|
|
43
|
+
E -- "Yes" --> G["Record requirement link"]
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Language examples
|
|
47
|
+
|
|
48
|
+
The two examples link REQ-24 to a test that verifies one charge for duplicate requests.
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
def test_req_24_duplicate_key_creates_one_charge():
|
|
52
|
+
store = ChargeStore()
|
|
53
|
+
charge(store, "key-1")
|
|
54
|
+
charge(store, "key-1")
|
|
55
|
+
assert store.count() == 1
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```rust
|
|
59
|
+
#[test]
|
|
60
|
+
fn req_24_duplicate_key_creates_one_charge() {
|
|
61
|
+
let mut store = ChargeStore::new();
|
|
62
|
+
charge(&mut store, "key-1");
|
|
63
|
+
charge(&mut store, "key-1");
|
|
64
|
+
assert_eq!(store.count(), 1);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Boundaries and tensions
|
|
69
|
+
|
|
70
|
+
Traceability is not line coverage or one test for each requirement sentence. It does not make a
|
|
71
|
+
manual matrix in each repository. Static checks can prove properties that they fully enforce.
|
|
72
|
+
|
|
73
|
+
User workflows can make end-to-end evidence necessary. A test gives no evidence when a defect cannot
|
|
74
|
+
make the test fail. Before you change its tests, resolve a stale requirement. Apply
|
|
75
|
+
[P067 No Test Cheating](p067-no-test-cheating.md).
|
|
76
|
+
|
|
77
|
+
## Examples
|
|
78
|
+
|
|
79
|
+
**Positive:** A requirement states that duplicate requests cause one charge. Its integration test
|
|
80
|
+
uses one idempotency key again and verifies one stored effect.
|
|
81
|
+
|
|
82
|
+
**Misuse:** A pull request cites its total coverage percentage. No test exercises the new path for
|
|
83
|
+
an authorization failure.
|
|
84
|
+
|
|
85
|
+
**Athena/agent workflow:** A skill change maps its success and dependency-failure contracts to the
|
|
86
|
+
validator or behavior tests. It does not add brittle assertions for prose text.
|
|
87
|
+
|
|
88
|
+
## Related principles
|
|
89
|
+
|
|
90
|
+
- [P022 Test Behavior, Not Implementation](p022-test-behavior-not-implementation.md)
|
|
91
|
+
- [P026 Regression Before Repair](p026-regression-before-repair.md)
|
|
92
|
+
- [P028 Test Failure Paths](p028-test-failure-paths.md)
|
|
93
|
+
- [P063 Requirement-to-Code Traceability](p063-requirement-to-code-traceability.md)
|
|
94
|
+
- [P067 No Test Cheating](p067-no-test-cheating.md)
|
|
95
|
+
|
|
96
|
+
## References
|
|
97
|
+
|
|
98
|
+
### Source information
|
|
99
|
+
|
|
100
|
+
- [NASA SWE-072: Bidirectional Traceability Between Test Procedures and Requirements](https://swehb.nasa.gov/spaces/7150/pages/16449898/SWE-072%2B-%2BBidirectional%2BTraceability%2BBetween%2BSoftware%2BTest%2BProcedures%2Band%2BSoftware%2BRequirements)
|
|
101
|
+
records the established requirements-to-test practice. This page does not identify the initial
|
|
102
|
+
publication.
|
|
103
|
+
|
|
104
|
+
### Applicable information
|
|
105
|
+
|
|
106
|
+
- [NASA SWE-194: Delivery Requirements Verification](https://swehb.nasa.gov/spaces/SWEHBVD/pages/102695529/SWE-194%2B-%2BDelivery%2BRequirements%2BVerification)
|
|
107
|
+
links delivery evidence and test results to individual requirements.
|
|
108
|
+
- [NIST SSDF 1.1](https://csrc.nist.gov/pubs/sp/800/218/final) specifies pre-release verification
|
|
109
|
+
practices for human-readable and executable code.
|
|
110
|
+
|
|
111
|
+
### More information
|
|
112
|
+
|
|
113
|
+
- [Google Engineering Practices: Tests in small CLs](https://google.github.io/eng-practices/review/developer/small-cls.html#keep-related-test-code-in-the-same-cl)
|
|
114
|
+
shows why behavior changes and their tests belong in the same change.
|
|
115
|
+
|
|
116
|
+
[Back to the engineering principles catalog](../README.md#p064)
|