@mrciphersmith/keryx 0.2.76 → 0.2.78

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 (51) hide show
  1. package/README.md +15 -10
  2. package/dist/cli.js +11401 -9120
  3. package/dist/proxy-worker.js +12 -12
  4. package/package.json +1 -1
  5. package/src/gdgraph/build.ts +12 -0
  6. package/src/gdgraph/query.ts +51 -1
  7. package/src/gdgraph/types.ts +77 -0
  8. package/src/gdgraph/wiki-layer-no-git.test.ts +73 -0
  9. package/src/gdgraph/wiki-layer.test.ts +211 -0
  10. package/src/gdgraph/wiki-layer.ts +213 -0
  11. package/src/gdskills/bundled/rules/core/api-contracts.mdc +6 -4
  12. package/src/gdskills/bundled/rules/core/model-selection.mdc +4 -5
  13. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.codex.md +4 -38
  14. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.cursor.md +4 -38
  15. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.md +4 -38
  16. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.opencode.md +4 -38
  17. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.zed.md +4 -38
  18. package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.codex.md +1 -3
  19. package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.cursor.md +1 -3
  20. package/src/gdskills/bundled/skills/orchestration/feature-dev/SKILL.md +1 -3
  21. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.codex.md +35 -34
  22. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.cursor.md +35 -34
  23. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.md +35 -34
  24. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.opencode.md +35 -34
  25. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.zed.md +35 -34
  26. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/input-contract.schema.json +1 -1
  27. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.codex.md +2 -4
  28. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.cursor.md +2 -4
  29. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.md +2 -4
  30. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.opencode.md +2 -4
  31. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.zed.md +2 -4
  32. package/src/gdskills/bundled/skills/planning/autodoc-orchestrator/SKILL.md +10 -6
  33. package/src/gdskills/bundled/skills/planning/interview/SKILL.codex.md +1 -1
  34. package/src/gdskills/bundled/skills/planning/interview/SKILL.cursor.md +1 -1
  35. package/src/gdskills/bundled/skills/planning/interview/SKILL.md +1 -1
  36. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.codex.md +1 -1
  37. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.cursor.md +1 -1
  38. package/src/gdskills/bundled/skills/planning/interviewer/SKILL.md +1 -1
  39. package/src/gdskills/bundled/skills/platform/agent-entrypoint-distiller/SKILL.md +4 -0
  40. package/src/gdskills/bundled/skills/review/review-architecture/SKILL.md +1 -2
  41. package/src/gdskills/bundled/skills/review/review-backend/SKILL.md +2 -2
  42. package/src/gdskills/bundled/skills/review/review-clean-code/SKILL.md +1 -2
  43. package/src/gdskills/bundled/skills/review/review-core-boundaries/SKILL.md +4 -0
  44. package/src/gdskills/bundled/skills/review/review-flow-graph/SKILL.md +4 -0
  45. package/src/gdskills/bundled/skills/review/review-frontend-conventions/SKILL.md +4 -0
  46. package/src/gdskills/bundled/skills/review/review-highload/SKILL.md +1 -2
  47. package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.md +8 -13
  48. package/src/gdskills/bundled/skills/review/review-pr-feedback/SKILL.md +2 -3
  49. package/src/gdskills/bundled/skills/review/review-style/SKILL.md +2 -3
  50. package/src/gdskills/bundled/skills/review/review-testing-practices/SKILL.md +5 -0
  51. package/src/gdskills/bundled/skills/review/review-verifier/SKILL.md +1 -2
@@ -474,7 +474,7 @@ FOR step in PLAN:
474
474
  — that counter is the attempt budget, and it survives a session restart.
475
475
 
476
476
  2.1.2 Execute step (see step-specific instructions below)
477
- **CRITICAL RESILIENCE**: If the sub-agent returns a malformed result or fails to follow formatting rules, run an explicit retry:
477
+ If the sub-agent returns a malformed result or fails to follow formatting rules, run an explicit retry:
478
478
  "The previous output was malformed. Fix these errors: [errors] and try again." (Max 2 retries before counting as critical failure).
479
479
  Re-open the step before each retry so the retry is counted.
480
480
 
@@ -728,7 +728,7 @@ keryx job step <job-name> prepare --status completed --reason "feature/<branch-s
728
728
 
729
729
  ### 2.5 Step: TESTS-CREATOR + IMPLEMENT
730
730
 
731
- **IRON LAW: tests-creator MUST run before task-implementer for every task. No exceptions.**
731
+ tests-creator runs before task-implementer for every task, with no exceptions.
732
732
 
733
733
  There is no `wave-executor` agent. Each wave is two dispatches the orchestrator makes
734
734
  itself — `tests-creator`, then `task-implementer` — and both are real, installed
@@ -1949,8 +1949,8 @@ What actually bounds this orchestrator:
1949
1949
  | reviewer fan-out | 4 in flight | `keryx review budget --outstanding <n>` before every dispatch (2.6.1) |
1950
1950
  | spend | 3 USD by default | `keryx review budget --spent <usd>` — a non-zero exit means stop and ask |
1951
1951
 
1952
- Each of these is a number some command reads or writes. A guard that no command can
1953
- observe is not a guard, and this section no longer lists any.
1952
+ Each of these is a number some command reads or writes. A guard no command can
1953
+ observe is not a guard; this section lists only observable ones.
1954
1954
 
