@lapxo/bound 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/README.md +40 -121
  2. package/TARGET.bound +51 -23
  3. package/dist/cli/standing-result.js +4 -3
  4. package/dist/cli/verb.js +36 -3
  5. package/dist/engine/encoding.js +2 -0
  6. package/dist/engine/index.d.ts +2 -0
  7. package/dist/engine/index.js +2 -0
  8. package/dist/engine/ports.d.ts +32 -0
  9. package/dist/engine/ports.js +103 -0
  10. package/dist/host/admitted-place.js +6 -0
  11. package/dist/host/contextual-place.js +2 -2
  12. package/dist/host/io.js +2 -2
  13. package/dist/host/reference-authenticated.d.ts +12 -0
  14. package/dist/host/reference-authenticated.js +47 -31
  15. package/dist/host/reference-contracts.js +6 -0
  16. package/dist/host/reference-export.d.ts +33 -0
  17. package/dist/host/reference-export.js +81 -0
  18. package/dist/host/reference-native-api.d.ts +3 -0
  19. package/dist/host/reference-native-api.js +3 -0
  20. package/dist/host/reference-native.d.ts +21 -1
  21. package/dist/host/reference-native.js +34 -10
  22. package/dist/host/reference-profile.js +2 -1
  23. package/dist/host/reference-standing.js +18 -0
  24. package/dist/host/refusals.d.ts +14 -0
  25. package/dist/host/refusals.js +43 -0
  26. package/dist/host/signing.js +7 -1
  27. package/dist/observe/files.js +11 -1
  28. package/dist/wasm/object.js +2 -2
  29. package/docs/contracts/authenticated-reference.publication.json +2 -2
  30. package/docs/contracts/host-ports.md +23 -0
  31. package/docs/contracts/host-ports.publication.json +25 -0
  32. package/docs/contracts/native-publication.inventory.json +7 -1
  33. package/docs/contracts/optional-wasm-adapter.publication.json +1 -1
  34. package/docs/contracts/readme.publication.json +25 -0
  35. package/docs/contracts/reference-backend.md +24 -0
  36. package/docs/contracts/reference-backend.publication.json +25 -0
  37. package/docs/contracts/reference-export.md +31 -0
  38. package/docs/contracts/reference-export.publication.json +25 -0
  39. package/docs/contracts/reference-port.md +8 -1
  40. package/docs/contracts/reference-port.publication.json +1 -1
  41. package/docs/contracts/refusals.bound +94 -0
  42. package/docs/contracts/refusals.md +47 -0
  43. package/docs/contracts/refusals.publication.json +25 -0
  44. package/docs/contracts/standing.bound +9 -0
  45. package/docs/contracts/standing.md +24 -0
  46. package/docs/contracts/standing.publication.json +25 -0
  47. package/package.json +49 -4
  48. package/receipts.bound +9550 -7668
  49. package/samples/authenticated-reference/compatibility.json +306 -0
  50. package/samples/authenticated-reference/yes.json +2 -2
  51. package/samples/host-ports/no.json +16 -0
  52. package/samples/host-ports/yes.json +9 -0
  53. package/samples/readme/no.json +1 -0
  54. package/samples/readme/yes.json +1 -0
  55. package/samples/reference-backend/no.json +1 -0
  56. package/samples/reference-backend/world-fixture.json +8 -0
  57. package/samples/reference-backend/yes.json +1 -0
  58. package/samples/reference-export/no.json +5 -0
  59. package/samples/reference-export/yes.json +15 -0
  60. package/samples/reference-port/no/catalog/TARGET.bound +33 -0
  61. package/samples/reference-port/no/route-notes/TARGET.bound +33 -0
  62. package/samples/refusals/no.json +4 -0
  63. package/samples/refusals/yes.json +9 -0
  64. package/samples/standing/no.json +4 -0
  65. package/samples/standing/yes.json +21 -0
  66. package/vectors/native/authenticated-reference-formation.vector.json +55 -1
  67. package/vectors/native/authenticated-reference.vector.json +32 -396
  68. package/vectors/native/host-ports.vector.json +107 -0
  69. package/vectors/native/readme.vector.json +76 -0
  70. package/vectors/native/reference-backend.vector.json +84 -0
  71. package/vectors/native/reference-export.vector.json +78 -0
  72. package/vectors/native/refusals.vector.json +95 -0
  73. package/vectors/native/standing.vector.json +116 -0
  74. package/vectors/wasm-object.cli.json +16 -61
  75. package/dist/cli/accept.d.ts +0 -28
  76. package/dist/cli/act-result.d.ts +0 -12
  77. package/dist/cli/args.d.ts +0 -11
  78. package/dist/cli/custodian.d.ts +0 -1
  79. package/dist/cli/host.d.ts +0 -1
  80. package/dist/cli/names.d.ts +0 -25
  81. package/dist/cli/native-descendant.d.ts +0 -1
  82. package/dist/cli/native.d.ts +0 -1
  83. package/dist/cli/observe.d.ts +0 -1
  84. package/dist/cli/owner.d.ts +0 -37
  85. package/dist/cli/pass.d.ts +0 -6
  86. package/dist/cli/place.d.ts +0 -76
  87. package/dist/cli/release-result.d.ts +0 -5
  88. package/dist/cli/standing-result.d.ts +0 -5
  89. package/dist/cli/takes.d.ts +0 -30
  90. package/dist/fold/admission-history.d.ts +0 -6
  91. package/dist/fold/ceilings.d.ts +0 -24
  92. package/dist/fold/claims.d.ts +0 -29
  93. package/dist/fold/closed.d.ts +0 -15
  94. package/dist/fold/configures.d.ts +0 -4
  95. package/dist/fold/digests.d.ts +0 -29
  96. package/dist/fold/evidence.d.ts +0 -32
  97. package/dist/fold/fold-worker.d.ts +0 -1
  98. package/dist/fold/kept.d.ts +0 -29
  99. package/dist/fold/keys.d.ts +0 -17
  100. package/dist/fold/laid.d.ts +0 -17
  101. package/dist/fold/nos.d.ts +0 -8
  102. package/dist/fold/object.d.ts +0 -3
  103. package/dist/fold/observed.d.ts +0 -35
  104. package/dist/fold/opened.d.ts +0 -5
  105. package/dist/fold/own.d.ts +0 -24
  106. package/dist/fold/paid.d.ts +0 -11
  107. package/dist/fold/place-inputs.d.ts +0 -17
  108. package/dist/fold/places.d.ts +0 -24
  109. package/dist/fold/rank.d.ts +0 -3
  110. package/dist/fold/reach.d.ts +0 -18
  111. package/dist/fold/readers.d.ts +0 -47
  112. package/dist/fold/receipts.d.ts +0 -8
  113. package/dist/fold/region-declarations.d.ts +0 -2
  114. package/dist/fold/region.d.ts +0 -72
  115. package/dist/fold/release-policy.d.ts +0 -67
  116. package/dist/fold/resolved.d.ts +0 -18
  117. package/dist/fold/roles.d.ts +0 -17
  118. package/dist/fold/second.d.ts +0 -18
  119. package/dist/fold/shards.d.ts +0 -29
  120. package/dist/fold/signed.d.ts +0 -23
  121. package/dist/fold/signers.d.ts +0 -24
  122. package/dist/fold/stranger.d.ts +0 -3
  123. package/dist/fold/views.d.ts +0 -27
  124. package/dist/fold/wire.d.ts +0 -19
  125. package/dist/fold/zoom.d.ts +0 -16
  126. package/dist/host/act-cost.d.ts +0 -13
  127. package/dist/host/adapters/keys/ed25519.d.ts +0 -7
  128. package/dist/host/adapters/modules/javascript.d.ts +0 -3
  129. package/dist/host/adapters/transport/http.d.ts +0 -5
  130. package/dist/host/admitted-place.d.ts +0 -5
  131. package/dist/host/archive.d.ts +0 -11
  132. package/dist/host/capsule-process.d.ts +0 -21
  133. package/dist/host/capsule.d.ts +0 -19
  134. package/dist/host/cell-receipts.d.ts +0 -2
  135. package/dist/host/content-needed.d.ts +0 -5
  136. package/dist/host/content-store.d.ts +0 -8
  137. package/dist/host/contextual-place.d.ts +0 -59
  138. package/dist/host/digest.d.ts +0 -3
  139. package/dist/host/hash.d.ts +0 -9
  140. package/dist/host/io.d.ts +0 -11
  141. package/dist/host/lifetime.d.ts +0 -1
  142. package/dist/host/located.d.ts +0 -4
  143. package/dist/host/native/bounded-file.d.ts +0 -8
  144. package/dist/host/native/command.d.ts +0 -36
  145. package/dist/host/native/control-bridge-worker.d.ts +0 -1
  146. package/dist/host/native/control-bridge.d.ts +0 -30
  147. package/dist/host/native/control-selection.d.ts +0 -29
  148. package/dist/host/native/custody.d.ts +0 -5
  149. package/dist/host/native/deadline.d.ts +0 -12
  150. package/dist/host/native/descendants.d.ts +0 -1
  151. package/dist/host/native/generated-custodian.d.ts +0 -122
  152. package/dist/host/native/generated.d.ts +0 -217
  153. package/dist/host/native/image.d.ts +0 -36
  154. package/dist/host/native/jobs.d.ts +0 -75
  155. package/dist/host/native/loader.d.ts +0 -80
  156. package/dist/host/native/materialize.d.ts +0 -22
  157. package/dist/host/native/module-closure.d.ts +0 -27
  158. package/dist/host/native/module-syntax.d.ts +0 -8
  159. package/dist/host/native/native-binary.d.ts +0 -54
  160. package/dist/host/native/native-program.d.ts +0 -56
  161. package/dist/host/native/node-jobs.d.ts +0 -84
  162. package/dist/host/native/node-launch.d.ts +0 -72
  163. package/dist/host/native/preload.d.ts +0 -1
  164. package/dist/host/native/reading.d.ts +0 -91
  165. package/dist/host/native/receipt-environment.d.ts +0 -3
  166. package/dist/host/native/references.d.ts +0 -5
  167. package/dist/host/native/root.d.ts +0 -17
  168. package/dist/host/native/route.d.ts +0 -66
  169. package/dist/host/native/runtime.d.ts +0 -4
  170. package/dist/host/native-reader-context.d.ts +0 -3
  171. package/dist/host/objects.d.ts +0 -6
  172. package/dist/host/place-clock-selection.d.ts +0 -55
  173. package/dist/host/ports/ingress.d.ts +0 -24
  174. package/dist/host/ports/local-act.d.ts +0 -44
  175. package/dist/host/ports/place-act.d.ts +0 -46
  176. package/dist/host/ports/publication.d.ts +0 -10
  177. package/dist/host/ports/signing.d.ts +0 -31
  178. package/dist/host/ports/store.d.ts +0 -2
  179. package/dist/host/ports/transport.d.ts +0 -1
  180. package/dist/host/process-lifetime.d.ts +0 -11
  181. package/dist/host/provide.d.ts +0 -48
  182. package/dist/host/read-only.d.ts +0 -3
  183. package/dist/host/reading-closures.d.ts +0 -47
  184. package/dist/host/reading-context.d.ts +0 -29
  185. package/dist/host/reference.d.ts +0 -6
  186. package/dist/host/release.d.ts +0 -14
  187. package/dist/host/root-clock-source.d.ts +0 -85
  188. package/dist/host/selected-capsules.d.ts +0 -8
  189. package/dist/host/selected-topos.d.ts +0 -24
  190. package/dist/host/signing.d.ts +0 -3
  191. package/dist/host/source-content.d.ts +0 -12
  192. package/dist/host/timing.d.ts +0 -2
  193. package/dist/host/walk.d.ts +0 -6
  194. package/dist/judge/late.d.ts +0 -7
  195. package/dist/judge/take.d.ts +0 -59
  196. package/dist/judge/widening.d.ts +0 -1
  197. package/dist/land/act.d.ts +0 -30
  198. package/dist/land/alias.d.ts +0 -10
  199. package/dist/land/held.d.ts +0 -7
  200. package/dist/land/inert.d.ts +0 -26
  201. package/dist/land/leaving.d.ts +0 -14
  202. package/dist/land/ledger.d.ts +0 -33
  203. package/dist/land/owned.d.ts +0 -23
  204. package/dist/land/sign.d.ts +0 -15
  205. package/dist/land/standing-pin.d.ts +0 -3
  206. package/dist/land/vouched.d.ts +0 -21
  207. package/dist/land/withdraw.d.ts +0 -14
  208. package/dist/observe/files.d.ts +0 -14
  209. package/dist/observe/identity.d.ts +0 -21
  210. package/dist/observe/match.d.ts +0 -1
  211. package/dist/observe/regions.d.ts +0 -33
  212. package/dist/observe/run.d.ts +0 -31
  213. package/dist/observe/runner.d.ts +0 -20
  214. package/dist/render/capsule.d.ts +0 -24
  215. package/dist/render/field.d.ts +0 -3
  216. package/dist/render/names.d.ts +0 -3
  217. package/dist/render/open.d.ts +0 -27
  218. package/dist/render/page.d.ts +0 -3
  219. package/dist/render/receipts.d.ts +0 -3
  220. package/dist/render/shape.d.ts +0 -16
  221. package/dist/render/target.d.ts +0 -18
  222. package/dist/render/view.d.ts +0 -22
  223. package/dist/wasm/node-worker.d.ts +0 -1
  224. package/dist/wasm/object.d.ts +0 -8
  225. package/dist/wasm/worker.d.ts +0 -1
