@agentskit/harness 0.3.0 → 0.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.0] - 2026-09-10
4
+
5
+ - Added phase quality matrices, watchdog classification, and resource telemetry.
6
+ - Added versioned eval and ecosystem compatibility manifests with fail-closed
7
+ evidence handling.
8
+ - Added runnable consumer onboarding, adapter examples, and troubleshooting.
9
+
3
10
  ## [0.3.0] - 2026-09-10
4
11
 
5
12
  - Added portable issue/worktree claims and idempotent dispatch ledger.
package/README.md CHANGED
@@ -6,7 +6,7 @@ docbridge:
6
6
 
7
7
  # @agentskit/harness
8
8
 
9
- Portable, evidence-backed development protocol for coding agents. The harness freezes a human-approved task contract, executes every configured check, binds evidence to the current source revision, detects stale results, and refuses completion without human approval.
9
+ Portable, evidence-backed development protocol for coding agents. The harness freezes a task contract, executes every configured check, binds evidence to the current source revision, detects stale results, and applies the configured controlled or YOLO approval policy.
10
10
 
11
11
  ## Install
12
12
 
@@ -14,6 +14,10 @@ Portable, evidence-backed development protocol for coding agents. The harness fr
14
14
  pnpm add -D @agentskit/harness
15
15
  ```
16
16
 
17
+ New consumers can run [`examples/minimum-profile.mjs`](examples/minimum-profile.mjs)
18
+ after `pnpm build`; the walkthrough is in [`docs/GETTING-STARTED.md`](docs/GETTING-STARTED.md).
19
+ Common gate and runtime failures are documented in [`docs/TROUBLESHOOTING.md`](docs/TROUBLESHOOTING.md).
20
+
17
21
  The package requires Node.js 22 or newer and exposes both `ak-harness` and the common-protocol alias `ak-verify`.
18
22
 
19
23
  ## Workflow
@@ -44,7 +48,7 @@ Endpoint, database, CLI, MCP, and UI checks must declare `execution: "real"`. UI
44
48
 
45
49
  ## API
46
50
 
47
- The public TypeScript API is exported from `src/index.ts` and includes configuration loading, lifecycle operations, state transitions, evidence verification, approvals, cancellation, retries, and task-owned cleanup. Internal modules are not part of the supported API.
51
+ The public TypeScript API is exported from `src/index.ts` and includes configuration loading, lifecycle operations, state transitions, evidence verification, approvals, cancellation, retries, task-owned cleanup, versioned capability manifests, event-envelope validation, deterministic phase execution, and stable error classification. Internal modules are not part of the supported API. The checked-in [capability manifest](./capabilities/public-surface.json) is generated from this entry point; run `pnpm test:capabilities` to detect drift.
48
52
 
49
53
  ## Extensibility
50
54
 
@@ -85,6 +89,29 @@ the current state, so a post-approval edit cannot appear as `COMPLETE`.
85
89
  Concurrent event writers are serialized by an atomic per-run lock and fail
86
90
  closed if the log is busy.
87
91
 
92
+ Structured plans, findings, decisions, repairs, blockers, approvals, and phase
93
+ results can be persisted as provenance-bound `ArtifactEnvelope` records. Each
94
+ artifact has a version, run/issue/source/contract/config/context hashes, a
95
+ content digest, and both JSON and Markdown representations. `FileArtifactStore`
96
+ is idempotent: retrying the same write does not duplicate the event-log record.
97
+ Use `resumeStateFromArtifacts` to rebuild completed phase outputs after an
98
+ interruption, and inspect records with `ak-harness artifacts inspect <path>` or
99
+ `ak-harness artifacts list [run-id]`.
100
+
101
+ The legacy event-log record remains schema version 1 for compatibility. New
102
+ provider-neutral integrations can exchange the schema-versioned v2
103
+ `HarnessEventEnvelope`, which requires event identity, correlation, source
104
+ revision, idempotency, and provenance metadata. `classifyHarnessError` maps
105
+ stable Harness error codes to `retry`, `block`, or `escalate` dispositions.
106
+
107
+ Replaceable integrations use the shared `AdapterMetadata` contract: every
108
+ adapter declares an assurance level (`unverified`, `contract-tested`, or
109
+ `runtime-attested`) and measured/unknown telemetry. Coding agents return
110
+ structured output, diff, usage, timeout/cancellation status, and failure
111
+ classification; Doc Bridge reports relevance and context cost; Orca exposes
112
+ lease/lock/worktree/SHA projections; and tracking adapters deduplicate effects
113
+ by idempotency key (with a dry-run mode).
114
+
88
115
  Each harness event may also carry an optional `correlation` envelope. Its
89
116
  `operationId` is the stable identity used when a lifecycle crosses into
90
117
  AgentsKit, Chat, Doc Bridge, or Code Review; the optional `runId`, `sessionId`,
@@ -123,6 +150,40 @@ contract is frozen:
123
150
 
124
151
  `autonomy: "yolo"` removes the generic final review only after every applicable check passes, tracking is disabled, and the frozen contract has no ambiguity. It never auto-approves a material decision, external tracking, or a tool rule that requires approval.
125
152
 
153
+ The phase executor applies the same rule to a declarative SDLC profile. A profile
154
+ declares dependencies, inputs/outputs, gates, bounded retries, budgets, and an
155
+ effect class (`read`, `write`, or `external`). `safe`, `yolo`, and `dry-run`
156
+ profiles share the engine; only the effect policy changes:
157
+
158
+ ```ts
159
+ const profile = createPhaseProfile({
160
+ id: 'feature', mode: 'yolo',
161
+ phases: [
162
+ { id: 'discover', outputs: ['plan'], effect: 'read' },
163
+ { id: 'implement', inputs: ['plan'], dependsOn: ['discover'], effect: 'write' },
164
+ ],
165
+ })
166
+ const result = await executePhaseProfile(profile, {
167
+ preflight: grillMeAndPreflight,
168
+ handlers: { discover, implement },
169
+ })
170
+ ```
171
+
172
+ Preflight runs for all mutating phases before any effect. Material ambiguities
173
+ are returned as one structured decision packet; dry-run previews mutating phases
174
+ without invoking their handlers. `planPhaseProfile` exposes the deterministic
175
+ route without executing it.
176
+
177
+ `runAdversarialReview` executes independent review lenses with bounded
178
+ concurrency/retries and blocks empty or non-reproducible verdicts. Delivery
179
+ helpers hash-bind the approved PR body/metadata and only emit a QA transition
180
+ after feature validation and G5 acceptance; failed QA returns to verification.
181
+
182
+ `createQualityMatrix` aggregates phase evidence, outcomes, duration, token/cache,
183
+ machine, and concurrency signals into bounded 0–100 dimensions with baseline
184
+ deltas. Missing measurements remain `unknown`; `evaluateWatchdog` emits typed
185
+ budget/resource/contention blockers instead of treating absent data as success.
186
+
126
187
  Use named profiles to make the operational choice explicit:
127
188
 
128
189
  ```json