1955
1955
  **Context passing rules (minimal context principle):**
1956
1956
  - `issue-analyzer`: receives only issue data + codebase paths (NOT previous job state)
@@ -2053,36 +2053,37 @@ what to show a user who asks mid-run.
2053
2053
 
2054
2054
  ## Rules of Engagement
2055
2055
 
2056
- 1. **DO** ALWAYS collect context in Phase 0 — project directory is MANDATORY, never assume.
2057
- 2. **DO** build plans dynamically based on intent — not a fixed 8-phase pipeline.
2058
- 3. **DO** run `keryx job init` before executing any step.
2059
- 4. **DO** record every step with `keryx job step` and every document with `keryx job document` — the package, not this session, is the record.
2060
- 5. **DO** parallelize independent tasks and reviewers where safe.
2061
- 6. **DO** respect dependency order — use wave-based execution for implementation.
2062
- 7. **DO** limit review → fix loop to max_review_iterations, and stop earlier on repetition.
2063
- 8. **DO** present PR proposal to user before creating (unless auto_create_pr).
2064
- 9. **DO** tell user where the job package is at completion.
2065
- 10. **DO** ALWAYS use `git worktree add` for feature branches — NEVER `git checkout -b`.
2066
- 11. **DO** run ALL commands in the **worktree directory**, never in the original project.
2067
- 12. **DO** ask user for confirmation before extending plan (e.g., analyze → implement).
2068
- 13. **DO** send progress notifications at phase and step transitions.
2069
- 14. **DO** use auto-detected `package_manager` and `run_command` — never hardcode `npm`.
2070
- 15. **DO NOT** ask the user anything during execution (after Phase 0) — except for critical failures and plan extension decisions.
2071
- 16. **DO NOT** push the branch until user confirms (or auto_create_pr).
2072
- 17. **DO NOT** hand-write `state.json`, or let a sub-agent write it. `keryx job` is the only writer, and it validates every write.
2073
- 18. **DO NOT** let a sub-agent record its own result in the package — the orchestrator runs `keryx job document`.
2074
- 19. **DO** run `keryx review start` before a fix round and `keryx review ingest` after synthesis, so the round is citable.
2075
- 20. **DO** give every finding a terminal disposition with `keryx review complete --finding … --disposition … --evidence …`. A finding never leaves the loop by being absent from the next round.
2076
- 21. **DO** classify every step failure as `terminal`, `retryable`, or `recoverable` — never just abort or ask without classifying first.
2077
- 22. **DO** show agent-explicit plan in 1.3 and ask approve/adjust — unless `plan_approval: false`.
2078
- 23. **DO** run `sanity-check` after every implement step before dispatching review.
2079
- 24. **DO** auto-trigger `test-gen` if implementer produced no test files (unless `run_test_gen: false`).
2080
- 25. **DO** auto-trigger `security-audit` if diff touches auth/API/DB/env files (unless `run_security_audit: false`).
2081
- 26. **DO** include changelog entry in PR body (unless `run_changelog: false`).
2082
- 27. **DO** dispatch with `subagent_type: "general-purpose"` — `"general"` is not a value any dispatcher accepts.
2083
- 28. **DO** compute every dispatch's model with `keryx review tier` — never assign a tier by hand, and never write a model id into a dispatch.
2084
- 29. **DO** pass `--outstanding <n>` on `keryx review budget` and `keryx review ingest` — this orchestrator is the outermost of the three nesting levels the concurrency cap was sized for, and the cap binds the nested total only when the parent declares its in-flight count.
2085
- 30. **DO NOT** deploy without user confirmation (unless `run_deploy: true` explicitly set).
2056
+ Everything this orchestrator does is described once, with its reason, in the
2057
+ section that owns it. This section is not a second copy of that. It carries the
2058
+ three rules stated nowhere else, and the four whose cost, when you get them
2059
+ wrong, cannot be undone by trying again.
2060
+
2061
+ ### Stated only here
2062
+
2063
+ - **Do not ask the user anything between Phase 0 and completion.** Two
2064
+ exceptions: a critical failure, and a decision to extend the plan (analyze →
2065
+ implement). Everything else was settled in Phase 0, or is settled by the
2066
+ package rather than by asking.
2067
+ - **Do not push the branch until the user confirms**, unless `auto_create_pr` is
2068
+ set. A push is visible to everyone watching the repository, and there is no
2069
+ version of un-pushing it that they do not see.
2070
+ - **Say where the job package is when the job ends.** It is the only durable
2071
+ record of the run, and a user who cannot find it is left with nothing to read.
2072
+
2073
+ ### Unrecoverable if wrong
2074
+
2075
+ - **Branch with `git worktree add`** — never `git checkout -b` or
2076
+ `git switch -c`. Those switch the main working directory out from under the
2077
+ user's own session, mid-run.
2078
+ - **Run every later command in the worktree directory**, not the project root.
2079
+ A build, test or commit that lands in the wrong tree is attributed to work
2080
+ nobody did.
2081
+ - **`keryx job` is the only writer of `state.json`**, this orchestrator
2082
+ included. It validates each write against the `job-orchestrator-state`
2083
+ contract; a hand-written file satisfies no contract, and the next session
2084
+ resumes into a state that never existed.
2085
+ - **Ask for the project directory in Phase 0.** There is no default. A wrong
2086
+ guess writes a job package into somebody else's repository.
2086
2087
 
