@spences10/pi-harness 0.1.2 → 0.2.1
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/CHANGELOG.md +123 -0
- package/README.md +120 -175
- package/dist/assessment.d.ts +4 -12
- package/dist/assessment.js +19 -192
- package/dist/assessment.js.map +1 -1
- package/dist/enforcement/policy.d.ts +2 -0
- package/dist/enforcement/policy.js +47 -73
- package/dist/enforcement/policy.js.map +1 -1
- package/dist/extension.d.ts +1 -1
- package/dist/extension.js +184 -403
- package/dist/extension.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/prompt.d.ts +1 -1
- package/dist/prompt.js +1 -7
- package/dist/prompt.js.map +1 -1
- package/dist/runtime/baseline.d.ts +6 -0
- package/dist/runtime/baseline.js +145 -0
- package/dist/runtime/baseline.js.map +1 -0
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.js +72 -29
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/outcome.d.ts +1 -2
- package/dist/runtime/outcome.js +21 -35
- package/dist/runtime/outcome.js.map +1 -1
- package/dist/runtime/renderers.js +34 -70
- package/dist/runtime/renderers.js.map +1 -1
- package/dist/runtime/verification.d.ts +15 -0
- package/dist/runtime/verification.js +97 -0
- package/dist/runtime/verification.js.map +1 -0
- package/dist/schema.d.ts +12 -2
- package/dist/schema.js +6 -8
- package/dist/schema.js.map +1 -1
- package/package.json +6 -5
- package/skills/create-harness/SKILL.md +19 -62
- package/skills/execute-harness/SKILL.md +27 -66
- package/skills/review-harness/SKILL.md +21 -54
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# @spences10/pi-harness
|
|
2
|
+
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 725454e: Confirm harness selection and clearing with explicit
|
|
8
|
+
notifications, including repeated clears, and add regression tests.
|
|
9
|
+
- d15e4b8: Ship extension changelogs, announce launcher updates,
|
|
10
|
+
distinguish cost estimates, and display responding models alongside
|
|
11
|
+
requests.
|
|
12
|
+
|
|
13
|
+
## 0.2.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- 20bfa27: Simplify harness creation, fix dirty baselines, and verify
|
|
18
|
+
completion; breaking APIs now require asynchronous updates.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 720eb07: Restore timers, session autonaming, and portable tool
|
|
23
|
+
guidance while preserving native Pi prompt configuration
|
|
24
|
+
compatibility.
|
|
25
|
+
|
|
26
|
+
## 0.1.2
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- b07ea54: Remove tool prompt guidelines that repeated the harness and
|
|
31
|
+
Team Mode system prompt sections, which reduces the default request
|
|
32
|
+
size.
|
|
33
|
+
|
|
34
|
+
## 0.1.1
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- 39fa567: Respect disabled extension defaults and keep harness
|
|
39
|
+
execution separate from experimental Factory workflows by default.
|
|
40
|
+
|
|
41
|
+
## 0.1.0
|
|
42
|
+
|
|
43
|
+
### Minor Changes
|
|
44
|
+
|
|
45
|
+
- fbf0a07: Add evidence-gated pre-harness assessments requiring
|
|
46
|
+
read-only investigation and explicit user approval before execution
|
|
47
|
+
begins safely.
|
|
48
|
+
|
|
49
|
+
## 0.0.11
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- c275674: Refine harness guidance to favor direct workflows for
|
|
54
|
+
bounded work and reserve contracts for risk.
|
|
55
|
+
|
|
56
|
+
## 0.0.10
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- f699c9c: Automatically deactivate terminal harnesses on direct user
|
|
61
|
+
input or session startup, preserving current-turn enforcement
|
|
62
|
+
guarantees.
|
|
63
|
+
|
|
64
|
+
## 0.0.9
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- b2f1fdd: Prevent Codex schema failures by restricting constrained
|
|
69
|
+
sampling to closed tools with fully required parameters.
|
|
70
|
+
|
|
71
|
+
## 0.0.8
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- 5e8460c: Prefer strict JSON Schema sampling for eligible context,
|
|
76
|
+
LSP, harness, Factory, and Team Mode tools.
|
|
77
|
+
- 5389efc: Refine harness lifecycle and selection to prevent
|
|
78
|
+
unnecessary commit scaffolds while preserving runtime enforcement
|
|
79
|
+
boundaries.
|
|
80
|
+
|
|
81
|
+
## 0.0.7
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- c425095: Generate shared README maintenance blocks deterministically
|
|
86
|
+
and validate package documentation links without removing
|
|
87
|
+
package-specific guidance.
|
|
88
|
+
|
|
89
|
+
## 0.0.6
|
|
90
|
+
|
|
91
|
+
### Patch Changes
|
|
92
|
+
|
|
93
|
+
- df03901: Replace explicit any usages with precise shared, inferred,
|
|
94
|
+
and fixture types throughout the monorepo safely.
|
|
95
|
+
|
|
96
|
+
## 0.0.5
|
|
97
|
+
|
|
98
|
+
### Patch Changes
|
|
99
|
+
|
|
100
|
+
- 9c8e205: Separate immutable harness policy from amendable scaffolds,
|
|
101
|
+
adding audited versioning, clearer precedence, and safer
|
|
102
|
+
enforcement.
|
|
103
|
+
|
|
104
|
+
## 0.0.4
|
|
105
|
+
|
|
106
|
+
### Patch Changes
|
|
107
|
+
|
|
108
|
+
- 7cc67f7: Render active harness state compactly in the TUI without
|
|
109
|
+
persistent verbose task summary widget.
|
|
110
|
+
|
|
111
|
+
## 0.0.3
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- ba4ceed: Update team orchestration guidance to prefer shared cwd
|
|
116
|
+
mutation and reserve worktrees for explicit isolation.
|
|
117
|
+
|
|
118
|
+
## 0.0.2
|
|
119
|
+
|
|
120
|
+
### Patch Changes
|
|
121
|
+
|
|
122
|
+
- e8c1bfe: Add pi-harness runtime with task contracts, team execution,
|
|
123
|
+
enforcement, and outcome artifacts.
|
package/README.md
CHANGED
|
@@ -11,18 +11,19 @@
|
|
|
11
11
|
|
|
12
12
|
<!-- package-readme:header:end -->
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
status, and runtime enforcement. Inspired by Ornith's self-scaffolding
|
|
18
|
-
design, the runtime separates an immutable outer policy from a
|
|
19
|
-
versioned, amendable inner scaffold.
|
|
14
|
+
Prompt guidance uses Pi's named system-prompt sections. It coexists
|
|
15
|
+
with user `SYSTEM.md` and `APPEND_SYSTEM.md` files and other
|
|
16
|
+
extensions without replacing the complete prompt.
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
Optional task scaffolding for Pi: a contract, working-state baseline,
|
|
19
|
+
validation scripts, progress log, and reviewable outcome. Pi still
|
|
20
|
+
owns the agent loop, sessions, tools, and permission hooks.
|
|
24
21
|
|
|
25
|
-
|
|
22
|
+
Use direct work for routine changes. Use a harness when the user asks
|
|
23
|
+
for one or a concrete execution contract adds value. Assessment is
|
|
24
|
+
optional advice, not a prerequisite or a read-only security mode.
|
|
25
|
+
|
|
26
|
+
## Install
|
|
26
27
|
|
|
27
28
|
<!-- package-readme:install:start -->
|
|
28
29
|
|
|
@@ -32,181 +33,129 @@ pi install npm:@spences10/pi-harness
|
|
|
32
33
|
|
|
33
34
|
<!-- package-readme:install:end -->
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
## Create and execute
|
|
36
37
|
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
pi install ./packages/pi-harness
|
|
40
|
-
# or for one run only
|
|
41
|
-
pi -e ./packages/pi-harness
|
|
38
|
+
```text
|
|
39
|
+
/harness create <task>
|
|
42
40
|
```
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
`
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- `/harness` command for assess-before-create, run, review, status,
|
|
50
|
-
use, and clear
|
|
51
|
-
- `harness_assess` and `harness_assessment_submit` tools for read-only
|
|
52
|
-
orientation and structured adoption decisions
|
|
53
|
-
- guarded `harness_create` tool that cannot bypass assessment approval
|
|
54
|
-
- `harness_amend` tool for audited, versioned changes to the inner
|
|
55
|
-
scaffold
|
|
56
|
-
- `harness_update` tool for phase/status/evidence logging
|
|
57
|
-
- generated `OUTCOME.md` and `outcome.json` review artifacts
|
|
58
|
-
- dirty-baseline tracking so pre-existing repo changes are reported
|
|
59
|
-
but not treated as task drift
|
|
60
|
-
- worktree-aware validate/review scripts for team-mode executors
|
|
61
|
-
- `harness_read` tool for summaries
|
|
62
|
-
- `before_agent_start` context injection for the active harness
|
|
63
|
-
- `tool_call` enforcement for edit/write paths and forbidden commands
|
|
64
|
-
- compact TUI status for the active harness
|
|
65
|
-
- bundled `create-harness`, `execute-harness`, and `review-harness`
|
|
66
|
-
skills
|
|
67
|
-
|
|
68
|
-
## Runtime layout
|
|
42
|
+
The agent calls `harness_create` with the task and at least one
|
|
43
|
+
accepted validation command. Scope defaults to the project; provide
|
|
44
|
+
`allowed_paths` to narrow it. Normal project test development is
|
|
45
|
+
allowed by default. Set `allow_test_changes: false` only when the task
|
|
46
|
+
explicitly requires protecting those files.
|
|
69
47
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
48
|
+
Creation does not require a separate assessment or approval roundtrip.
|
|
49
|
+
It does not authorize new capabilities, commits, pushes, releases,
|
|
50
|
+
deployments, destructive operations, or peer collaboration beyond the
|
|
51
|
+
user's request.
|
|
52
|
+
|
|
53
|
+
The runtime lives under `/tmp/my-pi-harness-<id>/`:
|
|
54
|
+
|
|
55
|
+
- `harness.json`: accepted maximum scope and checks, plus the
|
|
56
|
+
execution scaffold and amendment history.
|
|
57
|
+
- `TASK.md` and `SYSTEM.md`: task and workflow guidance.
|
|
58
|
+
- `validate.sh` and `review.sh`: manual validation and drift review.
|
|
59
|
+
- `status.json` and `logs/`: progress, executed checks and output.
|
|
60
|
+
- `OUTCOME.md` and `outcome.json`: review artifacts.
|
|
61
|
+
|
|
62
|
+
### Completion means checks ran
|
|
63
|
+
|
|
64
|
+
Request `status: completed` through `harness_update`. The extension
|
|
65
|
+
runs the accepted commands, any additional scaffold checks, and the
|
|
66
|
+
drift guard through Pi's normal nested Bash tool pipeline. Permission
|
|
67
|
+
hooks, cancellation and tool-result handling still apply.
|
|
68
|
+
|
|
69
|
+
Completion requires successful checks against an unchanged contract
|
|
70
|
+
and Git-visible working state. A failure, denied tool, interruption or
|
|
71
|
+
concurrent change cannot become success merely because an agent writes
|
|
72
|
+
“passed”. Results include executed-check records and output-file
|
|
73
|
+
references. Manual evidence strings are self-reported notes, not
|
|
74
|
+
validation proof.
|
|
75
|
+
|
|
76
|
+
Failed checks can be fixed and retried; there is no one-attempt
|
|
77
|
+
escalation rule. Completed runs reject further API amendments and
|
|
78
|
+
status mutations. Their active guard clears on the next direct user
|
|
79
|
+
turn or session startup; do not create another harness just to commit
|
|
80
|
+
already-reviewed work.
|
|
81
|
+
|
|
82
|
+
### Amend strategy, not acceptance
|
|
83
|
+
|
|
84
|
+
`harness_amend` records a versioned strategy change. It cannot remove
|
|
85
|
+
or replace the accepted validation commands or relax an explicit
|
|
86
|
+
no-test-edit restriction. Additional checks are allowed. Scaffold
|
|
87
|
+
scope always intersects the accepted maximum scope, so broadening a
|
|
88
|
+
strategy does not grant access outside the contract.
|
|
89
|
+
|
|
90
|
+
A genuinely larger task needs user authorization and a new contract,
|
|
91
|
+
not an executor-authored relaxation of its own acceptance criteria.
|
|
92
|
+
|
|
93
|
+
### Baseline and worktrees
|
|
94
|
+
|
|
95
|
+
Dirty files are fingerprinted without changing the working tree, HEAD
|
|
96
|
+
or Git index. Later content, index, mode, symlink, deletion and rename
|
|
97
|
+
changes remain visible, including initially untracked files. Only
|
|
98
|
+
fingerprints are saved, not file contents.
|
|
83
99
|
|
|
84
|
-
|
|
100
|
+
A baseline belongs to the workspace where it was captured. Linked
|
|
101
|
+
worktrees use their own Git state, without another workspace's dirty
|
|
102
|
+
file exemptions. Run manual scripts from the execution worktree or set
|
|
103
|
+
`HARNESS_CWD`. Completion uses the current Pi execution directory and
|
|
104
|
+
rejects unrelated repositories.
|
|
105
|
+
|
|
106
|
+
### Optional assessment
|
|
107
|
+
|
|
108
|
+
`/assess <task>`, `harness_assess` and `harness_assessment_submit`
|
|
109
|
+
record evidence, existing primitives and a recommendation. Tools,
|
|
110
|
+
native codemode, discovery and MCP remain available. This is advisory
|
|
111
|
+
investigation: it does not enforce read-only access or add an approval
|
|
112
|
+
queue. Normal user authorization still applies.
|
|
113
|
+
|
|
114
|
+
## Commands and tools
|
|
85
115
|
|
|
86
116
|
```text
|
|
87
|
-
/assess <task>
|
|
88
|
-
/assess status
|
|
89
|
-
/assess approve [harness|direct]
|
|
90
|
-
/assess reject
|
|
91
|
-
/assess clear
|
|
92
117
|
/harness create <task>
|
|
93
|
-
/harness run
|
|
94
|
-
/harness review
|
|
118
|
+
/harness run [dir]
|
|
119
|
+
/harness review [dir]
|
|
95
120
|
/harness status [dir]
|
|
96
121
|
/harness use <dir>
|
|
97
122
|
/harness clear
|
|
123
|
+
/assess <task>
|
|
124
|
+
/assess status
|
|
125
|
+
/assess clear
|
|
98
126
|
```
|
|
99
127
|
|
|
100
|
-
`/
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
`harness_create` without approval, the extension blocks the call and
|
|
113
|
-
starts assessment. This backstop does not detect an agent that
|
|
114
|
-
misclassifies a task and never asks for harness machinery.
|
|
115
|
-
|
|
116
|
-
Use assessment when a task may benefit from an enforceable execution
|
|
117
|
-
contract because it has material risk, unresolved scope, destructive
|
|
118
|
-
effects, or complex coordination. Use the normal direct workflow for
|
|
119
|
-
bounded, low-risk changes that standard validation can verify, such as
|
|
120
|
-
documentation and copy edits, focused single-file fixes, configuration
|
|
121
|
-
or metadata updates, test expectation changes, formatting, and
|
|
122
|
-
reviewed commit or push follow-ups. A simple ambiguity may need only a
|
|
123
|
-
clarifying question. Broad uncertain refactors, migrations,
|
|
124
|
-
deployments, risky releases, external side effects, and explicit user
|
|
125
|
-
requests are good assessment candidates.
|
|
126
|
-
|
|
127
|
-
Assessment snapshots the current tool set, keeps an explicit read-only
|
|
128
|
-
research subset active, and filters Bash through a strict
|
|
129
|
-
single-command allowlist. Unknown and mutating custom tools are
|
|
130
|
-
withheld. This is a workflow guard, not an operating-system sandbox.
|
|
131
|
-
In print and JSON modes, an assessment can be submitted but remains
|
|
132
|
-
waiting because direct approval cannot be inferred. RPC clients can
|
|
133
|
-
answer Pi's extension UI request, or send `/assess approve ...` as an
|
|
134
|
-
explicit command.
|
|
135
|
-
|
|
136
|
-
`harness.json` contains two deliberately different layers:
|
|
137
|
-
|
|
138
|
-
- `policy`: runtime-owned workspace and verifier protections such as
|
|
139
|
-
cwd, forbidden paths/commands, available tools, and the dirty
|
|
140
|
-
baseline. Executors cannot weaken these through amendments.
|
|
141
|
-
- `scaffold`: the model's task interpretation and execution strategy,
|
|
142
|
-
including allowed paths, validation, test policy, and model roles.
|
|
143
|
-
It is subordinate to system, developer, and current user
|
|
144
|
-
instructions and can be revised with `harness_amend`.
|
|
145
|
-
|
|
146
|
-
Every scaffold amendment increments its version, records its reason
|
|
147
|
-
and requester, regenerates runtime prompts/scripts, and appends an
|
|
148
|
-
audit event. A harness enforcement block reports a contract mismatch;
|
|
149
|
-
it is not a platform-policy refusal. When a harness is active, the TUI
|
|
150
|
-
shows a compact footer/status indicator; use `/harness status [dir]`
|
|
151
|
-
or `harness_read` for the full contract, task, validation, and outcome
|
|
152
|
-
details.
|
|
153
|
-
|
|
154
|
-
A terminal `completed` or `failed` status seals the run and keeps
|
|
155
|
-
enforcement active for the remainder of the current turn, so an
|
|
156
|
-
executor cannot escape the outer policy by declaring its own work
|
|
157
|
-
complete. The extension automatically deactivates that terminal
|
|
158
|
-
harness on the next direct user turn or when the session starts again.
|
|
159
|
-
Extension-injected messages do not trigger cleanup. Use
|
|
160
|
-
`/harness clear` only to abandon a non-terminal run. Clearing or
|
|
161
|
-
deleting a harness affects only its `/tmp` control state; repository
|
|
162
|
-
changes remain in the working tree. Do not create a new harness merely
|
|
163
|
-
to commit or push already-reviewed work. A risky release, deployment,
|
|
164
|
-
migration, or destructive operation can still justify a dedicated
|
|
165
|
-
harness when explicitly requested or warranted by its actual risk.
|
|
166
|
-
|
|
167
|
-
Harnesses snapshot dirty files at creation time. Review and outcome
|
|
168
|
-
artifacts focus on changes after that baseline, while still recording
|
|
169
|
-
baseline files in `outcome.json`. If a team-mode executor runs in a
|
|
170
|
-
linked git worktree, run `review.sh` from that worktree or set
|
|
171
|
-
`HARNESS_CWD` so validation, guard checks, and outcome collection use
|
|
172
|
-
the executor workspace.
|
|
173
|
-
|
|
174
|
-
## Assessment and harness loops
|
|
175
|
-
|
|
176
|
-
Assessment happens before harness creation:
|
|
177
|
-
|
|
178
|
-
1. Read-only context recovery
|
|
179
|
-
2. Source-of-truth and existing-primitive capture
|
|
180
|
-
3. Assumption challenge and rejected options
|
|
181
|
-
4. Smallest vertical slice
|
|
182
|
-
5. Structured recommendation
|
|
183
|
-
6. Direct user adoption decision
|
|
184
|
-
|
|
185
|
-
An approved harness then runs:
|
|
186
|
-
|
|
187
|
-
1. Contract recovery
|
|
188
|
-
2. Surgical execution
|
|
189
|
-
3. Validation evidence
|
|
190
|
-
4. Drift review
|
|
191
|
-
5. OUTCOME.md/outcome.json review
|
|
192
|
-
6. Delta/risk report
|
|
193
|
-
|
|
194
|
-
Use `harness_amend` for bounded inner-scaffold changes. A new
|
|
195
|
-
capability or architecture decision requires assessment; an approved
|
|
196
|
-
harness recommendation can then amend the active scaffold.
|
|
197
|
-
Outer-policy expansion requires a separate execution contract instead
|
|
198
|
-
of silent scope growth.
|
|
199
|
-
|
|
200
|
-
## Using from a custom harness
|
|
201
|
-
|
|
202
|
-
```ts
|
|
203
|
-
import harness from '@spences10/pi-harness';
|
|
204
|
-
|
|
205
|
-
// pass `harness` as an ExtensionFactory to your Pi runtime
|
|
206
|
-
```
|
|
128
|
+
`/harness use <dir>` confirms the selected harness directory.
|
|
129
|
+
`/harness clear` confirms when the active harness is cleared, or
|
|
130
|
+
reports that there is no active harness to clear.
|
|
131
|
+
|
|
132
|
+
Tools: `harness_create`, `harness_amend`, `harness_update`,
|
|
133
|
+
`harness_read`, `harness_assess`, `harness_assessment_submit`.
|
|
134
|
+
|
|
135
|
+
Execution is direct by default. Team Mode can coordinate independently
|
|
136
|
+
opened peers only when the user authorizes collaboration. This package
|
|
137
|
+
does not spawn or supervise workers.
|
|
138
|
+
|
|
139
|
+
## Safety and compatibility
|
|
207
140
|
|
|
208
|
-
|
|
209
|
-
|
|
141
|
+
This is workflow scaffolding, **not an OS sandbox**. Direct edit/write
|
|
142
|
+
hooks and final Git drift checks enforce the accepted paths through
|
|
143
|
+
those interfaces. Shell commands and other tools retain the host
|
|
144
|
+
user's permissions and can modify control files; the runtime is not a
|
|
145
|
+
security boundary against hostile code. Use OS/container isolation for
|
|
146
|
+
that threat model. Explicit `forbidden_commands` are optional
|
|
147
|
+
substring checks, not a general shell parser.
|
|
148
|
+
|
|
149
|
+
Existing temporary runtimes keep old generated scripts: recreate them
|
|
150
|
+
before relying on these changes. Contracts without accepted checks and
|
|
151
|
+
scope cannot complete or amend through the current API.
|
|
152
|
+
|
|
153
|
+
For programmatic consumers, `create_harness_runtime` now requires
|
|
154
|
+
`validation_commands`. `update_harness_runtime` is asynchronous;
|
|
155
|
+
completion requires a trusted `HarnessVerificationOptions.run` backend
|
|
156
|
+
that executes the supplied commands in the supplied cwd and respects
|
|
157
|
+
the signal. The extension supplies this through Pi's tool pipeline.
|
|
158
|
+
Removed assessment-locking helpers are no longer exported.
|
|
210
159
|
|
|
211
160
|
## Development
|
|
212
161
|
|
|
@@ -215,7 +164,3 @@ pnpm --filter @spences10/pi-harness run check
|
|
|
215
164
|
pnpm --filter @spences10/pi-harness run test
|
|
216
165
|
pnpm --filter @spences10/pi-harness run build
|
|
217
166
|
```
|
|
218
|
-
|
|
219
|
-
## License
|
|
220
|
-
|
|
221
|
-
MIT
|
package/dist/assessment.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare const harness_assessment_submit_params_schema: Type.TObject<{
|
|
|
16
16
|
cwd: Type.TOptional<Type.TString>;
|
|
17
17
|
allowed_paths: Type.TOptional<Type.TArray<Type.TString>>;
|
|
18
18
|
forbidden_paths: Type.TOptional<Type.TArray<Type.TString>>;
|
|
19
|
-
validation_commands: Type.
|
|
19
|
+
validation_commands: Type.TArray<Type.TString>;
|
|
20
20
|
forbidden_commands: Type.TOptional<Type.TArray<Type.TString>>;
|
|
21
21
|
allow_test_changes: Type.TOptional<Type.TBoolean>;
|
|
22
22
|
escalation_rules: Type.TOptional<Type.TArray<Type.TString>>;
|
|
@@ -32,7 +32,7 @@ export type HarnessAssessParams = Static<typeof harness_assess_params_schema>;
|
|
|
32
32
|
export type HarnessAssessmentRecord = Static<typeof harness_assessment_submit_params_schema>;
|
|
33
33
|
export type HarnessAssessmentRecommendation = HarnessAssessmentRecord['recommendation'];
|
|
34
34
|
export type HarnessAssessmentSource = 'agent' | 'user' | 'harness-create';
|
|
35
|
-
export type HarnessAssessmentStatus = 'assessing' | 'awaiting_approval' | 'approved' | 'rejected';
|
|
35
|
+
export type HarnessAssessmentStatus = 'assessing' | 'assessed' | 'awaiting_approval' | 'approved' | 'rejected';
|
|
36
36
|
export interface HarnessAssessmentState {
|
|
37
37
|
id: string;
|
|
38
38
|
version: number;
|
|
@@ -40,20 +40,12 @@ export interface HarnessAssessmentState {
|
|
|
40
40
|
task: string;
|
|
41
41
|
source: HarnessAssessmentSource;
|
|
42
42
|
started_at: string;
|
|
43
|
-
tools_before_assessment
|
|
43
|
+
tools_before_assessment?: string[];
|
|
44
44
|
record?: HarnessAssessmentRecord;
|
|
45
45
|
decision?: HarnessAssessmentRecommendation;
|
|
46
46
|
}
|
|
47
|
-
export declare function create_assessment_state(task: string, source: HarnessAssessmentSource, tools_before_assessment
|
|
47
|
+
export declare function create_assessment_state(task: string, source: HarnessAssessmentSource, tools_before_assessment?: string[], now?: Date): HarnessAssessmentState;
|
|
48
48
|
export declare function submit_assessment_record(state: HarnessAssessmentState, record: HarnessAssessmentRecord): HarnessAssessmentState;
|
|
49
49
|
export declare function assessment_active(state: HarnessAssessmentState | undefined): boolean;
|
|
50
|
-
export declare function assessment_tool_names(active_tool_names: string[]): string[];
|
|
51
|
-
export declare function is_assessment_tool_allowed(tool_name: string): boolean;
|
|
52
|
-
export declare function check_assessment_command(command: string): {
|
|
53
|
-
ok: true;
|
|
54
|
-
} | {
|
|
55
|
-
ok: false;
|
|
56
|
-
reason: string;
|
|
57
|
-
};
|
|
58
50
|
export declare function assessment_context(state: HarnessAssessmentState): string;
|
|
59
51
|
export declare function format_assessment_record(state: HarnessAssessmentState): string;
|