@punks/cli 5.1.0 → 5.2.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.
Files changed (89) hide show
  1. package/AGENTS.md +28 -10
  2. package/dist/BASELINE_CHANGELOG.md +11 -1
  3. package/dist/CHANGELOG.md +51 -0
  4. package/dist/baseline/scaffold-baseline/baseline.json +5 -10
  5. package/dist/baseline/scaffold-baseline/data/catalog/packs.json +1 -1
  6. package/dist/baseline/scaffold-baseline/data/catalog/skills.json +0 -8
  7. package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.mjs +118 -41
  8. package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.test.ts +345 -26
  9. package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents-validator.test.ts +39 -0
  10. package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents.mjs +8 -2
  11. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/define-handoffs.md +1 -1
  12. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/model-state.md +1 -1
  13. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/test-routes.md +1 -1
  14. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/write-phases.md +2 -2
  15. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/phases/write-router.md +1 -1
  16. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/write-graph-based-skills/references/authoring-contract.md +8 -8
  17. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/autoreview/SKILL.md +1 -1
  18. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/make-tsuite/SKILL.md +2 -2
  19. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/brainstorm/SKILL.md +21 -11
  20. package/dist/baseline/scaffold-baseline/skills/phases/debugging-phase/SKILL.md +3 -4
  21. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/SKILL.md +2 -2
  22. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/debug.md +2 -2
  23. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/human-steering.md +25 -0
  24. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/implement.md +2 -2
  25. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +2 -2
  26. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +3 -2
  27. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/context-continuity.md +1 -1
  28. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/failure-continuity.md +1 -1
  29. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/phase-handoff.md +4 -3
  30. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/AUTHORING-HANDOFF.md +9 -9
  31. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/SKILL.md +1 -1
  32. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/ensure-fog.md +1 -1
  33. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/grilling.md +1 -1
  34. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/human-steering.md +25 -0
  35. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/prototype.md +1 -1
  36. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/reconcile.md +1 -1
  37. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/research.md +1 -1
  38. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/router.md +1 -1
  39. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/references/state-graph.md +1 -1
  40. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/return-route.md +6 -5
  41. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/router.md +1 -1
  42. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/run-review.md +2 -1
  43. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/state-graph.md +3 -3
  44. package/dist/baseline/scaffold-baseline.json +5 -5
  45. package/dist/baseline/scaffold-baseline.tgz +0 -0
  46. package/dist/data/AGENTS.md +22 -5
  47. package/dist/data/scripts/commit-gate-runner.mjs +118 -41
  48. package/dist/data/scripts/sync-subagents.mjs +8 -2
  49. package/dist/index.js +117 -110
  50. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/define-handoffs.md +1 -1
  51. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/model-state.md +1 -1
  52. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/test-routes.md +1 -1
  53. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/write-phases.md +2 -2
  54. package/dist/skills/agnostic/docs/write-graph-based-skills/phases/write-router.md +1 -1
  55. package/dist/skills/agnostic/docs/write-graph-based-skills/references/authoring-contract.md +8 -8
  56. package/dist/skills/agnostic/quality/autoreview/SKILL.md +1 -1
  57. package/dist/skills/agnostic/quality/make-tsuite/SKILL.md +2 -2
  58. package/dist/skills/agnostic/requirements/brainstorm/SKILL.md +21 -11
  59. package/dist/skills/phases/debugging-phase/SKILL.md +3 -4
  60. package/dist/skills/phases/delivery-phase/SKILL.md +2 -2
  61. package/dist/skills/phases/delivery-phase/phases/debug.md +2 -2
  62. package/dist/skills/phases/delivery-phase/phases/human-steering.md +25 -0
  63. package/dist/skills/phases/delivery-phase/phases/implement.md +2 -2
  64. package/dist/skills/phases/delivery-phase/phases/review.md +2 -2
  65. package/dist/skills/phases/delivery-phase/phases/router.md +3 -2
  66. package/dist/skills/phases/delivery-phase/references/context-continuity.md +1 -1
  67. package/dist/skills/phases/delivery-phase/references/failure-continuity.md +1 -1
  68. package/dist/skills/phases/delivery-phase/references/phase-handoff.md +4 -3
  69. package/dist/skills/phases/finder-phase/AUTHORING-HANDOFF.md +6 -6
  70. package/dist/skills/phases/finder-phase/SKILL.md +1 -1
  71. package/dist/skills/phases/finder-phase/phases/ensure-fog.md +1 -1
  72. package/dist/skills/phases/finder-phase/phases/grilling.md +1 -1
  73. package/dist/skills/phases/finder-phase/phases/human-steering.md +25 -0
  74. package/dist/skills/phases/finder-phase/phases/prototype.md +1 -1
  75. package/dist/skills/phases/finder-phase/phases/reconcile.md +1 -1
  76. package/dist/skills/phases/finder-phase/phases/research.md +1 -1
  77. package/dist/skills/phases/finder-phase/phases/router.md +1 -1
  78. package/dist/skills/phases/finder-phase/references/state-graph.md +1 -1
  79. package/dist/skills/phases/review-phase/phases/return-route.md +6 -5
  80. package/dist/skills/phases/review-phase/phases/router.md +1 -1
  81. package/dist/skills/phases/review-phase/phases/run-review.md +2 -1
  82. package/dist/skills/phases/review-phase/references/state-graph.md +3 -3
  83. package/package.json +12 -6
  84. package/dist/baseline/scaffold-baseline/skills/agnostic/generic/handback/SKILL.md +0 -27
  85. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/handback.md +0 -27
  86. package/dist/baseline/scaffold-baseline/skills/phases/finder-phase/phases/handback.md +0 -29
  87. package/dist/skills/agnostic/generic/handback/SKILL.md +0 -27
  88. package/dist/skills/phases/delivery-phase/phases/handback.md +0 -27
  89. package/dist/skills/phases/finder-phase/phases/handback.md +0 -29