2087
2088
  ---
2088
2089
 
@@ -474,7 +474,7 @@ FOR step in PLAN:
474
474
  — that counter is the attempt budget, and it survives a session restart.
475
475
 
476
476
  2.1.2 Execute step (see step-specific instructions below)
477
- **CRITICAL RESILIENCE**: If the sub-agent returns a malformed result or fails to follow formatting rules, run an explicit retry:
477
+ If the sub-agent returns a malformed result or fails to follow formatting rules, run an explicit retry:
478
478
  "The previous output was malformed. Fix these errors: [errors] and try again." (Max 2 retries before counting as critical failure).
479
479
  Re-open the step before each retry so the retry is counted.
480
480
 
@@ -728,7 +728,7 @@ keryx job step <job-name> prepare --status completed --reason "feature/<branch-s
728
728
 
729
729
  ### 2.5 Step: TESTS-CREATOR + IMPLEMENT
730
730
 
731
- **IRON LAW: tests-creator MUST run before task-implementer for every task. No exceptions.**
731
+ tests-creator runs before task-implementer for every task, with no exceptions.
732
732
 
733
733
  There is no `wave-executor` agent. Each wave is two dispatches the orchestrator makes
734
734
  itself — `tests-creator`, then `task-implementer` — and both are real, installed
@@ -1949,8 +1949,8 @@ What actually bounds this orchestrator:
1949
1949
  | reviewer fan-out | 4 in flight | `keryx review budget --outstanding <n>` before every dispatch (2.6.1) |
1950
1950
  | spend | 3 USD by default | `keryx review budget --spent <usd>` — a non-zero exit means stop and ask |
1951
1951
 
1952
- Each of these is a number some command reads or writes. A guard that no command can
1953
- observe is not a guard, and this section no longer lists any.
1952
+ Each of these is a number some command reads or writes. A guard no command can
1953
+ observe is not a guard; this section lists only observable ones.
1954
1954
 
1955
1955
  **Context passing rules (minimal context principle):**
1956
1956
  - `issue-analyzer`: receives only issue data + codebase paths (NOT previous job state)
@@ -2053,36 +2053,37 @@ what to show a user who asks mid-run.
2053
2053
 
2054
2054
  ## Rules of Engagement
2055
2055
 
2056
- 1. **DO** ALWAYS collect context in Phase 0 — project directory is MANDATORY, never assume.
2057
- 2. **DO** build plans dynamically based on intent — not a fixed 8-phase pipeline.
2058
- 3. **DO** run `keryx job init` before executing any step.
2059
- 4. **DO** record every step with `keryx job step` and every document with `keryx job document` — the package, not this session, is the record.
2060
- 5. **DO** parallelize independent tasks and reviewers where safe.
2061
- 6. **DO** respect dependency order — use wave-based execution for implementation.
2062
- 7. **DO** limit review → fix loop to max_review_iterations, and stop earlier on repetition.
2063
- 8. **DO** present PR proposal to user before creating (unless auto_create_pr).
2064
- 9. **DO** tell user where the job package is at completion.
2065
- 10. **DO** ALWAYS use `git worktree add` for feature branches — NEVER `git checkout -b`.
2066
- 11. **DO** run ALL commands in the **worktree directory**, never in the original project.
2067
- 12. **DO** ask user for confirmation before extending plan (e.g., analyze → implement).
2068
- 13. **DO** send progress notifications at phase and step transitions.
2069
- 14. **DO** use auto-detected `package_manager` and `run_command` — never hardcode `npm`.
2070
- 15. **DO NOT** ask the user anything during execution (after Phase 0) — except for critical failures and plan extension decisions.
2071
- 16. **DO NOT** push the branch until user confirms (or auto_create_pr).
2072
- 17. **DO NOT** hand-write `state.json`, or let a sub-agent write it. `keryx job` is the only writer, and it validates every write.
2073
- 18. **DO NOT** let a sub-agent record its own result in the package — the orchestrator runs `keryx job document`.
2074
- 19. **DO** run `keryx review start` before a fix round and `keryx review ingest` after synthesis, so the round is citable.
2075
- 20. **DO** give every finding a terminal disposition with `keryx review complete --finding … --disposition … --evidence …`. A finding never leaves the loop by being absent from the next round.
2076
- 21. **DO** classify every step failure as `terminal`, `retryable`, or `recoverable` — never just abort or ask without classifying first.
2077
- 22. **DO** show agent-explicit plan in 1.3 and ask approve/adjust — unless `plan_approval: false`.
2078
- 23. **DO** run `sanity-check` after every implement step before dispatching review.
2079
- 24. **DO** auto-trigger `test-gen` if implementer produced no test files (unless `run_test_gen: false`).
2080
- 25. **DO** auto-trigger `security-audit` if diff touches auth/API/DB/env files (unless `run_security_audit: false`).
2081
- 26. **DO** include changelog entry in PR body (unless `run_changelog: false`).
2082
- 27. **DO** dispatch with `subagent_type: "general-purpose"` — `"general"` is not a value any dispatcher accepts.
2083
- 28. **DO** compute every dispatch's model with `keryx review tier` — never assign a tier by hand, and never write a model id into a dispatch.
2084
- 29. **DO** pass `--outstanding <n>` on `keryx review budget` and `keryx review ingest` — this orchestrator is the outermost of the three nesting levels the concurrency cap was sized for, and the cap binds the nested total only when the parent declares its in-flight count.
2085
- 30. **DO NOT** deploy without user confirmation (unless `run_deploy: true` explicitly set).
2056
+ Everything this orchestrator does is described once, with its reason, in the
2057
+ section that owns it. This section is not a second copy of that. It carries the
2058
+ three rules stated nowhere else, and the four whose cost, when you get them
2059
+ wrong, cannot be undone by trying again.
2060
+
2061
+ ### Stated only here
2062
+
2063
+ - **Do not ask the user anything between Phase 0 and completion.** Two
2064
+ exceptions: a critical failure, and a decision to extend the plan (analyze →
2065
+ implement). Everything else was settled in Phase 0, or is settled by the
2066
+ package rather than by asking.
2067
+ - **Do not push the branch until the user confirms**, unless `auto_create_pr` is
2068
+ set. A push is visible to everyone watching the repository, and there is no
2069
+ version of un-pushing it that they do not see.
2070
+ - **Say where the job package is when the job ends.** It is the only durable
2071
+ record of the run, and a user who cannot find it is left with nothing to read.
2072
+
2073
+ ### Unrecoverable if wrong
2074
+
2075
+ - **Branch with `git worktree add`** — never `git checkout -b` or
2076
+ `git switch -c`. Those switch the main working directory out from under the
2077
+ user's own session, mid-run.
2078
+ - **Run every later command in the worktree directory**, not the project root.
2079
+ A build, test or commit that lands in the wrong tree is attributed to work
2080
+ nobody did.
2081
+ - **`keryx job` is the only writer of `state.json`**, this orchestrator
2082
+ included. It validates each write against the `job-orchestrator-state`
2083
+ contract; a hand-written file satisfies no contract, and the next session
2084
+ resumes into a state that never existed.
2085
+ - **Ask for the project directory in Phase 0.** There is no default. A wrong
2086
+ guess writes a job package into somebody else's repository.
2086
2087
 
