claude-dev-env 8.114.9 → 8.115.0
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/.agents/skills/pr-lifecycle/SKILL.md +1 -1
- package/docs/rule-guides/verified-work.md +10 -2
- package/hooks/features/spawn-routing.md +1 -1
- package/hooks/hooks_constants/spawn_oversight_hook_constants.py +5 -1
- package/hooks/routing/test_spawn_oversight_hook.py +15 -0
- package/package.json +1 -1
- package/scripts/tests/test_verified_work_rule.py +49 -0
|
@@ -11,7 +11,7 @@ User-level rule: applies to **every** git repo that uses GitHub with `gh`. Small
|
|
|
11
11
|
|
|
12
12
|
### Workflow decision tree
|
|
13
13
|
|
|
14
|
-
**When to use stacked PRs:** Feature B depends on Feature A's implementation
|
|
14
|
+
**When to use stacked PRs:** Feature B depends on Feature A's implementation. See the Delivery section of `~/.claude/docs/rule-guides/verified-work.md`.
|
|
15
15
|
|
|
16
16
|
**When to extract shared infrastructure first:** Multiple features need same utilities/helpers
|
|
17
17
|
|
|
@@ -6,7 +6,7 @@ Back to the [rules index](../../rules/index.md).
|
|
|
6
6
|
|
|
7
7
|
Research, plan, and build; a fresh `verifier` agent checks each step and reproduces the issue before it confirms the fix. Report only verified results. Ask before new scope.
|
|
8
8
|
|
|
9
|
-
Every piece of work runs in six steps: research, verify the research, plan, verify the plan, implement, verify the fix. A separate `verifier` agent runs each verify step. The fix check reproduces the issue on the old state first, then confirms it is gone on the new state. The user gets only results a verifier passed. New scope goes to the user as one question before it is built.
|
|
9
|
+
Every piece of work runs in six steps: research, verify the research, plan, verify the plan, implement, verify the fix. A separate `verifier` agent runs each verify step. The fix check reproduces the issue on the old state first, then confirms it is gone on the new state. The user gets only results a verifier passed. New scope goes to the user as one question before it is built. Each piece a verifier passes is committed alone, as its own stack level.
|
|
10
10
|
|
|
11
11
|
**When this applies:** Any task: a change to code, configuration, rules, or a document, and any finding, cause, or fix reported to the user.
|
|
12
12
|
|
|
@@ -19,6 +19,14 @@ Every piece of work runs in six steps: research, verify the research, plan, veri
|
|
|
19
19
|
5. **Implement.** Build the in-scope pieces.
|
|
20
20
|
6. **Verify the fix.** Spawn a fresh `verifier` in fix mode. It reproduces the issue on the old state, confirms the issue is gone on the new state, and confirms an undo of the fix fails again. When no scratch copy can revert the fix, such as an installed setting, it reports UNDO NOT RUN with the reason, and REPRODUCED plus FIXED still pass. A fix whose issue did not reproduce does not pass.
|
|
21
21
|
|
|
22
|
+
## Delivery
|
|
23
|
+
|
|
24
|
+
When a piece's verifier passes, commit that piece alone, as its own stack level. The subject names that one behaviour. Start the next piece on top of it. A piece that depends on nothing earlier goes on its own branch from trunk.
|
|
25
|
+
|
|
26
|
+
Stack with `gt create` where Graphite is installed. Without Graphite, use a plain branch from the previous level, made with `git switch -c <branch>`. The pieces in the plan set the levels, so a reviewer reads one purpose at a time.
|
|
27
|
+
|
|
28
|
+
This applies where the brief and the user allow commits. A worker whose brief bars git writes hands the piece back uncommitted and says so.
|
|
29
|
+
|
|
22
30
|
## The verifier
|
|
23
31
|
|
|
24
32
|
- The verifier is never the agent that did the work. The spawner is the owner of the work. A fresh agent at each verify step keeps the check apart from the author.
|
|
@@ -50,4 +58,4 @@ Report only what a verifier passed. Name the verifier's verdict and the evidence
|
|
|
50
58
|
|
|
51
59
|
## Enforcement
|
|
52
60
|
|
|
53
|
-
`hooks/routing/spawn_oversight_hook.py` adds the six steps, the separate verifier, the reproduce-first check, the scope ask, and the reporting rule to the first passing spawn of each agent in the tree, and again after a compaction. A passing brief has an `Outcome:` line and an `On a blocker:` line; the hook denies a brief without them on every spawn, and the verifier brief template carries both. The flow itself adds context only. No hook refuses a report, a commit, or a spawn for a missing verifier run, so the flow never blocks work the user asked for.
|
|
61
|
+
`hooks/routing/spawn_oversight_hook.py` adds the six steps, the separate verifier, the reproduce-first check, the one-piece-per-level delivery where the brief allows commits, the scope ask, and the reporting rule to the first passing spawn of each agent in the tree, and again after a compaction. A passing brief has an `Outcome:` line and an `On a blocker:` line; the hook denies a brief without them on every spawn, and the verifier brief template carries both. The flow itself adds context only. No hook refuses a report, a commit, or a spawn for a missing verifier run, so the flow never blocks work the user asked for.
|
|
@@ -5,7 +5,7 @@ This family reminds the agent to gather context before a spawn, refuses a brief
|
|
|
5
5
|
## Checks
|
|
6
6
|
|
|
7
7
|
- `routing/spawn_readiness_hook.py` adds context to a spawn that comes before a read step, or before an answered question or a settled-scope line. The spawn still runs.
|
|
8
|
-
- `routing/spawn_oversight_hook.py` denies a spawn whose brief has no `Outcome:` line or no `On a blocker:` clause, each with text after it. The first passing spawn of a session, the first of each subagent, and the first after each compaction get the orchestrator oversight directive; the brief check runs on every spawn. The directive says: run each piece through the verified-work flow, with a fresh verifier agent that checks the research, the plan, and the fix, reproduces the issue before it confirms the fix, and leaves the worker's conclusion out of its brief; ask the user before new scope; report as done only what a verifier passed; and watch the agent while it runs. `routing/spawn_brief_text.py` reads the brief from each spawn tool for this hook and the readiness hook.
|
|
8
|
+
- `routing/spawn_oversight_hook.py` denies a spawn whose brief has no `Outcome:` line or no `On a blocker:` clause, each with text after it. The first passing spawn of a session, the first of each subagent, and the first after each compaction get the orchestrator oversight directive; the brief check runs on every spawn. The directive says: run each piece through the verified-work flow, with a fresh verifier agent that checks the research, the plan, and the fix, reproduces the issue before it confirms the fix, and leaves the worker's conclusion out of its brief; where the brief allows commits, commit each piece a verifier passed alone, as its own stack level, and otherwise hand it back uncommitted and say so; ask the user before new scope; report as done only what a verifier passed; and watch the agent while it runs. `routing/spawn_brief_text.py` reads the brief from each spawn tool for this hook and the readiness hook.
|
|
9
9
|
- `routing/thread_spawn_pace_hook.py` reshapes a thread request to Opus at medium when usage is over pace or unreadable. Under pace, a thread request that names a model gets the effort its model allows.
|
|
10
10
|
- `routing/subagent_effort_route_hook.py` sets an allowed effort on an Agent or Task spawn: Opus medium, Sonnet high, Fable low, medium or high, and Haiku any effort. A spawn with no effort or one outside its model's list gets Opus medium, Sonnet high, Fable high, or Haiku medium. `routing/subagent_effort_route.py` holds the rule for this hook and the pace hook.
|
|
11
11
|
- `routing/subagent_model_routing.mjs` allows a selected Luna model, remaps eligible requests, and denies unsupported model routing.
|
|
@@ -44,7 +44,11 @@ SPAWN_OVERSIGHT_DIRECTIVE = (
|
|
|
44
44
|
"confirms the fix on the new state. Spawn a fresh verifier agent for each "
|
|
45
45
|
"check, never the agent that did the work, and brief it with the issue and "
|
|
46
46
|
"the sources and leave the worker's conclusion out. A verifier's check ends "
|
|
47
|
-
"the chain and gets no verifier of its own.
|
|
47
|
+
"the chain and gets no verifier of its own. When a piece's verifier passes "
|
|
48
|
+
"and the brief allows commits, commit that piece alone as its own stack level "
|
|
49
|
+
"with a subject for that one behaviour: a piece that depends on it goes on "
|
|
50
|
+
"top, and an independent piece goes on its own branch from trunk. Otherwise "
|
|
51
|
+
"hand the piece back uncommitted and say so. Ask the user once before "
|
|
48
52
|
"you build new scope the user's words do not name, and keep in-scope work "
|
|
49
53
|
"moving while the question waits. Report as done only what a verifier "
|
|
50
54
|
"passed, with its evidence. While the agent runs, read its progress and wake "
|
|
@@ -361,3 +361,18 @@ def test_the_emitted_directive_reports_only_verified_results() -> None:
|
|
|
361
361
|
|
|
362
362
|
def test_the_emitted_directive_ends_the_chain_at_the_verifier() -> None:
|
|
363
363
|
assert "A verifier's check ends the chain and gets no verifier of its own" in _emitted_directive()
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
def test_the_emitted_directive_commits_each_passed_piece_as_its_own_stack_level() -> None:
|
|
367
|
+
directive = _emitted_directive()
|
|
368
|
+
assert "When a piece's verifier passes and the brief allows commits, commit that piece alone as its own stack level" in directive
|
|
369
|
+
assert "a piece that depends on it goes on top" in directive
|
|
370
|
+
assert "an independent piece goes on its own branch from trunk" in directive
|
|
371
|
+
assert "Otherwise hand the piece back uncommitted and say so." in directive
|
|
372
|
+
assert directive.index("confirms the fix on the new state") < directive.index("commit that piece alone")
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
def test_the_emitted_directive_stays_context_only_and_inside_its_budget() -> None:
|
|
376
|
+
directive = _emitted_directive()
|
|
377
|
+
assert len(directive) < 1500
|
|
378
|
+
assert "deny" not in directive.lower()
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ from pathlib import Path
|
|
|
5
5
|
PACKAGE_ROOT = Path(__file__).resolve().parents[2]
|
|
6
6
|
INDEX_PATH = PACKAGE_ROOT / "rules" / "index.md"
|
|
7
7
|
GUIDE_PATH = PACKAGE_ROOT / "docs" / "rule-guides" / "verified-work.md"
|
|
8
|
+
PR_LIFECYCLE_PATH = PACKAGE_ROOT / ".agents" / "skills" / "pr-lifecycle" / "SKILL.md"
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
def test_the_index_points_every_session_at_the_verified_work_guide() -> None:
|
|
@@ -38,3 +39,51 @@ def test_the_guide_keeps_the_verifier_apart_and_asks_before_new_scope() -> None:
|
|
|
38
39
|
assert "A fix whose issue did not reproduce does not pass." in guide_text
|
|
39
40
|
assert "New scope goes to the user as one question before any of it is built" in guide_text
|
|
40
41
|
assert "In-scope work runs with no ask." in guide_text
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _delivery_section(guide_text: str) -> str:
|
|
45
|
+
return guide_text.split("## Delivery", 1)[1].split("\n## ", 1)[0]
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def test_the_guide_delivers_each_passed_piece_as_its_own_stack_level() -> None:
|
|
49
|
+
delivery_text = _delivery_section(GUIDE_PATH.read_text(encoding="utf-8"))
|
|
50
|
+
assert "When a piece's verifier passes, commit that piece alone, as its own stack level." in delivery_text
|
|
51
|
+
assert "The subject names that one behaviour." in delivery_text
|
|
52
|
+
assert "Start the next piece on top of it." in delivery_text
|
|
53
|
+
assert "A piece that depends on nothing earlier goes on its own branch from trunk." in delivery_text
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def test_the_guide_names_the_stacking_command_for_each_setup() -> None:
|
|
57
|
+
delivery_text = _delivery_section(GUIDE_PATH.read_text(encoding="utf-8"))
|
|
58
|
+
assert "`gt create`" in delivery_text
|
|
59
|
+
assert "a plain branch from the previous level" in delivery_text
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def test_the_guide_keeps_six_steps_and_sets_delivery_after_them() -> None:
|
|
63
|
+
guide_text = GUIDE_PATH.read_text(encoding="utf-8")
|
|
64
|
+
assert "## The six steps" in guide_text
|
|
65
|
+
assert guide_text.index("6. **Verify the fix.**") < guide_text.index("## Delivery")
|
|
66
|
+
assert guide_text.index("## Delivery") < guide_text.index("## The verifier")
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def test_the_guide_sets_no_line_or_file_count_on_a_level() -> None:
|
|
70
|
+
delivery_text = _delivery_section(GUIDE_PATH.read_text(encoding="utf-8")).lower()
|
|
71
|
+
assert "lines" not in delivery_text
|
|
72
|
+
assert "files" not in delivery_text
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def test_the_guide_limits_delivery_commits_to_where_the_brief_and_user_allow_them() -> None:
|
|
76
|
+
delivery_text = _delivery_section(GUIDE_PATH.read_text(encoding="utf-8"))
|
|
77
|
+
assert "This applies where the brief and the user allow commits." in delivery_text
|
|
78
|
+
assert "A worker whose brief bars git writes hands the piece back uncommitted and says so." in delivery_text
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def test_the_pull_request_skill_points_its_decision_tree_at_the_delivery_section() -> None:
|
|
82
|
+
skill_text = PR_LIFECYCLE_PATH.read_text(encoding="utf-8")
|
|
83
|
+
decision_tree = skill_text.split("### Workflow decision tree", 1)[1].split("\n### ", 1)[0]
|
|
84
|
+
assert "Feature B depends on Feature A's implementation." in decision_tree
|
|
85
|
+
assert "Delivery section of `~/.claude/docs/rule-guides/verified-work.md`" in decision_tree
|
|
86
|
+
assert "its own stack level" not in decision_tree
|
|
87
|
+
assert "independent piece" not in decision_tree
|
|
88
|
+
assert "`gt create`" not in decision_tree
|
|
89
|
+
assert "a plain branch from the previous level" not in decision_tree
|