@homericintelligence/athena-opencode 0.4.4 → 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 +102 -40
- package/skills/advise/scripts/list_retrievable_skills.py +3 -3
- package/skills/brainstorm/SKILL.md +167 -76
- package/skills/change-review/SKILL.md +99 -43
- package/skills/change-review/references/scope-resolution.md +70 -41
- package/skills/change-review/scripts/resolve_scope.py +119 -73
- package/skills/finalize-plan/SKILL.md +208 -100
- package/skills/git-worktrees/SKILL.md +108 -59
- package/skills/git-worktrees/scripts/prepare_worktree.py +16 -10
- package/skills/issue-review/SKILL.md +143 -47
- package/skills/learn/SKILL.md +284 -162
- package/skills/myrmidon-swarm/SKILL.md +136 -61
- package/skills/plan-issue/SKILL.md +129 -47
- package/skills/pr-review/SKILL.md +170 -71
- package/skills/pr-review/references/criteria.md +61 -14
- package/skills/pr-review/references/delivery.md +159 -80
- package/skills/pr-review/references/evidence.md +268 -139
- package/skills/pr-review/references/prevalidated.md +91 -48
- 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 +209 -87
- package/skills/systematic-debugging/SKILL.md +195 -131
- package/skills/systematic-debugging/scripts/repository_evidence.py +9 -4
- package/skills/test-driven-development/SKILL.md +134 -53
- package/skills/tidy/SKILL.md +97 -33
- package/skills/tidy/scripts/run_tidy.py +3 -3
|
@@ -1,198 +1,262 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: systematic-debugging
|
|
3
3
|
license: BSD-3-Clause
|
|
4
|
-
description: Investigate root cause before
|
|
4
|
+
description: Investigate root cause before you repair a bug or unexpected behavior. This skill requires the Mnemosyne knowledge backend through advise. Stop if the backend cannot be prepared.
|
|
5
5
|
argument-hint: <description of the bug or failure>
|
|
6
6
|
allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent]
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
# Systematic
|
|
9
|
+
# Systematic debugging
|
|
10
10
|
|
|
11
11
|
## Overview
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
A repair without evidence wastes time and can create a new bug. A repair of only the symptom can
|
|
14
|
+
hide the root cause.
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
Apply the [ASD-STE100 technical-English policy](../TECHNICAL_ENGLISH.md) to this skill and to
|
|
17
|
+
all prose that it produces.
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
## Working rules
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
Find the root cause before you attempt a repair. Do not repair only the symptom. Follow each
|
|
22
|
+
required step in this process.
|
|
23
|
+
|
|
24
|
+
## Engineering principles
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
Use Athena's [canonical engineering-principles catalog](../_support/docs/principles/README.md) for the
|
|
27
|
+
principle definitions. Use these principles in this workflow:
|
|
23
28
|
|
|
24
|
-
|
|
29
|
+
- [P012 — Evidence Before Modification](../_support/docs/principles/README.md#p012): Before you select a
|
|
30
|
+
repair, examine symptoms, changes, contracts, and repository guidance.
|
|
31
|
+
- [P015 — Architecture Conformance](../_support/docs/principles/README.md#p015): Before you change the
|
|
32
|
+
architecture, compare the failure path with the repository boundaries.
|
|
33
|
+
- [P022 — Test Behavior, Not Implementation](../_support/docs/principles/README.md#p022): Reproduce the
|
|
34
|
+
observable contract. Add a test for this contract. Do not add a test for the private
|
|
35
|
+
implementation.
|
|
36
|
+
- [P029 — Generalize Error Policy; Preserve Specific Cause](../_support/docs/principles/README.md#p029):
|
|
37
|
+
Use a stable error policy at the boundary. Keep the initial cause.
|
|
38
|
+
- [P031 — Propagate Rather Than Swallow](../_support/docs/principles/README.md#p031): If this layer cannot
|
|
39
|
+
fully recover from the failure, propagate the failure.
|
|
40
|
+
- [P047 — Observability Is Part of Correctness](../_support/docs/principles/README.md#p047): Collect the
|
|
41
|
+
minimum evidence that is necessary to find the fault. Correlate the evidence. Use a structured
|
|
42
|
+
data format. Do not include sensitive data.
|
|
43
|
+
- [P065 — Verify Before Claiming Completion](../_support/docs/principles/README.md#p065): Before you tell the
|
|
44
|
+
user that you corrected the fault, do the initial reproduction again. Then, do the applicable
|
|
45
|
+
repository checks.
|
|
46
|
+
- [P072 — Technical Evidence Over Preference](../_support/docs/principles/README.md#p072): Use only collected
|
|
47
|
+
evidence to accept or reject a hypothesis.
|
|
25
48
|
|
|
26
|
-
|
|
27
|
-
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
|
|
28
|
-
```
|
|
49
|
+
## Before you start
|
|
29
50
|
|
|
30
|
-
|
|
51
|
+
Run `advise` with the error description. If you cannot prepare the required knowledge backend,
|
|
52
|
+
stop. Do not skip the prior-knowledge search.
|
|
31
53
|
|
|
32
|
-
##
|
|
54
|
+
## Required sequence
|
|
33
55
|
|
|
34
|
-
|
|
56
|
+
Complete phase 1 before you propose a repair.
|
|
35
57
|
|
|
36
|
-
|
|
37
|
-
- Bugs in production
|
|
38
|
-
- Unexpected behavior
|
|
39
|
-
- Performance problems
|
|
40
|
-
- Build failures
|
|
41
|
-
- Integration issues
|
|
58
|
+
## When to use
|
|
42
59
|
|
|
43
|
-
|
|
60
|
+
Use this skill for all technical issues, including:
|
|
44
61
|
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
62
|
+
- A test fails.
|
|
63
|
+
- A bug occurs in production.
|
|
64
|
+
- The product has unexpected behavior.
|
|
65
|
+
- The product has a performance problem.
|
|
66
|
+
- A build fails.
|
|
67
|
+
- An integration fails.
|
|
50
68
|
|
|
51
|
-
|
|
69
|
+
Use this skill especially in these conditions:
|
|
52
70
|
|
|
53
|
-
You
|
|
71
|
+
- You are under time pressure.
|
|
72
|
+
- A repair appears obvious before an investigation.
|
|
73
|
+
- You already attempted multiple repairs.
|
|
74
|
+
- A previous repair did not work.
|
|
75
|
+
- You do not fully understand the issue.
|
|
54
76
|
|
|
55
|
-
|
|
77
|
+
## Workflow
|
|
56
78
|
|
|
57
|
-
|
|
79
|
+
Complete each phase before you continue to the next phase.
|
|
58
80
|
|
|
59
|
-
1
|
|
60
|
-
- Don't skip past errors or warnings
|
|
61
|
-
- They often contain the exact solution
|
|
62
|
-
- Read stack traces completely
|
|
63
|
-
- Note line numbers, file paths, error codes
|
|
81
|
+
### Phase 1: Root cause investigation
|
|
64
82
|
|
|
65
|
-
|
|
66
|
-
- Can you trigger it reliably?
|
|
67
|
-
- What are the exact steps?
|
|
68
|
-
- Does it happen every time?
|
|
69
|
-
- If not reproducible → gather more data, don't guess
|
|
83
|
+
Before you attempt a repair, complete these steps:
|
|
70
84
|
|
|
71
|
-
|
|
72
|
-
- What changed that could cause this?
|
|
73
|
-
- `git diff`, recent commits
|
|
74
|
-
- New dependencies, config changes
|
|
75
|
-
- Environmental differences
|
|
85
|
+
1. Record these items from the complete failure output:
|
|
76
86
|
|
|
77
|
-
|
|
87
|
+
- each error and warning;
|
|
88
|
+
- the complete stack trace;
|
|
89
|
+
- line numbers;
|
|
90
|
+
- file paths;
|
|
91
|
+
- error codes.
|
|
78
92
|
|
|
79
|
-
|
|
93
|
+
2. Do not skip an error or warning. An error message can identify the cause.
|
|
94
|
+
3. Reproduce the failure consistently.
|
|
95
|
+
4. Record the exact conditions, steps, and frequency of the failure.
|
|
96
|
+
5. If you cannot reproduce the failure, collect more data.
|
|
97
|
+
6. Do not guess the cause.
|
|
98
|
+
7. Compare the failed state with recent repository history.
|
|
99
|
+
8. Inspect these possible sources of the failure:
|
|
80
100
|
|
|
81
|
-
|
|
101
|
+
- `git diff`;
|
|
102
|
+
- recent commits;
|
|
103
|
+
- new dependencies;
|
|
104
|
+
- configuration changes;
|
|
105
|
+
- environment differences.
|
|
82
106
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- Verify environment/config propagation
|
|
88
|
-
- Check state at each layer
|
|
107
|
+
9. If the system has multiple components, isolate the failed boundary.
|
|
108
|
+
10. Before you propose a repair, add only the minimum non-sensitive diagnostic instrumentation that
|
|
109
|
+
[P047 — Observability Is Part of Correctness](../_support/docs/principles/README.md#p047) requires.
|
|
110
|
+
11. At each component boundary:
|
|
89
111
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
112
|
+
- log the input data;
|
|
113
|
+
- log the output data;
|
|
114
|
+
- verify the transfer of environment and configuration data;
|
|
115
|
+
- examine the state at each layer.
|
|
116
|
+
|
|
117
|
+
12. Run the instrumented reproduction one time to collect evidence.
|
|
118
|
+
13. Use the evidence to identify the failed component.
|
|
119
|
+
14. Investigate that component.
|
|
120
|
+
15. If an incorrect value is deep in the call stack, trace the value back to its source.
|
|
121
|
+
16. Identify where the incorrect value starts and which caller supplied it.
|
|
122
|
+
17. Continue the trace until you find the source.
|
|
123
|
+
18. Identify the source as the repair location.
|
|
124
|
+
19. Do not repair only the symptom.
|
|
125
|
+
|
|
126
|
+
### Phase 2: Pattern analysis
|
|
127
|
+
|
|
128
|
+
Identify the pattern before you make a repair:
|
|
129
|
+
|
|
130
|
+
1. Find correct examples of similar code in the same repository.
|
|
131
|
+
2. Read each applicable reference implementation completely.
|
|
132
|
+
3. Do not read only a sample.
|
|
133
|
+
4. List each difference between the correct code and the code that fails.
|
|
134
|
+
5. Identify all dependencies and all configuration and environment assumptions.
|
|
135
|
+
|
|
136
|
+
### Phase 3: Hypothesis and test
|
|
94
137
|
|
|
95
|
-
|
|
138
|
+
Use this method to test a hypothesis:
|
|
96
139
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
140
|
+
1. State one hypothesis: `The root cause is X because Y.`
|
|
141
|
+
2. Make the minimum possible change to test the hypothesis.
|
|
142
|
+
3. Change only one variable in each test.
|
|
143
|
+
4. If the result supports the hypothesis, continue to phase 4.
|
|
144
|
+
5. If the result does not support the hypothesis, state a new hypothesis.
|
|
145
|
+
6. If you do not understand X, state `I do not understand X.`
|
|
146
|
+
7. Do not claim that you understand X.
|
|
102
147
|
|
|
103
|
-
### Phase
|
|
148
|
+
### Phase 4: Implementation
|
|
104
149
|
|
|
105
|
-
|
|
150
|
+
Repair the root cause.
|
|
106
151
|
|
|
107
|
-
|
|
108
|
-
2. Read reference implementations completely — don't skim
|
|
109
|
-
3. List every difference between working and broken code
|
|
110
|
-
4. Identify all dependencies, config, environment assumptions
|
|
152
|
+
Do not repair only the symptom.
|
|
111
153
|
|
|
112
|
-
|
|
154
|
+
1. Use the `test-driven-development` skill to create a regression test.
|
|
155
|
+
2. Under [P026 — Regression Before Repair](../_support/docs/principles/README.md#p026), create the test
|
|
156
|
+
before the repair.
|
|
157
|
+
3. Under [P022](../_support/docs/principles/README.md#p022), make the test assert observable behavior.
|
|
158
|
+
4. Under [P028](../_support/docs/principles/README.md#p028), make the test cover the applicable failure
|
|
159
|
+
path.
|
|
160
|
+
5. Implement one repair that corrects the root cause.
|
|
161
|
+
6. Under [P065](../_support/docs/principles/README.md#p065), run this validation:
|
|
113
162
|
|
|
114
|
-
|
|
163
|
+
- Rerun the reproduction.
|
|
164
|
+
- Run the applicable test suite.
|
|
165
|
+
7. Under [P027](../_support/docs/principles/README.md#p027), keep the test deterministic and isolated.
|
|
166
|
+
8. Under [P067](../_support/docs/principles/README.md#p067), do not weaken tests.
|
|
167
|
+
9. Under [P068](../_support/docs/principles/README.md#p068), do not bypass validation.
|
|
115
168
|
|
|
116
|
-
|
|
117
|
-
2. **Test minimally**: Make the SMALLEST possible change to test the hypothesis
|
|
118
|
-
3. **One variable at a time**: Don't fix multiple things at once
|
|
119
|
-
4. **Verify before continuing**: If it worked → Phase 4. Didn't work → new hypothesis
|
|
120
|
-
5. **When stuck**: Say "I don't understand X" — don't pretend to know
|
|
169
|
+
If the repair changes failure behavior, complete these steps:
|
|
121
170
|
|
|
122
|
-
|
|
171
|
+
1. Under [P029](../_support/docs/principles/README.md#p029), generalize the policy.
|
|
172
|
+
2. Under [P029](../_support/docs/principles/README.md#p029), preserve the cause.
|
|
173
|
+
3. Handle the failure at the
|
|
174
|
+
[nearest responsible boundary](../_support/docs/principles/README.md#p030).
|
|
175
|
+
4. [Propagate unrecovered failures](../_support/docs/principles/README.md#p031).
|
|
176
|
+
5. [Handle the failure once without losing causality](../_support/docs/principles/README.md#p032).
|
|
177
|
+
6. Under [P033](../_support/docs/principles/README.md#p033), preserve valid state.
|
|
178
|
+
7. Select [fail-fast](../_support/docs/principles/README.md#p034),
|
|
179
|
+
[fail-closed](../_support/docs/principles/README.md#p035), or
|
|
180
|
+
[graceful degradation](../_support/docs/principles/README.md#p036).
|
|
181
|
+
8. Base this selection on the correctness and security importance of the failed capability.
|
|
182
|
+
|
|
183
|
+
If the repair does not correct the issue, complete these steps:
|
|
184
|
+
|
|
185
|
+
1. Stop the current repair attempt.
|
|
186
|
+
2. Count the failed repair attempts.
|
|
187
|
+
3. If fewer than three repairs failed, return to phase 1 with the new information.
|
|
188
|
+
4. After three failed repairs, start an architecture review.
|
|
123
189
|
|
|
124
|
-
|
|
190
|
+
### After three failed repairs
|
|
125
191
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
3. **Verify fix**: Test passes? No other tests broken? Issue actually resolved?
|
|
192
|
+
Repeated failed repairs can show an incorrect model, a missing dependency, or an architecture
|
|
193
|
+
problem. They require a new assessment. They do not prove that the architecture is incorrect.
|
|
129
194
|
|
|
130
|
-
|
|
131
|
-
- STOP
|
|
132
|
-
- Count: How many fixes have you tried?
|
|
133
|
-
- If < 3: Return to Phase 1 with new information
|
|
134
|
-
- **If ≥ 3: STOP and question the architecture**
|
|
195
|
+
Review the evidence for these conditions:
|
|
135
196
|
|
|
136
|
-
|
|
197
|
+
- Each repair reveals new shared state, coupling, or a problem in another component.
|
|
198
|
+
- A repair requires a large refactor.
|
|
199
|
+
- Each repair creates a new symptom in another component.
|
|
137
200
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
- Each fix creates new symptoms elsewhere
|
|
201
|
+
Before another repair attempt, discuss the collected evidence with the user. If the evidence shows
|
|
202
|
+
an incorrect hypothesis, return to phase 1. Propose an architecture change only if the evidence
|
|
203
|
+
supports it.
|
|
142
204
|
|
|
143
|
-
|
|
144
|
-
This is not a failed hypothesis — this is a wrong architecture.
|
|
205
|
+
## Stop conditions
|
|
145
206
|
|
|
146
|
-
|
|
207
|
+
Stop if one of these conditions applies:
|
|
147
208
|
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
- Each
|
|
209
|
+
- You plan a temporary repair before an investigation.
|
|
210
|
+
- You plan to change X only to see the result.
|
|
211
|
+
- You plan to make multiple changes before a test.
|
|
212
|
+
- You select a probable cause without evidence.
|
|
213
|
+
- You do not understand the issue but plan a repair.
|
|
214
|
+
- You plan another repair after two failed repairs.
|
|
215
|
+
- Each repair reveals a new problem in a different component.
|
|
155
216
|
|
|
156
|
-
|
|
217
|
+
After you stop, return to phase 1.
|
|
157
218
|
|
|
158
|
-
##
|
|
219
|
+
## Failed approaches
|
|
159
220
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
221
|
+
- Do not omit this process for a simple issue. A simple issue also has a root cause.
|
|
222
|
+
- Do not omit this process during an emergency. Systematic debugging is faster than repairs without
|
|
223
|
+
evidence.
|
|
224
|
+
- Do not attempt a repair before the investigation. The first repair can affect the next evidence.
|
|
225
|
+
- Do not make multiple repairs at the same time. You cannot identify which repair changed the
|
|
226
|
+
result, and the repairs can cause new bugs.
|
|
227
|
+
- After three failed repairs, do not make another repair from a guess. Start an architecture review.
|
|
167
228
|
|
|
168
229
|
## Repository command discovery
|
|
169
230
|
|
|
170
|
-
Before
|
|
171
|
-
manifests, lockfiles, and CI. Prefer the command
|
|
172
|
-
|
|
231
|
+
Before you run a check, find the target repository commands. Inspect `AGENTS.md`, task runners,
|
|
232
|
+
manifests, lockfiles, and continuous integration (CI) configuration. Prefer the command that required
|
|
233
|
+
CI uses.
|
|
234
|
+
If the sources conflict or you cannot find a safe command, ask the user. Do not use Athena commands
|
|
235
|
+
as a substitute.
|
|
173
236
|
|
|
174
237
|
Keep the target repository as the current working directory. Resolve
|
|
175
|
-
`scripts/repository_evidence.py` against this installed skill directory
|
|
176
|
-
|
|
177
|
-
bounded to that revision window, and matching source locations as JSON. Run the
|
|
178
|
-
|
|
179
|
-
|
|
238
|
+
`scripts/repository_evidence.py` against this installed skill directory. Invoke that absolute helper
|
|
239
|
+
path with `PATTERN --source-root SOURCE_ROOT`. The helper collects the latest ten commits, a diff
|
|
240
|
+
bounded to that revision window, and matching source locations as JSON. Run the discovered
|
|
241
|
+
repository-focused test and type-check commands through the host execution tool. Keep their complete
|
|
242
|
+
output as evidence.
|
|
180
243
|
|
|
181
|
-
## After
|
|
244
|
+
## After resolution
|
|
182
245
|
|
|
183
|
-
|
|
184
|
-
|
|
246
|
+
Before you state that the bug is fixed, verify the result with fresh runnable evidence under the
|
|
247
|
+
[evidence-integrity policy](../_support/docs/policies/evidence-integrity.md). Rerun the original
|
|
248
|
+
reproduction. Run the repository-defined checks again.
|
|
185
249
|
|
|
186
|
-
|
|
187
|
-
invocation
|
|
188
|
-
|
|
250
|
+
If the session produces durable debugging knowledge, offer to invoke `learn`. An indirect `learn`
|
|
251
|
+
invocation is read-only and does not increase the requested scope. If the user requests durable
|
|
252
|
+
learning, use the delivery boundary of `learn`. Useful lessons include these items:
|
|
189
253
|
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
254
|
+
- the root-cause category and symptoms;
|
|
255
|
+
- the diagnostic steps that revealed the cause;
|
|
256
|
+
- the repair pattern; and
|
|
257
|
+
- each architecture issue that the investigation found.
|
|
194
258
|
|
|
195
|
-
This prevents
|
|
259
|
+
This record prevents another agent from repeating the same debugging session.
|
|
196
260
|
|
|
197
261
|
---
|
|
198
262
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
-
"""Collect reproducible recent
|
|
2
|
+
"""Collect reproducible evidence about recent changes and source patterns."""
|
|
3
3
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
@@ -18,7 +18,10 @@ EMPTY_TREE = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
|
|
|
18
18
|
def run(*arguments: str, accepted_codes: tuple[int, ...] = (0,)) -> str:
|
|
19
19
|
result = run_command(arguments, capture_output=True, text=True, check=False)
|
|
20
20
|
if result.returncode not in accepted_codes:
|
|
21
|
-
raise RuntimeError(
|
|
21
|
+
raise RuntimeError(
|
|
22
|
+
result.stderr.strip()
|
|
23
|
+
or f"The command failed. Command: {' '.join(arguments)}"
|
|
24
|
+
)
|
|
22
25
|
return result.stdout
|
|
23
26
|
|
|
24
27
|
|
|
@@ -33,9 +36,11 @@ def main() -> int:
|
|
|
33
36
|
"git", "rev-list", "--max-count=10", "HEAD"
|
|
34
37
|
).splitlines()
|
|
35
38
|
except RuntimeError as error:
|
|
36
|
-
raise RuntimeError(f"cannot resolve HEAD: {error}") from error
|
|
39
|
+
raise RuntimeError(f"The tool cannot resolve HEAD: {error}") from error
|
|
37
40
|
if not recent_revisions:
|
|
38
|
-
raise RuntimeError(
|
|
41
|
+
raise RuntimeError(
|
|
42
|
+
"The tool cannot resolve HEAD because the repository has no commits."
|
|
43
|
+
)
|
|
39
44
|
recent_commits = run("git", "log", "--oneline", "-10")
|
|
40
45
|
oldest_parent = run(
|
|
41
46
|
"git",
|