2087
2088
  ---
2088
2089
 
@@ -474,7 +474,7 @@ FOR step in PLAN:
474
474
  — that counter is the attempt budget, and it survives a session restart.
475
475
 
476
476
  2.1.2 Execute step (see step-specific instructions below)
477
- **CRITICAL RESILIENCE**: If the sub-agent returns a malformed result or fails to follow formatting rules, run an explicit retry:
477
+ If the sub-agent returns a malformed result or fails to follow formatting rules, run an explicit retry:
478
478
  "The previous output was malformed. Fix these errors: [errors] and try again." (Max 2 retries before counting as critical failure).
479
479
  Re-open the step before each retry so the retry is counted.
480
480
 
@@ -728,7 +728,7 @@ keryx job step <job-name> prepare --status completed --reason "feature/<branch-s
728
728
 
729
729
  ### 2.5 Step: TESTS-CREATOR + IMPLEMENT
730
730
 
731
- **IRON LAW: tests-creator MUST run before task-implementer for every task. No exceptions.**
731
+ tests-creator runs before task-implementer for every task, with no exceptions.
732
732
 
733
733
  There is no `wave-executor` agent. Each wave is two dispatches the orchestrator makes
734
734
  itself — `tests-creator`, then `task-implementer` — and both are real, installed
@@ -1949,8 +1949,8 @@ What actually bounds this orchestrator:
1949
1949
  | reviewer fan-out | 4 in flight | `keryx review budget --outstanding <n>` before every dispatch (2.6.1) |
1950
1950
  | spend | 3 USD by default | `keryx review budget --spent <usd>` — a non-zero exit means stop and ask |
1951
1951
 
1952
- Each of these is a number some command reads or writes. A guard that no command can
1953
- observe is not a guard, and this section no longer lists any.
1952
+ Each of these is a number some command reads or writes. A guard no command can
1953
+ observe is not a guard; this section lists only observable ones.
1954
1954
 
1955
1955
  **Context passing rules (minimal context principle):**
1956
1956
  - `issue-analyzer`: receives only issue data + codebase paths (NOT previous job state)
@@ -2053,36 +2053,37 @@ what to show a user who asks mid-run.
2053
2053
 
2054
2054
  ## Rules of Engagement
2055
2055
 
