mirror of
https://github.com/morluto/rea.git
synced 2026-12-01 11:01:11 +00:00
docs(skills): add a bug fix skill and update tool design and test audit skills (#15400)
Add rea-bug-fix, a thin router for fixing a reproduced defect: trace it through the call boundaries to the code that owns the fact, check sibling copies, prove it with a regression whose expected value is independent of the code under test, remove what the fix supersedes, and keep the change minimal. Point rea-tool-design at the served-schema, stated-prerequisite and producer-owned recovery rules, and teach rea-ci-tests-audit to look for tests that pin bugs, unchecked setup steps, and known-failure lists keyed by root cause.
This commit is contained in:
1 parent
3df3253428
commit
1fd22f9783
5 files changed
+97
No files matched your search
@@ -0,0 +1,66 @@
|
||||
---
|
||||
name: rea-bug-fix
|
||||
description: Fix a reproduced REA defect at its owning boundary; use when a tool, contract, recovery, lifecycle, or result is wrong, not for new features or suite-wide CI audits.
|
||||
---
|
||||
|
||||
# REA bug fix
|
||||
|
||||
Fix the cause once, where the fact is produced, and remove what the fix makes
|
||||
redundant. Follow the checkout's `AGENTS.md`, the
|
||||
[tool design guide](../../../docs/development/tool-design.md) and the
|
||||
[testing guide](../../../docs/development/testing.md).
|
||||
|
||||
## Trace the defect to its owner
|
||||
|
||||
Start from what the agent or user actually sees, then follow the call inward
|
||||
until you reach the code that decides the wrong fact. Common boundaries, in
|
||||
the order a call crosses them:
|
||||
|
||||
1. The advertised schema clients receive (the served `tools/list`, not the
|
||||
canonical contract).
|
||||
2. Input validation and its error rewrite.
|
||||
3. Admission: whether the tool can run in the current session.
|
||||
4. Provider and session state: lifecycle stages the provider owns.
|
||||
5. Error projection: code, retry semantics, recovery and remediation.
|
||||
6. Result delivery: budgets, summaries and retained Evidence.
|
||||
|
||||
Decide where the fix belongs. A shared boundary owns how facts are carried,
|
||||
formatted and enforced; the producer owns facts only it knows, such as a
|
||||
lifecycle outcome, a measured limit, a current revision or the next tool. A
|
||||
downstream repair cannot restore a fact the producer never recorded.
|
||||
|
||||
## Check siblings before fixing
|
||||
|
||||
Search for the same decision made elsewhere: duplicated factories, hand-built
|
||||
copies of shared text, per-client or per-tool name branches, and parallel
|
||||
checks that can disagree. Group confirmed instances under one root cause and
|
||||
fix them together. Similar wording alone does not establish another instance;
|
||||
reproduce it.
|
||||
|
||||
## Prove it with an independent oracle
|
||||
|
||||
Write the regression first and show it fails on the base revision for the
|
||||
reported reason. Take expected values from independent facts, such as a
|
||||
literal, a fake's observed calls, or the served schema, never from the
|
||||
production function under test. Assert the key fact the bug broke (identity,
|
||||
linkage, coverage, retry semantics, recovery, what was written or released),
|
||||
not only that an error occurred. Prefer a public CLI/MCP workflow, then a
|
||||
production-boundary test. When an existing test asserts the buggy value,
|
||||
update it with the fix instead of keeping both.
|
||||
|
||||
## Remove what the fix supersedes
|
||||
|
||||
Delete the copies, fallbacks, aliases, wrappers and tests the new owner
|
||||
replaces, after checking their consumers. Keep malformed-input, cancellation,
|
||||
cleanup, permission, capacity and target-identity coverage.
|
||||
|
||||
## Keep it simple
|
||||
|
||||
Make the smallest change that removes the observed problem. Do not add a new
|
||||
mechanism, setting or abstraction for a theoretical or client-dependent gain;
|
||||
if one seems needed, state the concrete failure mode, likelihood and cost and
|
||||
get agreement first. Mark output or input changes that break a previously
|
||||
valid call as breaking, with migration.
|
||||
|
||||
Report the root cause, the structural fix, the sibling paths checked, the
|
||||
validation you ran, and anything left for later.
|
||||
@@ -0,0 +1,4 @@
|
||||
interface:
|
||||
display_name: "REA bug fix"
|
||||
short_description: "Fix a defect at its owning boundary with an independent regression"
|
||||
default_prompt: "Use $rea-bug-fix to trace this defect to the code that owns it, fix it there with a regression that fails on main, and remove what the fix supersedes."
|
||||
@@ -54,6 +54,18 @@ the producer and affected consumers before deciding where to fix it.
|
||||
copy or inject a controlled failure. Verify that the existing assertion or
|
||||
gate detects it. A test may merely repeat its mock, import abandoned code,
|
||||
or hide a subprocess/checker failure. Restore mutations after the experiment.
|
||||
- Look for tests that pin a bug as the expected value, not only weak ones: a
|
||||
generic schema remediation on a refusal whose arguments conform, `retryable:
|
||||
true` where an identical replay cannot succeed, a collapsed lifecycle value
|
||||
such as `"unknown"`, or the canonical schema treated as the advertised one.
|
||||
Also check that setup calls are asserted (an unchecked failed setup can make
|
||||
the later check pass vacuously), that matchers name the key fact rather than
|
||||
`expect.any` or a bare error flag, and that expected values do not come from
|
||||
the production function under test. Prefer shared setup, removal and liveness
|
||||
helpers over local copies.
|
||||
- When a suite records known failures or gaps, keep them keyed by root cause:
|
||||
a new failure must fail the suite, and an entry the code no longer produces
|
||||
must fail as stale, so fixes shrink the list.
|
||||
- For shared setup or pruning, map distinct assertions to their retained
|
||||
scenarios. Preserve malformed inputs, cancellation, cleanup failure,
|
||||
permissions, capacity, identity, and meaningful concurrency interactions.
|
||||
|
||||
@@ -39,6 +39,17 @@ requested, preserving the user's scope and existing authorization.
|
||||
|
||||
When adding or revising contracts and services:
|
||||
|
||||
- Judge a tool by what clients receive: the served `tools/list` after compact
|
||||
presentation, not the canonical contract. A rule the served schema drops must
|
||||
appear in the tool's advertised guidance, and parity tests run against the
|
||||
served listing ([implement and evaluate](../../../docs/development/tool-design.md#implement-and-evaluate)).
|
||||
- Declare any prerequisite, such as an open target or session, in the
|
||||
contract's availability so the listing, `binary_session` and the refusal
|
||||
agree ([descriptions](../../../docs/development/tool-design.md#write-descriptions-for-selection-and-a-valid-first-call)).
|
||||
- Have the producer supply each refusal's remediation and retry semantics;
|
||||
shared projection formats them and never fills them in
|
||||
([recovery](../../../docs/development/tool-design.md#design-recovery-around-the-failure)).
|
||||
|
||||
- Check high-cardinality discovery and graph tools for optional per-call
|
||||
pagination (`limit`/`offset`) or traversal bounds (`max_depth`/`max_nodes`)
|
||||
that stop producer work early when supplied, preserve unpaged behavior
|
||||
|
||||
@@ -10,6 +10,10 @@ and maintenance cost. Keep cosmetic polish with useful fixes; confusing or
|
||||
incorrect user instructions warrant standalone corrections. Collect other
|
||||
cosmetic-only suggestions in an issue rather than separate PRs.
|
||||
|
||||
To fix a reproduced defect, use the [bug fix skill](.agents/skills/rea-bug-fix/SKILL.md)
|
||||
to trace it to the boundary that owns it, prove it with an independent
|
||||
regression, and remove what the fix supersedes.
|
||||
|
||||
For provider wiring, start with
|
||||
[`src/composition/binary.ts`](src/composition/binary.ts) for deep candidates and
|
||||
the other `src/composition/` factories for tool services, including
|
||||
|
||||
Reference in new issue
Block a user