@lapxo/bound 0.2.4 → 0.2.5

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 (250) hide show
  1. package/CITATION.cff +1 -1
  2. package/TARGET.bound +44 -39
  3. package/dist/cli/accept.js +72 -590
  4. package/dist/cli/act-result.js +3 -103
  5. package/dist/cli/args.js +3 -44
  6. package/dist/cli/custodian.js +2 -29
  7. package/dist/cli/host.js +4 -32
  8. package/dist/cli/names.js +1 -12
  9. package/dist/cli/native-descendant.js +1 -19
  10. package/dist/cli/native.js +3 -60
  11. package/dist/cli/observe.js +1 -13
  12. package/dist/cli/owner.js +3 -139
  13. package/dist/cli/pass.js +21 -321
  14. package/dist/cli/place.js +6 -282
  15. package/dist/cli/release-result.js +3 -80
  16. package/dist/cli/retained-judgment.js +1 -25
  17. package/dist/cli/standing-result.js +4 -19
  18. package/dist/cli/takes.js +10 -112
  19. package/dist/cli/verb.d.ts +1 -2
  20. package/dist/cli/verb.js +83 -684
  21. package/dist/engine/computation.js +2 -0
  22. package/dist/engine/conformance.js +4 -0
  23. package/dist/engine/encoding.js +1 -2
  24. package/dist/engine/index.d.ts +1 -13
  25. package/dist/engine/index.js +2 -11
  26. package/dist/engine/object.js +1 -38
  27. package/dist/engine/ports.js +2 -117
  28. package/dist/fold/admission-history.js +1 -17
  29. package/dist/fold/bootstrap-anchor.js +1 -28
  30. package/dist/fold/ceilings.js +1 -142
  31. package/dist/fold/claims.js +2 -132
  32. package/dist/fold/closed.js +24 -235
  33. package/dist/fold/configures.js +1 -25
  34. package/dist/fold/digests.js +10 -226
  35. package/dist/fold/evidence.js +1 -22
  36. package/dist/fold/fold-worker.js +1 -13
  37. package/dist/fold/kept.js +12 -173
  38. package/dist/fold/keys.js +3 -91
  39. package/dist/fold/laid.js +3 -90
  40. package/dist/fold/nos.js +1 -48
  41. package/dist/fold/object.js +1 -2
  42. package/dist/fold/observed.js +27 -534
  43. package/dist/fold/opened.js +1 -33
  44. package/dist/fold/own.js +3 -217
  45. package/dist/fold/paid.js +1 -92
  46. package/dist/fold/place-inputs.js +1 -70
  47. package/dist/fold/places.js +3 -100
  48. package/dist/fold/rank.js +1 -9
  49. package/dist/fold/reach.js +1 -83
  50. package/dist/fold/readers.js +6 -142
  51. package/dist/fold/receipts.js +1 -47
  52. package/dist/fold/region-declarations.js +1 -13
  53. package/dist/fold/region.js +8 -286
  54. package/dist/fold/release-policy.js +1 -101
  55. package/dist/fold/resolved.js +6 -145
  56. package/dist/fold/roles.js +2 -59
  57. package/dist/fold/second.js +4 -71
  58. package/dist/fold/shards.js +12 -100
  59. package/dist/fold/signed.js +3 -81
  60. package/dist/fold/signers.js +1 -54
  61. package/dist/fold/stranger.js +6 -24
  62. package/dist/fold/views.js +1 -66
  63. package/dist/fold/wire.js +1 -46
  64. package/dist/fold/zoom.js +3 -81
  65. package/dist/host/act-cost.js +1 -25
  66. package/dist/host/adapters/keys/ed25519.js +1 -30
  67. package/dist/host/adapters/modules/javascript.js +1 -50
  68. package/dist/host/adapters/transport/http.js +1 -28
  69. package/dist/host/admitted-place.js +1 -35
  70. package/dist/host/archive.js +1 -152
  71. package/dist/host/call-context.js +1 -14
  72. package/dist/host/capsule-process.js +2 -62
  73. package/dist/host/capsule.js +9 -171
  74. package/dist/host/cell-receipts.js +12 -128
  75. package/dist/host/commit-result.js +1 -5
  76. package/dist/host/content-needed.js +1 -8
  77. package/dist/host/content-store.js +1 -31
  78. package/dist/host/contextual-place.js +2 -72
  79. package/dist/host/digest.js +2 -15
  80. package/dist/host/hash.js +1 -9
  81. package/dist/host/host-controls.js +1 -19
  82. package/dist/host/in-process-act.js +3 -84
  83. package/dist/host/in-process-context.js +3 -91
  84. package/dist/host/in-process-root.js +6 -84
  85. package/dist/host/in-process.js +4 -55
  86. package/dist/host/index.d.ts +1 -15
  87. package/dist/host/index.js +1 -7
  88. package/dist/host/io.js +1 -11
  89. package/dist/host/lifetime.js +1 -79
  90. package/dist/host/located.js +6 -105
  91. package/dist/host/native/bounded-file.js +1 -32
  92. package/dist/host/native/command.js +1 -91
  93. package/dist/host/native/control-bridge-worker.js +2 -88
  94. package/dist/host/native/control-bridge.js +1 -110
  95. package/dist/host/native/control-selection.js +1 -32
  96. package/dist/host/native/custody.js +1 -91
  97. package/dist/host/native/deadline.js +1 -28
  98. package/dist/host/native/descendants.js +1 -528
  99. package/dist/host/native/generated-custodian.js +5 -267
  100. package/dist/host/native/generated.js +1 -379
  101. package/dist/host/native/image.js +1 -45
  102. package/dist/host/native/jobs.js +2 -148
  103. package/dist/host/native/loader.js +1 -269
  104. package/dist/host/native/materialize.js +1 -175
  105. package/dist/host/native/module-closure.js +1 -130
  106. package/dist/host/native/module-delivery.d.ts +1 -62
  107. package/dist/host/native/module-delivery.js +1 -151
  108. package/dist/host/native/module-syntax.js +1 -69
  109. package/dist/host/native/native-binary.js +1 -115
  110. package/dist/host/native/native-program.js +1 -72
  111. package/dist/host/native/node-jobs.js +3 -187
  112. package/dist/host/native/node-launch.js +1 -159
  113. package/dist/host/native/preload.js +1 -45
  114. package/dist/host/native/reading.js +1 -249
  115. package/dist/host/native/receipt-environment.js +1 -41
  116. package/dist/host/native/references.js +1 -30
  117. package/dist/host/native/root.js +1 -37
  118. package/dist/host/native/route.js +1 -216
  119. package/dist/host/native/runtime.js +1 -9
  120. package/dist/host/native-reader-context.js +1 -8
  121. package/dist/host/native-receiver.js +1 -25
  122. package/dist/host/objects.js +1 -38
  123. package/dist/host/order.js +1 -2
  124. package/dist/host/place-act-transaction.js +4 -78
  125. package/dist/host/place-clock-selection.js +5 -124
  126. package/dist/host/ports/ingress.js +2 -57
  127. package/dist/host/ports/local-act.js +5 -183
  128. package/dist/host/ports/place-act.js +1 -134
  129. package/dist/host/ports/publication.js +1 -56
  130. package/dist/host/ports/signing.js +1 -74
  131. package/dist/host/ports/store.js +1 -18
  132. package/dist/host/ports/transport.js +1 -48
  133. package/dist/host/process-lifetime.js +1 -17
  134. package/dist/host/provide.js +1 -183
  135. package/dist/host/read-only.js +1 -9
  136. package/dist/host/reading-closures.js +7 -227
  137. package/dist/host/reading-context.js +1 -53
  138. package/dist/host/reading-identity-types.js +0 -0
  139. package/dist/host/reading-identity.js +3 -0
  140. package/dist/host/reading-preparation.js +6 -0
  141. package/dist/host/reference-authenticated.d.ts +1 -40
  142. package/dist/host/reference-authenticated.js +3 -100
  143. package/dist/host/reference-contracts.js +1 -6
  144. package/dist/host/reference-export.js +6 -81
  145. package/dist/host/reference-native-api.d.ts +1 -3
  146. package/dist/host/reference-native-api.js +1 -3
  147. package/dist/host/reference-native.js +1 -74
  148. package/dist/host/reference-profile.js +1 -63
  149. package/dist/host/reference-standing.js +2 -18
  150. package/dist/host/reference.js +1 -24
  151. package/dist/host/refusals.js +2 -43
  152. package/dist/host/release.js +4 -256
  153. package/dist/host/root-clock-source.js +1 -307
  154. package/dist/host/selected-capsules.js +1 -50
  155. package/dist/host/selected-topos.js +1 -80
  156. package/dist/host/signature-era.js +1 -12
  157. package/dist/host/signing.js +2 -48
  158. package/dist/host/source-content.js +2 -111
  159. package/dist/host/standing-carrier.js +1 -18
  160. package/dist/host/standing-projection.js +1 -50
  161. package/dist/host/timing.js +1 -7
  162. package/dist/host/walk.js +20 -193
  163. package/dist/judge/late.js +1 -33
  164. package/dist/judge/take.js +2 -75
  165. package/dist/judge/widening.js +1 -25
  166. package/dist/land/act.js +8 -336
  167. package/dist/land/alias.js +1 -41
  168. package/dist/land/held.js +1 -23
  169. package/dist/land/inert.js +1 -33
  170. package/dist/land/leaving.js +1 -55
  171. package/dist/land/ledger.js +7 -188
  172. package/dist/land/owned.js +4 -66
  173. package/dist/land/sign.js +1 -53
  174. package/dist/land/standing-pin.js +1 -49
  175. package/dist/land/vouched.js +1 -112
  176. package/dist/land/withdraw.js +1 -24
  177. package/dist/observe/files.js +1 -88
  178. package/dist/observe/identity.js +1 -61
  179. package/dist/observe/match.js +1 -8
  180. package/dist/observe/regions.js +7 -306
  181. package/dist/observe/run.js +2 -41
  182. package/dist/observe/runner.js +4 -101
  183. package/dist/public-types.d.ts +1114 -0
  184. package/dist/render/capsule.js +1 -30
  185. package/dist/render/field.js +1 -40
  186. package/dist/render/names.js +1 -4
  187. package/dist/render/open.js +1 -61
  188. package/dist/render/page.js +1 -7
  189. package/dist/render/receipts.js +1 -47
  190. package/dist/render/shape.js +1 -74
  191. package/dist/render/target.js +4 -52
  192. package/dist/render/view.js +7 -197
  193. package/dist/vendor/50086958553b9376d600583f7dff354196bfeb41170fc6d1482ca7bea7c493e2.LICENSE +21 -0
  194. package/dist/vendor/b3e938d28f88a1851af303a40c749e12ebd5a686daac4f0b343b5cdd2e040419.LICENSE +21 -0
  195. package/dist/vendor/bundle.json +1 -0
  196. package/dist/vendor/library11.js +1 -0
  197. package/dist/vendor/object-provider.js +42 -0
  198. package/dist/vendor/runtime.js +38 -0
  199. package/dist/vendor/sources.json +1 -0
  200. package/dist/wasm/adapter.d.ts +1 -51
  201. package/dist/wasm/adapter.js +1 -180
  202. package/dist/wasm/node-worker.js +1 -13
  203. package/dist/wasm/object.js +1 -76
  204. package/dist/wasm/worker.js +1 -7
  205. package/docs/contracts/closure-delivery.md +1 -1
  206. package/docs/contracts/closure-delivery.publication.json +1 -1
  207. package/docs/contracts/conformance.json +142 -0
  208. package/docs/contracts/determinism.bound +9 -0
  209. package/docs/contracts/engine-object-projection.publication.json +1 -1
  210. package/docs/contracts/engine.md +21 -1
  211. package/docs/contracts/native-publication.inventory.json +2 -1
  212. package/docs/contracts/optional-wasm-adapter.publication.json +1 -1
  213. package/docs/contracts/reading-identity.md +37 -0
  214. package/docs/contracts/reading-identity.publication.json +25 -0
  215. package/docs/contracts/refusals.bound +51 -0
  216. package/docs/contracts/refusals.md +18 -3
  217. package/docs/contracts/refusals.publication.json +2 -2
  218. package/docs/contracts/views.md +8 -0
  219. package/docs/reference.md +1 -0
  220. package/package.json +23 -34
  221. package/receipts.bound +11627 -10323
  222. package/samples/reading-identity/no.json +20 -0
  223. package/samples/reading-identity/yes.json +46 -0
  224. package/vectors/native/reading-identity.vector.json +101 -0
  225. package/vectors/native/refusals.vector.json +104 -0
  226. package/vendor/syntax/LICENSE.md +7 -0
  227. package/vendor/syntax/parser.js +1 -0
  228. package/.github/workflows/release.yml +0 -67
  229. package/.github/workflows/test.yml +0 -35
  230. package/dist/engine/object.d.ts +0 -17
  231. package/dist/engine/ports.d.ts +0 -37
  232. package/dist/fold/claims.d.ts +0 -29
  233. package/dist/host/call-context.d.ts +0 -20
  234. package/dist/host/commit-result.d.ts +0 -6
  235. package/dist/host/in-process-act.d.ts +0 -82
  236. package/dist/host/in-process-context.d.ts +0 -46
  237. package/dist/host/in-process-root.d.ts +0 -117
  238. package/dist/host/in-process.d.ts +0 -41
  239. package/dist/host/native/module-closure.d.ts +0 -35
  240. package/dist/host/native-receiver.d.ts +0 -19
  241. package/dist/host/place-act-transaction.d.ts +0 -24
  242. package/dist/host/place-clock-selection.d.ts +0 -55
  243. package/dist/host/ports/local-act.d.ts +0 -44
  244. package/dist/host/ports/place-act.d.ts +0 -49
  245. package/dist/host/ports/publication.d.ts +0 -10
  246. package/dist/host/reference-export.d.ts +0 -33
  247. package/dist/host/reference-native.d.ts +0 -30
  248. package/dist/host/reference-profile.d.ts +0 -23
  249. package/dist/host/refusals.d.ts +0 -14
  250. package/dist/host/root-clock-source.d.ts +0 -86