2056
- 1. **DO** ALWAYS collect context in Phase 0 — project directory is MANDATORY, never assume.
2057
- 2. **DO** build plans dynamically based on intent — not a fixed 8-phase pipeline.
2058
- 3. **DO** run `keryx job init` before executing any step.
2059
- 4. **DO** record every step with `keryx job step` and every document with `keryx job document` — the package, not this session, is the record.
2060
- 5. **DO** parallelize independent tasks and reviewers where safe.
2061
- 6. **DO** respect dependency order — use wave-based execution for implementation.
2062
- 7. **DO** limit review → fix loop to max_review_iterations, and stop earlier on repetition.
2063
- 8. **DO** present PR proposal to user before creating (unless auto_create_pr).
2064
- 9. **DO** tell user where the job package is at completion.
2065
- 10. **DO** ALWAYS use `git worktree add` for feature branches — NEVER `git checkout -b`.
2066
- 11. **DO** run ALL commands in the **worktree directory**, never in the original project.
2067
- 12. **DO** ask user for confirmation before extending plan (e.g., analyze → implement).
2068
- 13. **DO** send progress notifications at phase and step transitions.
2069
- 14. **DO** use auto-detected `package_manager` and `run_command` — never hardcode `npm`.
2070
- 15. **DO NOT** ask the user anything during execution (after Phase 0) — except for critical failures and plan extension decisions.
2071
- 16. **DO NOT** push the branch until user confirms (or auto_create_pr).
2072
- 17. **DO NOT** hand-write `state.json`, or let a sub-agent write it. `keryx job` is the only writer, and it validates every write.
2073
- 18. **DO NOT** let a sub-agent record its own result in the package — the orchestrator runs `keryx job document`.
2074
- 19. **DO** run `keryx review start` before a fix round and `keryx review ingest` after synthesis, so the round is citable.
2075
- 20. **DO** give every finding a terminal disposition with `keryx review complete --finding … --disposition … --evidence …`. A finding never leaves the loop by being absent from the next round.
2076
- 21. **DO** classify every step failure as `terminal`, `retryable`, or `recoverable` — never just abort or ask without classifying first.
2077
- 22. **DO** show agent-explicit plan in 1.3 and ask approve/adjust — unless `plan_approval: false`.
2078
- 23. **DO** run `sanity-check` after every implement step before dispatching review.
2079
- 24. **DO** auto-trigger `test-gen` if implementer produced no test files (unless `run_test_gen: false`).
2080
- 25. **DO** auto-trigger `security-audit` if diff touches auth/API/DB/env files (unless `run_security_audit: false`).
2081
- 26. **DO** include changelog entry in PR body (unless `run_changelog: false`).
2082
- 27. **DO** dispatch with `subagent_type: "general-purpose"` — `"general"` is not a value any dispatcher accepts.
2083
- 28. **DO** compute every dispatch's model with `keryx review tier` — never assign a tier by hand, and never write a model id into a dispatch.
2084
- 29. **DO** pass `--outstanding <n>` on `keryx review budget` and `keryx review ingest` — this orchestrator is the outermost of the three nesting levels the concurrency cap was sized for, and the cap binds the nested total only when the parent declares its in-flight count.
2085
- 30. **DO NOT** deploy without user confirmation (unless `run_deploy: true` explicitly set).
2056
+ Everything this orchestrator does is described once, with its reason, in the
2057
+ section that owns it. This section is not a second copy of that. It carries the
2058
+ three rules stated nowhere else, and the four whose cost, when you get them
2059
+ wrong, cannot be undone by trying again.
2060
+
2061
+ ### Stated only here
2062
+
2063
+ - **Do not ask the user anything between Phase 0 and completion.** Two
2064
+ exceptions: a critical failure, and a decision to extend the plan (analyze →
2065
+ implement). Everything else was settled in Phase 0, or is settled by the
2066
+ package rather than by asking.
2067
+ - **Do not push the branch until the user confirms**, unless `auto_create_pr` is
2068
+ set. A push is visible to everyone watching the repository, and there is no
2069
+ version of un-pushing it that they do not see.
2070
+ - **Say where the job package is when the job ends.** It is the only durable
2071
+ record of the run, and a user who cannot find it is left with nothing to read.
2072
+
2073
+ ### Unrecoverable if wrong
2074
+
2075
+ - **Branch with `git worktree add`** — never `git checkout -b` or
2076
+ `git switch -c`. Those switch the main working directory out from under the
2077
+ user's own session, mid-run.
2078
+ - **Run every later command in the worktree directory**, not the project root.
2079
+ A build, test or commit that lands in the wrong tree is attributed to work
2080
+ nobody did.
2081
+ - **`keryx job` is the only writer of `state.json`**, this orchestrator
2082
+ included. It validates each write against the `job-orchestrator-state`
2083
+ contract; a hand-written file satisfies no contract, and the next session
2084
+ resumes into a state that never existed.
2085
+ - **Ask for the project directory in Phase 0.** There is no default. A wrong
2086
+ guess writes a job package into somebody else's repository.
2086
2087
 
2087
2088
  ---
2088
2089
 
@@ -474,7 +474,7 @@ FOR step in PLAN:
474
474
  — that counter is the attempt budget, and it survives a session restart.
475
475
 
476
476
  2.1.2 Execute step (see step-specific instructions below)
477
- **CRITICAL RESILIENCE**: If the sub-agent returns a malformed result or fails to follow formatting rules, run an explicit retry:
477
+ If the sub-agent returns a malformed result or fails to follow formatting rules, run an explicit retry:
478
478
  "The previous output was malformed. Fix these errors: [errors] and try again." (Max 2 retries before counting as critical failure).
479
479
  Re-open the step before each retry so the retry is counted.
480
480
 
@@ -728,7 +728,7 @@ keryx job step <job-name> prepare --status completed --reason "feature/<branch-s
728
728
 
729
729
  ### 2.5 Step: TESTS-CREATOR + IMPLEMENT
730
730
 
731
- **IRON LAW: tests-creator MUST run before task-implementer for every task. No exceptions.**
731
+ tests-creator runs before task-implementer for every task, with no exceptions.
732
732
 
733
733
  There is no `wave-executor` agent. Each wave is two dispatches the orchestrator makes
734
734
  itself — `tests-creator`, then `task-implementer` — and both are real, installed
@@ -1949,8 +1949,8 @@ What actually bounds this orchestrator:
1949
1949
  | reviewer fan-out | 4 in flight | `keryx review budget --outstanding <n>` before every dispatch (2.6.1) |
