architecture-harness 0.20.3 → 0.20.4

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 (39) hide show
  1. package/package.json +1 -1
  2. package/src/cli/bash-command-guard.mjs +28 -5
  3. package/src/cli/bash-command-guard.test.mjs +100 -0
  4. package/src/cli/bash-edit-guard.mjs +19 -16
  5. package/src/cli/bash-edit-guard.test.mjs +19 -0
  6. package/src/cli/ci-state.mjs +17 -9
  7. package/src/cli/ci-state.test.mjs +15 -1
  8. package/src/cli/cost-stop.mjs +98 -0
  9. package/src/cli/cost-stop.test.mjs +149 -0
  10. package/src/cli/dispatch-guard.mjs +3 -3
  11. package/src/cli/dispatch-guard.test.mjs +14 -6
  12. package/src/cli/dispatch-reminder.mjs +5 -3
  13. package/src/cli/dispatch-reminder.test.mjs +5 -1
  14. package/src/cli/git-read.mjs +28 -3
  15. package/src/cli/git-read.test.mjs +31 -1
  16. package/src/cli/ledger.mjs +50 -3
  17. package/src/cli/ledger.test.mjs +46 -0
  18. package/src/cli/powershell-command.mjs +8 -13
  19. package/src/cli/powershell-command.test.mjs +11 -1
  20. package/src/cli/qc.mjs +1 -1
  21. package/src/cli/report-stop.test.mjs +2 -1
  22. package/src/cli/review-gate.mjs +224 -0
  23. package/src/cli/review-gate.test.mjs +334 -0
  24. package/src/cli/shell-command.mjs +65 -9
  25. package/src/cli/shell-command.test.mjs +21 -1
  26. package/src/cli/skill-guard.mjs +56 -0
  27. package/src/cli/skill-guard.test.mjs +87 -0
  28. package/src/cli/stop-gate.test.mjs +80 -0
  29. package/src/cli/task-gate-review.test.mjs +225 -0
  30. package/src/cli/task-gate.mjs +35 -11
  31. package/src/cli/task-gate.test.mjs +6 -5
  32. package/src/cli/test-brief.mjs +12 -0
  33. package/src/cli/transcript-usage.mjs +28 -0
  34. package/src/cli/transcript-usage.test.mjs +9 -0
  35. package/src/cli/workflow-hooks.test.mjs +38 -0
  36. package/src/cli/workflow-settings.mjs +14 -3
  37. package/src/cli/workflow-settings.test.mjs +24 -0
  38. package/src/config.mjs +13 -0
  39. package/templates/docs/enforcement.md +11 -0
@@ -71,6 +71,14 @@ recorded.
71
71
  | An issue that a merge names is closed, or has a comment after the merge | `issue-gate.mjs`, on `Stop` |
72
72
  | The controller edits only its own paths, or a small fix inside the direct lane, whose limits come from the base | `controller-guard.mjs`, through `direct-lane.mjs` |
73
73
  | A plan task names its files, a test step, and a commit step, within the budget | `qc plan-check`, and `plan-stop.mjs` |
74
+ | A branch is reviewed whole once; a later review names `Reviewed: <sha>`, the last head a branch review named, and reads the increment (`swarm.review.oneBranchReview`) | `dispatch-guard.mjs`, on `Agent` |
75
+ | A model never calls a code-review skill: dispatch `sdd-branch-reviewer`, or ask the user to type `/code-review` (`codeReviewSkills`) | `skill-guard.mjs`, on `Skill` |
76
+ | A review runs on a green head: CI on the head is not red or running (`requireGreen`) | `dispatch-guard.mjs`, on `Agent` |
77
+ | A review runs on a head that holds the tip of `worktree.base`: merge the base first (`requireBase`) | `dispatch-guard.mjs`, on `Agent` |
78
+ | An implementer prompt names its brief on a `Brief: <path>` line, and the brief holds a `## Product decisions` section with the user's rulings, or `none` (`productDecisions`). A reviewer prompt names a `Worktree: <path>` whose branch and head the gate can read | `dispatch-guard.mjs`, on `Agent` |
79
+ | An implementer brief stays within `roundFindings` findings and `roundFiles` files; a larger round splits in parallel on disjoint paths (a warning) | `dispatch-guard.mjs`, on `Agent` |
80
+ | Each subagent stop records its tokens and tool calls by role; `qc ledger --cost [branch]` totals them | `cost-stop.mjs`, on `SubagentStop` |
81
+ | A typecheck that fails only with `TS2307` runs once more before the stop reports red | `hooks/stop-gate.sh`, on `Stop` |
74
82
 
75
83
  ## Worktrees — QC-015
76
84
 
@@ -79,6 +87,9 @@ These hooks are on wherever `qc.config.json` is. `"worktree": { "enforce": false
79
87
  | Rule | Check |
80
88
  |---|---|
81
89
  | A worktree is one folder directly under `worktree.dir` of the main checkout | `bash-command-guard.mjs`, on `PreToolUse` of `Bash` and `PowerShell` |
90
+ | `git worktree add` runs where the guard can name the repository: no `GIT_DIR`, `GIT_COMMON_DIR`, `GIT_WORK_TREE`, `core.worktree`, or `core.bare` anywhere in the command; use `-C`, `cd`, or `Set-Location` | `bash-command-guard.mjs`, on `PreToolUse` of `Bash` and `PowerShell` |
91
+ | A `-C`, `cd`, or `Set-Location` path before `git worktree add` is a literal path, with no variable, command substitution, or subexpression: write the path literally | `bash-command-guard.mjs`, on `PreToolUse` of `Bash` and `PowerShell` |
92
+ | A shell write names its checkout: a `--work-tree` directory counts, and a `--git-dir` with no work tree is reported as unresolved (a warning) | `bash-edit-guard.mjs`, on `PostToolUse` of `Bash` and `PowerShell` |
82
93
  | A pull request this session merged leaves no worktree, local branch, or remote branch on its head | `worktree-gate.mjs`, on `Stop`, from the merge record of `merge-guard.mjs` |
83
94
  | A squash-merged branch is deleted | `qc worktree remove`, on a merged pull request whose head is the branch at its tip |
84
95