harness-everything 0.8.0 → 0.9.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 (102) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.github/workflows/ci.yml +12 -2
  4. package/AGENTS.md +36 -35
  5. package/CHANGELOG.md +51 -0
  6. package/README.md +2 -2
  7. package/benchmarks/results/reviews/pr142-verification.json +95 -0
  8. package/ci/action-gate.test.js +83 -3
  9. package/ci/doc-capability-consistency.test.js +3 -0
  10. package/ci/invariant-routing.test.js +87 -74
  11. package/ci/mechanism-2af-worktree-isolation.test.js +152 -0
  12. package/ci/mechanism-2ag-router-worktree-contract.test.js +44 -0
  13. package/ci/mechanism-2ah-workflow-lifecycle.test.js +140 -0
  14. package/ci/openai-plugin-package.test.js +9 -6
  15. package/ci/phase4-ensemble-memory.test.js +128 -10
  16. package/ci/router-workflow-plan.test.js +23 -0
  17. package/ci/workflow-execution-contract.test.js +133 -0
  18. package/ci/workflow-plan-consumers.test.js +18 -0
  19. package/docs/architecture.md +111 -114
  20. package/docs/mechanism-first-skill-mesh.md +92 -103
  21. package/docs/openai-plugin.md +1 -1
  22. package/docs/philosophy.md +40 -33
  23. package/docs/platform-capabilities.md +2 -2
  24. package/docs/reviews/pr-142-issue-131.md +89 -0
  25. package/docs/routing.md +61 -124
  26. package/docs/workflow-runtime.md +109 -0
  27. package/fable-mode/CONTRACT-FORMAT.md +3 -1
  28. package/fable-mode/SKILL.md +1 -1
  29. package/fable-mode/agents/fable-orchestrator.md +9 -7
  30. package/fable-mode/execution-guardrails/SKILL.md +1 -1
  31. package/fable-mode/fable-haiku/SKILL.md +1 -1
  32. package/fable-mode/fable-opus/SKILL.md +1 -1
  33. package/fable-mode/fable-sonnet/SKILL.md +1 -1
  34. package/fable-mode/scripts/workflow-plan-consumer.js +13 -8
  35. package/harness-everything/SKILL.md +11 -10
  36. package/harness-everything/references/triage-and-tiers.md +76 -107
  37. package/harness-everything/schemas/router-task-shape.schema.json +4 -2
  38. package/harness-everything/schemas/router-workflow-plan.schema.json +3 -2
  39. package/harness-everything/scripts/kernel-router-core.js +265 -0
  40. package/harness-everything/scripts/kernel-router.js +118 -223
  41. package/harness-everything/scripts/router-contract-core.js +633 -0
  42. package/harness-everything/scripts/router-contract.js +21 -581
  43. package/harness-everything/scripts/tier-router.js +19 -1
  44. package/hooks/hooks.json +25 -4
  45. package/hooks/scripts/action-gate.js +111 -2
  46. package/hooks/scripts/contract-test.js +27 -2
  47. package/hooks/scripts/lib/workflow-isolation.js +102 -0
  48. package/hooks/scripts/lib/workflow-runtime.js +254 -0
  49. package/hooks/scripts/state-persist.js +1 -0
  50. package/hooks/scripts/subagent-scope-guard.js +20 -3
  51. package/hooks/scripts/workflow-disposition.js +104 -0
  52. package/hooks/scripts/workflow-gate.js +56 -0
  53. package/hooks/scripts/workflow-stop-gate.js +44 -0
  54. package/multi-agent-workspace/SKILL.md +2 -2
  55. package/multi-agent-workspace/scripts/index_memory.js +107 -1
  56. package/opencode-plugin/plugin.json +1 -1
  57. package/package.json +2 -2
  58. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  59. package/plugins/harness-everything/hooks/hooks.json +44 -1
  60. package/plugins/harness-everything/hooks/scripts/action-gate.js +111 -2
  61. package/plugins/harness-everything/hooks/scripts/contract-test.js +27 -2
  62. package/plugins/harness-everything/hooks/scripts/lib/workflow-isolation.js +102 -0
  63. package/plugins/harness-everything/hooks/scripts/lib/workflow-runtime.js +254 -0
  64. package/plugins/harness-everything/hooks/scripts/state-persist.js +1 -0
  65. package/plugins/harness-everything/hooks/scripts/subagent-scope-guard.js +20 -3
  66. package/plugins/harness-everything/hooks/scripts/workflow-disposition.js +104 -0
  67. package/plugins/harness-everything/hooks/scripts/workflow-gate.js +56 -0
  68. package/plugins/harness-everything/hooks/scripts/workflow-stop-gate.js +44 -0
  69. package/plugins/harness-everything/plugin.json +1 -1
  70. package/plugins/harness-everything/scripts/lib/advisory-text.js +51 -54
  71. package/plugins/harness-everything/skills/fable-mode/CONTRACT-FORMAT.md +3 -1
  72. package/plugins/harness-everything/skills/fable-mode/SKILL.md +1 -1
  73. package/plugins/harness-everything/skills/fable-mode/agents/fable-orchestrator.md +9 -7
  74. package/plugins/harness-everything/skills/fable-mode/execution-guardrails/SKILL.md +1 -1
  75. package/plugins/harness-everything/skills/fable-mode/fable-haiku/SKILL.md +1 -1
  76. package/plugins/harness-everything/skills/fable-mode/fable-opus/SKILL.md +1 -1
  77. package/plugins/harness-everything/skills/fable-mode/fable-sonnet/SKILL.md +1 -1
  78. package/plugins/harness-everything/skills/fable-mode/scripts/workflow-plan-consumer.js +13 -8
  79. package/plugins/harness-everything/skills/harness-everything/SKILL.md +11 -10
  80. package/plugins/harness-everything/skills/harness-everything/references/triage-and-tiers.md +76 -107
  81. package/plugins/harness-everything/skills/harness-everything/schemas/router-task-shape.schema.json +4 -2
  82. package/plugins/harness-everything/skills/harness-everything/schemas/router-workflow-plan.schema.json +3 -2
  83. package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router-core.js +265 -0
  84. package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +118 -223
  85. package/plugins/harness-everything/skills/harness-everything/scripts/router-contract-core.js +633 -0
  86. package/plugins/harness-everything/skills/harness-everything/scripts/router-contract.js +21 -581
  87. package/plugins/harness-everything/skills/harness-everything/scripts/tier-router.js +19 -1
  88. package/plugins/harness-everything/skills/multi-agent-workspace/SKILL.md +2 -2
  89. package/plugins/harness-everything/skills/multi-agent-workspace/scripts/index_memory.js +107 -1
  90. package/plugins/harness-everything/skills/self-evolve/SKILL.md +6 -6
  91. package/plugins/harness-everything/skills/self-evolve/references/memory-resolution.md +22 -33
  92. package/plugins/harness-everything/skills/self-evolve/scripts/persist-memory.js +336 -57
  93. package/plugins/harness-everything/skills/self-evolve/scripts/self-regression.js +1 -0
  94. package/plugins/harness-everything/skills/using-git-worktrees/SKILL.md +14 -16
  95. package/plugins/harness-everything/skills/using-git-worktrees/references/workflow-details.md +44 -85
  96. package/scripts/lib/advisory-text.js +51 -54
  97. package/self-evolve/SKILL.md +6 -6
  98. package/self-evolve/references/memory-resolution.md +22 -33
  99. package/self-evolve/scripts/persist-memory.js +336 -57
  100. package/self-evolve/scripts/self-regression.js +1 -0
  101. package/using-git-worktrees/SKILL.md +14 -16
  102. package/using-git-worktrees/references/workflow-details.md +44 -85