@@ -1,67 +0,0 @@
1
- name: release
2
- on:
3
- workflow_run:
4
- workflows: [tag]
5
- types: [completed]
6
- workflow_dispatch:
7
- jobs:
8
- stage:
9
- if: github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main')
10
- concurrency: release-delivery
11
- environment: release
12
- runs-on: ubuntu-latest
13
- permissions:
14
- contents: write
15
- id-token: write
16
- steps:
17
- - uses: actions/checkout@v4
18
- with:
19
- ref: ${{ github.event.workflow_run.head_sha || github.sha }}
20
- - uses: actions/setup-node@v4
21
- with:
22
- node-version: 24
23
- - run: npm ci --ignore-scripts
24
- - run: npm run build
25
- - run: npm install --global npm@'12.1.0' --ignore-scripts
26
- - name: Prepare release
27
- env:
28
- GH_TOKEN: ${{ github.token }}
29
- run: |
30
- set -euo pipefail
31
- TAG="v$(node -p "require('./package.json').version")"
32
- printf 'TAG=%s\n' "$TAG" >> "$GITHUB_ENV"
33
- git fetch origin "refs/tags/$TAG:refs/tags/$TAG"
34
- gh api --paginate "repos/$GITHUB_REPOSITORY/releases" --jq '.[].tag_name' > "$RUNNER_TEMP/release-tags"
35
- if grep -Fxq "$TAG" "$RUNNER_TEMP/release-tags"; then
36
- printf 'RELEASE %s · exists\n' "$TAG"
37
- else
38
- gh release create "$TAG" --verify-tag --draft --title "$TAG" --generate-notes
39
- printf 'RELEASE %s · draft created · awaiting signed assets\n' "$TAG"
40
- fi
41
- - name: Read owner approval
42
- env:
43
- GH_TOKEN: ${{ github.token }}
44
- run: |
45
- set -euo pipefail
46
- mkdir .release
47
- gh release download "$TAG" --pattern approval-signed --dir .release
48
- node dist/cli/verb.js fold --as release .release/approval-signed > .release/verdict
49
- cat .release/verdict
50
- - name: Stage the approved release archive
51
- env:
52
- GH_TOKEN: ${{ github.token }}
53
- run: |
54
- set -euo pipefail
55
- read -r status digest archive source extra < .release/verdict
56
- test "$status" = READY
57
- test -z "$extra"
58
- gh release download "$TAG" --pattern "$archive" --dir .release
59
- printf '%s %s\n' "${digest#sha256:}" ".release/$archive" | sha256sum -c -
60
- expected="$(node -p "require('./package.json').name+'@'+require('./package.json').version")"
61
- actual="$(tar -xOf ".release/$archive" package/package.json | node -p "const p=JSON.parse(require('fs').readFileSync(0,'utf8'));p.name+'@'+p.version")"
62
- test "$actual" = "$expected"
63
- printf 'SOURCE release/%s/%s · %s · declared %s\n' "$TAG" "$archive" "$digest" "$source"
64
- gh release edit "$TAG" --draft=false
65
- printf 'RELEASE %s · published · %s\n' "$TAG" "$digest"
66
- npm stage publish ".release/$archive" --access public --ignore-scripts
67
- printf 'STAGED %s · %s · owner approval pending\n' "$actual" "$digest"
@@ -1,35 +0,0 @@
1
- name: test
2
- on:
3
- push:
4
- branches: [main]
5
- pull_request:
6
- permissions:
7
- contents: read
8
- jobs:
9
- test:
10
- strategy:
11
- fail-fast: false
12
- matrix:
13
- node: [22, 24]
14
- runs-on: ubuntu-latest
15
- steps:
16
- - uses: actions/checkout@v4
17
- with:
18
- persist-credentials: false
19
- - uses: actions/setup-node@v4
20
- with:
21
- node-version: ${{ matrix.node }}
22
- - run: npm ci
23
- - run: npm run build
24
- - name: Run tests
25
- run: |
26
- set -euo pipefail
27
- npm test 2>&1 | tee "$RUNNER_TEMP/bound-tests.log"
28
- - run: npm pack --pack-destination "$RUNNER_TEMP" --silent
29
- - name: Preserve test logs
30
- if: always()
31
- uses: actions/upload-artifact@v4
32
- with:
33
- name: bound-node-${{ matrix.node }}
34
- path: ${{ runner.temp }}/bound-tests.log
35
- if-no-files-found: ignore
@@ -1,17 +0,0 @@
1
- import type { Mark, Cell } from '@lapxo/obligations/views/field';
2
- import type { ObjectRecord, ObjectContext } from '@lapxo/topos/wire';
3
- /** Projection dispatches admitted acts into Obligatory; it defines no meet or propagation. */
4
- export interface ObjectReading {
5
- cell: string;
6
- state: string;
7
- parts: Cell<unknown>;
8
- rest: readonly string[];
9
- ownMarks: readonly (string | undefined)[];
10
- ownClaims: readonly {
11
- id: string | undefined;
12
- origin: string;
13
- }[];
14
- marks: readonly Mark<unknown>[];
15
- claims: readonly unknown[];
16
- }
17
- export declare function objectFold(records: readonly ObjectRecord[], context: ObjectContext): readonly ObjectReading[];
@@ -1,37 +0,0 @@
1
- export interface PortLimits {
2
- readonly timeoutMs: number;
3
- readonly maxBytes: number;
4
- }
5
- export interface SigningLot {
6
- readonly bytes: readonly string[];
7
- readonly keyId: string;
8
- readonly algorithm: string;
9
- }
10
- export interface SignatureRecord {
11
- readonly keyId: string;
12
- readonly signature: string;
13
- }
14
- export type SigningPort = (lot: SigningLot, signal: AbortSignal) => Promise<readonly SignatureRecord[]>;
15
- export type ContentReadPort = (source: string, digest: string, signal: AbortSignal) => Promise<Uint8Array>;
16
- /** Atomic byte retention supplied by the host. This is neither admission nor a current-answer cache. */
17
- export type PersistencePort = (digest: string, bytes: Uint8Array, signal: AbortSignal) => Promise<void>;
18
- export type DigestPort = (bytes: Uint8Array) => string | Promise<string>;
19
- export declare function readContent(source: string, digest: string, ports: {
20
- readonly read: ContentReadPort;
21
- readonly digestBytes: DigestPort;
22
- }, limits: PortLimits, signal?: AbortSignal): Promise<Uint8Array>;
23
- /** Verify before invoking retention; no operation automatically writes the projected result. */
24
- export declare function retainContent(digest: string, bytes: Uint8Array, ports: {
25
- readonly retain: PersistencePort;
26
- readonly digestBytes: DigestPort;
27
- }, limits: PortLimits, signal?: AbortSignal): Promise<{
28
- readonly digest: string;
29
- readonly bytes: number;
30
- }>;
31
- /** Acquire canonical line signatures only. The line protocol is not widened
32
- * for contextual receipt frames. Both operations share bounds and response checks. */
33
- export declare function invokeSigningPort(lot: SigningLot, sign: SigningPort, limits: PortLimits, signal?: AbortSignal): Promise<readonly SignatureRecord[]>;
34
- /** Host-prepared signature frames. This acquires no authority: the contextual
35
- * transaction validates the frame's domain/receiver and verifies every signature.
36
- * A carrier cannot select this operation or supply a signature verifier. */
37
- export declare function invokeFrameSigningPort(lot: SigningLot, sign: SigningPort, limits: PortLimits, signal?: AbortSignal): Promise<readonly SignatureRecord[]>;
@@ -1,29 +0,0 @@
1
- import { parse } from '@lapxo/topos/wire';
2
- export { CAPSULE, EXTENSION, LOCK, RECEIPTS } from '@lapxo/topos/wire';
3
- /** Pure syntax is retained by the exact record bytes, never by a path, epoch or
4
- * claimed digest. This does not retain admission, coverage or current grants. */
5
- export declare function parsedLine(line: string): ReturnType<typeof parse>;
6
- export declare const fieldOf: (line: string, name: string) => string;
7
- export declare const fieldsOf: (line: string) => Record<string, string>;
8
- export declare function selfName(): string;
9
- export declare function isWire(line: string): boolean;
10
- export declare const wireLinesOf: (text: string | undefined) => readonly string[];
11
- export declare const isConfig: (line: string) => boolean;
12
- export declare const sayingOf: (line: string) => string;
13
- /** One key per claim: scope, role and measure; what a line says, its envelope set aside, is one however often it landed. */
14
- export declare function claimKey(line: string): string;
15
- export interface Fork {
16
- readonly key: string;
17
- readonly lines: readonly string[];
18
- readonly state?: string;
19
- }
20
- export declare function foldClaims(lines: readonly string[], receipts?: readonly {
21
- readonly scope: string;
22
- readonly moved: readonly string[];
23
- }[], _placed?: boolean): {
24
- readonly standing: readonly string[];
25
- readonly superseded: readonly string[];
26
- readonly retracted: readonly string[];
27
- readonly forks: readonly Fork[];
28
- readonly vacuous: readonly string[];
29
- };
@@ -1,20 +0,0 @@
1
- /** Native operational selection from the receiver, never the offered content. */
2
- export interface HostInstrumentRuntime {
3
- readonly root: string;
4
- readonly entry: string;
5
- readonly directory: string;
6
- readonly extension: '.ts' | '.js';
7
- readonly lock: readonly string[];
8
- }
9
- interface HostCall {
10
- readonly instrumentName: string;
11
- readonly runtime?: HostInstrumentRuntime;
12
- readonly output?: (stream: 'out' | 'error', text: string) => void;
13
- }
14
- export declare const hostInstrumentName: () => string | undefined;
15
- export declare const hostInstrumentRuntime: () => HostInstrumentRuntime | undefined;
16
- export declare const withHostInstrument: <T>(instrumentName: string, run: () => T) => T;
17
- export declare const withHostCall: <T>(call: HostCall, run: () => T) => T;
18
- /** No stream monkey-patching: diagnostics follow only this asynchronous call. */
19
- export declare function hostOutput(stream: 'out' | 'error', text: string): void;
20
- export {};
@@ -1,6 +0,0 @@
1
- import { BoundRefusal } from './refusals.ts';
2
- /** Visibility may precede a failed publication response; never asserts rollback. */
3
- export declare class ActCommitUnknown extends BoundRefusal {
4
- readonly identity: string;
5
- constructor(identity: string, cause: unknown);
6
- }
@@ -1,82 +0,0 @@
1
- import { type ReadingIdentityContext } from '@lapxo/topos/contract';
2
- import { type ContentReadPort, type SigningPort, type PortLimits } from '../engine/ports.ts';
3
- import { type PlaceActPersistence } from './place-act-transaction.ts';
4
- import type { PlaceActTrust, PlaceActBudget } from './ports/place-act.ts';
5
- export interface PlaceActHostContext {
6
- readonly place: string;
7
- readonly source: string;
8
- readonly identity: string;
9
- readonly rootSnapshot: string;
10
- readonly reading: ReadingIdentityContext;
11
- readonly algorithm: string;
12
- readonly contentLimits: PortLimits;
13
- readonly signingLimits: PortLimits;
14
- readonly storageLimits: PlaceActBudget;
15
- readonly signal?: AbortSignal;
16
- }
17
- /** These are receiver-selected host ports, not carrier fields or an offered
18
- * verifier. Trust must be constructed from the authenticated receiver snapshot. */
19
- export interface PlaceActHostPorts {
20
- readonly instrumentName: string;
21
- readonly read: ContentReadPort;
22
- readonly sign: SigningPort;
23
- readonly trust: () => PlaceActTrust;
24
- readonly persistence: PlaceActPersistence;
25
- readonly limits: {
26
- readonly storage: PlaceActBudget;
27
- readonly signing: PortLimits;
28
- readonly content: PortLimits;
29
- };
30
- }
31
- /** Signs receiver receipts through the bounded existing signer protocol. Exact
32
- * original declarations/proofs remain unchanged. Replay is historical recovery,
33
- * never a new permission. A refusal after visibility is not a rollback claim. */
34
- export declare function landPlaceActInProcess(context: PlaceActHostContext, ports: PlaceActHostPorts): Promise<{
35
- kind: "fact";
36
- value: {
37
- place: string;
38
- act: import("./ports/place-act.ts").PlaceActBundle & {
39
- readonly kind: "landed" | "once";
40
- readonly identity: string;
41
- };
42
- reading: string;
43
- result: string;
44
- commitment: string;
45
- };
46
- identity?: undefined;
47
- code?: undefined;
48
- diagnostic?: undefined;
49
- } | {
50
- kind: "uncertain";
51
- identity: string;
52
- code: string;
53
- diagnostic: string;
54
- value?: undefined;
55
- } | {
56
- kind: "refuse";
57
- code: string;
58
- diagnostic: string;
59
- value?: undefined;
60
- identity?: undefined;
61
- }>;
62
- /** Historical recovery after a lost response. No signer, current authorization
63
- * or publication callback is invoked and the result grants no new act. */
64
- export declare function recoverPlaceActInProcess(context: Pick<PlaceActHostContext, 'place' | 'identity' | 'reading' | 'storageLimits' | 'signal'>, ports: Pick<PlaceActHostPorts, 'instrumentName' | 'trust' | 'persistence' | 'limits'>): {
65
- kind: "fact";
66
- value: {
67
- place: string;
68
- identity: string;
69
- act: import("./ports/place-act.ts").PlaceActBundle;
70
- historical: true;
71
- reading: string;
72
- result: string;
73
- commitment: string;
74
- };
75
- code?: undefined;
76
- diagnostic?: undefined;
77
- } | {
78
- kind: "refuse";
79
- code: string;
80
- diagnostic: string;
81
- value?: undefined;
82
- };
@@ -1,46 +0,0 @@
1
- import type { ContentReadPort } from '../engine/ports.ts';
2
- import type { RootStandingHostContext } from './in-process.ts';
3
- /** Full contextual carrier, authenticated against receiver inputs only. It is a
4
- * data projection, not a current admission permit or a signed receipt. */
5
- export declare function readContextualStandingInProcess(context: RootStandingHostContext, ports: {
6
- readonly read: ContentReadPort;
7
- }): Promise<{
8
- kind: "fact";
9
- value: {
10
- place: string;
11
- standing: {
12
- profile: string;
13
- root: readonly string[];
14
- legacyPlaces: {
15
- namespace: string;
16
- place: string;
17
- standing: string[];
18
- history: readonly string[];
19
- }[];
20
- contexts: readonly import("./root-clock-source.ts").PortablePlaceContext[];
21
- places: {
22
- namespace: string;
23
- place: string;
24
- standing: string[];
25
- retracted: readonly string[];
26
- superseded: readonly string[];
27
- forks: readonly import("../fold/claims.ts").Fork[];
28
- contexts: {
29
- identity: string;
30
- context: string;
31
- receipts: readonly import("@lapxo/topos/wire").PlaceReceipt[];
32
- }[];
33
- }[];
34
- };
35
- reading: string;
36
- result: string;
37
- commitment: string;
38
- };
39
- code?: undefined;
40
- diagnostic?: undefined;
41
- } | {
42
- kind: "refuse";
43
- code: string;
44
- diagnostic: string;
45
- value?: undefined;
46
- }>;
@@ -1,117 +0,0 @@
1
- import { type ReadingIdentityContext } from '@lapxo/topos/contract';
2
- import { type ContentReadPort, type SigningPort, type PortLimits } from '../engine/ports.ts';
3
- import { type HostInstrumentRuntime } from './call-context.ts';
4
- import type { LocalActBundle } from './ports/local-act.ts';
5
- import type { PublicationStorage } from './ports/publication.ts';
6
- export interface RootLotContext {
7
- readonly place: string;
8
- readonly snapshot: string;
9
- readonly source: string;
10
- readonly digest: string;
11
- readonly reading: ReadingIdentityContext;
12
- readonly limits: PortLimits & {
13
- readonly records: number;
14
- };
15
- readonly signal?: AbortSignal;
16
- }
17
- /** The receiver selects the actual native place, instrument and signer. The lot
18
- * supplies only canonical unsigned Root configuration, never host capabilities. */
19
- export interface RootLotPorts {
20
- readonly root: string;
21
- readonly instrumentName: string;
22
- readonly runtime: HostInstrumentRuntime;
23
- readonly read: ContentReadPort;
24
- readonly signer: {
25
- readonly keyId: string;
26
- readonly name: string;
27
- readonly sign: SigningPort;
28
- };
29
- readonly storage?: PublicationStorage;
30
- readonly prepared?: (identity: string) => void;
31
- readonly limits: RootLotContext['limits'] & {
32
- readonly diagnostics: number;
33
- };
34
- }
35
- /** Snapshot identity, not a new wire, authority algorithm or current permit. */
36
- export declare const rootLotSnapshot: (root: string) => string;
37
- export declare function landRootLotInProcess(context: RootLotContext, ports: RootLotPorts): Promise<{
38
- kind: "refuse";
39
- code: string;
40
- diagnostics: {
41
- stream: "out" | "error";
42
- text: string;
43
- }[];
44
- value?: undefined;
45
- identity?: undefined;
46
- diagnostic?: undefined;
47
- } | {
48
- kind: "fact";
49
- value: {
50
- result: string;
51
- commitment: string;
52
- conformance: "refused" | "complete";
53
- reading: string;
54
- identity?: string | undefined;
55
- act?: import("@lapxo/topos/wire").ActResult | undefined;
56
- place: string;
57
- status: "once" | "landed" | "already-held";
58
- };
59
- diagnostics: {
60
- stream: "out" | "error";
61
- text: string;
62
- }[];
63
- code?: undefined;
64
- identity?: undefined;
65
- diagnostic?: undefined;
66
- } | {
67
- kind: "uncertain";
68
- identity: string;
69
- code: string;
70
- diagnostic: string;
71
- diagnostics: {
72
- stream: "out" | "error";
73
- text: string;
74
- }[];
75
- value?: undefined;
76
- } | {
77
- kind: "fact";
78
- value: {
79
- place: string;
80
- status: "once" | "landed";
81
- identity: string;
82
- conformance: "incomplete";
83
- };
84
- diagnostic: string;
85
- diagnostics: {
86
- stream: "out" | "error";
87
- text: string;
88
- }[];
89
- code?: undefined;
90
- identity?: undefined;
91
- } | {
92
- kind: "refuse";
93
- code: string;
94
- diagnostic: string;
95
- diagnostics: {
96
- stream: "out" | "error";
97
- text: string;
98
- }[];
99
- value?: undefined;
100
- identity?: undefined;
101
- }>;
102
- /** Authenticated historical query only; never revives authority or signs. */
103
- export declare function recoverRootActInProcess(identity: string, ports: Pick<RootLotPorts, 'root' | 'instrumentName' | 'runtime'>): {
104
- kind: "fact";
105
- value: {
106
- historical: true;
107
- act: import("@lapxo/topos/wire").ActResult;
108
- bundle: LocalActBundle;
109
- };
110
- code?: undefined;
111
- diagnostic?: undefined;
112
- } | {
113
- kind: "refuse";
114
- code: string;
115
- diagnostic: string;
116
- value?: undefined;
117
- };
@@ -1,41 +0,0 @@
1
- import type { Signer } from '@lapxo/topos/wire';
2
- import type { ReadingIdentityContext } from '@lapxo/topos/contract';
3
- import type { ContentReadPort, PortLimits } from '../engine/ports.ts';
4
- /** Initial read-only host slice. The receiver supplies the original anchor and
5
- * verified implementation/policy references; the offered bytes choose none of them.
6
- * Context references commit identity, not authority or conformance certification.
7
- */
8
- export interface RootStandingHostContext {
9
- readonly place: string;
10
- readonly source: string;
11
- readonly snapshot: string;
12
- readonly anchor: Signer;
13
- readonly reading: ReadingIdentityContext;
14
- readonly limits: PortLimits & {
15
- readonly records: number;
16
- };
17
- readonly signal?: AbortSignal;
18
- }
19
- export type RootStandingHostResult = {
20
- readonly kind: 'fact';
21
- readonly value: {
22
- readonly place: string;
23
- readonly rootStanding: readonly string[];
24
- readonly reading: string;
25
- readonly result: string;
26
- readonly commitment: string;
27
- };
28
- } | {
29
- readonly kind: 'refuse';
30
- readonly code: string;
31
- readonly diagnostic: string;
32
- };
33
- /** Uses the existing bounded content port, authority evaluator and projection.
34
- * It projects the Root component of a complete signed Root wire snapshot; it has no persistence callback,
35
- * current-root global, console output, process entry point or CLI subprocess.
36
- * Contextual places and their carriers are not this Root-only projection.
37
- * The returned commitment is unsigned and is not a paid native receipt.
38
- */
39
- export declare function readRootStandingInProcess(context: RootStandingHostContext, ports: {
40
- readonly read: ContentReadPort;
41
- }): Promise<RootStandingHostResult>;
@@ -1,35 +0,0 @@
1
- export interface ModuleClosureMember {
2
- readonly digest: string;
3
- readonly source: string;
4
- }
5
- export interface ModuleClosureSnapshot {
6
- readonly identity: string;
7
- readonly entry: string;
8
- readonly members: ReadonlyMap<string, ModuleClosureMember>;
9
- }
10
- export interface ModuleClosureReading {
11
- readonly snapshot: string;
12
- readonly coordinate: string;
13
- readonly digest: string;
14
- }
15
- export interface ModuleClosureLimits {
16
- readonly members: number;
17
- readonly bytes: number;
18
- readonly portableESM?: boolean;
19
- readonly signal?: AbortSignal;
20
- }
21
- /** Host-selected archive and entry, never a verifier assertion from the program.
22
- * This proves content identity only; standing admission and runtime capabilities
23
- * are separate prerequisites. Binary resources are not executable text members.
24
- */
25
- export declare function moduleSnapshot(archive: Uint8Array, expected: string, entry: string): ModuleClosureSnapshot;
26
- /** The host supplies authenticated snapshot identities and its library resolver.
27
- * Each reached text member is verified here against its exact UTF-8 bytes.
28
- * Authentication of the snapshot envelope remains a separate host prerequisite.
29
- * A capsule cannot select either verifier or resolver.
30
- * This reads declared module edges, not arbitrary I/O or a JavaScript sandbox. Computed edges are unpaid, never absent.
31
- * Activation requires an admitted host policy; existing inventory callers are not silently changed.
32
- */
33
- export declare function moduleClosure(snapshot: ModuleClosureSnapshot, library: (specifier: string, parent: ModuleClosureSnapshot) => ModuleClosureSnapshot | undefined): readonly ModuleClosureReading[];
34
- /** Multiple needs share the existing traversal and one optional act budget. */
35
- export declare function moduleClosures(snapshots: readonly ModuleClosureSnapshot[], library: (specifier: string, parent: ModuleClosureSnapshot) => ModuleClosureSnapshot | undefined, limits?: ModuleClosureLimits): readonly ModuleClosureReading[];
@@ -1,19 +0,0 @@
1
- import { type HostInstrumentRuntime } from './call-context.ts';
2
- export interface NativeHostInstrument {
3
- readonly name: string;
4
- readonly runtime: HostInstrumentRuntime;
5
- }
6
- /** Explicit installed/source ESM selection, never consumer argv or packet data.
7
- * Identity and public configuration do not certify implementation correctness. */
8
- export declare function nativeHostInstrument(root: string, entry: string): NativeHostInstrument;
9
- /** Bind existing native authority construction to an explicit instrument for
10
- * every later current/historical observation, not only the constructor call. */
11
- export declare function nativePlaceActReceiver(root: string, instrument: NativeHostInstrument): {
12
- selection: import("./place-clock-selection.ts").HostClockSelection;
13
- trust: {
14
- current: () => import("./ports/place-act.ts").PlaceActSnapshot;
15
- historical: (encoded: string) => import("@lapxo/topos/wire").TrustedClockContract;
16
- contract: import("@lapxo/topos/wire").TrustedClockContract;
17
- initialHeads: readonly import("./ports/place-act.ts").PlaceActHead[];
18
- };
19
- };
@@ -1,24 +0,0 @@
1
- import { type PlaceReceipt } from '@lapxo/topos/core';
2
- import type { PlaceActTrust, PlaceActBudget, PlaceActBundle, PlaceActHead } from './ports/place-act.ts';
3
- export { ActCommitUnknown as PlaceActCommitUnknown } from './commit-result.ts';
4
- /** Host-selected persistence, never supplied by offered content. exclusive must
5
- * share the CLI's region/authority/projection protocol. publish is synchronous
6
- * with exactly one atomic visibility point; a thrown reply may follow commit. */
7
- export interface PlaceActPersistence {
8
- readonly exclusive: <T>(regions: readonly string[], run: () => Promise<T>) => Promise<T>;
9
- readonly result: (identity: string, trust: PlaceActTrust, limits: PlaceActBudget) => PlaceActBundle | undefined;
10
- readonly inventory: (limits: PlaceActBudget) => {
11
- readonly names: readonly string[];
12
- readonly bytes: number;
13
- };
14
- readonly heads: (trust: PlaceActTrust, limits: PlaceActBudget) => readonly PlaceActHead[];
15
- readonly publish: (identity: string, files: Readonly<Record<string, string>>) => void;
16
- }
17
- export type PlaceActReceiptSource = readonly PlaceReceipt[] | (() => Promise<readonly PlaceReceipt[]>);
18
- /** Shared transaction, including historical replay, current authorization and
19
- * atomic publication. Signing may await; current Root and receiver heads are
20
- * checked again afterwards while the same exclusion remains held. */
21
- export declare function transactPlaceAct(encoded: string, source: PlaceActReceiptSource, trust: PlaceActTrust, limits: PlaceActBudget, persistence: PlaceActPersistence, signal?: AbortSignal): Promise<PlaceActBundle & {
22
- readonly kind: 'landed' | 'once';
23
- readonly identity: string;
24
- }>;
@@ -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
- };