@agentskit/harness 0.1.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +33 -32
  2. package/CONTRIBUTING.md +60 -12
  3. package/MANIFESTO.md +23 -0
  4. package/README.md +276 -144
  5. package/capabilities/public-surface.json +668 -0
  6. package/compatibility/manifest.json +17 -0
  7. package/compatibility/migration.md +10 -0
  8. package/compatibility/report.json +23 -0
  9. package/compatibility/report.md +22 -0
  10. package/compatibility/rollback.md +8 -0
  11. package/dist/cli.js +958 -239
  12. package/dist/cli.js.map +1 -1
  13. package/dist/index.d.ts +1338 -122
  14. package/dist/index.js +2273 -353
  15. package/dist/index.js.map +1 -1
  16. package/docs/ADR-0025-portable-orchestration-controls.md +27 -0
  17. package/docs/ADR-0026-kernel-adapters-boundary.md +82 -0
  18. package/docs/GETTING-STARTED.md +18 -0
  19. package/docs/MODULE-BOUNDARIES.md +143 -0
  20. package/docs/ORGANIZATION.md +46 -0
  21. package/docs/TROUBLESHOOTING.md +24 -0
  22. package/examples/minimum-profile.mjs +27 -0
  23. package/package.json +52 -34
  24. package/release/manifest.json +14 -0
  25. package/release/notes.md +10 -0
  26. package/release/qualification.json +14 -0
  27. package/docs/ADR-0025-ci-dogfood.md +0 -22
  28. package/docs/ADR-0026-ci-evidence-artifact.md +0 -22
  29. package/docs/ADR-0027-portable-evidence.md +0 -19
  30. package/docs/ADR-0028-effective-metrics.md +0 -20
  31. package/docs/ADR-0029-honest-ci-preparation.md +0 -20
  32. package/docs/ADR-0030-agentskit-os-benchmark-bridge.md +0 -20
  33. package/docs/ADR-0031-real-provider-baseline.md +0 -18
  34. package/docs/ADR-0032-harness-equivalent-benchmark.md +0 -25
  35. package/docs/ADR-0033-portable-agent-gate.md +0 -25
  36. package/docs/ADR-0034-measurement-quality-gates.md +0 -25
  37. package/docs/ADR-0035-reproducible-benchmark-samples.md +0 -20
  38. package/docs/ADR-0036-comparable-baseline-samples.md +0 -20
  39. package/docs/ADR-0037-replicated-baseline-collection.md +0 -27
  40. package/docs/ADR-0038-end-to-end-benchmark-boundary.md +0 -28
  41. package/docs/ADR-0039-artifact-and-protocol-metrics.md +0 -39
  42. package/docs/ADR-0040-benchmark-corpus-surfaces.md +0 -32
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
+ ---
2
+ docbridge:
3
+ covers:
4
+ - package:@agentskit/harness
5
+ ---
6
+
1
7
  # @agentskit/harness
2
8
 
3
- 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.
4
10
 
5
11
  ## Install
6
12
 
@@ -8,6 +14,10 @@ Portable, evidence-backed development protocol for coding agents. The harness fr
8
14
  pnpm add -D @agentskit/harness
