Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
2a5194f
feat(improvement): add prompt instruction component preset
drewstone Aug 16, 2026
cb85e15
feat(improvement): export prompt instruction preset
drewstone Aug 16, 2026
46d78dd
feat(improvement): add reusable profile improvement harness
drewstone Aug 16, 2026
61816a4
feat(improvement): export profile improvement harness
drewstone Aug 16, 2026
8aef4e5
feat(durable): discover persisted supervision identities
drewstone Aug 16, 2026
7f8e871
feat(durable): export supervision discovery helper
drewstone Aug 16, 2026
9c1c563
test(improvement): cover meta-harness developer primitives
drewstone Aug 16, 2026
f1780ec
test(durable): cover durable supervision identity discovery
drewstone Aug 16, 2026
14a0d69
fix(improvement): capture harness executor immutably
drewstone Aug 16, 2026
44734bf
style: format durable supervision discovery
drewstone Aug 16, 2026
6f09943
style: organize improvement exports
drewstone Aug 16, 2026
ef70cca
style: format meta-harness tests
drewstone Aug 16, 2026
4fdb68f
style: format profile improvement harness
drewstone Aug 16, 2026
27fbc63
test(improvement): assert synchronous configuration errors
drewstone Aug 16, 2026
5f4eaa9
fix(improvement): type frozen harness callback explicitly
drewstone Aug 16, 2026
de2da3f
fix(improvement): type frozen profile component callbacks
drewstone Aug 16, 2026
65b72d4
style: format typed instruction component mapping
drewstone Aug 16, 2026
288c983
chore: merge current main into meta-harness branch
drewstone Aug 16, 2026
f58c891
ci: regenerate API docs on the meta-harness branch
drewstone Aug 16, 2026
d26c2aa
docs: regenerate API reference
github-actions[bot] Aug 16, 2026
5ce6b42
chore: remove branch-only docs regeneration workflow
drewstone Aug 16, 2026
cdb6cc8
fix(durable): distinguish top-level supervision roots
drewstone Aug 16, 2026
f82432d
test(durable): cover root ownership and log failure modes
drewstone Aug 16, 2026
e92778d
fix(improvement): validate bound harness callbacks
drewstone Aug 16, 2026
7aa0628
test(improvement): exercise the bound harness run path
drewstone Aug 16, 2026
889616b
style(durable): apply canonical formatter output
drewstone Aug 16, 2026
ecda707
style(durable): format malformed identity assertion
drewstone Aug 16, 2026
c9fbcfd
style(improvement): organize and format harness tests
drewstone Aug 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions docs/api/durable.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,61 @@ NDJSON body to return as the platform `Response` body.

Content type for the response.

***

### DurableCoordinationStreamIdentity

#### Properties

##### runId

> `readonly` **runId**: `string`

##### ownerIds

> `readonly` **ownerIds**: readonly `string`[]

Exact owner ids present in the side-log, sorted for deterministic display.

##### unscopedRecords

> `readonly` **unscopedRecords**: `number`

Records written before owner-scoped coordination identities were introduced.

##### recordCount

> `readonly` **recordCount**: `number`

***

### DurableSupervisionDiscovery

Identities discoverable from one `supervise({ runDir })` directory without
already knowing the root node or coordination run id stored inside it.

#### Properties

##### runDir

> `readonly` **runDir**: `string`

##### spawnJournalPath

> `readonly` **spawnJournalPath**: `string`

##### coordinationLogPath

> `readonly` **coordinationLogPath**: `string`

##### roots

> `readonly` **roots**: readonly `string`[]

##### coordinationStreams