@@ -242,6 +303,17 @@ in sorted, bounded fan-out/fan-in batches while serializing nodes that share a
242
303
  optional token, memory, cache, and parallelism measurements and refuses
243
304
  incomparable provider/model/configuration bindings.
244
305
 
306
+ `evals/manifest.json` is the versioned evaluation battery. `validateEvalManifest`
307
+ requires contract, deterministic, integration, quality, regression, and
308
+ resource layers plus coverage for every supported component. `runEvalBattery`
309
+ repeats each case and reports min/median/max scores; unknown, stale, critical,
310
+ subjective, or unapproved regression results block the gate.
311
+
312
+ `compatibility/manifest.json` pins the AgentsKit ecosystem revisions and the
313
+ upstream test/eval commands. `assessCompatibility` accepts only complete,
314
+ evidence-bound real-adapter observations and blocks unknown or failed upstream
315
+ results; migration and rollback procedures are kept beside the manifest.
316
+
245
317
  These are seams, not replacements for AgentsKit packages. An integration may
246
318
  adapt `@agentskit/memory` and `@agentskit/eval` into them while keeping the
247
319
  Harness provider-neutral. Missing measurements remain missing; they are never
@@ -524,6 +596,9 @@ Releases are published by `.github/workflows/release-harness.yml` after a merge
524
596
  or require an `NPM_TOKEN`. Configure the npm trusted publisher once for
525
597
  `AgentsKit-io/harness`, workflow `release-harness.yml`, and package
526
598
  `@agentskit/harness`; version changes remain the release trigger.
599
+ The 0.4.0 candidate checklist and explicit blockers live in
600
+ [`release/manifest.json`](release/manifest.json) and
601
+ [`release/notes.md`](release/notes.md).
527
602
 
528
603
  ## License
529
604