1950
1950
  | spend | 3 USD by default | `keryx review budget --spent <usd>` — a non-zero exit means stop and ask |
1951
1951
 
1952
- Each of these is a number some command reads or writes. A guard that no command can
1953
- observe is not a guard, and this section no longer lists any.
1952
+ Each of these is a number some command reads or writes. A guard no command can
1953
+ observe is not a guard; this section lists only observable ones.
1954
1954
 
1955
1955
  **Context passing rules (minimal context principle):**
1956
1956
  - `issue-analyzer`: receives only issue data + codebase paths (NOT previous job state)
@@ -2053,36 +2053,37 @@ what to show a user who asks mid-run.
2053
2053
 
2054
2054
  ## Rules of Engagement
2055
2055
 
2056
- 1. **DO** ALWAYS collect context in Phase 0 — project directory is MANDATORY, never assume.
2057
- 2. **DO** build plans dynamically based on intent — not a fixed 8-phase pipeline.
2058
- 3. **DO** run `keryx job init` before executing any step.
2059
- 4. **DO** record every step with `keryx job step` and every document with `keryx job document` — the package, not this session, is the record.
2060
- 5. **DO** parallelize independent tasks and reviewers where safe.
2061
- 6. **DO** respect dependency order — use wave-based execution for implementation.
2062
- 7. **DO** limit review → fix loop to max_review_iterations, and stop earlier on repetition.
2063
- 8. **DO** present PR proposal to user before creating (unless auto_create_pr).
2064
- 9. **DO** tell user where the job package is at completion.
2065
- 10. **DO** ALWAYS use `git worktree add` for feature branches — NEVER `git checkout -b`.
2066
- 11. **DO** run ALL commands in the **worktree directory**, never in the original project.
2067
- 12. **DO** ask user for confirmation before extending plan (e.g., analyze → implement).
2068
- 13. **DO** send progress notifications at phase and step transitions.
2069
- 14. **DO** use auto-detected `package_manager` and `run_command` — never hardcode `npm`.
2070
- 15. **DO NOT** ask the user anything during execution (after Phase 0) — except for critical failures and plan extension decisions.
2071
- 16. **DO NOT** push the branch until user confirms (or auto_create_pr).
2072
- 17. **DO NOT** hand-write `state.json`, or let a sub-agent write it. `keryx job` is the only writer, and it validates every write.
2073
- 18. **DO NOT** let a sub-agent record its own result in the package — the orchestrator runs `keryx job document`.
2074
- 19. **DO** run `keryx review start` before a fix round and `keryx review ingest` after synthesis, so the round is citable.
2075
- 20. **DO** give every finding a terminal disposition with `keryx review complete --finding … --disposition … --evidence …`. A finding never leaves the loop by being absent from the next round.
2076
- 21. **DO** classify every step failure as `terminal`, `retryable`, or `recoverable` — never just abort or ask without classifying first.
2077
- 22. **DO** show agent-explicit plan in 1.3 and ask approve/adjust — unless `plan_approval: false`.
2078
- 23. **DO** run `sanity-check` after every implement step before dispatching review.
2079
- 24. **DO** auto-trigger `test-gen` if implementer produced no test files (unless `run_test_gen: false`).
2080
- 25. **DO** auto-trigger `security-audit` if diff touches auth/API/DB/env files (unless `run_security_audit: false`).
2081
- 26. **DO** include changelog entry in PR body (unless `run_changelog: false`).
2082
- 27. **DO** dispatch with `subagent_type: "general-purpose"` — `"general"` is not a value any dispatcher accepts.
2083
- 28. **DO** compute every dispatch's model with `keryx review tier` — never assign a tier by hand, and never write a model id into a dispatch.
2084
- 29. **DO** pass `--outstanding <n>` on `keryx review budget` and `keryx review ingest` — this orchestrator is the outermost of the three nesting levels the concurrency cap was sized for, and the cap binds the nested total only when the parent declares its in-flight count.
2085
- 30. **DO NOT** deploy without user confirmation (unless `run_deploy: true` explicitly set).
2056
+ Everything this orchestrator does is described once, with its reason, in the
2057
+ section that owns it. This section is not a second copy of that. It carries the
2058
+ three rules stated nowhere else, and the four whose cost, when you get them
2059
+ wrong, cannot be undone by trying again.
2060
+
2061
+ ### Stated only here
2062
+
2063
+ - **Do not ask the user anything between Phase 0 and completion.** Two
2064
+ exceptions: a critical failure, and a decision to extend the plan (analyze →
2065
+ implement). Everything else was settled in Phase 0, or is settled by the
2066
+ package rather than by asking.
2067
+ - **Do not push the branch until the user confirms**, unless `auto_create_pr` is
2068
+ set. A push is visible to everyone watching the repository, and there is no
2069
+ version of un-pushing it that they do not see.
2070
+ - **Say where the job package is when the job ends.** It is the only durable
2071
+ record of the run, and a user who cannot find it is left with nothing to read.
2072
+
2073
+ ### Unrecoverable if wrong
2074
+
2075
+ - **Branch with `git worktree add`** — never `git checkout -b` or
2076
+ `git switch -c`. Those switch the main working directory out from under the
2077
+ user's own session, mid-run.
2078
+ - **Run every later command in the worktree directory**, not the project root.
2079
+ A build, test or commit that lands in the wrong tree is attributed to work
2080
+ nobody did.
2081
+ - **`keryx job` is the only writer of `state.json`**, this orchestrator
2082
+ included. It validates each write against the `job-orchestrator-state`
2083
+ contract; a hand-written file satisfies no contract, and the next session
2084
+ resumes into a state that never existed.
2085
+ - **Ask for the project directory in Phase 0.** There is no default. A wrong
2086
+ guess writes a job package into somebody else's repository.
2086
2087
 