@@ -1,108 +1,67 @@
1
1
  # Using Git Worktrees — Full Workflow Reference
2
2
 
3
- ## Decision Flow
3
+ ## Decide whether isolation is mandatory
4
4
 
5
- ```mermaid
6
- flowchart TD
7
- Start[Trigger: Need Workspace Isolation] --> CheckIso{1. Already in Worktree?}
5
+ Tier 3 / Fable-class engineering requires Git isolation before the first source
6
+ or artifact mutation. Read-only discovery may remain in the bound repository.
7
+ Durable multi-agent workspace state is separate: a staged run may need no
8
+ multi-agent workspace and still require Git isolation.
8
9
 
9
- CheckIso -- Yes (GIT_DIR != GIT_COMMON) --> Setup[3. Run Project Setup & Dependencies]
10
- CheckIso -- No (Normal Repo) --> CheckNative{2. Native Worktree Tool Available?}
10
+ Ordinary feature work may honor an explicit preference to stay in place.
11
+ Mandatory mode has no in-place fallback for a declined helper, unavailable
12
+ native tool, sandbox denial, or creation failure; report `blocked`.
11
13
 
12
- CheckNative -- Yes --> RunNative[Use Native Worktree Tool] --> Setup
13
- CheckNative -- No --> RunGit[Try git worktree add .worktrees/branch]
14
+ ## Detect existing isolation
14
15
 
15
- RunGit -- Success --> Setup
16
- RunGit -- Fails / Denied --> WorkInPlace[Fallback: Work in Place in Current Directory] --> Setup
17
-
18
- Setup --> RunBaseline[4. Verify Clean Test Baseline]
19
- RunBaseline --> Done[Isolated Workspace Ready]
20
- ```
21
-
22
- ## Step 0 detail
23
-
24
- **Submodule guard:** `git-dir` differs from `git-common-dir` inside git submodules as well. Before concluding "already in a worktree," verify you are not in a submodule:
16
+ Inspect absolute Git paths and the registered worktree list:
25
17
 
