harness-everything 0.55.2 → 0.55.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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/AGENTS.md +1 -1
- package/BENCHMARK_SOP.md +2 -2
- package/CHANGELOG.md +22 -0
- package/README.md +15 -16
- package/SECURITY.md +1 -1
- package/VERIFICATION.md +4 -8
- package/behavioral-evals/PAIRED-BENCHMARK.md +12 -27
- package/behavioral-evals/README.md +21 -65
- package/behavioral-evals/cases/breaker-zoom-out-after-3.yaml +26 -33
- package/behavioral-evals/cases/pressure-sunk-cost-retry.yaml +15 -17
- package/behavioral-evals/paired-benchmark.js +3 -40
- package/behavioral-evals/run.js +2 -3
- package/ci/fixtures/doc-obligations/reconciliation-s2b/wiring/legacy-off-golden.json +0 -6
- package/ci/invariant-routing.test.js +32 -6
- package/ci/lib/opencode-verification-loader.js +3 -5
- package/ci/mechanism-2a-rule-of-3.test.js +111 -97
- package/ci/mechanism-2n-opencode-plugin.test.js +68 -206
- package/ci/mechanism-2p-opencode-v2-entrypoint.test.js +47 -28
- package/ci/mechanism-2w-platform-compatibility.test.js +1 -0
- package/ci/mechanism-32-paired-benchmark.test.js +1 -2
- package/ci/mechanism-33-issues-205-207.test.js +1 -1
- package/ci/mechanism-338-opencode-async.test.js +18 -49
- package/ci/mechanism-36-verify-timeout.test.js +3 -189
- package/ci/mechanism-39-opencode-verify-outcomes.test.js +56 -323
- package/ci/mechanism-397-opencode-observations.test.js +64 -9
- package/ci/mechanism-check-packet-write-set.test.js +163 -8
- package/ci/mechanism-codex-hook-results.test.js +9 -5
- package/ci/mechanism-prb-outline-review.test.js +1 -13
- package/ci/mechanism-system-one-router.test.js +1 -1
- package/ci/openai-plugin-package.test.js +30 -7
- package/ci/openai-plugin-runtime.test.js +64 -32
- package/ci/prompt-contract-regressions.test.js +1 -5
- package/ci/router-workflow-plan.test.js +8 -8
- package/ci/self-evolve-loop.test.js +51 -51
- package/ci/workflow-execution-contract.test.js +3 -6
- package/code-review/SKILL.md +1 -1
- package/code-review/templates/finding.template.md +17 -1
- package/docker-verify.sh +1 -117
- package/docs/architecture.md +9 -7
- package/docs/document-lifecycle.md +1 -1
- package/docs/enforcement-locks.md +12 -10
- package/docs/mechanism-first-skill-mesh.md +2 -2
- package/docs/openai-plugin.md +3 -3
- package/docs/philosophy.md +1 -1
- package/docs/platform-capabilities.md +4 -3
- package/docs/platform-compatibility.json +2 -2
- package/docs/reflection.md +1 -1
- package/docs/routing.md +2 -2
- package/docs/system-one-suggestion-gates.md +4 -4
- package/docs/troubleshooting.md +9 -35
- package/docs/workflow-runtime.md +19 -18
- package/docs/workflows/environment-detection.md +11 -9
- package/docs/workflows/fable-discipline.md +6 -5
- package/docs/workflows/fable-mode.md +6 -5
- package/docs/workflows/harness-everything.md +5 -5
- package/docs/workflows/improve-codebase-architecture.md +10 -8
- package/docs/workflows/install-cognitive-os.md +5 -5
- package/docs/workflows/tdd.md +9 -9
- package/docs/workflows/zoom-out.md +20 -30
- package/environment-detection/SKILL.md +2 -2
- package/environment-detection/references/shell-syntax-rules.md +1 -1
- package/eval-harness/SKILL.md +1 -1
- package/eval-harness/references/scoring-rubric.md +3 -3
- package/evals/zoom-out/eval.yaml +2 -2
- package/evals/zoom-out/tasks/negative-productive-iteration.yaml +15 -0
- package/evals/zoom-out/tasks/negative-trivial-edit.yaml +6 -6
- package/evals/zoom-out/tasks/positive-first-failure.yaml +15 -0
- package/evals/zoom-out/tasks/positive-repair-loop.yaml +1 -1
- package/fable-discipline/SKILL.md +3 -3
- package/fable-discipline/references/discipline-rules.md +1 -1
- package/fable-mode/SKILL.md +1 -1
- package/fable-mode/execution-guardrails/SKILL.md +2 -4
- package/fable-mode/execution-guardrails/references/guardrail-rules.md +3 -3
- package/fable-mode/fable-haiku/SKILL.md +1 -1
- package/fable-mode/fable-opus/SKILL.md +2 -2
- package/fable-mode/fable-sonnet/SKILL.md +1 -1
- package/fable-mode/references/execution-phases.md +2 -2
- package/harness-everything/SKILL.md +3 -3
- package/harness-everything/references/router-workflow-plan.md +2 -2
- package/harness-everything/references/skill-registry.md +2 -2
- package/harness-everything/references/triage-and-tiers.md +5 -5
- package/harness-everything/scripts/bootstrap.js +1 -26
- package/harness-everything/scripts/kernel-router-core.js +2 -3
- package/harness-everything/scripts/kernel-router.js +1 -1
- package/harness-everything/scripts/router-contract-core.js +1 -1
- package/harness-everything/scripts/routing-keywords.json +0 -2
- package/hooks/hooks.json +0 -33
- package/hooks/scripts/lib/harness-state.js +5 -6
- package/hooks/scripts/lib/learning-opportunity.js +3 -13
- package/hooks/scripts/openai-session-start.js +2 -4
- package/improve-codebase-architecture/SKILL.md +3 -3
- package/improve-codebase-architecture/guides/refactoring-workflow.md +5 -4
- package/install-cognitive-os/SKILL.md +3 -3
- package/opencode-plugin/README.md +18 -43
- package/opencode-plugin/index.mjs +52 -380
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +1 -4
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/hooks/hooks.json +0 -14
- package/plugins/harness-everything/hooks/scripts/lib/harness-state.js +5 -6
- package/plugins/harness-everything/hooks/scripts/lib/learning-opportunity.js +3 -13
- package/plugins/harness-everything/hooks/scripts/lib/workspace.js +2 -2
- package/plugins/harness-everything/hooks/scripts/openai-session-start.js +2 -4
- package/plugins/harness-everything/hooks/session-start.js +2 -4
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/scripts/lib/advisory-text.js +2 -2
- package/plugins/harness-everything/scripts/lib/workspace.js +2 -2
- package/plugins/harness-everything/skills/code-review/SKILL.md +1 -1
- package/plugins/harness-everything/skills/code-review/templates/finding.template.md +17 -1
- package/plugins/harness-everything/skills/environment-detection/SKILL.md +2 -2
- package/plugins/harness-everything/skills/environment-detection/references/shell-syntax-rules.md +1 -1
- package/plugins/harness-everything/skills/eval-harness/SKILL.md +1 -1
- package/plugins/harness-everything/skills/eval-harness/references/scoring-rubric.md +3 -3
- package/plugins/harness-everything/skills/fable-discipline/SKILL.md +3 -3
- package/plugins/harness-everything/skills/fable-discipline/references/discipline-rules.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/execution-guardrails/SKILL.md +2 -4
- package/plugins/harness-everything/skills/fable-mode/execution-guardrails/references/guardrail-rules.md +3 -3
- package/plugins/harness-everything/skills/fable-mode/fable-haiku/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/fable-opus/SKILL.md +2 -2
- package/plugins/harness-everything/skills/fable-mode/fable-sonnet/SKILL.md +1 -1
- package/plugins/harness-everything/skills/fable-mode/references/execution-phases.md +2 -2
- package/plugins/harness-everything/skills/harness-everything/SKILL.md +3 -3
- package/plugins/harness-everything/skills/harness-everything/references/router-workflow-plan.md +2 -2
- package/plugins/harness-everything/skills/harness-everything/references/skill-registry.md +2 -2
- package/plugins/harness-everything/skills/harness-everything/references/triage-and-tiers.md +5 -5
- package/plugins/harness-everything/skills/harness-everything/scripts/bootstrap.js +1 -26
- package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router-core.js +2 -3
- package/plugins/harness-everything/skills/harness-everything/scripts/kernel-router.js +1 -1
- package/plugins/harness-everything/skills/harness-everything/scripts/router-contract-core.js +1 -1
- package/plugins/harness-everything/skills/harness-everything/scripts/routing-keywords.json +0 -2
- package/plugins/harness-everything/skills/improve-codebase-architecture/SKILL.md +3 -3
- package/plugins/harness-everything/skills/improve-codebase-architecture/guides/refactoring-workflow.md +5 -4
- package/plugins/harness-everything/skills/install-cognitive-os/SKILL.md +3 -3
- package/plugins/harness-everything/skills/self-evolve/SKILL.md +1 -1
- package/plugins/harness-everything/skills/self-evolve/references/memory-resolution.md +3 -3
- package/plugins/harness-everything/skills/self-evolve/schemas/lesson-candidate.schema.json +4 -1
- package/plugins/harness-everything/skills/self-evolve/scripts/lesson-candidate.js +1 -0
- package/plugins/harness-everything/skills/skill-creator/SKILL.md +1 -1
- package/plugins/harness-everything/skills/skill-creator/references/quality-checklist.md +1 -1
- package/plugins/harness-everything/skills/skill-creator/references/quality-principles.md +4 -4
- package/plugins/harness-everything/skills/tdd/SKILL.md +2 -2
- package/plugins/harness-everything/skills/tdd/references/core-discipline.md +3 -5
- package/plugins/harness-everything/skills/todo-driven-workflow/SKILL.md +2 -2
- package/plugins/harness-everything/skills/zoom-out/SKILL.md +14 -26
- package/plugins/harness-everything/skills/zoom-out/references/circuit-breaker.md +18 -62
- package/references/platform-advisory-template.md +3 -9
- package/sbom.cdx.json +7 -7
- package/scripts/check-packet-write-set.js +76 -1
- package/scripts/lib/advisory-text.js +2 -2
- package/scripts/lib/workspace.js +2 -2
- package/self-evolve/SKILL.md +1 -1
- package/self-evolve/references/memory-resolution.md +3 -3
- package/self-evolve/schemas/lesson-candidate.schema.json +4 -1
- package/self-evolve/scripts/lesson-candidate.js +1 -0
- package/skill-creator/SKILL.md +1 -1
- package/skill-creator/references/quality-checklist.md +1 -1
- package/skill-creator/references/quality-principles.md +4 -4
- package/submission/openai/test-cases.json +5 -5
- package/tdd/SKILL.md +2 -2
- package/tdd/references/core-discipline.md +3 -5
- package/todo-driven-workflow/SKILL.md +2 -2
- package/zoom-out/SKILL.md +14 -26
- package/zoom-out/references/circuit-breaker.md +18 -62
- package/behavioral-evals/opencode-hardlock-live.js +0 -17
- package/behavioral-evals/opencode-reflection-gate-live.js +0 -342
- package/ci/mechanism-31-opencode-hardlock-evidence.test.js +0 -82
- package/evals/zoom-out/tasks/negative-first-edge-case-review.yaml +0 -16
- package/evals/zoom-out/tasks/positive-repeated-failure.yaml +0 -15
- package/hooks/scripts/reset-circuit-breaker.js +0 -30
- package/hooks/scripts/rule-of-3-tracker.js +0 -165
- package/hooks/scripts/rule-of-3.js +0 -171
- package/plugins/harness-everything/hooks/scripts/reset-circuit-breaker.js +0 -30
- package/plugins/harness-everything/hooks/scripts/rule-of-3-tracker.js +0 -165
- package/plugins/harness-everything/hooks/scripts/rule-of-3.js +0 -171
package/plugins/harness-everything/skills/harness-everything/scripts/router-contract-core.js
CHANGED
|
@@ -325,7 +325,7 @@ function selectWorkflowStrategy(input = {}) {
|
|
|
325
325
|
function planMetadataForStrategy(strategy) {
|
|
326
326
|
const base = {
|
|
327
327
|
patterns: ['router'],
|
|
328
|
-
requiredInvariants: ['scope-lock', 'environment-alignment', 'verify-before-claim', '
|
|
328
|
+
requiredInvariants: ['scope-lock', 'environment-alignment', 'verify-before-claim', 'visible-status-updates'],
|
|
329
329
|
suggestedSkills: [],
|
|
330
330
|
knowledgeSignals: [],
|
|
331
331
|
maxIterations: null,
|
|
@@ -4,7 +4,7 @@ description: Discovers and transforms shallow or bloated modules into deep, SRP-
|
|
|
4
4
|
license: Apache-2.0
|
|
5
5
|
metadata:
|
|
6
6
|
author: Miya Daniel
|
|
7
|
-
version: 0.
|
|
7
|
+
version: 0.55.4
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Improve Codebase Architecture (Deep & SRP Refactoring)
|
|
@@ -16,14 +16,14 @@ metadata:
|
|
|
16
16
|
| **Trigger / Input** | "refactor architecture", "split object/class", "apply SRP", tech debt |
|
|
17
17
|
| **Expected Output** | SRP proposal, Characterization Test safety net, TDD-guided extraction. |
|
|
18
18
|
| **State Mutations** | Extracts classes/functions/objects; adds characterization tests. |
|
|
19
|
-
| **Enforcement Gate** | Scan docs first; Characterization Tests before refactoring untested code
|
|
19
|
+
| **Enforcement Gate** | Scan docs first; Characterization Tests before refactoring untested code. |
|
|
20
20
|
|
|
21
21
|
## Workflow
|
|
22
22
|
|
|
23
23
|
1. `[Discover]`: no blind refactoring — scan `CONTEXT.md`, `docs/adr/`, core interfaces first. Targets: SRP violations (>300 lines / >10 complexity), shallow modules, coupled seams.
|
|
24
24
|
2. `[Think]`: present the Deepening & SRP proposal (object splitting + seam abstraction) until approved.
|
|
25
25
|
3. `[Try]`: launch `tdd`; Characterization Tests first if legacy code lacks tests; extract incrementally, verifying tests after each change.
|
|
26
|
-
4. `[Summarize]`/`[Self-Evolve]`:
|
|
26
|
+
4. `[Summarize]`/`[Self-Evolve]`: if evidence changes the refactor diagnosis, optionally use `zoom-out` at the first meaningful signal; productive iteration may continue when attempts add evidence or narrow the cause. Roll back only when checks show a regression, and record useful traps in `self-evolve`.
|
|
27
27
|
|
|
28
28
|
Deep dive: <this-skill-dir>/references/README.md
|
|
29
29
|
|
|
@@ -23,10 +23,11 @@ flowchart TD
|
|
|
23
23
|
CheckTest -- No Tests --> WriteCharTest[Write Characterization Tests First] --> Execute
|
|
24
24
|
CheckTest -- Tests Pass --> Execute[5. Execute Refactoring via TDD]
|
|
25
25
|
|
|
26
|
-
Execute --> ErrorsCheck{
|
|
26
|
+
Execute --> ErrorsCheck{Did results change the diagnosis?}
|
|
27
27
|
|
|
28
|
-
ErrorsCheck -- Yes -->
|
|
28
|
+
ErrorsCheck -- Yes --> Reassess[Choose whether to reassess, revise, or roll back]
|
|
29
29
|
ErrorsCheck -- No --> Complete[Refactoring Complete & Record Lessons in self-evolve]
|
|
30
|
+
Reassess --> Execute
|
|
30
31
|
```
|
|
31
32
|
|
|
32
33
|
## 1. Architectural Exploration & Discovery `[Discover]`
|
|
@@ -47,8 +48,8 @@ Use consistent domain terminology (Module, Interface, Implementation, Depth, Sea
|
|
|
47
48
|
- **Iron Rule of Refactoring**: MUST be done under the safety net of test coverage. If there are no tests, the first step MUST be to "write Characterization Tests for the legacy code" before modifying the architecture.
|
|
48
49
|
- **Extract Safely**: Extract objects/functions incrementally, verifying test suite execution after each atomic change.
|
|
49
50
|
|
|
50
|
-
## 4.
|
|
51
|
-
-
|
|
51
|
+
## 4. Reassessment & Evolution `[Summarize]` & `[Self-Evolve]`
|
|
52
|
+
- When results contradict an assumption or leave the next check unclear, an agent may choose `zoom-out` to review evidence and update the diagnosis. Continue when iterations narrow the cause and justify the next action; roll back when checks show a regression.
|
|
52
53
|
- Write the discovered coupling traps into `self-evolve` memory, ensuring future newly generated code does not repeat the same mistakes.
|
|
53
54
|
|
|
54
55
|
## Reference Guides
|
|
@@ -4,7 +4,7 @@ description: "Explain or explicitly apply the Harness cognitive policy: Discover
|
|
|
4
4
|
license: Apache-2.0
|
|
5
5
|
metadata:
|
|
6
6
|
author: Miya Daniel
|
|
7
|
-
version: 0.
|
|
7
|
+
version: 0.55.4
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Agent Cognitive OS
|
|
@@ -27,14 +27,14 @@ The Cognitive OS is policy, not a required peer-skill selection. Supported runti
|
|
|
27
27
|
| **Input** | Explicit cognitive-loop use, or a host without automatic Harness kernel context. |
|
|
28
28
|
| **Output** | Evidence-grounded work without a fixed domain-skill sequence. |
|
|
29
29
|
| **State** | None directly. |
|
|
30
|
-
| **Gate** | Completion claims need evidence;
|
|
30
|
+
| **Gate** | Completion claims need evidence; agents may reassess when evidence changes the diagnosis. |
|
|
31
31
|
|
|
32
32
|
## Core Loop
|
|
33
33
|
|
|
34
34
|
1. `[Discover]` Verify relevant workspace state.
|
|
35
35
|
2. `[Think]` Establish intent, scope, and failure modes.
|
|
36
36
|
3. `[Try]` Make the smallest useful change and gather evidence.
|
|
37
|
-
4. `[Summarize]` Ground conclusions in tool output;
|
|
37
|
+
4. `[Summarize]` Ground conclusions in tool output; use `zoom-out` when evidence warrants a fresh diagnosis.
|
|
38
38
|
5. `[Record]` Record milestones only when evidence supports them.
|
|
39
39
|
|
|
40
40
|
Domain skills may define their own tactics and phases. They do not need to invoke this skill first as long as the Harness invariants remain satisfied.
|
|
@@ -4,11 +4,11 @@ Details moved from SKILL.md. Read when you need the full decision matrix or the
|
|
|
4
4
|
|
|
5
5
|
## Responsibility Boundary
|
|
6
6
|
|
|
7
|
-
Harness may observe only its own structured runtime events.
|
|
7
|
+
Harness may observe only its own structured runtime events. Agent-initiated reassessment is not triggered by a retry counter; supported structured events such as verifier fail→pass may create privacy-minimal lesson candidates automatically. Raw prompts, commands, tool output, source text, and global host transcripts are not copied into those candidates. The agent or Human Partner still supplies the generalized rule before evaluation. `self-evolve` MUST NOT scan global transcript stores, persist raw transcripts, or act as a transcript daemon.
|
|
8
8
|
|
|
9
9
|
## Triggers
|
|
10
10
|
|
|
11
|
-
- **
|
|
11
|
+
- **After Reassessment**: When an agent-chosen `zoom-out` yields a reusable insight.
|
|
12
12
|
- **Major Breakthrough**: Upon completing complex tasks that revealed non-obvious framework limits or architectural edge cases.
|
|
13
13
|
- **Explicit Request**: When the user asks to "remember this lesson" or "save this to memory".
|
|
14
14
|
|
|
@@ -58,7 +58,7 @@ observed -> proposed -> screened -> evaluated
|
|
|
58
58
|
-> inconclusive
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
- `rule-of-3-recovery`
|
|
61
|
+
- Legacy `rule-of-3-recovery` candidates are historical, remain `inconclusive`, and do not act as an active trigger.
|
|
62
62
|
- `verifier-fail-pass` can pass deterministic grounding checks because the retained contract records an objective fail→pass transition, but this still does not prove future behavioral improvement.
|
|
63
63
|
- Identical runtime evidence is idempotent and maps to one candidate ID.
|
|
64
64
|
- Runtime hooks can create candidates but cannot call the durable memory writer directly.
|
|
@@ -47,7 +47,10 @@
|
|
|
47
47
|
"type": "object",
|
|
48
48
|
"required": ["type", "reasonCodes", "sourceEventIds", "evidenceClass"],
|
|
49
49
|
"properties": {
|
|
50
|
-
"type": {
|
|
50
|
+
"type": {
|
|
51
|
+
"enum": ["rule-of-3-recovery", "verifier-fail-pass"],
|
|
52
|
+
"description": "rule-of-3-recovery is retained only for historical candidates; the runtime no longer produces it."
|
|
53
|
+
},
|
|
51
54
|
"reasonCodes": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
|
|
52
55
|
"sourceEventIds": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
|
|
53
56
|
"evidenceClass": { "enum": ["runtime-recovery", "objective-transition"] }
|
|
@@ -104,6 +104,7 @@ function replayability(candidate) {
|
|
|
104
104
|
method: 'deterministic-transition-check',
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
+
// Keep pre-retirement candidates readable; the runtime no longer produces this trigger.
|
|
107
108
|
if (candidate.trigger?.type === 'rule-of-3-recovery') {
|
|
108
109
|
return {
|
|
109
110
|
replayable: false,
|
|
@@ -11,7 +11,7 @@ A skill isn't done until every line here is true. This is deliberately a flat ch
|
|
|
11
11
|
- [ ] **Every `MUST`/`MUST NOT`/`PROHIBITED` has a real gate behind it**, or is rewritten as a positive statement of the target behavior. A prohibition with no gate and no "why" sentence next to it is a smell, not a strength.
|
|
12
12
|
- [ ] **No no-op lines** — for each imperative sentence, ask whether it changes behavior versus what the model already does by default. ("Be thorough" reads as a no-op; a concrete completion criterion or a stronger leading word doesn't.)
|
|
13
13
|
- [ ] **Body fits the information hierarchy** — steps for ordered action, flat reference for rules, detail past what every branch needs pushed to `guides/`/`references/` with a "when to open this" pointer.
|
|
14
|
-
- [ ] **Reuses existing leading words** (`Tier 1/2/3`, `
|
|
14
|
+
- [ ] **Reuses existing leading words** (`Tier 1/2/3`, `zoom out`, `Red/Green/Refactor`, `Discover > Think > Try > Summarize > Record`) instead of naming a new concept for something this repo already has a word for.
|
|
15
15
|
- [ ] **Completion criteria are checkable** — tied to an exit code, a file's existence, a grep result, or explicit human confirmation, not "when it feels done."
|
|
16
16
|
- [ ] **Description reads as a human-facing sentence**, not just a trigger-phrase list — `scripts/installer.js`'s interactive picker prints it next to a checkbox for a person deciding whether to install this skill; that's its real first reader in this architecture (audit report §2.1).
|
|
17
17
|
|
|
@@ -45,18 +45,18 @@ A leading word is a compact, already-understood concept the model can think *wit
|
|
|
45
45
|
| Leading word | What it compresses |
|
|
46
46
|
|---|---|
|
|
47
47
|
| `Tier 1 / 2 / 3` | Task-complexity routing and the whole action-strategy that follows from each |
|
|
48
|
-
| `
|
|
49
|
-
|
|
|
48
|
+
| `zoom out` | Agent-initiated reassessment when evidence changes the diagnosis or the next action is unclear |
|
|
49
|
+
| productive iteration | Continuing is valid while attempts yield useful evidence and justify the next step |
|
|
50
50
|
| `Red / Green / Refactor` | The TDD cycle and which actions are legal in each phase |
|
|
51
51
|
| `Discover > Think > Try > Summarize > Record` | The base cognitive loop every tier and skill runs inside |
|
|
52
52
|
|
|
53
|
-
When a new skill
|
|
53
|
+
When a new skill refers to a fresh diagnosis, use `zoom-out` for agent-initiated reassessment; do not add a count-based stop or required artifact.
|
|
54
54
|
|
|
55
55
|
## Negation
|
|
56
56
|
|
|
57
57
|
A prohibition drags the forbidden behavior into the model's attention rather than out of it — "don't think of an elephant" makes the elephant the only thing present. This repo uses `MUST NOT`/`PROHIBITED` heavily and by design (`skill-style` mandates it), so the actual lever available isn't "stop using negation" — it's **reserve it for gates that are real**, and pair the rest with the positive target:
|
|
58
58
|
|
|
59
|
-
- **Does this well**: `zoom-out/SKILL.md`
|
|
59
|
+
- **Does this well**: `zoom-out/SKILL.md` names the evidence that can make a fresh diagnosis useful and gives a concrete next-step process. It leaves the choice with the agent instead of imposing a count-based stop.
|
|
60
60
|
- **Could do better**: `environment-detection/SKILL.md`'s "Red Flags & Common Errors" section restates, as a list of ❌ prohibitions, rules the same file already gave positively one section earlier (which shell uses which syntax). The information isn't wrong, it's just said twice in two moods.
|
|
61
61
|
|
|
62
62
|
If you're about to write `MUST NOT X`, check: is there a script or state mutation that actually enforces this, or human cost if violated (data loss, a broken build, a security gap)? If yes, keep the imperative — that's this repo's real strength, don't soften it. If no, try stating what *good* looks like instead and see if the `MUST NOT` was even carrying information.
|
|
@@ -4,7 +4,7 @@ description: "Drive Standard Tasks (Tier 2) with Test-Driven Development (RED/GR
|
|
|
4
4
|
license: Apache-2.0
|
|
5
5
|
metadata:
|
|
6
6
|
author: Miya Daniel
|
|
7
|
-
version: 0.
|
|
7
|
+
version: 0.55.4
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Test-Driven Development
|
|
@@ -35,4 +35,4 @@ Load `<this-skill-dir>/references/core-discipline.md` and the quality model, the
|
|
|
35
35
|
|
|
36
36
|
Deep dive: <this-skill-dir>/references/core-discipline.md
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
When a GREEN attempt reveals a wrong assumption, an unclear impact boundary, or no useful next check, the agent may invoke `zoom-out` to reassess. Continue when each iteration adds evidence and justifies the next step; no failure count requires a pause.
|
|
@@ -14,7 +14,7 @@ flowchart TD
|
|
|
14
14
|
|
|
15
15
|
Green --> CheckPass{Re-run Test Runner}
|
|
16
16
|
CheckPass -- Tests Pass --> Refactor[3. REFACTOR: Clean Code & Verify Alignments]
|
|
17
|
-
CheckPass --
|
|
17
|
+
CheckPass -- New evidence changes diagnosis --> ZoomOut[Optionally reassess with zoom-out]
|
|
18
18
|
|
|
19
19
|
Refactor --> VerifyFinal[Re-run Tests & Mark Todo Complete]
|
|
20
20
|
VerifyFinal --> Done[TDD Cycle Complete]
|
|
@@ -45,7 +45,5 @@ In the REFACTOR phase, you MUST verify that the implemented code actually aligns
|
|
|
45
45
|
- Checks: Is the naming clear? Is there duplicated code? Can performance be improved? Does it comply with the project's Clean Code standards?
|
|
46
46
|
- **Validation**: After every modification, re-run the tests to ensure refactoring hasn't broken the original functionality.
|
|
47
47
|
|
|
48
|
-
##
|
|
49
|
-
|
|
50
|
-
- **Trigger Condition Met**: You might have hit the reasoning ceiling, or the initial test logic (RED) was written incorrectly.
|
|
51
|
-
- **Mandatory Action**: Stop guessing blindly. Immediately abort the TDD process and call the `zoom-out` skill: fact-check the assumption behind each failing attempt — including whether the RED test itself encodes the wrong expectation — and resume on a fresh diagnosis. Bring the human in only if the reflection surfaces a genuine decision (e.g., the test contradicts the requirement).
|
|
48
|
+
## Voluntary Reassessment
|
|
49
|
+
During any TDD phase, an agent may choose `zoom-out` when a result contradicts an assumption, exposes an unknown boundary, or leaves the next check unclear. Review the test, evidence, and attempted changes before selecting a next step. Continue when each iteration yields useful evidence and the next action remains justified; no count or report is required.
|
|
@@ -4,7 +4,7 @@ description: "Enforce a deliberate step-by-step execution loop for complex multi
|
|
|
4
4
|
license: Apache-2.0
|
|
5
5
|
metadata:
|
|
6
6
|
author: Miya Daniel
|
|
7
|
-
version: 0.4
|
|
7
|
+
version: 0.55.4
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Todo-Driven Workflow
|
|
@@ -34,7 +34,7 @@ Single-task milestones prevent context drift in Tier 2/3 work.
|
|
|
34
34
|
2. [Record] Initialize the native host tracker before edits; if unavailable, create a Markdown checklist.
|
|
35
35
|
3. Start exactly one milestone, execute only its scope, and run its named check.
|
|
36
36
|
4. Mark it complete only after evidence passes; then start the next milestone.
|
|
37
|
-
5. Record blockers
|
|
37
|
+
5. Record blockers and surface genuine user decisions when the next step depends on them; choose `zoom-out` when new evidence warrants reassessment.
|
|
38
38
|
|
|
39
39
|
Native TODO tools take priority. Markdown is portable fallback; this skill
|
|
40
40
|
does not depend on a repository CLI state machine.
|
|
@@ -1,43 +1,31 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zoom-out
|
|
3
|
-
description: "
|
|
3
|
+
description: "Agent-initiated reassessment when evidence contradicts assumptions, exposes an unknown boundary, or a path stops producing useful information. Use for voluntary diagnosis of stalled or changing work. DO NOT USE FOR: routine debugging when the next check is clear, or greenfield planning."
|
|
4
4
|
license: Apache-2.0
|
|
5
5
|
metadata:
|
|
6
6
|
author: Miya Daniel
|
|
7
|
-
version: 0.
|
|
7
|
+
version: 0.55.4
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
# Zoom Out
|
|
10
|
+
# Zoom Out
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Choose a fresh diagnosis when evidence changes your understanding, an important boundary is unknown, or the next action is unclear. You may do this after the first failure or later. Continue while attempts yield useful evidence and the next step is justified.
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Reassess
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
| **State Mutations** | Writes the session `zoom-out-report.md`; reset may clear breaker state. |
|
|
21
|
-
| **Enforcement Gate** | `<skills-repo-root>/hooks/scripts/rule-of-3.js` plus a valid report; a later three-failure cycle requests another reflection. |
|
|
16
|
+
1. Restate the goal and acceptance criteria.
|
|
17
|
+
2. Review observed evidence, assumptions, and attempts; separate facts from guesses.
|
|
18
|
+
3. Trace callers and consumers when a shared decision or impact boundary is unclear.
|
|
19
|
+
4. Choose the next smallest check or correction. Continue, revise, or surface a genuine user decision.
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
1. After three same-signature failures, stop edits and do not ask the user yet.
|
|
26
|
-
2. Use read-only tools to restate the goal and check files, configuration, and logs.
|
|
27
|
-
3. Fill `<this-skill-dir>/templates/zoom-out-report.template.md` and end with `RESUME` or `ESCALATE`.
|
|
28
|
-
4. Resume only on an untried path; escalate genuine user decisions with options. Repair loop: inventory sites first.
|
|
29
|
-
5. If three more matching failures occur, run another zoom-out cycle. `npm run harness:reset` is only an optional manual state clear; record the insight with `self-evolve`.
|
|
21
|
+
This is agent-chosen guidance: no failure count or threshold requires a stop, report, or reset ritual. A written note is optional.
|
|
30
22
|
|
|
31
23
|
## USE FOR:
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
- "every round finds a new edge case"
|
|
35
|
-
- "rethink your assumptions"
|
|
24
|
+
- Evidence contradicts a core assumption or exposes an unknown impact boundary.
|
|
25
|
+
- The current approach stops producing useful information, or you request a fresh diagnosis.
|
|
36
26
|
|
|
37
27
|
## DO NOT USE FOR:
|
|
38
|
-
- Routine
|
|
39
|
-
- Greenfield planning
|
|
40
|
-
|
|
41
|
-
Never retry the same approach after the third failure, even under pressure.
|
|
28
|
+
- Routine debugging when the next check is clear.
|
|
29
|
+
- Greenfield planning (`fable-mode`).
|
|
42
30
|
|
|
43
31
|
Deep dive: `<this-skill-dir>/references/circuit-breaker.md`
|
|
@@ -1,74 +1,30 @@
|
|
|
1
|
-
# Zoom Out —
|
|
1
|
+
# Zoom Out — Voluntary Diagnosis Guidance
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This reference helps an agent decide whether a fresh diagnosis would improve the next step. It does not impose a trigger or pause.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Reassessment path
|
|
6
6
|
|
|
7
7
|
```mermaid
|
|
8
8
|
flowchart TD
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
CheckPath -- Template / Path Unavailable --> WritePlatform[Write to .github/harness-everything/zoom-out-report.md or Inline]
|
|
15
|
-
|
|
16
|
-
WriteSession --> DecisionGate{4. Phase 4: Decision Gate}
|
|
17
|
-
WritePlatform --> DecisionGate
|
|
18
|
-
|
|
19
|
-
DecisionGate -- Clear Untried Path Identified --> Resume[RESUME: Execute Fresh Diagnosis in TDD / Fable]
|
|
20
|
-
DecisionGate -- Requirement Conflict / Access Gap --> Escalate[ESCALATE: Present 2-3 Options + Recommendation to Human]
|
|
21
|
-
|
|
22
|
-
Resume --> Resolved{5. Problem Cracking Succeeds?}
|
|
23
|
-
Resolved -- Yes --> SelfEvolve[Call self-evolve to Persist Insight]
|
|
24
|
-
Resolved -- No (3 More Matching Failures) --> CeaseFire
|
|
9
|
+
Signal[New evidence or unclear next step] --> Review[Revisit goal, assumptions, and evidence]
|
|
10
|
+
Review --> Useful{Is the next action justified?}
|
|
11
|
+
Useful -- Yes --> Continue[Continue and verify]
|
|
12
|
+
Useful -- No --> Update[Revise the approach or surface a genuine user decision]
|
|
13
|
+
Update --> Continue
|
|
25
14
|
```
|
|
26
15
|
|
|
27
|
-
|
|
28
|
-
- **Rule of 3 (Repeated Failures)**: Attempting to fix the same error or test failure 3 times without progress.
|
|
29
|
-
- **Divergence**: Fixing one bug repeatedly introduces new secondary errors.
|
|
30
|
-
- **Repair loop (feature level)**: Two consecutive review or fix rounds on the same feature each surface new defects in the same decision class (for example "is this the trusted checker?"), even though every command succeeded.
|
|
31
|
-
- The Rule of 3 hook cannot see this. It counts same-signature command failures in one session. Successful review findings do not increment it, and unrelated successes can leave an existing count in place. New sessions and different failure signatures do not accumulate a feature's review history.
|
|
32
|
-
- The signal comes from review history: prior findings and their dispositions, the round count per class in an error ledger, or the reviewer noticing the pattern. It is a prompt to reflect, not a lock. The hook gate in the skill contract applies only to the three-failure trigger.
|
|
33
|
-
- "Same decision class" means the same acceptance decision under the same trust assumptions, possibly at different sites. "Same directory" or "validation" is too broad. Count a repeated or renamed finding once, and treat missing history as unknown, not zero.
|
|
34
|
-
- Phase 2 here means: list every finding so far by decision class, state the acceptance clause each violates, and inventory every site (callers, state readers, Stop consumers) that makes the same decision. Findings that map to no acceptance clause stay `unresolved` for the owner instead of becoming new fixes.
|
|
35
|
-
- RESUME by using the inventory to choose the smallest justified correction (which may be one shared fix, or no code change), then re-trace one normal end-to-end acceptance path. Unresolved findings need scope adjudication, not speculative repairs.
|
|
36
|
-
- Whoever applies the fixes counts too. Before fixing review round 2 or later on one feature, classify each new finding against the decision classes of earlier rounds. A class that also appeared in the previous round MUST trigger Phase 2 before any edit; do not wait for the reviewer to name the pattern.
|
|
37
|
-
- A one-shot reviewer cannot see the previous round on its own. The packet carries the current acceptance anchor, a link to the previous comparable report with its revision, the prior finding IDs and dispositions, and the fix made since.
|
|
38
|
-
- **Goal Drift**: Execution strays far from the initial task objective.
|
|
39
|
-
- **User Instruction**: The user requests a step back ("zoom out", "step back", "stop and think").
|
|
40
|
-
|
|
41
|
-
## 2. Phase 1 — Cease Fire
|
|
42
|
-
- Pause code editing attempts immediately.
|
|
43
|
-
- Refrain from guessing quick fixes without checking underlying facts first.
|
|
44
|
-
|
|
45
|
-
## 3. Phase 2 — Rebuild Full Picture (Reflect & Fact-Check)
|
|
46
|
-
Use read-only tools (Read / Grep / Glob) to gather fresh evidence:
|
|
47
|
-
1. **Restate Goal**: Review original objectives from task/todo context.
|
|
48
|
-
2. **Examine Failed Attempts**: Identify the underlying belief behind each failed fix.
|
|
49
|
-
3. **Fact-Check Assumptions**: Verify files, configuration, logs, and docs directly.
|
|
50
|
-
4. **Elevate Perspective**: Check for layer mismatches, API contract misunderstandings, or conflicting requirements.
|
|
51
|
-
5. **Form Fresh Diagnosis**: Synthesize a comprehensive explanation that accounts for all observed evidence.
|
|
52
|
-
|
|
53
|
-
## 4. Phase 3 — Write Reflection Report
|
|
54
|
-
Copy `zoom-out/templates/zoom-out-report.template.md` to the `zoom-out-report.md` path given in the Rule of 3 message and fill it in section by section.
|
|
55
|
-
|
|
56
|
-
A complete report automatically releases the circuit breaker on hook-enabled systems.
|
|
16
|
+
An agent may reassess at the first meaningful signal or later. A run may continue when attempts add evidence, narrow the cause, and justify the next check. Neither a failure count nor review history forces a pause.
|
|
57
17
|
|
|
58
|
-
##
|
|
18
|
+
## Make the diagnosis concrete
|
|
59
19
|
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
|
|
20
|
+
- Restate the goal and the acceptance clause that matters.
|
|
21
|
+
- List observed results and assumptions separately; include which attempted changes were informative.
|
|
22
|
+
- When the issue may span consumers, inventory callers and state readers before choosing a correction.
|
|
23
|
+
- Group findings by the acceptance decision they affect. Keep findings with no matching clause unresolved for the owner instead of inventing extra scope.
|
|
24
|
+
- Select the smallest next check or change that distinguishes the remaining explanations.
|
|
63
25
|
|
|
64
|
-
|
|
65
|
-
> The real blocker is a [requirement conflict / architecture trade-off / destructive step / access gap], which is your call, not mine.
|
|
66
|
-
> Option A: [...] (trade-off: ...). Option B: [...] (trade-off: ...).
|
|
67
|
-
> I recommend A because [...]. Which direction do you choose?"
|
|
26
|
+
If a review or repair reveals the same decision problem at another site, trace all sites that make that decision before editing again. Productive iteration remains valid while it keeps reducing uncertainty.
|
|
68
27
|
|
|
69
|
-
|
|
28
|
+
## Optional record
|
|
70
29
|
|
|
71
|
-
|
|
72
|
-
- **Self-recovery path**: a valid report ending in `RESUME` releases the breaker — reload the appropriate execution mode (`tdd`, `fable-mode`) and execute the new diagnosis. If the SAME failure signature accumulates 3 more failures, start another zoom-out/reflection cycle.
|
|
73
|
-
- **Human path**: after the human answers an `ESCALATE`, continue under their direction. `npm run harness:reset` (or a new session / `/clear`) is an optional manual state clear for recovery or maintenance; it is not required merely because the breaker re-tripped.
|
|
74
|
-
- Either way, once the problem is ultimately cracked, feed the insight to `self-evolve`.
|
|
30
|
+
A written summary can help a handoff or preserve a useful diagnosis, but no report, token, unlock, reset, or escalation ritual is required. When a note helps, record the goal, evidence, changed understanding, next action, and any decision that belongs to the user. The template at `<this-skill-dir>/templates/zoom-out-report.template.md` is optional.
|
|
@@ -12,15 +12,9 @@ Before executing any command:
|
|
|
12
12
|
3. Detect your package manager (npm, yarn, pnpm, bun, pip, cargo)
|
|
13
13
|
4. Use only commands compatible with your detected environment
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Reassess when useful
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
1. **STOP.** Do not attempt a 4th variation.
|
|
19
|
-
2. Re-read the error message carefully - don't guess what it says.
|
|
20
|
-
3. Check the actual file contents (don't assume you know them).
|
|
21
|
-
4. Consider: is this a syntax error, logic error, environment issue, or missing dependency?
|
|
22
|
-
5. Try a fundamentally different approach.
|
|
23
|
-
6. If still stuck after reflection, escalate to your Human Partner with a clear decision request.
|
|
17
|
+
An agent may use `zoom-out` when a meaningful signal contradicts a core assumption or exposes an unknown impact boundary. Productive attempts may continue when they yield new evidence or narrow the cause.
|
|
24
18
|
|
|
25
19
|
## Context Preservation (Anti-Bloat Protection)
|
|
26
20
|
|
|
@@ -55,4 +49,4 @@ Before claiming a change works:
|
|
|
55
49
|
---
|
|
56
50
|
|
|
57
51
|
*This template ensures consistent guidance across all AI coding platforms.*
|
|
58
|
-
*For hard enforcement on Claude Code, see the lifecycle hooks in .claude/settings.json.*
|
|
52
|
+
*For hard enforcement on Claude Code, see the lifecycle hooks in .claude/settings.json.*
|
package/sbom.cdx.json
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
"$schema": "https://cyclonedx.org/schema/bom-1.7.schema.json",
|
|
3
3
|
"bomFormat": "CycloneDX",
|
|
4
4
|
"specVersion": "1.7",
|
|
5
|
-
"serialNumber": "urn:uuid:
|
|
5
|
+
"serialNumber": "urn:uuid:c9ac3731-0280-5a2b-8070-86240b1f4efb",
|
|
6
6
|
"version": 1,
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-11-
|
|
8
|
+
"timestamp": "2026-11-21T01:29:55.079Z",
|
|
9
9
|
"tools": [
|
|
10
10
|
{
|
|
11
11
|
"vendor": "Harness Everything",
|
|
12
12
|
"name": "generate-sbom.js",
|
|
13
|
-
"version": "0.55.
|
|
13
|
+
"version": "0.55.4"
|
|
14
14
|
}
|
|
15
15
|
],
|
|
16
16
|
"component": {
|
|
17
17
|
"type": "application",
|
|
18
|
-
"bom-ref": "pkg:npm/harness-everything@0.55.
|
|
18
|
+
"bom-ref": "pkg:npm/harness-everything@0.55.4",
|
|
19
19
|
"name": "harness-everything",
|
|
20
|
-
"version": "0.55.
|
|
21
|
-
"purl": "pkg:npm/harness-everything@0.55.
|
|
20
|
+
"version": "0.55.4",
|
|
21
|
+
"purl": "pkg:npm/harness-everything@0.55.4"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"components": [
|
|
@@ -2033,7 +2033,7 @@
|
|
|
2033
2033
|
]
|
|
2034
2034
|
},
|
|
2035
2035
|
{
|
|
2036
|
-
"ref": "pkg:npm/harness-everything@0.55.
|
|
2036
|
+
"ref": "pkg:npm/harness-everything@0.55.4",
|
|
2037
2037
|
"dependsOn": [
|
|
2038
2038
|
"pkg:npm/%40commitlint/cli@19.8.1",
|
|
2039
2039
|
"pkg:npm/%40commitlint/config-conventional@19.8.1",
|
|
@@ -32,7 +32,7 @@ function parseArgs(argv) {
|
|
|
32
32
|
return options;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
function git(args, cwd = process.cwd()) {
|
|
35
|
+
function git(args, cwd = process.cwd(), input) {
|
|
36
36
|
const env = Object.fromEntries(Object.entries(process.env).filter(([key]) => !key.startsWith('GIT_')));
|
|
37
37
|
if (process.env.GIT_CONFIG_GLOBAL !== undefined) env.GIT_CONFIG_GLOBAL = process.env.GIT_CONFIG_GLOBAL;
|
|
38
38
|
Object.assign(env, {
|
|
@@ -43,6 +43,7 @@ function git(args, cwd = process.cwd()) {
|
|
|
43
43
|
const result = spawnSync('git', ['-c', 'core.fsmonitor=false', '-c', 'core.untrackedCache=false', ...args], {
|
|
44
44
|
cwd,
|
|
45
45
|
encoding: null,
|
|
46
|
+
input,
|
|
46
47
|
shell: false,
|
|
47
48
|
env,
|
|
48
49
|
maxBuffer: 16 * 1024 * 1024,
|
|
@@ -110,6 +111,79 @@ function readAllowPatterns(options) {
|
|
|
110
111
|
});
|
|
111
112
|
}
|
|
112
113
|
|
|
114
|
+
function gitBooleanConfig(repo, key, fallback) {
|
|
115
|
+
const args = ['config', '--bool', '--get', key];
|
|
116
|
+
const result = git(args, repo);
|
|
117
|
+
if (result.status === 1 && !result.stderr.length) return fallback;
|
|
118
|
+
return pathsFrom(result, args)[0]?.trim() === 'true';
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function sparseCheckoutIncludes(repo, files) {
|
|
122
|
+
const args = ['sparse-checkout', 'check-rules', '-z'];
|
|
123
|
+
const input = Buffer.from(`${files.join('\0')}\0`);
|
|
124
|
+
return new Set(pathsFrom(git(args, repo, input), args));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function flaggedWorkingTreeChanges(repo) {
|
|
128
|
+
const args = ['ls-files', '-v', '--stage', '-z'];
|
|
129
|
+
const changes = [];
|
|
130
|
+
const sparseRuleCandidates = [];
|
|
131
|
+
let sparseCheckout;
|
|
132
|
+
for (const entry of pathsFrom(git(args, repo), args)) {
|
|
133
|
+
// Lowercase tags mark assume-unchanged; S/s marks skip-worktree.
|
|
134
|
+
if (!/^[a-zS] /.test(entry)) continue;
|
|
135
|
+
const separator = entry.indexOf('\t');
|
|
136
|
+
const [tag, mode, oid, stage] = entry.slice(0, separator).split(' ');
|
|
137
|
+
if (stage !== '0') continue;
|
|
138
|
+
const file = entry.slice(separator + 1);
|
|
139
|
+
const absolute = path.join(repo, file);
|
|
140
|
+
const stat = fs.lstatSync(absolute, { throwIfNoEntry: false });
|
|
141
|
+
if (!stat) {
|
|
142
|
+
// Skip only paths excluded by the active sparse rules; an in-cone deletion
|
|
143
|
+
// can also carry the skip-worktree bit.
|
|
144
|
+
if (tag.toUpperCase() === 'S'
|
|
145
|
+
&& (sparseCheckout ??= gitBooleanConfig(repo, 'core.sparseCheckout', false))) {
|
|
146
|
+
sparseRuleCandidates.push(file);
|
|
147
|
+
} else {
|
|
148
|
+
changes.push(file);
|
|
149
|
+
}
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
let hashArgs;
|
|
154
|
+
let hashCwd = repo;
|
|
155
|
+
let input;
|
|
156
|
+
if (mode === '160000' && stat.isDirectory()) {
|
|
157
|
+
// An uninitialized submodule has no checked-out commit to compare.
|
|
158
|
+
if (!fs.lstatSync(path.join(absolute, '.git'), { throwIfNoEntry: false })) continue;
|
|
159
|
+
hashArgs = ['rev-parse', '--verify', 'HEAD'];
|
|
160
|
+
hashCwd = absolute;
|
|
161
|
+
} else if (mode === '120000' && stat.isSymbolicLink()) {
|
|
162
|
+
hashArgs = ['hash-object', '--stdin'];
|
|
163
|
+
input = fs.readlinkSync(absolute, { encoding: 'buffer' });
|
|
164
|
+
} else if (mode === '120000' && stat.isFile() && !gitBooleanConfig(repo, 'core.symlinks', true)) {
|
|
165
|
+
// Git can check out a symlink as a plain file containing its target.
|
|
166
|
+
hashArgs = ['hash-object', '--no-filters', '--', file];
|
|
167
|
+
} else if (mode.startsWith('100') && stat.isFile()) {
|
|
168
|
+
// Apply Git's clean filters just as when comparing normal tracked files.
|
|
169
|
+
hashArgs = ['hash-object', `--path=${file}`, '--', file];
|
|
170
|
+
} else {
|
|
171
|
+
changes.push(file);
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
const actual = pathsFrom(git(hashArgs, hashCwd, input), hashArgs)[0]?.trim();
|
|
175
|
+
if (!actual) throw new Error(`could not compare tracked path ${JSON.stringify(file)}`);
|
|
176
|
+
if (actual !== oid) changes.push(file);
|
|
177
|
+
}
|
|
178
|
+
if (sparseRuleCandidates.length) {
|
|
179
|
+
const included = sparseCheckoutIncludes(repo, sparseRuleCandidates);
|
|
180
|
+
for (const file of sparseRuleCandidates) {
|
|
181
|
+
if (included.has(file)) changes.push(file);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return changes;
|
|
185
|
+
}
|
|
186
|
+
|
|
113
187
|
function changedPaths(base, head, includeWorkingTree, repo) {
|
|
114
188
|
const paths = new Set();
|
|
115
189
|
const diffs = [['diff', '--no-ext-diff', '--no-textconv', '--no-renames', '--name-only', '-z', base, head]];
|
|
@@ -123,6 +197,7 @@ function changedPaths(base, head, includeWorkingTree, repo) {
|
|
|
123
197
|
if (includeWorkingTree) {
|
|
124
198
|
const untrackedArgs = ['ls-files', '--others', '--exclude-standard', '-z'];
|
|
125
199
|
for (const file of pathsFrom(git(untrackedArgs, repo), untrackedArgs)) paths.add(file);
|
|
200
|
+
for (const file of flaggedWorkingTreeChanges(repo)) paths.add(file);
|
|
126
201
|
}
|
|
127
202
|
return [...paths].sort();
|
|
128
203
|
}
|
|
@@ -29,7 +29,7 @@ const advisoryInstructions = [
|
|
|
29
29
|
``,
|
|
30
30
|
`## 🤖 COGNITIVE COMPLIANCE`,
|
|
31
31
|
`- **No universal skill pipeline**: do not force every task through TODO/TDD/Fable.`,
|
|
32
|
-
`-
|
|
32
|
+
`- Agent-initiated zoom-out may start at a meaningful signal; productive iterations may continue while they yield new evidence or narrow the cause.`,
|
|
33
33
|
`- **Permission boundaries are separate**: explicit host/user approval for destructive or external actions remains authoritative.`,
|
|
34
34
|
`- **Contract strength**: MUST = required semantic obligation; SHOULD = default with evidence-based exception; MAY = optional optimization. Reminder-only mechanics never downgrade MUST.`,
|
|
35
35
|
`- **Verification is evidence, not a cage**: MUST verify before completion claims; host hooks may remind rather than persistently block.`,
|
|
@@ -153,7 +153,7 @@ function buildCodexGlobalContent() {
|
|
|
153
153
|
`- Do not impose a universal TODO/TDD/Fable sequence; use the smallest useful topology plus applicable skills.`,
|
|
154
154
|
`- MUST verify before declaring done; a reminder-only host mechanism does not make verification optional.`,
|
|
155
155
|
`- Tier-3/Fable broad mutation MUST resolve isolation: verified linked worktree or explicit degraded fallback.`,
|
|
156
|
-
`-
|
|
156
|
+
`- Agent-initiated zoom-out may start at a meaningful signal; productive iterations may continue while they yield new evidence or narrow the cause.`,
|
|
157
157
|
`- Targeted edits SHOULD be preferred; before committing, MUST inspect the staged diff and SHOULD split unrelated concerns.`,
|
|
158
158
|
``
|
|
159
159
|
].join('\n');
|