@jam-overture/loom 0.1.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/LICENSE +21 -0
- package/README.md +743 -0
- package/dist/catalogue.d.ts +70 -0
- package/dist/catalogue.js +88 -0
- package/dist/cli/args.d.ts +17 -0
- package/dist/cli/args.js +83 -0
- package/dist/cli/filesystem.d.ts +15 -0
- package/dist/cli/filesystem.js +31 -0
- package/dist/cli/index.d.ts +12 -0
- package/dist/cli/index.js +12 -0
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.js +30 -0
- package/dist/cli/namespace.d.ts +40 -0
- package/dist/cli/namespace.js +40 -0
- package/dist/cli/plan.d.ts +84 -0
- package/dist/cli/plan.js +113 -0
- package/dist/cli/run.d.ts +17 -0
- package/dist/cli/run.js +75 -0
- package/dist/cli/templates.d.ts +43 -0
- package/dist/cli/templates.js +134 -0
- package/dist/closed-set.d.ts +34 -0
- package/dist/closed-set.js +34 -0
- package/dist/data/adapter.d.ts +123 -0
- package/dist/data/adapter.js +91 -0
- package/dist/data/binding.d.ts +48 -0
- package/dist/data/binding.js +39 -0
- package/dist/data/catalogue.d.ts +26 -0
- package/dist/data/catalogue.js +6 -0
- package/dist/data/index.d.ts +14 -0
- package/dist/data/index.js +14 -0
- package/dist/data/plan.d.ts +58 -0
- package/dist/data/plan.js +0 -0
- package/dist/data/resolution.d.ts +91 -0
- package/dist/data/resolution.js +96 -0
- package/dist/data/resolve.d.ts +46 -0
- package/dist/data/resolve.js +37 -0
- package/dist/data/source.d.ts +40 -0
- package/dist/data/source.js +45 -0
- package/dist/deadline.d.ts +57 -0
- package/dist/deadline.js +78 -0
- package/dist/frame/catalogue.d.ts +24 -0
- package/dist/frame/catalogue.js +5 -0
- package/dist/frame/index.d.ts +12 -0
- package/dist/frame/index.js +12 -0
- package/dist/frame/origin.d.ts +87 -0
- package/dist/frame/origin.js +114 -0
- package/dist/frame/resolution.d.ts +85 -0
- package/dist/frame/resolution.js +79 -0
- package/dist/grammar.d.ts +26 -0
- package/dist/grammar.js +28 -0
- package/dist/ids.d.ts +57 -0
- package/dist/ids.js +104 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +26 -0
- package/dist/interactivity.d.ts +50 -0
- package/dist/interactivity.js +22 -0
- package/dist/interpretation/anthropic.d.ts +22 -0
- package/dist/interpretation/anthropic.js +76 -0
- package/dist/interpretation/client.d.ts +83 -0
- package/dist/interpretation/client.js +2 -0
- package/dist/interpretation/draft.d.ts +234 -0
- package/dist/interpretation/draft.js +84 -0
- package/dist/interpretation/index.d.ts +15 -0
- package/dist/interpretation/index.js +15 -0
- package/dist/interpretation/interpreter.d.ts +62 -0
- package/dist/interpretation/interpreter.js +151 -0
- package/dist/interpretation/materialize.d.ts +42 -0
- package/dist/interpretation/materialize.js +107 -0
- package/dist/interpretation/prompt.d.ts +229 -0
- package/dist/interpretation/prompt.js +285 -0
- package/dist/interpretation/render.d.ts +76 -0
- package/dist/interpretation/render.js +272 -0
- package/dist/interpretation/schema.d.ts +49 -0
- package/dist/interpretation/schema.js +131 -0
- package/dist/json.d.ts +35 -0
- package/dist/json.js +11 -0
- package/dist/paging.d.ts +60 -0
- package/dist/paging.js +49 -0
- package/dist/primitive-type.d.ts +32 -0
- package/dist/primitive-type.js +39 -0
- package/dist/render/addressing.d.ts +59 -0
- package/dist/render/addressing.js +60 -0
- package/dist/render/anchor.d.ts +105 -0
- package/dist/render/anchor.js +84 -0
- package/dist/render/behaviour-adjust.d.ts +62 -0
- package/dist/render/behaviour-adjust.js +78 -0
- package/dist/render/behaviour-copy.d.ts +53 -0
- package/dist/render/behaviour-copy.js +75 -0
- package/dist/render/behaviour-disclose.d.ts +74 -0
- package/dist/render/behaviour-disclose.js +77 -0
- package/dist/render/behaviour-present.d.ts +123 -0
- package/dist/render/behaviour-present.js +173 -0
- package/dist/render/behaviour.d.ts +243 -0
- package/dist/render/behaviour.js +284 -0
- package/dist/render/control.d.ts +81 -0
- package/dist/render/control.js +80 -0
- package/dist/render/decorative.d.ts +62 -0
- package/dist/render/decorative.js +2 -0
- package/dist/render/diagnostics.d.ts +260 -0
- package/dist/render/diagnostics.js +61 -0
- package/dist/render/disclosed.d.ts +37 -0
- package/dist/render/disclosed.js +37 -0
- package/dist/render/editable.d.ts +34 -0
- package/dist/render/editable.js +35 -0
- package/dist/render/frame.d.ts +42 -0
- package/dist/render/frame.js +31 -0
- package/dist/render/index.d.ts +35 -0
- package/dist/render/index.js +35 -0
- package/dist/render/inline-variables.d.ts +77 -0
- package/dist/render/inline-variables.js +220 -0
- package/dist/render/presented.d.ts +82 -0
- package/dist/render/presented.js +82 -0
- package/dist/render/primitive.d.ts +228 -0
- package/dist/render/primitive.js +36 -0
- package/dist/render/props.d.ts +48 -0
- package/dist/render/props.js +2 -0
- package/dist/render/reads.d.ts +73 -0
- package/dist/render/reads.js +45 -0
- package/dist/render/render.d.ts +164 -0
- package/dist/render/render.js +571 -0
- package/dist/render/request.d.ts +111 -0
- package/dist/render/request.js +60 -0
- package/dist/render/text.d.ts +91 -0
- package/dist/render/text.js +44 -0
- package/dist/render/theme.d.ts +61 -0
- package/dist/render/theme.js +52 -0
- package/dist/reserved-props.d.ts +35 -0
- package/dist/reserved-props.js +45 -0
- package/dist/result.d.ts +27 -0
- package/dist/result.js +30 -0
- package/dist/role.d.ts +71 -0
- package/dist/role.js +22 -0
- package/dist/runtime/analysis.d.ts +149 -0
- package/dist/runtime/analysis.js +187 -0
- package/dist/runtime/assessment.d.ts +35 -0
- package/dist/runtime/assessment.js +13 -0
- package/dist/runtime/disposition.d.ts +102 -0
- package/dist/runtime/disposition.js +59 -0
- package/dist/runtime/events.d.ts +187 -0
- package/dist/runtime/events.js +7 -0
- package/dist/runtime/gate.d.ts +43 -0
- package/dist/runtime/gate.js +169 -0
- package/dist/runtime/index.d.ts +27 -0
- package/dist/runtime/index.js +27 -0
- package/dist/runtime/intent.d.ts +60 -0
- package/dist/runtime/intent.js +36 -0
- package/dist/runtime/interpreter.d.ts +117 -0
- package/dist/runtime/interpreter.js +46 -0
- package/dist/runtime/inverse-interpreter.d.ts +90 -0
- package/dist/runtime/inverse-interpreter.js +56 -0
- package/dist/runtime/inverse.d.ts +87 -0
- package/dist/runtime/inverse.js +48 -0
- package/dist/runtime/narration.d.ts +24 -0
- package/dist/runtime/narration.js +36 -0
- package/dist/runtime/nesting.d.ts +31 -0
- package/dist/runtime/nesting.js +46 -0
- package/dist/runtime/pipeline.d.ts +124 -0
- package/dist/runtime/pipeline.js +178 -0
- package/dist/runtime/policy-fingerprint.d.ts +29 -0
- package/dist/runtime/policy-fingerprint.js +119 -0
- package/dist/runtime/policy-source.d.ts +42 -0
- package/dist/runtime/policy-source.js +8 -0
- package/dist/runtime/policy.d.ts +156 -0
- package/dist/runtime/policy.js +107 -0
- package/dist/runtime/proposal.d.ts +423 -0
- package/dist/runtime/proposal.js +109 -0
- package/dist/runtime/redirection.d.ts +53 -0
- package/dist/runtime/redirection.js +38 -0
- package/dist/runtime/repointing.d.ts +71 -0
- package/dist/runtime/repointing.js +0 -0
- package/dist/runtime/reversibility.d.ts +36 -0
- package/dist/runtime/reversibility.js +39 -0
- package/dist/runtime/stake-level.d.ts +33 -0
- package/dist/runtime/stake-level.js +58 -0
- package/dist/runtime/stakes.d.ts +47 -0
- package/dist/runtime/stakes.js +305 -0
- package/dist/runtime/vocabulary.d.ts +122 -0
- package/dist/runtime/vocabulary.js +87 -0
- package/dist/sdk/audit.d.ts +195 -0
- package/dist/sdk/audit.js +128 -0
- package/dist/sdk/catalogue.d.ts +37 -0
- package/dist/sdk/catalogue.js +16 -0
- package/dist/sdk/conformance.d.ts +342 -0
- package/dist/sdk/conformance.js +494 -0
- package/dist/sdk/copy.d.ts +105 -0
- package/dist/sdk/copy.js +90 -0
- package/dist/sdk/definition.d.ts +242 -0
- package/dist/sdk/definition.js +64 -0
- package/dist/sdk/index.d.ts +19 -0
- package/dist/sdk/index.js +19 -0
- package/dist/sdk/interactivity.d.ts +29 -0
- package/dist/sdk/interactivity.js +34 -0
- package/dist/sdk/pairings.d.ts +124 -0
- package/dist/sdk/pairings.js +81 -0
- package/dist/sdk/registry.d.ts +162 -0
- package/dist/sdk/registry.js +329 -0
- package/dist/sdk/selection.d.ts +46 -0
- package/dist/sdk/selection.js +24 -0
- package/dist/sdk/text.d.ts +100 -0
- package/dist/sdk/text.js +105 -0
- package/dist/sdk/vocabulary.d.ts +39 -0
- package/dist/sdk/vocabulary.js +36 -0
- package/dist/signals/broadcast.d.ts +134 -0
- package/dist/signals/broadcast.js +451 -0
- package/dist/signals/collect.d.ts +184 -0
- package/dist/signals/collect.js +196 -0
- package/dist/signals/deliver.d.ts +64 -0
- package/dist/signals/deliver.js +85 -0
- package/dist/signals/fold.d.ts +112 -0
- package/dist/signals/fold.js +76 -0
- package/dist/signals/index.d.ts +31 -0
- package/dist/signals/index.js +31 -0
- package/dist/signals/ingest.d.ts +51 -0
- package/dist/signals/ingest.js +70 -0
- package/dist/signals/intake.d.ts +149 -0
- package/dist/signals/intake.js +154 -0
- package/dist/signals/journal.d.ts +94 -0
- package/dist/signals/journal.js +11 -0
- package/dist/signals/kinds.d.ts +22 -0
- package/dist/signals/kinds.js +22 -0
- package/dist/signals/ledger.d.ts +46 -0
- package/dist/signals/ledger.js +81 -0
- package/dist/signals/memory.d.ts +17 -0
- package/dist/signals/memory.js +99 -0
- package/dist/signals/migrate.d.ts +27 -0
- package/dist/signals/migrate.js +78 -0
- package/dist/signals/postgres.d.ts +7 -0
- package/dist/signals/postgres.js +295 -0
- package/dist/signals/rollup.d.ts +142 -0
- package/dist/signals/rollup.js +0 -0
- package/dist/signals/schema.d.ts +534 -0
- package/dist/signals/schema.js +92 -0
- package/dist/signals/signal.d.ts +381 -0
- package/dist/signals/signal.js +150 -0
- package/dist/signals/tally.d.ts +70 -0
- package/dist/signals/tally.js +2 -0
- package/dist/signals/view.d.ts +51 -0
- package/dist/signals/view.js +54 -0
- package/dist/store/attribution.d.ts +125 -0
- package/dist/store/attribution.js +116 -0
- package/dist/store/database.d.ts +14 -0
- package/dist/store/database.js +2 -0
- package/dist/store/driver.d.ts +29 -0
- package/dist/store/driver.js +39 -0
- package/dist/store/errors.d.ts +56 -0
- package/dist/store/errors.js +37 -0
- package/dist/store/index.d.ts +16 -0
- package/dist/store/index.js +16 -0
- package/dist/store/memory.d.ts +3 -0
- package/dist/store/memory.js +115 -0
- package/dist/store/migrate.d.ts +54 -0
- package/dist/store/migrate.js +122 -0
- package/dist/store/postgres-holds.d.ts +4 -0
- package/dist/store/postgres-holds.js +192 -0
- package/dist/store/postgres.d.ts +8 -0
- package/dist/store/postgres.js +262 -0
- package/dist/store/replay.d.ts +94 -0
- package/dist/store/replay.js +82 -0
- package/dist/store/revert.d.ts +116 -0
- package/dist/store/revert.js +243 -0
- package/dist/store/schema.d.ts +371 -0
- package/dist/store/schema.js +78 -0
- package/dist/store/source.d.ts +23 -0
- package/dist/store/source.js +37 -0
- package/dist/store/store.d.ts +231 -0
- package/dist/store/store.js +52 -0
- package/dist/store/undone.d.ts +18 -0
- package/dist/store/undone.js +89 -0
- package/dist/submit/catalogue.d.ts +20 -0
- package/dist/submit/catalogue.js +5 -0
- package/dist/submit/declaration.d.ts +39 -0
- package/dist/submit/declaration.js +30 -0
- package/dist/submit/endpoint.d.ts +131 -0
- package/dist/submit/endpoint.js +160 -0
- package/dist/submit/index.d.ts +13 -0
- package/dist/submit/index.js +13 -0
- package/dist/submit/plan.d.ts +49 -0
- package/dist/submit/plan.js +47 -0
- package/dist/submit/resolution.d.ts +61 -0
- package/dist/submit/resolution.js +64 -0
- package/dist/submit/resolve.d.ts +45 -0
- package/dist/submit/resolve.js +36 -0
- package/dist/telemetry/calibration.d.ts +132 -0
- package/dist/telemetry/calibration.js +151 -0
- package/dist/telemetry/episode.d.ts +140 -0
- package/dist/telemetry/episode.js +272 -0
- package/dist/telemetry/event.d.ts +2310 -0
- package/dist/telemetry/event.js +405 -0
- package/dist/telemetry/index.d.ts +15 -0
- package/dist/telemetry/index.js +15 -0
- package/dist/telemetry/journal.d.ts +116 -0
- package/dist/telemetry/journal.js +11 -0
- package/dist/telemetry/memory.d.ts +24 -0
- package/dist/telemetry/memory.js +75 -0
- package/dist/telemetry/migrate.d.ts +26 -0
- package/dist/telemetry/migrate.js +40 -0
- package/dist/telemetry/postgres.d.ts +6 -0
- package/dist/telemetry/postgres.js +139 -0
- package/dist/telemetry/retention.d.ts +131 -0
- package/dist/telemetry/retention.js +217 -0
- package/dist/telemetry/schema.d.ts +113 -0
- package/dist/telemetry/schema.js +33 -0
- package/dist/telemetry/sink.d.ts +42 -0
- package/dist/telemetry/sink.js +61 -0
- package/dist/testing/contracts.d.ts +34 -0
- package/dist/testing/contracts.js +34 -0
- package/dist/testing/definitions.d.ts +15 -0
- package/dist/testing/definitions.js +48 -0
- package/dist/testing/doubles.d.ts +94 -0
- package/dist/testing/doubles.js +141 -0
- package/dist/testing/episode-harness.d.ts +49 -0
- package/dist/testing/episode-harness.js +65 -0
- package/dist/testing/filesystem.d.ts +17 -0
- package/dist/testing/filesystem.js +17 -0
- package/dist/testing/fixtures.d.ts +57 -0
- package/dist/testing/fixtures.js +84 -0
- package/dist/testing/hold-contract.d.ts +19 -0
- package/dist/testing/hold-contract.js +374 -0
- package/dist/testing/index.d.ts +41 -0
- package/dist/testing/index.js +41 -0
- package/dist/testing/journal-contract.d.ts +17 -0
- package/dist/testing/journal-contract.js +353 -0
- package/dist/testing/model-replies.d.ts +34 -0
- package/dist/testing/model-replies.js +101 -0
- package/dist/testing/primitives.d.ts +7 -0
- package/dist/testing/primitives.js +29 -0
- package/dist/testing/reader-signal-contract.d.ts +38 -0
- package/dist/testing/reader-signal-contract.js +318 -0
- package/dist/testing/row-security.d.ts +17 -0
- package/dist/testing/row-security.js +21 -0
- package/dist/testing/store-contract.d.ts +25 -0
- package/dist/testing/store-contract.js +500 -0
- package/dist/theme/apply.d.ts +17 -0
- package/dist/theme/apply.js +60 -0
- package/dist/theme/contrast.d.ts +197 -0
- package/dist/theme/contrast.js +259 -0
- package/dist/theme/derive.d.ts +77 -0
- package/dist/theme/derive.js +167 -0
- package/dist/theme/faces.d.ts +73 -0
- package/dist/theme/faces.js +119 -0
- package/dist/theme/font-packs.d.ts +25 -0
- package/dist/theme/font-packs.js +257 -0
- package/dist/theme/index.d.ts +20 -0
- package/dist/theme/index.js +20 -0
- package/dist/theme/lab.d.ts +30 -0
- package/dist/theme/lab.js +46 -0
- package/dist/theme/library.d.ts +114 -0
- package/dist/theme/library.js +300 -0
- package/dist/theme/measure.d.ts +144 -0
- package/dist/theme/measure.js +145 -0
- package/dist/theme/palettes.d.ts +64 -0
- package/dist/theme/palettes.js +497 -0
- package/dist/theme/registry.d.ts +59 -0
- package/dist/theme/registry.js +60 -0
- package/dist/theme/separation.d.ts +177 -0
- package/dist/theme/separation.js +203 -0
- package/dist/theme/style-presets.d.ts +60 -0
- package/dist/theme/style-presets.js +124 -0
- package/dist/theme/theme.d.ts +253 -0
- package/dist/theme/theme.js +171 -0
- package/dist/tree/apply.d.ts +16 -0
- package/dist/tree/apply.js +104 -0
- package/dist/tree/builders.d.ts +19 -0
- package/dist/tree/builders.js +20 -0
- package/dist/tree/compare.d.ts +68 -0
- package/dist/tree/compare.js +75 -0
- package/dist/tree/configuration.d.ts +25 -0
- package/dist/tree/configuration.js +108 -0
- package/dist/tree/delta.d.ts +288 -0
- package/dist/tree/delta.js +88 -0
- package/dist/tree/errors.d.ts +69 -0
- package/dist/tree/errors.js +34 -0
- package/dist/tree/identity.d.ts +117 -0
- package/dist/tree/identity.js +145 -0
- package/dist/tree/index.d.ts +21 -0
- package/dist/tree/index.js +21 -0
- package/dist/tree/inverse.d.ts +24 -0
- package/dist/tree/inverse.js +112 -0
- package/dist/tree/mutation.d.ts +18 -0
- package/dist/tree/mutation.js +49 -0
- package/dist/tree/naming.d.ts +4 -0
- package/dist/tree/naming.js +35 -0
- package/dist/tree/navigation.d.ts +38 -0
- package/dist/tree/navigation.js +83 -0
- package/dist/tree/node.d.ts +103 -0
- package/dist/tree/node.js +46 -0
- package/dist/tree/outline.d.ts +28 -0
- package/dist/tree/outline.js +10 -0
- package/dist/tree/tree.d.ts +83 -0
- package/dist/tree/tree.js +62 -0
- package/dist/write/commit.d.ts +124 -0
- package/dist/write/commit.js +234 -0
- package/dist/write/held.d.ts +674 -0
- package/dist/write/held.js +185 -0
- package/dist/write/index.d.ts +11 -0
- package/dist/write/index.js +11 -0
- package/dist/write/liveness.d.ts +132 -0
- package/dist/write/liveness.js +91 -0
- package/dist/write/revert.d.ts +79 -0
- package/dist/write/revert.js +134 -0
- package/package.json +160 -0
|
@@ -0,0 +1,2310 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type IntentId, type NodeId, type ProposalId, type TreeId } from "../ids.js";
|
|
3
|
+
import { type PrimitiveType } from "../primitive-type.js";
|
|
4
|
+
import { type Disposition, type DispositionReason } from "../runtime/disposition.js";
|
|
5
|
+
import type { RuntimeEventEnvelope } from "../runtime/events.js";
|
|
6
|
+
import { type IntentOrigin } from "../runtime/intent.js";
|
|
7
|
+
import { type ProposedChange } from "../runtime/proposal.js";
|
|
8
|
+
import { type StakeLevel } from "../runtime/stake-level.js";
|
|
9
|
+
/**
|
|
10
|
+
* What §6 keeps, and what it deliberately does not.
|
|
11
|
+
*
|
|
12
|
+
* A `RuntimeEvent` is the runtime talking to itself in a single process: it
|
|
13
|
+
* carries whole assessments and whole inverse deltas because the next stage
|
|
14
|
+
* needs them. A telemetry record is what survives the request, so it is a
|
|
15
|
+
* narrowing of that stream rather than a copy of it (0023). Three rules decide
|
|
16
|
+
* what crosses:
|
|
17
|
+
*
|
|
18
|
+
* - **The delta of a proposal is kept.** For a change that was refused, held and
|
|
19
|
+
* discarded, or never applied, this journal is the only record it ever
|
|
20
|
+
* existed — the revision log by construction holds only what was applied.
|
|
21
|
+
* - **Anything the log already holds is dropped.** An applied change's inverse
|
|
22
|
+
* is in the log with its provenance, and storing it twice invites two stores
|
|
23
|
+
* to disagree about the same delta.
|
|
24
|
+
* - **The utterance is not kept.** Telemetry is retained and aggregated; what
|
|
25
|
+
* someone typed is content, and provenance's `promptHash` already exists for
|
|
26
|
+
* hosts that want to group identical asks without keeping their text.
|
|
27
|
+
*
|
|
28
|
+
* The event names mirror `RuntimeEvent` one for one. A stage the runtime
|
|
29
|
+
* narrates but telemetry silently discarded would be a stage nobody could prove
|
|
30
|
+
* ran, so narrowing changes payloads and never membership.
|
|
31
|
+
*
|
|
32
|
+
* A field added after records exist is **optional and never defaulted** (0045).
|
|
33
|
+
* A record written before a field existed did not decline to say it — it could
|
|
34
|
+
* not, and a default would put a number in its mouth.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* A failure, as telemetry stores it: the code, and a sentence the runtime wrote
|
|
38
|
+
* about it. `code` is an open string rather than a mirror of §1/§2/§5's error
|
|
39
|
+
* taxonomies on purpose — adding an error code somewhere else in the codebase
|
|
40
|
+
* must not make records written yesterday fail to parse today.
|
|
41
|
+
*/
|
|
42
|
+
export declare const telemetryFailureSchema: z.ZodObject<{
|
|
43
|
+
code: z.ZodString;
|
|
44
|
+
detail: z.ZodString;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
code: string;
|
|
47
|
+
detail: string;
|
|
48
|
+
}, {
|
|
49
|
+
code: string;
|
|
50
|
+
detail: string;
|
|
51
|
+
}>;
|
|
52
|
+
export type TelemetryFailure = {
|
|
53
|
+
readonly code: string;
|
|
54
|
+
readonly detail: string;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* The intent, minus what was said. Origin, scope and the revision it was aimed
|
|
58
|
+
* at are what an analysis needs; `utteranceLength` keeps "a one-word ask" and
|
|
59
|
+
* "three paragraphs" distinguishable without storing either.
|
|
60
|
+
*
|
|
61
|
+
* `actor` is kept for the same reason `origin` is: it is an identifier a query
|
|
62
|
+
* groups by, not content someone typed. The rule 0023 set is about the
|
|
63
|
+
* utterance, and an identity is on the other side of it.
|
|
64
|
+
*/
|
|
65
|
+
export declare const intentSummarySchema: z.ZodObject<{
|
|
66
|
+
intentId: z.ZodBranded<z.ZodString, "IntentId">;
|
|
67
|
+
origin: z.ZodEnum<["user-instruction", "system-signal", "scheduled-adaptation", "developer"]>;
|
|
68
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
69
|
+
baseRevision: z.ZodNumber;
|
|
70
|
+
scopeNodeId: z.ZodOptional<z.ZodBranded<z.ZodString, "NodeId">>;
|
|
71
|
+
utteranceLength: z.ZodNumber;
|
|
72
|
+
observedAt: z.ZodString;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
75
|
+
baseRevision: number;
|
|
76
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
77
|
+
observedAt: string;
|
|
78
|
+
utteranceLength: number;
|
|
79
|
+
actor?: string | undefined;
|
|
80
|
+
scopeNodeId?: (string & z.BRAND<"NodeId">) | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
83
|
+
baseRevision: number;
|
|
84
|
+
intentId: string;
|
|
85
|
+
observedAt: string;
|
|
86
|
+
utteranceLength: number;
|
|
87
|
+
actor?: string | undefined;
|
|
88
|
+
scopeNodeId?: string | undefined;
|
|
89
|
+
}>;
|
|
90
|
+
export type IntentSummary = {
|
|
91
|
+
readonly intentId: IntentId;
|
|
92
|
+
readonly origin: IntentOrigin;
|
|
93
|
+
readonly actor?: string;
|
|
94
|
+
readonly baseRevision: number;
|
|
95
|
+
readonly scopeNodeId?: NodeId;
|
|
96
|
+
readonly utteranceLength: number;
|
|
97
|
+
readonly observedAt: string;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* What the Gate was looking at, in the shape a query can group by. The
|
|
101
|
+
* disposition that follows says stakes, reversibility and confidence; this says
|
|
102
|
+
* how big the change was and what it touched, which is what makes "the Gate
|
|
103
|
+
* refuses this class of change" measurable rather than anecdotal.
|
|
104
|
+
*/
|
|
105
|
+
export declare const assessmentSummarySchema: z.ZodObject<{
|
|
106
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
107
|
+
stakes: z.ZodEnum<["low", "medium", "high", "critical"]>;
|
|
108
|
+
reversible: z.ZodBoolean;
|
|
109
|
+
operationCount: z.ZodNumber;
|
|
110
|
+
insertedNodeCount: z.ZodNumber;
|
|
111
|
+
removedNodeCount: z.ZodNumber;
|
|
112
|
+
movedNodeCount: z.ZodNumber;
|
|
113
|
+
configuredNodeCount: z.ZodNumber;
|
|
114
|
+
touchedPrimitiveTypes: z.ZodArray<z.ZodBranded<z.ZodString, "PrimitiveType">, "many">;
|
|
115
|
+
/**
|
|
116
|
+
* Bounded, non-identifying, a subset of the touched types, and the input to
|
|
117
|
+
* the only `critical` stake factor. A corpus that cannot group by "the Gate
|
|
118
|
+
* saw this type destroyed" cannot ask the question the factor exists for.
|
|
119
|
+
*/
|
|
120
|
+
removedPrimitiveTypes: z.ZodOptional<z.ZodArray<z.ZodBranded<z.ZodString, "PrimitiveType">, "many">>;
|
|
121
|
+
relocatedPrimitiveTypes: z.ZodOptional<z.ZodArray<z.ZodBranded<z.ZodString, "PrimitiveType">, "many">>;
|
|
122
|
+
relocatedNodeCount: z.ZodOptional<z.ZodNumber>;
|
|
123
|
+
shallowestAffectedDepth: z.ZodNumber;
|
|
124
|
+
/** Nodes the inverse would have to carry — the content a removal destroyed. */
|
|
125
|
+
retainedNodeCount: z.ZodNumber;
|
|
126
|
+
irreversibilityReasons: z.ZodArray<z.ZodString, "many">;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
129
|
+
removedNodeCount: number;
|
|
130
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
131
|
+
reversible: boolean;
|
|
132
|
+
operationCount: number;
|
|
133
|
+
insertedNodeCount: number;
|
|
134
|
+
movedNodeCount: number;
|
|
135
|
+
configuredNodeCount: number;
|
|
136
|
+
touchedPrimitiveTypes: (string & z.BRAND<"PrimitiveType">)[];
|
|
137
|
+
shallowestAffectedDepth: number;
|
|
138
|
+
retainedNodeCount: number;
|
|
139
|
+
irreversibilityReasons: string[];
|
|
140
|
+
removedPrimitiveTypes?: (string & z.BRAND<"PrimitiveType">)[] | undefined;
|
|
141
|
+
relocatedPrimitiveTypes?: (string & z.BRAND<"PrimitiveType">)[] | undefined;
|
|
142
|
+
relocatedNodeCount?: number | undefined;
|
|
143
|
+
}, {
|
|
144
|
+
proposalId: string;
|
|
145
|
+
removedNodeCount: number;
|
|
146
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
147
|
+
reversible: boolean;
|
|
148
|
+
operationCount: number;
|
|
149
|
+
insertedNodeCount: number;
|
|
150
|
+
movedNodeCount: number;
|
|
151
|
+
configuredNodeCount: number;
|
|
152
|
+
touchedPrimitiveTypes: string[];
|
|
153
|
+
shallowestAffectedDepth: number;
|
|
154
|
+
retainedNodeCount: number;
|
|
155
|
+
irreversibilityReasons: string[];
|
|
156
|
+
removedPrimitiveTypes?: string[] | undefined;
|
|
157
|
+
relocatedPrimitiveTypes?: string[] | undefined;
|
|
158
|
+
relocatedNodeCount?: number | undefined;
|
|
159
|
+
}>;
|
|
160
|
+
export type AssessmentSummary = {
|
|
161
|
+
readonly proposalId: ProposalId;
|
|
162
|
+
readonly stakes: StakeLevel;
|
|
163
|
+
readonly reversible: boolean;
|
|
164
|
+
readonly operationCount: number;
|
|
165
|
+
readonly insertedNodeCount: number;
|
|
166
|
+
readonly removedNodeCount: number;
|
|
167
|
+
readonly movedNodeCount: number;
|
|
168
|
+
readonly configuredNodeCount: number;
|
|
169
|
+
readonly touchedPrimitiveTypes: readonly PrimitiveType[];
|
|
170
|
+
/** Absent on a record written before the field existed, never defaulted (0045). */
|
|
171
|
+
readonly removedPrimitiveTypes?: readonly PrimitiveType[];
|
|
172
|
+
readonly relocatedPrimitiveTypes?: readonly PrimitiveType[];
|
|
173
|
+
readonly relocatedNodeCount?: number;
|
|
174
|
+
readonly shallowestAffectedDepth: number;
|
|
175
|
+
readonly retainedNodeCount: number;
|
|
176
|
+
readonly irreversibilityReasons: readonly string[];
|
|
177
|
+
};
|
|
178
|
+
export declare const telemetryEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
179
|
+
type: z.ZodLiteral<"intent-received">;
|
|
180
|
+
intent: z.ZodObject<{
|
|
181
|
+
intentId: z.ZodBranded<z.ZodString, "IntentId">;
|
|
182
|
+
origin: z.ZodEnum<["user-instruction", "system-signal", "scheduled-adaptation", "developer"]>;
|
|
183
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
184
|
+
baseRevision: z.ZodNumber;
|
|
185
|
+
scopeNodeId: z.ZodOptional<z.ZodBranded<z.ZodString, "NodeId">>;
|
|
186
|
+
utteranceLength: z.ZodNumber;
|
|
187
|
+
observedAt: z.ZodString;
|
|
188
|
+
}, "strip", z.ZodTypeAny, {
|
|
189
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
190
|
+
baseRevision: number;
|
|
191
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
192
|
+
observedAt: string;
|
|
193
|
+
utteranceLength: number;
|
|
194
|
+
actor?: string | undefined;
|
|
195
|
+
scopeNodeId?: (string & z.BRAND<"NodeId">) | undefined;
|
|
196
|
+
}, {
|
|
197
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
198
|
+
baseRevision: number;
|
|
199
|
+
intentId: string;
|
|
200
|
+
observedAt: string;
|
|
201
|
+
utteranceLength: number;
|
|
202
|
+
actor?: string | undefined;
|
|
203
|
+
scopeNodeId?: string | undefined;
|
|
204
|
+
}>;
|
|
205
|
+
}, "strip", z.ZodTypeAny, {
|
|
206
|
+
type: "intent-received";
|
|
207
|
+
intent: {
|
|
208
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
209
|
+
baseRevision: number;
|
|
210
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
211
|
+
observedAt: string;
|
|
212
|
+
utteranceLength: number;
|
|
213
|
+
actor?: string | undefined;
|
|
214
|
+
scopeNodeId?: (string & z.BRAND<"NodeId">) | undefined;
|
|
215
|
+
};
|
|
216
|
+
}, {
|
|
217
|
+
type: "intent-received";
|
|
218
|
+
intent: {
|
|
219
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
220
|
+
baseRevision: number;
|
|
221
|
+
intentId: string;
|
|
222
|
+
observedAt: string;
|
|
223
|
+
utteranceLength: number;
|
|
224
|
+
actor?: string | undefined;
|
|
225
|
+
scopeNodeId?: string | undefined;
|
|
226
|
+
};
|
|
227
|
+
}>, z.ZodObject<{
|
|
228
|
+
type: z.ZodLiteral<"policy-resolved">;
|
|
229
|
+
intentId: z.ZodBranded<z.ZodString, "IntentId">;
|
|
230
|
+
policyId: z.ZodString;
|
|
231
|
+
policyFingerprint: z.ZodOptional<z.ZodString>;
|
|
232
|
+
}, "strip", z.ZodTypeAny, {
|
|
233
|
+
type: "policy-resolved";
|
|
234
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
235
|
+
policyId: string;
|
|
236
|
+
policyFingerprint?: string | undefined;
|
|
237
|
+
}, {
|
|
238
|
+
type: "policy-resolved";
|
|
239
|
+
intentId: string;
|
|
240
|
+
policyId: string;
|
|
241
|
+
policyFingerprint?: string | undefined;
|
|
242
|
+
}>, z.ZodObject<{
|
|
243
|
+
type: z.ZodLiteral<"interpretation-failed">;
|
|
244
|
+
intentId: z.ZodBranded<z.ZodString, "IntentId">;
|
|
245
|
+
failure: z.ZodObject<{
|
|
246
|
+
code: z.ZodString;
|
|
247
|
+
detail: z.ZodString;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
code: string;
|
|
250
|
+
detail: string;
|
|
251
|
+
}, {
|
|
252
|
+
code: string;
|
|
253
|
+
detail: string;
|
|
254
|
+
}>;
|
|
255
|
+
}, "strip", z.ZodTypeAny, {
|
|
256
|
+
type: "interpretation-failed";
|
|
257
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
258
|
+
failure: {
|
|
259
|
+
code: string;
|
|
260
|
+
detail: string;
|
|
261
|
+
};
|
|
262
|
+
}, {
|
|
263
|
+
type: "interpretation-failed";
|
|
264
|
+
intentId: string;
|
|
265
|
+
failure: {
|
|
266
|
+
code: string;
|
|
267
|
+
detail: string;
|
|
268
|
+
};
|
|
269
|
+
}>, z.ZodObject<{
|
|
270
|
+
type: z.ZodLiteral<"change-proposed">;
|
|
271
|
+
proposal: z.ZodObject<{
|
|
272
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
273
|
+
intentId: z.ZodBranded<z.ZodString, "IntentId">;
|
|
274
|
+
delta: z.ZodObject<{
|
|
275
|
+
deltaId: z.ZodBranded<z.ZodString, "DeltaId">;
|
|
276
|
+
treeId: z.ZodBranded<z.ZodString, "TreeId">;
|
|
277
|
+
baseRevision: z.ZodNumber;
|
|
278
|
+
operations: z.ZodArray<z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
|
|
279
|
+
op: z.ZodLiteral<"insert">;
|
|
280
|
+
parentId: z.ZodBranded<z.ZodString, "NodeId">;
|
|
281
|
+
index: z.ZodNumber;
|
|
282
|
+
node: z.ZodType<import("../index.js").LoomNode, z.ZodTypeDef, unknown>;
|
|
283
|
+
}, "strip", z.ZodTypeAny, {
|
|
284
|
+
index: number;
|
|
285
|
+
op: "insert";
|
|
286
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
287
|
+
node: import("../index.js").LoomNode;
|
|
288
|
+
}, {
|
|
289
|
+
index: number;
|
|
290
|
+
op: "insert";
|
|
291
|
+
parentId: string;
|
|
292
|
+
node?: unknown;
|
|
293
|
+
}>, z.ZodObject<{
|
|
294
|
+
op: z.ZodLiteral<"remove">;
|
|
295
|
+
nodeId: z.ZodBranded<z.ZodString, "NodeId">;
|
|
296
|
+
}, "strip", z.ZodTypeAny, {
|
|
297
|
+
op: "remove";
|
|
298
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
299
|
+
}, {
|
|
300
|
+
op: "remove";
|
|
301
|
+
nodeId: string;
|
|
302
|
+
}>, z.ZodObject<{
|
|
303
|
+
op: z.ZodLiteral<"move">;
|
|
304
|
+
nodeId: z.ZodBranded<z.ZodString, "NodeId">;
|
|
305
|
+
parentId: z.ZodBranded<z.ZodString, "NodeId">;
|
|
306
|
+
index: z.ZodNumber;
|
|
307
|
+
}, "strip", z.ZodTypeAny, {
|
|
308
|
+
index: number;
|
|
309
|
+
op: "move";
|
|
310
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
311
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
312
|
+
}, {
|
|
313
|
+
index: number;
|
|
314
|
+
op: "move";
|
|
315
|
+
parentId: string;
|
|
316
|
+
nodeId: string;
|
|
317
|
+
}>, z.ZodObject<{
|
|
318
|
+
op: z.ZodLiteral<"configure">;
|
|
319
|
+
nodeId: z.ZodBranded<z.ZodString, "NodeId">;
|
|
320
|
+
set: z.ZodDefault<z.ZodType<import("../json.js").JsonObject, z.ZodTypeDef, import("../json.js").JsonObject>>;
|
|
321
|
+
unset: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
322
|
+
}, "strip", z.ZodTypeAny, {
|
|
323
|
+
set: import("../json.js").JsonObject;
|
|
324
|
+
op: "configure";
|
|
325
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
326
|
+
unset: string[];
|
|
327
|
+
}, {
|
|
328
|
+
op: "configure";
|
|
329
|
+
nodeId: string;
|
|
330
|
+
set?: import("../json.js").JsonObject | undefined;
|
|
331
|
+
unset?: string[] | undefined;
|
|
332
|
+
}>]>, "many">;
|
|
333
|
+
}, "strip", z.ZodTypeAny, {
|
|
334
|
+
treeId: string & z.BRAND<"TreeId">;
|
|
335
|
+
operations: ({
|
|
336
|
+
index: number;
|
|
337
|
+
op: "insert";
|
|
338
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
339
|
+
node: import("../index.js").LoomNode;
|
|
340
|
+
} | {
|
|
341
|
+
op: "remove";
|
|
342
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
343
|
+
} | {
|
|
344
|
+
index: number;
|
|
345
|
+
op: "move";
|
|
346
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
347
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
348
|
+
} | {
|
|
349
|
+
set: import("../json.js").JsonObject;
|
|
350
|
+
op: "configure";
|
|
351
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
352
|
+
unset: string[];
|
|
353
|
+
})[];
|
|
354
|
+
deltaId: string & z.BRAND<"DeltaId">;
|
|
355
|
+
baseRevision: number;
|
|
356
|
+
}, {
|
|
357
|
+
treeId: string;
|
|
358
|
+
operations: ({
|
|
359
|
+
index: number;
|
|
360
|
+
op: "insert";
|
|
361
|
+
parentId: string;
|
|
362
|
+
node?: unknown;
|
|
363
|
+
} | {
|
|
364
|
+
op: "remove";
|
|
365
|
+
nodeId: string;
|
|
366
|
+
} | {
|
|
367
|
+
index: number;
|
|
368
|
+
op: "move";
|
|
369
|
+
parentId: string;
|
|
370
|
+
nodeId: string;
|
|
371
|
+
} | {
|
|
372
|
+
op: "configure";
|
|
373
|
+
nodeId: string;
|
|
374
|
+
set?: import("../json.js").JsonObject | undefined;
|
|
375
|
+
unset?: string[] | undefined;
|
|
376
|
+
})[];
|
|
377
|
+
deltaId: string;
|
|
378
|
+
baseRevision: number;
|
|
379
|
+
}>;
|
|
380
|
+
rationale: z.ZodString;
|
|
381
|
+
provenance: z.ZodObject<{
|
|
382
|
+
origin: z.ZodEnum<["user-instruction", "system-signal", "scheduled-adaptation", "developer"]>;
|
|
383
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
384
|
+
interpreter: z.ZodString;
|
|
385
|
+
authoredBy: z.ZodDefault<z.ZodEnum<["model", "runtime"]>>;
|
|
386
|
+
promptHash: z.ZodOptional<z.ZodString>;
|
|
387
|
+
undoes: z.ZodOptional<z.ZodNumber>;
|
|
388
|
+
confidence: z.ZodNumber;
|
|
389
|
+
interpretedAt: z.ZodString;
|
|
390
|
+
}, "strip", z.ZodTypeAny, {
|
|
391
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
392
|
+
confidence: number;
|
|
393
|
+
interpreter: string;
|
|
394
|
+
authoredBy: "model" | "runtime";
|
|
395
|
+
interpretedAt: string;
|
|
396
|
+
actor?: string | undefined;
|
|
397
|
+
promptHash?: string | undefined;
|
|
398
|
+
undoes?: number | undefined;
|
|
399
|
+
}, {
|
|
400
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
401
|
+
confidence: number;
|
|
402
|
+
interpreter: string;
|
|
403
|
+
interpretedAt: string;
|
|
404
|
+
actor?: string | undefined;
|
|
405
|
+
authoredBy?: "model" | "runtime" | undefined;
|
|
406
|
+
promptHash?: string | undefined;
|
|
407
|
+
undoes?: number | undefined;
|
|
408
|
+
}>;
|
|
409
|
+
repairOf: z.ZodOptional<z.ZodBranded<z.ZodString, "ProposalId">>;
|
|
410
|
+
discards: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
411
|
+
revision: z.ZodNumber;
|
|
412
|
+
nodeIds: z.ZodArray<z.ZodBranded<z.ZodString, "NodeId">, "many">;
|
|
413
|
+
}, "strip", z.ZodTypeAny, {
|
|
414
|
+
revision: number;
|
|
415
|
+
nodeIds: (string & z.BRAND<"NodeId">)[];
|
|
416
|
+
}, {
|
|
417
|
+
revision: number;
|
|
418
|
+
nodeIds: string[];
|
|
419
|
+
}>, "many">>;
|
|
420
|
+
}, "strip", z.ZodTypeAny, {
|
|
421
|
+
rationale: string;
|
|
422
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
423
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
424
|
+
delta: {
|
|
425
|
+
treeId: string & z.BRAND<"TreeId">;
|
|
426
|
+
operations: ({
|
|
427
|
+
index: number;
|
|
428
|
+
op: "insert";
|
|
429
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
430
|
+
node: import("../index.js").LoomNode;
|
|
431
|
+
} | {
|
|
432
|
+
op: "remove";
|
|
433
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
434
|
+
} | {
|
|
435
|
+
index: number;
|
|
436
|
+
op: "move";
|
|
437
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
438
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
439
|
+
} | {
|
|
440
|
+
set: import("../json.js").JsonObject;
|
|
441
|
+
op: "configure";
|
|
442
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
443
|
+
unset: string[];
|
|
444
|
+
})[];
|
|
445
|
+
deltaId: string & z.BRAND<"DeltaId">;
|
|
446
|
+
baseRevision: number;
|
|
447
|
+
};
|
|
448
|
+
provenance: {
|
|
449
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
450
|
+
confidence: number;
|
|
451
|
+
interpreter: string;
|
|
452
|
+
authoredBy: "model" | "runtime";
|
|
453
|
+
interpretedAt: string;
|
|
454
|
+
actor?: string | undefined;
|
|
455
|
+
promptHash?: string | undefined;
|
|
456
|
+
undoes?: number | undefined;
|
|
457
|
+
};
|
|
458
|
+
repairOf?: (string & z.BRAND<"ProposalId">) | undefined;
|
|
459
|
+
discards?: {
|
|
460
|
+
revision: number;
|
|
461
|
+
nodeIds: (string & z.BRAND<"NodeId">)[];
|
|
462
|
+
}[] | undefined;
|
|
463
|
+
}, {
|
|
464
|
+
rationale: string;
|
|
465
|
+
intentId: string;
|
|
466
|
+
proposalId: string;
|
|
467
|
+
delta: {
|
|
468
|
+
treeId: string;
|
|
469
|
+
operations: ({
|
|
470
|
+
index: number;
|
|
471
|
+
op: "insert";
|
|
472
|
+
parentId: string;
|
|
473
|
+
node?: unknown;
|
|
474
|
+
} | {
|
|
475
|
+
op: "remove";
|
|
476
|
+
nodeId: string;
|
|
477
|
+
} | {
|
|
478
|
+
index: number;
|
|
479
|
+
op: "move";
|
|
480
|
+
parentId: string;
|
|
481
|
+
nodeId: string;
|
|
482
|
+
} | {
|
|
483
|
+
op: "configure";
|
|
484
|
+
nodeId: string;
|
|
485
|
+
set?: import("../json.js").JsonObject | undefined;
|
|
486
|
+
unset?: string[] | undefined;
|
|
487
|
+
})[];
|
|
488
|
+
deltaId: string;
|
|
489
|
+
baseRevision: number;
|
|
490
|
+
};
|
|
491
|
+
provenance: {
|
|
492
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
493
|
+
confidence: number;
|
|
494
|
+
interpreter: string;
|
|
495
|
+
interpretedAt: string;
|
|
496
|
+
actor?: string | undefined;
|
|
497
|
+
authoredBy?: "model" | "runtime" | undefined;
|
|
498
|
+
promptHash?: string | undefined;
|
|
499
|
+
undoes?: number | undefined;
|
|
500
|
+
};
|
|
501
|
+
repairOf?: string | undefined;
|
|
502
|
+
discards?: {
|
|
503
|
+
revision: number;
|
|
504
|
+
nodeIds: string[];
|
|
505
|
+
}[] | undefined;
|
|
506
|
+
}>;
|
|
507
|
+
}, "strip", z.ZodTypeAny, {
|
|
508
|
+
type: "change-proposed";
|
|
509
|
+
proposal: {
|
|
510
|
+
rationale: string;
|
|
511
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
512
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
513
|
+
delta: {
|
|
514
|
+
treeId: string & z.BRAND<"TreeId">;
|
|
515
|
+
operations: ({
|
|
516
|
+
index: number;
|
|
517
|
+
op: "insert";
|
|
518
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
519
|
+
node: import("../index.js").LoomNode;
|
|
520
|
+
} | {
|
|
521
|
+
op: "remove";
|
|
522
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
523
|
+
} | {
|
|
524
|
+
index: number;
|
|
525
|
+
op: "move";
|
|
526
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
527
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
528
|
+
} | {
|
|
529
|
+
set: import("../json.js").JsonObject;
|
|
530
|
+
op: "configure";
|
|
531
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
532
|
+
unset: string[];
|
|
533
|
+
})[];
|
|
534
|
+
deltaId: string & z.BRAND<"DeltaId">;
|
|
535
|
+
baseRevision: number;
|
|
536
|
+
};
|
|
537
|
+
provenance: {
|
|
538
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
539
|
+
confidence: number;
|
|
540
|
+
interpreter: string;
|
|
541
|
+
authoredBy: "model" | "runtime";
|
|
542
|
+
interpretedAt: string;
|
|
543
|
+
actor?: string | undefined;
|
|
544
|
+
promptHash?: string | undefined;
|
|
545
|
+
undoes?: number | undefined;
|
|
546
|
+
};
|
|
547
|
+
repairOf?: (string & z.BRAND<"ProposalId">) | undefined;
|
|
548
|
+
discards?: {
|
|
549
|
+
revision: number;
|
|
550
|
+
nodeIds: (string & z.BRAND<"NodeId">)[];
|
|
551
|
+
}[] | undefined;
|
|
552
|
+
};
|
|
553
|
+
}, {
|
|
554
|
+
type: "change-proposed";
|
|
555
|
+
proposal: {
|
|
556
|
+
rationale: string;
|
|
557
|
+
intentId: string;
|
|
558
|
+
proposalId: string;
|
|
559
|
+
delta: {
|
|
560
|
+
treeId: string;
|
|
561
|
+
operations: ({
|
|
562
|
+
index: number;
|
|
563
|
+
op: "insert";
|
|
564
|
+
parentId: string;
|
|
565
|
+
node?: unknown;
|
|
566
|
+
} | {
|
|
567
|
+
op: "remove";
|
|
568
|
+
nodeId: string;
|
|
569
|
+
} | {
|
|
570
|
+
index: number;
|
|
571
|
+
op: "move";
|
|
572
|
+
parentId: string;
|
|
573
|
+
nodeId: string;
|
|
574
|
+
} | {
|
|
575
|
+
op: "configure";
|
|
576
|
+
nodeId: string;
|
|
577
|
+
set?: import("../json.js").JsonObject | undefined;
|
|
578
|
+
unset?: string[] | undefined;
|
|
579
|
+
})[];
|
|
580
|
+
deltaId: string;
|
|
581
|
+
baseRevision: number;
|
|
582
|
+
};
|
|
583
|
+
provenance: {
|
|
584
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
585
|
+
confidence: number;
|
|
586
|
+
interpreter: string;
|
|
587
|
+
interpretedAt: string;
|
|
588
|
+
actor?: string | undefined;
|
|
589
|
+
authoredBy?: "model" | "runtime" | undefined;
|
|
590
|
+
promptHash?: string | undefined;
|
|
591
|
+
undoes?: number | undefined;
|
|
592
|
+
};
|
|
593
|
+
repairOf?: string | undefined;
|
|
594
|
+
discards?: {
|
|
595
|
+
revision: number;
|
|
596
|
+
nodeIds: string[];
|
|
597
|
+
}[] | undefined;
|
|
598
|
+
};
|
|
599
|
+
}>, z.ZodObject<{
|
|
600
|
+
type: z.ZodLiteral<"assessment-failed">;
|
|
601
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
602
|
+
failure: z.ZodObject<{
|
|
603
|
+
code: z.ZodString;
|
|
604
|
+
detail: z.ZodString;
|
|
605
|
+
}, "strip", z.ZodTypeAny, {
|
|
606
|
+
code: string;
|
|
607
|
+
detail: string;
|
|
608
|
+
}, {
|
|
609
|
+
code: string;
|
|
610
|
+
detail: string;
|
|
611
|
+
}>;
|
|
612
|
+
}, "strip", z.ZodTypeAny, {
|
|
613
|
+
type: "assessment-failed";
|
|
614
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
615
|
+
failure: {
|
|
616
|
+
code: string;
|
|
617
|
+
detail: string;
|
|
618
|
+
};
|
|
619
|
+
}, {
|
|
620
|
+
type: "assessment-failed";
|
|
621
|
+
proposalId: string;
|
|
622
|
+
failure: {
|
|
623
|
+
code: string;
|
|
624
|
+
detail: string;
|
|
625
|
+
};
|
|
626
|
+
}>, z.ZodObject<{
|
|
627
|
+
type: z.ZodLiteral<"change-assessed">;
|
|
628
|
+
assessment: z.ZodObject<{
|
|
629
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
630
|
+
stakes: z.ZodEnum<["low", "medium", "high", "critical"]>;
|
|
631
|
+
reversible: z.ZodBoolean;
|
|
632
|
+
operationCount: z.ZodNumber;
|
|
633
|
+
insertedNodeCount: z.ZodNumber;
|
|
634
|
+
removedNodeCount: z.ZodNumber;
|
|
635
|
+
movedNodeCount: z.ZodNumber;
|
|
636
|
+
configuredNodeCount: z.ZodNumber;
|
|
637
|
+
touchedPrimitiveTypes: z.ZodArray<z.ZodBranded<z.ZodString, "PrimitiveType">, "many">;
|
|
638
|
+
/**
|
|
639
|
+
* Bounded, non-identifying, a subset of the touched types, and the input to
|
|
640
|
+
* the only `critical` stake factor. A corpus that cannot group by "the Gate
|
|
641
|
+
* saw this type destroyed" cannot ask the question the factor exists for.
|
|
642
|
+
*/
|
|
643
|
+
removedPrimitiveTypes: z.ZodOptional<z.ZodArray<z.ZodBranded<z.ZodString, "PrimitiveType">, "many">>;
|
|
644
|
+
relocatedPrimitiveTypes: z.ZodOptional<z.ZodArray<z.ZodBranded<z.ZodString, "PrimitiveType">, "many">>;
|
|
645
|
+
relocatedNodeCount: z.ZodOptional<z.ZodNumber>;
|
|
646
|
+
shallowestAffectedDepth: z.ZodNumber;
|
|
647
|
+
/** Nodes the inverse would have to carry — the content a removal destroyed. */
|
|
648
|
+
retainedNodeCount: z.ZodNumber;
|
|
649
|
+
irreversibilityReasons: z.ZodArray<z.ZodString, "many">;
|
|
650
|
+
}, "strip", z.ZodTypeAny, {
|
|
651
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
652
|
+
removedNodeCount: number;
|
|
653
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
654
|
+
reversible: boolean;
|
|
655
|
+
operationCount: number;
|
|
656
|
+
insertedNodeCount: number;
|
|
657
|
+
movedNodeCount: number;
|
|
658
|
+
configuredNodeCount: number;
|
|
659
|
+
touchedPrimitiveTypes: (string & z.BRAND<"PrimitiveType">)[];
|
|
660
|
+
shallowestAffectedDepth: number;
|
|
661
|
+
retainedNodeCount: number;
|
|
662
|
+
irreversibilityReasons: string[];
|
|
663
|
+
removedPrimitiveTypes?: (string & z.BRAND<"PrimitiveType">)[] | undefined;
|
|
664
|
+
relocatedPrimitiveTypes?: (string & z.BRAND<"PrimitiveType">)[] | undefined;
|
|
665
|
+
relocatedNodeCount?: number | undefined;
|
|
666
|
+
}, {
|
|
667
|
+
proposalId: string;
|
|
668
|
+
removedNodeCount: number;
|
|
669
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
670
|
+
reversible: boolean;
|
|
671
|
+
operationCount: number;
|
|
672
|
+
insertedNodeCount: number;
|
|
673
|
+
movedNodeCount: number;
|
|
674
|
+
configuredNodeCount: number;
|
|
675
|
+
touchedPrimitiveTypes: string[];
|
|
676
|
+
shallowestAffectedDepth: number;
|
|
677
|
+
retainedNodeCount: number;
|
|
678
|
+
irreversibilityReasons: string[];
|
|
679
|
+
removedPrimitiveTypes?: string[] | undefined;
|
|
680
|
+
relocatedPrimitiveTypes?: string[] | undefined;
|
|
681
|
+
relocatedNodeCount?: number | undefined;
|
|
682
|
+
}>;
|
|
683
|
+
}, "strip", z.ZodTypeAny, {
|
|
684
|
+
type: "change-assessed";
|
|
685
|
+
assessment: {
|
|
686
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
687
|
+
removedNodeCount: number;
|
|
688
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
689
|
+
reversible: boolean;
|
|
690
|
+
operationCount: number;
|
|
691
|
+
insertedNodeCount: number;
|
|
692
|
+
movedNodeCount: number;
|
|
693
|
+
configuredNodeCount: number;
|
|
694
|
+
touchedPrimitiveTypes: (string & z.BRAND<"PrimitiveType">)[];
|
|
695
|
+
shallowestAffectedDepth: number;
|
|
696
|
+
retainedNodeCount: number;
|
|
697
|
+
irreversibilityReasons: string[];
|
|
698
|
+
removedPrimitiveTypes?: (string & z.BRAND<"PrimitiveType">)[] | undefined;
|
|
699
|
+
relocatedPrimitiveTypes?: (string & z.BRAND<"PrimitiveType">)[] | undefined;
|
|
700
|
+
relocatedNodeCount?: number | undefined;
|
|
701
|
+
};
|
|
702
|
+
}, {
|
|
703
|
+
type: "change-assessed";
|
|
704
|
+
assessment: {
|
|
705
|
+
proposalId: string;
|
|
706
|
+
removedNodeCount: number;
|
|
707
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
708
|
+
reversible: boolean;
|
|
709
|
+
operationCount: number;
|
|
710
|
+
insertedNodeCount: number;
|
|
711
|
+
movedNodeCount: number;
|
|
712
|
+
configuredNodeCount: number;
|
|
713
|
+
touchedPrimitiveTypes: string[];
|
|
714
|
+
shallowestAffectedDepth: number;
|
|
715
|
+
retainedNodeCount: number;
|
|
716
|
+
irreversibilityReasons: string[];
|
|
717
|
+
removedPrimitiveTypes?: string[] | undefined;
|
|
718
|
+
relocatedPrimitiveTypes?: string[] | undefined;
|
|
719
|
+
relocatedNodeCount?: number | undefined;
|
|
720
|
+
};
|
|
721
|
+
}>, z.ZodObject<{
|
|
722
|
+
type: z.ZodLiteral<"disposition-decided">;
|
|
723
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
724
|
+
disposition: z.ZodObject<{
|
|
725
|
+
kind: z.ZodEnum<["accepted", "requires-confirmation", "rejected"]>;
|
|
726
|
+
reason: z.ZodObject<{
|
|
727
|
+
code: z.ZodEnum<["confidence-below-floor", "stakes-at-refusal-floor", "irreversible", "discards-later-work", "redirected-submission", "repointed-binding", "stakes-above-ceiling", "confidence-below-minimum", "within-policy"]>;
|
|
728
|
+
detail: z.ZodString;
|
|
729
|
+
}, "strip", z.ZodTypeAny, {
|
|
730
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
731
|
+
detail: string;
|
|
732
|
+
}, {
|
|
733
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
734
|
+
detail: string;
|
|
735
|
+
}>;
|
|
736
|
+
stakes: z.ZodEnum<["low", "medium", "high", "critical"]>;
|
|
737
|
+
reversible: z.ZodBoolean;
|
|
738
|
+
confidence: z.ZodNumber;
|
|
739
|
+
policyId: z.ZodDefault<z.ZodString>;
|
|
740
|
+
policyFingerprint: z.ZodOptional<z.ZodString>;
|
|
741
|
+
}, "strip", z.ZodTypeAny, {
|
|
742
|
+
kind: "rejected" | "accepted" | "requires-confirmation";
|
|
743
|
+
confidence: number;
|
|
744
|
+
policyId: string;
|
|
745
|
+
reason: {
|
|
746
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
747
|
+
detail: string;
|
|
748
|
+
};
|
|
749
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
750
|
+
reversible: boolean;
|
|
751
|
+
policyFingerprint?: string | undefined;
|
|
752
|
+
}, {
|
|
753
|
+
kind: "rejected" | "accepted" | "requires-confirmation";
|
|
754
|
+
confidence: number;
|
|
755
|
+
reason: {
|
|
756
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
757
|
+
detail: string;
|
|
758
|
+
};
|
|
759
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
760
|
+
reversible: boolean;
|
|
761
|
+
policyId?: string | undefined;
|
|
762
|
+
policyFingerprint?: string | undefined;
|
|
763
|
+
}>;
|
|
764
|
+
}, "strip", z.ZodTypeAny, {
|
|
765
|
+
type: "disposition-decided";
|
|
766
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
767
|
+
disposition: {
|
|
768
|
+
kind: "rejected" | "accepted" | "requires-confirmation";
|
|
769
|
+
confidence: number;
|
|
770
|
+
policyId: string;
|
|
771
|
+
reason: {
|
|
772
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
773
|
+
detail: string;
|
|
774
|
+
};
|
|
775
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
776
|
+
reversible: boolean;
|
|
777
|
+
policyFingerprint?: string | undefined;
|
|
778
|
+
};
|
|
779
|
+
}, {
|
|
780
|
+
type: "disposition-decided";
|
|
781
|
+
proposalId: string;
|
|
782
|
+
disposition: {
|
|
783
|
+
kind: "rejected" | "accepted" | "requires-confirmation";
|
|
784
|
+
confidence: number;
|
|
785
|
+
reason: {
|
|
786
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
787
|
+
detail: string;
|
|
788
|
+
};
|
|
789
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
790
|
+
reversible: boolean;
|
|
791
|
+
policyId?: string | undefined;
|
|
792
|
+
policyFingerprint?: string | undefined;
|
|
793
|
+
};
|
|
794
|
+
}>, z.ZodObject<{
|
|
795
|
+
type: z.ZodLiteral<"repair-requested">;
|
|
796
|
+
refusedProposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
797
|
+
reason: z.ZodObject<{
|
|
798
|
+
code: z.ZodEnum<["confidence-below-floor", "stakes-at-refusal-floor", "irreversible", "discards-later-work", "redirected-submission", "repointed-binding", "stakes-above-ceiling", "confidence-below-minimum", "within-policy"]>;
|
|
799
|
+
detail: z.ZodString;
|
|
800
|
+
}, "strip", z.ZodTypeAny, {
|
|
801
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
802
|
+
detail: string;
|
|
803
|
+
}, {
|
|
804
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
805
|
+
detail: string;
|
|
806
|
+
}>;
|
|
807
|
+
}, "strip", z.ZodTypeAny, {
|
|
808
|
+
type: "repair-requested";
|
|
809
|
+
reason: {
|
|
810
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
811
|
+
detail: string;
|
|
812
|
+
};
|
|
813
|
+
refusedProposalId: string & z.BRAND<"ProposalId">;
|
|
814
|
+
}, {
|
|
815
|
+
type: "repair-requested";
|
|
816
|
+
reason: {
|
|
817
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
818
|
+
detail: string;
|
|
819
|
+
};
|
|
820
|
+
refusedProposalId: string;
|
|
821
|
+
}>, z.ZodObject<{
|
|
822
|
+
type: z.ZodLiteral<"repair-failed">;
|
|
823
|
+
refusedProposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
824
|
+
failure: z.ZodObject<{
|
|
825
|
+
code: z.ZodString;
|
|
826
|
+
detail: z.ZodString;
|
|
827
|
+
}, "strip", z.ZodTypeAny, {
|
|
828
|
+
code: string;
|
|
829
|
+
detail: string;
|
|
830
|
+
}, {
|
|
831
|
+
code: string;
|
|
832
|
+
detail: string;
|
|
833
|
+
}>;
|
|
834
|
+
}, "strip", z.ZodTypeAny, {
|
|
835
|
+
type: "repair-failed";
|
|
836
|
+
failure: {
|
|
837
|
+
code: string;
|
|
838
|
+
detail: string;
|
|
839
|
+
};
|
|
840
|
+
refusedProposalId: string & z.BRAND<"ProposalId">;
|
|
841
|
+
}, {
|
|
842
|
+
type: "repair-failed";
|
|
843
|
+
failure: {
|
|
844
|
+
code: string;
|
|
845
|
+
detail: string;
|
|
846
|
+
};
|
|
847
|
+
refusedProposalId: string;
|
|
848
|
+
}>, z.ZodObject<{
|
|
849
|
+
type: z.ZodLiteral<"change-applied">;
|
|
850
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
851
|
+
revision: z.ZodNumber;
|
|
852
|
+
}, "strip", z.ZodTypeAny, {
|
|
853
|
+
type: "change-applied";
|
|
854
|
+
revision: number;
|
|
855
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
856
|
+
}, {
|
|
857
|
+
type: "change-applied";
|
|
858
|
+
revision: number;
|
|
859
|
+
proposalId: string;
|
|
860
|
+
}>, z.ZodObject<{
|
|
861
|
+
type: z.ZodLiteral<"application-failed">;
|
|
862
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
863
|
+
failure: z.ZodObject<{
|
|
864
|
+
code: z.ZodString;
|
|
865
|
+
detail: z.ZodString;
|
|
866
|
+
}, "strip", z.ZodTypeAny, {
|
|
867
|
+
code: string;
|
|
868
|
+
detail: string;
|
|
869
|
+
}, {
|
|
870
|
+
code: string;
|
|
871
|
+
detail: string;
|
|
872
|
+
}>;
|
|
873
|
+
}, "strip", z.ZodTypeAny, {
|
|
874
|
+
type: "application-failed";
|
|
875
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
876
|
+
failure: {
|
|
877
|
+
code: string;
|
|
878
|
+
detail: string;
|
|
879
|
+
};
|
|
880
|
+
}, {
|
|
881
|
+
type: "application-failed";
|
|
882
|
+
proposalId: string;
|
|
883
|
+
failure: {
|
|
884
|
+
code: string;
|
|
885
|
+
detail: string;
|
|
886
|
+
};
|
|
887
|
+
}>, z.ZodObject<{
|
|
888
|
+
type: z.ZodLiteral<"intent-not-writable">;
|
|
889
|
+
intentId: z.ZodBranded<z.ZodString, "IntentId">;
|
|
890
|
+
failure: z.ZodObject<{
|
|
891
|
+
code: z.ZodString;
|
|
892
|
+
detail: z.ZodString;
|
|
893
|
+
}, "strip", z.ZodTypeAny, {
|
|
894
|
+
code: string;
|
|
895
|
+
detail: string;
|
|
896
|
+
}, {
|
|
897
|
+
code: string;
|
|
898
|
+
detail: string;
|
|
899
|
+
}>;
|
|
900
|
+
}, "strip", z.ZodTypeAny, {
|
|
901
|
+
type: "intent-not-writable";
|
|
902
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
903
|
+
failure: {
|
|
904
|
+
code: string;
|
|
905
|
+
detail: string;
|
|
906
|
+
};
|
|
907
|
+
}, {
|
|
908
|
+
type: "intent-not-writable";
|
|
909
|
+
intentId: string;
|
|
910
|
+
failure: {
|
|
911
|
+
code: string;
|
|
912
|
+
detail: string;
|
|
913
|
+
};
|
|
914
|
+
}>, z.ZodObject<{
|
|
915
|
+
type: z.ZodLiteral<"proposal-held">;
|
|
916
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
917
|
+
}, "strip", z.ZodTypeAny, {
|
|
918
|
+
type: "proposal-held";
|
|
919
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
920
|
+
}, {
|
|
921
|
+
type: "proposal-held";
|
|
922
|
+
proposalId: string;
|
|
923
|
+
}>, z.ZodObject<{
|
|
924
|
+
type: z.ZodLiteral<"hold-failed">;
|
|
925
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
926
|
+
failure: z.ZodObject<{
|
|
927
|
+
code: z.ZodString;
|
|
928
|
+
detail: z.ZodString;
|
|
929
|
+
}, "strip", z.ZodTypeAny, {
|
|
930
|
+
code: string;
|
|
931
|
+
detail: string;
|
|
932
|
+
}, {
|
|
933
|
+
code: string;
|
|
934
|
+
detail: string;
|
|
935
|
+
}>;
|
|
936
|
+
}, "strip", z.ZodTypeAny, {
|
|
937
|
+
type: "hold-failed";
|
|
938
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
939
|
+
failure: {
|
|
940
|
+
code: string;
|
|
941
|
+
detail: string;
|
|
942
|
+
};
|
|
943
|
+
}, {
|
|
944
|
+
type: "hold-failed";
|
|
945
|
+
proposalId: string;
|
|
946
|
+
failure: {
|
|
947
|
+
code: string;
|
|
948
|
+
detail: string;
|
|
949
|
+
};
|
|
950
|
+
}>, z.ZodObject<{
|
|
951
|
+
type: z.ZodLiteral<"hold-confirmed">;
|
|
952
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
953
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
954
|
+
}, "strip", z.ZodTypeAny, {
|
|
955
|
+
type: "hold-confirmed";
|
|
956
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
957
|
+
actor?: string | undefined;
|
|
958
|
+
}, {
|
|
959
|
+
type: "hold-confirmed";
|
|
960
|
+
proposalId: string;
|
|
961
|
+
actor?: string | undefined;
|
|
962
|
+
}>, z.ZodObject<{
|
|
963
|
+
type: z.ZodLiteral<"hold-discarded">;
|
|
964
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
965
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
966
|
+
}, "strip", z.ZodTypeAny, {
|
|
967
|
+
type: "hold-discarded";
|
|
968
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
969
|
+
actor?: string | undefined;
|
|
970
|
+
}, {
|
|
971
|
+
type: "hold-discarded";
|
|
972
|
+
proposalId: string;
|
|
973
|
+
actor?: string | undefined;
|
|
974
|
+
}>, z.ZodObject<{
|
|
975
|
+
type: z.ZodLiteral<"change-committed">;
|
|
976
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
977
|
+
revision: z.ZodNumber;
|
|
978
|
+
}, "strip", z.ZodTypeAny, {
|
|
979
|
+
type: "change-committed";
|
|
980
|
+
revision: number;
|
|
981
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
982
|
+
}, {
|
|
983
|
+
type: "change-committed";
|
|
984
|
+
revision: number;
|
|
985
|
+
proposalId: string;
|
|
986
|
+
}>, z.ZodObject<{
|
|
987
|
+
type: z.ZodLiteral<"commit-failed">;
|
|
988
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
989
|
+
failure: z.ZodObject<{
|
|
990
|
+
code: z.ZodString;
|
|
991
|
+
detail: z.ZodString;
|
|
992
|
+
}, "strip", z.ZodTypeAny, {
|
|
993
|
+
code: string;
|
|
994
|
+
detail: string;
|
|
995
|
+
}, {
|
|
996
|
+
code: string;
|
|
997
|
+
detail: string;
|
|
998
|
+
}>;
|
|
999
|
+
}, "strip", z.ZodTypeAny, {
|
|
1000
|
+
type: "commit-failed";
|
|
1001
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1002
|
+
failure: {
|
|
1003
|
+
code: string;
|
|
1004
|
+
detail: string;
|
|
1005
|
+
};
|
|
1006
|
+
}, {
|
|
1007
|
+
type: "commit-failed";
|
|
1008
|
+
proposalId: string;
|
|
1009
|
+
failure: {
|
|
1010
|
+
code: string;
|
|
1011
|
+
detail: string;
|
|
1012
|
+
};
|
|
1013
|
+
}>]>;
|
|
1014
|
+
export type TelemetryEvent = {
|
|
1015
|
+
readonly type: "intent-received";
|
|
1016
|
+
readonly intent: IntentSummary;
|
|
1017
|
+
} | {
|
|
1018
|
+
readonly type: "policy-resolved";
|
|
1019
|
+
readonly intentId: IntentId;
|
|
1020
|
+
readonly policyId: string;
|
|
1021
|
+
/** Absent on a record written before the Gate fingerprinted policies (0045). */
|
|
1022
|
+
readonly policyFingerprint?: string;
|
|
1023
|
+
} | {
|
|
1024
|
+
readonly type: "interpretation-failed";
|
|
1025
|
+
readonly intentId: IntentId;
|
|
1026
|
+
readonly failure: TelemetryFailure;
|
|
1027
|
+
} | {
|
|
1028
|
+
readonly type: "change-proposed";
|
|
1029
|
+
readonly proposal: ProposedChange;
|
|
1030
|
+
} | {
|
|
1031
|
+
readonly type: "assessment-failed";
|
|
1032
|
+
readonly proposalId: ProposalId;
|
|
1033
|
+
readonly failure: TelemetryFailure;
|
|
1034
|
+
} | {
|
|
1035
|
+
readonly type: "change-assessed";
|
|
1036
|
+
readonly assessment: AssessmentSummary;
|
|
1037
|
+
} | {
|
|
1038
|
+
readonly type: "disposition-decided";
|
|
1039
|
+
readonly proposalId: ProposalId;
|
|
1040
|
+
readonly disposition: Disposition;
|
|
1041
|
+
} | {
|
|
1042
|
+
readonly type: "repair-requested";
|
|
1043
|
+
readonly refusedProposalId: ProposalId;
|
|
1044
|
+
readonly reason: DispositionReason;
|
|
1045
|
+
} | {
|
|
1046
|
+
readonly type: "repair-failed";
|
|
1047
|
+
readonly refusedProposalId: ProposalId;
|
|
1048
|
+
readonly failure: TelemetryFailure;
|
|
1049
|
+
} | {
|
|
1050
|
+
readonly type: "change-applied";
|
|
1051
|
+
readonly proposalId: ProposalId;
|
|
1052
|
+
readonly revision: number;
|
|
1053
|
+
} | {
|
|
1054
|
+
readonly type: "application-failed";
|
|
1055
|
+
readonly proposalId: ProposalId;
|
|
1056
|
+
readonly failure: TelemetryFailure;
|
|
1057
|
+
} | {
|
|
1058
|
+
readonly type: "intent-not-writable";
|
|
1059
|
+
readonly intentId: IntentId;
|
|
1060
|
+
readonly failure: TelemetryFailure;
|
|
1061
|
+
} | {
|
|
1062
|
+
readonly type: "proposal-held";
|
|
1063
|
+
readonly proposalId: ProposalId;
|
|
1064
|
+
} | {
|
|
1065
|
+
readonly type: "hold-failed";
|
|
1066
|
+
readonly proposalId: ProposalId;
|
|
1067
|
+
readonly failure: TelemetryFailure;
|
|
1068
|
+
} | {
|
|
1069
|
+
readonly type: "hold-confirmed";
|
|
1070
|
+
readonly proposalId: ProposalId;
|
|
1071
|
+
readonly actor?: string;
|
|
1072
|
+
} | {
|
|
1073
|
+
readonly type: "hold-discarded";
|
|
1074
|
+
readonly proposalId: ProposalId;
|
|
1075
|
+
readonly actor?: string;
|
|
1076
|
+
} | {
|
|
1077
|
+
readonly type: "change-committed";
|
|
1078
|
+
readonly proposalId: ProposalId;
|
|
1079
|
+
readonly revision: number;
|
|
1080
|
+
} | {
|
|
1081
|
+
readonly type: "commit-failed";
|
|
1082
|
+
readonly proposalId: ProposalId;
|
|
1083
|
+
readonly failure: TelemetryFailure;
|
|
1084
|
+
};
|
|
1085
|
+
export type TelemetryEventType = TelemetryEvent["type"];
|
|
1086
|
+
/**
|
|
1087
|
+
* Every event the journal can hold, in the order the runtime writes them.
|
|
1088
|
+
*
|
|
1089
|
+
* `TelemetryEvent` is exhaustive in a `switch` and that is the case it was built
|
|
1090
|
+
* for. What it cannot answer is **how many**, and three things ask: a page that
|
|
1091
|
+
* says what fraction of the vocabulary it is showing, a dashboard that needs
|
|
1092
|
+
* every bucket to exist before the first request rather than discovering them as
|
|
1093
|
+
* they arrive, and anything checking a sink against §6. Each of those otherwise
|
|
1094
|
+
* keeps its own copy, in its own order, with nothing to fail when a nineteenth
|
|
1095
|
+
* lands.
|
|
1096
|
+
*
|
|
1097
|
+
* The order is the lifecycle rather than the alphabet: an episode reads
|
|
1098
|
+
* top to bottom, so a list printed in this order is a story and a list sorted by
|
|
1099
|
+
* name is eighteen strings. `event.test.ts` holds it against
|
|
1100
|
+
* `telemetryEventSchema`, which is what keeps it complete — the schema is the
|
|
1101
|
+
* boundary a record has to cross, so a type the schema accepts and this omits is
|
|
1102
|
+
* the drift worth failing over.
|
|
1103
|
+
*/
|
|
1104
|
+
export declare const TELEMETRY_EVENT_TYPES: readonly TelemetryEventType[];
|
|
1105
|
+
export declare const telemetryRecordSchema: z.ZodObject<{
|
|
1106
|
+
treeId: z.ZodBranded<z.ZodString, "TreeId">;
|
|
1107
|
+
occurredAt: z.ZodString;
|
|
1108
|
+
event: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
1109
|
+
type: z.ZodLiteral<"intent-received">;
|
|
1110
|
+
intent: z.ZodObject<{
|
|
1111
|
+
intentId: z.ZodBranded<z.ZodString, "IntentId">;
|
|
1112
|
+
origin: z.ZodEnum<["user-instruction", "system-signal", "scheduled-adaptation", "developer"]>;
|
|
1113
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
1114
|
+
baseRevision: z.ZodNumber;
|
|
1115
|
+
scopeNodeId: z.ZodOptional<z.ZodBranded<z.ZodString, "NodeId">>;
|
|
1116
|
+
utteranceLength: z.ZodNumber;
|
|
1117
|
+
observedAt: z.ZodString;
|
|
1118
|
+
}, "strip", z.ZodTypeAny, {
|
|
1119
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
1120
|
+
baseRevision: number;
|
|
1121
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
1122
|
+
observedAt: string;
|
|
1123
|
+
utteranceLength: number;
|
|
1124
|
+
actor?: string | undefined;
|
|
1125
|
+
scopeNodeId?: (string & z.BRAND<"NodeId">) | undefined;
|
|
1126
|
+
}, {
|
|
1127
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
1128
|
+
baseRevision: number;
|
|
1129
|
+
intentId: string;
|
|
1130
|
+
observedAt: string;
|
|
1131
|
+
utteranceLength: number;
|
|
1132
|
+
actor?: string | undefined;
|
|
1133
|
+
scopeNodeId?: string | undefined;
|
|
1134
|
+
}>;
|
|
1135
|
+
}, "strip", z.ZodTypeAny, {
|
|
1136
|
+
type: "intent-received";
|
|
1137
|
+
intent: {
|
|
1138
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
1139
|
+
baseRevision: number;
|
|
1140
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
1141
|
+
observedAt: string;
|
|
1142
|
+
utteranceLength: number;
|
|
1143
|
+
actor?: string | undefined;
|
|
1144
|
+
scopeNodeId?: (string & z.BRAND<"NodeId">) | undefined;
|
|
1145
|
+
};
|
|
1146
|
+
}, {
|
|
1147
|
+
type: "intent-received";
|
|
1148
|
+
intent: {
|
|
1149
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
1150
|
+
baseRevision: number;
|
|
1151
|
+
intentId: string;
|
|
1152
|
+
observedAt: string;
|
|
1153
|
+
utteranceLength: number;
|
|
1154
|
+
actor?: string | undefined;
|
|
1155
|
+
scopeNodeId?: string | undefined;
|
|
1156
|
+
};
|
|
1157
|
+
}>, z.ZodObject<{
|
|
1158
|
+
type: z.ZodLiteral<"policy-resolved">;
|
|
1159
|
+
intentId: z.ZodBranded<z.ZodString, "IntentId">;
|
|
1160
|
+
policyId: z.ZodString;
|
|
1161
|
+
policyFingerprint: z.ZodOptional<z.ZodString>;
|
|
1162
|
+
}, "strip", z.ZodTypeAny, {
|
|
1163
|
+
type: "policy-resolved";
|
|
1164
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
1165
|
+
policyId: string;
|
|
1166
|
+
policyFingerprint?: string | undefined;
|
|
1167
|
+
}, {
|
|
1168
|
+
type: "policy-resolved";
|
|
1169
|
+
intentId: string;
|
|
1170
|
+
policyId: string;
|
|
1171
|
+
policyFingerprint?: string | undefined;
|
|
1172
|
+
}>, z.ZodObject<{
|
|
1173
|
+
type: z.ZodLiteral<"interpretation-failed">;
|
|
1174
|
+
intentId: z.ZodBranded<z.ZodString, "IntentId">;
|
|
1175
|
+
failure: z.ZodObject<{
|
|
1176
|
+
code: z.ZodString;
|
|
1177
|
+
detail: z.ZodString;
|
|
1178
|
+
}, "strip", z.ZodTypeAny, {
|
|
1179
|
+
code: string;
|
|
1180
|
+
detail: string;
|
|
1181
|
+
}, {
|
|
1182
|
+
code: string;
|
|
1183
|
+
detail: string;
|
|
1184
|
+
}>;
|
|
1185
|
+
}, "strip", z.ZodTypeAny, {
|
|
1186
|
+
type: "interpretation-failed";
|
|
1187
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
1188
|
+
failure: {
|
|
1189
|
+
code: string;
|
|
1190
|
+
detail: string;
|
|
1191
|
+
};
|
|
1192
|
+
}, {
|
|
1193
|
+
type: "interpretation-failed";
|
|
1194
|
+
intentId: string;
|
|
1195
|
+
failure: {
|
|
1196
|
+
code: string;
|
|
1197
|
+
detail: string;
|
|
1198
|
+
};
|
|
1199
|
+
}>, z.ZodObject<{
|
|
1200
|
+
type: z.ZodLiteral<"change-proposed">;
|
|
1201
|
+
proposal: z.ZodObject<{
|
|
1202
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1203
|
+
intentId: z.ZodBranded<z.ZodString, "IntentId">;
|
|
1204
|
+
delta: z.ZodObject<{
|
|
1205
|
+
deltaId: z.ZodBranded<z.ZodString, "DeltaId">;
|
|
1206
|
+
treeId: z.ZodBranded<z.ZodString, "TreeId">;
|
|
1207
|
+
baseRevision: z.ZodNumber;
|
|
1208
|
+
operations: z.ZodArray<z.ZodDiscriminatedUnion<"op", [z.ZodObject<{
|
|
1209
|
+
op: z.ZodLiteral<"insert">;
|
|
1210
|
+
parentId: z.ZodBranded<z.ZodString, "NodeId">;
|
|
1211
|
+
index: z.ZodNumber;
|
|
1212
|
+
node: z.ZodType<import("../index.js").LoomNode, z.ZodTypeDef, unknown>;
|
|
1213
|
+
}, "strip", z.ZodTypeAny, {
|
|
1214
|
+
index: number;
|
|
1215
|
+
op: "insert";
|
|
1216
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
1217
|
+
node: import("../index.js").LoomNode;
|
|
1218
|
+
}, {
|
|
1219
|
+
index: number;
|
|
1220
|
+
op: "insert";
|
|
1221
|
+
parentId: string;
|
|
1222
|
+
node?: unknown;
|
|
1223
|
+
}>, z.ZodObject<{
|
|
1224
|
+
op: z.ZodLiteral<"remove">;
|
|
1225
|
+
nodeId: z.ZodBranded<z.ZodString, "NodeId">;
|
|
1226
|
+
}, "strip", z.ZodTypeAny, {
|
|
1227
|
+
op: "remove";
|
|
1228
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1229
|
+
}, {
|
|
1230
|
+
op: "remove";
|
|
1231
|
+
nodeId: string;
|
|
1232
|
+
}>, z.ZodObject<{
|
|
1233
|
+
op: z.ZodLiteral<"move">;
|
|
1234
|
+
nodeId: z.ZodBranded<z.ZodString, "NodeId">;
|
|
1235
|
+
parentId: z.ZodBranded<z.ZodString, "NodeId">;
|
|
1236
|
+
index: z.ZodNumber;
|
|
1237
|
+
}, "strip", z.ZodTypeAny, {
|
|
1238
|
+
index: number;
|
|
1239
|
+
op: "move";
|
|
1240
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
1241
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1242
|
+
}, {
|
|
1243
|
+
index: number;
|
|
1244
|
+
op: "move";
|
|
1245
|
+
parentId: string;
|
|
1246
|
+
nodeId: string;
|
|
1247
|
+
}>, z.ZodObject<{
|
|
1248
|
+
op: z.ZodLiteral<"configure">;
|
|
1249
|
+
nodeId: z.ZodBranded<z.ZodString, "NodeId">;
|
|
1250
|
+
set: z.ZodDefault<z.ZodType<import("../json.js").JsonObject, z.ZodTypeDef, import("../json.js").JsonObject>>;
|
|
1251
|
+
unset: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1252
|
+
}, "strip", z.ZodTypeAny, {
|
|
1253
|
+
set: import("../json.js").JsonObject;
|
|
1254
|
+
op: "configure";
|
|
1255
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1256
|
+
unset: string[];
|
|
1257
|
+
}, {
|
|
1258
|
+
op: "configure";
|
|
1259
|
+
nodeId: string;
|
|
1260
|
+
set?: import("../json.js").JsonObject | undefined;
|
|
1261
|
+
unset?: string[] | undefined;
|
|
1262
|
+
}>]>, "many">;
|
|
1263
|
+
}, "strip", z.ZodTypeAny, {
|
|
1264
|
+
treeId: string & z.BRAND<"TreeId">;
|
|
1265
|
+
operations: ({
|
|
1266
|
+
index: number;
|
|
1267
|
+
op: "insert";
|
|
1268
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
1269
|
+
node: import("../index.js").LoomNode;
|
|
1270
|
+
} | {
|
|
1271
|
+
op: "remove";
|
|
1272
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1273
|
+
} | {
|
|
1274
|
+
index: number;
|
|
1275
|
+
op: "move";
|
|
1276
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
1277
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1278
|
+
} | {
|
|
1279
|
+
set: import("../json.js").JsonObject;
|
|
1280
|
+
op: "configure";
|
|
1281
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1282
|
+
unset: string[];
|
|
1283
|
+
})[];
|
|
1284
|
+
deltaId: string & z.BRAND<"DeltaId">;
|
|
1285
|
+
baseRevision: number;
|
|
1286
|
+
}, {
|
|
1287
|
+
treeId: string;
|
|
1288
|
+
operations: ({
|
|
1289
|
+
index: number;
|
|
1290
|
+
op: "insert";
|
|
1291
|
+
parentId: string;
|
|
1292
|
+
node?: unknown;
|
|
1293
|
+
} | {
|
|
1294
|
+
op: "remove";
|
|
1295
|
+
nodeId: string;
|
|
1296
|
+
} | {
|
|
1297
|
+
index: number;
|
|
1298
|
+
op: "move";
|
|
1299
|
+
parentId: string;
|
|
1300
|
+
nodeId: string;
|
|
1301
|
+
} | {
|
|
1302
|
+
op: "configure";
|
|
1303
|
+
nodeId: string;
|
|
1304
|
+
set?: import("../json.js").JsonObject | undefined;
|
|
1305
|
+
unset?: string[] | undefined;
|
|
1306
|
+
})[];
|
|
1307
|
+
deltaId: string;
|
|
1308
|
+
baseRevision: number;
|
|
1309
|
+
}>;
|
|
1310
|
+
rationale: z.ZodString;
|
|
1311
|
+
provenance: z.ZodObject<{
|
|
1312
|
+
origin: z.ZodEnum<["user-instruction", "system-signal", "scheduled-adaptation", "developer"]>;
|
|
1313
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
1314
|
+
interpreter: z.ZodString;
|
|
1315
|
+
authoredBy: z.ZodDefault<z.ZodEnum<["model", "runtime"]>>;
|
|
1316
|
+
promptHash: z.ZodOptional<z.ZodString>;
|
|
1317
|
+
undoes: z.ZodOptional<z.ZodNumber>;
|
|
1318
|
+
confidence: z.ZodNumber;
|
|
1319
|
+
interpretedAt: z.ZodString;
|
|
1320
|
+
}, "strip", z.ZodTypeAny, {
|
|
1321
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
1322
|
+
confidence: number;
|
|
1323
|
+
interpreter: string;
|
|
1324
|
+
authoredBy: "model" | "runtime";
|
|
1325
|
+
interpretedAt: string;
|
|
1326
|
+
actor?: string | undefined;
|
|
1327
|
+
promptHash?: string | undefined;
|
|
1328
|
+
undoes?: number | undefined;
|
|
1329
|
+
}, {
|
|
1330
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
1331
|
+
confidence: number;
|
|
1332
|
+
interpreter: string;
|
|
1333
|
+
interpretedAt: string;
|
|
1334
|
+
actor?: string | undefined;
|
|
1335
|
+
authoredBy?: "model" | "runtime" | undefined;
|
|
1336
|
+
promptHash?: string | undefined;
|
|
1337
|
+
undoes?: number | undefined;
|
|
1338
|
+
}>;
|
|
1339
|
+
repairOf: z.ZodOptional<z.ZodBranded<z.ZodString, "ProposalId">>;
|
|
1340
|
+
discards: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1341
|
+
revision: z.ZodNumber;
|
|
1342
|
+
nodeIds: z.ZodArray<z.ZodBranded<z.ZodString, "NodeId">, "many">;
|
|
1343
|
+
}, "strip", z.ZodTypeAny, {
|
|
1344
|
+
revision: number;
|
|
1345
|
+
nodeIds: (string & z.BRAND<"NodeId">)[];
|
|
1346
|
+
}, {
|
|
1347
|
+
revision: number;
|
|
1348
|
+
nodeIds: string[];
|
|
1349
|
+
}>, "many">>;
|
|
1350
|
+
}, "strip", z.ZodTypeAny, {
|
|
1351
|
+
rationale: string;
|
|
1352
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
1353
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1354
|
+
delta: {
|
|
1355
|
+
treeId: string & z.BRAND<"TreeId">;
|
|
1356
|
+
operations: ({
|
|
1357
|
+
index: number;
|
|
1358
|
+
op: "insert";
|
|
1359
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
1360
|
+
node: import("../index.js").LoomNode;
|
|
1361
|
+
} | {
|
|
1362
|
+
op: "remove";
|
|
1363
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1364
|
+
} | {
|
|
1365
|
+
index: number;
|
|
1366
|
+
op: "move";
|
|
1367
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
1368
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1369
|
+
} | {
|
|
1370
|
+
set: import("../json.js").JsonObject;
|
|
1371
|
+
op: "configure";
|
|
1372
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1373
|
+
unset: string[];
|
|
1374
|
+
})[];
|
|
1375
|
+
deltaId: string & z.BRAND<"DeltaId">;
|
|
1376
|
+
baseRevision: number;
|
|
1377
|
+
};
|
|
1378
|
+
provenance: {
|
|
1379
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
1380
|
+
confidence: number;
|
|
1381
|
+
interpreter: string;
|
|
1382
|
+
authoredBy: "model" | "runtime";
|
|
1383
|
+
interpretedAt: string;
|
|
1384
|
+
actor?: string | undefined;
|
|
1385
|
+
promptHash?: string | undefined;
|
|
1386
|
+
undoes?: number | undefined;
|
|
1387
|
+
};
|
|
1388
|
+
repairOf?: (string & z.BRAND<"ProposalId">) | undefined;
|
|
1389
|
+
discards?: {
|
|
1390
|
+
revision: number;
|
|
1391
|
+
nodeIds: (string & z.BRAND<"NodeId">)[];
|
|
1392
|
+
}[] | undefined;
|
|
1393
|
+
}, {
|
|
1394
|
+
rationale: string;
|
|
1395
|
+
intentId: string;
|
|
1396
|
+
proposalId: string;
|
|
1397
|
+
delta: {
|
|
1398
|
+
treeId: string;
|
|
1399
|
+
operations: ({
|
|
1400
|
+
index: number;
|
|
1401
|
+
op: "insert";
|
|
1402
|
+
parentId: string;
|
|
1403
|
+
node?: unknown;
|
|
1404
|
+
} | {
|
|
1405
|
+
op: "remove";
|
|
1406
|
+
nodeId: string;
|
|
1407
|
+
} | {
|
|
1408
|
+
index: number;
|
|
1409
|
+
op: "move";
|
|
1410
|
+
parentId: string;
|
|
1411
|
+
nodeId: string;
|
|
1412
|
+
} | {
|
|
1413
|
+
op: "configure";
|
|
1414
|
+
nodeId: string;
|
|
1415
|
+
set?: import("../json.js").JsonObject | undefined;
|
|
1416
|
+
unset?: string[] | undefined;
|
|
1417
|
+
})[];
|
|
1418
|
+
deltaId: string;
|
|
1419
|
+
baseRevision: number;
|
|
1420
|
+
};
|
|
1421
|
+
provenance: {
|
|
1422
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
1423
|
+
confidence: number;
|
|
1424
|
+
interpreter: string;
|
|
1425
|
+
interpretedAt: string;
|
|
1426
|
+
actor?: string | undefined;
|
|
1427
|
+
authoredBy?: "model" | "runtime" | undefined;
|
|
1428
|
+
promptHash?: string | undefined;
|
|
1429
|
+
undoes?: number | undefined;
|
|
1430
|
+
};
|
|
1431
|
+
repairOf?: string | undefined;
|
|
1432
|
+
discards?: {
|
|
1433
|
+
revision: number;
|
|
1434
|
+
nodeIds: string[];
|
|
1435
|
+
}[] | undefined;
|
|
1436
|
+
}>;
|
|
1437
|
+
}, "strip", z.ZodTypeAny, {
|
|
1438
|
+
type: "change-proposed";
|
|
1439
|
+
proposal: {
|
|
1440
|
+
rationale: string;
|
|
1441
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
1442
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1443
|
+
delta: {
|
|
1444
|
+
treeId: string & z.BRAND<"TreeId">;
|
|
1445
|
+
operations: ({
|
|
1446
|
+
index: number;
|
|
1447
|
+
op: "insert";
|
|
1448
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
1449
|
+
node: import("../index.js").LoomNode;
|
|
1450
|
+
} | {
|
|
1451
|
+
op: "remove";
|
|
1452
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1453
|
+
} | {
|
|
1454
|
+
index: number;
|
|
1455
|
+
op: "move";
|
|
1456
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
1457
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1458
|
+
} | {
|
|
1459
|
+
set: import("../json.js").JsonObject;
|
|
1460
|
+
op: "configure";
|
|
1461
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1462
|
+
unset: string[];
|
|
1463
|
+
})[];
|
|
1464
|
+
deltaId: string & z.BRAND<"DeltaId">;
|
|
1465
|
+
baseRevision: number;
|
|
1466
|
+
};
|
|
1467
|
+
provenance: {
|
|
1468
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
1469
|
+
confidence: number;
|
|
1470
|
+
interpreter: string;
|
|
1471
|
+
authoredBy: "model" | "runtime";
|
|
1472
|
+
interpretedAt: string;
|
|
1473
|
+
actor?: string | undefined;
|
|
1474
|
+
promptHash?: string | undefined;
|
|
1475
|
+
undoes?: number | undefined;
|
|
1476
|
+
};
|
|
1477
|
+
repairOf?: (string & z.BRAND<"ProposalId">) | undefined;
|
|
1478
|
+
discards?: {
|
|
1479
|
+
revision: number;
|
|
1480
|
+
nodeIds: (string & z.BRAND<"NodeId">)[];
|
|
1481
|
+
}[] | undefined;
|
|
1482
|
+
};
|
|
1483
|
+
}, {
|
|
1484
|
+
type: "change-proposed";
|
|
1485
|
+
proposal: {
|
|
1486
|
+
rationale: string;
|
|
1487
|
+
intentId: string;
|
|
1488
|
+
proposalId: string;
|
|
1489
|
+
delta: {
|
|
1490
|
+
treeId: string;
|
|
1491
|
+
operations: ({
|
|
1492
|
+
index: number;
|
|
1493
|
+
op: "insert";
|
|
1494
|
+
parentId: string;
|
|
1495
|
+
node?: unknown;
|
|
1496
|
+
} | {
|
|
1497
|
+
op: "remove";
|
|
1498
|
+
nodeId: string;
|
|
1499
|
+
} | {
|
|
1500
|
+
index: number;
|
|
1501
|
+
op: "move";
|
|
1502
|
+
parentId: string;
|
|
1503
|
+
nodeId: string;
|
|
1504
|
+
} | {
|
|
1505
|
+
op: "configure";
|
|
1506
|
+
nodeId: string;
|
|
1507
|
+
set?: import("../json.js").JsonObject | undefined;
|
|
1508
|
+
unset?: string[] | undefined;
|
|
1509
|
+
})[];
|
|
1510
|
+
deltaId: string;
|
|
1511
|
+
baseRevision: number;
|
|
1512
|
+
};
|
|
1513
|
+
provenance: {
|
|
1514
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
1515
|
+
confidence: number;
|
|
1516
|
+
interpreter: string;
|
|
1517
|
+
interpretedAt: string;
|
|
1518
|
+
actor?: string | undefined;
|
|
1519
|
+
authoredBy?: "model" | "runtime" | undefined;
|
|
1520
|
+
promptHash?: string | undefined;
|
|
1521
|
+
undoes?: number | undefined;
|
|
1522
|
+
};
|
|
1523
|
+
repairOf?: string | undefined;
|
|
1524
|
+
discards?: {
|
|
1525
|
+
revision: number;
|
|
1526
|
+
nodeIds: string[];
|
|
1527
|
+
}[] | undefined;
|
|
1528
|
+
};
|
|
1529
|
+
}>, z.ZodObject<{
|
|
1530
|
+
type: z.ZodLiteral<"assessment-failed">;
|
|
1531
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1532
|
+
failure: z.ZodObject<{
|
|
1533
|
+
code: z.ZodString;
|
|
1534
|
+
detail: z.ZodString;
|
|
1535
|
+
}, "strip", z.ZodTypeAny, {
|
|
1536
|
+
code: string;
|
|
1537
|
+
detail: string;
|
|
1538
|
+
}, {
|
|
1539
|
+
code: string;
|
|
1540
|
+
detail: string;
|
|
1541
|
+
}>;
|
|
1542
|
+
}, "strip", z.ZodTypeAny, {
|
|
1543
|
+
type: "assessment-failed";
|
|
1544
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1545
|
+
failure: {
|
|
1546
|
+
code: string;
|
|
1547
|
+
detail: string;
|
|
1548
|
+
};
|
|
1549
|
+
}, {
|
|
1550
|
+
type: "assessment-failed";
|
|
1551
|
+
proposalId: string;
|
|
1552
|
+
failure: {
|
|
1553
|
+
code: string;
|
|
1554
|
+
detail: string;
|
|
1555
|
+
};
|
|
1556
|
+
}>, z.ZodObject<{
|
|
1557
|
+
type: z.ZodLiteral<"change-assessed">;
|
|
1558
|
+
assessment: z.ZodObject<{
|
|
1559
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1560
|
+
stakes: z.ZodEnum<["low", "medium", "high", "critical"]>;
|
|
1561
|
+
reversible: z.ZodBoolean;
|
|
1562
|
+
operationCount: z.ZodNumber;
|
|
1563
|
+
insertedNodeCount: z.ZodNumber;
|
|
1564
|
+
removedNodeCount: z.ZodNumber;
|
|
1565
|
+
movedNodeCount: z.ZodNumber;
|
|
1566
|
+
configuredNodeCount: z.ZodNumber;
|
|
1567
|
+
touchedPrimitiveTypes: z.ZodArray<z.ZodBranded<z.ZodString, "PrimitiveType">, "many">;
|
|
1568
|
+
/**
|
|
1569
|
+
* Bounded, non-identifying, a subset of the touched types, and the input to
|
|
1570
|
+
* the only `critical` stake factor. A corpus that cannot group by "the Gate
|
|
1571
|
+
* saw this type destroyed" cannot ask the question the factor exists for.
|
|
1572
|
+
*/
|
|
1573
|
+
removedPrimitiveTypes: z.ZodOptional<z.ZodArray<z.ZodBranded<z.ZodString, "PrimitiveType">, "many">>;
|
|
1574
|
+
relocatedPrimitiveTypes: z.ZodOptional<z.ZodArray<z.ZodBranded<z.ZodString, "PrimitiveType">, "many">>;
|
|
1575
|
+
relocatedNodeCount: z.ZodOptional<z.ZodNumber>;
|
|
1576
|
+
shallowestAffectedDepth: z.ZodNumber;
|
|
1577
|
+
/** Nodes the inverse would have to carry — the content a removal destroyed. */
|
|
1578
|
+
retainedNodeCount: z.ZodNumber;
|
|
1579
|
+
irreversibilityReasons: z.ZodArray<z.ZodString, "many">;
|
|
1580
|
+
}, "strip", z.ZodTypeAny, {
|
|
1581
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1582
|
+
removedNodeCount: number;
|
|
1583
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
1584
|
+
reversible: boolean;
|
|
1585
|
+
operationCount: number;
|
|
1586
|
+
insertedNodeCount: number;
|
|
1587
|
+
movedNodeCount: number;
|
|
1588
|
+
configuredNodeCount: number;
|
|
1589
|
+
touchedPrimitiveTypes: (string & z.BRAND<"PrimitiveType">)[];
|
|
1590
|
+
shallowestAffectedDepth: number;
|
|
1591
|
+
retainedNodeCount: number;
|
|
1592
|
+
irreversibilityReasons: string[];
|
|
1593
|
+
removedPrimitiveTypes?: (string & z.BRAND<"PrimitiveType">)[] | undefined;
|
|
1594
|
+
relocatedPrimitiveTypes?: (string & z.BRAND<"PrimitiveType">)[] | undefined;
|
|
1595
|
+
relocatedNodeCount?: number | undefined;
|
|
1596
|
+
}, {
|
|
1597
|
+
proposalId: string;
|
|
1598
|
+
removedNodeCount: number;
|
|
1599
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
1600
|
+
reversible: boolean;
|
|
1601
|
+
operationCount: number;
|
|
1602
|
+
insertedNodeCount: number;
|
|
1603
|
+
movedNodeCount: number;
|
|
1604
|
+
configuredNodeCount: number;
|
|
1605
|
+
touchedPrimitiveTypes: string[];
|
|
1606
|
+
shallowestAffectedDepth: number;
|
|
1607
|
+
retainedNodeCount: number;
|
|
1608
|
+
irreversibilityReasons: string[];
|
|
1609
|
+
removedPrimitiveTypes?: string[] | undefined;
|
|
1610
|
+
relocatedPrimitiveTypes?: string[] | undefined;
|
|
1611
|
+
relocatedNodeCount?: number | undefined;
|
|
1612
|
+
}>;
|
|
1613
|
+
}, "strip", z.ZodTypeAny, {
|
|
1614
|
+
type: "change-assessed";
|
|
1615
|
+
assessment: {
|
|
1616
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1617
|
+
removedNodeCount: number;
|
|
1618
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
1619
|
+
reversible: boolean;
|
|
1620
|
+
operationCount: number;
|
|
1621
|
+
insertedNodeCount: number;
|
|
1622
|
+
movedNodeCount: number;
|
|
1623
|
+
configuredNodeCount: number;
|
|
1624
|
+
touchedPrimitiveTypes: (string & z.BRAND<"PrimitiveType">)[];
|
|
1625
|
+
shallowestAffectedDepth: number;
|
|
1626
|
+
retainedNodeCount: number;
|
|
1627
|
+
irreversibilityReasons: string[];
|
|
1628
|
+
removedPrimitiveTypes?: (string & z.BRAND<"PrimitiveType">)[] | undefined;
|
|
1629
|
+
relocatedPrimitiveTypes?: (string & z.BRAND<"PrimitiveType">)[] | undefined;
|
|
1630
|
+
relocatedNodeCount?: number | undefined;
|
|
1631
|
+
};
|
|
1632
|
+
}, {
|
|
1633
|
+
type: "change-assessed";
|
|
1634
|
+
assessment: {
|
|
1635
|
+
proposalId: string;
|
|
1636
|
+
removedNodeCount: number;
|
|
1637
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
1638
|
+
reversible: boolean;
|
|
1639
|
+
operationCount: number;
|
|
1640
|
+
insertedNodeCount: number;
|
|
1641
|
+
movedNodeCount: number;
|
|
1642
|
+
configuredNodeCount: number;
|
|
1643
|
+
touchedPrimitiveTypes: string[];
|
|
1644
|
+
shallowestAffectedDepth: number;
|
|
1645
|
+
retainedNodeCount: number;
|
|
1646
|
+
irreversibilityReasons: string[];
|
|
1647
|
+
removedPrimitiveTypes?: string[] | undefined;
|
|
1648
|
+
relocatedPrimitiveTypes?: string[] | undefined;
|
|
1649
|
+
relocatedNodeCount?: number | undefined;
|
|
1650
|
+
};
|
|
1651
|
+
}>, z.ZodObject<{
|
|
1652
|
+
type: z.ZodLiteral<"disposition-decided">;
|
|
1653
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1654
|
+
disposition: z.ZodObject<{
|
|
1655
|
+
kind: z.ZodEnum<["accepted", "requires-confirmation", "rejected"]>;
|
|
1656
|
+
reason: z.ZodObject<{
|
|
1657
|
+
code: z.ZodEnum<["confidence-below-floor", "stakes-at-refusal-floor", "irreversible", "discards-later-work", "redirected-submission", "repointed-binding", "stakes-above-ceiling", "confidence-below-minimum", "within-policy"]>;
|
|
1658
|
+
detail: z.ZodString;
|
|
1659
|
+
}, "strip", z.ZodTypeAny, {
|
|
1660
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
1661
|
+
detail: string;
|
|
1662
|
+
}, {
|
|
1663
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
1664
|
+
detail: string;
|
|
1665
|
+
}>;
|
|
1666
|
+
stakes: z.ZodEnum<["low", "medium", "high", "critical"]>;
|
|
1667
|
+
reversible: z.ZodBoolean;
|
|
1668
|
+
confidence: z.ZodNumber;
|
|
1669
|
+
policyId: z.ZodDefault<z.ZodString>;
|
|
1670
|
+
policyFingerprint: z.ZodOptional<z.ZodString>;
|
|
1671
|
+
}, "strip", z.ZodTypeAny, {
|
|
1672
|
+
kind: "rejected" | "accepted" | "requires-confirmation";
|
|
1673
|
+
confidence: number;
|
|
1674
|
+
policyId: string;
|
|
1675
|
+
reason: {
|
|
1676
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
1677
|
+
detail: string;
|
|
1678
|
+
};
|
|
1679
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
1680
|
+
reversible: boolean;
|
|
1681
|
+
policyFingerprint?: string | undefined;
|
|
1682
|
+
}, {
|
|
1683
|
+
kind: "rejected" | "accepted" | "requires-confirmation";
|
|
1684
|
+
confidence: number;
|
|
1685
|
+
reason: {
|
|
1686
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
1687
|
+
detail: string;
|
|
1688
|
+
};
|
|
1689
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
1690
|
+
reversible: boolean;
|
|
1691
|
+
policyId?: string | undefined;
|
|
1692
|
+
policyFingerprint?: string | undefined;
|
|
1693
|
+
}>;
|
|
1694
|
+
}, "strip", z.ZodTypeAny, {
|
|
1695
|
+
type: "disposition-decided";
|
|
1696
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1697
|
+
disposition: {
|
|
1698
|
+
kind: "rejected" | "accepted" | "requires-confirmation";
|
|
1699
|
+
confidence: number;
|
|
1700
|
+
policyId: string;
|
|
1701
|
+
reason: {
|
|
1702
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
1703
|
+
detail: string;
|
|
1704
|
+
};
|
|
1705
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
1706
|
+
reversible: boolean;
|
|
1707
|
+
policyFingerprint?: string | undefined;
|
|
1708
|
+
};
|
|
1709
|
+
}, {
|
|
1710
|
+
type: "disposition-decided";
|
|
1711
|
+
proposalId: string;
|
|
1712
|
+
disposition: {
|
|
1713
|
+
kind: "rejected" | "accepted" | "requires-confirmation";
|
|
1714
|
+
confidence: number;
|
|
1715
|
+
reason: {
|
|
1716
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
1717
|
+
detail: string;
|
|
1718
|
+
};
|
|
1719
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
1720
|
+
reversible: boolean;
|
|
1721
|
+
policyId?: string | undefined;
|
|
1722
|
+
policyFingerprint?: string | undefined;
|
|
1723
|
+
};
|
|
1724
|
+
}>, z.ZodObject<{
|
|
1725
|
+
type: z.ZodLiteral<"repair-requested">;
|
|
1726
|
+
refusedProposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1727
|
+
reason: z.ZodObject<{
|
|
1728
|
+
code: z.ZodEnum<["confidence-below-floor", "stakes-at-refusal-floor", "irreversible", "discards-later-work", "redirected-submission", "repointed-binding", "stakes-above-ceiling", "confidence-below-minimum", "within-policy"]>;
|
|
1729
|
+
detail: z.ZodString;
|
|
1730
|
+
}, "strip", z.ZodTypeAny, {
|
|
1731
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
1732
|
+
detail: string;
|
|
1733
|
+
}, {
|
|
1734
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
1735
|
+
detail: string;
|
|
1736
|
+
}>;
|
|
1737
|
+
}, "strip", z.ZodTypeAny, {
|
|
1738
|
+
type: "repair-requested";
|
|
1739
|
+
reason: {
|
|
1740
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
1741
|
+
detail: string;
|
|
1742
|
+
};
|
|
1743
|
+
refusedProposalId: string & z.BRAND<"ProposalId">;
|
|
1744
|
+
}, {
|
|
1745
|
+
type: "repair-requested";
|
|
1746
|
+
reason: {
|
|
1747
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
1748
|
+
detail: string;
|
|
1749
|
+
};
|
|
1750
|
+
refusedProposalId: string;
|
|
1751
|
+
}>, z.ZodObject<{
|
|
1752
|
+
type: z.ZodLiteral<"repair-failed">;
|
|
1753
|
+
refusedProposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1754
|
+
failure: z.ZodObject<{
|
|
1755
|
+
code: z.ZodString;
|
|
1756
|
+
detail: z.ZodString;
|
|
1757
|
+
}, "strip", z.ZodTypeAny, {
|
|
1758
|
+
code: string;
|
|
1759
|
+
detail: string;
|
|
1760
|
+
}, {
|
|
1761
|
+
code: string;
|
|
1762
|
+
detail: string;
|
|
1763
|
+
}>;
|
|
1764
|
+
}, "strip", z.ZodTypeAny, {
|
|
1765
|
+
type: "repair-failed";
|
|
1766
|
+
failure: {
|
|
1767
|
+
code: string;
|
|
1768
|
+
detail: string;
|
|
1769
|
+
};
|
|
1770
|
+
refusedProposalId: string & z.BRAND<"ProposalId">;
|
|
1771
|
+
}, {
|
|
1772
|
+
type: "repair-failed";
|
|
1773
|
+
failure: {
|
|
1774
|
+
code: string;
|
|
1775
|
+
detail: string;
|
|
1776
|
+
};
|
|
1777
|
+
refusedProposalId: string;
|
|
1778
|
+
}>, z.ZodObject<{
|
|
1779
|
+
type: z.ZodLiteral<"change-applied">;
|
|
1780
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1781
|
+
revision: z.ZodNumber;
|
|
1782
|
+
}, "strip", z.ZodTypeAny, {
|
|
1783
|
+
type: "change-applied";
|
|
1784
|
+
revision: number;
|
|
1785
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1786
|
+
}, {
|
|
1787
|
+
type: "change-applied";
|
|
1788
|
+
revision: number;
|
|
1789
|
+
proposalId: string;
|
|
1790
|
+
}>, z.ZodObject<{
|
|
1791
|
+
type: z.ZodLiteral<"application-failed">;
|
|
1792
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1793
|
+
failure: z.ZodObject<{
|
|
1794
|
+
code: z.ZodString;
|
|
1795
|
+
detail: z.ZodString;
|
|
1796
|
+
}, "strip", z.ZodTypeAny, {
|
|
1797
|
+
code: string;
|
|
1798
|
+
detail: string;
|
|
1799
|
+
}, {
|
|
1800
|
+
code: string;
|
|
1801
|
+
detail: string;
|
|
1802
|
+
}>;
|
|
1803
|
+
}, "strip", z.ZodTypeAny, {
|
|
1804
|
+
type: "application-failed";
|
|
1805
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1806
|
+
failure: {
|
|
1807
|
+
code: string;
|
|
1808
|
+
detail: string;
|
|
1809
|
+
};
|
|
1810
|
+
}, {
|
|
1811
|
+
type: "application-failed";
|
|
1812
|
+
proposalId: string;
|
|
1813
|
+
failure: {
|
|
1814
|
+
code: string;
|
|
1815
|
+
detail: string;
|
|
1816
|
+
};
|
|
1817
|
+
}>, z.ZodObject<{
|
|
1818
|
+
type: z.ZodLiteral<"intent-not-writable">;
|
|
1819
|
+
intentId: z.ZodBranded<z.ZodString, "IntentId">;
|
|
1820
|
+
failure: z.ZodObject<{
|
|
1821
|
+
code: z.ZodString;
|
|
1822
|
+
detail: z.ZodString;
|
|
1823
|
+
}, "strip", z.ZodTypeAny, {
|
|
1824
|
+
code: string;
|
|
1825
|
+
detail: string;
|
|
1826
|
+
}, {
|
|
1827
|
+
code: string;
|
|
1828
|
+
detail: string;
|
|
1829
|
+
}>;
|
|
1830
|
+
}, "strip", z.ZodTypeAny, {
|
|
1831
|
+
type: "intent-not-writable";
|
|
1832
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
1833
|
+
failure: {
|
|
1834
|
+
code: string;
|
|
1835
|
+
detail: string;
|
|
1836
|
+
};
|
|
1837
|
+
}, {
|
|
1838
|
+
type: "intent-not-writable";
|
|
1839
|
+
intentId: string;
|
|
1840
|
+
failure: {
|
|
1841
|
+
code: string;
|
|
1842
|
+
detail: string;
|
|
1843
|
+
};
|
|
1844
|
+
}>, z.ZodObject<{
|
|
1845
|
+
type: z.ZodLiteral<"proposal-held">;
|
|
1846
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1847
|
+
}, "strip", z.ZodTypeAny, {
|
|
1848
|
+
type: "proposal-held";
|
|
1849
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1850
|
+
}, {
|
|
1851
|
+
type: "proposal-held";
|
|
1852
|
+
proposalId: string;
|
|
1853
|
+
}>, z.ZodObject<{
|
|
1854
|
+
type: z.ZodLiteral<"hold-failed">;
|
|
1855
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1856
|
+
failure: z.ZodObject<{
|
|
1857
|
+
code: z.ZodString;
|
|
1858
|
+
detail: z.ZodString;
|
|
1859
|
+
}, "strip", z.ZodTypeAny, {
|
|
1860
|
+
code: string;
|
|
1861
|
+
detail: string;
|
|
1862
|
+
}, {
|
|
1863
|
+
code: string;
|
|
1864
|
+
detail: string;
|
|
1865
|
+
}>;
|
|
1866
|
+
}, "strip", z.ZodTypeAny, {
|
|
1867
|
+
type: "hold-failed";
|
|
1868
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1869
|
+
failure: {
|
|
1870
|
+
code: string;
|
|
1871
|
+
detail: string;
|
|
1872
|
+
};
|
|
1873
|
+
}, {
|
|
1874
|
+
type: "hold-failed";
|
|
1875
|
+
proposalId: string;
|
|
1876
|
+
failure: {
|
|
1877
|
+
code: string;
|
|
1878
|
+
detail: string;
|
|
1879
|
+
};
|
|
1880
|
+
}>, z.ZodObject<{
|
|
1881
|
+
type: z.ZodLiteral<"hold-confirmed">;
|
|
1882
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1883
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
1884
|
+
}, "strip", z.ZodTypeAny, {
|
|
1885
|
+
type: "hold-confirmed";
|
|
1886
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1887
|
+
actor?: string | undefined;
|
|
1888
|
+
}, {
|
|
1889
|
+
type: "hold-confirmed";
|
|
1890
|
+
proposalId: string;
|
|
1891
|
+
actor?: string | undefined;
|
|
1892
|
+
}>, z.ZodObject<{
|
|
1893
|
+
type: z.ZodLiteral<"hold-discarded">;
|
|
1894
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1895
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
1896
|
+
}, "strip", z.ZodTypeAny, {
|
|
1897
|
+
type: "hold-discarded";
|
|
1898
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1899
|
+
actor?: string | undefined;
|
|
1900
|
+
}, {
|
|
1901
|
+
type: "hold-discarded";
|
|
1902
|
+
proposalId: string;
|
|
1903
|
+
actor?: string | undefined;
|
|
1904
|
+
}>, z.ZodObject<{
|
|
1905
|
+
type: z.ZodLiteral<"change-committed">;
|
|
1906
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1907
|
+
revision: z.ZodNumber;
|
|
1908
|
+
}, "strip", z.ZodTypeAny, {
|
|
1909
|
+
type: "change-committed";
|
|
1910
|
+
revision: number;
|
|
1911
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1912
|
+
}, {
|
|
1913
|
+
type: "change-committed";
|
|
1914
|
+
revision: number;
|
|
1915
|
+
proposalId: string;
|
|
1916
|
+
}>, z.ZodObject<{
|
|
1917
|
+
type: z.ZodLiteral<"commit-failed">;
|
|
1918
|
+
proposalId: z.ZodBranded<z.ZodString, "ProposalId">;
|
|
1919
|
+
failure: z.ZodObject<{
|
|
1920
|
+
code: z.ZodString;
|
|
1921
|
+
detail: z.ZodString;
|
|
1922
|
+
}, "strip", z.ZodTypeAny, {
|
|
1923
|
+
code: string;
|
|
1924
|
+
detail: string;
|
|
1925
|
+
}, {
|
|
1926
|
+
code: string;
|
|
1927
|
+
detail: string;
|
|
1928
|
+
}>;
|
|
1929
|
+
}, "strip", z.ZodTypeAny, {
|
|
1930
|
+
type: "commit-failed";
|
|
1931
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1932
|
+
failure: {
|
|
1933
|
+
code: string;
|
|
1934
|
+
detail: string;
|
|
1935
|
+
};
|
|
1936
|
+
}, {
|
|
1937
|
+
type: "commit-failed";
|
|
1938
|
+
proposalId: string;
|
|
1939
|
+
failure: {
|
|
1940
|
+
code: string;
|
|
1941
|
+
detail: string;
|
|
1942
|
+
};
|
|
1943
|
+
}>]>;
|
|
1944
|
+
}, "strip", z.ZodTypeAny, {
|
|
1945
|
+
treeId: string & z.BRAND<"TreeId">;
|
|
1946
|
+
occurredAt: string;
|
|
1947
|
+
event: {
|
|
1948
|
+
type: "intent-received";
|
|
1949
|
+
intent: {
|
|
1950
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
1951
|
+
baseRevision: number;
|
|
1952
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
1953
|
+
observedAt: string;
|
|
1954
|
+
utteranceLength: number;
|
|
1955
|
+
actor?: string | undefined;
|
|
1956
|
+
scopeNodeId?: (string & z.BRAND<"NodeId">) | undefined;
|
|
1957
|
+
};
|
|
1958
|
+
} | {
|
|
1959
|
+
type: "policy-resolved";
|
|
1960
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
1961
|
+
policyId: string;
|
|
1962
|
+
policyFingerprint?: string | undefined;
|
|
1963
|
+
} | {
|
|
1964
|
+
type: "interpretation-failed";
|
|
1965
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
1966
|
+
failure: {
|
|
1967
|
+
code: string;
|
|
1968
|
+
detail: string;
|
|
1969
|
+
};
|
|
1970
|
+
} | {
|
|
1971
|
+
type: "change-proposed";
|
|
1972
|
+
proposal: {
|
|
1973
|
+
rationale: string;
|
|
1974
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
1975
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
1976
|
+
delta: {
|
|
1977
|
+
treeId: string & z.BRAND<"TreeId">;
|
|
1978
|
+
operations: ({
|
|
1979
|
+
index: number;
|
|
1980
|
+
op: "insert";
|
|
1981
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
1982
|
+
node: import("../index.js").LoomNode;
|
|
1983
|
+
} | {
|
|
1984
|
+
op: "remove";
|
|
1985
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1986
|
+
} | {
|
|
1987
|
+
index: number;
|
|
1988
|
+
op: "move";
|
|
1989
|
+
parentId: string & z.BRAND<"NodeId">;
|
|
1990
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1991
|
+
} | {
|
|
1992
|
+
set: import("../json.js").JsonObject;
|
|
1993
|
+
op: "configure";
|
|
1994
|
+
nodeId: string & z.BRAND<"NodeId">;
|
|
1995
|
+
unset: string[];
|
|
1996
|
+
})[];
|
|
1997
|
+
deltaId: string & z.BRAND<"DeltaId">;
|
|
1998
|
+
baseRevision: number;
|
|
1999
|
+
};
|
|
2000
|
+
provenance: {
|
|
2001
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
2002
|
+
confidence: number;
|
|
2003
|
+
interpreter: string;
|
|
2004
|
+
authoredBy: "model" | "runtime";
|
|
2005
|
+
interpretedAt: string;
|
|
2006
|
+
actor?: string | undefined;
|
|
2007
|
+
promptHash?: string | undefined;
|
|
2008
|
+
undoes?: number | undefined;
|
|
2009
|
+
};
|
|
2010
|
+
repairOf?: (string & z.BRAND<"ProposalId">) | undefined;
|
|
2011
|
+
discards?: {
|
|
2012
|
+
revision: number;
|
|
2013
|
+
nodeIds: (string & z.BRAND<"NodeId">)[];
|
|
2014
|
+
}[] | undefined;
|
|
2015
|
+
};
|
|
2016
|
+
} | {
|
|
2017
|
+
type: "assessment-failed";
|
|
2018
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
2019
|
+
failure: {
|
|
2020
|
+
code: string;
|
|
2021
|
+
detail: string;
|
|
2022
|
+
};
|
|
2023
|
+
} | {
|
|
2024
|
+
type: "change-assessed";
|
|
2025
|
+
assessment: {
|
|
2026
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
2027
|
+
removedNodeCount: number;
|
|
2028
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
2029
|
+
reversible: boolean;
|
|
2030
|
+
operationCount: number;
|
|
2031
|
+
insertedNodeCount: number;
|
|
2032
|
+
movedNodeCount: number;
|
|
2033
|
+
configuredNodeCount: number;
|
|
2034
|
+
touchedPrimitiveTypes: (string & z.BRAND<"PrimitiveType">)[];
|
|
2035
|
+
shallowestAffectedDepth: number;
|
|
2036
|
+
retainedNodeCount: number;
|
|
2037
|
+
irreversibilityReasons: string[];
|
|
2038
|
+
removedPrimitiveTypes?: (string & z.BRAND<"PrimitiveType">)[] | undefined;
|
|
2039
|
+
relocatedPrimitiveTypes?: (string & z.BRAND<"PrimitiveType">)[] | undefined;
|
|
2040
|
+
relocatedNodeCount?: number | undefined;
|
|
2041
|
+
};
|
|
2042
|
+
} | {
|
|
2043
|
+
type: "disposition-decided";
|
|
2044
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
2045
|
+
disposition: {
|
|
2046
|
+
kind: "rejected" | "accepted" | "requires-confirmation";
|
|
2047
|
+
confidence: number;
|
|
2048
|
+
policyId: string;
|
|
2049
|
+
reason: {
|
|
2050
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
2051
|
+
detail: string;
|
|
2052
|
+
};
|
|
2053
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
2054
|
+
reversible: boolean;
|
|
2055
|
+
policyFingerprint?: string | undefined;
|
|
2056
|
+
};
|
|
2057
|
+
} | {
|
|
2058
|
+
type: "repair-requested";
|
|
2059
|
+
reason: {
|
|
2060
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
2061
|
+
detail: string;
|
|
2062
|
+
};
|
|
2063
|
+
refusedProposalId: string & z.BRAND<"ProposalId">;
|
|
2064
|
+
} | {
|
|
2065
|
+
type: "repair-failed";
|
|
2066
|
+
failure: {
|
|
2067
|
+
code: string;
|
|
2068
|
+
detail: string;
|
|
2069
|
+
};
|
|
2070
|
+
refusedProposalId: string & z.BRAND<"ProposalId">;
|
|
2071
|
+
} | {
|
|
2072
|
+
type: "change-applied";
|
|
2073
|
+
revision: number;
|
|
2074
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
2075
|
+
} | {
|
|
2076
|
+
type: "application-failed";
|
|
2077
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
2078
|
+
failure: {
|
|
2079
|
+
code: string;
|
|
2080
|
+
detail: string;
|
|
2081
|
+
};
|
|
2082
|
+
} | {
|
|
2083
|
+
type: "intent-not-writable";
|
|
2084
|
+
intentId: string & z.BRAND<"IntentId">;
|
|
2085
|
+
failure: {
|
|
2086
|
+
code: string;
|
|
2087
|
+
detail: string;
|
|
2088
|
+
};
|
|
2089
|
+
} | {
|
|
2090
|
+
type: "proposal-held";
|
|
2091
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
2092
|
+
} | {
|
|
2093
|
+
type: "hold-failed";
|
|
2094
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
2095
|
+
failure: {
|
|
2096
|
+
code: string;
|
|
2097
|
+
detail: string;
|
|
2098
|
+
};
|
|
2099
|
+
} | {
|
|
2100
|
+
type: "hold-confirmed";
|
|
2101
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
2102
|
+
actor?: string | undefined;
|
|
2103
|
+
} | {
|
|
2104
|
+
type: "hold-discarded";
|
|
2105
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
2106
|
+
actor?: string | undefined;
|
|
2107
|
+
} | {
|
|
2108
|
+
type: "change-committed";
|
|
2109
|
+
revision: number;
|
|
2110
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
2111
|
+
} | {
|
|
2112
|
+
type: "commit-failed";
|
|
2113
|
+
proposalId: string & z.BRAND<"ProposalId">;
|
|
2114
|
+
failure: {
|
|
2115
|
+
code: string;
|
|
2116
|
+
detail: string;
|
|
2117
|
+
};
|
|
2118
|
+
};
|
|
2119
|
+
}, {
|
|
2120
|
+
treeId: string;
|
|
2121
|
+
occurredAt: string;
|
|
2122
|
+
event: {
|
|
2123
|
+
type: "intent-received";
|
|
2124
|
+
intent: {
|
|
2125
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
2126
|
+
baseRevision: number;
|
|
2127
|
+
intentId: string;
|
|
2128
|
+
observedAt: string;
|
|
2129
|
+
utteranceLength: number;
|
|
2130
|
+
actor?: string | undefined;
|
|
2131
|
+
scopeNodeId?: string | undefined;
|
|
2132
|
+
};
|
|
2133
|
+
} | {
|
|
2134
|
+
type: "policy-resolved";
|
|
2135
|
+
intentId: string;
|
|
2136
|
+
policyId: string;
|
|
2137
|
+
policyFingerprint?: string | undefined;
|
|
2138
|
+
} | {
|
|
2139
|
+
type: "interpretation-failed";
|
|
2140
|
+
intentId: string;
|
|
2141
|
+
failure: {
|
|
2142
|
+
code: string;
|
|
2143
|
+
detail: string;
|
|
2144
|
+
};
|
|
2145
|
+
} | {
|
|
2146
|
+
type: "change-proposed";
|
|
2147
|
+
proposal: {
|
|
2148
|
+
rationale: string;
|
|
2149
|
+
intentId: string;
|
|
2150
|
+
proposalId: string;
|
|
2151
|
+
delta: {
|
|
2152
|
+
treeId: string;
|
|
2153
|
+
operations: ({
|
|
2154
|
+
index: number;
|
|
2155
|
+
op: "insert";
|
|
2156
|
+
parentId: string;
|
|
2157
|
+
node?: unknown;
|
|
2158
|
+
} | {
|
|
2159
|
+
op: "remove";
|
|
2160
|
+
nodeId: string;
|
|
2161
|
+
} | {
|
|
2162
|
+
index: number;
|
|
2163
|
+
op: "move";
|
|
2164
|
+
parentId: string;
|
|
2165
|
+
nodeId: string;
|
|
2166
|
+
} | {
|
|
2167
|
+
op: "configure";
|
|
2168
|
+
nodeId: string;
|
|
2169
|
+
set?: import("../json.js").JsonObject | undefined;
|
|
2170
|
+
unset?: string[] | undefined;
|
|
2171
|
+
})[];
|
|
2172
|
+
deltaId: string;
|
|
2173
|
+
baseRevision: number;
|
|
2174
|
+
};
|
|
2175
|
+
provenance: {
|
|
2176
|
+
origin: "user-instruction" | "system-signal" | "scheduled-adaptation" | "developer";
|
|
2177
|
+
confidence: number;
|
|
2178
|
+
interpreter: string;
|
|
2179
|
+
interpretedAt: string;
|
|
2180
|
+
actor?: string | undefined;
|
|
2181
|
+
authoredBy?: "model" | "runtime" | undefined;
|
|
2182
|
+
promptHash?: string | undefined;
|
|
2183
|
+
undoes?: number | undefined;
|
|
2184
|
+
};
|
|
2185
|
+
repairOf?: string | undefined;
|
|
2186
|
+
discards?: {
|
|
2187
|
+
revision: number;
|
|
2188
|
+
nodeIds: string[];
|
|
2189
|
+
}[] | undefined;
|
|
2190
|
+
};
|
|
2191
|
+
} | {
|
|
2192
|
+
type: "assessment-failed";
|
|
2193
|
+
proposalId: string;
|
|
2194
|
+
failure: {
|
|
2195
|
+
code: string;
|
|
2196
|
+
detail: string;
|
|
2197
|
+
};
|
|
2198
|
+
} | {
|
|
2199
|
+
type: "change-assessed";
|
|
2200
|
+
assessment: {
|
|
2201
|
+
proposalId: string;
|
|
2202
|
+
removedNodeCount: number;
|
|
2203
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
2204
|
+
reversible: boolean;
|
|
2205
|
+
operationCount: number;
|
|
2206
|
+
insertedNodeCount: number;
|
|
2207
|
+
movedNodeCount: number;
|
|
2208
|
+
configuredNodeCount: number;
|
|
2209
|
+
touchedPrimitiveTypes: string[];
|
|
2210
|
+
shallowestAffectedDepth: number;
|
|
2211
|
+
retainedNodeCount: number;
|
|
2212
|
+
irreversibilityReasons: string[];
|
|
2213
|
+
removedPrimitiveTypes?: string[] | undefined;
|
|
2214
|
+
relocatedPrimitiveTypes?: string[] | undefined;
|
|
2215
|
+
relocatedNodeCount?: number | undefined;
|
|
2216
|
+
};
|
|
2217
|
+
} | {
|
|
2218
|
+
type: "disposition-decided";
|
|
2219
|
+
proposalId: string;
|
|
2220
|
+
disposition: {
|
|
2221
|
+
kind: "rejected" | "accepted" | "requires-confirmation";
|
|
2222
|
+
confidence: number;
|
|
2223
|
+
reason: {
|
|
2224
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
2225
|
+
detail: string;
|
|
2226
|
+
};
|
|
2227
|
+
stakes: "low" | "medium" | "high" | "critical";
|
|
2228
|
+
reversible: boolean;
|
|
2229
|
+
policyId?: string | undefined;
|
|
2230
|
+
policyFingerprint?: string | undefined;
|
|
2231
|
+
};
|
|
2232
|
+
} | {
|
|
2233
|
+
type: "repair-requested";
|
|
2234
|
+
reason: {
|
|
2235
|
+
code: "discards-later-work" | "redirected-submission" | "repointed-binding" | "confidence-below-floor" | "stakes-at-refusal-floor" | "irreversible" | "stakes-above-ceiling" | "confidence-below-minimum" | "within-policy";
|
|
2236
|
+
detail: string;
|
|
2237
|
+
};
|
|
2238
|
+
refusedProposalId: string;
|
|
2239
|
+
} | {
|
|
2240
|
+
type: "repair-failed";
|
|
2241
|
+
failure: {
|
|
2242
|
+
code: string;
|
|
2243
|
+
detail: string;
|
|
2244
|
+
};
|
|
2245
|
+
refusedProposalId: string;
|
|
2246
|
+
} | {
|
|
2247
|
+
type: "change-applied";
|
|
2248
|
+
revision: number;
|
|
2249
|
+
proposalId: string;
|
|
2250
|
+
} | {
|
|
2251
|
+
type: "application-failed";
|
|
2252
|
+
proposalId: string;
|
|
2253
|
+
failure: {
|
|
2254
|
+
code: string;
|
|
2255
|
+
detail: string;
|
|
2256
|
+
};
|
|
2257
|
+
} | {
|
|
2258
|
+
type: "intent-not-writable";
|
|
2259
|
+
intentId: string;
|
|
2260
|
+
failure: {
|
|
2261
|
+
code: string;
|
|
2262
|
+
detail: string;
|
|
2263
|
+
};
|
|
2264
|
+
} | {
|
|
2265
|
+
type: "proposal-held";
|
|
2266
|
+
proposalId: string;
|
|
2267
|
+
} | {
|
|
2268
|
+
type: "hold-failed";
|
|
2269
|
+
proposalId: string;
|
|
2270
|
+
failure: {
|
|
2271
|
+
code: string;
|
|
2272
|
+
detail: string;
|
|
2273
|
+
};
|
|
2274
|
+
} | {
|
|
2275
|
+
type: "hold-confirmed";
|
|
2276
|
+
proposalId: string;
|
|
2277
|
+
actor?: string | undefined;
|
|
2278
|
+
} | {
|
|
2279
|
+
type: "hold-discarded";
|
|
2280
|
+
proposalId: string;
|
|
2281
|
+
actor?: string | undefined;
|
|
2282
|
+
} | {
|
|
2283
|
+
type: "change-committed";
|
|
2284
|
+
revision: number;
|
|
2285
|
+
proposalId: string;
|
|
2286
|
+
} | {
|
|
2287
|
+
type: "commit-failed";
|
|
2288
|
+
proposalId: string;
|
|
2289
|
+
failure: {
|
|
2290
|
+
code: string;
|
|
2291
|
+
detail: string;
|
|
2292
|
+
};
|
|
2293
|
+
};
|
|
2294
|
+
}>;
|
|
2295
|
+
export type TelemetryRecord = {
|
|
2296
|
+
readonly treeId: TreeId;
|
|
2297
|
+
readonly occurredAt: string;
|
|
2298
|
+
readonly event: TelemetryEvent;
|
|
2299
|
+
};
|
|
2300
|
+
export declare const recordOf: (envelope: RuntimeEventEnvelope) => TelemetryRecord;
|
|
2301
|
+
/**
|
|
2302
|
+
* The proposal an event is about, when it is about one. Used by the fold rather
|
|
2303
|
+
* than stored as a column: a query that needs an index on it is a change with a
|
|
2304
|
+
* reason behind it, and duplicating a field into a column is how two copies of
|
|
2305
|
+
* the same fact start disagreeing.
|
|
2306
|
+
*/
|
|
2307
|
+
export declare const proposalIdOf: (event: TelemetryEvent) => ProposalId | undefined;
|
|
2308
|
+
/** The intent an event names directly. Everything else reaches one via its proposal. */
|
|
2309
|
+
export declare const intentIdOf: (event: TelemetryEvent) => IntentId | undefined;
|
|
2310
|
+
//# sourceMappingURL=event.d.ts.map
|