26
18
  ```bash
27
- # If this returns a path, you're in a submodule, not a worktree — treat as normal repo
19
+ git rev-parse --absolute-git-dir
20
+ git rev-parse --path-format=absolute --git-common-dir
28
21
  git rev-parse --show-superproject-working-tree
22
+ git worktree list --porcelain
29
23
  ```
30
24
 
31
- Report with branch state:
32
- - On a branch: "Already in isolated workspace at `<path>` on branch `<name>`."
33
- - Detached HEAD: "Already in isolated workspace at `<path>` (detached HEAD, externally managed). Branch creation needed at finish time."
34
-
35
- Has the user already indicated their worktree preference in your instructions? If not, ask for consent before creating a worktree:
36
-
37
- > "Would you like me to set up an isolated worktree? It protects your current branch from changes."
38
-
39
- Honor any existing declared preference without asking. If the user declines consent, work in place and skip to project setup.
40
-
41
- ## Step 1a detail — native tools
42
-
43
- The user has asked for an isolated workspace. Do you already have a way to create a worktree? It might be a tool with a name like `EnterWorktree`, `WorktreeCreate`, a `/worktree` command, or a `--worktree` flag. If you do, use it and skip to setup.
44
-
45
- Native tools handle directory placement, branch creation, and cleanup automatically. Using `git worktree add` when you have a native tool creates phantom state your harness can't see or manage.
46
-
47
- Only use the git fallback if you have no native worktree tool available.
48
-
49
- ## Step 1b detail — directory selection priority
50
-
51
- Follow this priority order. Explicit user preference always beats observed filesystem state.
52
-
53
- 1. **Check your instructions for a declared worktree directory preference.** If the user has already specified one, use it without asking.
54
- 2. **Check for an existing project-local worktree directory:** Check if `.worktrees/` or `worktrees/` exists using cross-platform file system tools (`read_file` / `list_dir` or native shell test commands). If found, use it. If both exist, `.worktrees` wins.
55
- 3. **If there is no other guidance available**, default to `.worktrees/` at the project root.
56
-
57
- ### Safety verification (project-local directories only)
58
-
59
- **MUST verify directory is ignored before creating worktree:**
60
-
61
- ```bash
62
- git check-ignore -q .worktrees || git check-ignore -q worktrees
63
- ```
64
-
65
- **If NOT ignored:** Add to .gitignore, commit the change, then proceed.
25
+ Reuse a registered linked checkout of the bound repository; never nest another
26
+ worktree inside it. A submodule or unrelated repository is not sufficient proof.
27
+ Record the resolved directory and branch (or detached HEAD) in the handoff.
66
28
 