@@ -16,7 +16,7 @@ Select when target gates exist and their workflow-owned handoff schema, durable
16
16
  - Keep route suggestions optional, advisory, and lowest authority.
17
17
  - Require every declared completion, blocker, skip or no-op, and human-checkpoint exit to write a durable handoff when applicable.
18
18
  - Require the [human steering terminal](../references/authoring-contract.md#human-steering-terminal)
19
- to preserve the `$handback` outcome and authority guard.
19
+ to preserve the required decision and evidence for resuming.
20
20
 
21
21
  ## Checkable Completion State
22
22
 
@@ -19,7 +19,7 @@ Select when obligations are qualified and the evidence-defined state model, topo
19
19
  - Every state has scope, entry guard, exit guard, and reachable next states.
20
20
  - Every mandatory obligation is reachable and evidence-backed.
21
21
  - Each topology form is represented or marked N/A.
22
- - `human_steering_required` is terminal until the `$handback` authority guard passes.
22
+ - `human_steering_required` preserves the defined terminal and resumption conditions.
23
23
 
24
24
  ## Durable Phase Outcome
25
25
 
@@ -10,7 +10,7 @@ Select when disclosure passes and route predictions, derivations, or mismatch re
10
10
  - Record each predicted route before applying the target contracts.
11
11
  - Derive each route from current evidence, authority, guards, and precedence.
12
12
  - Cover all ten scenarios: baseline path, branch path, repair cycle, planned
13
- human checkpoint, failure handback terminal, cold resume, stale or
13
+ human checkpoint, human steering terminal, cold resume, stale or
14
14
  out-of-scope or invalid artifact, contradictory suggested route losing to
15
15
  evidence, narrower executor substitution with a stable actor-like gate
16
16
  boundary, and premature completion rejected by the terminal guard.
@@ -21,8 +21,8 @@ Select when the target router exists and one or more executable target gates are
21
21
  - Every executable gate has exactly one flat phase file.
22
22
  - Every gate defines the normalized contract and emits only declared exits.
23
23
  - Target root and references contain no executable gate body.
24
- - Every applicable gate invokes `$handback` and emits only the terminal's
25
- durable outcome when its guard selects human steering.
24
+ - Every applicable gate records the terminal outcome and stops when its guard
25
+ selects human steering.
26
26
 
27
27
  ## Durable Phase Outcome
28
28
 
@@ -12,7 +12,7 @@ Select when bounds, state, and authority are complete while the target root boot
12
12
  - Make cold resume independent of transcript continuity.
13
13
  - Return exactly one selected gate, terminal, checkpoint, or blocked outcome for every legal state.
14
14
  - Preserve the [human steering terminal](../references/authoring-contract.md#human-steering-terminal)
15
- until the `$handback` authority guard passes.
15
+ with its defined resumption conditions.
16
16
  - Preserve the target's intentional invocation policy.
17
17
 
18
18
  ## Checkable Completion State
@@ -111,9 +111,9 @@ Completion criterion:
111
111
  ## Human Steering Terminal
112
112
 
113
113
  Every graph includes `human_steering_required` as a terminal, non-success
114
- state. The gate that selects it invokes `$handback`, writes that skill's durable
115
- outcome, and stops. The router keeps returning the terminal until the
116
- `$handback` authority guard passes.
114
+ state for actions beyond accepted scope or unresolved human decisions. The gate
115
+ records the blocker, evidence, proposed action, and required decision, then stops.
116
+ The router keeps returning the terminal until the user authorizes continuation.
117
117
 
118
118
  ## Gate Contract
119
119
 
@@ -181,7 +181,7 @@ Completion criterion:
181
181
  | Branch path | | | | |
182
182
  | Repair cycle | | | | |
183
183
  | Human checkpoint | | | | |
184
- | Failure handback terminal | | | | |
184
+ | Human steering terminal | | | | |
185
185
  | Cold resume | | | | |
186
186
  | Stale, out-of-scope, or invalid artifact | | | | |
187
187
  | Contradictory suggested route loses to evidence | | | | |
@@ -190,8 +190,8 @@ Completion criterion:
190
190
 
191
191
  Completion criterion:
192
192
  - all ten rows are filled with stale, out-of-scope, and invalid as subcases.
193
- - the failure-handback row proves the `human_steering_required` terminal and
194
- `$handback` authority guard; the planned human-checkpoint row remains distinct.
193
+ - the human-steering row proves the terminal and resumption conditions defined
194
+ in [Human Steering Terminal](#human-steering-terminal); the planned human-checkpoint row remains distinct.
195
195
  - repairs are present only when match is No.
196
196
 
197
197
  ## Final Audit
@@ -200,8 +200,8 @@ Completion criterion:
200
200
  - Router and gates are deterministic under the authority table.
201
201
  - Cold resume derives from current evidence, workflow-native artifacts, and committed handoffs.
202
202
  - Every exit commits a durable handoff.
203
- - `human_steering_required` invokes `$handback`, commits its outcome, and keeps
204
- the terminal until that skill's authority guard passes.
203
+ - `human_steering_required` records the outcome and preserves the
204
+ [terminal and resumption conditions](#human-steering-terminal).
205
205
  - Terminal guard accounts for every mandatory obligation.
206
206
  - The skill-protocol boundary is the set of written contracts and durable evidence.
207
207
  - Markdown cannot enforce exclusive writers, execution ordering, or atomic persistence; require an external runtime only when one of those guarantees is a correctness requirement.
@@ -27,7 +27,7 @@ Use when:
27
27
  focused tests for changed code. End this invocation without rerunning the
28
28
  helper. A further direct pass requires formal `$review-phase` or a new
29
29
  explicit user instruction after this result.
30
- - When a finding triggers `$handback`, invoke it before any expanded repair.
30
+ - Report repairs beyond accepted scope with the decision needed before proceeding.
31
31
  - For security-audit suppression changes, verify accepted findings remain auditable: suppressed findings stay in structured output, active output keeps an unsuppressible suppression notice, and aggregate findings cannot hide unrelated active risk.
32
32
  - Never switch or override the requested review engine/model. If the review hits model capacity, retry the same command a few times with the same engine/model.
33
33
  - Be patient with large bundles. Structured review can take up to 30 minutes while the model call is active, especially with Codex tools or web search.
@@ -9,11 +9,11 @@ Build a risk-driven automated software test portfolio. `TSuite` means test suite
9
9
 
10
10
  ## Boundary
11
11
 
12
- Production-reachable content is immutable. Writable scope is limited to automated tests and test-scoped fixtures, harnesses, seeds, artifacts, configuration, and dependencies. Inline tests or shared manifests are writable only where changed regions are mechanically isolated to test compilation or execution. Ambiguous isolation is a blocker requiring handback.
12
+ Production-reachable content is immutable. Writable scope is limited to automated tests and test-scoped fixtures, harnesses, seeds, artifacts, configuration, and dependencies. Inline tests or shared manifests are writable only where changed regions are mechanically isolated to test compilation or execution. Ambiguous isolation is a blocker. Report the uncertainty and required scope decision before editing.
13
13
 
14
14
  Before editing, classify every allowed path or hunk as test-scoped. After editing, inspect the complete source-control diff; completion requires every changed region and dependency to remain unreachable from production behavior, artifacts, and deployable wiring.
15
15
 
16
- Keep a product defect visible as a failing test with observed failure evidence, then hand back a separate production requirement. A test-only task reaches GREEN only through test-scoped changes.
16
+ Keep a product defect visible as a failing test with observed failure evidence, then report a separate production requirement. A test-only task reaches GREEN only through test-scoped changes.
17
17
 
18
18
  ## Modes
19
19
 
@@ -5,14 +5,24 @@ description: Brainstorm a bounded system from the operating agent’s perspectiv
5
5
 
6
6
  # Brainstorm
7
7
 
8
- 1. Bound the system, its operator, accepted constraints, and available
9
- evidence. Mark every unsupported premise as unknown.
10
- 2. Operate the system from the agent's seat. Trace intake, state, control,
11
- feedback, recovery, and handoff. Account for each applicable surface or
12
- record why it does not apply.
13
- 3. Derive the smallest changes that make the system agent-intuitive,
14
- agent-ergonomic, and agent-accretive. For each candidate, state its evidence,
15
- consequence, and unresolved tradeoff.
16
- 4. Return the evidence-grounded observations and unresolved decisions. Completion
17
- requires every observation to trace to evidence or an explicit unknown. They
18
- remain candidates until the caller accepts them.
8
+ 1. Bound the system, operator, accepted constraints, and available evidence.
9
+ Mark every unsupported premise unknown.
10
+ 2. Put yourself in the operating agent's seat. Ask: "What would most enable me
11
+ to understand the situation accurately and control it optimally, producing
12
+ the best and most accurate results with the least expenditure of resources?"
13
+ Conceptualize the project as one synthetic SYSTEM: maximally coherent,
14
+ cohesive, modular, interconnected; a tower of linked abstractions maximally
15
+ legible to an agent. Trace intake, state, control, feedback, recovery, and
16
+ handoff through that tower. Account for each applicable surface with
17
+ evidence, or record why it does not apply.
18
+ 3. Derive the smallest changes that make the system agent-intuitive (clear
19
+ meaning), agent-ergonomic (efficient control), and agent-accretive (reusable
20
+ verified knowledge benefiting later runs). For each candidate, state
21
+ evidence, consequence, and unresolved tradeoff, including required
22
+ design-document and plan changes. Apply document or plan edits only when
23
+ authorized by the caller; otherwise propose them. Completion requires
24
+ reconciling every affected design document and plan when edits are
25
+ authorized, and reporting unresolved inconsistencies across abstractions.
26
+ 4. Return evidence-grounded observations and unresolved decisions. Completion
27
+ requires every observation to trace to evidence or an explicit unknown.
28
+ Observations remain candidates until the caller accepts them.
@@ -30,7 +30,6 @@ description: >-
30
30
 
31
31
  - The work is pure planning, requirements discovery, or design.
32
32
  - The failure is already proven and only needs implementation inside an active spec plan.
33
- - The next action triggers `$handback`; return human steering instead.
34
33
  - The request is only static code review with no runtime symptom.
35
34
 
36
35
  ## Workflow
@@ -42,7 +41,8 @@ description: >-
42
41
  2. **Set bounds.**
43
42
  - Define owned files, systems, and scenarios.
44
43
  - For delivery-internal debugging, patch only inside the active delivery scope.
45
- - When the next action triggers `$handback`, invoke it and stop.
44
+ - If the next action exceeds these bounds, retain the evidence and required
45
+ decision; return `human_steering_required` and stop.
46
46
  3. **Reproduce visible behavior.**
47
47
  - Before forming hypotheses or starting fix work, run `$verify-behavior` in
48
48
  `reproduce` mode when the reported behavior is visibly exercisable.
@@ -71,7 +71,7 @@ description: >-
71
71
  8. **Exit.**
72
72
  - Fixed: report cause, patch, verification, and residual risk.
73
73
  - Blocked: report the concrete blocker and the missing artifact/access/action.
74
- - Human steering: return the durable `$handback` outcome and stop.
74
+ - Human steering: return `human_steering_required` with the retained decision record.
75
75
 
76
76
  ## Parallel Rules
77
77
 
@@ -83,7 +83,6 @@ description: >-
83
83
  - Never let parallel workers make speculative fixes against unproven hypotheses.
84
84
  - Merge worker findings into one evidence matrix before deciding on a patch.
85
85
  - In delivery-internal mode, parallel workers must stay inside the delivery scope unless assigned readonly investigation.
86
- - A `$handback` trigger ends fix delegation.
87
86
 
88
87
  ## Output Contract
89
88
 
@@ -36,7 +36,7 @@ Within accepted bounds, full delivery grants its selected inner steps the author
36
36
  - [phases/review.md](phases/review.md): prepare the explicit review handoff or
37
37
  classify findings from a retained report.
38
38
  - [phases/debug.md](phases/debug.md): investigate runtime-evidence failures.
39
- - [phases/handback.md](phases/handback.md): return a scope or authority boundary for human steering.
39
+ - [phases/human-steering.md](phases/human-steering.md): return a scope or authority boundary for human steering.
40
40
  - [phases/docs-ingest.md](phases/docs-ingest.md): ingest docs-affecting changes or record a no-op.
41
41
  - [phases/closeout.md](phases/closeout.md): finish tracker, PR, validation, and final report state.
42
42
 
@@ -59,4 +59,4 @@ Within accepted bounds, full delivery grants its selected inner steps the author
59
59
  - User explicitly requested a HITL checkpoint or one-phase mode and its resumable state was written.
60
60
  - Router reaches closeout and final evidence is reported.
61
61
  - Scope is ambiguous, stale, contradictory, or blocked by missing access.
62
- - `human_steering_required` is durable while the `$handback` authority guard fails.
62
+ - `human_steering_required` remains durable while its required decision is unresolved.
@@ -14,8 +14,8 @@ Load `debugging-phase` only after this phase is selected.
14
14
  trace, reproduction, or review finding.
15
15
  - Readonly parallel hypothesis research is allowed.
16
16
  - Speculative parallel fixes are not allowed.
17
- - When current evidence triggers `$handback`, return it to the router without
18
- opening another goal.
17
+ - When the next action exceeds accepted bounds, return the required decision
18
+ to the router before opening another goal.
19
19
  - Preserve review lineage, `review_count`, `repair_count`, and the opening
20
20
  `review_run_id` through the repair.
21
21
 
@@ -0,0 +1,25 @@
1
+ # Human Steering Phase
2
+
3
+ ## Guard
4
+
5
+ The next action exceeds accepted bounds, changes accepted requirements, weakens
6
+ a gate, substantially redesigns implementation, or requires missing authority.
7
+
8
+ ## Bounded Action
9
+
10
+ 1. Record the blocked action, supporting evidence, and exact decision needed in
11
+ a durable state artifact.
12
+ 2. Put its Context Pointer and exact blocker in the compact Delivery Handoff.
13
+ 3. Return `human_steering_required` and stop.
14
+
15
+ ## Completion Evidence
16
+
17
+ - durable decision record
18
+ - preserved accepted bounds and completed in-bounds artifacts
19
+ - expanded work awaits the required decision
20
+
21
+ ## Exit
22
+
23
+ Emit the [common Phase Result](../references/context-continuity.md#common-phase-result)
24
+ with pointers to the decision record. In every mode, resume routing when current
25
+ user direction resolves the required decision.
@@ -34,8 +34,8 @@ silently renaming them.
34
34
  - Use a one-worker wave only when dependencies or ownership leave one task
35
35
  unblocked.
36
36
  - Keep changes inside the active delivery scope.
37
- - When current evidence triggers `$handback`, return it to the router without
38
- expanding worker ownership.
37
+ - When the next action exceeds accepted bounds, return the required decision
38
+ to the router before expanding worker ownership.
39
39
  - Parent orchestration owns shared notes and final validation evidence.
40
40
  - For UI work, require `implement-spec` to carry durable before/after links through `UI Evidence Links`; use `repo-asset-management` only through that evidence contract.
41
41
  - If runtime evidence appears during validation, finish the phase handoff and route to debug.
@@ -72,8 +72,8 @@ After the retained report establishes the completed ordinal:
72
72
  1. Recompute aggregate routing from every finding's validated `return_route`
73
73
  with the review contract helper. Reject a mismatch with the retained routing
74
74
  object.
75
- 2. For primary `human_steering_required`, preserve the returned `$handback`
76
- outcome and stop. It never opens a repair state.
75
+ 2. For primary `human_steering_required`, preserve the returned decision record
76
+ and stop. It never opens a repair state.
77
77
  3. When `secondary_architecture_follow_up` is true, enter `debt_follow_up`
78
78
  first and persist the primary `debugging` or `implementation` route as
79
79
  `post_debt_route`.
@@ -5,8 +5,9 @@ Choose one next phase from current durable authority.
5
5
  1. Apply [context continuity](../references/context-continuity.md): select
6
6
  trigger-specific instructions, validate required pointers and warm/cold mode.
7
7
  A failed resolution emits the common Phase Result and blocks its action.
8
- 2. Preserve terminal `human_steering_required` until `$handback`'s authority guard
9
- passes. New boundary evidence selects [handback.md](handback.md).
8
+ 2. Preserve terminal `human_steering_required` until current user direction
9
+ resolves the required decision. New boundary evidence selects
10
+ [human-steering.md](human-steering.md).
10
11
  3. For failed tasks or repair evidence, apply
11
12
  [failure continuity](../references/failure-continuity.md). Independent eligible
12
13
  work continues through the implementation owner's gates.
@@ -87,7 +87,7 @@ pointer contract above; required delta and stop fields cannot be omitted.
87
87
  Keep phase-specific state, logs and detailed rationale in pointed durable
88
88
  artifacts. `failed` records an attempted action's observed failure; `blocked`
89
89
  records unavailable required proof or prerequisite. `skipped` requires an exact
90
- no-op reason. `human_steering_required` points to the retained handback outcome.
90
+ no-op reason. `human_steering_required` points to the retained decision record.
91
91
  A Phase Result neither accepts a Task nor replaces its Task Gate.
92
92
 
93
93
  Full Delivery updates its packet and re-enters the router. Direct phase, explicit
@@ -17,7 +17,7 @@ contracts; these remain the sole owners of worker returns and gate outcomes.
17
17
  Diagnostic Evidence. Record the observation and discriminating result before
18
18
  retrying; repeating the same repair is not new evidence.
19
19
  3. Stagnant repair, required scope redesign, weaker gates, changed requirements,
20
- missing access or a human decision routes to [handback](../phases/handback.md).
20
+ missing access or a human decision routes to [human steering](../phases/human-steering.md).
21
21
  Keep accepted bounds and scope custody intact while steering is required.
22
22
  4. Retain the resulting phase-specific state behind a pointer and emit the common
23
23
  [Phase Result](context-continuity.md#common-phase-result). Resume checks current
@@ -106,6 +106,7 @@ evidence under the transition rules in [review.md](../phases/review.md). A clean
106
106
  handoff links the retained review, final changes and passing required checks.
107
107
  Historical ordinals remain unchanged during legacy read-time normalization.
108
108
 
109
- For `human_steering_required`, store the complete `$handback` outcome in the
110
- pointed durable state artifact. Keep only its pointer and exact blocker in the
111
- Delivery Handoff. The state remains terminal until the authority guard passes.
109
+ For `human_steering_required`, store the blocked action, evidence, and required
110
+ decision in the pointed durable state artifact. Keep only its pointer and exact
111
+ blocker in the Delivery Handoff. The state remains terminal until current user
112
+ direction resolves the required decision.
@@ -15,12 +15,12 @@
15
15
 
16
16
  | State | Entry guard | Exit guard | Next states |
17
17
  | --- | --- | --- | --- |
18
- | Fog absent | supported wrapper lens, no exact Fog | exact Fog and immutable lens | grilling, handback |
19
- | Grilling active | exact Fog, bounded result missing | retained evidence or support request | research, prototype, reconcile, return, handback |
20
- | Support active | named child and precise unknown | immutable evidence or verdict | grilling, handback |
21
- | Projection pending | ceiling-safe optional intent | exact or unresolved result | return, handback |
18
+ | Fog absent | supported wrapper lens, no exact Fog | exact Fog and immutable lens | grilling, human-steering |
19
+ | Grilling active | exact Fog, bounded result missing | retained evidence or support request | research, prototype, reconcile, return, human-steering |
20
+ | Support active | named child and precise unknown | immutable evidence or verdict | grilling, human-steering |
21
+ | Projection pending | ceiling-safe optional intent | exact or unresolved result | return, human-steering |
22
22
  | Bounded result | required retained evidence exists | durable return written | terminal return |
23
- | Human steering | current authority cannot resolve conflict | `$handback` guard passes | terminal or router re-entry |
23
+ | Human steering | current authority cannot resolve conflict | user direction resolves the conflict | terminal or router re-entry |
24
24
 
25
25
  Graph forms cover the baseline path, lens branch, support cycles, optional
26
26
  projection skip, blocked/checkpoint outcomes, cold resume, and terminal human
@@ -35,7 +35,7 @@ outrank a committed handoff and its advisory suggested route.
35
35
  | Branch path | grilling | grilling | yes | — |
36
36
  | Repair cycle | reconcile | reconcile | yes | — |
37
37
  | Human checkpoint | reconcile | reconcile | yes | — |
38
- | Failure handback terminal | human-steering | human-steering | yes | — |
38
+ | Human steering terminal | human-steering | human-steering | yes | — |
39
39
  | Cold resume | return-target | return-target | yes | — |
40
40
  | Stale or invalid artifact | human-steering | human-steering | yes | — |
41
41
  | Contradictory suggestion loses | grilling | grilling | yes | — |
@@ -35,7 +35,7 @@ The router owns transitions. Each gate owns only its bounded action.
35
35
  - [Prototype support](phases/prototype.md)
36
36
  - [Optional projection reconciliation](phases/reconcile.md)
37
37
  - [Bounded return](phases/return-target.md)
38
- - [Human steering](phases/handback.md)
38
+ - [Human steering](phases/human-steering.md)
39
39
 
40
40
  ## Runtime references
41
41
 
@@ -24,7 +24,7 @@ intake lens.
24
24
  ## Declared exits
25
25
 
26
26
  - `fog_ready` -> router re-entry.
27
- - `human_steering_required` -> handback.
27
+ - `human_steering_required` -> human-steering.
28
28
  - `blocked` -> stop with missing evidence.
29
29
 
30
30
  ## Durable handoff
@@ -31,7 +31,7 @@ and relation, bounded-result state, and optional ceiling-safe projection intent.
31
31
  - `support_required` -> router re-entry.
32
32
  - `projection_requested` -> reconciliation through router re-entry.
33
33
  - `bounded_result_ready` -> bounded return through router re-entry.
34
- - `human_steering_required` -> handback.
34
+ - `human_steering_required` -> human-steering.
35
35
  - `blocked` -> stop with missing evidence.
36
36
 
37
37
  ## Durable handoff
@@ -0,0 +1,25 @@
1
+ # Human Steering Gate
2
+
3
+ ## Entry guard
4
+
5
+ Fog identity, immutable lens, child relevance, support relation, evidence,
6
+ scope, or projection ceiling is ambiguous or conflicting under current authority.
7
+
8
+ ## Bounded action
9
+
10
+ Record the exact conflict, supporting evidence, and minimum human decision.
11
+ Return `human_steering_required` and stop before emitting a mutation intent.
12
+
13
+ ## Completion evidence
14
+
15
+ Durable decision record and evidence that the conflict caused no further mutation.
16
+
17
+ ## Declared exits
18
+
19
+ - `human_steering_required` -> terminal non-success state.
20
+ - `decision_resolved` -> router re-entry with the resolving user direction.
21
+
22
+ ## Durable handoff
23
+
24
+ Link the decision record and retain the terminal state until current user
25
+ direction resolves the conflict.
@@ -23,7 +23,7 @@ and human-verdict pointers, and exact child/relation readback.
23
23
  ## Declared exits
24
24
 
25
25
  - `support_resolved` -> router re-entry.
26
- - `human_steering_required` -> handback.
26
+ - `human_steering_required` -> human-steering.
27
27
  - `blocked` -> stop with missing retained evidence.
28
28
 
29
29
  ## Durable handoff
@@ -29,7 +29,7 @@ unresolved projection result, or a zero-write conflict result.
29
29
  - `projection_reconciled` -> router re-entry.
30
30
  - `projection_unresolved` -> bounded return through router re-entry.
31
31
  - `approval_required` -> persist checkpoint and stop.
32
- - `human_steering_required` -> handback.
32
+ - `human_steering_required` -> human-steering.
33
33
  - `blocked` -> stop with missing required readback.
34
34
 
35
35
  ## Durable handoff
@@ -24,7 +24,7 @@ immutable commit SHA and path, and exact child/relation readback.
24
24
  ## Declared exits
25
25
 
26
26
  - `support_resolved` -> router re-entry.
27
- - `human_steering_required` -> handback.
27
+ - `human_steering_required` -> human-steering.
28
28
  - `blocked` -> stop with missing retained evidence.
29
29
 
30
30
  ## Durable handoff
@@ -10,7 +10,7 @@ suggested route is advisory only.
10
10
  1. Unsupported intake lens, explicit steering state, ambiguous Fog identity,
11
11
  conflicting immutable-lens evidence, duplicate child identity, ambiguous child choice,
12
12
  unsupported support kind, or projection above the wrapper ceiling ->
13
- [handback](handback.md).
13
+ [human-steering](human-steering.md).
14
14
  2. No exact Fog readback -> [ensure-fog](ensure-fog.md).
15
15
  3. One unresolved Research child -> [research](research.md).
16
16
  4. One unresolved Prototype child -> [prototype](prototype.md).
@@ -20,7 +20,7 @@ ensure-fog
20
20
  -> bounded return
21
21
 
22
22
  identity, lens, selection, or ceiling conflict
23
- -> handback -> human_steering_required
23
+ -> human-steering -> human_steering_required
24
24
  ```
25
25
 
26
26
  One Fog retains its immutable original Business or Functional intake lens.
@@ -41,8 +41,9 @@ debug, debt, documentation, or closeout work.
41
41
  4. Require the derived result to equal the retained report's `routing` object.
42
42
  A mismatch is invalid retained routing evidence and routes to
43
43
  `review_failed`.
44
- 5. If the primary route is `human_steering_required`, invoke `$handback`, write
45
- its durable outcome, and stop.
44
+ 5. If the primary route is `human_steering_required`, retain the blocking
45
+ finding, supporting evidence, and exact decision needed; return that outcome
46
+ and stop.
46
47
  6. Otherwise write returned routing evidence containing the immutable report
47
48
  identity, stable finding IDs, primary route, optional architecture follow-up,
48
49
  and validation summary. Delivery returns `review_routed`; standalone returns
@@ -55,7 +56,7 @@ debug, debt, documentation, or closeout work.
55
56
  - Human steering outranks runtime, implementation, debt, documentation, and
56
57
  closeout.
57
58
  - The retained report and reviewed target remain readonly.
58
- - This gate writes routing or `$handback` evidence only. Delivery owns any later
59
+ - This gate writes routing or decision evidence only. Delivery owns any later
59
60
  route mutation and every repair counter or active repair state.
60
61
  - One return does not invoke review again, run validation again, create review
61
62
  4, or enter repair.
@@ -74,8 +75,8 @@ debug, debt, documentation, or closeout work.
74
75
  explicit delivery resume.
75
76
  - `review_complete`: standalone routing evidence is durable and review is
76
77
  complete.
77
- - `human_steering_required`: the `$handback` outcome is durable and expanded
78
- repair awaits that skill's authority guard.
78
+ - `human_steering_required`: the decision record is durable; expanded repair
79
+ awaits current user direction resolving the required decision.
79
80
  - `report_retention_pending`: retained containment or blob evidence became
80
81
  temporarily unverifiable; retry retention without rerunning lenses.
81
82
  - `review_due`: target, bounds, or governing sources are no longer fresh for
@@ -43,7 +43,7 @@ output.
43
43
 
44
44
  | Priority | Current evidence | Output |
45
45
  | --- | --- | --- |
46
- | 1 | Durable `human_steering_required` while the `$handback` authority guard fails | terminal `human_steering_required` |
46
+ | 1 | Durable `human_steering_required` with an unresolved required decision | terminal `human_steering_required` |
47
47
  | 2 | Unsupported target, invalid accepted bounds, non-retryable contract or infrastructure failure, malformed active retention candidate, or `same_run_conflict` | terminal `review_failed` |
48
48
  | 3 | Delivery entry is otherwise valid, recovered `review_count >= 2`, no verified human direction authorizes the next ordinal, and no already-started run has valid predecessor evidence | terminal `review_budget_exhausted` |
49
49
  | 4 | A repository-approved retained ref is required but cannot be derived and requires an operator decision | checkpoint `retained_ref_approval_required` |
@@ -58,7 +58,8 @@ scope; the parent rejects stale, expanded, duplicated, or unverified output.
58
58
  accepted finding a stable identifier, lens, severity, location, impact,
59
59
  evidence, action, and one explicit `return_route`: `human_steering_required`,
60
60
  `debugging`, `implementation`, `debt_follow_up`, or `docs_ingest`. Use
61
- `human_steering_required` when the repair triggers `$handback`.
61
+ `human_steering_required` when the repair exceeds accepted bounds, changes
62
+ requirements, weakens a gate, or substantially redesigns implementation.
62
63
  7. Run only the smallest safe readonly validation needed to verify candidates or
63
64
  governing acceptance evidence. Broader checks require explicit accepted spec
64
65
  or plan authority. Record missing required RED/GREEN evidence as a finding;
@@ -24,7 +24,7 @@ and clean handoff.
24
24
  | `report_retention_pending` | Retryable retention failure | Hashes fresh | Report writer | `report_retention_pending` | None | Exact retryable evidence; no authoritative pass |
25
25
  | `report_retention_pending` | Non-retryable retention failure | Retry cannot succeed | Report writer | `review_failed` | None | Exact terminal evidence; no authoritative pass |
26
26
  | `report_retention_pending` | Freshness changed | Target or source hash changed | `review-phase` | `review_due` | None | Stale local report; unchanged counters |
27
- | `review_routed` | Human steering route | Derived primary route is `human_steering_required` | `review-phase` | `human_steering_required` | None | Retained report plus durable `$handback` outcome |
27
+ | `review_routed` | Human steering route | Derived primary route is `human_steering_required` | `review-phase` | `human_steering_required` | None | Retained report plus durable decision record |
28
28
  | `review_routed` | Readonly return | Standalone; primary route is not `human_steering_required` | Standalone caller | `review_complete` | None | Retained report output and route |
29
29
  | `review_routed` | Resume debug route | Handoff already records run id, debug route, and `debug_active` | `delivery-phase` | `debug_active` | None | Existing atomic handoff; no guard fallthrough |
30
30
  | `review_routed` | Resume implementation route | Handoff already records run id, implementation route, and `repair_active` | `delivery-phase` | `repair_active` | None | Existing atomic handoff; no guard fallthrough |
@@ -79,8 +79,8 @@ including three. Recovery preserves this authority without granting more default
79
79
  passes. Historical numbered repair states normalize to the existing repair and
80
80
  focused-validation route; their counters and report identities stay unchanged.
81
81
 
82
- `human_steering_required` opens no repair. It remains terminal until the
83
- `$handback` authority guard passes.
82
+ `human_steering_required` opens no repair. It remains terminal until current
83
+ user direction resolves the required decision.
84
84
 
85
85
  Same-goal bounds revisions preserve delivery lineage and counters. Resume,
86
86
  rebase, new commit, process retry, and handoff preserve them. Only an explicitly
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@punks/cli",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "Harness Intelligence scaffolding CLI",
5
5
  "homepage": "https://github.com/wearedevpunks/harness-intelligence/tree/main/apps/cli#readme",
6
6
  "bugs": {
@@ -37,13 +37,19 @@
37
37
  "release:publish:beta": "NPM_TAG=beta node ./scripts/release-dispatcher.mjs",
38
38
  "release:publication": "cd ../.. && node ./apps/cli/scripts/run-release-publication.mjs",
39
39
  "sync:skills": "node ./scripts/sync-skills-repo.mjs",
40
- "test": "vitest run --config vitest.config.ts",
40
+ "test": "vitest run --config vitest.config.ts --maxWorkers=1",
41
41
  "test:parallel": "vitest run --config vitest.config.ts --fileParallelism --maxWorkers=2",
42
42
  "ui:catalog": "bun ./scripts/run-renderer-catalog.mjs",
43
43
  "lint": "oxlint src scripts",
44
- "format": "oxfmt --check src scripts package.json tsconfig.json vitest.config.ts",
45
- "format:check": "oxfmt --check src scripts package.json tsconfig.json vitest.config.ts",
46
- "check": "bun run lint && bun run format"
44
+ "format": "oxfmt --check src scripts package.json tsconfig.json vitest*.ts",
45
+ "format:check": "oxfmt --check src scripts package.json tsconfig.json vitest*.ts",
46
+ "check": "bun run lint && bun run format",
47
+ "test:source": "vitest run --config vitest.source.config.ts --maxWorkers=1",
48
+ "test:update": "vitest run --config vitest.update.config.ts --maxWorkers=1",
49
+ "test:release": "vitest run --config vitest.release.config.ts --maxWorkers=1",
50
+ "test:built": "vitest run --config vitest.built.config.ts --maxWorkers=1",
51
+ "test:recovery:historical": "bun test-fixtures/release-recovery/historical.runner.ts",
52
+ "test:update:diagnostic": "node ../../scripts/behavior-contract/issue-215-update-benchmark.mjs"
47
53
  },
48
54
  "dependencies": {
49
55
  "react-devtools-core": "^6.1.5"
@@ -68,5 +74,5 @@
68
74
  "ultracite": "7.10.7",
69
75
  "vitest": "catalog:"
70
76
  },
71
- "packageManager": "bun@1.3.5"
77
+ "packageManager": "bun@1.4.0"
72
78
  }
@@ -1,27 +0,0 @@
1
- ---
2
- name: handback
3
- description: Hand control back when a blocker or proposed next step crosses accepted goal bounds, changes accepted requirements, weakens a gate, or substantially redesigns implementation.
4
- ---
5
-
6
- # Handback
7
-
8
- Autonomy applies only while the next action remains inside the accepted goal.
9
-
10
- Return `human_steering_required` with:
11
-
12
- - initial goal and accepted bounds
13
- - current phase and last known-good state
14
- - attempts and evidence
15
- - blocker and what it prevents
16
- - proposed next action
17
- - why it changes scope or authority
18
- - exact human decision required
19
-
20
- Preserve completed in-bounds work, then stop. The authority guard passes only
21
- on explicit human authorization for the proposed next action. A proposal is not
22
- authority. “All steps”, “full
23
- delivery”, “do not stop”, and equivalent persistence language apply only within
24
- accepted bounds.
25
-
26
- `human_steering_required` is a terminal, non-success outcome. Expanded design,
27
- implementation, delegation, and recursive review begin only after authority.