9
15
  ```
10
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
+
11
21
  The package requires Node.js 22 or newer and exposes both `ak-harness` and the common-protocol alias `ak-verify`.
12
22
 
13
23
  ## Workflow
@@ -24,79 +34,7 @@ ak-harness benchmark --manifest benchmarks/harness-phase-0.json --json
24
34
 
25
35
  `plan` rejects unresolved ambiguities and unauthorized dirty worktrees. After `start`, the contract is frozen. Any source, configuration, or contract change invalidates evidence and moves the run to `STALE`. A human can cancel an active run; retrying a blocked, stale, or cancelled run marks the previous run `SUPERSEDED`.
26
36
 
27
- Automated CI may prepare a run with `ak-harness plan prepared --by ci`. This records a CI preparation, never a human approval; the run remains unable to become `COMPLETE` until a human approves the verified result.
28
-
29
- ## External coding benchmark bridge
30
-
31
- The harness validates a provenance-bearing task manifest and the JSON report
32
- emitted by an external coding benchmark, including AgentsKit OS:
33
-
34
- ```bash
35
- AGENTSKIT_OS_ROOT=/path/to/agentskit-os \
36
- AGENTSKIT_OS_BENCHMARK_REPORT=/path/to/report.json \
37
- node scripts/verify-harness-agentskit-os-benchmark.mjs \
38
- --manifest benchmarks/agentskit-os-phase-28.json \
39
- --target "$AGENTSKIT_OS_ROOT" \
40
- --report "$AGENTSKIT_OS_BENCHMARK_REPORT"
41
- ```
42
-
43
- The bridge checks the pinned source revision, task definition, prompt digests,
44
- scope, and provider report shape. Provider status and heuristic scores remain
45
- observations: they do not grant human acceptance. With no controlled baseline,
46
- improvement is reported as unavailable rather than inferred.
47
-
48
- The phase-45 corpus adds explicit task surfaces and keeps the task definition
49
- bound to the real AgentsKit OS fixture. It covers logic, CLI, and documentation
50
- surfaces; the added CLI task executes compact, pretty, and invalid-input paths,
51
- while the documentation task checks the API contract and its reproducible test
52
- command:
53
-
54
- ```bash
55
- node scripts/verify-harness-agentskit-os-benchmark.mjs \
56
- --manifest benchmarks/agentskit-os-phase-45.json \
57
- --target /path/to/agentskit-os \
58
- --require-surface-coverage logic,cli,docs
59
- ```
60
-
61
- Corpus coverage is a readiness gate, not a performance claim. Live provider
62
- samples and human approval remain required before the expanded tasks become
63
- comparable benchmark evidence.
64
-
65
- Phase 29 adds a reproducible real-provider baseline runner for the AgentsKit OS
66
- seed corpus. It uses disposable fixture copies, the existing OS benchmark
67
- runner, and task-specific validation:
68
-
69
- ```bash
70
- node scripts/run-agentskit-os-baseline.mjs \
71
- --target /path/to/agentskit-os \
72
- --provider codex \
73
- --output benchmarks/agentskit-os-phase-29-baseline
74
- ```
75
-
76
- The observations are not an improvement claim until equivalent harness runs
77
- exist.
78
-
79
- To collect equivalent baseline samples, run the same corpus independently and
80
- record the aggregate only after every task has been sampled:
81
-
82
- ```bash
83
- node scripts/run-agentskit-os-baseline.mjs \
84
- --target /path/to/agentskit-os \
85
- --provider codex \
86
- --repeats 3 \
87
- --output benchmarks/agentskit-os-phase-36-baseline \
88
- --record-manifest benchmarks/agentskit-os-phase-28.json
89
- ```
90
-
91
- Each repeat uses a fresh disposable fixture. The report stores the end-to-end
92
- duration of fixture setup, provider execution, validation, and cleanup in
93
- `durationSamplesMs`; the provider's own duration remains nested in the raw
94
- report. The manifest is replaced atomically through
95
- the typed observation recorder. `--record-manifest` requires the complete task
96
- set; omit it to inspect an uncommitted collection. Replicas are not retries,
97
- and a failed sample keeps the aggregate failed. Escape reduction may remain
98
- visible as a separate outcome, but duration, attempt, and review improvements
99
- remain unavailable until the baseline proves complete delivery.
37
+ Current-source evidence requires a committed Git `HEAD`. A directory outside Git, or a repository without its first commit, is rejected as `GIT_REQUIRED`; it is not a supported pilot mode because it cannot prove revision currentness.
100
38
 
101
39
  ## Contract
102
40
 
@@ -110,7 +48,7 @@ Endpoint, database, CLI, MCP, and UI checks must declare `execution: "real"`. UI
110
48
 
111
49
  ## API
112
50
 
113
- 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.
114
52
 
115
53
  ## Extensibility
116
54
 
@@ -151,6 +89,36 @@ the current state, so a post-approval edit cannot appear as `COMPLETE`.
151
89
  Concurrent event writers are serialized by an atomic per-run lock and fail
152
90
  closed if the log is busy.
153
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
+
115
+ Each harness event may also carry an optional `correlation` envelope. Its
116
+ `operationId` is the stable identity used when a lifecycle crosses into
117
+ AgentsKit, Chat, Doc Bridge, or Code Review; the optional `runId`, `sessionId`,
118
+ `turnId`, `actionId`, and `traceId` remain local identities. The envelope is
119
+ bounded metadata only and never contains prompts, arguments, results, or
120
+ secrets.
121
+
154
122
  Export a reconciled `COMPLETE` run for external review with an Ed25519 key:
155
123
 
156
124
  ```bash