67
- **Why critical:** Prevents accidentally committing worktree contents to repository.
29
+ ## Create and enter
68
30
 
69
- ### Create the worktree
31
+ Honor an existing directory preference. Prefer a host-native worktree facility
32
+ when available, then verify that it is backed by a registered Git worktree.
33
+ Otherwise use Git:
70
34
 
71
35
  ```bash
72
- # Determine path based on chosen location
73
- path="$LOCATION/$BRANCH_NAME"
74
-
75
- git worktree add "$path" -b "$BRANCH_NAME"
76
- cd "$path"
36
+ git worktree add "<isolated-path>" -b "<task-branch>"
77
37
  ```
78
38
 
79
- **Sandbox fallback:** If `git worktree add` fails with a permission error (sandbox denial), tell the user the sandbox blocked worktree creation and you're working in the current directory instead. Then run setup and baseline tests in place.
39
+ For mandatory mode, choose an already-ignored project-local path or an external
40
+ sibling path. Verify the exact project-local candidate with `git check-ignore`.
41
+ Do not edit/commit the primary tree's ignore file just to permit worktree setup.
42
+ If the native facility fails, a permitted Git fallback is valid; if neither can
43
+ establish isolation, stop mutable work as blocked.
80
44
 
81
- ## Step 2 detail — project setup
45
+ Set each subsequent tool's working-directory field to the isolated path and
46
+ keep artifact targets inside it. Entering a worktree does not authorize an
47
+ absolute edit, patch move, or shell target back into the primary checkout.
48
+ Resolve symlinks/junctions when verifying target scope.
82
49
 
83
- Auto-detect and run appropriate setup:
50
+ ## Setup and baseline
84
51
 
85
- ```bash
86
- # Node.js
87
- if [ -f package.json ]; then npm install; fi
88
-
89
- # Rust
90
- if [ -f Cargo.toml ]; then cargo build; fi
52
+ Install the detected dependencies inside the isolated checkout, then run the
53
+ relevant baseline tests/build before implementation. Surface existing failures
54
+ with exact output and distinguish them from regressions introduced by the task.
55
+ Continue fixing task-relevant failures within the user's authorized scope.
91
56
 
92
- # Python
93
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
94
- if [ -f pyproject.toml ]; then poetry install; fi
95
-
96
- # Go
97
- if [ -f go.mod ]; then go mod download; fi
98
- ```
57
+ For active Fable workflows, enter the correlated run through the router's
58
+ displayed controller before dependency installation or artifact mutation. The
59
+ session's `workflow-stages.json` bootstrap file is runtime state; it is not an
60
+ exception for source changes.
99
61
 
100
- ## Step 3 detail — baseline report
62
+ ## Evidence boundary
101
63
 
102
- If tests fail: report failures, ask whether to proceed or investigate. If tests pass:
103
-
104
- ```
105
- Worktree ready at <full-path>
106
- Tests passing (<N> tests, 0 failures)
107
- Ready to implement <feature-name>
108
- ```
64
+ The workflow gate checks registered Git identity, direct/patch target paths,
65
+ known shell side effects, and explicit outside paths. It is not a filesystem
66
+ sandbox for arbitrary script bodies or indirect side effects. Preserve the
67
+ platform capability boundary and report unsupported hook/metadata paths.