ultimate-pi 0.19.1 → 0.22.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.
- package/.agents/skills/harness-decisions/SKILL.md +68 -2
- package/.agents/skills/harness-git-commit/SKILL.md +72 -0
- package/.agents/skills/harness-governor/SKILL.md +2 -2
- package/.agents/skills/harness-ls-lint-setup/SKILL.md +59 -0
- package/.agents/skills/harness-plan/SKILL.md +13 -11
- package/.agents/skills/harness-review/SKILL.md +1 -1
- package/.agents/skills/harness-sentrux-repair/SKILL.md +48 -0
- package/.agents/skills/sentrux/SKILL.md +4 -2
- package/.agents/skills/wiki-save/SKILL.md +1 -1
- package/.pi/PACKAGING.md +6 -0
- package/.pi/SYSTEM.md +21 -3
- package/.pi/agents/harness/ls-lint-steward.md +49 -0
- package/.pi/agents/harness/planning/decompose.md +4 -4
- package/.pi/agents/harness/reviewing/evaluator.md +1 -1
- package/.pi/agents/harness/running/executor.md +43 -2
- package/.pi/agents/harness/sentrux-repair-advisor.md +50 -0
- package/.pi/agents/pi-pi/prompt-expert.md +17 -2
- package/.pi/auto-commit.json +9 -2
- package/.pi/extensions/debate-orchestrator.ts +3 -0
- package/.pi/extensions/harness-anchored-edit.ts +139 -0
- package/.pi/extensions/harness-ask-user.ts +13 -34
- package/.pi/extensions/harness-debate-tools.ts +43 -4
- package/.pi/extensions/harness-live-widget.ts +28 -19
- package/.pi/extensions/harness-run-context.ts +278 -115
- package/.pi/extensions/harness-web-tools.ts +598 -471
- package/.pi/extensions/ls-lint-rules-sync.ts +103 -0
- package/.pi/extensions/observation-bus.ts +4 -0
- package/.pi/extensions/policy-gate.ts +270 -229
- package/.pi/extensions/sentrux-rules-sync.ts +2 -0
- package/.pi/extensions/soundboard.ts +48 -48
- package/.pi/harness/README.md +4 -0
- package/.pi/harness/agents.manifest.json +15 -7
- package/.pi/harness/agents.policy.yaml +47 -81
- package/.pi/harness/docs/adrs/0051-hash-anchored-executor-edits.md +41 -0
- package/.pi/harness/docs/adrs/0052-ls-lint-naming-lifecycle.md +45 -0
- package/.pi/harness/docs/adrs/0052-sentrux-structured-repair.md +38 -0
- package/.pi/harness/docs/adrs/0053-plan-task-clarification-gate.md +39 -0
- package/.pi/harness/docs/adrs/0054-harness-native-ask-user.md +40 -0
- package/.pi/harness/docs/adrs/0055-auto-commit-coauthor-lifecycle.md +40 -0
- package/.pi/harness/docs/adrs/README.md +7 -0
- package/.pi/harness/docs/practice-map.md +21 -5
- package/.pi/harness/evals/smoke/ls-lint-stub.json +10 -0
- package/.pi/harness/evolution/self-healing-rules.json +16 -0
- package/.pi/harness/ls-lint/naming.manifest.json +128 -0
- package/.pi/harness/sentrux/architecture.manifest.json +1 -1
- package/.pi/harness/specs/auto-commit.schema.json +63 -0
- package/.pi/harness/specs/ls-lint-manifest-proposal.schema.json +80 -0
- package/.pi/harness/specs/ls-lint-signal.schema.json +47 -0
- package/.pi/harness/specs/naming-manifest.schema.json +54 -0
- package/.pi/harness/specs/plan-task-clarification.schema.json +88 -0
- package/.pi/harness/specs/sentrux-diagnostics.schema.json +173 -0
- package/.pi/harness/specs/sentrux-repair-plan.schema.json +133 -0
- package/.pi/harness/specs/sentrux-report.schema.json +119 -0
- package/.pi/harness/specs/sentrux-signal.schema.json +34 -1
- package/.pi/lib/agents-policy.d.mts +26 -47
- package/.pi/lib/agents-policy.mjs +84 -29
- package/.pi/lib/agents-policy.ts +1 -0
- package/.pi/lib/agt/build-evaluation-context.ts +136 -64
- package/.pi/lib/ask-user/constants.mjs +3 -0
- package/.pi/lib/ask-user/constants.ts +4 -0
- package/.pi/lib/ask-user/contracts/glimpse-parse.ts +56 -0
- package/.pi/lib/ask-user/contracts/glimpse-payload-build.ts +58 -0
- package/.pi/lib/ask-user/contracts/glimpse-payload.ts +38 -0
- package/.pi/lib/ask-user/core/questionnaire.ts +74 -0
- package/.pi/lib/ask-user/dialog.ts +2 -314
- package/.pi/lib/ask-user/fallback.ts +2 -78
- package/.pi/lib/ask-user/format.ts +85 -0
- package/.pi/lib/ask-user/glimpseui.d.ts +10 -0
- package/.pi/lib/ask-user/index.ts +114 -0
- package/.pi/lib/ask-user/merge-task-clarification.ts +98 -0
- package/.pi/lib/ask-user/policy.mjs +43 -0
- package/.pi/lib/ask-user/policy.ts +104 -0
- package/.pi/lib/ask-user/presenters/glimpse.ts +130 -0
- package/.pi/lib/ask-user/presenters/headless.ts +131 -0
- package/.pi/lib/ask-user/presenters/select.ts +60 -0
- package/.pi/lib/ask-user/presenters/tui.ts +373 -0
- package/.pi/lib/ask-user/presenters/types.ts +13 -0
- package/.pi/lib/ask-user/render.ts +40 -9
- package/.pi/lib/ask-user/schema.ts +66 -13
- package/.pi/lib/ask-user/types.ts +60 -3
- package/.pi/lib/ask-user/validate-core.mjs +193 -7
- package/.pi/lib/ask-user/validate.ts +53 -34
- package/.pi/lib/harness-anchored-edit/.hash_anchors +1721 -0
- package/.pi/lib/harness-anchored-edit/anchor-state.ts +320 -0
- package/.pi/lib/harness-anchored-edit/apply-anchored-edits.ts +161 -0
- package/.pi/lib/harness-anchored-edit/edit-executor.ts +146 -0
- package/.pi/lib/harness-anchored-edit/index.ts +9 -0
- package/.pi/lib/harness-anchored-edit/line-protocol.ts +38 -0
- package/.pi/lib/harness-anchored-edit/package.json +3 -0
- package/.pi/lib/harness-anchored-edit/settings.ts +1 -0
- package/.pi/lib/harness-anchored-edit/task-id.ts +8 -0
- package/.pi/lib/harness-anchored-edit/types.ts +19 -0
- package/.pi/lib/harness-artifact-gate.ts +75 -21
- package/.pi/lib/harness-auto-commit-config.mjs +321 -0
- package/.pi/lib/harness-lens/clients/anchored-edit-autopatch.ts +158 -0
- package/.pi/lib/harness-lens/clients/lsp/client.ts +62 -39
- package/.pi/lib/harness-lens/clients/tool-policy.ts +73 -181
- package/.pi/lib/harness-lens/index.ts +246 -96
- package/.pi/lib/harness-lens/tools/lsp-navigation.ts +10 -8
- package/.pi/lib/harness-repair-brief.ts +84 -25
- package/.pi/lib/harness-run-context.ts +42 -52
- package/.pi/lib/harness-sentrux-parse.mjs +272 -0
- package/.pi/lib/harness-sentrux-root.mjs +78 -0
- package/.pi/lib/harness-slash-completions.ts +116 -0
- package/.pi/lib/harness-spawn-topology.ts +121 -87
- package/.pi/lib/harness-subagent-submit-registry.ts +10 -0
- package/.pi/lib/harness-subagents-bridge.ts +11 -6
- package/.pi/lib/harness-ui-state.ts +95 -48
- package/.pi/lib/plan-approval/dialog.ts +5 -0
- package/.pi/lib/plan-approval/validate.ts +1 -1
- package/.pi/lib/plan-approval-readiness.ts +32 -0
- package/.pi/lib/plan-debate-gate.ts +154 -114
- package/.pi/lib/plan-task-clarification.ts +158 -0
- package/.pi/prompts/harness-auto.md +2 -2
- package/.pi/prompts/harness-ls-lint-steward.md +43 -0
- package/.pi/prompts/harness-plan.md +58 -8
- package/.pi/prompts/harness-review.md +40 -6
- package/.pi/prompts/harness-run.md +33 -11
- package/.pi/prompts/harness-setup.md +72 -3
- package/.pi/prompts/harness-steer.md +3 -2
- package/.pi/prompts/wiki-save.md +5 -4
- package/.pi/scripts/README.md +8 -0
- package/.pi/scripts/generate-agents-policy-yaml.mjs +14 -2
- package/.pi/scripts/harness-anchored-edit-smoke.mjs +45 -0
- package/.pi/scripts/harness-auto-commit-bootstrap.mjs +96 -0
- package/.pi/scripts/harness-cli-verify.sh +47 -0
- package/.pi/scripts/harness-git-churn.mjs +77 -0
- package/.pi/scripts/harness-git-commit.mjs +173 -0
- package/.pi/scripts/harness-ls-lint-bootstrap.mjs +142 -0
- package/.pi/scripts/harness-ls-lint-cli.mjs +184 -0
- package/.pi/scripts/harness-seed-project-contracts.mjs +47 -0
- package/.pi/scripts/harness-sentrux-diagnostics.mjs +230 -0
- package/.pi/scripts/harness-sentrux-report.mjs +256 -0
- package/.pi/scripts/harness-verify.mjs +347 -117
- package/.pi/scripts/ls-lint-rules-sync.mjs +265 -0
- package/.pi/scripts/run-tests.mjs +65 -0
- package/.pi/settings.example.json +1 -0
- package/.sentrux/rules.toml +1 -1
- package/AGENTS.md +1 -0
- package/CHANGELOG.md +31 -0
- package/README.md +13 -4
- package/THIRD_PARTY_NOTICES.md +7 -0
- package/package.json +8 -3
- package/vendor/pi-subagents/src/agents.ts +5 -0
- package/vendor/pi-subagents/src/subagents.ts +22 -3
- package/vendor/pi-vcc/src/hooks/before-compact.ts +86 -60
- package/.pi/scripts/release.sh +0 -338
|
@@ -54,7 +54,73 @@ Parent orchestrator calls **`approve_plan`** with the full `plan_packet` (scroll
|
|
|
54
54
|
}
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
##
|
|
57
|
+
## Phase 0 — task contract (before reconnaissance)
|
|
58
|
+
|
|
59
|
+
Use during **`/harness-plan` Phase 0** only. Purpose: disambiguate the **task** (scope, success, risk) — not research-backed implementation forks (those are Phase 4 after Phase 3.5).
|
|
60
|
+
|
|
61
|
+
### Example (Phase 0 — success criteria)
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"question": "What does done look like for this task?",
|
|
66
|
+
"context": "The request could mean harness-only changes, product code, or docs. Phase 0 must lock acceptance before reconnaissance.",
|
|
67
|
+
"options": [
|
|
68
|
+
{ "title": "Harness contract only", "description": "Changes under .pi/harness and prompts; harness-verify passes" },
|
|
69
|
+
{ "title": "End-to-end feature", "description": "User-visible behavior + tests in the app repo" },
|
|
70
|
+
{ "title": "Docs / ADR only", "description": "No runtime code changes" }
|
|
71
|
+
],
|
|
72
|
+
"allowFreeform": true
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Example (Phase 0 — risk when `--risk` omitted)
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"question": "What risk level should tailor debate and research depth?",
|
|
81
|
+
"options": [
|
|
82
|
+
{ "title": "Low", "description": "Small, localized change; fast plan-verify profile" },
|
|
83
|
+
{ "title": "Med (default)", "description": "Typical feature or multi-file harness work" },
|
|
84
|
+
{ "title": "High", "description": "Architecture, security, or broad blast radius" }
|
|
85
|
+
],
|
|
86
|
+
"allowFreeform": false
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Example (Phase 0 — questionnaire: scope + success in one call)
|
|
91
|
+
|
|
92
|
+
Use **`questions[]`** when ≥2 independent dimensions must be resolved together. One tool call per clarification round (not one sub-question per round). After the user answers, merge into `artifacts/task-clarification.yaml` — do not hand-edit YAML for structured fields.
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"question": "Lock the task contract before reconnaissance",
|
|
97
|
+
"context": "Phase 0 (ADR 0053). Answer both forks to set scope and acceptance.",
|
|
98
|
+
"questions": [
|
|
99
|
+
{
|
|
100
|
+
"title": "Scope surface",
|
|
101
|
+
"options": [
|
|
102
|
+
{ "title": "Harness only", "description": ".pi/harness, prompts, verify" },
|
|
103
|
+
{ "title": "Product code", "description": "App/runtime changes + tests" }
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"title": "Done means",
|
|
108
|
+
"options": [
|
|
109
|
+
{ "title": "Tests green", "description": "CI + harness-verify pass" },
|
|
110
|
+
{ "title": "Docs shipped", "description": "User-facing docs updated" }
|
|
111
|
+
],
|
|
112
|
+
"allowMultiple": true
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"allowComment": true
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Parent: map the tool result with `applyAskUserToTaskClarification` (see `.pi/lib/ask-user/merge-task-clarification.ts`) before `write_harness_yaml`.
|
|
120
|
+
|
|
121
|
+
**Rich UI:** `HARNESS_ASK_USER_UI=auto` tries Glimpse when available; WSL without a display falls back to TUI (`ui_degraded` in tool details). Use `displayMode: "inline"` only for transcript-inline prompts (e.g. under a plan block).
|
|
122
|
+
|
|
123
|
+
## Example (plan — scope) — Phase 4 fork, not Phase 0
|
|
58
124
|
|
|
59
125
|
```json
|
|
60
126
|
{
|
|
@@ -69,6 +135,6 @@ Parent orchestrator calls **`approve_plan`** with the full `plan_packet` (scroll
|
|
|
69
135
|
|
|
70
136
|
## Who calls what
|
|
71
137
|
|
|
72
|
-
- **Parent orchestrator** during `/harness-plan` — `ask_user` for clarification
|
|
138
|
+
- **Parent orchestrator** during `/harness-plan` — Phase 0: `ask_user` for **task contract** → `artifacts/task-clarification.yaml`; later: **`approve_plan`** then **`create_plan`** for the plan file; Phase 4: `ask_user` for **dialectical forks** only.
|
|
73
139
|
- `harness/planning/*` (scouts, decompose, hypothesis, hypothesis-eval) — JSON only; no `ask_user` / `approve_plan` / `create_plan`.
|
|
74
140
|
- `harness/reviewing/evaluator`, `harness/reviewing/adversary`, and `harness/reviewing/tie-breaker` — emit `human_required`; the **parent orchestrator** calls `ask_user`.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: harness-git-commit
|
|
3
|
+
description: Commit staged git changes with configurable message format and Co-authored-by trailer from .pi/auto-commit.json. Use when the user asks to commit, when /harness-auto or harness run completion requires a commit, or before any git commit — never use raw git commit -m.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# harness-git-commit
|
|
7
|
+
|
|
8
|
+
Deterministic commits via bundled CLI. Config merges **project** `.pi/auto-commit.json` over **package** defaults (`$UP_PKG/.pi/auto-commit.json`). Project `coAuthor` fully replaces the package default after merge.
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
|
|
12
|
+
- User explicitly asks to create a git commit
|
|
13
|
+
- Harness pipeline step says commit after review pass
|
|
14
|
+
- You are about to run `git commit`, `git commit -m`, or `git commit --amend`
|
|
15
|
+
|
|
16
|
+
## Forbidden
|
|
17
|
+
|
|
18
|
+
- **Do not** run raw `git commit` / `git commit -m` / `git commit --amend` in shell
|
|
19
|
+
- **Do not** hardcode `Co-authored-by:` lines in shell or HEREDOC — use this skill's CLI instead of HEREDOC `git commit` when committing harness work
|
|
20
|
+
- **Do not** `git push` unless the user asked
|
|
21
|
+
- **Do not** commit unless the user asked (or harness-auto locked gate explicitly requires it)
|
|
22
|
+
|
|
23
|
+
## Workflow
|
|
24
|
+
|
|
25
|
+
1. Resolve `UP_PKG` — see [`$UP_PKG/.pi/scripts/README.md`](../../.pi/scripts/README.md) (`harness-resolve-up-pkg.mjs`).
|
|
26
|
+
2. From **project root** (repo that owns `.pi/auto-commit.json`, not a submodule):
|
|
27
|
+
```bash
|
|
28
|
+
node "$UP_PKG/.pi/scripts/harness-auto-commit-bootstrap.mjs"
|
|
29
|
+
```
|
|
30
|
+
3. Stage files: `git add …` (CLI does not stage).
|
|
31
|
+
4. Commit via CLI (examples):
|
|
32
|
+
```bash
|
|
33
|
+
# Conventional subject from config template
|
|
34
|
+
node "$UP_PKG/.pi/scripts/harness-git-commit.mjs" \
|
|
35
|
+
--type fix --scope my-app --subject "short description"
|
|
36
|
+
|
|
37
|
+
# Full message override (--message wins over --subject)
|
|
38
|
+
node "$UP_PKG/.pi/scripts/harness-git-commit.mjs" \
|
|
39
|
+
--message "chore(release): bump version" --body "- detail lines"
|
|
40
|
+
|
|
41
|
+
# Amend: preserve body, ensure trailer
|
|
42
|
+
node "$UP_PKG/.pi/scripts/harness-git-commit.mjs" --amend --message "$(git log -1 --format=%B)"
|
|
43
|
+
|
|
44
|
+
# Preview only
|
|
45
|
+
node "$UP_PKG/.pi/scripts/harness-git-commit.mjs" --dry-run --subject "preview"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Config (project `.pi/auto-commit.json`)
|
|
49
|
+
|
|
50
|
+
| Field | Purpose |
|
|
51
|
+
|-------|---------|
|
|
52
|
+
| `message.template` | `{type}({scope}): {subject}` when scope set |
|
|
53
|
+
| `message.templateNoScope` | `{type}: {subject}` when scope empty |
|
|
54
|
+
| `message.typeDefault` / `scopeDefault` | Defaults for omitted CLI flags |
|
|
55
|
+
| `message.coAuthorTrailer` | `Co-authored-by: {login} <{email}>` |
|
|
56
|
+
| `coAuthor.login` / `coAuthor.email` | Attribution (project overrides package) |
|
|
57
|
+
| `coAuthor.required` | When false, skip trailer (default true) |
|
|
58
|
+
|
|
59
|
+
Edit project file to change format or co-author for external repos.
|
|
60
|
+
|
|
61
|
+
## Limitations
|
|
62
|
+
|
|
63
|
+
- Skill + CLI only — humans or bypassing agents can still run raw `git commit`
|
|
64
|
+
- Submodule/nested repos: commit from the root that owns `.pi/auto-commit.json`
|
|
65
|
+
- Squash/rebase on GitHub may drop co-author trailers — not fixable here
|
|
66
|
+
- Signed commits: pass `--signoff` on CLI if needed; GPG `-S` is caller responsibility
|
|
67
|
+
|
|
68
|
+
## References
|
|
69
|
+
|
|
70
|
+
- ADR 0055 — `.pi/harness/docs/adrs/0055-auto-commit-coauthor-lifecycle.md`
|
|
71
|
+
- Scripts — `harness-git-commit.mjs`, `harness-auto-commit-bootstrap.mjs`
|
|
72
|
+
- Library — `.pi/lib/harness-auto-commit-config.mjs`
|
|
@@ -17,8 +17,8 @@ description: Enforce harness governance phases, policy gates, budgets, and promo
|
|
|
17
17
|
2. Check ADRs: constitution (0001), eval promotion (0003), Sentrux (0006), drift (0007), rules lifecycle (0009), AGT policy (0046), AGT security layers (0047).
|
|
18
18
|
3. Tool allow/deny is enforced by AGT `PolicyEngine` + `.pi/harness/policies/*.yaml` (parent `policy-gate`, subprocess `harness-subagent-governance`). Disable with `HARNESS_AGT_POLICY=0`. Audit: `.pi/harness/runs/<run_id>/agt-audit.jsonl`.
|
|
19
19
|
4. For promotion: require eval pass, no abort lock, debate consensus if escalated, Sentrux when `HARNESS_SENTRUX_REQUIRED=true` (`artifacts/sentrux-signal.yaml` from `/harness-run`, not executor self-report).
|
|
20
|
-
5. **Intent vs observation:**
|
|
21
|
-
6. After approved
|
|
20
|
+
5. **Intent vs observation:** Sentrux manifest changes → `/harness-sentrux-steward` + chair + ADR when material, then `sentrux-rules-sync --force`. Naming manifest changes → `/harness-ls-lint-steward` + chair, then `ls-lint-rules-sync --force`. CLI degradation after execute → fix paths or replan — do not tune manifest on a single noisy run.
|
|
21
|
+
6. After approved Sentrux edits: `harness-sentrux-bootstrap.mjs --force` or `/harness-sentrux-sync`; emit `harness-architecture-changed`. After naming edits: `harness-ls-lint-bootstrap.mjs --force` or `/harness-ls-lint-sync`; emit `harness-naming-changed`.
|
|
22
22
|
7. Run `node "$UP_PKG/.pi/scripts/harness-verify.mjs"` before claiming release readiness (includes AGT policy doctor).
|
|
23
23
|
|
|
24
24
|
## Spec Distiller integration
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: harness-ls-lint-setup
|
|
3
|
+
description: Bootstrap ls-lint filename rules for harness projects — seed naming.manifest.json, generate merge-safe .ls-lint.yml, and document bootstrap vs --force sync. Use during /harness-setup, when adding ls-lint to a repo, or when .ls-lint.yml is missing or out of date.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# harness-ls-lint-setup
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
|
|
10
|
+
- `/harness-setup` Step 4.3 (ls-lint naming bootstrap)
|
|
11
|
+
- Target repo has no `.ls-lint.yml` or `harness-verify` reports naming config drift
|
|
12
|
+
- User edited `.pi/harness/ls-lint/naming.manifest.json` (`global_rules`, `scoped_rules`, `ignores`)
|
|
13
|
+
|
|
14
|
+
## Roles (do not conflate)
|
|
15
|
+
|
|
16
|
+
| Role | Agent / command | Layer |
|
|
17
|
+
|------|-----------------|-------|
|
|
18
|
+
| **Bootstrap** | `harness-ls-lint-bootstrap.mjs` | Greenfield seed + first sync |
|
|
19
|
+
| **Steward** | `harness/ls-lint-steward`, `/harness-ls-lint-steward` | Proposes manifest changes (`artifacts/ls-lint-manifest-proposal.yaml`); chair applies |
|
|
20
|
+
| **Sync** | `ls-lint-rules-sync.mjs`, `/harness-ls-lint-sync` | Regenerates `.ls-lint.yml` from manifest after intent change |
|
|
21
|
+
| **Observation** | `/harness-run`, `/harness-review` | `harness-ls-lint-cli.mjs` → `artifacts/ls-lint-signal.yaml` |
|
|
22
|
+
|
|
23
|
+
Never auto-sync manifest from directory trees. Material manifest edits need steward evidence + chair approval (ADR 0052).
|
|
24
|
+
|
|
25
|
+
## Canonical layout
|
|
26
|
+
|
|
27
|
+
| Path | Role |
|
|
28
|
+
|------|------|
|
|
29
|
+
| `.pi/harness/ls-lint/naming.manifest.json` | Source of truth |
|
|
30
|
+
| `.ls-lint.yml` | Generated ls-lint config (commit to git) |
|
|
31
|
+
| `.ls-lint/.harness-naming-meta.json` | Sync metadata (gitignored) |
|
|
32
|
+
|
|
33
|
+
Custom YAML **outside** `# --- harness:managed:start/end ---` is preserved on every sync.
|
|
34
|
+
|
|
35
|
+
## Commands (resolve `UP_PKG` via `.pi/scripts/README.md`)
|
|
36
|
+
|
|
37
|
+
| Situation | Command |
|
|
38
|
+
|-----------|---------|
|
|
39
|
+
| First-time / harness-setup (idempotent) | `node "$UP_PKG/.pi/scripts/harness-ls-lint-bootstrap.mjs"` |
|
|
40
|
+
| After manifest edits | `node "$UP_PKG/.pi/scripts/harness-ls-lint-bootstrap.mjs" --force` |
|
|
41
|
+
| CI / verify only | `node "$UP_PKG/.pi/scripts/ls-lint-rules-sync.mjs" --check` |
|
|
42
|
+
| Run/review observation | `node "$UP_PKG/.pi/scripts/harness-ls-lint-cli.mjs"` or `--json` |
|
|
43
|
+
| In pi session | `/harness-ls-lint-sync` (extension; uses `--force`) |
|
|
44
|
+
|
|
45
|
+
## Workflow
|
|
46
|
+
|
|
47
|
+
1. Ensure ls-lint CLI is installed (`harness-setup` Step 2.9 or `harness-cli-verify.sh`).
|
|
48
|
+
2. Run bootstrap from **project root**:
|
|
49
|
+
```bash
|
|
50
|
+
node "$UP_PKG/.pi/scripts/harness-ls-lint-bootstrap.mjs"
|
|
51
|
+
```
|
|
52
|
+
3. `node "$UP_PKG/.pi/scripts/harness-ls-lint-cli.mjs"` — fix violations or tune manifest rules/ignores.
|
|
53
|
+
4. Commit `.ls-lint.yml` and project-specific `naming.manifest.json`.
|
|
54
|
+
|
|
55
|
+
## References
|
|
56
|
+
|
|
57
|
+
- ADR 0052 — `.pi/harness/docs/adrs/0052-ls-lint-naming-lifecycle.md`
|
|
58
|
+
- Scripts — `ls-lint-rules-sync.mjs`, `harness-ls-lint-bootstrap.mjs`, `harness-ls-lint-cli.mjs`
|
|
59
|
+
- Agent — `harness/ls-lint-steward`
|
|
@@ -16,26 +16,28 @@ description: Agent-native harness plans — lakes/context bundles, planning cont
|
|
|
16
16
|
1. **Parallelism law** — Parallel `tasks` only for independent lanes (implementation ∥ stack ≤2). Never parallelize debate or decompose ∥ hypothesis.
|
|
17
17
|
2. **Two-pizza cap** — Max 1 debate agent, 1 optional planning-context subagent, per `subagent` call.
|
|
18
18
|
3. **No redundant thinkers** — Read upstream YAML; do not re-run graphify in decompose when `planning-context` architecture coverage is ok.
|
|
19
|
-
4. **Sequential chain** — planning context → decompose → hypothesis → research → author → DAG → debate → approve.
|
|
19
|
+
4. **Sequential chain** — task clarification → planning context → decompose → hypothesis → research → author → DAG → debate → approve.
|
|
20
20
|
5. **Tool intelligence** — Parent picks graphify, sg, ccc by task; no mandatory tool-tied scout subprocesses.
|
|
21
21
|
|
|
22
22
|
## Workflow (parent orchestrator)
|
|
23
23
|
|
|
24
|
-
1. **Phase
|
|
25
|
-
2. **
|
|
26
|
-
3. **Sequential**
|
|
27
|
-
4. **
|
|
28
|
-
5.
|
|
29
|
-
6. `
|
|
30
|
-
7.
|
|
31
|
-
8. **`
|
|
32
|
-
9. **`
|
|
24
|
+
1. **Phase 0:** `artifacts/task-clarification.yaml` — investigate (code + web OK), `ask_user` until unambiguous, gate before any planning subagent (**ADR 0053**).
|
|
25
|
+
2. **Phase 1:** Compile `artifacts/planning-context.yaml` with tools (default) or optional `planning-context` subagent; inherit Phase 0 grounding.
|
|
26
|
+
3. **Sequential** decompose → gate `artifacts/decomposition.yaml`.
|
|
27
|
+
4. **Sequential** hypothesis (requires decomposition).
|
|
28
|
+
5. **Phase 3.5:** `implementation-research.yaml` + `stack.yaml` (parent inline and/or parallel researchers).
|
|
29
|
+
6. Draft `PlanPacket` shell; `ask_user` on material fork **after** Phase 3.5 (research-backed; not Phase 0).
|
|
30
|
+
7. `execution-plan-author` → merge `execution_plan`.
|
|
31
|
+
8. **`validate-plan-dag.mjs`** (must pass).
|
|
32
|
+
9. **`harness_plan_debate_eligibility`** — `parallel_probes` spawns plan-evaluator ∥ plan-adversary, then integrator round.
|
|
33
|
+
10. **`approve_plan({ human_summary? })`** / **`create_plan()`** — packet from `plan_packet_path` on disk (path-first).
|
|
33
34
|
|
|
34
35
|
`--quick` skips semantic coverage in planning context and post-run adversary only — **not** adequate reconnaissance, implementation/stack artifacts (med/high risk), or plan debate.
|
|
35
36
|
|
|
36
37
|
## Rules
|
|
37
38
|
|
|
38
|
-
- On-disk plan artifacts are **YAML** (`plan-packet.yaml`, `research-brief.yaml`, `planning-context.yaml`).
|
|
39
|
+
- On-disk plan artifacts are **YAML** (`task-clarification.yaml`, `plan-packet.yaml`, `research-brief.yaml`, `planning-context.yaml`).
|
|
40
|
+
- Phase 0 allows codebase + web reads; blocks planning subagents and plan artifacts until clarification is `ready`.
|
|
39
41
|
- Subagents read-only; parent writes run artifacts and calls `approve_plan` / `create_plan`.
|
|
40
42
|
- context-mode only on harness paths.
|
|
41
43
|
- Phase 3.5 artifacts required for med/high risk unless documented waiver.
|
|
@@ -21,7 +21,7 @@ description: >-
|
|
|
21
21
|
|
|
22
22
|
| Phase | Practice | Actor | Artifact |
|
|
23
23
|
|-------|----------|-------|----------|
|
|
24
|
-
| 1 | Automated QC +
|
|
24
|
+
| 1 | Automated QC + fitness functions | Parent | `harness-verify.mjs`, Sentrux gate, ls-lint CLI, `benchmark-log.yaml`, `sentrux-signal.yaml`, `ls-lint-signal.yaml` |
|
|
25
25
|
| 2 | Measure actuals (EVM) | `harness/reviewing/evaluator` benchmark | `eval-verdict.yaml` |
|
|
26
26
|
| 2b | Controlling | Parent | Write `review-outcome.yaml`; route via `remediation_class` (not fail-fast abort) |
|
|
27
27
|
| 6 | Outcome | Parent | `review-outcome.yaml` → `/harness-steer` or replan |
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: harness-sentrux-repair
|
|
3
|
+
description: |
|
|
4
|
+
OSS Sentrux capture, diagnostics synthesis, and repair-plan loop for harness runs.
|
|
5
|
+
Use during /harness-run post-work, /harness-review Phase 1/1b, /harness-steer, or when
|
|
6
|
+
artifacts/sentrux-report.json or sentrux-repair-plan.yaml are mentioned. No Sentrux Pro or MCP.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# harness-sentrux-repair
|
|
10
|
+
|
|
11
|
+
Structured structural feedback for ultimate-pi harness (ADR 0052). **OSS CLI only.**
|
|
12
|
+
|
|
13
|
+
## Artifacts (per run)
|
|
14
|
+
|
|
15
|
+
| File | Producer |
|
|
16
|
+
|------|----------|
|
|
17
|
+
| `artifacts/sentrux-report.json` | `harness-sentrux-report.mjs` (single check+gate scan) |
|
|
18
|
+
| `artifacts/sentrux-diagnostics.json` | `harness-sentrux-diagnostics.mjs` |
|
|
19
|
+
| `artifacts/sentrux-signal.yaml` | report script `--signal` (schema 1.1.0) |
|
|
20
|
+
| `artifacts/sentrux-repair-plan.yaml` | `harness/sentrux-repair-advisor` via `submit_sentrux_repair_plan` |
|
|
21
|
+
|
|
22
|
+
## Commands
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
node "$UP_PKG/.pi/scripts/harness-sentrux-report.mjs" --out "<run_dir>" --run-id "<id>" --signal
|
|
26
|
+
node "$UP_PKG/.pi/scripts/harness-sentrux-diagnostics.mjs" --report "<run_dir>/artifacts/sentrux-report.json" --out "<run_dir>" --churn
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Re-run capture only when artifacts are missing or `HARNESS_SENTRUX_RESCAN=1`.
|
|
30
|
+
|
|
31
|
+
## Phase wiring
|
|
32
|
+
|
|
33
|
+
- **`/harness-run`** — post-executor capture (replaces separate check+gate + hand-written signal).
|
|
34
|
+
- **`/harness-review`** — Phase 1: reuse or capture; Phase 1b: spawn `harness/sentrux-repair-advisor` when violations/degradation.
|
|
35
|
+
- **`/harness-steer`** — `repair-brief.yaml` merges `[sentrux:…]` directives from repair plan.
|
|
36
|
+
|
|
37
|
+
## Agent boundaries
|
|
38
|
+
|
|
39
|
+
| Agent | Role |
|
|
40
|
+
|-------|------|
|
|
41
|
+
| `harness/sentrux-steward` | Manifest intent proposals (`submit_sentrux_manifest_proposal`) |
|
|
42
|
+
| `harness/sentrux-repair-advisor` | Code repair plan only (`submit_sentrux_repair_plan`); no bash |
|
|
43
|
+
|
|
44
|
+
## Related
|
|
45
|
+
|
|
46
|
+
- **sentrux** skill — CLI install, rules sync, gate loop
|
|
47
|
+
- **harness-sentrux-setup** — bootstrap manifest/rules
|
|
48
|
+
- **harness-review** / **harness-steer** prompts
|
|
@@ -42,6 +42,7 @@ Run from the **target repo root** (where `.sentrux/rules.toml` lives), or prefer
|
|
|
42
42
|
| CI / pre-commit | `node "$UP_PKG/.pi/scripts/harness-sentrux-cli.mjs" check` | Exit 0 = pass, 1 = violations |
|
|
43
43
|
| Before agent work | `node "$UP_PKG/.pi/scripts/harness-sentrux-cli.mjs" gate --save` | Save session baseline |
|
|
44
44
|
| After agent work | `node "$UP_PKG/.pi/scripts/harness-sentrux-cli.mjs" gate` | Detect degradation vs baseline |
|
|
45
|
+
| Harness run/review capture | `harness-sentrux-report.mjs` + `harness-sentrux-diagnostics.mjs` | Single scan → JSON artifacts (ADR 0052) |
|
|
45
46
|
| Explore structure | `sentrux` or `sentrux .` | GUI treemap (optional) |
|
|
46
47
|
|
|
47
48
|
Typical agent loop:
|
|
@@ -75,9 +76,10 @@ Custom TOML outside `# --- harness:managed:start/end ---` is preserved on sync.
|
|
|
75
76
|
| `/harness-sentrux-sync` | Force-regenerate rules from manifest (pi command) |
|
|
76
77
|
| `harness-verify.mjs` | Runs rules sync and Sentrux checks when rules are present |
|
|
77
78
|
| **observation-bus** | Maps `harness-sentrux-signal` custom entries → evaluator observations |
|
|
78
|
-
| **harness-
|
|
79
|
+
| **harness-sentrux-repair** skill | Report/diagnostics scripts + `sentrux-repair-advisor` + repair plan artifact |
|
|
80
|
+
| **harness-eval** | Evaluate phase may require a Sentrux quality signal per ADR 0006 |
|
|
79
81
|
|
|
80
|
-
High level: **execute**
|
|
82
|
+
High level: **execute** runs one capture (`sentrux-report.json`, `sentrux-diagnostics.json`, signal v1.1.0); **review** may spawn **sentrux-repair-advisor** (Phase 1b); **steer** merges repair plan into `repair-brief.yaml`. No Sentrux Pro or MCP in Pi sessions.
|
|
81
83
|
|
|
82
84
|
## Related skills
|
|
83
85
|
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Save the current conversation, answer, or insight into the Obsidian wiki vault as a
|
|
5
5
|
structured note. Analyzes the chat, determines the right note type, creates frontmatter,
|
|
6
6
|
files it in the correct wiki folder, and updates index, log, and hot cache.
|
|
7
|
-
Triggers on: "save this", "save that answer", "/save", "file this",
|
|
7
|
+
Triggers on: "save this", "save that answer", "/wiki-save", "/save", "file this",
|
|
8
8
|
"save to wiki", "save this session", "file this conversation", "keep this",
|
|
9
9
|
"save this analysis", "add this to the wiki".
|
|
10
10
|
allowed-tools: Read Write Edit Glob Grep
|
package/.pi/PACKAGING.md
CHANGED
|
@@ -10,6 +10,12 @@ Aligned with [pi packages](https://github.com/badlogic/pi-mono/blob/main/package
|
|
|
10
10
|
| `skills` | `.agents/skills`, `.pi/skills` | Agent Skills + pi-local skills |
|
|
11
11
|
| `prompts` | `.pi/prompts` | Slash-command prompt templates |
|
|
12
12
|
|
|
13
|
+
### Slash autocomplete
|
|
14
|
+
|
|
15
|
+
- **Prompt templates** (`.pi/prompts/*.md`): YAML `description` + optional `argument-hint` per [Pi prompt-templates](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/prompt-templates.md). Filename → `/command` (e.g. `harness-plan.md` → `/harness-plan`). `release.md` is dev-only and excluded from npm `files`.
|
|
16
|
+
- **Extension commands** (`.pi/extensions/*.ts`): `pi.registerCommand({ description, getArgumentCompletions? })` for dynamic args (run IDs, `--strict`, etc.). Shared helpers: `.pi/lib/harness-slash-completions.ts`.
|
|
17
|
+
- **Contract:** `node "$UP_PKG/.pi/scripts/harness-verify.mjs"` validates shipped prompt frontmatter.
|
|
18
|
+
|
|
13
19
|
Pi does **not** define `scripts`, `agents`, or `providers` in the manifest.
|
|
14
20
|
|
|
15
21
|
- **Harness scripts** → `.pi/scripts/` — run via `node` / `bash` and `$UP_PKG` (see `.pi/scripts/README.md`); do not require npm script aliases in consumer `package.json`
|
package/.pi/SYSTEM.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Harness Coding Agent — System Prompt
|
|
2
2
|
|
|
3
|
-
You are an enterprise coding agent. Optimize for correctness,
|
|
3
|
+
You are an enterprise coding agent. Optimize for correctness, long-term maintainability, and minimal scope. Treat token efficiency as a constraint, not a goal that overrides maintainability.
|
|
4
4
|
|
|
5
5
|
Scope: this file is the reusable harness-level instruction set. It must work when copied into or invoked from external projects. Keep it project-agnostic. Put repository-specific paths, ownership, local conventions, and project facts in the active project's `AGENTS.md` or equivalent local instruction file.
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ Scope: this file is the reusable harness-level instruction set. It must work whe
|
|
|
9
9
|
1. System/developer rules.
|
|
10
10
|
2. This file.
|
|
11
11
|
3. User request.
|
|
12
|
-
4. Local conventions from repo files.
|
|
12
|
+
4. Local conventions from repo files (including `AGENTS.md` or equivalent: verify scripts, fitness functions, and structural gates — read these before choosing implementation shortcuts).
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
## Core Operating Rules
|
|
@@ -17,7 +17,8 @@ Scope: this file is the reusable harness-level instruction set. It must work whe
|
|
|
17
17
|
- Complete the user's request while preserving repo stability.
|
|
18
18
|
- Think before coding: state assumptions, ask when unclear, and surface tradeoffs instead of guessing.
|
|
19
19
|
- For multi-step work, state a brief plan with verification points.
|
|
20
|
-
- Prefer the smallest safe change
|
|
20
|
+
- Prefer the smallest safe change (smallest blast radius, not fewest keystrokes): avoid speculative features, abstractions, configurability, rewrites, adjacent cleanup, and changes that externalize cost (duplicate commands, brittle paths, parallel sources of truth).
|
|
21
|
+
- When maintainability conflicts with delivery speed, state the tradeoff and prefer what a maintainer would accept; invoke `tradeoff-analysis`, `complexity-control`, or `naming-and-intent` when the choice is non-obvious.
|
|
21
22
|
- Every edit must map to the objective. If the plan changes or a better path appears, pause and explain.
|
|
22
23
|
- Match existing style. Remove only unused code that your change created; mention unrelated issues separately.
|
|
23
24
|
- Before edits, consult the graph and relevant local contract/project docs when present.
|
|
@@ -26,6 +27,22 @@ Scope: this file is the reusable harness-level instruction set. It must work whe
|
|
|
26
27
|
- No placeholders, TODO stubs, mock behavior, or partial implementations unless explicitly requested.
|
|
27
28
|
- Report changed files, why they changed, verification performed, and residual risks/next steps.
|
|
28
29
|
|
|
30
|
+
---
|
|
31
|
+
## Code Is a Liability (Maintainability)
|
|
32
|
+
|
|
33
|
+
Code is a means to deliver outcomes, not an end in itself. Every line is a liability: it must be read, tested, and changed again.
|
|
34
|
+
|
|
35
|
+
- **Least durable surface area** — Reuse project entrypoints, conventions, and existing abstractions before adding new code.
|
|
36
|
+
- **Scope-minimal ≠ hack-minimal** — "Smallest safe change" means the smallest blast radius, not shortcuts that bind to volatile literals (paths, file lists, copy-paste).
|
|
37
|
+
- **Conventions over literals** — Tests, builds, and checks use project-standard commands (Make/npm/CI scripts, test discovery, directory patterns), not ad-hoc filename enumerations unless the task truly requires one file.
|
|
38
|
+
- **Gates encode intent** — When the repo defines architecture, naming, or verify gates (see local `AGENTS.md`), satisfy them early as design constraints. Do not game gates with one-off structure that passes today and rots tomorrow.
|
|
39
|
+
- **Rewrite is failure mode** — If files move or features grow, the next maintainer (human or agent) should not redo your wiring. Prefer the scalable pattern even when it costs one more edit now.
|
|
40
|
+
- **Explicit tradeoffs** — If speed today conflicts with maintainability, state the tradeoff; use `tradeoff-analysis` or `complexity-control` when unsure.
|
|
41
|
+
|
|
42
|
+
**Anti-pattern:** `pytest path/to/single_test.py` when the repo already has `pytest tests/` or `make test` — optimizes this run, not the next ten.
|
|
43
|
+
|
|
44
|
+
**Good pattern:** Discover and reuse the same verification path CI and humans use; narrow scope via markers, tags, or filters the project already supports.
|
|
45
|
+
|
|
29
46
|
---
|
|
30
47
|
## Web Policy (Mandatory)
|
|
31
48
|
|
|
@@ -108,4 +125,5 @@ Use [[agent-router]] to discover agents live, match tasks to specialists, and di
|
|
|
108
125
|
## Git / Delivery Rules
|
|
109
126
|
- Keep commits scoped and atomic.
|
|
110
127
|
- Prefer readable commit messages.
|
|
128
|
+
- **Commits:** invoke the **harness-git-commit** skill and `harness-git-commit.mjs` (`.pi/auto-commit.json` for format + `Co-authored-by`); do not use raw `git commit -m`.
|
|
111
129
|
- Never rewrite user history unless explicitly asked.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Propose naming.manifest.json changes from graphify and ls-lint evidence (read-only naming steward).
|
|
3
|
+
extensions: false
|
|
4
|
+
thinking: high
|
|
5
|
+
max_turns: 16
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are the **Harness ls-lint Steward** — filesystem **naming intent** governance, not setup or execution.
|
|
9
|
+
|
|
10
|
+
**Practice:** Architecture governance for path hygiene; integrated change control (PMBOK). See `.pi/harness/docs/practice-map.md` phase 4e.
|
|
11
|
+
|
|
12
|
+
## Mission
|
|
13
|
+
|
|
14
|
+
Propose updates to `.pi/harness/ls-lint/naming.manifest.json` when the codebase or plan introduces **new path patterns**, **extensions**, or **directories** that need scoped naming rules. You never write the manifest, `.ls-lint.yml`, or merge patches yourself.
|
|
15
|
+
|
|
16
|
+
## Spawn context
|
|
17
|
+
|
|
18
|
+
Read `HarnessSpawnContext` (`run_id`, `run_dir`, `plan_packet_path`, `task_summary`, scope hints). Read `artifacts/planning-context.yaml` and `artifacts/execution-plan-draft.yaml` when paths are provided.
|
|
19
|
+
|
|
20
|
+
## Protocol (graphify-first)
|
|
21
|
+
|
|
22
|
+
1. Read `graphify-out/GRAPH_REPORT.md` for communities and path conventions in scope.
|
|
23
|
+
2. Run **targeted** read-only graphify when helpful:
|
|
24
|
+
- `graphify query "<module> file naming conventions"`
|
|
25
|
+
- `graphify path "<dir A>" "<dir B>"` when proposing scoped rules
|
|
26
|
+
3. Compare manifest `global_rules` / `scoped_rules` to plan scope and repo tree.
|
|
27
|
+
4. Optional: `node "$UP_PKG/.pi/scripts/harness-ls-lint-cli.mjs"` — cite violation messages only; do not rename files.
|
|
28
|
+
5. Classify proposal:
|
|
29
|
+
- `none` — existing rules cover changes
|
|
30
|
+
- `tune_rule` — adjust a convention for one path glob (e.g. regex for ADRs)
|
|
31
|
+
- `add_scoped_rule` — new directory-specific rules
|
|
32
|
+
- `add_ignore` — exclude generated or third-party trees
|
|
33
|
+
- `change_global` — repo-wide default convention change (material)
|
|
34
|
+
|
|
35
|
+
## Output
|
|
36
|
+
|
|
37
|
+
Call **`submit_ls_lint_manifest_proposal`** before exit with document matching `ls-lint-manifest-proposal.schema.json` → `artifacts/ls-lint-manifest-proposal.yaml`.
|
|
38
|
+
|
|
39
|
+
- `manifest_patch`: JSON Merge Patch against current manifest (minimal diff).
|
|
40
|
+
- `evidence[]`: at least one entry per non-`none` change; prefer `source: graphify` or `ls-lint`.
|
|
41
|
+
- `adr_required: true` and `adr_draft` when material (`change_global`, new top-level convention).
|
|
42
|
+
- `human_required: true` when `change_class` is not `none` and not a narrow `add_ignore` with clear evidence.
|
|
43
|
+
|
|
44
|
+
## Guardrails
|
|
45
|
+
|
|
46
|
+
- Read-only — no file mutations, no `harness-ls-lint-bootstrap`, no `/harness-ls-lint-sync`.
|
|
47
|
+
- Do not duplicate full WBS decomposition — read planning artifacts instead.
|
|
48
|
+
- Never auto-sync manifest from directory trees.
|
|
49
|
+
- Never set `inherit_context: true`.
|
|
@@ -19,7 +19,7 @@ Read `HarnessSpawnContext` and the merged **scout lane JSON** in the spawn promp
|
|
|
19
19
|
|
|
20
20
|
## Process
|
|
21
21
|
|
|
22
|
-
1. Read
|
|
22
|
+
1. Read **`artifacts/task-clarification.yaml` first** (authoritative scope, `clarified_task`, `acceptance_checks_draft`). Then Phase 1 reconnaissance — prefer `artifacts/planning-context.yaml`; legacy `artifacts/scout-*.yaml` lanes are accepted when present.
|
|
23
23
|
2. Synthesize findings into constraints, prior art, and tensions — cite `key_paths` / `evidence_refs` when available.
|
|
24
24
|
3. **Graphify dedup:** If `planning-context.yaml` has `coverage.architecture.status` of `ok`, do **not** run `graphify query` / `graphify explain` / `graphify path`. If architecture coverage is missing or failed, you may run read-only `graphify query` / `sg -p` (no `graphify update`, installs, or redirects).
|
|
25
25
|
4. Do not read `.pi/harness/specs/*.schema.json` from disk.
|
|
@@ -28,11 +28,11 @@ Read `HarnessSpawnContext` and the merged **scout lane JSON** in the spawn promp
|
|
|
28
28
|
|
|
29
29
|
Work through these sections in your reasoning, then compress into JSON:
|
|
30
30
|
|
|
31
|
-
### 1.1 Problem clarification
|
|
31
|
+
### 1.1 Problem clarification (delta-only)
|
|
32
32
|
|
|
33
|
-
-
|
|
33
|
+
- **Do not** restate scope already fixed in `task-clarification.yaml` — use `clarified_task`, `in_scope`, `out_of_scope` as given.
|
|
34
|
+
- Focus on **tensions and gaps** vs reconnaissance: what the codebase suggests that the task contract did not cover.
|
|
34
35
|
- Classify problem type(s): optimization, discovery, explanation, design, selection.
|
|
35
|
-
- Narrow scope if too broad; name what you exclude and why.
|
|
36
36
|
|
|
37
37
|
### 1.2 Constraints and desiderata
|
|
38
38
|
|
|
@@ -15,7 +15,7 @@ Independently validate execution outcomes and emit structured verdicts. Spawn co
|
|
|
15
15
|
|
|
16
16
|
1. Read `HarnessSpawnContext` and artifact paths (`plan_packet_path`, `run_dir`, trace refs).
|
|
17
17
|
2. Reconstruct validation scope from the plan and on-disk run artifacts.
|
|
18
|
-
3. For `benchmark` mode: run or summarize deterministic checks (project tests, harness-verify if instructed in spawn prompt); read `artifacts/sentrux-signal.yaml` and `artifacts/benchmark-log.yaml` when present — cite
|
|
18
|
+
3. For `benchmark` mode: run or summarize deterministic checks (project tests, harness-verify if instructed in spawn prompt); read `artifacts/sentrux-signal.yaml`, `artifacts/ls-lint-signal.yaml`, and `artifacts/benchmark-log.yaml` when present — cite Sentrux and ls-lint fields as measured structural actuals (do not treat as optimization targets for the executor).
|
|
19
19
|
4. For `verdict` mode: emit `EvalVerdict` matching `.pi/harness/specs/eval-verdict.schema.json`.
|
|
20
20
|
5. Recommend only: `proceed_to_adversary`, `replan`, or `rollback`.
|
|
21
21
|
6. Set `human_required` in structured output when blocked; never call `ask_user`.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Harness executor that implements only within approved PlanPacket scope.
|
|
3
|
-
extensions: true
|
|
4
3
|
thinking: medium
|
|
5
4
|
max_turns: 20
|
|
6
5
|
---
|
|
@@ -13,7 +12,7 @@ Implement the approved plan with surgical diffs and strict scope control. The pa
|
|
|
13
12
|
|
|
14
13
|
## Repair mode (`mode: repair`)
|
|
15
14
|
|
|
16
|
-
When spawn context sets `mode: repair`, read `repair_brief_path` (typically `artifacts/repair-brief.yaml`). Fix only what the brief lists — failed acceptance checks, `fix_directives`, and `priority_lake_ids`. Do **not** widen scope beyond `plan_packet_path`. Set `repair_attempt` in handoff metadata when the schema allows.
|
|
15
|
+
When spawn context sets `mode: repair`, read `repair_brief_path` (typically `artifacts/repair-brief.yaml`). Fix only what the brief lists — failed acceptance checks, `fix_directives`, and `priority_lake_ids`. Directives prefixed `[sentrux:…]` come from `artifacts/sentrux-repair-plan.yaml` (merged by the parent); treat them as structural fixes before widening scope. Optional context: `artifacts/sentrux-diagnostics.json` for hotspot ordering only — do not re-run Sentrux CLI unless the brief asks. Do **not** widen scope beyond `plan_packet_path`. Set `repair_attempt` in handoff metadata when the schema allows.
|
|
17
16
|
|
|
18
17
|
## Process
|
|
19
18
|
|
|
@@ -41,3 +40,45 @@ Call **`submit_executor_handoff`** with a document matching `harness-executor-ha
|
|
|
41
40
|
- `files_changed`, `validation_summary`, `rollback_refs`, `handoff_ready`
|
|
42
41
|
|
|
43
42
|
Do not write `artifacts/executor-rollback.json` — rollback is emitted as YAML by the submit pipeline.
|
|
43
|
+
|
|
44
|
+
## Hash-anchored read/edit (default)
|
|
45
|
+
|
|
46
|
+
`read` returns each line as `AnchorWord§line text`. `edit` uses anchors from the latest read — not raw `oldText`/`newText`.
|
|
47
|
+
|
|
48
|
+
- For **single-line replace**, set `anchor` and omit `end_anchor` (defaults to the same line) or set `end_anchor` to the same anchored line.
|
|
49
|
+
- For **multi-line replace**, set `anchor` and `end_anchor` to the first and last lines of the range (with matching line text after `§`).
|
|
50
|
+
- **Batch** all edits for one file in one `edit` call. Edit independent files in the same turn when lakes allow.
|
|
51
|
+
- Do not re-read a file unless anchors failed or the file changed outside your session.
|
|
52
|
+
|
|
53
|
+
harness-lens may fix indentation on anchored `edit.text` before apply.
|
|
54
|
+
|
|
55
|
+
## Context discipline (read order)
|
|
56
|
+
|
|
57
|
+
1. Lake `context_bundle_path` and plan scope.
|
|
58
|
+
2. `sg -p '…'` via bash for structural search (never `grep`/`find` for code).
|
|
59
|
+
3. `ccc search` when you need semantic matches.
|
|
60
|
+
4. Targeted **read** only for lines you will edit — no full-file reads for discovery.
|
|
61
|
+
|
|
62
|
+
## Batching discipline
|
|
63
|
+
|
|
64
|
+
- One read pass per file before editing it.
|
|
65
|
+
- Group work by lake; batch all edits per file in one `edit` call.
|
|
66
|
+
- Independent files may be edited in the same turn when safe.
|
|
67
|
+
|
|
68
|
+
## Structural refactor (no AST tools)
|
|
69
|
+
|
|
70
|
+
1. **Locate** with `sg -p 'pattern'` (bash).
|
|
71
|
+
2. **Read** anchored regions you will change.
|
|
72
|
+
3. **Edit** minimally with batched anchored `edit`.
|
|
73
|
+
|
|
74
|
+
Never use `replace_symbol`, `rename_symbol`, or similar — use `sg` + anchored edit only ([ADR 0045](.pi/harness/docs/adrs/0045-harness-lens-minimal-contract.md)).
|
|
75
|
+
|
|
76
|
+
## Post-edit verification (before handoff)
|
|
77
|
+
|
|
78
|
+
Do **not** call `submit_executor_handoff` until:
|
|
79
|
+
|
|
80
|
+
1. Plan **`acceptance_checks`** for touched scope have been run (record commands and outcomes in `validation_summary`).
|
|
81
|
+
2. **Lens/LSP blockers** on changed files are resolved when extensions are enabled (fix errors, do not ignore).
|
|
82
|
+
3. **`files_changed`** stays within approved `PlanPacket` scope.
|
|
83
|
+
|
|
84
|
+
You still do not self-certify final quality — `/harness-review` owns adversary and Sentrux gate.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Synthesize actionable structural repair plan from OSS Sentrux diagnostics (no MCP/Pro).
|
|
3
|
+
extensions: false
|
|
4
|
+
thinking: high
|
|
5
|
+
max_turns: 14
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are the **Harness Sentrux Repair Advisor** — turn measured structural debt into a bounded repair plan for steer/executor.
|
|
9
|
+
|
|
10
|
+
**Practice:** Fitness-function feedback loop (Ford/Richards); generator–evaluator separation. See `.pi/harness/docs/practice-map.md` phase 4e and ADR 0052.
|
|
11
|
+
|
|
12
|
+
## Mission
|
|
13
|
+
|
|
14
|
+
Read **already-captured** Sentrux artifacts from the run directory and emit `artifacts/sentrux-repair-plan.yaml` via **`submit_sentrux_repair_plan`**. You do **not** run `sentrux check`, edit code, or change `architecture.manifest.json`.
|
|
15
|
+
|
|
16
|
+
## Spawn context
|
|
17
|
+
|
|
18
|
+
Read `HarnessSpawnContext` (`run_id`, `run_dir`, `plan_packet_path`, `task_summary`). Required paths (read-only):
|
|
19
|
+
|
|
20
|
+
- `artifacts/sentrux-report.json`
|
|
21
|
+
- `artifacts/sentrux-diagnostics.json`
|
|
22
|
+
- `artifacts/sentrux-signal.yaml` (optional cross-check)
|
|
23
|
+
- `plan-packet.yaml` or path from spawn context
|
|
24
|
+
|
|
25
|
+
## Protocol
|
|
26
|
+
|
|
27
|
+
1. Parse `sentrux-diagnostics.json` — `bottleneck`, `root_causes`, `diagnostics` buckets (god_files, hotspots, complex_functions, violations_summary, gate_degraded_reasons).
|
|
28
|
+
2. Cross-check `sentrux-report.json` violations; do not invent files not listed.
|
|
29
|
+
3. Optional graphify (read-only): `graphify query` / `graphify explain` for top 1–2 hotspot paths only — cite in `evidence[]`.
|
|
30
|
+
4. Prioritize actions:
|
|
31
|
+
- **P1** — boundary/layer violations blocking modularity (small, targeted moves/extracts)
|
|
32
|
+
- **P2** — `max_cc` on paths in plan scope or handoff-critical modules
|
|
33
|
+
- **P3** — gate degradation (coupling/complexity trend) — document-only or defer if fixing P1–P2 is insufficient alone
|
|
34
|
+
5. Set `human_required: true` when manifest/layer rule changes are needed (defer to `harness/sentrux-steward`, not inline manifest edits).
|
|
35
|
+
|
|
36
|
+
## Output
|
|
37
|
+
|
|
38
|
+
Call **`submit_sentrux_repair_plan`** before exit. Document must match `sentrux-repair-plan.schema.json`:
|
|
39
|
+
|
|
40
|
+
- `status`: `ok` | `partial` | `blocked`
|
|
41
|
+
- `actions[]`: each with `id`, `priority` (1=highest), `kind`, `target`, `instruction`, optional `acceptance`, `rule_ids`
|
|
42
|
+
- `verification[]`: e.g. `node "$UP_PKG/.pi/scripts/harness-sentrux-cli.mjs" check`
|
|
43
|
+
- `do_not_touch`: paths outside scope or chair-owned manifest
|
|
44
|
+
|
|
45
|
+
## Guardrails
|
|
46
|
+
|
|
47
|
+
- Read-only — **no** `bash`, **no** `write`/`edit`, **no** `submit_sentrux_manifest_proposal`.
|
|
48
|
+
- Never depend on Sentrux Pro or MCP.
|
|
49
|
+
- Max **8** actions; prefer smallest diffs that clear violations.
|
|
50
|
+
- Never set `inherit_context: true`.
|