@@ -162,9 +130,6 @@ The bundle includes the run projection, event log, and referenced check outputs,
162
130
  each with a SHA-256 digest. A trust store can mark keys `active` or `revoked` to
163
131
  support controlled key rotation. Treat exported outputs as potentially sensitive.
164
132
 
165
- The signed bundle is self-contained: it can be copied to an isolated directory
166
- and verified there with only the bundle and the trusted public key.
167
-
168
133
  Profiles are optional declarative overlays in `.codex/verification.json`. They
169
134
  inherit in order, override existing checks by ID, and are resolved before the
170
135
  contract is frozen:
@@ -181,6 +146,65 @@ contract is frozen:
181
146
  }
182
147
  ```
183
148
 
149
+ `runtime.kind` chooses the executor used by an integration: `process` is a bounded shell-free local child process; `docker` adds the Docker sandbox. The choice is frozen in the resolved contract and therefore changes its hash. Docker remains fail-closed when its daemon or image is unavailable.
150
+
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.
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
+
187
+ Use named profiles to make the operational choice explicit:
188
+
189
+ ```json
190
+ {
191
+ "profile": "process",
192
+ "runtime": { "kind": "process" },
193
+ "profiles": {
194
+ "process": { "runtime": { "kind": "process" } },
195
+ "docker": { "runtime": { "kind": "docker" } }
196
+ }
197
+ }
198
+ ```
199
+
200
+ ```ts
201
+ const runtime = createConfiguredToolRuntime({
202
+ runtime: loaded.config.runtime,
203
+ process: { tools: processTools },
204
+ docker: { tools: dockerTools },
205
+ })
206
+ ```
207
+
184
208
  Doc Bridge and Playbook integrations can implement `ContextProvider` and
185
209
  register it through `CONTEXT_PROVIDER_SLOT`; the kernel records neither their
186
210
  credentials nor their transport and does not depend on either package. The
@@ -215,6 +239,159 @@ stable `contextHash`; resolution time is metadata and does not change the
215
239
  reproducibility hash. Context is resolved before planning and is frozen with
216
240
  the run, so later index changes cannot silently change its evidence.
217
241
 
242
+ ## Delivery gates
243
+
244
+ The optional delivery helpers evaluate gates without embedding a GitHub, Linear,
245
+ or deployment provider. Adapters perform external effects only after the
246
+ deterministic decision is recorded:
247
+
248
+ ```ts
249
+ const g2 = assessPreflight({
250
+ criteria,
251
+ implementerId: 'implementer',
252
+ reviewerId: 'independent-reviewer',
253
+ reviewKind: 'adversarial',
254
+ reviewApproved: true,
255
+ })
256
+ ```
257
+
258
+ G2 ignores later-gate pending criteria but blocks failed/pending G2 evidence,
259
+ self-review, and a third repair. `composePullRequest` creates a structured PR
260
+ body only from an approved, current G2 result; it reuses a confirmed matching
261
+ remote PR and preserves uncertain state. G3 binds CI to the candidate revision.
262
+ G4 requires an approved environment profile, identified artifact, isolation or
263
+ version-bound acceptance, technical evidence, and a 15-minute low-risk window.
264
+ G5 remains `awaiting-acceptance` until the applicable business/UX decision is
265
+ recorded. `assessWorktreeCleanup` permits cleanup only after remote branch SHA,
266
+ PR, and G3 all match.
267
+
268
+ ## Pilot cohort
269
+
270
+ `ak-harness pilot cohort.json` validates the frozen cohort before work starts.
271
+ It requires a policy hash, a baseline reference, exactly ten included issues,
272
+ and the `normal` classification for each. Excluded or aborted issues need a
273
+ reason and cannot be silently replaced in the same manifest.
274
+
275
+ ## Improvement cycle
276
+
277
+ The five pilot steps can be evaluated as a bounded cycle: adversarial review,
278
+ G2 preflight, baseline recording, pilot execution, and harness/no-harness
279
+ comparison. Each iteration must contain those steps in order. A failed,
280
+ blocked, or pending step requires a reason; repeating requires an explicit
281
+ adjustment. The assessment returns `complete`, `repeat` (with the next
282
+ iteration), or `blocked` when the adjustment is missing or the iteration
283
+ budget is exhausted, plus a criterion-level matrix:
284
+
285
+ ```bash
286
+ ak-harness cycle assess cycle.json --json
287
+ ```
288
+
289
+ This is a deterministic decision helper: Orca, Emdash, GitHub, Linear, and
290
+ other adapters remain responsible for executing external actions and supplying
291
+ their structured results.
292
+
293
+ ## Agent optimization and evaluation
294
+
295
+ The Harness also validates the optimization layer without owning a provider.
296
+ The memory boundary accepts only approved records with explicit scope, source
297
+ revision, and content hash; an adapter can back it with AgentsKit memory.
298
+ `runAgentEval` runs a bounded suite and returns criterion-level accuracy;
299
+ `createLlmCache` provides deterministic keys and hit/miss/invalidation evidence
300
+ for context and read-only calls; and `runWorkflow` executes independent nodes
301
+ in sorted, bounded fan-out/fan-in batches while serializing nodes that share a
302
+ `mutationKey`. `OptimizationObservation` carries
303
+ optional token, memory, cache, and parallelism measurements and refuses
304
+ incomparable provider/model/configuration bindings.
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
+
317
+ These are seams, not replacements for AgentsKit packages. An integration may
318
+ adapt `@agentskit/memory` and `@agentskit/eval` into them while keeping the
319
+ Harness provider-neutral. Missing measurements remain missing; they are never
320
+ reported as zero.
321
+
322
+ ## Discovery gate
323
+
324
+ Discovery is a small deterministic gate before implementation. An adapter or
325
+ agent supplies a structured list of ambiguities; the Harness does not decide
326
+ product questions. Material ambiguities produce one decision packet with
327
+ options and a recommendation. A non-material ambiguity can proceed only when
328
+ an approved policy assumption covers it, and the result records that policy in
329
+ the decision log.
330
+
331
+ ```bash
332
+ ak-harness discovery assess discovery.json --json
333
+ ```
334
+
335
+ The result is `ready` or `awaiting-decision`, and carries the source revision,
336
+ contract hash, context hash, decision log and digest. Recheck it before
337
+ implementation with `isDiscoveryCurrent`: any source, contract or context
338
+ change makes the earlier result stale. The input is intentionally portable so
339
+ Linear, Orca and Emdash adapters can produce it later without becoming kernel
340
+ dependencies.
341
+
342
+ ## WIP admission
343
+
344
+ Use the same portable approach to decide whether a new issue can start. The
345
+ default limit is three deliveries started and not terminal. `blocked`,
346
+ `awaiting-decision` and `awaiting-acceptance` still consume a delivery slot;
347
+ they release an executor but do not hide unfinished work. Resuming an existing
348
+ non-terminal issue keeps its reservation and takes priority over new work.
349
+
350
+ ```bash
351
+ ak-harness wip assess wip.json --json
352
+ ```
353
+
354
+ ## Runtime experiment
355
+
356
+ Compare Orca and Emdash only when both records carry the same source revision, contract, provider, model, and configuration hash. A failed hard gate is ineligible; the remaining candidates are ordered by human minutes, duration, cost, then `orca` only as the final tie-break.
357
+
358
+ ```sh
359
+ ak-harness experiment select experiment.json --json
360
+ ```
361
+
362
+ The Harness only assesses the supplied ledger. A future Linear adapter owns
363
+ reading and writing the tracker; it must persist the ledger/recovery identity
364
+ and use the existing event-log lock before acting.
365
+
366
+ ## Portable orchestration controls
367
+
368
+ The package includes the small controls needed by an external orchestrator without
369
+ embedding a tracker or provider:
370
+
371
+ ```ts
372
+ import { createDispatchLedger, createOrcaDispatchPlan, planFilePreflight, runWithRecovery } from '@agentskit/harness'
373
+
374
+ const ledger = createDispatchLedger('.codex/verification')
375
+ const claim = ledger.claim({ tracker: 'linear', repository: 'org/repo', issue: 'ENG-1', worktree: 'eng-1', branch: 'codex/eng-1', owner: 'agent' })
376
+ const dispatch = createOrcaDispatchPlan({ repository: 'org/repo', worktree: 'eng-1', branch: 'codex/eng-1', baseBranch: 'main', goalFile: 'GOAL.md' })
377
+ ledger.recordDispatch({ lease: claim.lease, idempotencyKey: dispatch.idempotencyKey, commandDigest: dispatch.commandDigest })
378
+ ```
379
+
380
+ Claims are keyed by tracker, repository, issue, worktree, and branch. They are
381
+ atomic, idempotent, and recoverable only by a human. The ledger never executes
382
+ the command; an Orca adapter may execute the returned argv after recording the
383
+ decision.
384
+
385
+ `planFilePreflight` skips documentation-only changes, selects colocated tests,
386
+ and `validateSafeCommand` rejects shell composition. `runWithRecovery` retries
387
+ only classified retryable failures with a bounded exponential delay and an
388
+ abortable watchdog. `parseRetro` produces proposed learnings; only a human can
389
+ promote them. `createStatusSnapshot` creates a digest-bound status projection.
390
+
391
+ Linear/GitHub and Orca integrations should implement the provider-neutral
392
+ tracking and dispatch adapters; no credentials or network clients belong in
393
+ the kernel.
394
+
218
395
  Agent sessions can record adapter identity, turns, and guarded tool actions
219
396
  during `IMPLEMENTING` without persisting prompt, argument, or result contents:
220
397
 
@@ -338,18 +515,11 @@ action without storing raw output.
338
515
 
339
516
  `benchmark` aggregates the local run history into a versioned JSON report. It
340
517
  includes check/outcome/evidence pass rates, retries, stale runs, human approvals,
341
- and average/median verification duration. It also reports `effective*` metrics
342
- over the latest non-superseded run in each retry lineage, so attempt history is
343
- not confused with the current delivery state. With `--manifest`, it also compares
518
+ and average/median verification duration. With `--manifest`, it also compares
344
519
  bound harness tasks with explicitly recorded baseline observations. A baseline
345
520
  must include evidence for every acceptance criterion; missing, duplicate, or
346
521
  unknown criterion evidence is rejected. Missing baselines and incomplete
347
- evidence remain non-comparable; the harness never invents a baseline. Baseline
348
- collectors also record `baselineArtifactAcceptanceRate`, the fraction of
349
- repeated samples whose real artifact validation passed. This is independent of
350
- protocol completion: a correct artifact with missing or incomplete protocol
351
- evidence is visible as an accepted artifact but remains non-comparable for
352
- duration and resource claims. These are
522
+ evidence remain non-comparable; the harness never invents a baseline. These are
353
523
  execution metrics, not a claim of productivity improvement; compare reports over
354
524
  a controlled task corpus to measure that outcome.
355
525
 
@@ -400,73 +570,35 @@ the report exposes their delta and direction. A positive improvement rate
400
570
  means the harness used less of that measured resource; these metrics do not
401
571
  establish causality or productivity improvement alone.
402
572
 
403
- When a structured check includes `artifactAcceptanceRate` directly or inside
404
- its benchmark `reports`, comparisons also expose the harness rate, contributing
405
- sample count, and acceptance improvement. Missing rates remain uncounted and
406
- never become a failed artifact implicitly.
407
-
408
- Baseline and harness comparisons also expose `protocolCompletionRate`, which
409
- measures whether the verification protocol completed independently of artifact
410
- acceptance. A protocol rate does not override the fail-closed comparability
411
- rules.
412
-
413
- When a baseline rate is zero, relative improvement remains `unavailable`; the
414
- report still exposes the absolute acceptance or protocol completion delta.
415
-
416
- For paired real-provider measurements, `scripts/run-agentskit-os-harness-benchmark.mjs`
417
- prepares one frozen contract per manifest task, binds each run to the suite and
418
- task ID, and leaves the lifecycle at the human approval gate. Use
419
- `--repeats 3` for three independent samples per task; each sample has its own
420
- state directory and must be approved separately. Run `--collect` after
421
- approvals to aggregate the isolated task state directories. Pending or blocked
422
- task runs remain non-comparable; only `COMPLETE` runs produce directional
423
- improvement values. Duration comparisons use the median of completed samples,
424
- while retry metrics count only superseded retry lineages, so experimental
425
- replication is not misreported as agent retry cost.
426
-
427
- When one sample is blocked or times out, prepare a distinct replacement without
428
- overwriting the original evidence:
573
+ ## Repository organization
429
574
 
430
- ```bash
431
- node scripts/run-agentskit-os-harness-benchmark.mjs \
432
- --execute --task-id feat-formatter --sample 4 \
433
- --phase-root .codex/verification/phase-39/harness
434
- ```
435
-
436
- `--sample` requires a positive sample number and refuses an existing config or
437
- state directory. The original blocked run remains part of the audit trail;
438
- replacement runs add evidence and do not retroactively turn the blocked sample
439
- into success.
440
-
441
- The AgentsKit OS benchmark runner can expose the built `ak-verify` CLI inside
442
- its disposable fixture. The fixture contract is prepared by CI, the provider
443
- inherits a fixture-local PATH entry, and human approval is never synthesized.
444
- This makes provider-side verification available without making the fixture a
445
- security boundary; the outer harness remains the authoritative evidence gate.
446
-
447
- Benchmark reports also expose a fail-closed `qualityGate`. It separates
448
- historical retries from effective delivery, reports duration regressions, and
449
- labels small samples as `insufficient-data` or `directional` instead of
450
- claiming enterprise-level improvement. Configure
451
- `minBaselineSamplesPerTask` alongside `minCompletedRunsPerTask`: a single
452
- baseline observation is not comparable to replicated harness runs. Baseline
453
- observations may store `durationSamplesMs`; the report compares medians.
575
+ The Playbook contains guidance; this repository contains the enforceable SDLC
576
+ engine. See [MANIFESTO.md](./MANIFESTO.md) for the boundary and
577
+ [docs/ORGANIZATION.md](./docs/ORGANIZATION.md) for the Angular Conventional
578
+ Commits and capability layout.
454
579
 
455
580
  ## Development
456
581
 
457
582
  ```bash