2087
2088
  ---
2088
2089
 
@@ -474,7 +474,7 @@ FOR step in PLAN:
474
474
  — that counter is the attempt budget, and it survives a session restart.
475
475
 
476
476
  2.1.2 Execute step (see step-specific instructions below)
477
- **CRITICAL RESILIENCE**: If the sub-agent returns a malformed result or fails to follow formatting rules, run an explicit retry:
477
+ If the sub-agent returns a malformed result or fails to follow formatting rules, run an explicit retry:
478
478
  "The previous output was malformed. Fix these errors: [errors] and try again." (Max 2 retries before counting as critical failure).
479
479
  Re-open the step before each retry so the retry is counted.
480
480
 
@@ -728,7 +728,7 @@ keryx job step <job-name> prepare --status completed --reason "feature/<branch-s
728
728
 
729
729
  ### 2.5 Step: TESTS-CREATOR + IMPLEMENT
730
730
 
731
- **IRON LAW: tests-creator MUST run before task-implementer for every task. No exceptions.**
731
+ tests-creator runs before task-implementer for every task, with no exceptions.
732
732
 
733
733
  There is no `wave-executor` agent. Each wave is two dispatches the orchestrator makes
734
734
  itself — `tests-creator`, then `task-implementer` — and both are real, installed
@@ -1949,8 +1949,8 @@ What actually bounds this orchestrator:
1949
1949
  | reviewer fan-out | 4 in flight | `keryx review budget --outstanding <n>` before every dispatch (2.6.1) |
1950
1950
  | spend | 3 USD by default | `keryx review budget --spent <usd>` — a non-zero exit means stop and ask |
1951
1951
 
1952
- Each of these is a number some command reads or writes. A guard that no command can
1953
- observe is not a guard, and this section no longer lists any.
1952
+ Each of these is a number some command reads or writes. A guard no command can
1953
+ observe is not a guard; this section lists only observable ones.
1954
1954
 
1955
1955
  **Context passing rules (minimal context principle):**
1956
1956
  - `issue-analyzer`: receives only issue data + codebase paths (NOT previous job state)
@@ -2053,36 +2053,37 @@ what to show a user who asks mid-run.
2053
2053
 
2054
2054
  ## Rules of Engagement
2055
2055
 
2056
- 1. **DO** ALWAYS collect context in Phase 0 — project directory is MANDATORY, never assume.
2057
- 2. **DO** build plans dynamically based on intent — not a fixed 8-phase pipeline.
2058
- 3. **DO** run `keryx job init` before executing any step.
2059
- 4. **DO** record every step with `keryx job step` and every document with `keryx job document` — the package, not this session, is the record.
2060
- 5. **DO** parallelize independent tasks and reviewers where safe.
2061
- 6. **DO** respect dependency order — use wave-based execution for implementation.
2062
- 7. **DO** limit review → fix loop to max_review_iterations, and stop earlier on repetition.
2063
- 8. **DO** present PR proposal to user before creating (unless auto_create_pr).
2064
- 9. **DO** tell user where the job package is at completion.
2065
- 10. **DO** ALWAYS use `git worktree add` for feature branches — NEVER `git checkout -b`.
2066
- 11. **DO** run ALL commands in the **worktree directory**, never in the original project.
2067
- 12. **DO** ask user for confirmation before extending plan (e.g., analyze → implement).
2068
- 13. **DO** send progress notifications at phase and step transitions.
2069
- 14. **DO** use auto-detected `package_manager` and `run_command` — never hardcode `npm`.
2070
- 15. **DO NOT** ask the user anything during execution (after Phase 0) — except for critical failures and plan extension decisions.
2071
- 16. **DO NOT** push the branch until user confirms (or auto_create_pr).
2072
- 17. **DO NOT** hand-write `state.json`, or let a sub-agent write it. `keryx job` is the only writer, and it validates every write.
2073
- 18. **DO NOT** let a sub-agent record its own result in the package — the orchestrator runs `keryx job document`.
2074
- 19. **DO** run `keryx review start` before a fix round and `keryx review ingest` after synthesis, so the round is citable.
2075
- 20. **DO** give every finding a terminal disposition with `keryx review complete --finding … --disposition … --evidence …`. A finding never leaves the loop by being absent from the next round.
2076
- 21. **DO** classify every step failure as `terminal`, `retryable`, or `recoverable` — never just abort or ask without classifying first.
2077
- 22. **DO** show agent-explicit plan in 1.3 and ask approve/adjust — unless `plan_approval: false`.
2078
- 23. **DO** run `sanity-check` after every implement step before dispatching review.
2079
- 24. **DO** auto-trigger `test-gen` if implementer produced no test files (unless `run_test_gen: false`).
2080
- 25. **DO** auto-trigger `security-audit` if diff touches auth/API/DB/env files (unless `run_security_audit: false`).
2081
- 26. **DO** include changelog entry in PR body (unless `run_changelog: false`).
2082
- 27. **DO** dispatch with `subagent_type: "general-purpose"` — `"general"` is not a value any dispatcher accepts.
2083
- 28. **DO** compute every dispatch's model with `keryx review tier` — never assign a tier by hand, and never write a model id into a dispatch.
2084
- 29. **DO** pass `--outstanding <n>` on `keryx review budget` and `keryx review ingest` — this orchestrator is the outermost of the three nesting levels the concurrency cap was sized for, and the cap binds the nested total only when the parent declares its in-flight count.
2085
- 30. **DO NOT** deploy without user confirmation (unless `run_deploy: true` explicitly set).
2056
+ Everything this orchestrator does is described once, with its reason, in the
2057
+ section that owns it. This section is not a second copy of that. It carries the
2058
+ three rules stated nowhere else, and the four whose cost, when you get them
2059
+ wrong, cannot be undone by trying again.
2060
+
2061
+ ### Stated only here
2062
+
2063
+ - **Do not ask the user anything between Phase 0 and completion.** Two
2064
+ exceptions: a critical failure, and a decision to extend the plan (analyze →
2065
+ implement). Everything else was settled in Phase 0, or is settled by the
2066
+ package rather than by asking.
2067
+ - **Do not push the branch until the user confirms**, unless `auto_create_pr` is
2068
+ set. A push is visible to everyone watching the repository, and there is no
2069
+ version of un-pushing it that they do not see.
2070
+ - **Say where the job package is when the job ends.** It is the only durable
2071
+ record of the run, and a user who cannot find it is left with nothing to read.
2072
+
2073
+ ### Unrecoverable if wrong
2074
+
2075
+ - **Branch with `git worktree add`** — never `git checkout -b` or
2076
+ `git switch -c`. Those switch the main working directory out from under the
2077
+ user's own session, mid-run.
2078
+ - **Run every later command in the worktree directory**, not the project root.
2079
+ A build, test or commit that lands in the wrong tree is attributed to work
2080
+ nobody did.
2081
+ - **`keryx job` is the only writer of `state.json`**, this orchestrator
2082
+ included. It validates each write against the `job-orchestrator-state`
2083
+ contract; a hand-written file satisfies no contract, and the next session
2084
+ resumes into a state that never existed.
2085
+ - **Ask for the project directory in Phase 0.** There is no default. A wrong
2086
+ guess writes a job package into somebody else's repository.
2086
2087
 