> `readonly` **coordinationStreams**: readonly [`DurableCoordinationStreamIdentity`](#durablecoordinationstreamidentity)[]

## Functions

### handleChatTurn()
Expand Down Expand Up @@ -342,3 +397,28 @@ Wire integration:
#### Throws

`RangeError` when `turnIndex` is invalid or the result exceeds 256 bytes.

***

### discoverDurableSupervisionRun()

> **discoverDurableSupervisionRun**(`runDir`): `Promise`\<[`DurableSupervisionDiscovery`](#durablesupervisiondiscovery)\>

Discover the stable identities recorded by Runtime's durable supervision
files. This is the developer-facing first step before calling
`FileSpawnJournal.loadTree(root)`, `loadSpawnForest(journal, root)`, or
`FileCoordinationLog.load(runId, ownerId)`.

Missing files produce empty collections. A malformed committed JSONL record
still fails loud through the same parser used by the runtime; a torn final
append is ignored because it was never acknowledged as committed.

#### Parameters

##### runDir

`string`

#### Returns

`Promise`\<[`DurableSupervisionDiscovery`](#durablesupervisiondiscovery)\>
188 changes: 188 additions & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6144,6 +6144,105 @@ Exact materialized profile presented for validation before any candidate run.

***

### CreateProfileImprovementHarnessOptions

#### Type Parameters

##### TScenario

`TScenario` *extends* `Scenario`

##### TArtifact

`TArtifact`

#### Properties

##### profile

> **profile**: `AgentProfile`

Exact baseline profile. It is parsed, detached, and frozen at construction.

##### executionRef

> **executionRef**: `` `sha256:${string}` ``

Immutable identity of the bound executor, models, tools, component mapping,
and every closure or external setting that can change measured behavior.

##### agent

> **agent**: [`ImproveProfileAgent`](#improveprofileagent)\<`TScenario`, `TArtifact`\>

Execute one exact materialized profile on one scenario.

##### validateCandidate?

> `optional` **validateCandidate?**: [`ImproveCandidateValidator`](#improvecandidatevalidator)

Optional validator shared by every run from this harness.

***

### ProfileImprovementHarness

A small, reusable front door over `improve(profile, options)`.

The harness freezes the baseline and binds execution identity once, which
removes the two easiest sources of accidental experiment drift when a
developer runs several methods, surfaces, or held-out suites against the
same agent. It does not replace or narrow `improve`; callers retain every
method option and may still use the lower-level API directly.

#### Type Parameters

##### TScenario

`TScenario` *extends* `Scenario`

##### TArtifact

`TArtifact`

#### Properties

##### profile

> `readonly` **profile**: `object`

Detached immutable baseline actually used by every run.

##### profileDigest

> `readonly` **profileDigest**: `` `sha256:${string}` ``

Canonical digest of the bound baseline profile.

##### executionRef

> `readonly` **executionRef**: `` `sha256:${string}` ``

Exact execution identity bound at construction.

#### Methods

##### run()

> **run**(`options`): `Promise`\<[`ImproveMethodResult`](#improvemethodresult)\>

###### Parameters

###### options

[`ProfileImprovementHarnessRunOptions`](#profileimprovementharnessrunoptions)\<`TScenario`, `TArtifact`\>

###### Returns

`Promise`\<[`ImproveMethodResult`](#improvemethodresult)\>

***

### RawTraceDistillerOptions

#### Properties
Expand Down Expand Up @@ -11364,6 +11463,30 @@ Official SkillOpt configuration plus bounded Runtime findings context.

***

### ProfileImprovementHarnessRunOptions

> **ProfileImprovementHarnessRunOptions**\<`TScenario`, `TArtifact`\> = `Omit`\<[`ImproveMethodOptions`](#improvemethodoptions)\<`TScenario`, `TArtifact`\>, `"executionRef"` \| `"agent"` \| `"validateCandidate"`\> & `object`

#### Type Declaration

##### validateCandidate?

> `optional` **validateCandidate?**: [`ImproveCandidateValidator`](#improvecandidatevalidator)

Override the harness-level validator for this run.

#### Type Parameters

##### TScenario

`TScenario` *extends* `Scenario`

##### TArtifact

`TArtifact`

***

### DeepReadonly

> **DeepReadonly**\<`T`\> = `T` *extends* (...`args`) => `unknown` ? `T` : `T` *extends* readonly infer TItem[] ? readonly [`DeepReadonly`](#deepreadonly)\<`TItem`\>[] : `T` *extends* `object` ? `{ readonly [TKey in keyof T]: DeepReadonly<T[TKey]> }` : `T`
Expand Down Expand Up @@ -12620,6 +12743,41 @@ to the strategy contract (author-blind, conserved budget, one module out).

***

### PROMPT\_INSTRUCTION\_COMPONENT\_PREFIX

> `const` **PROMPT\_INSTRUCTION\_COMPONENT\_PREFIX**: `"prompt.instruction:"` = `'prompt.instruction:'`

Stable component-name prefix used for `profile.prompt.instructions`.

***

### promptInstructionsProfileComponents

> `const` **promptInstructionsProfileComponents**: [`ImproveProfileComponents`](#improveprofilecomponents)

Canonical `ImproveProfileComponents` mapping for the ordered
`AgentProfile.prompt.instructions` list.

Use it with `surface: 'agent-profile'` when an optimizer should rewrite the
exact instruction texts without being allowed to change their count, order,
labels, or any unrelated profile field:

```ts
await improve(profile, {
surface: 'agent-profile',
profileComponents: promptInstructionsProfileComponents,
// method, scenarios, judge, executionRef, agent, ...
})
```

Component names are zero-padded and stable. Runtime's existing component
materializer requires every candidate to preserve the exact key set and
verifies that `apply(read(profile))` reproduces the baseline profile. A
profile with no prompt instructions is refused rather than inventing a
sentinel instruction that could accidentally ship.

***

### ROLLOUT\_POLICY\_EXTENSION

> `const` **ROLLOUT\_POLICY\_EXTENSION**: `"structural-rollout"` = `'structural-rollout'`
Expand Down Expand Up @@ -13954,6 +14112,36 @@ Build a complete method backed by Microsoft's official SkillOpt trainer.

***

### createProfileImprovementHarness()

> **createProfileImprovementHarness**\<`TScenario`, `TArtifact`\>(`options`): [`ProfileImprovementHarness`](#profileimprovementharness)\<`TScenario`, `TArtifact`\>

Bind one exact profile and executor into a repeatable self-improvement
harness. The returned `run` method remains generic over every existing
profile surface, optimization method, split, gate, and budget option.

#### Type Parameters

##### TScenario

`TScenario` *extends* `Scenario`

##### TArtifact

`TArtifact`

#### Parameters

##### options

[`CreateProfileImprovementHarnessOptions`](#createprofileimprovementharnessoptions)\<`TScenario`, `TArtifact`\>

#### Returns

[`ProfileImprovementHarness`](#profileimprovementharness)\<`TScenario`, `TArtifact`\>

***

### rawTraceDistiller()

> **rawTraceDistiller**\<`TScenario`, `TArtifact`\>(`options?`): (`input`) => `Promise`\<readonly `ProposalFinding`[]\>
Expand Down
Loading