@orkestrel/scaffold 0.0.133 → 0.0.135
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/dist/agents/skills/orkestrel-dispatch/scripts/bench.js +61 -96
- package/dist/agents/skills/orkestrel-dispatch/scripts/brief.js +48 -76
- package/dist/agents/skills/orkestrel-dispatch/scripts/chain.js +27 -66
- package/dist/agents/skills/orkestrel-dispatch/scripts/cite.js +31 -64
- package/dist/agents/skills/orkestrel-dispatch/scripts/launch.js +43 -57
- package/dist/agents/skills/orkestrel-dispatch/scripts/login.js +43 -86
- package/dist/agents/skills/orkestrel-dispatch/scripts/patch.js +68 -104
- package/dist/agents/skills/orkestrel-dispatch/scripts/result.js +35 -69
- package/dist/agents/skills/orkestrel-dispatch/scripts/sweep.js +47 -84
- package/dist/agents/skills/orkestrel-falsify/scripts/mutate.js +134 -116
- package/dist/agents/skills/orkestrel-harden/scripts/discovery.js +38 -90
- package/dist/agents/skills/orkestrel-harden/scripts/interleave.js +39 -103
- package/dist/agents/skills/orkestrel-harden/scripts/measure.js +40 -89
- package/dist/agents/skills/orkestrel-harden/scripts/titles.js +41 -87
- package/dist/agents/skills/orkestrel-parallel/scripts/cases.js +43 -88
- package/dist/agents/skills/orkestrel-parallel/scripts/lane.js +1568 -213
- package/dist/agents/skills/orkestrel-publish/scripts/compare.js +40 -60
- package/dist/agents/skills/orkestrel-publish/scripts/pins.js +47 -81
- package/dist/agents/skills/orkestrel-publish/scripts/steps.js +66 -104
- package/dist/agents/skills/orkestrel-publish/scripts/swap.js +74 -88
- package/dist/agents/skills/orkestrel-publish/scripts/wave.js +387 -109
- package/dist/agents/skills/orkestrel-publish/scripts/window.js +55 -96
- package/dist/agents/skills/orkestrel-scout/scripts/map.js +54 -101
- package/dist/bin/main.js +275 -33
- package/dist/bin/main.js.map +1 -1
- package/dist/host/AGENTS.md +1 -1
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/bench.ts +81 -97
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/brief.ts +64 -72
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/chain.ts +41 -63
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/cite.ts +56 -79
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/launch.ts +61 -74
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/login.ts +59 -89
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/patch.ts +87 -106
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/result.ts +57 -76
- package/dist/host/agents/skills/orkestrel-dispatch/scripts/sweep.ts +73 -88
- package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +2 -2
- package/dist/host/agents/skills/orkestrel-falsify/scripts/mutate.ts +167 -119
- package/dist/host/agents/skills/orkestrel-harden/references/methods.md +1 -1
- package/dist/host/agents/skills/orkestrel-harden/scripts/discovery.ts +58 -75
- package/dist/host/agents/skills/orkestrel-harden/scripts/interleave.ts +55 -99
- package/dist/host/agents/skills/orkestrel-harden/scripts/measure.ts +59 -90
- package/dist/host/agents/skills/orkestrel-harden/scripts/titles.ts +60 -80
- package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +4 -4
- package/dist/host/agents/skills/orkestrel-parallel/scripts/cases.ts +71 -108
- package/dist/host/agents/skills/orkestrel-parallel/scripts/lane.ts +1990 -274
- package/dist/host/agents/skills/orkestrel-publish/references/release.md +1 -0
- package/dist/host/agents/skills/orkestrel-publish/references/wave.md +28 -7
- package/dist/host/agents/skills/orkestrel-publish/scripts/compare.ts +58 -79
- package/dist/host/agents/skills/orkestrel-publish/scripts/pins.ts +66 -87
- package/dist/host/agents/skills/orkestrel-publish/scripts/steps.ts +84 -102
- package/dist/host/agents/skills/orkestrel-publish/scripts/swap.ts +92 -99
- package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +483 -127
- package/dist/host/agents/skills/orkestrel-publish/scripts/window.ts +82 -120
- package/dist/host/agents/skills/orkestrel-scout/SKILL.md +3 -3
- package/dist/host/agents/skills/orkestrel-scout/scripts/map.ts +85 -112
- package/dist/host/claude/agents/orkestrel.md +16 -16
- package/dist/host/claude/rules/architecture.md +1 -1
- package/dist/host/claude/rules/documentation.md +1 -1
- package/dist/host/claude/rules/patterns.md +7 -4
- package/dist/host/claude/rules/styles.md +1 -1
- package/dist/host/claude/rules/tests.md +3 -3
- package/dist/host/claude/rules/workspace.md +50 -37
- package/dist/host/configs/helpers.ts +117 -71
- package/dist/host/dotfiles/oxlintrc.json +6 -0
- package/dist/host/guides/agent.md +989 -395
- package/dist/host/guides/database.md +357 -342
- package/dist/host/guides/form.md +79 -4
- package/dist/host/guides/middleware.md +5 -5
- package/dist/host/guides/ollama.md +41 -42
- package/dist/host/guides/scaffold.md +170 -70
- package/dist/host/guides/study.md +12 -12
- package/dist/host/guides/table.md +20 -6
- package/dist/host/guides/test.md +166 -52
- package/dist/host/guides/toolbox.md +127 -81
- package/dist/host/guides/workspace.md +21 -14
- package/dist/host/manifest.json +54 -54
- package/dist/host/tests/config.test.ts +251 -7
- package/dist/host/tests/policy.test.ts +14 -21
- package/dist/host/tests/setupPolicy.ts +43 -36
- package/dist/src/core/index.cjs +533 -139
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +223 -16
- package/dist/src/core/index.d.ts +223 -16
- package/dist/src/core/index.js +524 -139
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +23 -14
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +3 -2
- package/dist/src/server/index.d.ts +3 -2
- package/dist/src/server/index.js +24 -15
- package/dist/src/server/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -129,7 +129,7 @@ The `triage` role sends System One requests to `/v1/systemone`. Its `StudySystem
|
|
|
129
129
|
|
|
130
130
|
A provider declares `triage` and `digest.triage` together. Both metadata passes verify the pin through tags and show, configuration identity retains it, and a declared daemon includes it in its verified maintenance population. A transport fault on this leg fails the trial even if the consumer catches it; it cannot produce successful recording completion. A well-transported answer the consumer semantically refuses remains the consumer's decision to refer onward. Study chooses no model name or probability cutoff.
|
|
131
131
|
|
|
132
|
-
Recording reads
|
|
132
|
+
Recording reads the optional procedure from the exchange sink's opening declaration. The transport refuses metadata or model pins that differ from that row. Preflight and postflight each fetch the serving version, then verify tags and show for each distinct pinned model. The version is an observation for debugging: each pass appends a `version` evidence row to its goal, `{ version }` with the reply's nonempty string or `null` when the reply names none, and Study compares it with nothing, so no recording, replay, or continuation refuses because of a version. The sidecar retains each version reply's exact bytes. Ordered exact steps compare UTF-8 bytes and verify their declared SHA-256 receipt; capture steps require their declared positive safe byte length and forbid body or input members. Goal, role, route, policy, and order are checked before sending. A second request and verification during request admission refuse. The sink supplies each HTTP ordinal, which joins dispatch and wire evidence even without passive observation. An attempt retains request bytes before sending. A validated response retains native status, selected headers, exact bytes, and chunk lengths; a failure retains bounded partial bytes and cannot produce completion. Successful postflight appends completion after the admitted execution sequence; a declared procedure also requires every step to finish. The parent composes the declaration, and the worker retains that row after verifying any maintenance prefix.
|
|
133
133
|
|
|
134
134
|
The transport owns its configuration before validation and snapshots each outbound URL, settings, headers, and request correlation before awaiting admission. Later caller mutation cannot change the admitted request. Cancellation signals, the timing callback, and the optional fetch collaborator retain their live identity.
|
|
135
135
|
|
|
@@ -216,9 +216,9 @@ The Ollama transport appends a `stop` evidence row after its `wire` row when com
|
|
|
216
216
|
|
|
217
217
|
## Native command
|
|
218
218
|
|
|
219
|
-
Recording declares positive safe `record.bytes`, `record.calls`, and `record.duration` allowances on the profile. The manifest retains the same declaration, and the parent reserves that complete allowance separately for each trial before starting workers. The allowance covers every serialized sidecar byte, including base64 expansion, opening and terminal rows, and LF framing. It consumes series custody without consuming goal evidence or model quota. Recording profiles explicitly supply `settings.
|
|
219
|
+
Recording declares positive safe `record.bytes`, `record.calls`, and `record.duration` allowances on the profile. The manifest retains the same declaration, and the parent reserves that complete allowance separately for each trial before starting workers. The allowance covers every serialized sidecar byte, including base64 expansion, opening and terminal rows, and LF framing. It consumes series custody without consuming goal evidence or model quota. Recording profiles explicitly supply `settings.metadata`, and name no serving version. Omitting `settings.procedure` selects open recording; supplying it keeps ordered exact or capture admission. The parent calls `buildStudyExchangeDeclaration` with the profile, trial, scenario, and whether it owns a daemon session. Each destination carries that declaration, and the driver, session, and worker check its members against the profile and trial they hold before constructing the adapter driver. The transport takes the procedure from the sink, with no duplicate options.
|
|
220
220
|
|
|
221
|
-
The declaration retains `record`, the ordered `goals`, and a `configuration` digest alongside
|
|
221
|
+
The declaration retains `record`, the ordered `goals`, and a `configuration` digest alongside pinned models, metadata bounds, maintenance, and optional procedure. It holds no version, and a declaration that carries one refuses. Configuration hashes canonical room, settings, and daemon configuration with the daemon executable path omitted; the daemon declaration holds no executable digest, so an updated executable leaves configuration unchanged. Profile record and elapsed bounds stay outside that digest. Maintenance lists the daemon's declared models when the parent owns a daemon session for this execution, and is empty otherwise.
|
|
222
222
|
|
|
223
223
|
The `record.calls` allowance counts execution attempts retained by the sidecar, including replayed exchanges. A request past the cap refuses before append or send with CAPACITY and the scope stop Recording calls. The `record.duration` allowance sums execution send-to-settlement milliseconds; metadata retains its independent budget. When the remaining model time binds a request, its recording deadline starts immediately before send and expires with DEADLINE and the scope stop Recording duration. An exhausted allowance refuses before append or send. A refusal keeps prior charges and prevents completion; an admitted attempt retains its failure terminal, including any bounded partial reply. Such a result stays interrupted.
|
|
224
224
|
|
|
@@ -238,11 +238,11 @@ The `StudyIdentity` interface retains location-independent runtime and content d
|
|
|
238
238
|
|
|
239
239
|
The replay manifest's ancestor retains the source result id, seal, and complete source identity. The replay sidecar's ancestor also retains its source file identity and exchange prefix. The manifest's own identity describes the executing build, so both contents remain available. The worker rechecks the ancestor and recorded goal prefix. The `scanStudyDivergence` function accepts a strictly read history and strictly read replay rows, aligns non-maintenance attempts by position, and returns the first differing or unmatched request. It performs no second validation. An extra request pairs with the recorded attempt at its position; after the last recorded execution, that is the first postflight request; an early end has no actual attempt. An attempt past the complete recording has no expected attempt and uses the recording's completion count plus one as its ordinal.
|
|
240
240
|
|
|
241
|
-
Continuation selects `--extend <result>` on check or execute and refuses a simultaneous replay selection. The ancestor must be sealed, recorded in open form, and complete without operational failures or partial products. The executing profile must declare open recording and a dedicated daemon. The definition, driver, ordered trials, runtime, content,
|
|
241
|
+
Continuation selects `--extend <result>` on check or execute and refuses a simultaneous replay selection. The ancestor must be sealed, recorded in open form, and complete without operational failures or partial products. The executing profile must declare open recording, and it can declare a dedicated daemon or none, with empty maintenance. The definition, driver, ordered trials, runtime, content, models, and configuration must match; the serving version and the daemon executable can differ, so a recording continues under a later Ollama. Every scenario keeps its id and strictly extends its ancestor's goals, including their canonical input values. Fixture identity changes with the grown scenario. Recording and elapsed bounds may rise because they stay outside configuration; no bound rises automatically.
|
|
242
242
|
|
|
243
|
-
The parent derives a live replay prefix ending immediately before each ancestor's postflight.
|
|
243
|
+
The parent derives a live replay prefix ending immediately before each ancestor's postflight. With a declared daemon, it starts and verifies the daemon, then records live unloads before opening the worker; without one, it records no maintenance and live requests go to the external daemon at the provider URL. The worker reconstructs state through the real adapter with exact recorded preflight and execution responses, sending no prefix request to the daemon. It checks the consumed prefix at the ancestor's last goal. An extra request in that goal refuses before forwarding and retains its attempt and failure. The first request in a later goal goes live; postflight verifies the live daemon at the extended horizon's last goal. With a declared daemon, each segment's first live goal starts cold, so its timing and cache state can differ from a continuous execution; an external daemon keeps whatever models it holds.
|
|
244
244
|
|
|
245
|
-
The descendant retains a complete flat sidecar: its extended declaration and ancestor prefix, live maintenance, replayed request and response bytes with recorded chunk lengths, live execution, live postflight, and completion. Its manifest links the immediate ancestor, so a later segment needs only that complete descendant. Replayed goals emit their evidence again and count against recording calls; their send-to-settlement time follows the executing recording duration allowance.
|
|
245
|
+
The descendant retains a complete flat sidecar: its extended declaration and ancestor prefix, any live maintenance, replayed request and response bytes with recorded chunk lengths, live execution, live postflight, and completion. Its manifest links the immediate ancestor, so a later segment needs only that complete descendant. Replayed goals emit their evidence again and count against recording calls; their send-to-settlement time follows the executing recording duration allowance.
|
|
246
246
|
|
|
247
247
|
Triage participates in open recording and in exact or capture procedures using its System One route and policy. Strict sidecar reading checks the same identity, ordering, receipts, and completion as for other roles. Prefix and keyed replay retain original response bytes and chunk lengths. An offline replay sends nothing, and a keyed triage miss cannot borrow another role's recorded answer. Replayed triage usage still charges admission budgets, while progress and reports attribute it to `triage`, count it as replayed, and exclude it from live spending. Continuation requires open recording, replays the ancestor goals, and sends only the grown horizon's suffix live. Keyed replay remains exclusive with `--extend`, and every keyed execution still requires recording.
|
|
248
248
|
|
|
@@ -300,9 +300,9 @@ isStudyExchangeAncestor(reference)
|
|
|
300
300
|
|
|
301
301
|
The process driver accepts `StudyProcessDriverOptions`. Its optional `prepare` callback runs in the parent before session construction, preserves the reserved destination and allowance, and never crosses structured cloning or IPC. Offline replay refuses a preparation callback. A worker verifies any retained maintenance prefix before resuming the sidecar and projects those ordinals into its first goal's evidence.
|
|
302
302
|
|
|
303
|
-
A provider's optional `daemon` declaration makes live execution own a dedicated Ollama session at the provider URL. The declaration
|
|
303
|
+
A provider's optional `daemon` declaration makes live execution own a dedicated Ollama session at the provider URL. The declaration names a canonical absolute executable, explicit environment overrides, and distinct model names and inventory digests equal to the provider's model, judge, and triage pins. It names no executable digest and no version, and a declaration that carries either refuses. Shared pins require one entry. A maintenance-only model, a relative executable, port 11434, a missing model digest, or conflicting environment-name casing refuses at profile load. The daemon owns the effective OLLAMA_HOST value. Without this declaration, the provider URL selects an external daemon.
|
|
304
304
|
|
|
305
|
-
The `StudyDaemonSession` class starts and verifies the daemon before trial execution. The manifest's `host.daemon` string retains the verified startup identity
|
|
305
|
+
The `StudyDaemonSession` class starts and verifies the daemon before trial execution. Each start reads the executable's SHA-256 and hands it to the daemon as the identity to start. The manifest's `host.daemon` string retains the verified startup identity, including that digest and the version the daemon reported. Study compares neither with an earlier reading, so an updated executable or version never refuses a run. Startup version and inventory probes belong to no trial sidecar. Before each trial worker opens, preparation unloads the declared models in order. The `StudyDaemonTrial` class synchronizes each maintenance attempt before sending, retains status, allowed headers, original sender chunk lengths, and exact body bytes, and closes the prefix after daemon validation. A failed exchange retains a failure row. The worker joins the maintenance ordinals to the scenario's first declared goal. Every execution ending awaits daemon stop and process-tree join; an unconfirmed tree stop refuses completion, and an executable that changed or became unreadable while the daemon ran refuses nothing. Offline replay constructs no daemon or preparation callback and sends no maintenance request.
|
|
306
306
|
|
|
307
307
|
Install the package in the consumer workspace, then run the study executable from that workspace. The selected declaration lives at studies/<name>/study.json, and its declared rubric path resolves inside that same directory. Its driver field selects a bundle at studies/<driver>/ containing scenarios/<scenario>.json, profiles/<profile>.json, and the adapter module index.ts. Several declarations can share one driver bundle while each keeps its own rubric. The profile defaults to local. JSON declarations use the public definition, scenario, profile, and rubric contracts.
|
|
308
308
|
|
|
@@ -405,7 +405,7 @@ The following declarations describe this concept.
|
|
|
405
405
|
| `STUDY_CHECKPOINT_EVENT` | const | `"checkpoint"` | Names the evidence event whose row a seeded execution hands its trial at open. |
|
|
406
406
|
| `STUDY_COMMAND_DURATION` | const | `86400000` | Caps declared execution duration at the native supervisor's host ceiling. |
|
|
407
407
|
| `STUDY_COMMAND_GRADER` | const | `"consumer-adapter"` | Names the trusted command's independent offline predicate. |
|
|
408
|
-
| `STUDY_COMMAND_HELP` | const | `"study check <study> [--profile <name>] [--closure <directory>] [--extend <result>] [--trial <name>] [--goals <first>..<last>] [--seed <result>:<trial>:<goal>]\nstudy freeze <study> --profile <name> --to <directory>\nstudy execute <study> [--profile <name>] [--out <path>] [--expected <sha256>] [--closure <directory>] [--extend <result> \| --replay <result> --prefix <JSON trial counts> --offline <true\|false> \| --replay <result> --roles <JSON roles> --offline <true\|false>] [--trial <name>] [--goals <first>..<last>] [--seed <result>:<trial>:<goal>]\nstudy grade <result> --rubric <path>\nstudy label <result> --assessment <sha256> --labels <path>\nstudy report <result> --assessment <sha256>\nstudy progress <result> [--from <goal>]\nstudy --help\nstudy --version\n\nProfiles default to local; freeze requires --profile. Flags require values and may appear only once.\nResults default to tmp/studies/<result>; scratch also uses tmp/studies.\nA result is its id under tmp/studies, a root-relative path, or an absolute path.\nRelative paths, including --out, must stay inside the consumer working directory.\nOutput directories must be new; existing results are never overwritten.\n--expected pins the fingerprint returned by check. --assessment selects an exact assessment.\n--rubric selects independent criteria. --labels imports caller-supplied semantic labels.\n--closure selects retained artifacts. Replay requires explicit prefix counts or roles, and offline behavior.\n--roles serves a listed role's request whose path, method, and body bytes equal a recorded attempt's.\n--extend continues a sealed open recording with further goals
|
|
408
|
+
| `STUDY_COMMAND_HELP` | const | `"study check <study> [--profile <name>] [--closure <directory>] [--extend <result>] [--trial <name>] [--goals <first>..<last>] [--seed <result>:<trial>:<goal>]\nstudy freeze <study> --profile <name> --to <directory>\nstudy execute <study> [--profile <name>] [--out <path>] [--expected <sha256>] [--closure <directory>] [--extend <result> \| --replay <result> --prefix <JSON trial counts> --offline <true\|false> \| --replay <result> --roles <JSON roles> --offline <true\|false>] [--trial <name>] [--goals <first>..<last>] [--seed <result>:<trial>:<goal>]\nstudy grade <result> --rubric <path>\nstudy label <result> --assessment <sha256> --labels <path>\nstudy report <result> --assessment <sha256>\nstudy progress <result> [--from <goal>]\nstudy --help\nstudy --version\n\nProfiles default to local; freeze requires --profile. Flags require values and may appear only once.\nResults default to tmp/studies/<result>; scratch also uses tmp/studies.\nA result is its id under tmp/studies, a root-relative path, or an absolute path.\nRelative paths, including --out, must stay inside the consumer working directory.\nOutput directories must be new; existing results are never overwritten.\n--expected pins the fingerprint returned by check. --assessment selects an exact assessment.\n--rubric selects independent criteria. --labels imports caller-supplied semantic labels.\n--closure selects retained artifacts. Replay requires explicit prefix counts or roles, and offline behavior.\n--roles serves a listed role's request whose path, method, and body bytes equal a recorded attempt's.\n--extend continues a sealed open recording with further goals; the profile can omit a daemon.\ncheck carries --extend into next and binds the ancestor seal into its fingerprint.\ncheck binds --trial, --goals, and --seed into its fingerprint and carries them into next.\nSuccess writes one JSON document; next contains suggested argv, never executed automatically.\ncheck, freeze, grade, label, report and progress have a fixed allowance of 60 seconds.\nexecute checks first, then uses the declared series duration plus 15 seconds for cleanup.\nExit codes: 0 success, 64 invalid input, 124 deadline, 130 interruption, 1 operational failure.\n"` | Defines the complete public CLI reference shared by help and grammar diagnostics. |
|
|
409
409
|
| `STUDY_COMMAND_OPERATION` | const | `"study-command"` | Names the command route beneath the native supervisor. |
|
|
410
410
|
| `STUDY_CUSTODY_BYTES` | const | `number` | Limits untrusted metadata before JSON parsing or file allocation. |
|
|
411
411
|
| `STUDY_DRAIN_DURATION` | const | `1000` | Bounds how long inherited output handles stay open after native exit, in milliseconds. |
|
|
@@ -749,7 +749,7 @@ The following declarations describe this concept.
|
|
|
749
749
|
| `readStudyDeclarationBytes` | function | `(root: string, path: string) => Promise<Uint8Array>` | Reads one declaration file and refuses a missing or linked path with its root-relative path. |
|
|
750
750
|
| `readStudyVersion` | function | `(entry: string) => string` | Reads the version of the study package that owns an executable entry. |
|
|
751
751
|
| `matchesSystemError` | function | `(value: unknown, code: string) => boolean` | Reports whether a caught value is a Node error carrying the given system code. |
|
|
752
|
-
| `StudyDaemon` | interface | `{ executable,
|
|
752
|
+
| `StudyDaemon` | interface | `{ executable, environment?, models }` | Pins an executable and the model population an execution owns until cleanup. |
|
|
753
753
|
| `StudyDaemonModel` | interface | `{ name, digest }` | Pins one model the declared daemon verifies and unloads before each trial. |
|
|
754
754
|
| `StudyRecord` | interface | `{ bytes, calls, duration }` | Bounds serialized exchange bytes, execution calls and summed model time for each trial. |
|
|
755
755
|
| `ArtifactErrorCode` | type | `'ARTIFACT' \| 'TRAVERSAL' \| 'REDIRECT' \| 'ALIAS' \| 'NAME' \| 'DUPLICATE' \| 'OCCUPIED' \| 'OVERLAP' \| 'PARENT' \| 'STALE' \| 'VOLUME' \| 'DRIFT' \| 'LIMIT'` | Names the refused boundary of a captured or materialized artifact graph. |
|
|
@@ -782,7 +782,7 @@ The following declarations describe this concept.
|
|
|
782
782
|
| `StudyExchangeDestination` | interface | `{ path, declaration, retained? }` | Holds the parent-reserved destination of one trial's exchange sidecar. |
|
|
783
783
|
| `StudyExchangeBytes` | interface | `{ body, digest, size }` | Retains an application HTTP body's exact bytes independently of text decoding. |
|
|
784
784
|
| `StudyExchangeIdentity` | interface | `{ ordinal, goal, role, path, method, stage, step? }` | Binds one HTTP exchange to its trial-local position and declared execution stage. |
|
|
785
|
-
| `StudyExchangeDeclaration` | interface | `{ phase, trial,
|
|
785
|
+
| `StudyExchangeDeclaration` | interface | `{ phase, trial, models, metadata, record, goals, configuration, procedure?, maintenance, ancestor?, keyed? }` | Declares a bounded trial horizon and serving identities before any exchange attempt. |
|
|
786
786
|
| `StudyExchangeAttempt` | interface | `{ phase }` | Retains admitted request bytes durably before the corresponding send begins. |
|
|
787
787
|
| `StudyExchangeReply` | interface | `{ status, headers, chunks }` | Retains response status, headers, and original application-body chunk lengths. |
|
|
788
788
|
| `StudyExchangeResponse` | interface | `{ phase }` | Retains a fully consumed response only after status and terminal validation succeed. |
|
|
@@ -3346,7 +3346,7 @@ try {
|
|
|
3346
3346
|
|
|
3347
3347
|
## Tests
|
|
3348
3348
|
|
|
3349
|
-
The staging proofs drive the real command and worker over a Node protocol daemon on an ephemeral loopback port. The daemon records whether each unload's attempt was already readable on disk. The source suite proves repeated maintenance prefixes, exact ordinal joins, offline replay without a daemon or request,
|
|
3349
|
+
The staging proofs drive the real command and worker over a Node protocol daemon on an ephemeral loopback port. The daemon records whether each unload's attempt was already readable on disk. The source suite proves repeated maintenance prefixes, exact ordinal joins, offline replay without a daemon or request, startup, trial, unload, and cancellation cleanup while an unrelated sentinel survives, and a stop that completes after the executable changed under the running daemon. Setup proofs validate fixture declarations without starting a child.
|
|
3350
3350
|
|
|
3351
3351
|
### Call exchange and replay helpers
|
|
3352
3352
|
|
|
@@ -320,7 +320,7 @@ The entity, its managers, its factory, its contract, and the error it raises.
|
|
|
320
320
|
| `FilterManagerInterface` | interface | `{ filter(), filters(), set(), remove() }` | Manages which rows a grid keeps. |
|
|
321
321
|
| `SelectionManagerInterface` | interface | `{ keys, select(), clear(), toggle() }` | Manages the rows somebody has picked. |
|
|
322
322
|
| `ExpansionManagerInterface` | interface | `{ keys, expand(), clear(), toggle() }` | Manages the rows somebody has opened up. |
|
|
323
|
-
| `PaginationManagerInterface` | interface | `{ page, limit, offset, count, move(), resize() }`
|
|
323
|
+
| `PaginationManagerInterface` | interface | `{ page, limit, offset, count, move(), locate(), resize() }` | Manages which stretch of the filtered rows the view shows. |
|
|
324
324
|
| `GridError` | class | `new (code: GridErrorCode, message: string, context?: JSONRecord) => GridError` | Represents an error raised by the grid domain — a machine-readable `code` and optional structured `context`. |
|
|
325
325
|
| `GridErrorCode` | type | `'SCHEMA' \| 'COLUMN' \| 'KEY' \| 'CELL' \| 'DESTROYED'` | Names the reason a `GridError` carries — the machine-readable code a `catch` branches on. |
|
|
326
326
|
| `isGridError` | function | `(input: unknown) => input is GridError` | Determines whether a caught value is a grid error, so a `catch` branches on `code` without an assertion. |
|
|
@@ -971,6 +971,10 @@ the filter admits, so nothing here can drift out of step with what the grid hold
|
|
|
971
971
|
"page 1 of 1" over an empty list needs no separate case for it.
|
|
972
972
|
- A page beyond the last one clamps to the last one. Narrowing the filter therefore moves the page
|
|
973
973
|
on its own, and moving to page 9 of 3 shows page 3 rather than nothing.
|
|
974
|
+
- `locate` names the page that holds one row under the current filter and sort, so a host turns to
|
|
975
|
+
a row with `move(locate(key))` and keeps no copy of the lens to work it out. An unpaged grid
|
|
976
|
+
answers `1`, and a key the filter hides or no row holds answers `undefined`, never a page the
|
|
977
|
+
row is not on. `locate` moves nothing.
|
|
974
978
|
- `resize` keeps the first row the view was showing, so the page moves to wherever that row
|
|
975
979
|
falls. Resizing is a change of magnification, not a jump to the top.
|
|
976
980
|
|
|
@@ -988,6 +992,13 @@ grid.pagination.page // 3 — clamped to the last page
|
|
|
988
992
|
grid.pagination.offset // 4
|
|
989
993
|
grid.view.map((row) => row.id) // ['5']
|
|
990
994
|
|
|
995
|
+
grid.pagination.locate('3') // 2 — rows 3 and 4 fill the second page
|
|
996
|
+
grid.pagination.locate('9') // undefined — no row holds that key
|
|
997
|
+
grid.filter.set({ column: 'id', operator: 'contains', text: '5' })
|
|
998
|
+
grid.pagination.locate('3') // undefined — the filter hides the row
|
|
999
|
+
grid.pagination.locate('5') // 1 — one admitted row fills one page
|
|
1000
|
+
grid.filter.remove()
|
|
1001
|
+
|
|
991
1002
|
grid.pagination.resize()
|
|
992
1003
|
grid.pagination.limit // undefined — not paged
|
|
993
1004
|
grid.view.length // 5
|
|
@@ -1503,10 +1514,11 @@ it either way.
|
|
|
1503
1514
|
|
|
1504
1515
|
#### `PaginationManagerInterface`
|
|
1505
1516
|
|
|
1506
|
-
| Method | Returns
|
|
1507
|
-
| -------- |
|
|
1508
|
-
| `move` | `void`
|
|
1509
|
-
| `
|
|
1517
|
+
| Method | Returns | Summary |
|
|
1518
|
+
| -------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
1519
|
+
| `move` | `void` | Shows another page, counted from one and clamped to the pages that exist. |
|
|
1520
|
+
| `locate` | `number` or `undefined` | Finds the page that holds one row under the current filter and sort. |
|
|
1521
|
+
| `resize` | `void` | Sets how many rows a page holds, keeping the first row the view was showing. Leave the argument out to stop paging. |
|
|
1510
1522
|
|
|
1511
1523
|
### Errors
|
|
1512
1524
|
|
|
@@ -1623,7 +1635,9 @@ These invariants hold across [`src/core`](../src/core) and this guide.
|
|
|
1623
1635
|
`offset` is `(page - 1) * limit` and zero when unpaged; `count` is `max(1, ceil(rows / limit))`
|
|
1624
1636
|
and `1` when unpaged — so a paged grid with no admitted rows holds one page, and that page's
|
|
1625
1637
|
`view` is empty. A page beyond the last clamps to the last, including when a filter or a removal
|
|
1626
|
-
shrinks the rows underneath it. `
|
|
1638
|
+
shrinks the rows underneath it. `locate` is derived the same way: the page of a key among the rows
|
|
1639
|
+
the filter admits, in the order the sort gives them, `1` when unpaged, and `undefined` for a
|
|
1640
|
+
key the filter hides or no row holds. `resize` keeps the first row the view was showing.
|
|
1627
1641
|
14. **Every event fires after commit, and a no-op is silent.** No listener sees a state the grid has
|
|
1628
1642
|
not finished writing, and a call that moves nothing announces nothing — the same sort term twice,
|
|
1629
1643
|
a toggle back to where it was, a `move` to the index a row already occupies. When one call moves
|