458
583
  pnpm install
459
- pnpm --filter @agentskit/harness typecheck
460
- pnpm --filter @agentskit/harness test
461
- pnpm --filter @agentskit/harness build
584
+ pnpm typecheck
585
+ pnpm test
586
+ pnpm build
587
+ pnpm pack --pack-destination /tmp/agentskit-harness-pack
462
588
  ```
463
589
 
464
590
  See [CONTRIBUTING.md](./CONTRIBUTING.md) for changes, tests, and release expectations. See [CHANGELOG.md](./CHANGELOG.md) for version history.
465
591
 
466
- The Playbook CI dogfoods the package with `harness:test`, `harness:cli`, and a
467
- clean packed-consumer probe before the broader repository checks run.
468
- It also uploads the resulting `.codex/verification/harness-phase-24` run
469
- directory so a human can inspect the exact evidence before approval.
592
+ ## Release
593
+
594
+ Releases are published by `.github/workflows/release-harness.yml` after a merge to
595
+ `main`. The workflow uses npm Trusted Publishing (GitHub OIDC) and does not read
596
+ or require an `NPM_TOKEN`. Configure the npm trusted publisher once for
597
+ `AgentsKit-io/harness`, workflow `release-harness.yml`, and package
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).
470
602
 
471
603
  ## License
472
604