@dynamicalsystems/idl 0.6.1 → 0.7.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/dist/index.cjs +68 -0
- package/dist/index.d.cts +49 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +49 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +64 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -15
- package/src/index.ts +10 -0
- package/src/run/event.v1.ts +95 -0
package/dist/index.cjs
CHANGED
|
@@ -626,6 +626,68 @@ const ordinaryAuthorityV1 = {
|
|
|
626
626
|
const EXECUTOR_PROTOCOL_VERSION = "dsg.run.executor/1";
|
|
627
627
|
const PROVIDER_PROTOCOL_VERSION = "dsg.run.provider/1";
|
|
628
628
|
//#endregion
|
|
629
|
+
//#region src/run/event.v1.ts
|
|
630
|
+
const EVENT_PROFILE = "dsg.run.event/1";
|
|
631
|
+
/** The wire prefix that lets a collector pick these lines out of ordinary
|
|
632
|
+
* job logs. One space, then the JSON object, then a newline. */
|
|
633
|
+
const EVENT_LINE_PREFIX = "DSGEV ";
|
|
634
|
+
/** The lifecycle spine every catalog carries without declaring it: the
|
|
635
|
+
* kinds the console draws for any workload, whatever it models. A
|
|
636
|
+
* workload emitting only started and finished is fully described. */
|
|
637
|
+
const LIFECYCLE_KINDS = [
|
|
638
|
+
"started",
|
|
639
|
+
"phase.entered",
|
|
640
|
+
"phase.exited",
|
|
641
|
+
"progress",
|
|
642
|
+
"checkpoint",
|
|
643
|
+
"artifact",
|
|
644
|
+
"warning",
|
|
645
|
+
"failure",
|
|
646
|
+
"finished"
|
|
647
|
+
];
|
|
648
|
+
const EventSchema = closed({
|
|
649
|
+
profile: _sinclair_typebox.Type.Literal(EVENT_PROFILE),
|
|
650
|
+
/** The operation this event belongs to; injected into the job's
|
|
651
|
+
* environment by the plane, never chosen by the workload. */
|
|
652
|
+
operation: NonEmptyString,
|
|
653
|
+
/** Monotonic within one operation, from 1. Ordering lives here. */
|
|
654
|
+
sequence: _sinclair_typebox.Type.Integer({
|
|
655
|
+
minimum: 1,
|
|
656
|
+
maximum: Number.MAX_SAFE_INTEGER
|
|
657
|
+
}),
|
|
658
|
+
at: UtcSecond,
|
|
659
|
+
/** A lifecycle kind or one the pinned catalog declares. */
|
|
660
|
+
kind: NonEmptyString,
|
|
661
|
+
/** Digest of the catalog the payload validates against. */
|
|
662
|
+
catalogSha256: Hex64,
|
|
663
|
+
/** Validated against the catalog by digest, not by this schema: a
|
|
664
|
+
* modeler's vocabulary is theirs, and the plane refuses a payload the
|
|
665
|
+
* catalog does not admit. Artifacts are references, never contents. */
|
|
666
|
+
payload: _sinclair_typebox.Type.Record(_sinclair_typebox.Type.String(), _sinclair_typebox.Type.Unknown())
|
|
667
|
+
});
|
|
668
|
+
const EventStreamSealSchema = closed({
|
|
669
|
+
profile: _sinclair_typebox.Type.Literal(EVENT_PROFILE),
|
|
670
|
+
operation: NonEmptyString,
|
|
671
|
+
catalogSha256: Hex64,
|
|
672
|
+
/** sha256 over the newline-joined canonical event lines, in sequence. */
|
|
673
|
+
streamSha256: Hex64,
|
|
674
|
+
eventCount: SafeInt,
|
|
675
|
+
/** Sequence numbers missing from an otherwise ordered stream. */
|
|
676
|
+
gaps: _sinclair_typebox.Type.Array(_sinclair_typebox.Type.Integer({
|
|
677
|
+
minimum: 1,
|
|
678
|
+
maximum: Number.MAX_SAFE_INTEGER
|
|
679
|
+
})),
|
|
680
|
+
truncatedAtSequence: _sinclair_typebox.Type.Union([_sinclair_typebox.Type.Integer({ minimum: 1 }), _sinclair_typebox.Type.Null()])
|
|
681
|
+
});
|
|
682
|
+
const eventV1 = {
|
|
683
|
+
literal: EVENT_PROFILE,
|
|
684
|
+
rootShape: "event",
|
|
685
|
+
shapes: {
|
|
686
|
+
event: EventSchema,
|
|
687
|
+
streamSeal: EventStreamSealSchema
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
//#endregion
|
|
629
691
|
//#region src/index.ts
|
|
630
692
|
/** Every profile this version of the package defines, keyed by literal.
|
|
631
693
|
* Profile modules are added here as they are extracted; the rules test
|
|
@@ -634,6 +696,7 @@ const PROVIDER_PROTOCOL_VERSION = "dsg.run.provider/1";
|
|
|
634
696
|
const PROFILES = {
|
|
635
697
|
[dispatchConsumeV1.literal]: dispatchConsumeV1,
|
|
636
698
|
[operationV1.literal]: operationV1,
|
|
699
|
+
[eventV1.literal]: eventV1,
|
|
637
700
|
[signedLawV1.literal]: signedLawV1,
|
|
638
701
|
[resourceDescriptorV1.literal]: resourceDescriptorV1,
|
|
639
702
|
[adoptionFactV1.literal]: adoptionFactV1,
|
|
@@ -654,11 +717,16 @@ exports.DispatchConsumeRequestSchema = DispatchConsumeRequestSchema;
|
|
|
654
717
|
exports.DispatchLeaseSchema = DispatchLeaseSchema;
|
|
655
718
|
exports.DispatchRefusalCodeSchema = DispatchRefusalCodeSchema;
|
|
656
719
|
exports.DispatchRefusalSchema = DispatchRefusalSchema;
|
|
720
|
+
exports.EVENT_LINE_PREFIX = EVENT_LINE_PREFIX;
|
|
721
|
+
exports.EVENT_PROFILE = EVENT_PROFILE;
|
|
657
722
|
exports.EXECUTOR_PROTOCOL_VERSION = EXECUTOR_PROTOCOL_VERSION;
|
|
723
|
+
exports.EventSchema = EventSchema;
|
|
724
|
+
exports.EventStreamSealSchema = EventStreamSealSchema;
|
|
658
725
|
exports.ExecutionDocumentSchema = ExecutionDocumentSchema;
|
|
659
726
|
exports.ExecutionLawSchema = ExecutionLawSchema;
|
|
660
727
|
exports.ExecutionResourcesSchema = ExecutionResourcesSchema;
|
|
661
728
|
exports.Hex64 = Hex64;
|
|
729
|
+
exports.LIFECYCLE_KINDS = LIFECYCLE_KINDS;
|
|
662
730
|
exports.NonEmptyString = NonEmptyString;
|
|
663
731
|
exports.OPERATION_PROFILE = OPERATION_PROFILE;
|
|
664
732
|
exports.ORDINARY_AUTHORITY_PROFILE = ORDINARY_AUTHORITY_PROFILE;
|
package/dist/index.d.cts
CHANGED
|
@@ -661,6 +661,54 @@ type ExecutorProtocolVersion = typeof EXECUTOR_PROTOCOL_VERSION;
|
|
|
661
661
|
declare const PROVIDER_PROTOCOL_VERSION: "dsg.run.provider/1";
|
|
662
662
|
type ProviderProtocolVersion = typeof PROVIDER_PROTOCOL_VERSION;
|
|
663
663
|
//#endregion
|
|
664
|
+
//#region src/run/event.v1.d.ts
|
|
665
|
+
declare const EVENT_PROFILE: "dsg.run.event/1";
|
|
666
|
+
/** The wire prefix that lets a collector pick these lines out of ordinary
|
|
667
|
+
* job logs. One space, then the JSON object, then a newline. */
|
|
668
|
+
declare const EVENT_LINE_PREFIX: "DSGEV ";
|
|
669
|
+
/** The lifecycle spine every catalog carries without declaring it: the
|
|
670
|
+
* kinds the console draws for any workload, whatever it models. A
|
|
671
|
+
* workload emitting only started and finished is fully described. */
|
|
672
|
+
declare const LIFECYCLE_KINDS: readonly ["started", "phase.entered", "phase.exited", "progress", "checkpoint", "artifact", "warning", "failure", "finished"];
|
|
673
|
+
declare const EventSchemaValue: import("@sinclair/typebox").TObject<{
|
|
674
|
+
profile: import("@sinclair/typebox").TLiteral<"dsg.run.event/1">;
|
|
675
|
+
/** The operation this event belongs to; injected into the job's
|
|
676
|
+
* environment by the plane, never chosen by the workload. */
|
|
677
|
+
operation: import("@sinclair/typebox").TString;
|
|
678
|
+
/** Monotonic within one operation, from 1. Ordering lives here. */
|
|
679
|
+
sequence: import("@sinclair/typebox").TInteger;
|
|
680
|
+
at: import("@sinclair/typebox").TString;
|
|
681
|
+
/** A lifecycle kind or one the pinned catalog declares. */
|
|
682
|
+
kind: import("@sinclair/typebox").TString;
|
|
683
|
+
/** Digest of the catalog the payload validates against. */
|
|
684
|
+
catalogSha256: import("@sinclair/typebox").TString;
|
|
685
|
+
/** Validated against the catalog by digest, not by this schema: a
|
|
686
|
+
* modeler's vocabulary is theirs, and the plane refuses a payload the
|
|
687
|
+
* catalog does not admit. Artifacts are references, never contents. */
|
|
688
|
+
payload: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
|
|
689
|
+
}>;
|
|
690
|
+
declare const EventSchema: typeof EventSchemaValue;
|
|
691
|
+
type Event = Static<typeof EventSchema>;
|
|
692
|
+
/** What the plane seals into the outcome: the ordered stream's own digest,
|
|
693
|
+
* the catalog it validated against, and the count - enough for an
|
|
694
|
+
* offline reader holding the exported stream to recompute the verdict
|
|
695
|
+
* without the plane. `truncatedAtSequence` is the event ceiling's mark:
|
|
696
|
+
* a runaway logger is bounded, and the bound is visible rather than a
|
|
697
|
+
* silently short stream. */
|
|
698
|
+
declare const EventStreamSealSchemaValue: import("@sinclair/typebox").TObject<{
|
|
699
|
+
profile: import("@sinclair/typebox").TLiteral<"dsg.run.event/1">;
|
|
700
|
+
operation: import("@sinclair/typebox").TString;
|
|
701
|
+
catalogSha256: import("@sinclair/typebox").TString;
|
|
702
|
+
/** sha256 over the newline-joined canonical event lines, in sequence. */
|
|
703
|
+
streamSha256: import("@sinclair/typebox").TString;
|
|
704
|
+
eventCount: import("@sinclair/typebox").TInteger;
|
|
705
|
+
/** Sequence numbers missing from an otherwise ordered stream. */
|
|
706
|
+
gaps: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TInteger>;
|
|
707
|
+
truncatedAtSequence: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
|
|
708
|
+
}>;
|
|
709
|
+
declare const EventStreamSealSchema: typeof EventStreamSealSchemaValue;
|
|
710
|
+
type EventStreamSeal = Static<typeof EventStreamSealSchema>;
|
|
711
|
+
//#endregion
|
|
664
712
|
//#region src/index.d.ts
|
|
665
713
|
/** Every profile this version of the package defines, keyed by literal.
|
|
666
714
|
* Profile modules are added here as they are extracted; the rules test
|
|
@@ -668,5 +716,5 @@ type ProviderProtocolVersion = typeof PROVIDER_PROTOCOL_VERSION;
|
|
|
668
716
|
* registered does not exist. */
|
|
669
717
|
declare const PROFILES: Readonly<Record<string, ProfileEntry>>;
|
|
670
718
|
//#endregion
|
|
671
|
-
export { ADOPTION_FACT_PROFILE, type Accepted, AcceptedSchema, type AdoptionFact, AdoptionFactSchema, BOOTSTRAP_PROFILE, type BootstrapAction, BootstrapActionSchema, type BootstrapIntent, BootstrapIntentSchema, DISPATCH_CONSUME_PROFILE, DISPATCH_MAX_SKEW_SECONDS, type DispatchConsumeRequest, DispatchConsumeRequestSchema, type DispatchLease, DispatchLeaseSchema, type DispatchRefusal, type DispatchRefusalCode, DispatchRefusalCodeSchema, DispatchRefusalSchema, EXECUTOR_PROTOCOL_VERSION, type ExecutionDocument, ExecutionDocumentSchema, type ExecutionLaw, ExecutionLawSchema, type ExecutionResources, ExecutionResourcesSchema, type ExecutorProtocolVersion, Hex64, NonEmptyString, OPERATION_PROFILE, ORDINARY_AUTHORITY_PROFILE, type OperationBefore, OperationBeforeSchema, type OperationCleanup, OperationCleanupSchema, type OperationCost, OperationCostSchema, type OperationEvidence, OperationEvidenceSchema, type OperationExecution, OperationExecutionSchema, type OperationRequest, OperationRequestSchema, type OperationStatus, OperationStatusSchema, type OrdinaryAuthority, OrdinaryAuthoritySchema, Orn, PRICE_PROFILE_REFERENCE, PROFILES, PROVIDER_PROTOCOL_VERSION, type ProfileEntry, type ProviderProtocolVersion, RESOURCE_DESCRIPTOR_KIND, RESOURCE_DESCRIPTOR_PROFILE, REVOCATIONS_PROFILE, type Readback, ReadbackSchema, Reference, type ResourceDescriptor, ResourceDescriptorSchema, type RevocationPointer, RevocationPointerSchema, RevocationSchema, type RevocationSnapshot, SCOPE_REFERENCE, SIGNED_LAW_DOMAIN, SIGNED_LAW_PROFILE, SafeInt, type SignedBootstrapIntent, SignedBootstrapIntentSchema, type SignedLawBundle, SignedLawBundleSchema, UtcSecond, closed };
|
|
719
|
+
export { ADOPTION_FACT_PROFILE, type Accepted, AcceptedSchema, type AdoptionFact, AdoptionFactSchema, BOOTSTRAP_PROFILE, type BootstrapAction, BootstrapActionSchema, type BootstrapIntent, BootstrapIntentSchema, DISPATCH_CONSUME_PROFILE, DISPATCH_MAX_SKEW_SECONDS, type DispatchConsumeRequest, DispatchConsumeRequestSchema, type DispatchLease, DispatchLeaseSchema, type DispatchRefusal, type DispatchRefusalCode, DispatchRefusalCodeSchema, DispatchRefusalSchema, EVENT_LINE_PREFIX, EVENT_PROFILE, EXECUTOR_PROTOCOL_VERSION, type Event, EventSchema, type EventStreamSeal, EventStreamSealSchema, type ExecutionDocument, ExecutionDocumentSchema, type ExecutionLaw, ExecutionLawSchema, type ExecutionResources, ExecutionResourcesSchema, type ExecutorProtocolVersion, Hex64, LIFECYCLE_KINDS, NonEmptyString, OPERATION_PROFILE, ORDINARY_AUTHORITY_PROFILE, type OperationBefore, OperationBeforeSchema, type OperationCleanup, OperationCleanupSchema, type OperationCost, OperationCostSchema, type OperationEvidence, OperationEvidenceSchema, type OperationExecution, OperationExecutionSchema, type OperationRequest, OperationRequestSchema, type OperationStatus, OperationStatusSchema, type OrdinaryAuthority, OrdinaryAuthoritySchema, Orn, PRICE_PROFILE_REFERENCE, PROFILES, PROVIDER_PROTOCOL_VERSION, type ProfileEntry, type ProviderProtocolVersion, RESOURCE_DESCRIPTOR_KIND, RESOURCE_DESCRIPTOR_PROFILE, REVOCATIONS_PROFILE, type Readback, ReadbackSchema, Reference, type ResourceDescriptor, ResourceDescriptorSchema, type RevocationPointer, RevocationPointerSchema, RevocationSchema, type RevocationSnapshot, SCOPE_REFERENCE, SIGNED_LAW_DOMAIN, SIGNED_LAW_PROFILE, SafeInt, type SignedBootstrapIntent, SignedBootstrapIntentSchema, type SignedLawBundle, SignedLawBundleSchema, UtcSecond, closed };
|
|
672
720
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/primitives.ts","../src/kernel/dispatch-consume.v1.ts","../src/run/operation.v1.ts","../src/infra/signed-law.v1.ts","../src/infra/resource-descriptor.v1.ts","../src/infra/adoption-fact.v1.ts","../src/registry/revocations.v1.ts","../src/kernel/bootstrap.v1.ts","../src/kernel/ordinary-authority.v1.ts","../src/run/contract-versions.ts","../src/index.ts"],"mappings":";;;cAOa,SAAU,UAAU,aAAW,YAAc,MAAI,QAAQ;;cAIzD,mCAAK;;cAGL,uCAAS;cAIT,4CAAc;cAEd,qCAAO;;;;;;cAOP,iCAAG;;cAGH,WAAS;;;;;;;KAQV;WACD;WACA,QAAQ,SAAS,eAAe;;;WAGhC;;;;WAIA;;;;cCnBE;;cAGA;cAEP,+DAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwB1B,qCAAqC;KAEtC,yBAAyB,cAAc;cAE7C,sDAAwB;;;;;;;;;;;;;;;;;;;;;;;;cAqBjB,4BAA4B;KAC7B,gBAAgB,cAAc;cAEpC,4DAA8B,oCAAA,2DAAA,wDAAA,0DAAA,iDAAA,2DAAA,+EAAA;cASvB,kCAAkC;KAEnC,sBAAsB,cAAc;cAE1C,wDAA0B;;;;;cAKnB,8BAA8B;KAC/B,kBAAkB,cAAc;;;cC3E/B;cAEP,2DAA6B;;;;;cAKtB,iCAAiC;KAElC,qBAAqB,cAAc;cAEzC,qDAAuB;;;;;;;;;;cAIhB,2BAA2B;KAC5B,eAAe,cAAc;cAEnC,0DAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAYrB,gCAAgC;KAEjC,oBAAoB,cAAc;cAExC,wDAA0B;;;;cAInB,8BAA8B;KAC/B,kBAAkB,cAAc;cAEtC,yDAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAYpB,+BAA+B;KAEhC,mBAAmB,cAAc;cAEvC,iDAAmB;;;;;;;;cAQZ,uBAAuB;KACxB,WAAW,cAAc;cAE/B,2DAA6B,oCAAA,gDAAA,iDAAA,mDAAA,g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AKP,0DAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwBrB,gCAAgC;KAEjC,oBAAoB,cAAc;;;cCtCjC;KACD,iCAAiC;cAEhC;KACD,iCAAiC;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/primitives.ts","../src/kernel/dispatch-consume.v1.ts","../src/run/operation.v1.ts","../src/infra/signed-law.v1.ts","../src/infra/resource-descriptor.v1.ts","../src/infra/adoption-fact.v1.ts","../src/registry/revocations.v1.ts","../src/kernel/bootstrap.v1.ts","../src/kernel/ordinary-authority.v1.ts","../src/run/contract-versions.ts","../src/run/event.v1.ts","../src/index.ts"],"mappings":";;;cAOa,SAAU,UAAU,aAAW,YAAc,MAAI,QAAQ;;cAIzD,mCAAK;;cAGL,uCAAS;cAIT,4CAAc;cAEd,qCAAO;;;;;;cAOP,iCAAG;;cAGH,WAAS;;;;;;;KAQV;WACD;WACA,QAAQ,SAAS,eAAe;;;WAGhC;;;;WAIA;;;;cCnBE;;cAGA;cAEP,+DAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwB1B,qCAAqC;KAEtC,yBAAyB,cAAc;cAE7C,sDAAwB;;;;;;;;;;;;;;;;;;;;;;;;cAqBjB,4BAA4B;KAC7B,gBAAgB,cAAc;cAEpC,4DAA8B,oCAAA,2DAAA,wDAAA,0DAAA,iDAAA,2DAAA,+EAAA;cASvB,kCAAkC;KAEnC,sBAAsB,cAAc;cAE1C,wDAA0B;;;;;cAKnB,8BAA8B;KAC/B,kBAAkB,cAAc;;;cC3E/B;cAEP,2DAA6B;;;;;cAKtB,iCAAiC;KAElC,qBAAqB,cAAc;cAEzC,qDAAuB;;;;;;;;;;cAIhB,2BAA2B;KAC5B,eAAe,cAAc;cAEnC,0DAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAYrB,gCAAgC;KAEjC,oBAAoB,cAAc;cAExC,wDAA0B;;;;cAInB,8BAA8B;KAC/B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P,wDAA0B,oCAAA,kEAAA,+DAAA,+DAAA;cAMnB,8BAA8B;KAC/B,kBAAkB,cAAc;cAEtC,wDAA0B;;;;;;;;;;;;;;;;;;;;;;;;cA2BnB,8BAA8B;KAC/B,kBAAkB,cAAc;cAEtC,8DAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;cAIzB,oCAAoC;KAErC,wBAAwB,cAAc;;;cC/CrC;cAKP,0DAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwBrB,gCAAgC;KAEjC,oBAAoB,cAAc;;;cCtCjC;KACD,iCAAiC;cAEhC;KACD,iCAAiC;;;cCiBhC;;;cAIA;;;;cAKA;cAYP,8CAAgB;;;;;;;;;;;;;;;;;cAiBT,oBAAoB;KACrB,QAAQ,cAAc;;;;;;;cAQ5B,wDAA0B;;;;;;;;;;;cAWnB,8BAA8B;KAC/B,kBAAkB,cAAc;;;;;;;cCqB/B,UAAU,SAAS,eAAe"}
|
package/dist/index.d.mts
CHANGED
|
@@ -661,6 +661,54 @@ type ExecutorProtocolVersion = typeof EXECUTOR_PROTOCOL_VERSION;
|
|
|
661
661
|
declare const PROVIDER_PROTOCOL_VERSION: "dsg.run.provider/1";
|
|
662
662
|
type ProviderProtocolVersion = typeof PROVIDER_PROTOCOL_VERSION;
|
|
663
663
|
//#endregion
|
|
664
|
+
//#region src/run/event.v1.d.ts
|
|
665
|
+
declare const EVENT_PROFILE: "dsg.run.event/1";
|
|
666
|
+
/** The wire prefix that lets a collector pick these lines out of ordinary
|
|
667
|
+
* job logs. One space, then the JSON object, then a newline. */
|
|
668
|
+
declare const EVENT_LINE_PREFIX: "DSGEV ";
|
|
669
|
+
/** The lifecycle spine every catalog carries without declaring it: the
|
|
670
|
+
* kinds the console draws for any workload, whatever it models. A
|
|
671
|
+
* workload emitting only started and finished is fully described. */
|
|
672
|
+
declare const LIFECYCLE_KINDS: readonly ["started", "phase.entered", "phase.exited", "progress", "checkpoint", "artifact", "warning", "failure", "finished"];
|
|
673
|
+
declare const EventSchemaValue: import("@sinclair/typebox").TObject<{
|
|
674
|
+
profile: import("@sinclair/typebox").TLiteral<"dsg.run.event/1">;
|
|
675
|
+
/** The operation this event belongs to; injected into the job's
|
|
676
|
+
* environment by the plane, never chosen by the workload. */
|
|
677
|
+
operation: import("@sinclair/typebox").TString;
|
|
678
|
+
/** Monotonic within one operation, from 1. Ordering lives here. */
|
|
679
|
+
sequence: import("@sinclair/typebox").TInteger;
|
|
680
|
+
at: import("@sinclair/typebox").TString;
|
|
681
|
+
/** A lifecycle kind or one the pinned catalog declares. */
|
|
682
|
+
kind: import("@sinclair/typebox").TString;
|
|
683
|
+
/** Digest of the catalog the payload validates against. */
|
|
684
|
+
catalogSha256: import("@sinclair/typebox").TString;
|
|
685
|
+
/** Validated against the catalog by digest, not by this schema: a
|
|
686
|
+
* modeler's vocabulary is theirs, and the plane refuses a payload the
|
|
687
|
+
* catalog does not admit. Artifacts are references, never contents. */
|
|
688
|
+
payload: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
|
|
689
|
+
}>;
|
|
690
|
+
declare const EventSchema: typeof EventSchemaValue;
|
|
691
|
+
type Event = Static<typeof EventSchema>;
|
|
692
|
+
/** What the plane seals into the outcome: the ordered stream's own digest,
|
|
693
|
+
* the catalog it validated against, and the count - enough for an
|
|
694
|
+
* offline reader holding the exported stream to recompute the verdict
|
|
695
|
+
* without the plane. `truncatedAtSequence` is the event ceiling's mark:
|
|
696
|
+
* a runaway logger is bounded, and the bound is visible rather than a
|
|
697
|
+
* silently short stream. */
|
|
698
|
+
declare const EventStreamSealSchemaValue: import("@sinclair/typebox").TObject<{
|
|
699
|
+
profile: import("@sinclair/typebox").TLiteral<"dsg.run.event/1">;
|
|
700
|
+
operation: import("@sinclair/typebox").TString;
|
|
701
|
+
catalogSha256: import("@sinclair/typebox").TString;
|
|
702
|
+
/** sha256 over the newline-joined canonical event lines, in sequence. */
|
|
703
|
+
streamSha256: import("@sinclair/typebox").TString;
|
|
704
|
+
eventCount: import("@sinclair/typebox").TInteger;
|
|
705
|
+
/** Sequence numbers missing from an otherwise ordered stream. */
|
|
706
|
+
gaps: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TInteger>;
|
|
707
|
+
truncatedAtSequence: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>;
|
|
708
|
+
}>;
|
|
709
|
+
declare const EventStreamSealSchema: typeof EventStreamSealSchemaValue;
|
|
710
|
+
type EventStreamSeal = Static<typeof EventStreamSealSchema>;
|
|
711
|
+
//#endregion
|
|
664
712
|
//#region src/index.d.ts
|
|
665
713
|
/** Every profile this version of the package defines, keyed by literal.
|
|
666
714
|
* Profile modules are added here as they are extracted; the rules test
|
|
@@ -668,5 +716,5 @@ type ProviderProtocolVersion = typeof PROVIDER_PROTOCOL_VERSION;
|
|
|
668
716
|
* registered does not exist. */
|
|
669
717
|
declare const PROFILES: Readonly<Record<string, ProfileEntry>>;
|
|
670
718
|
//#endregion
|
|
671
|
-
export { ADOPTION_FACT_PROFILE, type Accepted, AcceptedSchema, type AdoptionFact, AdoptionFactSchema, BOOTSTRAP_PROFILE, type BootstrapAction, BootstrapActionSchema, type BootstrapIntent, BootstrapIntentSchema, DISPATCH_CONSUME_PROFILE, DISPATCH_MAX_SKEW_SECONDS, type DispatchConsumeRequest, DispatchConsumeRequestSchema, type DispatchLease, DispatchLeaseSchema, type DispatchRefusal, type DispatchRefusalCode, DispatchRefusalCodeSchema, DispatchRefusalSchema, EXECUTOR_PROTOCOL_VERSION, type ExecutionDocument, ExecutionDocumentSchema, type ExecutionLaw, ExecutionLawSchema, type ExecutionResources, ExecutionResourcesSchema, type ExecutorProtocolVersion, Hex64, NonEmptyString, OPERATION_PROFILE, ORDINARY_AUTHORITY_PROFILE, type OperationBefore, OperationBeforeSchema, type OperationCleanup, OperationCleanupSchema, type OperationCost, OperationCostSchema, type OperationEvidence, OperationEvidenceSchema, type OperationExecution, OperationExecutionSchema, type OperationRequest, OperationRequestSchema, type OperationStatus, OperationStatusSchema, type OrdinaryAuthority, OrdinaryAuthoritySchema, Orn, PRICE_PROFILE_REFERENCE, PROFILES, PROVIDER_PROTOCOL_VERSION, type ProfileEntry, type ProviderProtocolVersion, RESOURCE_DESCRIPTOR_KIND, RESOURCE_DESCRIPTOR_PROFILE, REVOCATIONS_PROFILE, type Readback, ReadbackSchema, Reference, type ResourceDescriptor, ResourceDescriptorSchema, type RevocationPointer, RevocationPointerSchema, RevocationSchema, type RevocationSnapshot, SCOPE_REFERENCE, SIGNED_LAW_DOMAIN, SIGNED_LAW_PROFILE, SafeInt, type SignedBootstrapIntent, SignedBootstrapIntentSchema, type SignedLawBundle, SignedLawBundleSchema, UtcSecond, closed };
|
|
719
|
+
export { ADOPTION_FACT_PROFILE, type Accepted, AcceptedSchema, type AdoptionFact, AdoptionFactSchema, BOOTSTRAP_PROFILE, type BootstrapAction, BootstrapActionSchema, type BootstrapIntent, BootstrapIntentSchema, DISPATCH_CONSUME_PROFILE, DISPATCH_MAX_SKEW_SECONDS, type DispatchConsumeRequest, DispatchConsumeRequestSchema, type DispatchLease, DispatchLeaseSchema, type DispatchRefusal, type DispatchRefusalCode, DispatchRefusalCodeSchema, DispatchRefusalSchema, EVENT_LINE_PREFIX, EVENT_PROFILE, EXECUTOR_PROTOCOL_VERSION, type Event, EventSchema, type EventStreamSeal, EventStreamSealSchema, type ExecutionDocument, ExecutionDocumentSchema, type ExecutionLaw, ExecutionLawSchema, type ExecutionResources, ExecutionResourcesSchema, type ExecutorProtocolVersion, Hex64, LIFECYCLE_KINDS, NonEmptyString, OPERATION_PROFILE, ORDINARY_AUTHORITY_PROFILE, type OperationBefore, OperationBeforeSchema, type OperationCleanup, OperationCleanupSchema, type OperationCost, OperationCostSchema, type OperationEvidence, OperationEvidenceSchema, type OperationExecution, OperationExecutionSchema, type OperationRequest, OperationRequestSchema, type OperationStatus, OperationStatusSchema, type OrdinaryAuthority, OrdinaryAuthoritySchema, Orn, PRICE_PROFILE_REFERENCE, PROFILES, PROVIDER_PROTOCOL_VERSION, type ProfileEntry, type ProviderProtocolVersion, RESOURCE_DESCRIPTOR_KIND, RESOURCE_DESCRIPTOR_PROFILE, REVOCATIONS_PROFILE, type Readback, ReadbackSchema, Reference, type ResourceDescriptor, ResourceDescriptorSchema, type RevocationPointer, RevocationPointerSchema, RevocationSchema, type RevocationSnapshot, SCOPE_REFERENCE, SIGNED_LAW_DOMAIN, SIGNED_LAW_PROFILE, SafeInt, type SignedBootstrapIntent, SignedBootstrapIntentSchema, type SignedLawBundle, SignedLawBundleSchema, UtcSecond, closed };
|
|
672
720
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/primitives.ts","../src/kernel/dispatch-consume.v1.ts","../src/run/operation.v1.ts","../src/infra/signed-law.v1.ts","../src/infra/resource-descriptor.v1.ts","../src/infra/adoption-fact.v1.ts","../src/registry/revocations.v1.ts","../src/kernel/bootstrap.v1.ts","../src/kernel/ordinary-authority.v1.ts","../src/run/contract-versions.ts","../src/index.ts"],"mappings":";;;cAOa,SAAU,UAAU,aAAW,YAAc,MAAI,QAAQ;;cAIzD,mCAAK;;cAGL,uCAAS;cAIT,4CAAc;cAEd,qCAAO;;;;;;cAOP,iCAAG;;cAGH,WAAS;;;;;;;KAQV;WACD;WACA,QAAQ,SAAS,eAAe;;;WAGhC;;;;WAIA;;;;cCnBE;;cAGA;cAEP,+DAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwB1B,qCAAqC;KAEtC,yBAAyB,cAAc;cAE7C,sDAAwB;;;;;;;;;;;;;;;;;;;;;;;;cAqBjB,4BAA4B;KAC7B,gBAAgB,cAAc;cAEpC,4DAA8B,oCAAA,2DAAA,wDAAA,0DAAA,iDAAA,2DAAA,+EAAA;cASvB,kCAAkC;KAEnC,sBAAsB,cAAc;cAE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;;cAGA;cAIP,2DAA6B;;;;;;;;;;;;;;;;;;;;;;cAsBtB,iCAAiC;KAElC,qBAAqB,cAAc;;;cCjClC;cAEP,qDAAuB;;;;;;;;;;;;;;;;;;cAqBhB,2BAA2B;KAC5B,eAAe,cAAc;;;cC9B5B;cAOP,mDAAqB;;;;;;;;;;;;;;;;;;;;;;;;cAmDd,yBAAyB;KAC1B,qBAAqB,cAAc;cAEzC,0DAA4B;;;;;cAQrB,gCAAgC;KAEjC,oBAAoB,cAAc;;;cClEjC;cAEP,wDAA0B,oCAAA,kEAAA,+DAAA,+DAAA;cAMnB,8BAA8B;KAC/B,kBAAkB,cAAc;cAEtC,wDAA0B;;;;;;;;;;;;;;;;;;;;;;;;cA2BnB,8BAA8B;KAC/B,kBAAkB,cAAc;cAEtC,8DAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;cAIzB,oCAAoC;KAErC,wBAAwB,cAAc;;;cC/CrC;cAKP,0DAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwBrB,gCAAgC;KAEjC,oBAAoB,cAAc;;;cCtCjC;KACD,iCAAiC;cAEhC;KACD,iCAAiC;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/primitives.ts","../src/kernel/dispatch-consume.v1.ts","../src/run/operation.v1.ts","../src/infra/signed-law.v1.ts","../src/infra/resource-descriptor.v1.ts","../src/infra/adoption-fact.v1.ts","../src/registry/revocations.v1.ts","../src/kernel/bootstrap.v1.ts","../src/kernel/ordinary-authority.v1.ts","../src/run/contract-versions.ts","../src/run/event.v1.ts","../src/index.ts"],"mappings":";;;cAOa,SAAU,UAAU,aAAW,YAAc,MAAI,QAAQ;;cAIzD,mCAAK;;cAGL,uCAAS;cAIT,4CAAc;cAEd,qCAAO;;;;;;cAOP,iCAAG;;cAGH,WAAS;;;;;;;KAQV;WACD;WACA,QAAQ,SAAS,eAAe;;;WAGhC;;;;WAIA;;;;cCnBE;;cAGA;cAEP,+DAAiC;;;;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{
|
|
|
625
625
|
const EXECUTOR_PROTOCOL_VERSION = "dsg.run.executor/1";
|
|
626
626
|
const PROVIDER_PROTOCOL_VERSION = "dsg.run.provider/1";
|
|
627
627
|
//#endregion
|
|
628
|
+
//#region src/run/event.v1.ts
|
|
629
|
+
const EVENT_PROFILE = "dsg.run.event/1";
|
|
630
|
+
/** The wire prefix that lets a collector pick these lines out of ordinary
|
|
631
|
+
* job logs. One space, then the JSON object, then a newline. */
|
|
632
|
+
const EVENT_LINE_PREFIX = "DSGEV ";
|
|
633
|
+
/** The lifecycle spine every catalog carries without declaring it: the
|
|
634
|
+
* kinds the console draws for any workload, whatever it models. A
|
|
635
|
+
* workload emitting only started and finished is fully described. */
|
|
636
|
+
const LIFECYCLE_KINDS = [
|
|
637
|
+
"started",
|
|
638
|
+
"phase.entered",
|
|
639
|
+
"phase.exited",
|
|
640
|
+
"progress",
|
|
641
|
+
"checkpoint",
|
|
642
|
+
"artifact",
|
|
643
|
+
"warning",
|
|
644
|
+
"failure",
|
|
645
|
+
"finished"
|
|
646
|
+
];
|
|
647
|
+
const EventSchema = closed({
|
|
648
|
+
profile: Type.Literal(EVENT_PROFILE),
|
|
649
|
+
/** The operation this event belongs to; injected into the job's
|
|
650
|
+
* environment by the plane, never chosen by the workload. */
|
|
651
|
+
operation: NonEmptyString,
|
|
652
|
+
/** Monotonic within one operation, from 1. Ordering lives here. */
|
|
653
|
+
sequence: Type.Integer({
|
|
654
|
+
minimum: 1,
|
|
655
|
+
maximum: Number.MAX_SAFE_INTEGER
|
|
656
|
+
}),
|
|
657
|
+
at: UtcSecond,
|
|
658
|
+
/** A lifecycle kind or one the pinned catalog declares. */
|
|
659
|
+
kind: NonEmptyString,
|
|
660
|
+
/** Digest of the catalog the payload validates against. */
|
|
661
|
+
catalogSha256: Hex64,
|
|
662
|
+
/** Validated against the catalog by digest, not by this schema: a
|
|
663
|
+
* modeler's vocabulary is theirs, and the plane refuses a payload the
|
|
664
|
+
* catalog does not admit. Artifacts are references, never contents. */
|
|
665
|
+
payload: Type.Record(Type.String(), Type.Unknown())
|
|
666
|
+
});
|
|
667
|
+
const EventStreamSealSchema = closed({
|
|
668
|
+
profile: Type.Literal(EVENT_PROFILE),
|
|
669
|
+
operation: NonEmptyString,
|
|
670
|
+
catalogSha256: Hex64,
|
|
671
|
+
/** sha256 over the newline-joined canonical event lines, in sequence. */
|
|
672
|
+
streamSha256: Hex64,
|
|
673
|
+
eventCount: SafeInt,
|
|
674
|
+
/** Sequence numbers missing from an otherwise ordered stream. */
|
|
675
|
+
gaps: Type.Array(Type.Integer({
|
|
676
|
+
minimum: 1,
|
|
677
|
+
maximum: Number.MAX_SAFE_INTEGER
|
|
678
|
+
})),
|
|
679
|
+
truncatedAtSequence: Type.Union([Type.Integer({ minimum: 1 }), Type.Null()])
|
|
680
|
+
});
|
|
681
|
+
const eventV1 = {
|
|
682
|
+
literal: EVENT_PROFILE,
|
|
683
|
+
rootShape: "event",
|
|
684
|
+
shapes: {
|
|
685
|
+
event: EventSchema,
|
|
686
|
+
streamSeal: EventStreamSealSchema
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
//#endregion
|
|
628
690
|
//#region src/index.ts
|
|
629
691
|
/** Every profile this version of the package defines, keyed by literal.
|
|
630
692
|
* Profile modules are added here as they are extracted; the rules test
|
|
@@ -633,6 +695,7 @@ const PROVIDER_PROTOCOL_VERSION = "dsg.run.provider/1";
|
|
|
633
695
|
const PROFILES = {
|
|
634
696
|
[dispatchConsumeV1.literal]: dispatchConsumeV1,
|
|
635
697
|
[operationV1.literal]: operationV1,
|
|
698
|
+
[eventV1.literal]: eventV1,
|
|
636
699
|
[signedLawV1.literal]: signedLawV1,
|
|
637
700
|
[resourceDescriptorV1.literal]: resourceDescriptorV1,
|
|
638
701
|
[adoptionFactV1.literal]: adoptionFactV1,
|
|
@@ -641,6 +704,6 @@ const PROFILES = {
|
|
|
641
704
|
[ordinaryAuthorityV1.literal]: ordinaryAuthorityV1
|
|
642
705
|
};
|
|
643
706
|
//#endregion
|
|
644
|
-
export { ADOPTION_FACT_PROFILE, AcceptedSchema, AdoptionFactSchema, BOOTSTRAP_PROFILE, BootstrapActionSchema, BootstrapIntentSchema, DISPATCH_CONSUME_PROFILE, DISPATCH_MAX_SKEW_SECONDS, DispatchConsumeRequestSchema, DispatchLeaseSchema, DispatchRefusalCodeSchema, DispatchRefusalSchema, EXECUTOR_PROTOCOL_VERSION, ExecutionDocumentSchema, ExecutionLawSchema, ExecutionResourcesSchema, Hex64, NonEmptyString, OPERATION_PROFILE, ORDINARY_AUTHORITY_PROFILE, OperationBeforeSchema, OperationCleanupSchema, OperationCostSchema, OperationEvidenceSchema, OperationExecutionSchema, OperationRequestSchema, OperationStatusSchema, OrdinaryAuthoritySchema, Orn, PRICE_PROFILE_REFERENCE, PROFILES, PROVIDER_PROTOCOL_VERSION, RESOURCE_DESCRIPTOR_KIND, RESOURCE_DESCRIPTOR_PROFILE, REVOCATIONS_PROFILE, ReadbackSchema, Reference, ResourceDescriptorSchema, RevocationPointerSchema, RevocationSchema, SCOPE_REFERENCE, SIGNED_LAW_DOMAIN, SIGNED_LAW_PROFILE, SafeInt, SignedBootstrapIntentSchema, SignedLawBundleSchema, UtcSecond, closed };
|
|
707
|
+
export { ADOPTION_FACT_PROFILE, AcceptedSchema, AdoptionFactSchema, BOOTSTRAP_PROFILE, BootstrapActionSchema, BootstrapIntentSchema, DISPATCH_CONSUME_PROFILE, DISPATCH_MAX_SKEW_SECONDS, DispatchConsumeRequestSchema, DispatchLeaseSchema, DispatchRefusalCodeSchema, DispatchRefusalSchema, EVENT_LINE_PREFIX, EVENT_PROFILE, EXECUTOR_PROTOCOL_VERSION, EventSchema, EventStreamSealSchema, ExecutionDocumentSchema, ExecutionLawSchema, ExecutionResourcesSchema, Hex64, LIFECYCLE_KINDS, NonEmptyString, OPERATION_PROFILE, ORDINARY_AUTHORITY_PROFILE, OperationBeforeSchema, OperationCleanupSchema, OperationCostSchema, OperationEvidenceSchema, OperationExecutionSchema, OperationRequestSchema, OperationStatusSchema, OrdinaryAuthoritySchema, Orn, PRICE_PROFILE_REFERENCE, PROFILES, PROVIDER_PROTOCOL_VERSION, RESOURCE_DESCRIPTOR_KIND, RESOURCE_DESCRIPTOR_PROFILE, REVOCATIONS_PROFILE, ReadbackSchema, Reference, ResourceDescriptorSchema, RevocationPointerSchema, RevocationSchema, SCOPE_REFERENCE, SIGNED_LAW_DOMAIN, SIGNED_LAW_PROFILE, SafeInt, SignedBootstrapIntentSchema, SignedLawBundleSchema, UtcSecond, closed };
|
|
645
708
|
|
|
646
709
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["digest","closed"],"sources":["../src/primitives.ts","../src/kernel/dispatch-consume.v1.ts","../src/run/operation.v1.ts","../src/infra/resource-descriptor.v1.ts","../src/infra/signed-law.v1.ts","../src/infra/adoption-fact.v1.ts","../src/registry/revocations.v1.ts","../src/kernel/bootstrap.v1.ts","../src/kernel/ordinary-authority.v1.ts","../src/run/contract-versions.ts","../src/index.ts"],"sourcesContent":["// The shared primitives every profile builds from. No profile defines its\n// own: a digest is Hex64 everywhere, a timestamp is UtcSecond everywhere,\n// an open object exists nowhere.\nimport { type TObject, type TProperties, type TSchema, Type } from \"@sinclair/typebox\";\nimport { ORN_PATTERN, SHA256_PATTERN } from \"@dynamicalsystems/orn-schemas\";\n\n/** Closed object: an extra field is a different protocol. */\nexport const closed = <T extends TProperties>(properties: T): TObject<T> =>\n Type.Object(properties, { additionalProperties: false });\n\n/** Lowercase sha256 hex. Every digest on the wire. */\nexport const Hex64 = Type.String({ pattern: \"^[0-9a-f]{64}$\" });\n\n/** Exact UTC second, Z suffix, no fractional part. */\nexport const UtcSecond = Type.String({\n pattern: \"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$\",\n});\n\nexport const NonEmptyString = Type.String({ minLength: 1 });\n\nexport const SafeInt = Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER });\n\n/** An ORN, validated by the grammar dsg-orn owns. Built from the exported\n * pattern, not the exported schema object: the upstream schemas carry\n * JSON Schema $id metadata, and embedding the same $id in several route\n * schemas makes validators refuse the duplicate. The pattern is the wire\n * truth; the metadata is not. */\nexport const Orn = Type.String({ pattern: ORN_PATTERN });\n\n/** The pair of an ORN and the sha256 pinning a version (dsg-orn Reference). */\nexport const Reference = closed({\n orn: Orn,\n sha256: Type.String({ pattern: SHA256_PATTERN }),\n});\n\n/** One wire profile: the literal, and every top-level shape that crosses\n * the seam it names. Shape names are stable identifiers (\"request\",\n * \"lease\", \"refusal\"); vectors address a shape as \"<literal>#<shape>\". */\nexport type ProfileEntry = {\n readonly literal: `dsg.${string}.${string}/${number}`;\n readonly shapes: Readonly<Record<string, TSchema>>;\n /** Set ONLY when the wire cannot carry the literal as a field of any\n * shape (a frozen /1); names exactly where the literal lives instead. */\n readonly literalNote?: string;\n /** Names the shape non-TS consumers validate a whole document against;\n * the emitted JSON Schema gains a root $ref to it. Only meaningful for\n * profiles with a single document root. */\n readonly rootShape?: string;\n};\n","// dsg.kernel.dispatch-consume/1\n// Owner: dsg-kernel (the consume route produces the lease and the refusal;\n// the plane produces the request).\n//\n// K05/I3: the dispatch-authorization consume contract between the kernel\n// and the plane. Immediately before its first non-cleanup cloud mutation -\n// identity, bucket and IAM preparation included, not only job submission -\n// the plane consumes a short-lived, single-operation dispatch authorization\n// bound to operation, generation, envelope digest, law digest and\n// reservation. The committed consume event is the authorization ordering\n// point; it is not atomic with any provider API. A replay returns the\n// original lease and never renews it; a renewal is a new recorded\n// authorization decision for the same operation and reservation.\n//\n// Lifted verbatim from dsg-kernel packages/core/src/dispatch.ts at commit\n// c2d39d95 (wire shapes only; the record-held event payloads stay in the\n// kernel). This file is frozen: changes ship as dispatch-consume.v2.ts.\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport {\n closed,\n Hex64,\n NonEmptyString,\n Orn,\n Reference,\n UtcSecond,\n type ProfileEntry,\n} from \"../primitives.js\";\n\nexport const DISPATCH_CONSUME_PROFILE = \"dsg.kernel.dispatch-consume/1\" as const;\n\n/** The bounded clock skew a lease check must tolerate, in seconds. */\nexport const DISPATCH_MAX_SKEW_SECONDS = 300;\n\nconst DispatchConsumeRequestSchemaValue = closed({\n profile: Type.Literal(DISPATCH_CONSUME_PROFILE),\n /** The kernel operation identity from the accepted OperationRequest. */\n operationId: NonEmptyString,\n /** The workspace generation the plane admitted the operation at. */\n generation: Type.Integer({ minimum: 0 }),\n /** The Case the operation belongs to - the stream the consume event\n * lands on and the stream the reservation was recorded on. */\n caseOrn: Orn,\n /** SHA256(JCS(complete OperationRequest)) - the M010 envelope digest. */\n envelopeSha256: Hex64,\n /** The exact retained signed-law bytes the Case pins. */\n lawSha256: Hex64,\n /** The K04 reservation the authorization is bound to: sha256 is the\n * reservation event's record id. */\n reservation: Reference,\n requestedAt: UtcSecond,\n /** False: first consumption or idempotent replay of it. True: an explicit\n * renewal - a new recorded authorization decision for the same operation\n * and reservation after lease expiry with the work known unsubmitted. A\n * replay never renews; only this flag does, and it re-runs every\n * revocation check at the current record state. */\n renewal: Type.Boolean(),\n});\nexport const DispatchConsumeRequestSchema: typeof DispatchConsumeRequestSchemaValue =\n DispatchConsumeRequestSchemaValue;\nexport type DispatchConsumeRequest = Static<typeof DispatchConsumeRequestSchema>;\n\nconst DispatchLeaseSchemaValue = closed({\n profile: Type.Literal(DISPATCH_CONSUME_PROFILE),\n /** The consume event's record id: the committed ordering point. */\n leaseId: Hex64,\n operationId: NonEmptyString,\n generation: Type.Integer({ minimum: 0 }),\n caseOrn: Orn,\n envelopeSha256: Hex64,\n lawSha256: Hex64,\n reservation: Reference,\n consumedAt: UtcSecond,\n /** Fixed maximum duration from consumedAt; the plane checks validity\n * before each new non-cleanup call, Batch submission included. */\n expiresAt: UtcSecond,\n /** The bounded clock skew a lease check must tolerate, in seconds. */\n maxSkewSeconds: Type.Integer({ minimum: 0, maximum: DISPATCH_MAX_SKEW_SECONDS }),\n renewal: Type.Literal(\"new-authorization-required\"),\n /** False when this response replays an earlier committed consumption:\n * the lease bytes, expiry included, are the original's. */\n fresh: Type.Boolean(),\n});\nexport const DispatchLeaseSchema: typeof DispatchLeaseSchemaValue = DispatchLeaseSchemaValue;\nexport type DispatchLease = Static<typeof DispatchLeaseSchema>;\n\nconst DispatchRefusalCodeSchemaValue = Type.Union([\n Type.Literal(\"unknown_operation\"),\n Type.Literal(\"no_reservation\"),\n Type.Literal(\"binding_mismatch\"),\n Type.Literal(\"revoked\"),\n Type.Literal(\"authority_refused\"),\n Type.Literal(\"renewal_requires_existing_consumption\"),\n Type.Literal(\"unavailable\"),\n]);\nexport const DispatchRefusalCodeSchema: typeof DispatchRefusalCodeSchemaValue =\n DispatchRefusalCodeSchemaValue;\nexport type DispatchRefusalCode = Static<typeof DispatchRefusalCodeSchema>;\n\nconst DispatchRefusalSchemaValue = closed({\n profile: Type.Literal(DISPATCH_CONSUME_PROFILE),\n code: DispatchRefusalCodeSchema,\n issues: Type.Array(NonEmptyString, { minItems: 1 }),\n});\nexport const DispatchRefusalSchema: typeof DispatchRefusalSchemaValue = DispatchRefusalSchemaValue;\nexport type DispatchRefusal = Static<typeof DispatchRefusalSchema>;\n\nexport const dispatchConsumeV1: ProfileEntry = {\n literal: DISPATCH_CONSUME_PROFILE,\n shapes: {\n request: DispatchConsumeRequestSchema,\n lease: DispatchLeaseSchema,\n refusal: DispatchRefusalSchema,\n },\n};\n","// dsg.run.operation/1\n// Owner: dsg-run (the protocol listener accepts the request and answers\n// the receipt; the kernel validates, records and reads back).\n//\n// Closed, versioned compute-operation vocabulary shared by the kernel and\n// the dsg.run plane. The document is deliberately references-only: payload\n// bytes remain retained artifacts, while this request carries the immutable\n// identity, generation fence, law, reservation and plan digest.\n//\n// The envelope digest bound at dispatch (M010) is sha256 over the RFC 8785\n// canonical form of the complete OperationRequest; the digest vectors in\n// the conformance package pin that meaning.\n//\n// Lifted verbatim from dsg-kernel packages/core/src/operation.ts at commit\n// 0f8d64d7 (equal, field for field, to dsg-run service/src/protocol/\n// schemas.ts 134-246 - the R01 cross-validation held). Known /2 candidate,\n// kept loose here because a released /1 is frozen: acceptedAt is\n// minLength 1, not an exact UTC second, and the plane emits fractional\n// seconds today.\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport {\n closed,\n Hex64,\n NonEmptyString,\n Reference,\n SafeInt,\n type ProfileEntry,\n} from \"../primitives.js\";\n\nexport const OPERATION_PROFILE = \"dsg.run.operation/1\" as const;\n\nconst ExecutionResourcesSchemaValue = closed({\n maxGpuSeconds: SafeInt,\n maxRunSeconds: SafeInt,\n maxParallelism: SafeInt,\n});\nexport const ExecutionResourcesSchema: typeof ExecutionResourcesSchemaValue =\n ExecutionResourcesSchemaValue;\nexport type ExecutionResources = Static<typeof ExecutionResourcesSchema>;\n\nconst ExecutionLawSchemaValue = closed({\n bundle: Reference,\n registryRelease: Reference,\n});\nexport const ExecutionLawSchema: typeof ExecutionLawSchemaValue = ExecutionLawSchemaValue;\nexport type ExecutionLaw = Static<typeof ExecutionLawSchema>;\n\nconst ExecutionDocumentSchemaValue = closed({\n schemaVersion: Type.Literal(1),\n classContract: Reference,\n law: ExecutionLawSchema,\n workload: Reference,\n inputs: Type.Array(Reference),\n resources: ExecutionResourcesSchema,\n costBound: Reference,\n placement: Reference,\n results: Reference,\n secrets: Type.Array(Reference),\n});\nexport const ExecutionDocumentSchema: typeof ExecutionDocumentSchemaValue =\n ExecutionDocumentSchemaValue;\nexport type ExecutionDocument = Static<typeof ExecutionDocumentSchema>;\n\nconst OperationBeforeSchemaValue = closed({\n operationId: Type.Union([NonEmptyString, Type.Null()]),\n planDigest: Type.Union([Hex64, Type.Null()]),\n});\nexport const OperationBeforeSchema: typeof OperationBeforeSchemaValue = OperationBeforeSchemaValue;\nexport type OperationBefore = Static<typeof OperationBeforeSchema>;\n\nconst OperationRequestSchemaValue = closed({\n profile: Type.Literal(OPERATION_PROFILE),\n operationId: NonEmptyString,\n case: Reference,\n workspace: NonEmptyString,\n expectedGeneration: SafeInt,\n before: OperationBeforeSchema,\n planDigest: Hex64,\n document: ExecutionDocumentSchema,\n authority: Reference,\n reservation: Reference,\n});\nexport const OperationRequestSchema: typeof OperationRequestSchemaValue =\n OperationRequestSchemaValue;\nexport type OperationRequest = Static<typeof OperationRequestSchema>;\n\nconst AcceptedSchemaValue = closed({\n profile: Type.Literal(OPERATION_PROFILE),\n operationId: NonEmptyString,\n actionId: NonEmptyString,\n generation: SafeInt,\n planDigest: Hex64,\n acceptedAt: NonEmptyString,\n});\nexport const AcceptedSchema: typeof AcceptedSchemaValue = AcceptedSchemaValue;\nexport type Accepted = Static<typeof AcceptedSchema>;\n\nconst OperationExecutionSchemaValue = Type.Union([\n Type.Literal(\"queued\"),\n Type.Literal(\"running\"),\n Type.Literal(\"succeeded\"),\n Type.Literal(\"failed\"),\n Type.Literal(\"canceled\"),\n Type.Literal(\"unknown\"),\n]);\nexport const OperationExecutionSchema: typeof OperationExecutionSchemaValue =\n OperationExecutionSchemaValue;\nexport type OperationExecution = Static<typeof OperationExecutionSchema>;\n\nconst OperationCleanupSchemaValue = Type.Union([\n Type.Literal(\"pending\"),\n Type.Literal(\"present\"),\n Type.Literal(\"absent\"),\n Type.Literal(\"unknown\"),\n]);\nexport const OperationCleanupSchema: typeof OperationCleanupSchemaValue =\n OperationCleanupSchemaValue;\nexport type OperationCleanup = Static<typeof OperationCleanupSchema>;\n\nconst OperationEvidenceSchemaValue = Type.Union([Type.Literal(\"pending\"), Type.Literal(\"ready\")]);\nexport const OperationEvidenceSchema: typeof OperationEvidenceSchemaValue =\n OperationEvidenceSchemaValue;\nexport type OperationEvidence = Static<typeof OperationEvidenceSchema>;\n\nconst OperationCostSchemaValue = Type.Union([\n Type.Literal(\"reserved\"),\n Type.Literal(\"provisional\"),\n Type.Literal(\"reconciled\"),\n]);\nexport const OperationCostSchema: typeof OperationCostSchemaValue = OperationCostSchemaValue;\nexport type OperationCost = Static<typeof OperationCostSchema>;\n\nconst ReadbackSchemaValue = closed({\n operationId: NonEmptyString,\n generation: SafeInt,\n planDigest: Hex64,\n execution: OperationExecutionSchema,\n cleanup: OperationCleanupSchema,\n evidence: OperationEvidenceSchema,\n evidenceRef: Type.Union([Reference, Type.Null()]),\n cost: OperationCostSchema,\n});\nexport const ReadbackSchema: typeof ReadbackSchemaValue = ReadbackSchemaValue;\nexport type Readback = Static<typeof ReadbackSchema>;\n\n// I-001 names the status as the same closed readback shape. Keeping this\n// alias prevents callers from inventing a second status wire contract.\nexport const OperationStatusSchema = ReadbackSchema;\nexport type OperationStatus = Readback;\n\nexport const operationV1: ProfileEntry = {\n literal: OPERATION_PROFILE,\n shapes: {\n request: OperationRequestSchema,\n accepted: AcceptedSchema,\n readback: ReadbackSchema,\n },\n};\n","// dsg.infra.resource-descriptor/1\n// Owner: dsg-infra (policy/resource-descriptor.schema.json is the source;\n// law_contract.py validates this exact shape and evaluate_descriptor\n// returns its canonical digest). A concrete provider-neutral resource: the\n// thing rendered from a workload and gated against the signed law's\n// capability limits before any provider API sees it. Distinct from\n// signed-law's capabilityProfile, which states allowed LIMITS; this\n// document states one concrete resource checked against them.\n//\n// The wire carries kind \"dsg.infra.resource-descriptor\" plus\n// schemaVersion 1; the /1 literal itself is the version marker signed-law\n// fields pin (scope.resourceDescriptorVersion, capabilities\n// .descriptorVersion), so the constant lives here and signed-law imports\n// it. Lifted verbatim from dsg-infra policy/resource-descriptor.schema.json\n// at fccf709.\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { closed, NonEmptyString, type ProfileEntry } from \"../primitives.js\";\n\nexport const RESOURCE_DESCRIPTOR_PROFILE = \"dsg.infra.resource-descriptor/1\" as const;\n/** The document kind: the profile literal without its version suffix; the\n * version rides in schemaVersion. Frozen /1 wire choice. */\nexport const RESOURCE_DESCRIPTOR_KIND = \"dsg.infra.resource-descriptor\" as const;\n\nconst prefixedDigest = Type.String({ pattern: \"^sha256:[0-9a-f]{64}$\" });\n\nconst ResourceDescriptorSchemaValue = closed({\n schemaVersion: Type.Literal(1),\n kind: Type.Literal(RESOURCE_DESCRIPTOR_KIND),\n workloadClass: NonEmptyString,\n lifecycle: Type.Union([Type.Literal(\"ephemeral\"), Type.Literal(\"durable\")]),\n machineType: Type.String({ pattern: \"^[a-z][a-z0-9]*-[a-z0-9]+-[0-9]+$\" }),\n accelerator: Type.Union([Type.String({ minLength: 1 }), Type.Null()]),\n acceleratorCount: Type.Integer({ minimum: 0 }),\n vcpuCount: Type.Integer({ minimum: 1 }),\n memoryGiB: Type.Integer({ minimum: 1 }),\n maxRunSeconds: Type.Integer({ minimum: 1 }),\n maxParallelism: Type.Integer({ minimum: 1 }),\n region: NonEmptyString,\n imageDigest: prefixedDigest,\n moduleDigest: prefixedDigest,\n externalIp: Type.Literal(false),\n network: Type.Literal(\"private\"),\n reservation: closed({\n gpuSeconds: Type.Integer({ minimum: 0 }),\n usdMicroUnits: Type.Integer({ minimum: 0 }),\n }),\n});\nexport const ResourceDescriptorSchema: typeof ResourceDescriptorSchemaValue =\n ResourceDescriptorSchemaValue;\nexport type ResourceDescriptor = Static<typeof ResourceDescriptorSchema>;\n\nexport const resourceDescriptorV1: ProfileEntry = {\n literal: RESOURCE_DESCRIPTOR_PROFILE,\n literalNote:\n \"carried as kind (unversioned) plus schemaVersion on the document; the /1 literal is the version marker signed-law pins\",\n rootShape: \"descriptor\",\n shapes: { descriptor: ResourceDescriptorSchema },\n};\n","// dsg.infra.signed-law/1\n// Owner: dsg-infra (the S02 law producer; both prior copies were generated\n// from dsg-infra policy/law-bundle.schema.json, source SHA-256\n// bc3692395cf994567115c76d8fce66a7e9ebe7b2c50c70e1c83b8b10693a838c).\n//\n// The literal is the signing DOMAIN: it appears as the `domain` member of\n// the canonical signature input (JCS of {domain, payload, payloadSha256,\n// testOnly}), not as a field of the bundle itself; the bundle carries\n// `kind` plus `schemaVersion` instead. Lifted verbatim from dsg-kernel\n// packages/signing/src/law-schema.ts at ffafe305, byte-identical to the\n// module registry copy at 1f8c994.\nimport { Type, type Static } from \"@sinclair/typebox\";\nimport type { ProfileEntry } from \"../primitives.js\";\nimport { RESOURCE_DESCRIPTOR_PROFILE } from \"./resource-descriptor.v1.js\";\n\nexport const SIGNED_LAW_PROFILE = \"dsg.infra.signed-law/1\" as const;\n/** The signature-input domain member is exactly the profile literal. */\nexport const SIGNED_LAW_DOMAIN = SIGNED_LAW_PROFILE;\n\n/** The scope vocabulary version today's laws cite in\n * standingOrder.scopeReference. The FIELD stays an open nonempty string on\n * purpose (a law may cite a future scope); this constant is the value in\n * force, exported so no consumer hand-types it. */\nexport const SCOPE_REFERENCE = \"dsg.infra.scope/1\" as const;\n\n/** The price-profile version today's laws cite in priceProfile.reference.\n * Same rule: the field stays open; this is the value in force. */\nexport const PRICE_PROFILE_REFERENCE = \"dsg.infra.price-profile/1\" as const;\n\nconst nullableString = Type.Union([Type.String({ minLength: 1 }), Type.Null()]);\nconst authority = Type.Object(\n {\n issuerType: Type.Literal(\"human\"),\n issuerReference: nullableString,\n designationReference: nullableString,\n signatureReference: nullableString,\n humanSignatureRequired: Type.Literal(true),\n releaseAutomationMayIssue: Type.Literal(false),\n },\n { additionalProperties: false },\n);\nconst utcSecond = Type.String({\n pattern: \"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$\",\n});\nconst standingOrder = Type.Object(\n {\n reference: nullableString,\n designationReference: nullableString,\n scopeReference: Type.String({ minLength: 1 }),\n issuedAt: Type.Union([utcSecond, Type.Null()]),\n expiresAt: Type.Union([utcSecond, Type.Null()]),\n },\n { additionalProperties: false },\n);\nconst scope = Type.Object(\n {\n actions: Type.Array(Type.String({ minLength: 1 }), { minItems: 1, uniqueItems: true }),\n workloadClasses: Type.Array(Type.String({ minLength: 1 }), { minItems: 1, uniqueItems: true }),\n providers: Type.Array(Type.Literal(\"provider-neutral\"), { minItems: 1, uniqueItems: true }),\n regions: Type.Array(Type.String({ minLength: 1 }), { uniqueItems: true }),\n resourceDescriptorVersion: Type.Literal(RESOURCE_DESCRIPTOR_PROFILE),\n },\n { additionalProperties: false },\n);\nconst validity = Type.Object(\n {\n clock: Type.Literal(\"UTC\"),\n notBefore: Type.Union([utcSecond, Type.Null()]),\n notAfter: Type.Union([utcSecond, Type.Null()]),\n },\n { additionalProperties: false },\n);\nconst revocation = Type.Object(\n {\n snapshotReference: nullableString,\n failClosed: Type.Literal(true),\n checks: Type.Array(Type.String({ minLength: 1 }), { minItems: 1, uniqueItems: true }),\n },\n { additionalProperties: false },\n);\nconst ceiling = Type.Object(\n {\n unit: Type.String({ minLength: 1 }),\n period: Type.String({ minLength: 1 }),\n scope: Type.Union([Type.Literal(\"person\"), Type.Literal(\"organization\")]),\n value: Type.Union([Type.Integer({ minimum: 0 }), Type.Null()]),\n },\n { additionalProperties: false },\n);\nconst capabilityProfile = Type.Object(\n {\n lifecycle: Type.Union([Type.Literal(\"ephemeral\"), Type.Literal(\"durable\")]),\n machinePrefixes: Type.Array(Type.String({ minLength: 1 }), { minItems: 1, uniqueItems: true }),\n accelerators: Type.Array(Type.String({ minLength: 1 }), { uniqueItems: true }),\n maxRunSeconds: Type.Union([Type.Integer({ minimum: 0 }), Type.Null()]),\n maxParallelism: Type.Union([Type.Integer({ minimum: 1 }), Type.Null()]),\n maxGpuInstances: Type.Union([Type.Integer({ minimum: 0 }), Type.Null()]),\n maxVcpus: Type.Union([Type.Integer({ minimum: 1 }), Type.Null()]),\n network: Type.Literal(\"private\"),\n externalIpAllowed: Type.Literal(false),\n },\n { additionalProperties: false },\n);\nconst capabilities = Type.Object(\n {\n providerNeutral: Type.Literal(true),\n descriptorVersion: Type.Literal(RESOURCE_DESCRIPTOR_PROFILE),\n profiles: Type.Record(Type.String(), capabilityProfile, { minProperties: 1 }),\n },\n { additionalProperties: false },\n);\nconst priceProfile = Type.Object(\n {\n reference: Type.String({ minLength: 1 }),\n status: Type.Union([Type.Literal(\"unassigned\"), Type.Literal(\"retained\")]),\n currency: Type.Literal(\"USD\"),\n unit: Type.Literal(\"micro_usd\"),\n basis: Type.Literal(\"retained-conservative-on-demand\"),\n rates: Type.Object(\n {\n vcpuSecond: Type.Optional(Type.Integer({ minimum: 0 })),\n memoryGiBSecond: Type.Optional(Type.Integer({ minimum: 0 })),\n gpuSecond: Type.Optional(Type.Integer({ minimum: 0 })),\n startup: Type.Optional(Type.Integer({ minimum: 0 })),\n },\n { additionalProperties: false },\n ),\n safetyFactorBps: Type.Union([Type.Integer({ minimum: 10000 }), Type.Null()]),\n validFrom: Type.Union([utcSecond, Type.Null()]),\n validUntil: Type.Union([utcSecond, Type.Null()]),\n },\n { additionalProperties: false },\n);\nconst bootstrap = Type.Object(\n {\n mode: Type.Literal(\"finite-human-root\"),\n rootReferences: Type.Array(Type.String({ minLength: 1 }), { uniqueItems: true }),\n allowedActions: Type.Array(\n Type.Union([\n Type.Literal(\"enroll_human_root\"),\n Type.Literal(\"initialize_kernel_record\"),\n Type.Literal(\"restore_kernel_record\"),\n Type.Literal(\"cutover_single_writer\"),\n ]),\n { minItems: 1, uniqueItems: true },\n ),\n maxUses: Type.Integer({ minimum: 1, maximum: 1 }),\n expiresAt: Type.Union([utcSecond, Type.Null()]),\n projectCreationAllowed: Type.Literal(false),\n requiresHumanSignature: Type.Literal(true),\n automationCanSatisfy: Type.Literal(false),\n },\n { additionalProperties: false },\n);\nconst digest = Type.String({ pattern: \"^sha256:[0-9a-f]{64}$\" });\nconst policyBundle = Type.Object(\n {\n digest: digest,\n manifest: Type.Record(\n Type.String({ pattern: \"^policy/[A-Za-z0-9._-]+\\\\.rego$\" }),\n Type.String({ pattern: \"^[0-9a-f]{64}$\" }),\n { additionalProperties: false, minProperties: 1 },\n ),\n },\n { additionalProperties: false },\n);\nconst lawInputProfile = Type.Object(\n {\n requiresRunCeiling: Type.Boolean(),\n requiresExpirationLabel: Type.Boolean(),\n maxRunSeconds: Type.Integer({ minimum: 1 }),\n allowExternalIp: Type.Literal(false),\n machinePrefixes: Type.Array(Type.String({ minLength: 1 }), { minItems: 1, uniqueItems: true }),\n accelerators: Type.Array(Type.String({ minLength: 1 }), { uniqueItems: true }),\n maxGpuInstances: Type.Integer({ minimum: 0 }),\n maxTotalVcpus: Type.Integer({ minimum: 1 }),\n maxParallelism: Type.Integer({ minimum: 1 }),\n network: Type.Literal(\"private\"),\n },\n { additionalProperties: false },\n);\nconst lawInputs = Type.Object(\n {\n cloudflare: Type.Object(\n {\n approvedZoneId: Type.String({ minLength: 1 }),\n approvedAccountId: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n ),\n planLimits: Type.Object(\n {\n maxGpuInstances: Type.Integer({ minimum: 0 }),\n maxTotalVcpus: Type.Integer({ minimum: 1 }),\n approvedLocations: Type.Array(Type.String({ minLength: 1 }), {\n minItems: 1,\n uniqueItems: true,\n }),\n },\n { additionalProperties: false },\n ),\n profiles: Type.Object(\n { compute: lawInputProfile, plane: lawInputProfile },\n { additionalProperties: false },\n ),\n },\n { additionalProperties: false },\n);\nconst evaluationInputs = Type.Object(\n { policyBundle: policyBundle, lawInputs: lawInputs },\n { additionalProperties: false },\n);\nconst lawDocument = Type.Object(\n {\n schemaVersion: Type.Literal(1),\n kind: Type.Literal(\"dsg.infra.law\"),\n lawId: Type.String({ minLength: 1 }),\n status: Type.Union([Type.Literal(\"unissued\"), Type.Literal(\"issued\")]),\n authority: authority,\n standingOrder: standingOrder,\n scope: scope,\n validity: validity,\n revocation: revocation,\n ceilings: Type.Object(\n {\n gpuSecondsPerPersonUtcWeek: ceiling,\n usdMicroUnitsPerPersonUtcMonth: ceiling,\n usdMicroUnitsPerOrganizationUtcMonth: ceiling,\n },\n { additionalProperties: false },\n ),\n capabilities: capabilities,\n priceProfile: priceProfile,\n bootstrap: bootstrap,\n evaluationInputs: evaluationInputs,\n },\n { additionalProperties: false },\n);\nconst signature = Type.Object(\n {\n algorithm: Type.Literal(\"Ed25519\"),\n keyClass: Type.Union([\n Type.Literal(\"synthetic-test-only\"),\n Type.Literal(\"human-authority\"),\n Type.Literal(\"release-automation\"),\n ]),\n publicKeyHex: Type.String({ pattern: \"^[0-9a-f]{64}$\" }),\n signatureHex: Type.String({ pattern: \"^[0-9a-f]{128}$\" }),\n },\n { additionalProperties: false },\n);\nconst signedLawBundle = Type.Object(\n {\n schemaVersion: Type.Literal(1),\n kind: Type.Union([\n Type.Literal(\"dsg.infra.signed-law\"),\n Type.Literal(\"dsg.infra.signed-law-fixture\"),\n ]),\n testOnly: Type.Boolean(),\n deployedAuthority: Type.Boolean(),\n payload: lawDocument,\n canonicalPayload: Type.String({ minLength: 1 }),\n payloadSha256: Type.String({ pattern: \"^[0-9a-f]{64}$\" }),\n canonicalSignatureInput: Type.String({ minLength: 1 }),\n signature: signature,\n },\n { additionalProperties: false },\n);\nexport const SignedLawBundleSchema = signedLawBundle;\nexport type SignedLawBundle = Static<typeof SignedLawBundleSchema>;\n\nexport const signedLawV1: ProfileEntry = {\n literal: SIGNED_LAW_PROFILE,\n literalNote:\n \"carried as the domain member of the canonical signature input, not as a bundle field\",\n shapes: { bundle: SignedLawBundleSchema },\n};\n","// dsg.infra.adoption-fact/1\n// Owner: dsg-infra (governance/adoption.py is the producer: it verifies an\n// exported kernel bootstrap record snapshot offline - canonical digest,\n// event hash chain, stream heads, artifact bytes - and emits the accepted\n// root-authorizing operation as this fact). The tofu baseline root\n// consumes it and re-validates independently: its deployment-specific\n// conditions (which root string, testOnly false for the real baseline)\n// are that root's own law, deliberately NOT part of this shape - a\n// synthetic testOnly fact is a valid FACT, just never a valid deployed\n// authorization.\n//\n// Lifted from dsg-infra governance/adoption.py at e9d9501 and\n// infrastructure/environments/dsg-run/adoption.tf (S01, commit fccf709).\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { closed, Hex64, NonEmptyString, Orn, type ProfileEntry } from \"../primitives.js\";\n\nexport const ADOPTION_FACT_PROFILE = \"dsg.infra.adoption-fact/1\" as const;\n\nconst AdoptionFactSchemaValue = closed({\n profile: Type.Literal(ADOPTION_FACT_PROFILE),\n /** The root the record names as active baseline owner. */\n root: NonEmptyString,\n lineage: NonEmptyString,\n /** The accepted root-authorizing operation. */\n operation: NonEmptyString,\n /** Count of accepted root operations; ownership needs at least one. */\n generation: Type.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER }),\n /** Canonical digest of the verified record snapshot. */\n snapshotSha256: Hex64,\n /** initialize establishes the first owner; cutover transfers it. restore\n * and enrollment move custody and human roots, never root ownership. */\n action: Type.Union([\n Type.Literal(\"initialize_kernel_record\"),\n Type.Literal(\"cutover_single_writer\"),\n ]),\n signer: Orn,\n humanRoot: NonEmptyString,\n testOnly: Type.Boolean(),\n});\nexport const AdoptionFactSchema: typeof AdoptionFactSchemaValue = AdoptionFactSchemaValue;\nexport type AdoptionFact = Static<typeof AdoptionFactSchema>;\n\nexport const adoptionFactV1: ProfileEntry = {\n literal: ADOPTION_FACT_PROFILE,\n rootShape: \"fact\",\n shapes: { fact: AdoptionFactSchema },\n};\n","// dsg.registry.revocations/1\n// Owner: dsg-infra-module-registry (the S03 trust producer). Signed,\n// monotonically versioned revocation snapshots with retained trust\n// history; timestamps are epoch seconds by frozen choice of /1 (recorded\n// in FROZEN_EXEMPTIONS; exact-second strings would be a /2).\n// Lifted verbatim from dsg-infra-module-registry src/revocation.ts at\n// 1f8c994.\nimport { Type, type Static } from \"@sinclair/typebox\";\nimport type { ProfileEntry } from \"../primitives.js\";\n\nexport const REVOCATIONS_PROFILE = \"dsg.registry.revocations/1\" as const;\n\nconst closed = { additionalProperties: false };\nconst text = Type.String({ minLength: 1 });\nconst digest = Type.String({ pattern: \"^[0-9a-f]{64}$\" });\nconst time = Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER });\n\nconst RevocationSchemaValue = Type.Object(\n {\n domain: Type.Literal(REVOCATIONS_PROFILE),\n version: Type.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER }),\n issuedAt: time,\n expiresAt: time,\n previousSha256: Type.Union([digest, Type.Null()]),\n testOnly: Type.Literal(true),\n signerKey: digest,\n revoked: Type.Array(\n Type.Object(\n {\n kind: Type.Union([\n Type.Literal(\"principal\"),\n Type.Literal(\"standing-order\"),\n Type.Literal(\"law\"),\n Type.Literal(\"class\"),\n Type.Literal(\"key\"),\n ]),\n id: text,\n effectiveAt: time,\n reason: text,\n },\n closed,\n ),\n ),\n trustHistory: Type.Array(\n Type.Object(\n {\n principal: text,\n publicKey: digest,\n role: Type.Union([\n Type.Literal(\"human\"),\n Type.Literal(\"release\"),\n Type.Literal(\"collector\"),\n ]),\n action: Type.Union([\n Type.Literal(\"enroll\"),\n Type.Literal(\"rotate\"),\n Type.Literal(\"compromise\"),\n ]),\n effectiveAt: time,\n authoritySha256: digest,\n replacesKey: Type.Union([digest, Type.Null()]),\n },\n closed,\n ),\n ),\n },\n closed,\n);\nexport const RevocationSchema: typeof RevocationSchemaValue = RevocationSchemaValue;\nexport type RevocationSnapshot = Static<typeof RevocationSchema>;\n\nconst RevocationPointerSchemaValue = Type.Object(\n {\n version: Type.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER }),\n sha256: digest,\n url: Type.String({ pattern: \"^/revocations/v/[1-9][0-9]*/snapshot\\\\.json$\" }),\n },\n closed,\n);\nexport const RevocationPointerSchema: typeof RevocationPointerSchemaValue =\n RevocationPointerSchemaValue;\nexport type RevocationPointer = Static<typeof RevocationPointerSchema>;\n\nexport const revocationsV1: ProfileEntry = {\n literal: REVOCATIONS_PROFILE,\n shapes: { snapshot: RevocationSchema, pointer: RevocationPointerSchema },\n};\n","// dsg.kernel.bootstrap/1\n// Owner: dsg-kernel (K14). The finite bootstrap intent: a signed,\n// single-use, expiring authorization for exactly one of four record\n// actions, binding plan and resource-spec digests. enroll_human_root\n// (M030) is the additive action that anchors ordinary-authority\n// enrollment; initialization is never reinterpreted as enrollment. The\n// record-held bootstrap event payloads stay in the kernel.\n//\n// Lifted verbatim from dsg-kernel packages/core/src/contracts.ts at\n// 00b33ac1. createdAt/expiresAt are frozen /1 nonempty strings, recorded\n// in FROZEN_EXEMPTIONS; exact-second patterns would be a /2 against\n// already-recorded signed intents.\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { closed, Hex64, NonEmptyString, Orn, type ProfileEntry } from \"../primitives.js\";\n\nexport const BOOTSTRAP_PROFILE = \"dsg.kernel.bootstrap/1\" as const;\n\nconst BootstrapActionSchemaValue = Type.Union([\n Type.Literal(\"initialize_kernel_record\"),\n Type.Literal(\"restore_kernel_record\"),\n Type.Literal(\"cutover_single_writer\"),\n Type.Literal(\"enroll_human_root\"),\n]);\nexport const BootstrapActionSchema: typeof BootstrapActionSchemaValue = BootstrapActionSchemaValue;\nexport type BootstrapAction = Static<typeof BootstrapActionSchema>;\n\nconst BootstrapIntentSchemaValue = closed({\n version: Type.Literal(BOOTSTRAP_PROFILE),\n operation: NonEmptyString,\n action: BootstrapActionSchema,\n lineage: NonEmptyString,\n humanRoot: NonEmptyString,\n signer: Orn,\n scope: NonEmptyString,\n resources: Type.Array(\n closed({\n identity: NonEmptyString,\n specSha256: Hex64,\n }),\n { minItems: 1, uniqueItems: true },\n ),\n planSha256: Hex64,\n preconditionsSha256: Hex64,\n createdAt: NonEmptyString,\n expiresAt: NonEmptyString,\n maxUses: Type.Literal(1),\n cost: closed({\n currency: Type.Literal(\"USD\"),\n maxMicroUsd: Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER }),\n assumptionsSha256: Hex64,\n }),\n testOnly: Type.Boolean(),\n});\nexport const BootstrapIntentSchema: typeof BootstrapIntentSchemaValue = BootstrapIntentSchemaValue;\nexport type BootstrapIntent = Static<typeof BootstrapIntentSchema>;\n\nconst SignedBootstrapIntentSchemaValue = closed({\n body: BootstrapIntentSchema,\n signature: Type.String({ pattern: \"^[0-9a-f]{128}$\" }),\n});\nexport const SignedBootstrapIntentSchema: typeof SignedBootstrapIntentSchemaValue =\n SignedBootstrapIntentSchemaValue;\nexport type SignedBootstrapIntent = Static<typeof SignedBootstrapIntentSchema>;\n\nexport const bootstrapV1: ProfileEntry = {\n literal: BOOTSTRAP_PROFILE,\n shapes: { intent: BootstrapIntentSchema, signed: SignedBootstrapIntentSchema },\n};\n","// dsg.kernel.ordinary-authority/1\n// Owner: dsg-kernel (K02, M029/M030). The canonical ordinary-rights\n// artifact: who may issue law, exactly what they may permit, for how long,\n// and under which three ceilings. Closed and versioned; every set is an\n// explicit allow-list, never an omitted-means-unlimited default. A\n// verified finite enroll_human_root intent binds this document's digest as\n// both plan and resource spec. The revocation view a standing-order check\n// runs against stays in the kernel: independently supplied input, not a\n// wire document.\n//\n// Lifted verbatim from dsg-kernel packages/signing/src/enrollment.ts at\n// 00b33ac1.\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { closed, Hex64, NonEmptyString, Orn, UtcSecond, type ProfileEntry } from \"../primitives.js\";\n\nexport const ORDINARY_AUTHORITY_PROFILE = \"dsg.kernel.ordinary-authority/1\" as const;\n\nconst names = Type.Array(NonEmptyString, { minItems: 1, uniqueItems: true });\nconst ceilingValue = Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER });\n\nconst OrdinaryAuthoritySchemaValue = closed({\n version: Type.Literal(ORDINARY_AUTHORITY_PROFILE),\n reference: NonEmptyString,\n actor: Orn,\n publicKeyHex: Hex64,\n keyClass: Type.Union([Type.Literal(\"synthetic-test-only\"), Type.Literal(\"human-authority\")]),\n designation: closed({\n role: Type.Literal(\"law-issuer\"),\n designationReference: NonEmptyString,\n }),\n scope: closed({\n scopeReference: NonEmptyString,\n actions: names,\n workloadClasses: names,\n regions: names,\n }),\n validity: closed({ notBefore: UtcSecond, notAfter: UtcSecond }),\n ceilings: closed({\n gpuSecondsPerPersonUtcWeek: ceilingValue,\n usdMicroUnitsPerPersonUtcMonth: ceilingValue,\n usdMicroUnitsPerOrganizationUtcMonth: ceilingValue,\n }),\n revoked: Type.Boolean(),\n});\nexport const OrdinaryAuthoritySchema: typeof OrdinaryAuthoritySchemaValue =\n OrdinaryAuthoritySchemaValue;\nexport type OrdinaryAuthority = Static<typeof OrdinaryAuthoritySchema>;\n\nexport const ordinaryAuthorityV1: ProfileEntry = {\n literal: ORDINARY_AUTHORITY_PROFILE,\n rootShape: \"authority\",\n shapes: { authority: OrdinaryAuthoritySchema },\n};\n","// In-process contract versions of the dsg-run plane. Under ruling I7 these\n// are NOT profiles: an executor or provider adapter is a TypeScript plugin\n// interface inside one process, with no serialized shape or digest of its\n// own - its documents (operation requests, descriptors) already have\n// profiles. The literals live here so no consumer repo defines a\n// dsg.*.*/N string and the CI grep stays absolute. When R06 gives\n// executors a real serialized job document, THAT becomes a profile module\n// beside this file.\nexport const EXECUTOR_PROTOCOL_VERSION = \"dsg.run.executor/1\" as const;\nexport type ExecutorProtocolVersion = typeof EXECUTOR_PROTOCOL_VERSION;\n\nexport const PROVIDER_PROTOCOL_VERSION = \"dsg.run.provider/1\" as const;\nexport type ProviderProtocolVersion = typeof PROVIDER_PROTOCOL_VERSION;\n","export { closed, Hex64, NonEmptyString, Orn, Reference, SafeInt, UtcSecond } from \"./primitives.js\";\nexport type { ProfileEntry } from \"./primitives.js\";\nexport {\n DISPATCH_CONSUME_PROFILE,\n DISPATCH_MAX_SKEW_SECONDS,\n DispatchConsumeRequestSchema,\n DispatchLeaseSchema,\n DispatchRefusalCodeSchema,\n DispatchRefusalSchema,\n} from \"./kernel/dispatch-consume.v1.js\";\nexport type {\n DispatchConsumeRequest,\n DispatchLease,\n DispatchRefusal,\n DispatchRefusalCode,\n} from \"./kernel/dispatch-consume.v1.js\";\nexport {\n AcceptedSchema,\n ExecutionDocumentSchema,\n ExecutionLawSchema,\n ExecutionResourcesSchema,\n OPERATION_PROFILE,\n OperationBeforeSchema,\n OperationCleanupSchema,\n OperationCostSchema,\n OperationEvidenceSchema,\n OperationExecutionSchema,\n OperationRequestSchema,\n OperationStatusSchema,\n ReadbackSchema,\n} from \"./run/operation.v1.js\";\nexport type {\n Accepted,\n ExecutionDocument,\n ExecutionLaw,\n ExecutionResources,\n OperationBefore,\n OperationCleanup,\n OperationCost,\n OperationEvidence,\n OperationExecution,\n OperationRequest,\n OperationStatus,\n Readback,\n} from \"./run/operation.v1.js\";\nexport {\n PRICE_PROFILE_REFERENCE,\n SCOPE_REFERENCE,\n SIGNED_LAW_DOMAIN,\n SIGNED_LAW_PROFILE,\n SignedLawBundleSchema,\n} from \"./infra/signed-law.v1.js\";\nexport {\n RESOURCE_DESCRIPTOR_KIND,\n RESOURCE_DESCRIPTOR_PROFILE,\n ResourceDescriptorSchema,\n} from \"./infra/resource-descriptor.v1.js\";\nexport type { ResourceDescriptor } from \"./infra/resource-descriptor.v1.js\";\nexport { ADOPTION_FACT_PROFILE, AdoptionFactSchema } from \"./infra/adoption-fact.v1.js\";\nexport type { AdoptionFact } from \"./infra/adoption-fact.v1.js\";\nexport type { SignedLawBundle } from \"./infra/signed-law.v1.js\";\nexport {\n REVOCATIONS_PROFILE,\n RevocationPointerSchema,\n RevocationSchema,\n} from \"./registry/revocations.v1.js\";\nexport type { RevocationPointer, RevocationSnapshot } from \"./registry/revocations.v1.js\";\nexport {\n BOOTSTRAP_PROFILE,\n BootstrapActionSchema,\n BootstrapIntentSchema,\n SignedBootstrapIntentSchema,\n} from \"./kernel/bootstrap.v1.js\";\nexport type {\n BootstrapAction,\n BootstrapIntent,\n SignedBootstrapIntent,\n} from \"./kernel/bootstrap.v1.js\";\nexport {\n ORDINARY_AUTHORITY_PROFILE,\n OrdinaryAuthoritySchema,\n} from \"./kernel/ordinary-authority.v1.js\";\nexport type { OrdinaryAuthority } from \"./kernel/ordinary-authority.v1.js\";\nexport { EXECUTOR_PROTOCOL_VERSION, PROVIDER_PROTOCOL_VERSION } from \"./run/contract-versions.js\";\nexport type { ExecutorProtocolVersion, ProviderProtocolVersion } from \"./run/contract-versions.js\";\n\nimport type { ProfileEntry } from \"./primitives.js\";\nimport { dispatchConsumeV1 } from \"./kernel/dispatch-consume.v1.js\";\nimport { operationV1 } from \"./run/operation.v1.js\";\nimport { signedLawV1 } from \"./infra/signed-law.v1.js\";\nimport { resourceDescriptorV1 } from \"./infra/resource-descriptor.v1.js\";\nimport { adoptionFactV1 } from \"./infra/adoption-fact.v1.js\";\nimport { revocationsV1 } from \"./registry/revocations.v1.js\";\nimport { bootstrapV1 } from \"./kernel/bootstrap.v1.js\";\nimport { ordinaryAuthorityV1 } from \"./kernel/ordinary-authority.v1.js\";\n\n/** Every profile this version of the package defines, keyed by literal.\n * Profile modules are added here as they are extracted; the rules test\n * and the schema emitter walk this registry, so a module that is not\n * registered does not exist. */\nexport const PROFILES: Readonly<Record<string, ProfileEntry>> = {\n [dispatchConsumeV1.literal]: dispatchConsumeV1,\n [operationV1.literal]: operationV1,\n [signedLawV1.literal]: signedLawV1,\n [resourceDescriptorV1.literal]: resourceDescriptorV1,\n [adoptionFactV1.literal]: adoptionFactV1,\n [revocationsV1.literal]: revocationsV1,\n [bootstrapV1.literal]: bootstrapV1,\n [ordinaryAuthorityV1.literal]: ordinaryAuthorityV1,\n};\n"],"mappings":";;;;AAOA,MAAa,UAAiC,eAC5C,KAAK,OAAO,YAAY,EAAE,sBAAsB,MAAM,CAAC;;AAGzD,MAAa,QAAQ,KAAK,OAAO,EAAE,SAAS,iBAAiB,CAAC;;AAG9D,MAAa,YAAY,KAAK,OAAO,EACnC,SAAS,2DACX,CAAC;AAED,MAAa,iBAAiB,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAE1D,MAAa,UAAU,KAAK,QAAQ;CAAE,SAAS;CAAG,SAAS,OAAO;AAAiB,CAAC;;;;;;AAOpF,MAAa,MAAM,KAAK,OAAO,EAAE,SAAS,YAAY,CAAC;;AAGvD,MAAa,YAAY,OAAO;CAC9B,KAAK;CACL,QAAQ,KAAK,OAAO,EAAE,SAAS,eAAe,CAAC;AACjD,CAAC;;;ACLD,MAAa,2BAA2B;;AAGxC,MAAa,4BAA4B;AA0BzC,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AAY,UAAU;EACtB,oBAAoB,UAAU;AACjC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["digest","closed"],"sources":["../src/primitives.ts","../src/kernel/dispatch-consume.v1.ts","../src/run/operation.v1.ts","../src/infra/resource-descriptor.v1.ts","../src/infra/signed-law.v1.ts","../src/infra/adoption-fact.v1.ts","../src/registry/revocations.v1.ts","../src/kernel/bootstrap.v1.ts","../src/kernel/ordinary-authority.v1.ts","../src/run/contract-versions.ts","../src/run/event.v1.ts","../src/index.ts"],"sourcesContent":["// The shared primitives every profile builds from. No profile defines its\n// own: a digest is Hex64 everywhere, a timestamp is UtcSecond everywhere,\n// an open object exists nowhere.\nimport { type TObject, type TProperties, type TSchema, Type } from \"@sinclair/typebox\";\nimport { ORN_PATTERN, SHA256_PATTERN } from \"@dynamicalsystems/orn-schemas\";\n\n/** Closed object: an extra field is a different protocol. */\nexport const closed = <T extends TProperties>(properties: T): TObject<T> =>\n Type.Object(properties, { additionalProperties: false });\n\n/** Lowercase sha256 hex. Every digest on the wire. */\nexport const Hex64 = Type.String({ pattern: \"^[0-9a-f]{64}$\" });\n\n/** Exact UTC second, Z suffix, no fractional part. */\nexport const UtcSecond = Type.String({\n pattern: \"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$\",\n});\n\nexport const NonEmptyString = Type.String({ minLength: 1 });\n\nexport const SafeInt = Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER });\n\n/** An ORN, validated by the grammar dsg-orn owns. Built from the exported\n * pattern, not the exported schema object: the upstream schemas carry\n * JSON Schema $id metadata, and embedding the same $id in several route\n * schemas makes validators refuse the duplicate. The pattern is the wire\n * truth; the metadata is not. */\nexport const Orn = Type.String({ pattern: ORN_PATTERN });\n\n/** The pair of an ORN and the sha256 pinning a version (dsg-orn Reference). */\nexport const Reference = closed({\n orn: Orn,\n sha256: Type.String({ pattern: SHA256_PATTERN }),\n});\n\n/** One wire profile: the literal, and every top-level shape that crosses\n * the seam it names. Shape names are stable identifiers (\"request\",\n * \"lease\", \"refusal\"); vectors address a shape as \"<literal>#<shape>\". */\nexport type ProfileEntry = {\n readonly literal: `dsg.${string}.${string}/${number}`;\n readonly shapes: Readonly<Record<string, TSchema>>;\n /** Set ONLY when the wire cannot carry the literal as a field of any\n * shape (a frozen /1); names exactly where the literal lives instead. */\n readonly literalNote?: string;\n /** Names the shape non-TS consumers validate a whole document against;\n * the emitted JSON Schema gains a root $ref to it. Only meaningful for\n * profiles with a single document root. */\n readonly rootShape?: string;\n};\n","// dsg.kernel.dispatch-consume/1\n// Owner: dsg-kernel (the consume route produces the lease and the refusal;\n// the plane produces the request).\n//\n// K05/I3: the dispatch-authorization consume contract between the kernel\n// and the plane. Immediately before its first non-cleanup cloud mutation -\n// identity, bucket and IAM preparation included, not only job submission -\n// the plane consumes a short-lived, single-operation dispatch authorization\n// bound to operation, generation, envelope digest, law digest and\n// reservation. The committed consume event is the authorization ordering\n// point; it is not atomic with any provider API. A replay returns the\n// original lease and never renews it; a renewal is a new recorded\n// authorization decision for the same operation and reservation.\n//\n// Lifted verbatim from dsg-kernel packages/core/src/dispatch.ts at commit\n// c2d39d95 (wire shapes only; the record-held event payloads stay in the\n// kernel). This file is frozen: changes ship as dispatch-consume.v2.ts.\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport {\n closed,\n Hex64,\n NonEmptyString,\n Orn,\n Reference,\n UtcSecond,\n type ProfileEntry,\n} from \"../primitives.js\";\n\nexport const DISPATCH_CONSUME_PROFILE = \"dsg.kernel.dispatch-consume/1\" as const;\n\n/** The bounded clock skew a lease check must tolerate, in seconds. */\nexport const DISPATCH_MAX_SKEW_SECONDS = 300;\n\nconst DispatchConsumeRequestSchemaValue = closed({\n profile: Type.Literal(DISPATCH_CONSUME_PROFILE),\n /** The kernel operation identity from the accepted OperationRequest. */\n operationId: NonEmptyString,\n /** The workspace generation the plane admitted the operation at. */\n generation: Type.Integer({ minimum: 0 }),\n /** The Case the operation belongs to - the stream the consume event\n * lands on and the stream the reservation was recorded on. */\n caseOrn: Orn,\n /** SHA256(JCS(complete OperationRequest)) - the M010 envelope digest. */\n envelopeSha256: Hex64,\n /** The exact retained signed-law bytes the Case pins. */\n lawSha256: Hex64,\n /** The K04 reservation the authorization is bound to: sha256 is the\n * reservation event's record id. */\n reservation: Reference,\n requestedAt: UtcSecond,\n /** False: first consumption or idempotent replay of it. True: an explicit\n * renewal - a new recorded authorization decision for the same operation\n * and reservation after lease expiry with the work known unsubmitted. A\n * replay never renews; only this flag does, and it re-runs every\n * revocation check at the current record state. */\n renewal: Type.Boolean(),\n});\nexport const DispatchConsumeRequestSchema: typeof DispatchConsumeRequestSchemaValue =\n DispatchConsumeRequestSchemaValue;\nexport type DispatchConsumeRequest = Static<typeof DispatchConsumeRequestSchema>;\n\nconst DispatchLeaseSchemaValue = closed({\n profile: Type.Literal(DISPATCH_CONSUME_PROFILE),\n /** The consume event's record id: the committed ordering point. */\n leaseId: Hex64,\n operationId: NonEmptyString,\n generation: Type.Integer({ minimum: 0 }),\n caseOrn: Orn,\n envelopeSha256: Hex64,\n lawSha256: Hex64,\n reservation: Reference,\n consumedAt: UtcSecond,\n /** Fixed maximum duration from consumedAt; the plane checks validity\n * before each new non-cleanup call, Batch submission included. */\n expiresAt: UtcSecond,\n /** The bounded clock skew a lease check must tolerate, in seconds. */\n maxSkewSeconds: Type.Integer({ minimum: 0, maximum: DISPATCH_MAX_SKEW_SECONDS }),\n renewal: Type.Literal(\"new-authorization-required\"),\n /** False when this response replays an earlier committed consumption:\n * the lease bytes, expiry included, are the original's. */\n fresh: Type.Boolean(),\n});\nexport const DispatchLeaseSchema: typeof DispatchLeaseSchemaValue = DispatchLeaseSchemaValue;\nexport type DispatchLease = Static<typeof DispatchLeaseSchema>;\n\nconst DispatchRefusalCodeSchemaValue = Type.Union([\n Type.Literal(\"unknown_operation\"),\n Type.Literal(\"no_reservation\"),\n Type.Literal(\"binding_mismatch\"),\n Type.Literal(\"revoked\"),\n Type.Literal(\"authority_refused\"),\n Type.Literal(\"renewal_requires_existing_consumption\"),\n Type.Literal(\"unavailable\"),\n]);\nexport const DispatchRefusalCodeSchema: typeof DispatchRefusalCodeSchemaValue =\n DispatchRefusalCodeSchemaValue;\nexport type DispatchRefusalCode = Static<typeof DispatchRefusalCodeSchema>;\n\nconst DispatchRefusalSchemaValue = closed({\n profile: Type.Literal(DISPATCH_CONSUME_PROFILE),\n code: DispatchRefusalCodeSchema,\n issues: Type.Array(NonEmptyString, { minItems: 1 }),\n});\nexport const DispatchRefusalSchema: typeof DispatchRefusalSchemaValue = DispatchRefusalSchemaValue;\nexport type DispatchRefusal = Static<typeof DispatchRefusalSchema>;\n\nexport const dispatchConsumeV1: ProfileEntry = {\n literal: DISPATCH_CONSUME_PROFILE,\n shapes: {\n request: DispatchConsumeRequestSchema,\n lease: DispatchLeaseSchema,\n refusal: DispatchRefusalSchema,\n },\n};\n","// dsg.run.operation/1\n// Owner: dsg-run (the protocol listener accepts the request and answers\n// the receipt; the kernel validates, records and reads back).\n//\n// Closed, versioned compute-operation vocabulary shared by the kernel and\n// the dsg.run plane. The document is deliberately references-only: payload\n// bytes remain retained artifacts, while this request carries the immutable\n// identity, generation fence, law, reservation and plan digest.\n//\n// The envelope digest bound at dispatch (M010) is sha256 over the RFC 8785\n// canonical form of the complete OperationRequest; the digest vectors in\n// the conformance package pin that meaning.\n//\n// Lifted verbatim from dsg-kernel packages/core/src/operation.ts at commit\n// 0f8d64d7 (equal, field for field, to dsg-run service/src/protocol/\n// schemas.ts 134-246 - the R01 cross-validation held). Known /2 candidate,\n// kept loose here because a released /1 is frozen: acceptedAt is\n// minLength 1, not an exact UTC second, and the plane emits fractional\n// seconds today.\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport {\n closed,\n Hex64,\n NonEmptyString,\n Reference,\n SafeInt,\n type ProfileEntry,\n} from \"../primitives.js\";\n\nexport const OPERATION_PROFILE = \"dsg.run.operation/1\" as const;\n\nconst ExecutionResourcesSchemaValue = closed({\n maxGpuSeconds: SafeInt,\n maxRunSeconds: SafeInt,\n maxParallelism: SafeInt,\n});\nexport const ExecutionResourcesSchema: typeof ExecutionResourcesSchemaValue =\n ExecutionResourcesSchemaValue;\nexport type ExecutionResources = Static<typeof ExecutionResourcesSchema>;\n\nconst ExecutionLawSchemaValue = closed({\n bundle: Reference,\n registryRelease: Reference,\n});\nexport const ExecutionLawSchema: typeof ExecutionLawSchemaValue = ExecutionLawSchemaValue;\nexport type ExecutionLaw = Static<typeof ExecutionLawSchema>;\n\nconst ExecutionDocumentSchemaValue = closed({\n schemaVersion: Type.Literal(1),\n classContract: Reference,\n law: ExecutionLawSchema,\n workload: Reference,\n inputs: Type.Array(Reference),\n resources: ExecutionResourcesSchema,\n costBound: Reference,\n placement: Reference,\n results: Reference,\n secrets: Type.Array(Reference),\n});\nexport const ExecutionDocumentSchema: typeof ExecutionDocumentSchemaValue =\n ExecutionDocumentSchemaValue;\nexport type ExecutionDocument = Static<typeof ExecutionDocumentSchema>;\n\nconst OperationBeforeSchemaValue = closed({\n operationId: Type.Union([NonEmptyString, Type.Null()]),\n planDigest: Type.Union([Hex64, Type.Null()]),\n});\nexport const OperationBeforeSchema: typeof OperationBeforeSchemaValue = OperationBeforeSchemaValue;\nexport type OperationBefore = Static<typeof OperationBeforeSchema>;\n\nconst OperationRequestSchemaValue = closed({\n profile: Type.Literal(OPERATION_PROFILE),\n operationId: NonEmptyString,\n case: Reference,\n workspace: NonEmptyString,\n expectedGeneration: SafeInt,\n before: OperationBeforeSchema,\n planDigest: Hex64,\n document: ExecutionDocumentSchema,\n authority: Reference,\n reservation: Reference,\n});\nexport const OperationRequestSchema: typeof OperationRequestSchemaValue =\n OperationRequestSchemaValue;\nexport type OperationRequest = Static<typeof OperationRequestSchema>;\n\nconst AcceptedSchemaValue = closed({\n profile: Type.Literal(OPERATION_PROFILE),\n operationId: NonEmptyString,\n actionId: NonEmptyString,\n generation: SafeInt,\n planDigest: Hex64,\n acceptedAt: NonEmptyString,\n});\nexport const AcceptedSchema: typeof AcceptedSchemaValue = AcceptedSchemaValue;\nexport type Accepted = Static<typeof AcceptedSchema>;\n\nconst OperationExecutionSchemaValue = Type.Union([\n Type.Literal(\"queued\"),\n Type.Literal(\"running\"),\n Type.Literal(\"succeeded\"),\n Type.Literal(\"failed\"),\n Type.Literal(\"canceled\"),\n Type.Literal(\"unknown\"),\n]);\nexport const OperationExecutionSchema: typeof OperationExecutionSchemaValue =\n OperationExecutionSchemaValue;\nexport type OperationExecution = Static<typeof OperationExecutionSchema>;\n\nconst OperationCleanupSchemaValue = Type.Union([\n Type.Literal(\"pending\"),\n Type.Literal(\"present\"),\n Type.Literal(\"absent\"),\n Type.Literal(\"unknown\"),\n]);\nexport const OperationCleanupSchema: typeof OperationCleanupSchemaValue =\n OperationCleanupSchemaValue;\nexport type OperationCleanup = Static<typeof OperationCleanupSchema>;\n\nconst OperationEvidenceSchemaValue = Type.Union([Type.Literal(\"pending\"), Type.Literal(\"ready\")]);\nexport const OperationEvidenceSchema: typeof OperationEvidenceSchemaValue =\n OperationEvidenceSchemaValue;\nexport type OperationEvidence = Static<typeof OperationEvidenceSchema>;\n\nconst OperationCostSchemaValue = Type.Union([\n Type.Literal(\"reserved\"),\n Type.Literal(\"provisional\"),\n Type.Literal(\"reconciled\"),\n]);\nexport const OperationCostSchema: typeof OperationCostSchemaValue = OperationCostSchemaValue;\nexport type OperationCost = Static<typeof OperationCostSchema>;\n\nconst ReadbackSchemaValue = closed({\n operationId: NonEmptyString,\n generation: SafeInt,\n planDigest: Hex64,\n execution: OperationExecutionSchema,\n cleanup: OperationCleanupSchema,\n evidence: OperationEvidenceSchema,\n evidenceRef: Type.Union([Reference, Type.Null()]),\n cost: OperationCostSchema,\n});\nexport const ReadbackSchema: typeof ReadbackSchemaValue = ReadbackSchemaValue;\nexport type Readback = Static<typeof ReadbackSchema>;\n\n// I-001 names the status as the same closed readback shape. Keeping this\n// alias prevents callers from inventing a second status wire contract.\nexport const OperationStatusSchema = ReadbackSchema;\nexport type OperationStatus = Readback;\n\nexport const operationV1: ProfileEntry = {\n literal: OPERATION_PROFILE,\n shapes: {\n request: OperationRequestSchema,\n accepted: AcceptedSchema,\n readback: ReadbackSchema,\n },\n};\n","// dsg.infra.resource-descriptor/1\n// Owner: dsg-infra (policy/resource-descriptor.schema.json is the source;\n// law_contract.py validates this exact shape and evaluate_descriptor\n// returns its canonical digest). A concrete provider-neutral resource: the\n// thing rendered from a workload and gated against the signed law's\n// capability limits before any provider API sees it. Distinct from\n// signed-law's capabilityProfile, which states allowed LIMITS; this\n// document states one concrete resource checked against them.\n//\n// The wire carries kind \"dsg.infra.resource-descriptor\" plus\n// schemaVersion 1; the /1 literal itself is the version marker signed-law\n// fields pin (scope.resourceDescriptorVersion, capabilities\n// .descriptorVersion), so the constant lives here and signed-law imports\n// it. Lifted verbatim from dsg-infra policy/resource-descriptor.schema.json\n// at fccf709.\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { closed, NonEmptyString, type ProfileEntry } from \"../primitives.js\";\n\nexport const RESOURCE_DESCRIPTOR_PROFILE = \"dsg.infra.resource-descriptor/1\" as const;\n/** The document kind: the profile literal without its version suffix; the\n * version rides in schemaVersion. Frozen /1 wire choice. */\nexport const RESOURCE_DESCRIPTOR_KIND = \"dsg.infra.resource-descriptor\" as const;\n\nconst prefixedDigest = Type.String({ pattern: \"^sha256:[0-9a-f]{64}$\" });\n\nconst ResourceDescriptorSchemaValue = closed({\n schemaVersion: Type.Literal(1),\n kind: Type.Literal(RESOURCE_DESCRIPTOR_KIND),\n workloadClass: NonEmptyString,\n lifecycle: Type.Union([Type.Literal(\"ephemeral\"), Type.Literal(\"durable\")]),\n machineType: Type.String({ pattern: \"^[a-z][a-z0-9]*-[a-z0-9]+-[0-9]+$\" }),\n accelerator: Type.Union([Type.String({ minLength: 1 }), Type.Null()]),\n acceleratorCount: Type.Integer({ minimum: 0 }),\n vcpuCount: Type.Integer({ minimum: 1 }),\n memoryGiB: Type.Integer({ minimum: 1 }),\n maxRunSeconds: Type.Integer({ minimum: 1 }),\n maxParallelism: Type.Integer({ minimum: 1 }),\n region: NonEmptyString,\n imageDigest: prefixedDigest,\n moduleDigest: prefixedDigest,\n externalIp: Type.Literal(false),\n network: Type.Literal(\"private\"),\n reservation: closed({\n gpuSeconds: Type.Integer({ minimum: 0 }),\n usdMicroUnits: Type.Integer({ minimum: 0 }),\n }),\n});\nexport const ResourceDescriptorSchema: typeof ResourceDescriptorSchemaValue =\n ResourceDescriptorSchemaValue;\nexport type ResourceDescriptor = Static<typeof ResourceDescriptorSchema>;\n\nexport const resourceDescriptorV1: ProfileEntry = {\n literal: RESOURCE_DESCRIPTOR_PROFILE,\n literalNote:\n \"carried as kind (unversioned) plus schemaVersion on the document; the /1 literal is the version marker signed-law pins\",\n rootShape: \"descriptor\",\n shapes: { descriptor: ResourceDescriptorSchema },\n};\n","// dsg.infra.signed-law/1\n// Owner: dsg-infra (the S02 law producer; both prior copies were generated\n// from dsg-infra policy/law-bundle.schema.json, source SHA-256\n// bc3692395cf994567115c76d8fce66a7e9ebe7b2c50c70e1c83b8b10693a838c).\n//\n// The literal is the signing DOMAIN: it appears as the `domain` member of\n// the canonical signature input (JCS of {domain, payload, payloadSha256,\n// testOnly}), not as a field of the bundle itself; the bundle carries\n// `kind` plus `schemaVersion` instead. Lifted verbatim from dsg-kernel\n// packages/signing/src/law-schema.ts at ffafe305, byte-identical to the\n// module registry copy at 1f8c994.\nimport { Type, type Static } from \"@sinclair/typebox\";\nimport type { ProfileEntry } from \"../primitives.js\";\nimport { RESOURCE_DESCRIPTOR_PROFILE } from \"./resource-descriptor.v1.js\";\n\nexport const SIGNED_LAW_PROFILE = \"dsg.infra.signed-law/1\" as const;\n/** The signature-input domain member is exactly the profile literal. */\nexport const SIGNED_LAW_DOMAIN = SIGNED_LAW_PROFILE;\n\n/** The scope vocabulary version today's laws cite in\n * standingOrder.scopeReference. The FIELD stays an open nonempty string on\n * purpose (a law may cite a future scope); this constant is the value in\n * force, exported so no consumer hand-types it. */\nexport const SCOPE_REFERENCE = \"dsg.infra.scope/1\" as const;\n\n/** The price-profile version today's laws cite in priceProfile.reference.\n * Same rule: the field stays open; this is the value in force. */\nexport const PRICE_PROFILE_REFERENCE = \"dsg.infra.price-profile/1\" as const;\n\nconst nullableString = Type.Union([Type.String({ minLength: 1 }), Type.Null()]);\nconst authority = Type.Object(\n {\n issuerType: Type.Literal(\"human\"),\n issuerReference: nullableString,\n designationReference: nullableString,\n signatureReference: nullableString,\n humanSignatureRequired: Type.Literal(true),\n releaseAutomationMayIssue: Type.Literal(false),\n },\n { additionalProperties: false },\n);\nconst utcSecond = Type.String({\n pattern: \"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$\",\n});\nconst standingOrder = Type.Object(\n {\n reference: nullableString,\n designationReference: nullableString,\n scopeReference: Type.String({ minLength: 1 }),\n issuedAt: Type.Union([utcSecond, Type.Null()]),\n expiresAt: Type.Union([utcSecond, Type.Null()]),\n },\n { additionalProperties: false },\n);\nconst scope = Type.Object(\n {\n actions: Type.Array(Type.String({ minLength: 1 }), { minItems: 1, uniqueItems: true }),\n workloadClasses: Type.Array(Type.String({ minLength: 1 }), { minItems: 1, uniqueItems: true }),\n providers: Type.Array(Type.Literal(\"provider-neutral\"), { minItems: 1, uniqueItems: true }),\n regions: Type.Array(Type.String({ minLength: 1 }), { uniqueItems: true }),\n resourceDescriptorVersion: Type.Literal(RESOURCE_DESCRIPTOR_PROFILE),\n },\n { additionalProperties: false },\n);\nconst validity = Type.Object(\n {\n clock: Type.Literal(\"UTC\"),\n notBefore: Type.Union([utcSecond, Type.Null()]),\n notAfter: Type.Union([utcSecond, Type.Null()]),\n },\n { additionalProperties: false },\n);\nconst revocation = Type.Object(\n {\n snapshotReference: nullableString,\n failClosed: Type.Literal(true),\n checks: Type.Array(Type.String({ minLength: 1 }), { minItems: 1, uniqueItems: true }),\n },\n { additionalProperties: false },\n);\nconst ceiling = Type.Object(\n {\n unit: Type.String({ minLength: 1 }),\n period: Type.String({ minLength: 1 }),\n scope: Type.Union([Type.Literal(\"person\"), Type.Literal(\"organization\")]),\n value: Type.Union([Type.Integer({ minimum: 0 }), Type.Null()]),\n },\n { additionalProperties: false },\n);\nconst capabilityProfile = Type.Object(\n {\n lifecycle: Type.Union([Type.Literal(\"ephemeral\"), Type.Literal(\"durable\")]),\n machinePrefixes: Type.Array(Type.String({ minLength: 1 }), { minItems: 1, uniqueItems: true }),\n accelerators: Type.Array(Type.String({ minLength: 1 }), { uniqueItems: true }),\n maxRunSeconds: Type.Union([Type.Integer({ minimum: 0 }), Type.Null()]),\n maxParallelism: Type.Union([Type.Integer({ minimum: 1 }), Type.Null()]),\n maxGpuInstances: Type.Union([Type.Integer({ minimum: 0 }), Type.Null()]),\n maxVcpus: Type.Union([Type.Integer({ minimum: 1 }), Type.Null()]),\n network: Type.Literal(\"private\"),\n externalIpAllowed: Type.Literal(false),\n },\n { additionalProperties: false },\n);\nconst capabilities = Type.Object(\n {\n providerNeutral: Type.Literal(true),\n descriptorVersion: Type.Literal(RESOURCE_DESCRIPTOR_PROFILE),\n profiles: Type.Record(Type.String(), capabilityProfile, { minProperties: 1 }),\n },\n { additionalProperties: false },\n);\nconst priceProfile = Type.Object(\n {\n reference: Type.String({ minLength: 1 }),\n status: Type.Union([Type.Literal(\"unassigned\"), Type.Literal(\"retained\")]),\n currency: Type.Literal(\"USD\"),\n unit: Type.Literal(\"micro_usd\"),\n basis: Type.Literal(\"retained-conservative-on-demand\"),\n rates: Type.Object(\n {\n vcpuSecond: Type.Optional(Type.Integer({ minimum: 0 })),\n memoryGiBSecond: Type.Optional(Type.Integer({ minimum: 0 })),\n gpuSecond: Type.Optional(Type.Integer({ minimum: 0 })),\n startup: Type.Optional(Type.Integer({ minimum: 0 })),\n },\n { additionalProperties: false },\n ),\n safetyFactorBps: Type.Union([Type.Integer({ minimum: 10000 }), Type.Null()]),\n validFrom: Type.Union([utcSecond, Type.Null()]),\n validUntil: Type.Union([utcSecond, Type.Null()]),\n },\n { additionalProperties: false },\n);\nconst bootstrap = Type.Object(\n {\n mode: Type.Literal(\"finite-human-root\"),\n rootReferences: Type.Array(Type.String({ minLength: 1 }), { uniqueItems: true }),\n allowedActions: Type.Array(\n Type.Union([\n Type.Literal(\"enroll_human_root\"),\n Type.Literal(\"initialize_kernel_record\"),\n Type.Literal(\"restore_kernel_record\"),\n Type.Literal(\"cutover_single_writer\"),\n ]),\n { minItems: 1, uniqueItems: true },\n ),\n maxUses: Type.Integer({ minimum: 1, maximum: 1 }),\n expiresAt: Type.Union([utcSecond, Type.Null()]),\n projectCreationAllowed: Type.Literal(false),\n requiresHumanSignature: Type.Literal(true),\n automationCanSatisfy: Type.Literal(false),\n },\n { additionalProperties: false },\n);\nconst digest = Type.String({ pattern: \"^sha256:[0-9a-f]{64}$\" });\nconst policyBundle = Type.Object(\n {\n digest: digest,\n manifest: Type.Record(\n Type.String({ pattern: \"^policy/[A-Za-z0-9._-]+\\\\.rego$\" }),\n Type.String({ pattern: \"^[0-9a-f]{64}$\" }),\n { additionalProperties: false, minProperties: 1 },\n ),\n },\n { additionalProperties: false },\n);\nconst lawInputProfile = Type.Object(\n {\n requiresRunCeiling: Type.Boolean(),\n requiresExpirationLabel: Type.Boolean(),\n maxRunSeconds: Type.Integer({ minimum: 1 }),\n allowExternalIp: Type.Literal(false),\n machinePrefixes: Type.Array(Type.String({ minLength: 1 }), { minItems: 1, uniqueItems: true }),\n accelerators: Type.Array(Type.String({ minLength: 1 }), { uniqueItems: true }),\n maxGpuInstances: Type.Integer({ minimum: 0 }),\n maxTotalVcpus: Type.Integer({ minimum: 1 }),\n maxParallelism: Type.Integer({ minimum: 1 }),\n network: Type.Literal(\"private\"),\n },\n { additionalProperties: false },\n);\nconst lawInputs = Type.Object(\n {\n cloudflare: Type.Object(\n {\n approvedZoneId: Type.String({ minLength: 1 }),\n approvedAccountId: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n ),\n planLimits: Type.Object(\n {\n maxGpuInstances: Type.Integer({ minimum: 0 }),\n maxTotalVcpus: Type.Integer({ minimum: 1 }),\n approvedLocations: Type.Array(Type.String({ minLength: 1 }), {\n minItems: 1,\n uniqueItems: true,\n }),\n },\n { additionalProperties: false },\n ),\n profiles: Type.Object(\n { compute: lawInputProfile, plane: lawInputProfile },\n { additionalProperties: false },\n ),\n },\n { additionalProperties: false },\n);\nconst evaluationInputs = Type.Object(\n { policyBundle: policyBundle, lawInputs: lawInputs },\n { additionalProperties: false },\n);\nconst lawDocument = Type.Object(\n {\n schemaVersion: Type.Literal(1),\n kind: Type.Literal(\"dsg.infra.law\"),\n lawId: Type.String({ minLength: 1 }),\n status: Type.Union([Type.Literal(\"unissued\"), Type.Literal(\"issued\")]),\n authority: authority,\n standingOrder: standingOrder,\n scope: scope,\n validity: validity,\n revocation: revocation,\n ceilings: Type.Object(\n {\n gpuSecondsPerPersonUtcWeek: ceiling,\n usdMicroUnitsPerPersonUtcMonth: ceiling,\n usdMicroUnitsPerOrganizationUtcMonth: ceiling,\n },\n { additionalProperties: false },\n ),\n capabilities: capabilities,\n priceProfile: priceProfile,\n bootstrap: bootstrap,\n evaluationInputs: evaluationInputs,\n },\n { additionalProperties: false },\n);\nconst signature = Type.Object(\n {\n algorithm: Type.Literal(\"Ed25519\"),\n keyClass: Type.Union([\n Type.Literal(\"synthetic-test-only\"),\n Type.Literal(\"human-authority\"),\n Type.Literal(\"release-automation\"),\n ]),\n publicKeyHex: Type.String({ pattern: \"^[0-9a-f]{64}$\" }),\n signatureHex: Type.String({ pattern: \"^[0-9a-f]{128}$\" }),\n },\n { additionalProperties: false },\n);\nconst signedLawBundle = Type.Object(\n {\n schemaVersion: Type.Literal(1),\n kind: Type.Union([\n Type.Literal(\"dsg.infra.signed-law\"),\n Type.Literal(\"dsg.infra.signed-law-fixture\"),\n ]),\n testOnly: Type.Boolean(),\n deployedAuthority: Type.Boolean(),\n payload: lawDocument,\n canonicalPayload: Type.String({ minLength: 1 }),\n payloadSha256: Type.String({ pattern: \"^[0-9a-f]{64}$\" }),\n canonicalSignatureInput: Type.String({ minLength: 1 }),\n signature: signature,\n },\n { additionalProperties: false },\n);\nexport const SignedLawBundleSchema = signedLawBundle;\nexport type SignedLawBundle = Static<typeof SignedLawBundleSchema>;\n\nexport const signedLawV1: ProfileEntry = {\n literal: SIGNED_LAW_PROFILE,\n literalNote:\n \"carried as the domain member of the canonical signature input, not as a bundle field\",\n shapes: { bundle: SignedLawBundleSchema },\n};\n","// dsg.infra.adoption-fact/1\n// Owner: dsg-infra (governance/adoption.py is the producer: it verifies an\n// exported kernel bootstrap record snapshot offline - canonical digest,\n// event hash chain, stream heads, artifact bytes - and emits the accepted\n// root-authorizing operation as this fact). The tofu baseline root\n// consumes it and re-validates independently: its deployment-specific\n// conditions (which root string, testOnly false for the real baseline)\n// are that root's own law, deliberately NOT part of this shape - a\n// synthetic testOnly fact is a valid FACT, just never a valid deployed\n// authorization.\n//\n// Lifted from dsg-infra governance/adoption.py at e9d9501 and\n// infrastructure/environments/dsg-run/adoption.tf (S01, commit fccf709).\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { closed, Hex64, NonEmptyString, Orn, type ProfileEntry } from \"../primitives.js\";\n\nexport const ADOPTION_FACT_PROFILE = \"dsg.infra.adoption-fact/1\" as const;\n\nconst AdoptionFactSchemaValue = closed({\n profile: Type.Literal(ADOPTION_FACT_PROFILE),\n /** The root the record names as active baseline owner. */\n root: NonEmptyString,\n lineage: NonEmptyString,\n /** The accepted root-authorizing operation. */\n operation: NonEmptyString,\n /** Count of accepted root operations; ownership needs at least one. */\n generation: Type.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER }),\n /** Canonical digest of the verified record snapshot. */\n snapshotSha256: Hex64,\n /** initialize establishes the first owner; cutover transfers it. restore\n * and enrollment move custody and human roots, never root ownership. */\n action: Type.Union([\n Type.Literal(\"initialize_kernel_record\"),\n Type.Literal(\"cutover_single_writer\"),\n ]),\n signer: Orn,\n humanRoot: NonEmptyString,\n testOnly: Type.Boolean(),\n});\nexport const AdoptionFactSchema: typeof AdoptionFactSchemaValue = AdoptionFactSchemaValue;\nexport type AdoptionFact = Static<typeof AdoptionFactSchema>;\n\nexport const adoptionFactV1: ProfileEntry = {\n literal: ADOPTION_FACT_PROFILE,\n rootShape: \"fact\",\n shapes: { fact: AdoptionFactSchema },\n};\n","// dsg.registry.revocations/1\n// Owner: dsg-infra-module-registry (the S03 trust producer). Signed,\n// monotonically versioned revocation snapshots with retained trust\n// history; timestamps are epoch seconds by frozen choice of /1 (recorded\n// in FROZEN_EXEMPTIONS; exact-second strings would be a /2).\n// Lifted verbatim from dsg-infra-module-registry src/revocation.ts at\n// 1f8c994.\nimport { Type, type Static } from \"@sinclair/typebox\";\nimport type { ProfileEntry } from \"../primitives.js\";\n\nexport const REVOCATIONS_PROFILE = \"dsg.registry.revocations/1\" as const;\n\nconst closed = { additionalProperties: false };\nconst text = Type.String({ minLength: 1 });\nconst digest = Type.String({ pattern: \"^[0-9a-f]{64}$\" });\nconst time = Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER });\n\nconst RevocationSchemaValue = Type.Object(\n {\n domain: Type.Literal(REVOCATIONS_PROFILE),\n version: Type.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER }),\n issuedAt: time,\n expiresAt: time,\n previousSha256: Type.Union([digest, Type.Null()]),\n testOnly: Type.Literal(true),\n signerKey: digest,\n revoked: Type.Array(\n Type.Object(\n {\n kind: Type.Union([\n Type.Literal(\"principal\"),\n Type.Literal(\"standing-order\"),\n Type.Literal(\"law\"),\n Type.Literal(\"class\"),\n Type.Literal(\"key\"),\n ]),\n id: text,\n effectiveAt: time,\n reason: text,\n },\n closed,\n ),\n ),\n trustHistory: Type.Array(\n Type.Object(\n {\n principal: text,\n publicKey: digest,\n role: Type.Union([\n Type.Literal(\"human\"),\n Type.Literal(\"release\"),\n Type.Literal(\"collector\"),\n ]),\n action: Type.Union([\n Type.Literal(\"enroll\"),\n Type.Literal(\"rotate\"),\n Type.Literal(\"compromise\"),\n ]),\n effectiveAt: time,\n authoritySha256: digest,\n replacesKey: Type.Union([digest, Type.Null()]),\n },\n closed,\n ),\n ),\n },\n closed,\n);\nexport const RevocationSchema: typeof RevocationSchemaValue = RevocationSchemaValue;\nexport type RevocationSnapshot = Static<typeof RevocationSchema>;\n\nconst RevocationPointerSchemaValue = Type.Object(\n {\n version: Type.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER }),\n sha256: digest,\n url: Type.String({ pattern: \"^/revocations/v/[1-9][0-9]*/snapshot\\\\.json$\" }),\n },\n closed,\n);\nexport const RevocationPointerSchema: typeof RevocationPointerSchemaValue =\n RevocationPointerSchemaValue;\nexport type RevocationPointer = Static<typeof RevocationPointerSchema>;\n\nexport const revocationsV1: ProfileEntry = {\n literal: REVOCATIONS_PROFILE,\n shapes: { snapshot: RevocationSchema, pointer: RevocationPointerSchema },\n};\n","// dsg.kernel.bootstrap/1\n// Owner: dsg-kernel (K14). The finite bootstrap intent: a signed,\n// single-use, expiring authorization for exactly one of four record\n// actions, binding plan and resource-spec digests. enroll_human_root\n// (M030) is the additive action that anchors ordinary-authority\n// enrollment; initialization is never reinterpreted as enrollment. The\n// record-held bootstrap event payloads stay in the kernel.\n//\n// Lifted verbatim from dsg-kernel packages/core/src/contracts.ts at\n// 00b33ac1. createdAt/expiresAt are frozen /1 nonempty strings, recorded\n// in FROZEN_EXEMPTIONS; exact-second patterns would be a /2 against\n// already-recorded signed intents.\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { closed, Hex64, NonEmptyString, Orn, type ProfileEntry } from \"../primitives.js\";\n\nexport const BOOTSTRAP_PROFILE = \"dsg.kernel.bootstrap/1\" as const;\n\nconst BootstrapActionSchemaValue = Type.Union([\n Type.Literal(\"initialize_kernel_record\"),\n Type.Literal(\"restore_kernel_record\"),\n Type.Literal(\"cutover_single_writer\"),\n Type.Literal(\"enroll_human_root\"),\n]);\nexport const BootstrapActionSchema: typeof BootstrapActionSchemaValue = BootstrapActionSchemaValue;\nexport type BootstrapAction = Static<typeof BootstrapActionSchema>;\n\nconst BootstrapIntentSchemaValue = closed({\n version: Type.Literal(BOOTSTRAP_PROFILE),\n operation: NonEmptyString,\n action: BootstrapActionSchema,\n lineage: NonEmptyString,\n humanRoot: NonEmptyString,\n signer: Orn,\n scope: NonEmptyString,\n resources: Type.Array(\n closed({\n identity: NonEmptyString,\n specSha256: Hex64,\n }),\n { minItems: 1, uniqueItems: true },\n ),\n planSha256: Hex64,\n preconditionsSha256: Hex64,\n createdAt: NonEmptyString,\n expiresAt: NonEmptyString,\n maxUses: Type.Literal(1),\n cost: closed({\n currency: Type.Literal(\"USD\"),\n maxMicroUsd: Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER }),\n assumptionsSha256: Hex64,\n }),\n testOnly: Type.Boolean(),\n});\nexport const BootstrapIntentSchema: typeof BootstrapIntentSchemaValue = BootstrapIntentSchemaValue;\nexport type BootstrapIntent = Static<typeof BootstrapIntentSchema>;\n\nconst SignedBootstrapIntentSchemaValue = closed({\n body: BootstrapIntentSchema,\n signature: Type.String({ pattern: \"^[0-9a-f]{128}$\" }),\n});\nexport const SignedBootstrapIntentSchema: typeof SignedBootstrapIntentSchemaValue =\n SignedBootstrapIntentSchemaValue;\nexport type SignedBootstrapIntent = Static<typeof SignedBootstrapIntentSchema>;\n\nexport const bootstrapV1: ProfileEntry = {\n literal: BOOTSTRAP_PROFILE,\n shapes: { intent: BootstrapIntentSchema, signed: SignedBootstrapIntentSchema },\n};\n","// dsg.kernel.ordinary-authority/1\n// Owner: dsg-kernel (K02, M029/M030). The canonical ordinary-rights\n// artifact: who may issue law, exactly what they may permit, for how long,\n// and under which three ceilings. Closed and versioned; every set is an\n// explicit allow-list, never an omitted-means-unlimited default. A\n// verified finite enroll_human_root intent binds this document's digest as\n// both plan and resource spec. The revocation view a standing-order check\n// runs against stays in the kernel: independently supplied input, not a\n// wire document.\n//\n// Lifted verbatim from dsg-kernel packages/signing/src/enrollment.ts at\n// 00b33ac1.\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { closed, Hex64, NonEmptyString, Orn, UtcSecond, type ProfileEntry } from \"../primitives.js\";\n\nexport const ORDINARY_AUTHORITY_PROFILE = \"dsg.kernel.ordinary-authority/1\" as const;\n\nconst names = Type.Array(NonEmptyString, { minItems: 1, uniqueItems: true });\nconst ceilingValue = Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER });\n\nconst OrdinaryAuthoritySchemaValue = closed({\n version: Type.Literal(ORDINARY_AUTHORITY_PROFILE),\n reference: NonEmptyString,\n actor: Orn,\n publicKeyHex: Hex64,\n keyClass: Type.Union([Type.Literal(\"synthetic-test-only\"), Type.Literal(\"human-authority\")]),\n designation: closed({\n role: Type.Literal(\"law-issuer\"),\n designationReference: NonEmptyString,\n }),\n scope: closed({\n scopeReference: NonEmptyString,\n actions: names,\n workloadClasses: names,\n regions: names,\n }),\n validity: closed({ notBefore: UtcSecond, notAfter: UtcSecond }),\n ceilings: closed({\n gpuSecondsPerPersonUtcWeek: ceilingValue,\n usdMicroUnitsPerPersonUtcMonth: ceilingValue,\n usdMicroUnitsPerOrganizationUtcMonth: ceilingValue,\n }),\n revoked: Type.Boolean(),\n});\nexport const OrdinaryAuthoritySchema: typeof OrdinaryAuthoritySchemaValue =\n OrdinaryAuthoritySchemaValue;\nexport type OrdinaryAuthority = Static<typeof OrdinaryAuthoritySchema>;\n\nexport const ordinaryAuthorityV1: ProfileEntry = {\n literal: ORDINARY_AUTHORITY_PROFILE,\n rootShape: \"authority\",\n shapes: { authority: OrdinaryAuthoritySchema },\n};\n","// In-process contract versions of the dsg-run plane. Under ruling I7 these\n// are NOT profiles: an executor or provider adapter is a TypeScript plugin\n// interface inside one process, with no serialized shape or digest of its\n// own - its documents (operation requests, descriptors) already have\n// profiles. The literals live here so no consumer repo defines a\n// dsg.*.*/N string and the CI grep stays absolute. When R06 gives\n// executors a real serialized job document, THAT becomes a profile module\n// beside this file.\nexport const EXECUTOR_PROTOCOL_VERSION = \"dsg.run.executor/1\" as const;\nexport type ExecutorProtocolVersion = typeof EXECUTOR_PROTOCOL_VERSION;\n\nexport const PROVIDER_PROTOCOL_VERSION = \"dsg.run.provider/1\" as const;\nexport type ProviderProtocolVersion = typeof PROVIDER_PROTOCOL_VERSION;\n","// dsg.run.event/1\n// Owner: dsg-run (the plane ingests, stores, streams, and seals) with the\n// emitting library as the other side of the seam.\n//\n// One event a running workload emitted about itself. The workload writes\n// these as single JSON lines on standard output, prefixed `DSGEV `, and\n// knows nothing about how they travel: the executor that ran the job is\n// the only thing that knows where its output went.\n//\n// Two things are closed and two are open by design. The ENVELOPE is\n// closed: an unknown envelope field is a different protocol. The PAYLOAD\n// is open here and closed by the catalog the emitter declared and the\n// request pinned by digest - the plane validates the payload against that\n// catalog, so this profile does not need to know a modeler's vocabulary\n// to refuse an invalid instance of it.\n//\n// Ordering is the sequence number, never arrival and never the clock: a\n// transport may duplicate or reorder, and the stored stream is the same\n// either way. A gap is recorded as a fact, not smoothed over.\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport {\n closed,\n Hex64,\n NonEmptyString,\n SafeInt,\n UtcSecond,\n type ProfileEntry,\n} from \"../primitives.js\";\n\nexport const EVENT_PROFILE = \"dsg.run.event/1\" as const;\n\n/** The wire prefix that lets a collector pick these lines out of ordinary\n * job logs. One space, then the JSON object, then a newline. */\nexport const EVENT_LINE_PREFIX = \"DSGEV \" as const;\n\n/** The lifecycle spine every catalog carries without declaring it: the\n * kinds the console draws for any workload, whatever it models. A\n * workload emitting only started and finished is fully described. */\nexport const LIFECYCLE_KINDS = [\n \"started\",\n \"phase.entered\",\n \"phase.exited\",\n \"progress\",\n \"checkpoint\",\n \"artifact\",\n \"warning\",\n \"failure\",\n \"finished\",\n] as const;\n\nconst EventSchemaValue = closed({\n profile: Type.Literal(EVENT_PROFILE),\n /** The operation this event belongs to; injected into the job's\n * environment by the plane, never chosen by the workload. */\n operation: NonEmptyString,\n /** Monotonic within one operation, from 1. Ordering lives here. */\n sequence: Type.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER }),\n at: UtcSecond,\n /** A lifecycle kind or one the pinned catalog declares. */\n kind: NonEmptyString,\n /** Digest of the catalog the payload validates against. */\n catalogSha256: Hex64,\n /** Validated against the catalog by digest, not by this schema: a\n * modeler's vocabulary is theirs, and the plane refuses a payload the\n * catalog does not admit. Artifacts are references, never contents. */\n payload: Type.Record(Type.String(), Type.Unknown()),\n});\nexport const EventSchema: typeof EventSchemaValue = EventSchemaValue;\nexport type Event = Static<typeof EventSchema>;\n\n/** What the plane seals into the outcome: the ordered stream's own digest,\n * the catalog it validated against, and the count - enough for an\n * offline reader holding the exported stream to recompute the verdict\n * without the plane. `truncatedAtSequence` is the event ceiling's mark:\n * a runaway logger is bounded, and the bound is visible rather than a\n * silently short stream. */\nconst EventStreamSealSchemaValue = closed({\n profile: Type.Literal(EVENT_PROFILE),\n operation: NonEmptyString,\n catalogSha256: Hex64,\n /** sha256 over the newline-joined canonical event lines, in sequence. */\n streamSha256: Hex64,\n eventCount: SafeInt,\n /** Sequence numbers missing from an otherwise ordered stream. */\n gaps: Type.Array(Type.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER })),\n truncatedAtSequence: Type.Union([Type.Integer({ minimum: 1 }), Type.Null()]),\n});\nexport const EventStreamSealSchema: typeof EventStreamSealSchemaValue = EventStreamSealSchemaValue;\nexport type EventStreamSeal = Static<typeof EventStreamSealSchema>;\n\nexport const eventV1: ProfileEntry = {\n literal: EVENT_PROFILE,\n rootShape: \"event\",\n shapes: { event: EventSchema, streamSeal: EventStreamSealSchema },\n};\n","export { closed, Hex64, NonEmptyString, Orn, Reference, SafeInt, UtcSecond } from \"./primitives.js\";\nexport type { ProfileEntry } from \"./primitives.js\";\nexport {\n DISPATCH_CONSUME_PROFILE,\n DISPATCH_MAX_SKEW_SECONDS,\n DispatchConsumeRequestSchema,\n DispatchLeaseSchema,\n DispatchRefusalCodeSchema,\n DispatchRefusalSchema,\n} from \"./kernel/dispatch-consume.v1.js\";\nexport type {\n DispatchConsumeRequest,\n DispatchLease,\n DispatchRefusal,\n DispatchRefusalCode,\n} from \"./kernel/dispatch-consume.v1.js\";\nexport {\n AcceptedSchema,\n ExecutionDocumentSchema,\n ExecutionLawSchema,\n ExecutionResourcesSchema,\n OPERATION_PROFILE,\n OperationBeforeSchema,\n OperationCleanupSchema,\n OperationCostSchema,\n OperationEvidenceSchema,\n OperationExecutionSchema,\n OperationRequestSchema,\n OperationStatusSchema,\n ReadbackSchema,\n} from \"./run/operation.v1.js\";\nexport type {\n Accepted,\n ExecutionDocument,\n ExecutionLaw,\n ExecutionResources,\n OperationBefore,\n OperationCleanup,\n OperationCost,\n OperationEvidence,\n OperationExecution,\n OperationRequest,\n OperationStatus,\n Readback,\n} from \"./run/operation.v1.js\";\nexport {\n PRICE_PROFILE_REFERENCE,\n SCOPE_REFERENCE,\n SIGNED_LAW_DOMAIN,\n SIGNED_LAW_PROFILE,\n SignedLawBundleSchema,\n} from \"./infra/signed-law.v1.js\";\nexport {\n RESOURCE_DESCRIPTOR_KIND,\n RESOURCE_DESCRIPTOR_PROFILE,\n ResourceDescriptorSchema,\n} from \"./infra/resource-descriptor.v1.js\";\nexport type { ResourceDescriptor } from \"./infra/resource-descriptor.v1.js\";\nexport { ADOPTION_FACT_PROFILE, AdoptionFactSchema } from \"./infra/adoption-fact.v1.js\";\nexport type { AdoptionFact } from \"./infra/adoption-fact.v1.js\";\nexport type { SignedLawBundle } from \"./infra/signed-law.v1.js\";\nexport {\n REVOCATIONS_PROFILE,\n RevocationPointerSchema,\n RevocationSchema,\n} from \"./registry/revocations.v1.js\";\nexport type { RevocationPointer, RevocationSnapshot } from \"./registry/revocations.v1.js\";\nexport {\n BOOTSTRAP_PROFILE,\n BootstrapActionSchema,\n BootstrapIntentSchema,\n SignedBootstrapIntentSchema,\n} from \"./kernel/bootstrap.v1.js\";\nexport type {\n BootstrapAction,\n BootstrapIntent,\n SignedBootstrapIntent,\n} from \"./kernel/bootstrap.v1.js\";\nexport {\n ORDINARY_AUTHORITY_PROFILE,\n OrdinaryAuthoritySchema,\n} from \"./kernel/ordinary-authority.v1.js\";\nexport type { OrdinaryAuthority } from \"./kernel/ordinary-authority.v1.js\";\nexport { EXECUTOR_PROTOCOL_VERSION, PROVIDER_PROTOCOL_VERSION } from \"./run/contract-versions.js\";\nexport type { ExecutorProtocolVersion, ProviderProtocolVersion } from \"./run/contract-versions.js\";\nexport {\n EVENT_PROFILE,\n EVENT_LINE_PREFIX,\n LIFECYCLE_KINDS,\n EventSchema,\n EventStreamSealSchema,\n} from \"./run/event.v1.js\";\nexport type { Event, EventStreamSeal } from \"./run/event.v1.js\";\n\nimport type { ProfileEntry } from \"./primitives.js\";\nimport { dispatchConsumeV1 } from \"./kernel/dispatch-consume.v1.js\";\nimport { operationV1 } from \"./run/operation.v1.js\";\nimport { eventV1 } from \"./run/event.v1.js\";\nimport { signedLawV1 } from \"./infra/signed-law.v1.js\";\nimport { resourceDescriptorV1 } from \"./infra/resource-descriptor.v1.js\";\nimport { adoptionFactV1 } from \"./infra/adoption-fact.v1.js\";\nimport { revocationsV1 } from \"./registry/revocations.v1.js\";\nimport { bootstrapV1 } from \"./kernel/bootstrap.v1.js\";\nimport { ordinaryAuthorityV1 } from \"./kernel/ordinary-authority.v1.js\";\n\n/** Every profile this version of the package defines, keyed by literal.\n * Profile modules are added here as they are extracted; the rules test\n * and the schema emitter walk this registry, so a module that is not\n * registered does not exist. */\nexport const PROFILES: Readonly<Record<string, ProfileEntry>> = {\n [dispatchConsumeV1.literal]: dispatchConsumeV1,\n [operationV1.literal]: operationV1,\n [eventV1.literal]: eventV1,\n [signedLawV1.literal]: signedLawV1,\n [resourceDescriptorV1.literal]: resourceDescriptorV1,\n [adoptionFactV1.literal]: adoptionFactV1,\n [rev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,QAAQ;EAAE,OAAO;EAAa,YAAY;CAAsB;AAClE;;;;;;;ACeA,MAAa,WAAmD;EAC7D,kBAAkB,UAAU;EAC5B,YAAY,UAAU;EACtB,QAAQ,UAAU;EAClB,YAAY,UAAU;EACtB,qBAAqB,UAAU;EAC/B,eAAe,UAAU;EACzB,cAAc,UAAU;EACxB,YAAY,UAAU;EACtB,oBAAoB,UAAU;AACjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamicalsystems/idl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "The DSG governed compute plane wire profiles: TypeBox schemas, profile literals, and Static types for every dsg.*.*/N shape. One meaning per profile, frozen per version.",
|
|
5
5
|
"homepage": "https://github.com/DynamicalSystemsGroup/dsg-idl#readme",
|
|
6
6
|
"bugs": "https://github.com/DynamicalSystemsGroup/dsg-idl/issues",
|
|
@@ -38,25 +38,26 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsdown",
|
|
43
|
+
"prepack": "tsdown",
|
|
44
|
+
"check-types": "tsc --noEmit",
|
|
45
|
+
"lint": "oxlint --config ../../.oxlintrc.json --type-aware .",
|
|
46
|
+
"format:check": "oxfmt --check .",
|
|
47
|
+
"test": "vitest run"
|
|
48
|
+
},
|
|
41
49
|
"dependencies": {
|
|
42
50
|
"@dynamicalsystems/orn-schemas": "0.1.0",
|
|
43
|
-
"@sinclair/typebox": "
|
|
51
|
+
"@sinclair/typebox": "catalog:"
|
|
44
52
|
},
|
|
45
53
|
"devDependencies": {
|
|
46
|
-
"oxfmt": "
|
|
47
|
-
"oxlint": "
|
|
48
|
-
"tsdown": "
|
|
49
|
-
"typescript": "
|
|
50
|
-
"vitest": "
|
|
54
|
+
"oxfmt": "catalog:",
|
|
55
|
+
"oxlint": "catalog:",
|
|
56
|
+
"tsdown": "catalog:",
|
|
57
|
+
"typescript": "catalog:",
|
|
58
|
+
"vitest": "catalog:"
|
|
51
59
|
},
|
|
52
60
|
"engines": {
|
|
53
61
|
"node": ">=24"
|
|
54
|
-
},
|
|
55
|
-
"scripts": {
|
|
56
|
-
"build": "tsdown",
|
|
57
|
-
"check-types": "tsc --noEmit",
|
|
58
|
-
"lint": "oxlint --config ../../.oxlintrc.json --type-aware .",
|
|
59
|
-
"format:check": "oxfmt --check .",
|
|
60
|
-
"test": "vitest run"
|
|
61
62
|
}
|
|
62
|
-
}
|
|
63
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -83,10 +83,19 @@ export {
|
|
|
83
83
|
export type { OrdinaryAuthority } from "./kernel/ordinary-authority.v1.js";
|
|
84
84
|
export { EXECUTOR_PROTOCOL_VERSION, PROVIDER_PROTOCOL_VERSION } from "./run/contract-versions.js";
|
|
85
85
|
export type { ExecutorProtocolVersion, ProviderProtocolVersion } from "./run/contract-versions.js";
|
|
86
|
+
export {
|
|
87
|
+
EVENT_PROFILE,
|
|
88
|
+
EVENT_LINE_PREFIX,
|
|
89
|
+
LIFECYCLE_KINDS,
|
|
90
|
+
EventSchema,
|
|
91
|
+
EventStreamSealSchema,
|
|
92
|
+
} from "./run/event.v1.js";
|
|
93
|
+
export type { Event, EventStreamSeal } from "./run/event.v1.js";
|
|
86
94
|
|
|
87
95
|
import type { ProfileEntry } from "./primitives.js";
|
|
88
96
|
import { dispatchConsumeV1 } from "./kernel/dispatch-consume.v1.js";
|
|
89
97
|
import { operationV1 } from "./run/operation.v1.js";
|
|
98
|
+
import { eventV1 } from "./run/event.v1.js";
|
|
90
99
|
import { signedLawV1 } from "./infra/signed-law.v1.js";
|
|
91
100
|
import { resourceDescriptorV1 } from "./infra/resource-descriptor.v1.js";
|
|
92
101
|
import { adoptionFactV1 } from "./infra/adoption-fact.v1.js";
|
|
@@ -101,6 +110,7 @@ import { ordinaryAuthorityV1 } from "./kernel/ordinary-authority.v1.js";
|
|
|
101
110
|
export const PROFILES: Readonly<Record<string, ProfileEntry>> = {
|
|
102
111
|
[dispatchConsumeV1.literal]: dispatchConsumeV1,
|
|
103
112
|
[operationV1.literal]: operationV1,
|
|
113
|
+
[eventV1.literal]: eventV1,
|
|
104
114
|
[signedLawV1.literal]: signedLawV1,
|
|
105
115
|
[resourceDescriptorV1.literal]: resourceDescriptorV1,
|
|
106
116
|
[adoptionFactV1.literal]: adoptionFactV1,
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// dsg.run.event/1
|
|
2
|
+
// Owner: dsg-run (the plane ingests, stores, streams, and seals) with the
|
|
3
|
+
// emitting library as the other side of the seam.
|
|
4
|
+
//
|
|
5
|
+
// One event a running workload emitted about itself. The workload writes
|
|
6
|
+
// these as single JSON lines on standard output, prefixed `DSGEV `, and
|
|
7
|
+
// knows nothing about how they travel: the executor that ran the job is
|
|
8
|
+
// the only thing that knows where its output went.
|
|
9
|
+
//
|
|
10
|
+
// Two things are closed and two are open by design. The ENVELOPE is
|
|
11
|
+
// closed: an unknown envelope field is a different protocol. The PAYLOAD
|
|
12
|
+
// is open here and closed by the catalog the emitter declared and the
|
|
13
|
+
// request pinned by digest - the plane validates the payload against that
|
|
14
|
+
// catalog, so this profile does not need to know a modeler's vocabulary
|
|
15
|
+
// to refuse an invalid instance of it.
|
|
16
|
+
//
|
|
17
|
+
// Ordering is the sequence number, never arrival and never the clock: a
|
|
18
|
+
// transport may duplicate or reorder, and the stored stream is the same
|
|
19
|
+
// either way. A gap is recorded as a fact, not smoothed over.
|
|
20
|
+
import { type Static, Type } from "@sinclair/typebox";
|
|
21
|
+
import {
|
|
22
|
+
closed,
|
|
23
|
+
Hex64,
|
|
24
|
+
NonEmptyString,
|
|
25
|
+
SafeInt,
|
|
26
|
+
UtcSecond,
|
|
27
|
+
type ProfileEntry,
|
|
28
|
+
} from "../primitives.js";
|
|
29
|
+
|
|
30
|
+
export const EVENT_PROFILE = "dsg.run.event/1" as const;
|
|
31
|
+
|
|
32
|
+
/** The wire prefix that lets a collector pick these lines out of ordinary
|
|
33
|
+
* job logs. One space, then the JSON object, then a newline. */
|
|
34
|
+
export const EVENT_LINE_PREFIX = "DSGEV " as const;
|
|
35
|
+
|
|
36
|
+
/** The lifecycle spine every catalog carries without declaring it: the
|
|
37
|
+
* kinds the console draws for any workload, whatever it models. A
|
|
38
|
+
* workload emitting only started and finished is fully described. */
|
|
39
|
+
export const LIFECYCLE_KINDS = [
|
|
40
|
+
"started",
|
|
41
|
+
"phase.entered",
|
|
42
|
+
"phase.exited",
|
|
43
|
+
"progress",
|
|
44
|
+
"checkpoint",
|
|
45
|
+
"artifact",
|
|
46
|
+
"warning",
|
|
47
|
+
"failure",
|
|
48
|
+
"finished",
|
|
49
|
+
] as const;
|
|
50
|
+
|
|
51
|
+
const EventSchemaValue = closed({
|
|
52
|
+
profile: Type.Literal(EVENT_PROFILE),
|
|
53
|
+
/** The operation this event belongs to; injected into the job's
|
|
54
|
+
* environment by the plane, never chosen by the workload. */
|
|
55
|
+
operation: NonEmptyString,
|
|
56
|
+
/** Monotonic within one operation, from 1. Ordering lives here. */
|
|
57
|
+
sequence: Type.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER }),
|
|
58
|
+
at: UtcSecond,
|
|
59
|
+
/** A lifecycle kind or one the pinned catalog declares. */
|
|
60
|
+
kind: NonEmptyString,
|
|
61
|
+
/** Digest of the catalog the payload validates against. */
|
|
62
|
+
catalogSha256: Hex64,
|
|
63
|
+
/** Validated against the catalog by digest, not by this schema: a
|
|
64
|
+
* modeler's vocabulary is theirs, and the plane refuses a payload the
|
|
65
|
+
* catalog does not admit. Artifacts are references, never contents. */
|
|
66
|
+
payload: Type.Record(Type.String(), Type.Unknown()),
|
|
67
|
+
});
|
|
68
|
+
export const EventSchema: typeof EventSchemaValue = EventSchemaValue;
|
|
69
|
+
export type Event = Static<typeof EventSchema>;
|
|
70
|
+
|
|
71
|
+
/** What the plane seals into the outcome: the ordered stream's own digest,
|
|
72
|
+
* the catalog it validated against, and the count - enough for an
|
|
73
|
+
* offline reader holding the exported stream to recompute the verdict
|
|
74
|
+
* without the plane. `truncatedAtSequence` is the event ceiling's mark:
|
|
75
|
+
* a runaway logger is bounded, and the bound is visible rather than a
|
|
76
|
+
* silently short stream. */
|
|
77
|
+
const EventStreamSealSchemaValue = closed({
|
|
78
|
+
profile: Type.Literal(EVENT_PROFILE),
|
|
79
|
+
operation: NonEmptyString,
|
|
80
|
+
catalogSha256: Hex64,
|
|
81
|
+
/** sha256 over the newline-joined canonical event lines, in sequence. */
|
|
82
|
+
streamSha256: Hex64,
|
|
83
|
+
eventCount: SafeInt,
|
|
84
|
+
/** Sequence numbers missing from an otherwise ordered stream. */
|
|
85
|
+
gaps: Type.Array(Type.Integer({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER })),
|
|
86
|
+
truncatedAtSequence: Type.Union([Type.Integer({ minimum: 1 }), Type.Null()]),
|
|
87
|
+
});
|
|
88
|
+
export const EventStreamSealSchema: typeof EventStreamSealSchemaValue = EventStreamSealSchemaValue;
|
|
89
|
+
export type EventStreamSeal = Static<typeof EventStreamSealSchema>;
|
|
90
|
+
|
|
91
|
+
export const eventV1: ProfileEntry = {
|
|
92
|
+
literal: EVENT_PROFILE,
|
|
93
|
+
rootShape: "event",
|
|
94
|
+
shapes: { event: EventSchema, streamSeal: EventStreamSealSchema },
|
|
95
|
+
};
|