@north-light/crouter 0.3.227 → 0.3.229
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/api/client.d.ts +5 -5
- package/dist/api/client.js +3 -3
- package/dist/api/dto/broker-ops.d.ts +8 -0
- package/dist/api/dto/memory.d.ts +8 -7
- package/dist/api/dto/memory.js +2 -2
- package/dist/builtin-memory/04-base-worker.md +1 -1
- package/dist/builtin-memory/insights/init.md +5 -5
- package/dist/builtin-memory/internal/INDEX.md +1 -1
- package/dist/builtin-memory/internal/agent-shaping.md +11 -11
- package/dist/builtin-memory/internal/examples/INDEX.md +1 -1
- package/dist/builtin-memory/internal/memory-loading.md +6 -6
- package/dist/builtin-memory/internal/plugins.md +1 -1
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/memory-slash-commands.ts +50 -37
- package/dist/clients/attach/__tests__/pane-tag-successor.test.js +56 -0
- package/dist/clients/attach/__tests__/profile-files.test.js +21 -0
- package/dist/clients/attach/chrome/inbox-strip.js +11 -7
- package/dist/clients/attach/session/pane-tag.d.ts +28 -2
- package/dist/clients/attach/session/pane-tag.js +48 -22
- package/dist/clients/attach/session/profile-files.d.ts +6 -0
- package/dist/clients/attach/session/profile-files.js +44 -11
- package/dist/clients/attach/slash/dispatch.js +4 -7
- package/dist/clients/attach/viewer.js +588 -596
- package/dist/commands/__tests__/surface-reload-target.test.js +21 -0
- package/dist/commands/api-client.d.ts +3 -7
- package/dist/commands/api-client.js +7 -12
- package/dist/commands/memory/__tests__/command-selector-and-mutation-guards.test.js +292 -0
- package/dist/commands/memory/__tests__/repository-root-lint.test.js +146 -0
- package/dist/commands/memory/delete.js +51 -24
- package/dist/commands/memory/edit.js +50 -10
- package/dist/commands/memory/find.js +105 -56
- package/dist/commands/memory/history.js +51 -31
- package/dist/commands/memory/lint.d.ts +0 -9
- package/dist/commands/memory/lint.js +78 -322
- package/dist/commands/memory/list.d.ts +12 -4
- package/dist/commands/memory/list.js +64 -25
- package/dist/commands/memory/move.js +103 -73
- package/dist/commands/memory/origin.js +35 -5
- package/dist/commands/memory/read.d.ts +4 -0
- package/dist/commands/memory/read.js +132 -80
- package/dist/commands/memory/shared.d.ts +115 -25
- package/dist/commands/memory/shared.js +331 -74
- package/dist/commands/memory/write.js +72 -21
- package/dist/commands/memory.js +2 -2
- package/dist/commands/node/create.d.ts +1 -1
- package/dist/commands/node/create.js +1 -1
- package/dist/commands/node/inspect.js +1 -1
- package/dist/commands/node/lifecycle.js +5 -5
- package/dist/commands/pkg/market-manage.js +25 -24
- package/dist/commands/pkg/plugin-manage.d.ts +22 -6
- package/dist/commands/pkg/plugin-manage.js +118 -25
- package/dist/commands/pkg/shared.d.ts +8 -0
- package/dist/commands/pkg/shared.js +23 -20
- package/dist/commands/surface-reload.d.ts +5 -0
- package/dist/commands/surface-reload.js +9 -1
- package/dist/commands/sys/__tests__/migrate.test.js +1140 -22
- package/dist/commands/sys/__tests__/sync-project-guidance.test.js +218 -0
- package/dist/commands/sys/migrate.js +126 -140
- package/dist/commands/sys/panels/profiles-panel.d.ts +66 -0
- package/dist/commands/sys/panels/profiles-panel.js +599 -0
- package/dist/commands/sys/settings-shell.d.ts +4 -2
- package/dist/commands/sys/settings-shell.js +35 -4
- package/dist/commands/sys/settings.js +21 -5
- package/dist/commands/sys/sync-deps.d.ts +2 -0
- package/dist/commands/sys/sync-deps.js +26 -15
- package/dist/commands/sys/sync-project-guidance.js +228 -145
- package/dist/commands/sys/sync-skills.js +28 -17
- package/dist/commands/sys/update.js +11 -3
- package/dist/core/__tests__/canvas-inbox-watcher-hold.test.js +15 -2
- package/dist/core/__tests__/config-change-delta.test.js +106 -0
- package/dist/core/__tests__/context-intro.test.js +13 -9
- package/dist/core/__tests__/daemon-boot.test.js +22 -16
- package/dist/core/__tests__/fixtures/memory-slash-live-probe.js +5 -1
- package/dist/core/__tests__/human-deliver.test.js +19 -0
- package/dist/core/__tests__/inline-memory-refs.test.js +50 -46
- package/dist/core/__tests__/{serial → integration}/broker-fork-seam.test.js +1 -1
- package/dist/core/__tests__/{serial → integration}/broker-sdk-wiring.test.js +1 -1
- package/dist/core/__tests__/{serial → integration}/broker-snapshot-history.test.js +1 -1
- package/dist/core/__tests__/{serial → integration}/command-plugins.test.js +94 -3
- package/dist/core/__tests__/{serial → integration}/deferred-no-wake.test.js +1 -1
- package/dist/core/__tests__/{serial → integration}/flagship-lifecycle.test.js +13 -27
- package/dist/core/__tests__/{serial → integration}/host-teardown-process-group.test.js +1 -1
- package/dist/core/__tests__/{serial → integration}/human-deliver-e2e.test.js +1 -1
- package/dist/core/__tests__/{live-mutation-verbs.test.js → integration/live-mutation-verbs.test.js} +22 -33
- package/dist/core/__tests__/{serial → integration}/live-mutation.test.js +21 -41
- package/dist/core/__tests__/integration/refresh-stall-recycle.test.d.ts +1 -0
- package/dist/core/__tests__/{serial → integration}/refresh-stall-recycle.test.js +1 -1
- package/dist/core/__tests__/integration/revive.test.d.ts +1 -0
- package/dist/core/__tests__/{serial → integration}/revive.test.js +38 -19
- package/dist/core/__tests__/integration/spawn-root.test.d.ts +1 -0
- package/dist/core/__tests__/{serial → integration}/spawn-root.test.js +104 -1
- package/dist/core/__tests__/integration/subscription-delivery.test.d.ts +1 -0
- package/dist/core/__tests__/{serial → integration}/subscription-delivery.test.js +1 -1
- package/dist/core/__tests__/integration/tmux-surface.test.d.ts +1 -0
- package/dist/core/__tests__/{serial → integration}/tmux-surface.test.js +1 -1
- package/dist/core/__tests__/integration/worktree-land.test.d.ts +1 -0
- package/dist/core/__tests__/integration/worktree-land.test.js +400 -0
- package/dist/core/__tests__/integration/worktree-reap.test.d.ts +1 -0
- package/dist/core/__tests__/{serial/worktree.test.js → integration/worktree-reap.test.js} +6 -338
- package/dist/core/__tests__/kickoff.test.js +16 -5
- package/dist/core/__tests__/memory-resolver-precedence.test.js +122 -91
- package/dist/core/__tests__/nested-store-discovery.test.js +5 -3
- package/dist/core/__tests__/on-read-crouter-home-fence.test.js +2 -1
- package/dist/core/__tests__/on-read-dedup-resume.test.js +39 -27
- package/dist/core/__tests__/on-read-nested-store.test.js +19 -13
- package/dist/core/__tests__/profile-project-memory-delivery.test.js +138 -44
- package/dist/core/__tests__/repository-association.test.d.ts +1 -0
- package/dist/core/__tests__/repository-association.test.js +153 -0
- package/dist/core/__tests__/repository-root-identity.test.d.ts +1 -0
- package/dist/core/__tests__/repository-root-identity.test.js +219 -0
- package/dist/core/__tests__/review-model-floor.test.js +12 -4
- package/dist/core/__tests__/seam/memory-slash-node-relative-inventory.test.js +27 -11
- package/dist/core/__tests__/warm-claim-preference-snapshot.test.d.ts +1 -0
- package/dist/core/__tests__/warm-claim-preference-snapshot.test.js +40 -0
- package/dist/core/canvas/canvas.d.ts +3 -0
- package/dist/core/canvas/canvas.js +30 -10
- package/dist/core/canvas/db.js +28 -1
- package/dist/core/canvas/paths.d.ts +4 -6
- package/dist/core/canvas/paths.js +8 -6
- package/dist/core/canvas/render-source.js +2 -2
- package/dist/core/canvas/types.d.ts +9 -13
- package/dist/core/config.d.ts +3 -3
- package/dist/core/config.js +3 -3
- package/dist/core/exclusive-lock.d.ts +2 -0
- package/dist/core/exclusive-lock.js +21 -0
- package/dist/core/git.d.ts +0 -1
- package/dist/core/git.js +0 -3
- package/dist/core/human/__tests__/integration/inbox-core.test.d.ts +1 -0
- package/dist/core/human/feedback-companion.js +3 -0
- package/dist/core/human/scan.js +8 -1
- package/dist/core/keybindings/catalog.d.ts +2 -2
- package/dist/core/keybindings/catalog.js +2 -1
- package/dist/core/memory/doc-link-grammar.js +2 -2
- package/dist/core/memory/history.d.ts +24 -0
- package/dist/core/memory/history.js +66 -1
- package/dist/core/memory/identity.d.ts +65 -0
- package/dist/core/memory/identity.js +185 -0
- package/dist/core/memory/inline-ref-guidance.d.ts +1 -1
- package/dist/core/memory/inline-ref-guidance.js +1 -1
- package/dist/core/memory/inline-ref-inventory.d.ts +3 -10
- package/dist/core/memory/inline-ref-inventory.js +30 -62
- package/dist/core/memory/lint.d.ts +129 -0
- package/dist/core/memory/lint.js +517 -0
- package/dist/core/memory/project-namespace.d.ts +31 -0
- package/dist/core/memory/project-namespace.js +85 -0
- package/dist/core/memory/repository-association.d.ts +31 -0
- package/dist/core/memory/repository-association.js +129 -0
- package/dist/core/memory/tree.d.ts +39 -0
- package/dist/core/memory/tree.js +93 -0
- package/dist/core/memory-resolver.d.ts +193 -90
- package/dist/core/memory-resolver.js +461 -375
- package/dist/core/nested-stores.js +6 -13
- package/dist/core/profiles/select.d.ts +4 -1
- package/dist/core/profiles/select.js +108 -48
- package/dist/core/review/__tests__/capture-origin.test.js +2 -2
- package/dist/core/review/__tests__/stage-identity.test.js +2 -2
- package/dist/core/review/companion.js +11 -2
- package/dist/core/runtime/bearings.d.ts +2 -2
- package/dist/core/runtime/bearings.js +3 -3
- package/dist/core/runtime/broker/daemon-ops.d.ts +2 -2
- package/dist/core/runtime/broker/rebind.js +5 -0
- package/dist/core/runtime/broker-extension-render.d.ts +7 -3
- package/dist/core/runtime/broker-extension-render.js +10 -5
- package/dist/core/runtime/broker-persona-guidance.d.ts +19 -5
- package/dist/core/runtime/broker-persona-guidance.js +122 -27
- package/dist/core/runtime/deliver-live.d.ts +16 -4
- package/dist/core/runtime/deliver-live.js +29 -15
- package/dist/core/runtime/kickoff.d.ts +3 -3
- package/dist/core/runtime/kickoff.js +8 -16
- package/dist/core/runtime/launch.js +1 -1
- package/dist/core/runtime/lifecycle.js +2 -3
- package/dist/core/runtime/nodes.d.ts +3 -4
- package/dist/core/runtime/nodes.js +3 -4
- package/dist/core/runtime/persona.d.ts +8 -12
- package/dist/core/runtime/persona.js +24 -96
- package/dist/core/runtime/promote.d.ts +2 -2
- package/dist/core/runtime/promote.js +8 -21
- package/dist/core/runtime/revive.js +20 -17
- package/dist/core/runtime/spawn.js +18 -7
- package/dist/core/runtime/tmux-bindings.js +2 -3
- package/dist/core/runtime/warm-pool.js +3 -4
- package/dist/core/scope.js +2 -0
- package/dist/core/self-update.d.ts +0 -2
- package/dist/core/self-update.js +2 -35
- package/dist/core/substrate/__tests__/surface-match-memory-read.test.d.ts +1 -0
- package/dist/core/substrate/__tests__/surface-match-memory-read.test.js +28 -0
- package/dist/core/substrate/index.d.ts +2 -2
- package/dist/core/substrate/index.js +1 -1
- package/dist/core/substrate/injected-store.d.ts +43 -27
- package/dist/core/substrate/injected-store.js +208 -104
- package/dist/core/substrate/listings.d.ts +19 -12
- package/dist/core/substrate/listings.js +75 -52
- package/dist/core/substrate/on-read-node.d.ts +4 -7
- package/dist/core/substrate/on-read-node.js +6 -8
- package/dist/core/substrate/on-read.d.ts +22 -25
- package/dist/core/substrate/on-read.js +103 -147
- package/dist/core/substrate/render-node.d.ts +4 -7
- package/dist/core/substrate/render-node.js +5 -7
- package/dist/core/substrate/render.d.ts +21 -3
- package/dist/core/substrate/render.js +291 -223
- package/dist/core/substrate/schema.d.ts +1 -13
- package/dist/core/substrate/schema.js +5 -40
- package/dist/core/substrate/session-cache.d.ts +14 -4
- package/dist/core/substrate/session-cache.js +40 -22
- package/dist/core/substrate/surface-match.d.ts +9 -7
- package/dist/core/substrate/surface-match.js +26 -25
- package/dist/daemon/__tests__/helpers/source-daemon.d.ts +30 -0
- package/dist/daemon/__tests__/helpers/source-daemon.js +174 -0
- package/dist/daemon/__tests__/integration/migration-startup.test.d.ts +1 -0
- package/dist/daemon/__tests__/integration/migration-startup.test.js +97 -0
- package/dist/daemon/api/__tests__/bridge-heartbeat.test.js +21 -5
- package/dist/daemon/api/handlers/broker-ops.js +21 -16
- package/dist/daemon/api/handlers/memory.js +2 -0
- package/dist/daemon/crtrd.js +2 -0
- package/dist/daemon/human/finish.js +8 -1
- package/dist/daemon/manage.d.ts +0 -1
- package/dist/daemon/manage.js +7 -16
- package/dist/daemon/startup-policy.d.ts +1 -0
- package/dist/daemon/startup-policy.js +1 -0
- package/dist/migrations/001-surfaces-frontmatter.js +21 -109
- package/dist/migrations/002-profile-project-memory.js +1 -0
- package/dist/migrations/003-repository-root-memory-identity/front-door.d.ts +26 -0
- package/dist/migrations/003-repository-root-memory-identity/front-door.js +231 -0
- package/dist/migrations/003-repository-root-memory-identity/index.d.ts +2 -0
- package/dist/migrations/003-repository-root-memory-identity/index.js +513 -0
- package/dist/migrations/003-repository-root-memory-identity/references.d.ts +95 -0
- package/dist/migrations/003-repository-root-memory-identity/references.js +469 -0
- package/dist/migrations/003-repository-root-memory-identity/repository-facts.d.ts +39 -0
- package/dist/migrations/003-repository-root-memory-identity/repository-facts.js +349 -0
- package/dist/migrations/__tests__/activation-concurrency.test.d.ts +1 -0
- package/dist/migrations/__tests__/activation-concurrency.test.js +145 -0
- package/dist/migrations/__tests__/activation.test.d.ts +1 -0
- package/dist/migrations/__tests__/activation.test.js +149 -0
- package/dist/migrations/__tests__/deletion-and-root-declaration.test.d.ts +1 -0
- package/dist/migrations/__tests__/deletion-and-root-declaration.test.js +149 -0
- package/dist/migrations/activation.d.ts +16 -0
- package/dist/migrations/activation.js +78 -0
- package/dist/migrations/convergent.d.ts +14 -3
- package/dist/migrations/convergent.js +21 -10
- package/dist/migrations/corpus.d.ts +78 -0
- package/dist/migrations/corpus.js +497 -0
- package/dist/migrations/frontmatter-splice.d.ts +15 -0
- package/dist/migrations/frontmatter-splice.js +176 -0
- package/dist/migrations/registry.d.ts +6 -1
- package/dist/migrations/registry.js +7 -2
- package/dist/migrations/runner.d.ts +41 -0
- package/dist/migrations/runner.js +81 -0
- package/dist/migrations/types.d.ts +148 -9
- package/dist/migrations/types.js +9 -2
- package/dist/pi-extensions/__tests__/canvas-context-intro.test.js +225 -17
- package/dist/pi-extensions/__tests__/canvas-goal-capture-envelope.test.js +11 -3
- package/dist/pi-extensions/canvas-context-intro.d.ts +3 -5
- package/dist/pi-extensions/canvas-context-intro.js +50 -46
- package/dist/pi-extensions/canvas-doc-substrate.d.ts +1 -8
- package/dist/pi-extensions/canvas-doc-substrate.js +55 -122
- package/dist/pi-extensions/canvas-stophook.js +6 -13
- package/dist/shared/generated-context.d.ts +0 -3
- package/dist/shared/generated-context.js +0 -57
- package/dist/shared/tool-groups.js +2 -3
- package/dist/types.d.ts +8 -11
- package/dist/types.js +4 -31
- package/package.json +5 -4
- package/runtime.lock.json +2 -2
- package/dist/builtin-memory/05-kinds/design/00-base.md +0 -17
- package/dist/builtin-memory/05-kinds/design/01-orchestrator.md +0 -15
- package/dist/builtin-memory/05-kinds/design/design-contract.md +0 -19
- package/dist/builtin-memory/05-kinds/developer/00-base.md +0 -17
- package/dist/builtin-memory/05-kinds/developer/01-orchestrator.md +0 -15
- package/dist/builtin-memory/05-kinds/plan/00-base.md +0 -17
- package/dist/builtin-memory/05-kinds/plan/01-orchestrator.md +0 -17
- package/dist/builtin-memory/05-kinds/plan/plan-contract.md +0 -28
- package/dist/builtin-memory/05-kinds/plan/reviewers/architecture-fit.md +0 -15
- package/dist/builtin-memory/05-kinds/plan/reviewers/code-smells.md +0 -15
- package/dist/builtin-memory/05-kinds/plan/reviewers/lens-contract.md +0 -13
- package/dist/builtin-memory/05-kinds/plan/reviewers/pattern-consistency.md +0 -17
- package/dist/builtin-memory/05-kinds/plan/reviewers/requirements-coverage.md +0 -17
- package/dist/builtin-memory/05-kinds/plan/reviewers/security.md +0 -17
- package/dist/builtin-memory/05-kinds/spec/00-base.md +0 -17
- package/dist/builtin-memory/05-kinds/spec/01-orchestrator.md +0 -15
- package/dist/builtin-memory/05-kinds/spec/requirements.md +0 -15
- package/dist/builtin-memory/design/guide.md +0 -35
- package/dist/builtin-memory/design/roadmap.md +0 -21
- package/dist/builtin-memory/development.md +0 -113
- package/dist/builtin-memory/plan/roadmap.md +0 -25
- package/dist/builtin-memory/spec/guide.md +0 -53
- package/dist/builtin-memory/spec/requirements.md +0 -29
- package/dist/builtin-memory/spec/roadmap.md +0 -36
- package/dist/builtin-memory/testing.md +0 -39
- /package/dist/api/__tests__/{serial → integration}/client.test.d.ts +0 -0
- /package/dist/api/__tests__/{serial → integration}/client.test.js +0 -0
- /package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/{serial → integration}/provider-rotation.test.ts +0 -0
- /package/dist/clients/{inbox/__tests__/serial/inbox-controller.test.d.ts → attach/__tests__/pane-tag-successor.test.d.ts} +0 -0
- /package/dist/clients/{inbox/__tests__/serial/mount-panel.test.d.ts → attach/__tests__/profile-files.test.d.ts} +0 -0
- /package/dist/{core/__tests__/live-mutation-verbs.test.d.ts → clients/inbox/__tests__/integration/inbox-controller.test.d.ts} +0 -0
- /package/dist/clients/inbox/__tests__/{serial → integration}/inbox-controller.test.js +0 -0
- /package/dist/{core/__tests__/serial/broker-fork-seam.test.d.ts → clients/inbox/__tests__/integration/mount-panel.test.d.ts} +0 -0
- /package/dist/clients/inbox/__tests__/{serial → integration}/mount-panel.test.js +0 -0
- /package/dist/{core/__tests__/serial/broker-sdk-wiring.test.d.ts → commands/__tests__/surface-reload-target.test.d.ts} +0 -0
- /package/dist/{core/__tests__/serial/broker-snapshot-history.test.d.ts → commands/memory/__tests__/command-selector-and-mutation-guards.test.d.ts} +0 -0
- /package/dist/{core/__tests__/serial/command-plugins.test.d.ts → commands/memory/__tests__/repository-root-lint.test.d.ts} +0 -0
- /package/dist/{core/__tests__/serial/deferred-no-wake.test.d.ts → commands/sys/__tests__/sync-project-guidance.test.d.ts} +0 -0
- /package/dist/core/__tests__/{serial/flagship-lifecycle.test.d.ts → config-change-delta.test.d.ts} +0 -0
- /package/dist/core/__tests__/{serial/host-teardown-process-group.test.d.ts → integration/broker-fork-seam.test.d.ts} +0 -0
- /package/dist/core/__tests__/{serial/human-deliver-e2e.test.d.ts → integration/broker-sdk-wiring.test.d.ts} +0 -0
- /package/dist/core/__tests__/{serial/live-mutation.test.d.ts → integration/broker-snapshot-history.test.d.ts} +0 -0
- /package/dist/core/__tests__/{serial/refresh-stall-recycle.test.d.ts → integration/command-plugins.test.d.ts} +0 -0
- /package/dist/core/__tests__/{serial/revive.test.d.ts → integration/deferred-no-wake.test.d.ts} +0 -0
- /package/dist/core/__tests__/{serial/spawn-root.test.d.ts → integration/flagship-lifecycle.test.d.ts} +0 -0
- /package/dist/core/__tests__/{serial/subscription-delivery.test.d.ts → integration/host-teardown-process-group.test.d.ts} +0 -0
- /package/dist/core/__tests__/{serial/tmux-surface.test.d.ts → integration/human-deliver-e2e.test.d.ts} +0 -0
- /package/dist/core/__tests__/{serial/worktree.test.d.ts → integration/live-mutation-verbs.test.d.ts} +0 -0
- /package/dist/core/{human/__tests__/serial/inbox-core.test.d.ts → __tests__/integration/live-mutation.test.d.ts} +0 -0
- /package/dist/core/human/__tests__/{serial → integration}/inbox-core.test.js +0 -0
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
// Promotion
|
|
1
|
+
// Promotion changes mode, optionally kind/lifecycle, rebuilds the durable launch
|
|
2
|
+
// spec, and seeds a roadmap. In the current context, the broker's provider gate
|
|
3
|
+
// appends pending transition context before the next response. A fresh context
|
|
4
|
+
// instead boots from current system and bearings snapshots.
|
|
2
5
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// node's mode and (optionally) its KIND, REWRITES its launch spec to that
|
|
6
|
-
// kind's orchestrator persona (so the next revive comes back as that
|
|
7
|
-
// orchestrator), and seeds a roadmap scaffold.
|
|
8
|
-
// The transition guidance the node needs is injected CENTRALLY by the
|
|
9
|
-
// persona injector (runtime/persona.ts) at the turn boundary — promote()
|
|
10
|
-
// itself returns no guidance and emits none by hand.
|
|
11
|
-
// 2. Refresh → persona swap (permanent). On the next fresh revive the node
|
|
12
|
-
// starts with the orchestrator system prompt baked in (because the launch
|
|
13
|
-
// spec now says orchestrator). The injected guidance bridges until then.
|
|
14
|
-
//
|
|
15
|
-
// Mode and lifecycle are ORTHOGONAL: promotion flips mode only. Lifecycle stays
|
|
16
|
-
// whatever it was (a promoted child is terminal/orchestrator — still reports up
|
|
17
|
-
// + reaps) unless the caller passes `resident:true` to also make it resident.
|
|
18
|
-
//
|
|
19
|
-
// Trigger is persistence-need (deliberate, or a refresh-yield with open work),
|
|
20
|
-
// never the mere act of spawning a child.
|
|
6
|
+
// Mode and lifecycle remain orthogonal: promotion changes lifecycle only when
|
|
7
|
+
// the caller explicitly requests residency.
|
|
21
8
|
import { getNode, updateNode } from '../canvas/index.js';
|
|
22
9
|
import { transition } from './lifecycle.js';
|
|
23
10
|
import { ensureDaemon } from '../../daemon/manage.js';
|
|
@@ -68,8 +55,8 @@ export async function reshapeNodeAsync(nodeId, opts = {}, beforePersist) {
|
|
|
68
55
|
* `developer.orchestrator`) and optionally also making it resident. Idempotent:
|
|
69
56
|
* re-promoting just rewrites the spec. Seeds a roadmap SCAFFOLD if absent (a
|
|
70
57
|
* boss with no map is a failure mode) — no goal is forced here; authoring the
|
|
71
|
-
* goal + roadmap is the node's next act.
|
|
72
|
-
*
|
|
58
|
+
* goal + roadmap is the node's next act. Pending context delivery is owned by
|
|
59
|
+
* the broker provider gate, not this command. */
|
|
73
60
|
export function promote(nodeId, opts = {}) {
|
|
74
61
|
const node = getNode(nodeId);
|
|
75
62
|
if (node === null)
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
// reviveNode remains the ONLY sanctioned launcher of the node engine.
|
|
23
23
|
import { existsSync } from 'node:fs';
|
|
24
24
|
import { isAbsolute } from 'node:path';
|
|
25
|
-
import { getNode, updateNode, clearPid, recordPid, fullName, subscribersOf, } from '../canvas/index.js';
|
|
25
|
+
import { findNodeBySessionFile, getNode, updateNode, clearPid, recordPid, fullName, subscribersOf, } from '../canvas/index.js';
|
|
26
26
|
import { cancelCronsOnWake } from '../canvas/crons.js';
|
|
27
27
|
import { transition } from './lifecycle.js';
|
|
28
28
|
import { fanDoctrineWake } from './close.js';
|
|
@@ -33,7 +33,7 @@ import { readRoadmap } from './roadmap.js';
|
|
|
33
33
|
import { headlessBrokerHost } from './host.js';
|
|
34
34
|
import { boundFleet } from './fleet.js';
|
|
35
35
|
import { clearFault, beginBootFaultAttempt } from './fault.js';
|
|
36
|
-
import {
|
|
36
|
+
import { clearContextExposureState, initializeForkContextExposure, } from '../substrate/injected-store.js';
|
|
37
37
|
import { rootOfSpine } from './nodes.js';
|
|
38
38
|
import { isReviewCompanionBound } from '../review/companion.js';
|
|
39
39
|
import { assertProfileActive } from '../profiles/manifest.js';
|
|
@@ -153,16 +153,22 @@ export function reviveNode(nodeId, opts) {
|
|
|
153
153
|
meta.pi_session_file = null;
|
|
154
154
|
}
|
|
155
155
|
// An ordinary fork remains a birth until session_start records the child
|
|
156
|
-
// session.
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
156
|
+
// session. Every retry replays the resolved immutable source file.
|
|
157
|
+
const forkBirthUnbound = meta.fork_from != null && meta.pi_session_id == null;
|
|
158
|
+
const forkSourceFile = meta.fork_source_file;
|
|
159
|
+
if (forkBirthUnbound && (typeof forkSourceFile !== 'string' || !isAbsolute(forkSourceFile))) {
|
|
160
|
+
throw new InputError({
|
|
161
|
+
error: 'fork_source_invalid',
|
|
162
|
+
message: `${nodeId} cannot be revived — its resolved fork source file is missing or invalid.`,
|
|
163
|
+
next: `Restore the node's fork source metadata, then retry \`crtr node lifecycle revive ${nodeId}\`.`,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
const forkBirthPending = forkBirthUnbound && typeof forkSourceFile === 'string';
|
|
167
|
+
if (forkBirthPending && !existsSync(forkSourceFile)) {
|
|
162
168
|
throw new InputError({
|
|
163
169
|
error: 'fork_from_missing',
|
|
164
|
-
message: `${nodeId} cannot be revived — its fork source no longer exists: ${
|
|
165
|
-
next: `Restore ${
|
|
170
|
+
message: `${nodeId} cannot be revived — its fork source no longer exists: ${forkSourceFile}`,
|
|
171
|
+
next: `Restore ${forkSourceFile}, or update the node's fork source, then retry \`crtr node lifecycle revive ${nodeId}\`.`,
|
|
166
172
|
});
|
|
167
173
|
}
|
|
168
174
|
// Every (re)launch is a new cycle — bump the counter so CRTR_CYCLES and the
|
|
@@ -220,10 +226,10 @@ export function reviveNode(nodeId, opts) {
|
|
|
220
226
|
if (forkBirthPending) {
|
|
221
227
|
const goal = readGoal(nodeId);
|
|
222
228
|
inv = buildPiArgv(meta, {
|
|
223
|
-
forkFrom:
|
|
229
|
+
forkFrom: forkSourceFile,
|
|
224
230
|
...(goal != null && goal !== '' ? { prompt: goal } : {}),
|
|
225
231
|
});
|
|
226
|
-
|
|
232
|
+
initializeForkContextExposure(nodeId, findNodeBySessionFile(forkSourceFile)?.node_id ?? null);
|
|
227
233
|
}
|
|
228
234
|
else if (resuming) {
|
|
229
235
|
inv = buildPiArgv(meta, {
|
|
@@ -241,7 +247,7 @@ export function reviveNode(nodeId, opts) {
|
|
|
241
247
|
// interactive node boots promptless and takes no turn at all.
|
|
242
248
|
const goal = readGoal(nodeId)?.trim();
|
|
243
249
|
inv = buildPiArgv(meta, goal !== undefined && goal !== '' ? { prompt: goal } : {});
|
|
244
|
-
|
|
250
|
+
clearContextExposureState(nodeId);
|
|
245
251
|
}
|
|
246
252
|
else {
|
|
247
253
|
// Fresh or cycling: drain the one-shot bearings, then build the kickoff.
|
|
@@ -254,10 +260,7 @@ export function reviveNode(nodeId, opts) {
|
|
|
254
260
|
...resume,
|
|
255
261
|
prompt: buildReviveKickoff(meta, bearings, opts.wakeReason === 'runtime-restart-abort' ? undefined : opts.wakeReason),
|
|
256
262
|
});
|
|
257
|
-
|
|
258
|
-
// dedup so it surfaces docs from scratch (a true resume above instead KEEPS
|
|
259
|
-
// the persisted set, continuing the same transcript).
|
|
260
|
-
clearInjectedDocs(nodeId);
|
|
263
|
+
clearContextExposureState(nodeId);
|
|
261
264
|
}
|
|
262
265
|
// Every lifecycle launch emits the authoritative spine root rather than
|
|
263
266
|
// inheriting whichever node happened to invoke reviveNode.
|
|
@@ -21,7 +21,7 @@ import { writeGoal } from './kickoff.js';
|
|
|
21
21
|
import { appendSituationalContext, formatSituationalProse } from './situational-context.js';
|
|
22
22
|
import { hasRoadmap, seedRoadmap } from './roadmap.js';
|
|
23
23
|
import { buildWakeBearings } from './bearings.js';
|
|
24
|
-
import { contextDir, getNode, fullName, recordPid } from '../canvas/index.js';
|
|
24
|
+
import { canonicalSessionFile, contextDir, findNodeBySessionFile, getNode, fullName, recordPid } from '../canvas/index.js';
|
|
25
25
|
import { jobDir } from '../canvas/paths.js';
|
|
26
26
|
import { openViewerWindow, focusOf, windowOfPane, currentTmux, focusWindow, } from './placement.js';
|
|
27
27
|
import { waitForBrokerViewSocket } from './placement-tmux.js';
|
|
@@ -33,6 +33,7 @@ import { ensureDaemon } from '../../daemon/manage.js';
|
|
|
33
33
|
import { readConfig } from '../config.js';
|
|
34
34
|
import { modelRequestFromConfig, unregisteredConcreteModel } from '../model-routes.js';
|
|
35
35
|
import { openModelRegistry } from './model-registry.js';
|
|
36
|
+
import { initializeForkContextExposure } from '../substrate/injected-store.js';
|
|
36
37
|
// ---------------------------------------------------------------------------
|
|
37
38
|
// Shared broker-launch wrapper — catch launch/preflight failures at the call
|
|
38
39
|
// site, mark the node crashed, then rethrow a clear error.
|
|
@@ -112,7 +113,7 @@ function resolveSessionUuid(uuid) {
|
|
|
112
113
|
next: 'Pass the full session uuid or an absolute .jsonl path to disambiguate.',
|
|
113
114
|
});
|
|
114
115
|
}
|
|
115
|
-
return hit[0].path;
|
|
116
|
+
return canonicalSessionFile(hit[0].path);
|
|
116
117
|
}
|
|
117
118
|
/** Resolve a `--fork-from` value to an ABSOLUTE `.jsonl` source path for the
|
|
118
119
|
* broker fork (`SessionManager.forkFrom`, which loads a file — never a bare id).
|
|
@@ -127,7 +128,7 @@ export function resolveForkSource(value) {
|
|
|
127
128
|
// A path (contains `/` or ends `.jsonl`) is a session file — ensure it is
|
|
128
129
|
// ABSOLUTE so the broker, launched in a different cwd, still resolves it.
|
|
129
130
|
if (v.includes('/') || v.endsWith('.jsonl')) {
|
|
130
|
-
return isAbsolute(v) ? v : resolve(process.cwd(), v);
|
|
131
|
+
return canonicalSessionFile(isAbsolute(v) ? v : resolve(process.cwd(), v));
|
|
131
132
|
}
|
|
132
133
|
// A live node id — fork from the conversation it has accumulated. Its captured
|
|
133
134
|
// session FILE is absolute; the broker cannot fork a bare session id.
|
|
@@ -139,7 +140,7 @@ export function resolveForkSource(value) {
|
|
|
139
140
|
next: 'Pick a node that has captured a session, or drop --fork-from.',
|
|
140
141
|
});
|
|
141
142
|
}
|
|
142
|
-
return src;
|
|
143
|
+
return canonicalSessionFile(src);
|
|
143
144
|
}
|
|
144
145
|
// Not a known node — a bare/partial pi session uuid; resolve it to an absolute
|
|
145
146
|
// .jsonl (the broker fork won't resolve a uuid).
|
|
@@ -242,6 +243,9 @@ export async function spawnChildPrepared(opts, beforeBrokerLaunch) {
|
|
|
242
243
|
const preflightLaunch = (await buildLaunchSpecAsync(opts.kind, mode, { lifecycle, hasManager: !root, model: opts.model, cwd: opts.cwd, profileId })).launch;
|
|
243
244
|
await assertLaunchModelRegistered(requestFromLaunch(preflightLaunch), { cwd: opts.cwd, profileId });
|
|
244
245
|
const forkFrom = opts.forkFrom !== undefined ? resolveForkSource(opts.forkFrom) : undefined;
|
|
246
|
+
const forkSourceNodeId = forkFrom === undefined
|
|
247
|
+
? null
|
|
248
|
+
: findNodeBySessionFile(forkFrom)?.node_id ?? null;
|
|
245
249
|
let managedWorktree;
|
|
246
250
|
let spawnCwd = opts.cwd;
|
|
247
251
|
try {
|
|
@@ -274,15 +278,22 @@ export async function spawnChildPrepared(opts, beforeBrokerLaunch) {
|
|
|
274
278
|
parent: root ? null : spawner,
|
|
275
279
|
spawnedBy: root ? (spawner ?? undefined) : undefined,
|
|
276
280
|
profile_id: profileId,
|
|
277
|
-
// Persist the RAW fork reference (not the resolved path) as provenance, so
|
|
278
|
-
// the boot intro can detect this is a fork and re-assert the node's own
|
|
279
|
-
// identity over the source's copied-in conversation.
|
|
280
281
|
forkFrom: opts.forkFrom,
|
|
282
|
+
forkSourceFile: forkFrom,
|
|
281
283
|
modelOverride: opts.model,
|
|
282
284
|
...(managedWorktree !== undefined ? { managedWorktree } : {}),
|
|
283
285
|
...(nodeId !== undefined ? { nodeId } : {}),
|
|
284
286
|
launch,
|
|
285
287
|
});
|
|
288
|
+
if (opts.forkFrom !== undefined) {
|
|
289
|
+
try {
|
|
290
|
+
initializeForkContextExposure(meta.node_id, forkSourceNodeId);
|
|
291
|
+
}
|
|
292
|
+
catch (error) {
|
|
293
|
+
transition(meta.node_id, 'crash');
|
|
294
|
+
throw error;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
286
297
|
// Persist the task as the child's goal for a fresh revive to re-read.
|
|
287
298
|
writeGoal(meta.node_id, opts.prompt);
|
|
288
299
|
// Hidden ambient context, written BEFORE the engine launches so canvas-
|
|
@@ -19,9 +19,8 @@ const LEAF_MENU_ACTIONS = {
|
|
|
19
19
|
'crtr.tmux.menu.promote': { description: 'promote to orchestrator', action: { kind: 'keys', keys: '/promote' } },
|
|
20
20
|
'crtr.tmux.menu.resume': { description: 'find node', action: { kind: 'keys', keys: '/resume-node' } },
|
|
21
21
|
'crtr.tmux.menu.fork': { description: 'fork into idle root', action: { kind: 'direct', run: 'node fork --pane {pane}' } },
|
|
22
|
-
// Mode demote is the mirror of `/promote`: `node config`
|
|
23
|
-
//
|
|
24
|
-
// guidance at the node's next turn boundary.
|
|
22
|
+
// Mode demote is the mirror of `/promote`: `node config` persists the change;
|
|
23
|
+
// the broker appends its pending context before the next provider response.
|
|
25
24
|
'crtr.tmux.menu.demote-mode': { description: 'demote to base node', action: { kind: 'command', run: 'node config --mode base --pane {pane}' } },
|
|
26
25
|
'crtr.tmux.menu.demote': { description: 'demote to terminal (finish when done)', action: { kind: 'command', run: 'node lifecycle demote --pane {pane}' } },
|
|
27
26
|
'crtr.tmux.menu.make-resident': { description: 'make resident (interactable)', action: { kind: 'command', run: 'node config --lifecycle resident --pane {pane}' } },
|
|
@@ -17,9 +17,8 @@
|
|
|
17
17
|
// `promote`/`yield --kind` polymorph rewrites them, so the next revive comes
|
|
18
18
|
// back as the claimed persona and `nodeEnv`'s CRTR_KIND/CRTR_MODE flip for
|
|
19
19
|
// anything the live process spawns.
|
|
20
|
-
// • persona_ack — stamped to the claimed
|
|
21
|
-
//
|
|
22
|
-
// tells a brand-new node its persona just changed.
|
|
20
|
+
// • persona_ack — stamped to the claimed persona so a newborn has no pending
|
|
21
|
+
// transition on its first turn.
|
|
23
22
|
// • model — swapped over the live broker socket (`setModelLive`, the same
|
|
24
23
|
// seam provider rotation uses). A model swap that cannot reach the broker
|
|
25
24
|
// FAILS the claim: the spare is closed and the caller cold-spawns, because
|
|
@@ -133,7 +132,7 @@ export async function claimWarmNode(request) {
|
|
|
133
132
|
// back as the spare's persona.
|
|
134
133
|
launch: recipe.launch,
|
|
135
134
|
// A newborn must not be told its persona just changed.
|
|
136
|
-
persona_ack: { mode: request.mode, lifecycle: 'resident' },
|
|
135
|
+
persona_ack: { kind: request.kind, mode: request.mode, lifecycle: 'resident' },
|
|
137
136
|
...(request.model !== null ? { model_override: request.model } : {}),
|
|
138
137
|
});
|
|
139
138
|
// Bearings FIRST, before any other delivery: a spare mints without them (see
|
package/dist/core/scope.js
CHANGED
|
@@ -6,6 +6,7 @@ import { assetRoot } from './asset-root.js';
|
|
|
6
6
|
import { usage } from './errors.js';
|
|
7
7
|
import { loadProfileManifest } from './profiles/manifest.js';
|
|
8
8
|
import { realpathOrSelf } from './fs-utils.js';
|
|
9
|
+
import { resetRepositoryAssociationCache } from './memory/repository-association.js';
|
|
9
10
|
/** The ceiling a project root carries when no profile relationship contributes
|
|
10
11
|
* it — the top rung, i.e. no cap at all. */
|
|
11
12
|
export const NEUTRAL_PROJECT_MEMORY = 'content';
|
|
@@ -248,4 +249,5 @@ export function listScopes(scopeArg) {
|
|
|
248
249
|
}
|
|
249
250
|
export function resetScopeCache() {
|
|
250
251
|
scopeRootsCache.clear();
|
|
252
|
+
resetRepositoryAssociationCache();
|
|
251
253
|
}
|
|
@@ -7,8 +7,6 @@ export declare function selfCheck(): {
|
|
|
7
7
|
current: string;
|
|
8
8
|
latest: string;
|
|
9
9
|
} | null;
|
|
10
|
-
/** Pull updates for all installed marketplaces and standalone plugins. */
|
|
11
|
-
export declare function contentUpdate(): void;
|
|
12
10
|
export interface ContentUpdateEntry {
|
|
13
11
|
name: string;
|
|
14
12
|
kind: 'marketplace' | 'plugin';
|
package/dist/core/self-update.js
CHANGED
|
@@ -6,10 +6,8 @@ import { fileURLToPath } from 'node:url';
|
|
|
6
6
|
import { join, dirname } from 'node:path';
|
|
7
7
|
import { readFileSync } from 'node:fs';
|
|
8
8
|
import { listAllPlugins, listAllMarketplaces } from './resolver.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { nowIso } from './fs-utils.js';
|
|
12
|
-
import { general, network } from './errors.js';
|
|
9
|
+
import { fetch, currentSha, remoteSha } from './git.js';
|
|
10
|
+
import { general } from './errors.js';
|
|
13
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
14
12
|
const __dirname = dirname(__filename);
|
|
15
13
|
// src/core/self-update.ts → up to src/ → up to pkg root
|
|
@@ -39,37 +37,6 @@ export function selfCheck() {
|
|
|
39
37
|
const current = currentVersion();
|
|
40
38
|
return { current, latest };
|
|
41
39
|
}
|
|
42
|
-
/** Pull updates for all installed marketplaces and standalone plugins. */
|
|
43
|
-
export function contentUpdate() {
|
|
44
|
-
const marketplaces = listAllMarketplaces();
|
|
45
|
-
for (const mkt of marketplaces) {
|
|
46
|
-
const res = pull(mkt.root);
|
|
47
|
-
if (res.status !== 0) {
|
|
48
|
-
throw network(`git pull failed for marketplace ${mkt.name}: ${res.stderr.trim()}`);
|
|
49
|
-
}
|
|
50
|
-
updateState(mkt.scope, (s) => {
|
|
51
|
-
if (!s.marketplaces[mkt.name])
|
|
52
|
-
s.marketplaces[mkt.name] = {};
|
|
53
|
-
s.marketplaces[mkt.name].last_updated = nowIso();
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
const plugins = listAllPlugins();
|
|
57
|
-
for (const plugin of plugins) {
|
|
58
|
-
if (!plugin.enabled)
|
|
59
|
-
continue;
|
|
60
|
-
if (plugin.sourceMarketplace)
|
|
61
|
-
continue;
|
|
62
|
-
const res = pull(plugin.root);
|
|
63
|
-
if (res.status !== 0) {
|
|
64
|
-
throw network(`git pull failed for plugin ${plugin.name}: ${res.stderr.trim()}`);
|
|
65
|
-
}
|
|
66
|
-
updateState(plugin.scope, (s) => {
|
|
67
|
-
if (!s.plugins[plugin.name])
|
|
68
|
-
s.plugins[plugin.name] = {};
|
|
69
|
-
s.plugins[plugin.name].last_updated = nowIso();
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
40
|
/** Check whether any marketplace/plugin has updates available.
|
|
74
41
|
* Returns per-item status without applying anything. */
|
|
75
42
|
export function contentCheck() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Regression: memory-read matching must consume ONLY the resolved doc's
|
|
2
|
+
// exact canonical name — the hard-cut identity rule forbids a mount-stripped
|
|
3
|
+
// alias (or any other alias) from firing an unrelated carrier's route.
|
|
4
|
+
//
|
|
5
|
+
// Run: node --conditions=crtr-src --import tsx/esm --test src/core/substrate/__tests__/surface-match-memory-read.test.ts
|
|
6
|
+
import { test } from 'node:test';
|
|
7
|
+
import assert from 'node:assert/strict';
|
|
8
|
+
import { matchesMemoryReadEntry } from '../surface-match.js';
|
|
9
|
+
function entry(match) {
|
|
10
|
+
return { on: 'memory-read', at: 'preview', match };
|
|
11
|
+
}
|
|
12
|
+
test('a carrier routed at the mount-stripped local name does not fire for the plugin-qualified canonical read', () => {
|
|
13
|
+
// Authored for an unrelated ordinary doc named "topic" — must not fire
|
|
14
|
+
// when the resolved doc is actually the plugin doc "plug/topic".
|
|
15
|
+
assert.equal(matchesMemoryReadEntry(entry(['topic']), '', null, 'plug/topic'), false);
|
|
16
|
+
});
|
|
17
|
+
test('a carrier routed at the plugin-qualified canonical name still fires for that exact read', () => {
|
|
18
|
+
assert.equal(matchesMemoryReadEntry(entry(['plug/topic']), '', null, 'plug/topic'), true);
|
|
19
|
+
});
|
|
20
|
+
test('a carrier routed at the canonical name still fires for an ordinary (non-plugin) read', () => {
|
|
21
|
+
assert.equal(matchesMemoryReadEntry(entry(['topic']), '', null, 'topic'), true);
|
|
22
|
+
});
|
|
23
|
+
test('a directory-relative `./` route still anchors to the routing anchor of the canonical name', () => {
|
|
24
|
+
// Legitimate routing anchor / directory semantics preserved: a carrier
|
|
25
|
+
// fronting `plug/dir` still matches its own member by relative glob.
|
|
26
|
+
assert.equal(matchesMemoryReadEntry(entry(['./member']), 'plug/dir', null, 'plug/dir/member'), true);
|
|
27
|
+
assert.equal(matchesMemoryReadEntry(entry(['./member']), 'plug/dir', null, 'member'), false);
|
|
28
|
+
});
|
|
@@ -3,8 +3,8 @@ export type { DocKind, Rung, GatePredicate, SubstrateSchema, SubstrateDoc, Surfa
|
|
|
3
3
|
export { lintSubstrateFrontmatter, lintSubstrateSchema, lintSubstrateSurfaces, parsedSubstrateSurfaces } from './frontmatter-validation.js';
|
|
4
4
|
export { matchesReadEntry, matchesMemoryReadEntry, matchesCommandEntry, readDeliveryRung, workspaceOpenRung, memoryReadDeliveryRung, commandDeliveryRung, owningRootOf, underOwningRoot } from './surface-match.js';
|
|
5
5
|
export { dirDedupKey, docsByName, isDirName, ancestorDirsOf, renderDirListing } from './listings.js';
|
|
6
|
-
export {
|
|
7
|
-
export type {
|
|
6
|
+
export { clearContextExposureState, cloneContextExposureState, cloneTranscriptExposureState, contentExposureIdentity, contextExposureStatesEqual, documentExposedAtOrAbove, emptyContextExposureState, exposedAtOrAbove, exposureTarget, freezePreferenceSnapshot, hasTranscriptExposure, initializeForkContextExposure, loadContextExposureState, mergeContextExposureState, registerDocumentExposure, registerExposure, replaceContextExposureState, saveContextExposureState, sharedContextExposureState, } from './injected-store.js';
|
|
7
|
+
export type { ContextExposureState, ExposureSource, ExposureTarget } from './injected-store.js';
|
|
8
8
|
export { scopeForCwd, profileNameFor } from './subject-fields.js';
|
|
9
9
|
export type { NodeConfigSubject } from './subject-fields.js';
|
|
10
10
|
export { spineDepth, assembleNodeSubject } from './subject.js';
|
|
@@ -19,7 +19,7 @@ resolveDocName, } from './schema.js';
|
|
|
19
19
|
export { lintSubstrateFrontmatter, lintSubstrateSchema, lintSubstrateSurfaces, parsedSubstrateSurfaces } from './frontmatter-validation.js';
|
|
20
20
|
export { matchesReadEntry, matchesMemoryReadEntry, matchesCommandEntry, readDeliveryRung, workspaceOpenRung, memoryReadDeliveryRung, commandDeliveryRung, owningRootOf, underOwningRoot } from './surface-match.js';
|
|
21
21
|
export { dirDedupKey, docsByName, isDirName, ancestorDirsOf, renderDirListing } from './listings.js';
|
|
22
|
-
export {
|
|
22
|
+
export { clearContextExposureState, cloneContextExposureState, cloneTranscriptExposureState, contentExposureIdentity, contextExposureStatesEqual, documentExposedAtOrAbove, emptyContextExposureState, exposedAtOrAbove, exposureTarget, freezePreferenceSnapshot, hasTranscriptExposure, initializeForkContextExposure, loadContextExposureState, mergeContextExposureState, registerDocumentExposure, registerExposure, replaceContextExposureState, saveContextExposureState, sharedContextExposureState, } from './injected-store.js';
|
|
23
23
|
export { scopeForCwd, profileNameFor } from './subject-fields.js';
|
|
24
24
|
export { spineDepth, assembleNodeSubject } from './subject.js';
|
|
25
25
|
export { gatePasses } from './gate.js';
|
|
@@ -1,28 +1,44 @@
|
|
|
1
1
|
import { type Rung } from './schema.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export declare function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export declare function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export declare function
|
|
2
|
+
export type ExposureSource = 'system' | 'transcript';
|
|
3
|
+
interface ExposureRanks {
|
|
4
|
+
system?: number;
|
|
5
|
+
transcript?: number;
|
|
6
|
+
}
|
|
7
|
+
/** Memory visible to the currently loaded LLM context. */
|
|
8
|
+
export interface ContextExposureState {
|
|
9
|
+
/** Byte-stable preference splice for this context. */
|
|
10
|
+
preferenceSnapshot: string | null;
|
|
11
|
+
/** Canonical identity → ranks loaded from the system and transcript snapshots. */
|
|
12
|
+
exposures: Map<string, ExposureRanks>;
|
|
13
|
+
}
|
|
14
|
+
export interface ExposureTarget {
|
|
15
|
+
state: ContextExposureState;
|
|
16
|
+
source: ExposureSource;
|
|
17
|
+
}
|
|
18
|
+
export declare function emptyContextExposureState(): ContextExposureState;
|
|
19
|
+
export declare function exposureTarget(state: ContextExposureState, source: ExposureSource): ExposureTarget;
|
|
20
|
+
export declare function exposedAtOrAbove(state: ContextExposureState, identity: string, rung: Rung): boolean;
|
|
21
|
+
/** The sole delivery mutation: max-fold one loaded identity into its source rank. */
|
|
22
|
+
export declare function registerExposure(target: ExposureTarget, identity: string, rung: Rung): void;
|
|
23
|
+
export declare function contentExposureIdentity(body: string): string | null;
|
|
24
|
+
export declare function documentExposedAtOrAbove(state: ContextExposureState, path: string, body: string, rung: Rung): boolean;
|
|
25
|
+
/** Register both the physical document and its non-empty content alias. */
|
|
26
|
+
export declare function registerDocumentExposure(target: ExposureTarget, path: string, body: string, rung: Rung): void;
|
|
27
|
+
export declare function freezePreferenceSnapshot(state: ContextExposureState, rendered: string): string;
|
|
28
|
+
export declare function cloneContextExposureState(source: ContextExposureState): ContextExposureState;
|
|
29
|
+
export declare function hasTranscriptExposure(state: ContextExposureState): boolean;
|
|
30
|
+
/** The context copied into a fork excludes the source's system snapshot. */
|
|
31
|
+
export declare function cloneTranscriptExposureState(source: ContextExposureState): ContextExposureState;
|
|
32
|
+
export declare function replaceContextExposureState(target: ContextExposureState, source: ContextExposureState): void;
|
|
33
|
+
export declare function contextExposureStatesEqual(left: ContextExposureState, right: ContextExposureState): boolean;
|
|
34
|
+
/** Fold state written by another process into the live context state. */
|
|
35
|
+
export declare function mergeContextExposureState(target: ContextExposureState, source: ContextExposureState): void;
|
|
36
|
+
export declare function sharedContextExposureState(nodeId: string): ContextExposureState;
|
|
37
|
+
/** v1/v2 ranks predate provenance and conservatively become transcript exposure. */
|
|
38
|
+
export declare function loadContextExposureState(nodeId: string): ContextExposureState;
|
|
39
|
+
export declare function saveContextExposureState(nodeId: string, state: ContextExposureState): void;
|
|
40
|
+
/** Clear in place so every extension closure observes the new context boundary. */
|
|
41
|
+
export declare function clearContextExposureState(nodeId: string): void;
|
|
42
|
+
/** Seed a fork with only context copied in the source transcript. */
|
|
43
|
+
export declare function initializeForkContextExposure(destinationNodeId: string, sourceNodeId: string | null): void;
|
|
44
|
+
export {};
|