2087
2088
  ---
2088
2089
 
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "base_branch": {
68
68
  "type": "string",
69
- "description": "Base branch to create the feature branch from. NO DEFAULT, deliberately: SKILL.md 0.2 auto-detects the repository's own default branch and asks the operator to confirm it. The value shipped here used to be `develop-2`, a branch from an unrelated project, which a caller that omitted the field would silently have inherited."
69
+ "description": "Base branch to create the feature branch from. NO DEFAULT, deliberately: SKILL.md 0.2 auto-detects the repository's own default branch and asks the operator to confirm it. Any value shipped here would be silently inherited by a caller that omits the field, and a branch name is never portable between projects."
70
70
  },
71
71
  "additional_codebases": {
72
72
  "type": "array",
@@ -534,10 +534,8 @@ second copy of a schema is how that happens.
534
534
  9. **DO** verify your work before reporting.
535
535
  10. **DO** make `STATUS: <TOKEN>` the first line of your final message, and put no
536
536
  JSON in the response body. The full JSON result is the file Phase 6.1 writes
537
- and records. (This rule used to say the opposite — "return the JSON result
538
- object as your final message" — which contradicted 6.2, `## Reporting
539
- Results`, and `parseChildResult`, the production function that throws on any
540
- first line that is not a canonical STATUS token.)
537
+ and records. `parseChildResult` throws on any first line that is not a
538
+ canonical STATUS token.
541
539
 
542
540
  ---
543
541
 
@@ -534,10 +534,8 @@ second copy of a schema is how that happens.
534
534
  9. **DO** verify your work before reporting.
535
535
  10. **DO** make `STATUS: <TOKEN>` the first line of your final message, and put no
536
536
  JSON in the response body. The full JSON result is the file Phase 6.1 writes
537
- and records. (This rule used to say the opposite — "return the JSON result
538
- object as your final message" — which contradicted 6.2, `## Reporting
539
- Results`, and `parseChildResult`, the production function that throws on any
540
- first line that is not a canonical STATUS token.)
537
+ and records. `parseChildResult` throws on any first line that is not a
538
+ canonical STATUS token.
541
539
 
542
540
  ---
543
541
 
@@ -534,10 +534,8 @@ second copy of a schema is how that happens.
534
534
  9. **DO** verify your work before reporting.
535
535
  10. **DO** make `STATUS: <TOKEN>` the first line of your final message, and put no
536
536
  JSON in the response body. The full JSON result is the file Phase 6.1 writes
537
- and records. (This rule used to say the opposite — "return the JSON result
538
- object as your final message" — which contradicted 6.2, `## Reporting
539
- Results`, and `parseChildResult`, the production function that throws on any
540
- first line that is not a canonical STATUS token.)
537
+ and records. `parseChildResult` throws on any first line that is not a
538
+ canonical STATUS token.
541
539
 
542
540
  ---
543
541