@@ -1,54 +0,0 @@
1
- import { type RootStanding } from './reading.ts';
2
- import { type ParentExecution } from './generated.ts';
3
- interface NativeBinaryFields {
4
- coordinate: string;
5
- alias: string;
6
- selector: {
7
- port: string;
8
- binding: string;
9
- implementation: string;
10
- };
11
- entry: {
12
- path: string;
13
- digest: string;
14
- bytes: number;
15
- };
16
- limits: {
17
- bytes: number;
18
- };
19
- condition: string;
20
- }
21
- export type NativeBinaryProfile = NativeBinaryFields & ({
22
- profile: 'host-native-binary@1';
23
- } | {
24
- profile: 'host-native-binary-origin@1';
25
- origin: string;
26
- });
27
- export interface NativeBinaryOrigin {
28
- readonly coordinate: string;
29
- readonly line: string;
30
- readonly path: string;
31
- }
32
- /** A Root-selected local origin is a location constraint, not a World hint. */
33
- export declare function hostOriginPath(root: RootStanding, coordinate: string): NativeBinaryOrigin;
34
- export declare function nativeBinaryOrigin(root: RootStanding, p: NativeBinaryProfile, portLine: string): NativeBinaryOrigin | undefined;
35
- export interface VerifiedNativeBinary {
36
- readonly identity: string;
37
- }
38
- export interface NativeBinaryProjection {
39
- kind: 'native-binary';
40
- alias: string;
41
- entry: string;
42
- entryDigest: string;
43
- entryBytes: number;
44
- condition: string;
45
- }
46
- /** Call under the existing Root guard; privateBinding is from the already
47
- * prepared host image, never the candidate profile's own expected digest. */
48
- export declare function verifyNativeBinary(root: RootStanding, coordinate: string, parent: ParentExecution, privateBinding: {
49
- coordinate: string;
50
- path: string;
51
- digest: string;
52
- }): VerifiedNativeBinary;
53
- export declare const nativeBinaryProjection: (handle: VerifiedNativeBinary) => NativeBinaryProjection;
54
- export {};
@@ -1,56 +0,0 @@
1
- import { type RootStanding } from './reading.ts';
2
- import { type ParentExecution } from './generated.ts';
3
- export interface NativeProgramProfile {
4
- profile: 'host-native-program@1';
5
- coordinate: string;
6
- alias: string;
7
- selector: {
8
- port: string;
9
- binding: string;
10
- implementation: string;
11
- };
12
- interpreter: {
13
- path: string;
14
- digest: string;
15
- bytes: number;
16
- };
17
- root: string;
18
- entry: string;
19
- members: readonly {
20
- coordinate: string;
21
- digest: string;
22
- bytes: number;
23
- }[];
24
- limits: {
25
- members: number;
26
- bytes: number;
27
- };
28
- condition: string;
29
- }
30
- export interface VerifiedNativeProgram {
31
- readonly identity: string;
32
- }
33
- export interface NativeProgramProjection {
34
- alias: string;
35
- interpreter: string;
36
- interpreterDigest: string;
37
- entry: string;
38
- root: string;
39
- members: readonly {
40
- path: string;
41
- digest: string;
42
- }[];
43
- condition: string;
44
- }
45
- export declare function verifyNativeProgram(root: RootStanding, coordinate: string, parent: ParentExecution, runtimeBinding: {
46
- coordinate: string;
47
- path: string;
48
- digest: string;
49
- members: readonly {
50
- coordinate: string;
51
- path: string;
52
- }[];
53
- }): VerifiedNativeProgram;
54
- /** Only the guarded instrument can obtain this from a verified opaque handle.
55
- * Put it in the signed native image; never accept it from a world proposal. */
56
- export declare const nativeProgramProjection: (handle: VerifiedNativeProgram) => NativeProgramProjection;
@@ -1,84 +0,0 @@
1
- import type { CommandPort } from '@lapxo/topos/contract';
2
- import type { Declaration } from './loader.ts';
3
- import { type Handoff } from './jobs.ts';
4
- export interface Location {
5
- member: string;
6
- path: string;
7
- kind: 'binary' | 'module' | 'data';
8
- }
9
- export interface NodeImage {
10
- cwd: string;
11
- condition: string;
12
- runtime: string;
13
- preload?: string;
14
- nativePreloadMembers: readonly string[];
15
- commandPort?: CommandPort;
16
- hostLoader?: {
17
- declaration: Declaration;
18
- entries: readonly string[];
19
- preload: string;
20
- };
21
- locations: readonly Location[];
22
- }
23
- /** Observation of a completed inner command. A nonzero exit is data, never
24
- * silently converted into effect success; its meaning belongs to the reader. */
25
- export interface CapturedCommand {
26
- exitStatus: number;
27
- stdout: string;
28
- stderr: string;
29
- }
30
- export interface PreparedNodeImage {
31
- readonly identity: string;
32
- }
33
- /** Image/runtime condition and locations are instrument-admitted inputs, selected
34
- * before requests. Condition includes trusted Node builtins/platform libraries;
35
- * a binary's file digest alone does not seal every dynamic platform library. */
36
- export declare function prepareNodeImage(input: Handoff, inputImage: NodeImage): PreparedNodeImage;
37
- /** Exact expectations from the same opaque host image used by execution. */
38
- export declare function plannedJobs(handle: PreparedNodeImage, request: Uint8Array): readonly {
39
- id: string;
40
- identity: string;
41
- }[];
42
- /** Instrument-only producer lineage from the SAME private planned job used by
43
- * executeJobs. No fixture may invent an identity or reset shared custody. */
44
- export interface ParentExecution {
45
- identity: string;
46
- port: string;
47
- binding: string;
48
- implementation: string;
49
- instrument: string;
50
- policy: string;
51
- authority: string;
52
- inputs: readonly (readonly [string, string])[];
53
- environment: readonly (readonly [string, string])[];
54
- argv: readonly string[];
55
- cwd: string;
56
- runtime: string;
57
- timeoutMs: number;
58
- responseBytes: number;
59
- }
60
- export declare function plannedParentExecutions(handle: PreparedNodeImage, request: Uint8Array): readonly ParentExecution[];
61
- /** Root-owned execution resource, constructed from authenticated producer selection
62
- * under the authority guard. This is not a packet verifier or world callback. */
63
- export interface RootJobCustody {
64
- open(parent: ParentExecution): Promise<{
65
- assertClosed(): void;
66
- close(): Promise<void>;
67
- descendant?: unknown;
68
- }>;
69
- }
70
- /** No partial member escapes a failed batch. Uses the existing bounded async
71
- * child-group executor; worker launcher is itself an exact selected module. */
72
- export declare function executeJobs(handle: PreparedNodeImage, request: Uint8Array, options: {
73
- phase: 'act' | 'selection' | 'help' | 'check' | 'preview' | 'sign';
74
- signal?: AbortSignal;
75
- trace?: (event: {
76
- id: string;
77
- phase: 'start' | 'end';
78
- }) => void;
79
- custody?: RootJobCustody;
80
- }): Promise<readonly {
81
- id: string;
82
- identity: string;
83
- responses: readonly CapturedCommand[];
84
- }[]>;
@@ -1,72 +0,0 @@
1
- /** Parse the actual Node launch without rewriting argv or evaluating text.
2
- * Selection/authority and generated-member sealing belong to the Root host.
3
- * This is a deliberately finite native profile, not a JS sandbox. */
4
- export type NodeLaunch = {
5
- kind: 'eval';
6
- mode: 'commonjs' | 'module';
7
- text: string;
8
- args: readonly string[];
9
- imports: readonly string[];
10
- } | {
11
- kind: 'file';
12
- entry: string;
13
- args: readonly string[];
14
- imports: readonly string[];
15
- test: boolean;
16
- };
17
- export declare function nodeLaunch(args: readonly string[]): NodeLaunch;
18
- import type { NativeProgramProjection } from './native-program.ts';
19
- export interface SelectedInterpreter {
20
- readonly path: string;
21
- readonly digest: string;
22
- }
23
- export interface NativeProgramLaunch {
24
- readonly interpreter: string;
25
- readonly interpreterDigest: string;
26
- readonly entry: string;
27
- readonly args: readonly string[];
28
- }
29
- /** Only an exact, unique declared alias selects a native program. No PATH,
30
- * filename heuristics, option rewriting or consumer-specific names occur here. */
31
- export declare function projectNativeProgramLaunch(programs: readonly NativeProgramProjection[], program: string, args: readonly string[], runtime: SelectedInterpreter): NativeProgramLaunch;
32
- export interface NativeProgramParent {
33
- readonly parent: string;
34
- readonly root: string;
35
- readonly members: readonly {
36
- readonly path: string;
37
- readonly digest: string;
38
- }[];
39
- }
40
- /** Select a package-resolution context only for the exact reached parent member.
41
- * Root must validate the supplied parent digest against actual bytes first.
42
- * Node still performs actual resolution; Root checks the returned target digest
43
- * before handing it back. Merely sharing a path prefix grants no membership. */
44
- export declare function selectNativeProgramParent(programs: readonly NativeProgramProjection[], parent: {
45
- readonly path: string;
46
- readonly digest: string;
47
- }): NativeProgramParent;
48
- /** The fixed host receives this record only from the actual Root custodian's
49
- * retained before-fork evidence. This projection grants no new executable. */
50
- export interface NativeEvalActual {
51
- readonly argv: readonly string[];
52
- readonly rootPrefix: readonly string[];
53
- readonly cwd: string;
54
- readonly environment: readonly (readonly [string, string])[];
55
- readonly runtime: string;
56
- }
57
- export interface NativeEvalParent {
58
- readonly url: string;
59
- readonly context: string;
60
- readonly digest: string;
61
- readonly mode: 'module' | 'commonjs';
62
- }
63
- import type { DerivedExecutable } from './generated.ts';
64
- export declare function retainedNativeEvalMatches(record: DerivedExecutable, actual: NativeEvalActual): boolean;
65
- /** Exact Node CLI eval origin, not a file-pattern exception. A different URL
66
- * continues through ordinary physical-parent verification and refuses if absent.
67
- * Node's module and CommonJS CLI forms have distinct observed synthetic names. */
68
- export declare function nativeEvalParent(record: DerivedExecutable, actual: NativeEvalActual): NativeEvalParent;
69
- /** Non-authoritative discovery from Node's actual runtime options only. A false
70
- * result confers no permission: physical-parent/load checks remain unchanged.
71
- * Before-fork argv validation and exact retained-record matching are separate. */
72
- export declare function actualNodeEvalOptions(execArgv: readonly string[]): boolean;
@@ -1 +0,0 @@
1
- export {};
@@ -1,91 +0,0 @@
1
- import type { Signer } from '@lapxo/topos/wire';
2
- import type { Request, Response } from '@lapxo/topos/contract';
3
- import type { Asked } from '@lapxo/topos/capsule';
4
- import type { CommandPort } from '@lapxo/topos/contract';
5
- import { type NodeImage, type RootJobCustody } from './node-jobs.ts';
6
- import type { Handoff, Proposal } from './jobs.ts';
7
- export declare const canonicalJson: (value: unknown) => string;
8
- export interface RootStanding {
9
- readonly history: readonly string[];
10
- readonly live: readonly string[];
11
- readonly signer: Signer;
12
- readonly eras: readonly string[];
13
- readonly epoch: number;
14
- readonly budget: {
15
- readonly lines: number;
16
- readonly bytes: number;
17
- };
18
- }
19
- export interface PortProfile {
20
- readonly profile: 'host-native-reading@1';
21
- readonly port: CommandPort;
22
- readonly selection: {
23
- readonly archive: string;
24
- readonly entry: string;
25
- readonly reader: string;
26
- readonly loaderConfig: string;
27
- readonly runtime: string;
28
- readonly preload: string | null;
29
- readonly nativePreloadMembers: readonly string[];
30
- readonly condition: string;
31
- readonly budget: Handoff['budget'];
32
- readonly members: readonly {
33
- coordinate: string;
34
- digest: string;
35
- }[];
36
- readonly bindings: Handoff['bindings'];
37
- readonly loads: Handoff['loads'];
38
- };
39
- }
40
- export interface NativeReadingModule {
41
- readonly commands?: (asked: Asked) => readonly Proposal[];
42
- readonly receipt?: (asked: Asked) => readonly unknown[];
43
- readonly render?: (asked: Asked) => readonly string[];
44
- }
45
- export interface NativeReadingHandle {
46
- readonly identity: string;
47
- }
48
- export declare function authenticateSignedPort(root: RootStanding, coordinate: string): {
49
- line: string;
50
- profile: unknown;
51
- };
52
- export interface AuthenticatedNativeSelection {
53
- readonly identity: string;
54
- }
55
- /** One synchronous authentication supplies both the opaque boundary and its
56
- * immutable signed profile. Fresh Root checks still run at load and answer. */
57
- export declare function authenticateNativeProfile(root: RootStanding, coordinate: string): {
58
- readonly selection: AuthenticatedNativeSelection;
59
- readonly line: string;
60
- readonly profile: PortProfile;
61
- };
62
- export declare function validateSignedNativeProfile(root: RootStanding, coordinate: string, expected: PortProfile): AuthenticatedNativeSelection;
63
- /** Root must hold its real authority protection across the callback. A guard
64
- * method is instrument code, never supplied by a command or its JSON profile. */
65
- export interface RootAuthorityGuard {
66
- withCurrent<T>(body: (root: RootStanding) => Promise<T>): Promise<T>;
67
- }
68
- /** Fixed instrument loader, never a callback supplied by module/request/profile.
69
- * Root's REAL await-safe lease must cover verification, load and completion.
70
- * The handoff image is verified before the fixed loader receives an entry. */
71
- export declare function loadSignedNativeReading(selection: AuthenticatedNativeSelection, resolved: {
72
- profile: PortProfile;
73
- handoff: Handoff;
74
- image: NodeImage;
75
- archive: Uint8Array;
76
- custody?: RootJobCustody;
77
- }, guard: RootAuthorityGuard): Promise<NativeReadingHandle>;
78
- export declare function answerNativeReading(handle: NativeReadingHandle, requests: readonly Request[], self: string, options: {
79
- phase: 'act' | 'selection' | 'help' | 'check' | 'preview' | 'sign';
80
- signal?: AbortSignal;
81
- guard: RootAuthorityGuard;
82
- }): Promise<readonly Response[]>;
83
- /** Executable resources belong to the currently authenticated parent command
84
- * declaration, not to the separate authority-history/clock parsing budget. */
85
- export declare function nativeParentInputBytes(root: RootStanding, parent: {
86
- port: string;
87
- }): number;
88
- /** Exact schema field names, shared by the host's selected native formats. */
89
- export declare function fieldNames(value: object): string;
90
- /** Retain each verifier's private map and return a fresh canonical projection. */
91
- export declare function retainedProjection<H extends object, T>(verified: WeakMap<H, T>, fail: (why: string) => never): (handle: H) => T;
@@ -1,3 +0,0 @@
1
- import type { ReadingIdentityContext } from '@lapxo/topos/contract';
2
- import { type ReadingReference } from '../reading-context.ts';
3
- export declare function currentReadingEnvironment(store: string, root: string, hash: (text: string) => string, flags: readonly string[]): (context: ReadingIdentityContext) => readonly ReadingReference[] | undefined;
@@ -1,5 +0,0 @@
1
- import type { ReadingReference } from '../reading-context.ts';
2
- /** Existing leaf folds wrap parent names in the context namespace. Resolve that
3
- * namespace without dropping any inherited identity, and never pick a duplicate.
4
- */
5
- export declare function nativeReferenceInputs(inputs: readonly ReadingReference[], required: readonly ReadingReference[]): void;
@@ -1,17 +0,0 @@
1
- import { type RootAuthorityProtection } from '../../land/act.ts';
2
- import type { RootStanding, RootAuthorityGuard } from './reading.ts';
3
- import type { RootContext } from '@lapxo/topos/core';
4
- /** Values come from the fixed parent argv chain while it retains actual Root
5
- * protection. No world packet supplies the store, parent, cursor or verifier.
6
- */
7
- export interface NativeRootInheritance {
8
- readonly store: string;
9
- readonly parent: number;
10
- readonly expected: RootContext;
11
- }
12
- export declare function currentNativeRoot(store: string, parent: number, proof: RootAuthorityProtection): {
13
- readonly context: RootContext;
14
- readonly root: RootStanding;
15
- };
16
- export declare function inheritedNativeRoot(inherited: NativeRootInheritance, proof: RootAuthorityProtection): RootStanding;
17
- export declare function inheritedNativeGuard(inherited: NativeRootInheritance, proof: RootAuthorityProtection): RootAuthorityGuard;
@@ -1,66 +0,0 @@
1
- import { type NativeBinaryOrigin } from './native-binary.ts';
2
- import { type HostControlSelection } from './control-selection.ts';
3
- export { materializeNativeRoute } from './materialize.ts';
4
- import { type PortProfile, type RootStanding } from './reading.ts';
5
- import type { ReadingExecution, ReadingReference } from '../reading-context.ts';
6
- import type { Request, Response } from '@lapxo/topos/contract';
7
- import type { ReaderLifetime } from '@lapxo/topos/wire';
8
- export interface NativeBinaryBinding {
9
- readonly line: string;
10
- readonly coordinate: string;
11
- readonly profile: import('./native-binary.ts').NativeBinaryProfile;
12
- readonly origin?: NativeBinaryOrigin;
13
- }
14
- export interface NativeRoute {
15
- readonly identity: string;
16
- readonly profile: PortProfile;
17
- readonly binaries: readonly NativeBinaryBinding[];
18
- readonly control?: HostControlSelection;
19
- readonly inputs: readonly ReadingReference[];
20
- }
21
- /** Shared origins are one exact input; individual signed selectors remain separate. */
22
- export declare function nativeBinaryOriginInputs(binaries: readonly NativeBinaryBinding[]): readonly ReadingReference[];
23
- /** Inputs are semantic logical references. Fixed instrument/host graph and
24
- * runtime-supervisor chain must also be supplied by the calling identity builder.
25
- * Locations and lock-token/PID are operational custody, never these inputs.
26
- */
27
- export declare function prepareNativeRoute(store: string, coordinate: string, readerMapping?: string): NativeRoute;
28
- /** Recheck authority before both a current retained answer and fresh execution.
29
- * Historical public --check uses the existing receipt-inspection path, not this
30
- * command authorization route.
31
- */
32
- export declare function assertNativeRouteCurrent(route: NativeRoute): void;
33
- export declare function invokeNativeRoute(route: NativeRoute, input: {
34
- archive: string;
35
- locations: readonly {
36
- member: string;
37
- path: string;
38
- kind: 'module' | 'data' | 'binary';
39
- }[];
40
- requests: readonly Request[];
41
- execution: ReadingExecution;
42
- limits: ReaderLifetime;
43
- }): readonly Response[];
44
- /** This predicate only schedules an outer lease. It grants no command. */
45
- export declare function declaredNativeReaderPorts(lines: readonly string[]): boolean;
46
- export declare function prepareNativeReaderRoute(store: string, reader: {
47
- id: string;
48
- module: string;
49
- }): NativeRoute | undefined;
50
- export declare function nativeRouteStore(route: NativeRoute): string;
51
- /** Quiet-pass gate: authenticate grants/cursor only, no image/materialization or
52
- * program execution. Historical --check remains its separate receipt path. */
53
- export declare function assertNativeReaderGrantsCurrent(store: string): void;
54
- /** Executable kinds come only from current authenticated Root declarations. A
55
- * matching JSON hint identifies a candidate, but is never permission to execute. */
56
- export declare function authenticatedNativeBinaries(root: RootStanding, profile: PortProfile): readonly NativeBinaryBinding[];
57
- /** Same semantic image identity for preparation, retained mount and quiet checks. */
58
- export declare function nativeMountIdentity(profile: PortProfile, binaries: readonly NativeBinaryBinding[], control?: HostControlSelection): string;
59
- export interface CurrentNativeReaderSelection {
60
- readonly profile: PortProfile;
61
- readonly binaries: readonly NativeBinaryBinding[];
62
- readonly control?: HostControlSelection;
63
- }
64
- /** Current eligibility only: no executor graph, image load or materialization. */
65
- export declare function currentNativeReaderSelections(store: string): readonly CurrentNativeReaderSelection[];
66
- export declare function currentNativeReaderProfiles(store: string): readonly PortProfile[];
@@ -1,4 +0,0 @@
1
- /** Environment identity is not permission to bootstrap arbitrary executable
2
- * preloads. The fixed native entry currently has no ambient loader contract.
3
- */
4
- export declare function assertNativeRuntime(environment: Readonly<Record<string, string | undefined>>, flags: readonly string[]): void;
@@ -1,3 +0,0 @@
1
- import type { NativeRoute } from './native/route.ts';
2
- export declare const nativeReaderRoute: () => NativeRoute | undefined;
3
- export declare function withNativeReaderRoute<T>(route: NativeRoute | undefined, run: () => T): T;
@@ -1,6 +0,0 @@
1
- /** Bound supplies host authority and I/O; topos owns grammar, selection and context validation. */
2
- export declare function admittedObjects(root: string, lines: readonly string[], emit?: (text: string) => void, requireContextClosure?: boolean): Promise<{
3
- records: readonly import("@lapxo/topos/wire").ObjectRecord[];
4
- context: import("@lapxo/topos/wire").ObjectContext;
5
- configuration: Readonly<Record<string, string>>[];
6
- }>;
@@ -1,55 +0,0 @@
1
- import { PLACE_ACT_CONTEXT, type ClockBudget, type TrustedClockContract } from '@lapxo/topos/core';
2
- import { type Signer } from '@lapxo/topos/wire';
3
- import { type PlaceActTrust, type PlaceActBudget, type PlaceActHead } from './ports/place-act.ts';
4
- export interface HostClockSelection {
5
- readonly profile: typeof PLACE_ACT_CONTEXT;
6
- readonly namespace: string;
7
- readonly regionFamily: string;
8
- readonly receiptSigner: string;
9
- readonly receiptScope: string;
10
- readonly digestAlgorithm: 'sha256';
11
- readonly budget: ClockBudget;
12
- readonly storageBudget: PlaceActBudget;
13
- readonly initial: readonly {
14
- place: string;
15
- receiver: {
16
- identity: string;
17
- epoch: string;
18
- };
19
- origin: {
20
- prefix: string;
21
- epoch: string;
22
- };
23
- }[];
24
- }
25
- export interface HostClockInput {
26
- readonly store: string;
27
- readonly selector: string;
28
- readonly profileSelector: string;
29
- readonly history: readonly string[];
30
- readonly anchor: Signer;
31
- readonly algorithms: readonly string[];
32
- readonly legacyOriginals: readonly string[];
33
- /** Actual protected Root authority cursor: an authenticated signed Root config
34
- * checkpoint, never a sibling receipt/evidence max epoch. */
35
- readonly authorityCheckpoint: string;
36
- /** Fixed host historical predecessor proof, never taken from a packet. */
37
- readonly authenticatedReceiverHeads?: readonly PlaceActHead[];
38
- readonly readCurrent: () => Pick<HostClockInput, 'history' | 'anchor' | 'algorithms' | 'legacyOriginals' | 'authorityCheckpoint'>;
39
- readonly resources: {
40
- bytes: number;
41
- lines: number;
42
- places: number;
43
- };
44
- readonly inherited: {
45
- clock: ClockBudget;
46
- storage: PlaceActBudget;
47
- };
48
- readonly historical: (encoded: string) => TrustedClockContract;
49
- }
50
- /** Root chooses selector and anchors/resources from its authenticated standing.
51
- * Selection must be ROOT signed; a world's signature grants no host capability. */
52
- export declare function hostClockSelection(input: HostClockInput): {
53
- selection: HostClockSelection;
54
- trust: PlaceActTrust;
55
- };
@@ -1,24 +0,0 @@
1
- /** Prepared by the admitted Topos contract and receiver signer. The host does not infer origins, coverage or epochs. */
2
- export interface IngressBundle {
3
- readonly evidence: string;
4
- readonly receipt: string;
5
- }
6
- export interface IngressResult extends IngressBundle {
7
- readonly kind: 'landed' | 'once';
8
- readonly evidenceBytes: number;
9
- readonly receiptBytes: number;
10
- }
11
- export interface IngressStorage {
12
- publish(staged: string, committed: string): void;
13
- }
14
- /** Directory publication makes the pair visible together; there is no later ledger append that can expose half. */
15
- export declare const nativeIngressStorage: IngressStorage;
16
- /** Native signed receipt lines only. Foreign bytes are never added to the local ledger or epoch allocator. */
17
- export declare function ingressReceipts(store: string): readonly string[];
18
- /** Private staging directories are invisible to readers and may be discarded after host recovery. */
19
- export declare function ingressEvidence(store: string, identity: string): IngressBundle | undefined;
20
- export declare function ingressBundles(store: string): readonly IngressBundle[];
21
- /** Verification and signing complete before staging. Replay performs no signer invocation or persistent write. */
22
- export declare function commitIngress(store: string, identity: string, prepare: (localImportReceipts: readonly string[]) => Promise<IngressBundle>, verify: (bundle: IngressBundle) => boolean, storage?: IngressStorage): Promise<IngressResult>;
23
- /** Costs distinguish delivered bytes from newly committed bytes; no count is called information or freedom. */
24
- export declare function ingressCost(result: IngressResult, deliveredBytes: number, protocolBytes: number): string;
@@ -1,44 +0,0 @@
1
- import type { PublicationStorage } from './publication.ts';
2
- /** Prepared and verified by the selected Topos admission/result contract. */
3
- export interface LocalActBundle {
4
- readonly records: string;
5
- readonly receipt: string;
6
- readonly placements?: readonly {
7
- place: string;
8
- records: string;
9
- }[];
10
- }
11
- export type LocalActVerification = (identity: string, bundle: LocalActBundle) => boolean;
12
- export declare const actLines: (bytes: string) => readonly string[];
13
- /** Journal integrity is not authority. Signature/coverage checks remain the
14
- * same admission boundary; the hash algorithm here is the stored seal's named
15
- * algorithm, not a new selection of the place's wire.
16
- */
17
- export declare function intactLocalAct(identity: string, bundle: LocalActBundle): boolean;
18
- /** Internal integrity key only, not an act identity or a wire profile. */
19
- export declare function committedInventoryFingerprint(rows: readonly {
20
- identity: string;
21
- bundle: LocalActBundle;
22
- }[]): string;
23
- /** Committed segments are part of this ledger, not a second authority source. */
24
- export declare function committedLocalActs(store: string): readonly {
25
- identity: string;
26
- bundle: LocalActBundle;
27
- }[];
28
- /** Fixed host observation only: one synchronous, coherent committed inventory.
29
- * It supplies no authority, verifier or async lifetime. Each outer invocation
30
- * rereads exact bodies before entering; current authorization still runs inside.
31
- */
32
- export declare function withCommittedLocalActObservation<T>(store: string, body: () => T): T;
33
- /** A public result is available only as a verified committed pair.
34
- * No writer-tail guess, newest-result selection or implicit authority.
35
- */
36
- export declare function localActResult(store: string, identity: string, verify: LocalActVerification): LocalActBundle | undefined;
37
- /** One publication point for records and their native result. Re-delivery
38
- * reads the original pair without preparation, signing or a new local epoch.
39
- * The caller must also integrate this boundary into admission-history readers;
40
- * this storage port alone does not activate a grammar or land authority.
41
- */
42
- export declare function commitLocalAct(store: string, identity: string, regions: readonly string[], prepare: () => Promise<LocalActBundle>, verify: LocalActVerification, storage?: PublicationStorage): Promise<LocalActBundle & {
43
- readonly kind: 'landed' | 'once';
44
- }>;
@@ -1,46 +0,0 @@
1
- import { type TrustedClockContract, type PlaceReceipt, type RootContext } from '@lapxo/topos/core';
2
- import { type PublicationStorage } from './publication.ts';
3
- export interface PlaceActBudget {
4
- readonly acts: number;
5
- readonly bytes: number;
6
- }
7
- export interface PlaceActHead {
8
- readonly place: string;
9
- readonly identity: string;
10
- readonly epoch: string;
11
- }
12
- export interface PlaceActSnapshot {
13
- readonly root: RootContext;
14
- readonly heads: readonly PlaceActHead[];
15
- }
16
- /** Fixed instrument construction, never supplied by world JSON. Historical
17
- * authentication permits inspection only; current() is read under Root guards. */
18
- export interface PlaceActTrust {
19
- readonly contract: TrustedClockContract;
20
- readonly initialHeads: readonly PlaceActHead[];
21
- readonly current: () => PlaceActSnapshot;
22
- readonly historical: (encoded: string) => TrustedClockContract;
23
- }
24
- export interface PlaceActBundle {
25
- readonly context: string;
26
- readonly receipts: readonly PlaceReceipt[];
27
- readonly originals: readonly (readonly string[])[];
28
- }
29
- /** Historical result reads never produce a current authorization permit. */
30
- export declare function placeActResult(store: string, id: string, trust: Pick<PlaceActTrust, 'historical'>, limits: PlaceActBudget): PlaceActBundle | undefined;
31
- /** Each receiver chain advances independently. Initial heads are explicit,
32
- * authenticated host inputs, not inferred zero or legacy global epochs. */
33
- export declare function placeActHeads(store: string, initial: readonly PlaceActHead[], trust: Pick<PlaceActTrust, 'historical' | 'contract'>, limits: PlaceActBudget): readonly PlaceActHead[];
34
- /** Context, exact original bytes and complete signed receipts have one visibility
35
- * point. Real Root guard exclusion spans final authority/head comparison and
36
- * publication; this does not activate a CLI profile or reinterpret local-act@1. */
37
- export declare function commitPlaceAct(store: string, encoded: string, receipts: readonly PlaceReceipt[], trust: PlaceActTrust, limits: PlaceActBudget, storage?: PublicationStorage): Promise<PlaceActBundle & {
38
- readonly kind: 'landed' | 'once';
39
- readonly identity: string;
40
- }>;
41
- /** Enumerates only committed, historically authenticated carriers. Namespace
42
- * projection is a caller's separate pure operation, never current permission. */
43
- export declare function committedPlaceActResults(store: string, trust: Pick<PlaceActTrust, 'historical'>, limits: PlaceActBudget): readonly {
44
- identity: string;
45
- bundle: PlaceActBundle;
46
- }[];
@@ -1,10 +0,0 @@
1
- export interface PublicationStorage {
2
- publish(staged: string, committed: string): void;
3
- }
4
- export declare const nativePublicationStorage: PublicationStorage;
5
- /** Publish prepared bytes as one directory. No identity, grammar or authority
6
- * is inferred here. Readers address the committed name, never staging files.
7
- * A failure after rename is not evidence of rollback: the caller must retain
8
- * the uncertainty and allow a verified read of the committed name.
9
- */
10
- export declare function publishBundle(committed: string, files: Readonly<Record<string, string>>, storage?: PublicationStorage): void;