docs: tighten standalone SDK boundary
This commit is contained in:
parent
64cc68f293
commit
852cb27c7d
45
README.md
45
README.md
@ -1,11 +1,11 @@
|
|||||||
# Matrix SDK
|
# Matrix SDK
|
||||||
|
|
||||||
Matrix SDK is the package-author layer for building Matrix actors, browser
|
Matrix SDK is the package-author layer for building Matrix actors, browser
|
||||||
surfaces, and broker-connected applications without depending on the HiveCast
|
surfaces, and broker-connected applications without depending on a managed
|
||||||
platform repo.
|
platform repo.
|
||||||
|
|
||||||
This repository contains the SDK packages that were split out of Matrix-3 and
|
This repository contains the SDK packages renamed to their publishable
|
||||||
renamed to their publishable `@open-matrix/*` package names. The split is
|
`@open-matrix/*` package names. The workspace is
|
||||||
proven as a standalone workspace: a fresh clone can install, build, test,
|
proven as a standalone workspace: a fresh clone can install, build, test,
|
||||||
type-check, pack every package, and compile an external consumer against the
|
type-check, pack every package, and compile an external consumer against the
|
||||||
packed tarballs.
|
packed tarballs.
|
||||||
@ -19,9 +19,15 @@ packed tarballs.
|
|||||||
- Browser host integrations for Matrix web surfaces
|
- Browser host integrations for Matrix web surfaces
|
||||||
- Package-author CLIs and project scaffolds
|
- Package-author CLIs and project scaffolds
|
||||||
|
|
||||||
Matrix SDK is provider-neutral. It does not require HiveCast, Device Link, Host
|
Matrix SDK is provider-neutral. It does not require a managed platform account,
|
||||||
Link, Host Service, or a local HiveCast install. HiveCast is one managed provider
|
device-link ceremony, host-link implementation, managed host service, local
|
||||||
that can issue broker credentials and host runtimes on top of the SDK.
|
platform install, Postgres database, or provider-owned broker authority. A
|
||||||
|
provider overlay can issue broker credentials and host runtimes on top of the
|
||||||
|
SDK, but the SDK itself must remain usable against any compatible broker.
|
||||||
|
|
||||||
|
See [STANDALONE-AUDIT.md](STANDALONE-AUDIT.md) for the current standalone
|
||||||
|
boundary audit, including the remaining Omega/oracle extraction debt that is not
|
||||||
|
part of the package-author SDK proof.
|
||||||
|
|
||||||
## Packages
|
## Packages
|
||||||
|
|
||||||
@ -142,12 +148,13 @@ pnpm prove:cli-uat
|
|||||||
```
|
```
|
||||||
|
|
||||||
The command name uses `uat`, but its scope is only the SDK package-author CLI
|
The command name uses `uat`, but its scope is only the SDK package-author CLI
|
||||||
flow. It is not HiveCast product UAT, browser UAT, signup/login UAT, API-key UI
|
flow. It is not managed-platform product UAT, browser signup/login UAT,
|
||||||
UAT, or live platform deployment proof.
|
API-key UI UAT, or live deployment proof.
|
||||||
|
|
||||||
The CLI is intended to let a package author initialize a folder, add actors,
|
The CLI is intended to let a package author initialize a folder, add actors,
|
||||||
configure broker access, run actors, and invoke them without importing HiveCast
|
configure broker access, run actors, and invoke them without importing provider
|
||||||
product packages into the SDK layer.
|
overlay packages into the SDK layer. Managed-host promotion is optional and is
|
||||||
|
only exercised when `MATRIX_SDK_RUNTIME_HOST_BIN` is supplied.
|
||||||
|
|
||||||
## Repository Layout
|
## Repository Layout
|
||||||
|
|
||||||
@ -170,7 +177,7 @@ scripts/
|
|||||||
|
|
||||||
Done and proven:
|
Done and proven:
|
||||||
|
|
||||||
- The SDK packages build independently from Matrix-3.
|
- The SDK packages build independently from their original source monorepo.
|
||||||
- Package identities use final `@open-matrix/*` names.
|
- Package identities use final `@open-matrix/*` names.
|
||||||
- `@open-matrix/sdk` re-exports the public actor facade.
|
- `@open-matrix/sdk` re-exports the public actor facade.
|
||||||
- A fresh clone passes `pnpm install --frozen-lockfile && pnpm prove`.
|
- A fresh clone passes `pnpm install --frozen-lockfile && pnpm prove`.
|
||||||
@ -180,17 +187,17 @@ Done and proven:
|
|||||||
Still planned:
|
Still planned:
|
||||||
|
|
||||||
- Provider-neutral credential resolution for `matrix configure` and SDK users.
|
- Provider-neutral credential resolution for `matrix configure` and SDK users.
|
||||||
- `matrix login --provider hivecast` to write the same config shape as
|
- Provider login commands that write the same config shape as
|
||||||
`matrix configure`.
|
`matrix configure`.
|
||||||
- Direct broker mode with explicit broker URL/JWT/seed credentials.
|
- Direct broker mode with explicit broker URL/JWT/seed credentials.
|
||||||
- HiveCast provider mode where HiveCast issues scoped broker credentials.
|
- Managed-provider mode where an overlay issues scoped broker credentials.
|
||||||
- Publishing the packages to npm after the provider-login contract is complete.
|
- Publishing the packages to npm after the provider-login contract is complete.
|
||||||
|
|
||||||
## Relationship To HiveCast
|
## Relationship To Provider Overlays
|
||||||
|
|
||||||
Matrix SDK is the open, provider-neutral actor SDK.
|
Matrix SDK is the provider-neutral actor SDK.
|
||||||
|
|
||||||
HiveCast is a managed overlay on top of Matrix SDK. HiveCast can provide account
|
Provider overlays can provide account management, namespaces, API keys, broker
|
||||||
management, Spaces, API keys, broker credential issuance, runtime hosting,
|
credential issuance, runtime hosting, package distribution, and operator UI.
|
||||||
package distribution, and operator UI. SDK users should still be able to connect
|
SDK users should still be able to connect to another broker directly when they
|
||||||
to another broker directly when they already manage their own broker credentials.
|
already manage their own broker credentials.
|
||||||
|
|||||||
89
STANDALONE-AUDIT.md
Normal file
89
STANDALONE-AUDIT.md
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
# Standalone SDK Audit
|
||||||
|
|
||||||
|
Date: 2026-06-07
|
||||||
|
|
||||||
|
This repository is intended to be a standalone Matrix SDK repository. The SDK
|
||||||
|
packages must be usable without the HiveCast application monorepo, without
|
||||||
|
Matrix-3 path assumptions, and without platform-only concepts such as Device
|
||||||
|
Link, Host Link, system-auth, or gateway internals.
|
||||||
|
|
||||||
|
## Current Result
|
||||||
|
|
||||||
|
The SDK package surface is standalone enough for the current authoring proof:
|
||||||
|
|
||||||
|
- A fresh consumer installs the SDK CLI as a package-manager dependency.
|
||||||
|
- `matrix init` creates a fresh author package.
|
||||||
|
- `matrix add actor` creates an actor importing `@open-matrix/core`.
|
||||||
|
- `matrix configure` writes package-local `.matrix` credentials/config.
|
||||||
|
- `matrix run` starts the actor directly.
|
||||||
|
- `matrix invoke` calls the actor through the SDK CLI.
|
||||||
|
- The generated package can be packed, installed into a separate consumer, run,
|
||||||
|
and invoked again.
|
||||||
|
|
||||||
|
The proof script also checks that generated author-package files do not contain
|
||||||
|
legacy monorepo paths or upper-layer package dependencies.
|
||||||
|
|
||||||
|
## Cleanup Completed
|
||||||
|
|
||||||
|
- Root README now describes this as a provider-neutral SDK, not a HiveCast
|
||||||
|
application shard.
|
||||||
|
- Core package README and metadata use `@open-matrix/*` names and this repo URL.
|
||||||
|
- Browser host strings describe generic managed HTTP/broker surfaces instead of
|
||||||
|
HiveCast-specific local/dev URLs.
|
||||||
|
- CLI contracts describe standalone SDK boundaries and optional managed-host
|
||||||
|
integration without naming product-only packages as part of the SDK.
|
||||||
|
- The SDK CLI UAT proof no longer defaults to a HiveCast binary or
|
||||||
|
`dev.hivecast.ai`; managed-host proof requires explicit
|
||||||
|
`MATRIX_SDK_RUNTIME_HOST_BIN`.
|
||||||
|
- The internal theme manifest uses `@open-matrix/theme`.
|
||||||
|
|
||||||
|
## Intentional Guard Strings
|
||||||
|
|
||||||
|
Some upper-layer names remain only as forbidden-token checks inside proof
|
||||||
|
scripts. They are not dependencies, defaults, or runtime integration points.
|
||||||
|
They fail the proof if a generated SDK author package leaks those names.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
- `hivecast`
|
||||||
|
- `projects/matrix-3`
|
||||||
|
- `matrix-work-harness`
|
||||||
|
- `@matrix/mx-cli`
|
||||||
|
|
||||||
|
## Remaining Structural Debt
|
||||||
|
|
||||||
|
The repo still contains extraction residue that should be cleaned in the next
|
||||||
|
repo-hygiene slice:
|
||||||
|
|
||||||
|
- Top-level `src/` is an Omega source tree used by `@open-matrix/omega-core`
|
||||||
|
through relative imports.
|
||||||
|
- `packages/oracle/` is not part of the current SDK workspace packages, but it
|
||||||
|
remains in the repository and some top-level Omega files reference it.
|
||||||
|
- Some non-workspace Omega/oracle files reference `@open-matrix/inference`.
|
||||||
|
Those are not part of the current SDK authoring proof, but they are not clean
|
||||||
|
standalone SDK shape.
|
||||||
|
- `packages/omega-core/build.mjs` still emits declarations from the broad Omega
|
||||||
|
tree with `--skipLibCheck` because the extraction has not yet been narrowed to
|
||||||
|
package-local source only.
|
||||||
|
|
||||||
|
The next cleanup should copy the exact Omega subset used by
|
||||||
|
`@open-matrix/omega-core` into that package (or an explicit sibling package),
|
||||||
|
switch imports to package-local paths, remove the broad root `src/` dependency
|
||||||
|
from the build, and archive or extract oracle-specific code outside the SDK
|
||||||
|
repo surface.
|
||||||
|
|
||||||
|
## Verification Commands
|
||||||
|
|
||||||
|
Run from the repository root:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm prove:cli-uat
|
||||||
|
pnpm prove
|
||||||
|
```
|
||||||
|
|
||||||
|
Expected:
|
||||||
|
|
||||||
|
- `prove:cli-uat` reports `ok: true`.
|
||||||
|
- `legacyMonorepoPathReferences` is `false`.
|
||||||
|
- `managedHostProof` is skipped unless `MATRIX_SDK_RUNTIME_HOST_BIN` is supplied.
|
||||||
|
- `prove` builds, tests, type-checks, and packs all workspace packages.
|
||||||
@ -88,7 +88,7 @@ export function resolveHostedRuntimeRecoveryPlan(
|
|||||||
|
|
||||||
if (href) {
|
if (href) {
|
||||||
try {
|
try {
|
||||||
const currentUrl = new URL(href, 'https://hivecast.ai');
|
const currentUrl = new URL(href, 'https://matrix.invalid');
|
||||||
const hasExplicitTarget = currentUrl.searchParams.has('daemonRoot') || currentUrl.searchParams.has('daemonRealm');
|
const hasExplicitTarget = currentUrl.searchParams.has('daemonRoot') || currentUrl.searchParams.has('daemonRealm');
|
||||||
const relativeCurrentHref = serializeRelativeUrl(currentUrl);
|
const relativeCurrentHref = serializeRelativeUrl(currentUrl);
|
||||||
actions.push({
|
actions.push({
|
||||||
@ -105,14 +105,14 @@ export function resolveHostedRuntimeRecoveryPlan(
|
|||||||
key: 'auto',
|
key: 'auto',
|
||||||
label: 'Use Auto',
|
label: 'Use Auto',
|
||||||
href: serializeRelativeUrl(autoUrl),
|
href: serializeRelativeUrl(autoUrl),
|
||||||
title: 'Clear the explicit runtime target and let HiveCast pick the current live target.',
|
title: 'Clear the explicit runtime target and let the shell pick the current live target.',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
actions.push({
|
actions.push({
|
||||||
key: 'shell',
|
key: 'shell',
|
||||||
label: 'Open Shell',
|
label: 'Open Shell',
|
||||||
href: `/apps/web/#dashboard?redirect=${encodeURIComponent(relativeCurrentHref)}`,
|
href: `/apps/web/#dashboard?redirect=${encodeURIComponent(relativeCurrentHref)}`,
|
||||||
title: 'Open the HiveCast shell and return to this app after choosing a target.',
|
title: 'Open the Matrix shell and return to this app after choosing a target.',
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
requestedRoot,
|
requestedRoot,
|
||||||
@ -131,7 +131,7 @@ export function resolveHostedRuntimeRecoveryPlan(
|
|||||||
key: 'shell',
|
key: 'shell',
|
||||||
label: 'Open Shell',
|
label: 'Open Shell',
|
||||||
href: '/apps/web/#dashboard',
|
href: '/apps/web/#dashboard',
|
||||||
title: 'Open the HiveCast shell to inspect or switch attached leaves.',
|
title: 'Open the Matrix shell to inspect or switch attached runtimes.',
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -334,7 +334,7 @@ export interface BootstrapOptions {
|
|||||||
* @example Federated (NATS backbone for cross-root)
|
* @example Federated (NATS backbone for cross-root)
|
||||||
* ```html
|
* ```html
|
||||||
* <matrix-dsl-host root="flowpad" backbone="ws://localhost:4223">
|
* <matrix-dsl-host root="flowpad" backbone="ws://localhost:4223">
|
||||||
* <ralph-supervisor-view tracks="matrix-3/ralph" autoview>
|
* <ralph-supervisor-view tracks="demo/ralph" autoview>
|
||||||
* </ralph-supervisor-view>
|
* </ralph-supervisor-view>
|
||||||
* </matrix-dsl-host>
|
* </matrix-dsl-host>
|
||||||
* ```
|
* ```
|
||||||
@ -2008,7 +2008,7 @@ export class MatrixDSLHost extends HTMLElement {
|
|||||||
|| this._isAuthoritativeBootstrapIdentitySource(selectedAuthorityRootSource);
|
|| this._isAuthoritativeBootstrapIdentitySource(selectedAuthorityRootSource);
|
||||||
const authenticated = this.dataset.authenticated === 'true' || this._isAuthenticated === true;
|
const authenticated = this.dataset.authenticated === 'true' || this._isAuthenticated === true;
|
||||||
|
|
||||||
// Host Service deployments discover authority runtime state through
|
// Managed host deployments discover authority runtime state through
|
||||||
// system.runtimes. Retired actor paths are not a product path.
|
// system.runtimes. Retired actor paths are not a product path.
|
||||||
return authenticated && rootCameFromAuthoritativeBootstrap && selectedAuthorityRoot === root;
|
return authenticated && rootCameFromAuthoritativeBootstrap && selectedAuthorityRoot === root;
|
||||||
}
|
}
|
||||||
@ -2101,7 +2101,7 @@ export class MatrixDSLHost extends HTMLElement {
|
|||||||
lines.push(healthLine, bootstrapLine);
|
lines.push(healthLine, bootstrapLine);
|
||||||
return classify(
|
return classify(
|
||||||
'nats-jwt-bootstrap',
|
'nats-jwt-bootstrap',
|
||||||
'The HiveCast HTTP surface may still be up. This usually means session-to-bus auth or first-boot provisioning failed, not that the whole Host is down.',
|
'The Matrix HTTP surface may still be up. This usually means session-to-bus auth or first-boot provisioning failed, not that the whole host is down.',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2111,13 +2111,13 @@ export class MatrixDSLHost extends HTMLElement {
|
|||||||
lines.push(`HTTP /healthz: ${healthResp.status} ${healthResp.ok ? 'ok' : 'not ok'}`);
|
lines.push(`HTTP /healthz: ${healthResp.status} ${healthResp.ok ? 'ok' : 'not ok'}`);
|
||||||
return classify(
|
return classify(
|
||||||
'http-bootstrap',
|
'http-bootstrap',
|
||||||
'The browser reached the HiveCast origin but a bootstrap HTTP request failed. Check /api/bootstrap and auth/session routes before assuming the Host is down.',
|
'The browser reached the Matrix origin but a bootstrap HTTP request failed. Check /api/bootstrap and auth/session routes before assuming the host is down.',
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
lines.push(`HTTP /healthz: unreachable (${error instanceof Error ? error.message : String(error)})`);
|
lines.push(`HTTP /healthz: unreachable (${error instanceof Error ? error.message : String(error)})`);
|
||||||
return classify(
|
return classify(
|
||||||
'host-gateway-unreachable',
|
'host-gateway-unreachable',
|
||||||
'The browser cannot reach the HiveCast HTTP gateway at all. This is the closest thing to “Host is down” in the bootstrap path.',
|
'The browser cannot reach the Matrix HTTP gateway at all. This is the closest thing to “host is down” in the bootstrap path.',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3230,7 +3230,7 @@ export class MatrixDSLHost extends HTMLElement {
|
|||||||
lastError = err instanceof Error ? err.message : String(err);
|
lastError = err instanceof Error ? err.message : String(err);
|
||||||
// eslint-disable-next-line no-console -- browser bootstrap, not an actor
|
// eslint-disable-next-line no-console -- browser bootstrap, not an actor
|
||||||
console.warn(
|
console.warn(
|
||||||
`[MatrixDSLHost] Host Service runtime discovery failed at "${discoveryTarget.target}": ${lastError}.`,
|
`[MatrixDSLHost] Managed host runtime discovery failed at "${discoveryTarget.target}": ${lastError}.`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3445,13 +3445,13 @@ export class MatrixDSLHost extends HTMLElement {
|
|||||||
* (`system.runtimes`). Browser tabs claim child actors in `system.registry`
|
* (`system.runtimes`). Browser tabs claim child actors in `system.registry`
|
||||||
* via `registry.claim`, but `system.runtimes.runtimes.list` is fed by
|
* via `registry.claim`, but `system.runtimes.runtimes.list` is fed by
|
||||||
* runtime presence — without this call, browser tabs are invisible to
|
* runtime presence — without this call, browser tabs are invisible to
|
||||||
* Director Topology, Host Ops Workloads, and any other consumer of the
|
* runtime inventory UIs, workload views, and any other consumer of the
|
||||||
* runtime directory.
|
* runtime directory.
|
||||||
*
|
*
|
||||||
* We route through the explicit `runtimes.presence.update` op via
|
* We route through the explicit `runtimes.presence.update` op via
|
||||||
* `RequestReply.execute("${controlPlaneRoot}/system.runtimes", ...)`, NOT through
|
* `RequestReply.execute("${controlPlaneRoot}/system.runtimes", ...)`, NOT through
|
||||||
* `publishRuntimePresence(ctx, record, event)`. The pub/sub path uses bare
|
* `publishRuntimePresence(ctx, record, event)`. The pub/sub path uses bare
|
||||||
* `$runtime.*` topics on the local transport — in federated HiveCast mode
|
* `$runtime.*` topics on the local transport — in federated broker mode
|
||||||
* the tab realm is a synthetic per-tab root (`s-b-root-*`) so the publish
|
* the tab realm is a synthetic per-tab root (`s-b-root-*`) so the publish
|
||||||
* lands on a NATS subject prefix the `RuntimeManagerActor` at the
|
* lands on a NATS subject prefix the `RuntimeManagerActor` at the
|
||||||
* authority root never subscribes to. Routed RequestReply.execute uses
|
* authority root never subscribes to. Routed RequestReply.execute uses
|
||||||
@ -3683,7 +3683,7 @@ export class MatrixDSLHost extends HTMLElement {
|
|||||||
// Explicit authority URLs already declare the target identity in the
|
// Explicit authority URLs already declare the target identity in the
|
||||||
// path. Do not probe platform-local actors such as system.auth or
|
// path. Do not probe platform-local actors such as system.auth or
|
||||||
// system.directory here; that turns a shareable user URL into a hidden
|
// system.directory here; that turns a shareable user URL into a hidden
|
||||||
// HiveCast-local lookup and can wait on unrelated platform timeouts.
|
// provider-local lookup and can wait on unrelated platform timeouts.
|
||||||
console.info('[MatrixDSLHost] Phase B platform probe skipped for explicit authority URL - retaining explicit authority root');
|
console.info('[MatrixDSLHost] Phase B platform probe skipped for explicit authority URL - retaining explicit authority root');
|
||||||
finishPhaseBProfile({
|
finishPhaseBProfile({
|
||||||
result: 'skipped-explicit-authority',
|
result: 'skipped-explicit-authority',
|
||||||
@ -4091,7 +4091,7 @@ const RESERVED_ROUTE_KEYS = new Set([
|
|||||||
'well-known',
|
'well-known',
|
||||||
'favicon.ico',
|
'favicon.ico',
|
||||||
'manifest.json',
|
'manifest.json',
|
||||||
'hivecast',
|
'provider',
|
||||||
'open-matrix',
|
'open-matrix',
|
||||||
'me',
|
'me',
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -9,8 +9,8 @@ describe('htmlReferencesBundle', () => {
|
|||||||
assert.equal(
|
assert.equal(
|
||||||
htmlReferencesBundle(
|
htmlReferencesBundle(
|
||||||
html,
|
html,
|
||||||
'https://dev.hivecast.ai/apps/director/assets/index-new.js',
|
'https://example.invalid/apps/director/assets/index-new.js',
|
||||||
'https://dev.hivecast.ai/apps/director/',
|
'https://example.invalid/apps/director/',
|
||||||
),
|
),
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
@ -21,8 +21,8 @@ describe('htmlReferencesBundle', () => {
|
|||||||
assert.equal(
|
assert.equal(
|
||||||
htmlReferencesBundle(
|
htmlReferencesBundle(
|
||||||
html,
|
html,
|
||||||
'https://local.hivecast.ai/apps/web/index.ts',
|
'https://local.example.invalid/apps/web/index.ts',
|
||||||
'https://local.hivecast.ai/apps/web/',
|
'https://local.example.invalid/apps/web/',
|
||||||
),
|
),
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
@ -33,8 +33,8 @@ describe('htmlReferencesBundle', () => {
|
|||||||
assert.equal(
|
assert.equal(
|
||||||
htmlReferencesBundle(
|
htmlReferencesBundle(
|
||||||
html,
|
html,
|
||||||
'https://dev.hivecast.ai/apps/director/assets/index-old.js',
|
'https://example.invalid/apps/director/assets/index-old.js',
|
||||||
'https://dev.hivecast.ai/apps/director/',
|
'https://example.invalid/apps/director/',
|
||||||
),
|
),
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
# Boundary Identifiers — In-Package Reference
|
# Boundary Identifiers — In-Package Reference
|
||||||
|
|
||||||
If you're editing files in this package, you must know which identifier
|
If you're editing files in this package, you must know which identifier
|
||||||
you're touching. Full spec:
|
you're touching. This file is the in-package boundary contract for the SDK
|
||||||
`WORKSTREAMS/platform-control-plane-freeze/FOUR-ROOTS-DISENTANGLE.md`
|
browser host. Provider overlays may maintain their own deployment-specific
|
||||||
(working title preserved for grep continuity).
|
mapping docs, but boundary names exported by this package stay provider-neutral.
|
||||||
|
|
||||||
## The Four Boundary Identifiers
|
## The Four Boundary Identifiers
|
||||||
|
|
||||||
@ -41,10 +41,9 @@ discipline is at the seams.
|
|||||||
in new code. The `root` attribute is ambiguous — it has meant all four
|
in new code. The `root` attribute is ambiguous — it has meant all four
|
||||||
identifiers at different times in git history. Pick the specific one.
|
identifiers at different times in git history. Pick the specific one.
|
||||||
|
|
||||||
3. **No fallbacks.** Per CLAUDE.md "no fallbacks or legacy crutches,"
|
3. **No implicit substitution.** If `appName` is missing from a bootstrap that
|
||||||
if `appName` is missing from a bootstrap that needs it, **throw**.
|
needs it, **throw**. Do not silently degrade to using `subjectScope` in the
|
||||||
Do not silently degrade to using `subjectScope` in the `appName` slot —
|
`appName` slot; that creates wire-crossing bugs.
|
||||||
that's the wire-crossing bug this workstream exists to fix.
|
|
||||||
|
|
||||||
4. **Forbidden boundary names** (do not introduce in new code at boundaries):
|
4. **Forbidden boundary names** (do not introduce in new code at boundaries):
|
||||||
- `root` — meant all four at different times
|
- `root` — meant all four at different times
|
||||||
|
|||||||
@ -10,13 +10,11 @@ It may depend on:
|
|||||||
|
|
||||||
It must not depend on:
|
It must not depend on:
|
||||||
|
|
||||||
- `@matrix/mx-cli`
|
- legacy product CLI packages
|
||||||
- `@open-matrix/host-service`
|
- provider overlay CLIs
|
||||||
- `@open-matrix/host-control`
|
- managed host or host-control packages
|
||||||
- `@open-matrix/system-*`
|
- platform system actor packages
|
||||||
- `@open-matrix/system-auth`
|
- gateway/auth packages
|
||||||
- `@open-matrix/system-gateway-http`
|
- broker-authority/signing packages
|
||||||
- `@open-matrix/nats-auth`
|
|
||||||
- `hivecast`
|
|
||||||
|
|
||||||
User packages must depend on SDK libraries, not on this CLI package.
|
User packages must depend on SDK libraries, not on this CLI package.
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
Package-author CLI for the Matrix SDK layer.
|
Package-author CLI for the Matrix SDK layer.
|
||||||
|
|
||||||
This package owns the SDK/package-author `matrix` binary. It does not depend on
|
This package owns the SDK/package-author `matrix` binary. It does not depend on
|
||||||
Matrix-3 product packages, Host Service, Host Control, system actors, HiveCast,
|
provider overlay packages, managed host packages, platform system actors,
|
||||||
Device Link, or NATS authority packages.
|
device-link implementations, or broker-authority/signing packages.
|
||||||
|
|
||||||
Initial command surface:
|
Initial command surface:
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ matrix run <entry> --mount <mount>
|
|||||||
matrix invoke <mount> <op> [json]
|
matrix invoke <mount> <op> [json]
|
||||||
```
|
```
|
||||||
|
|
||||||
`matrix run` starts a standalone actor runner in the current folder. `matrix
|
`matrix run` starts a standalone actor runner in the current folder.
|
||||||
invoke` sends a Matrix request envelope to that runner through its local control
|
`matrix invoke` sends a Matrix request envelope to that runner through its local
|
||||||
port. Managed Runtime Host promotion belongs to the later Matrix-3/Runtime Host
|
control port. Managed host promotion belongs to provider overlays that consume
|
||||||
repoint phase.
|
the SDK; it is not an SDK-layer requirement.
|
||||||
|
|||||||
@ -56,7 +56,7 @@ test('init, add actor, and configure write package-local SDK state', async () =>
|
|||||||
assert.equal(credentialMode, 0o600);
|
assert.equal(credentialMode, 0o600);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('up delegates a Host-runnable package to an explicit Runtime Host command', async () => {
|
test('up delegates a host-runnable package to an explicit managed host command', async () => {
|
||||||
const root = await mkdtemp(join(tmpdir(), 'matrix-sdk-cli-up-test.'));
|
const root = await mkdtemp(join(tmpdir(), 'matrix-sdk-cli-up-test.'));
|
||||||
const fakeRuntimeHost = join(root, 'fake-runtime-host.mjs');
|
const fakeRuntimeHost = join(root, 'fake-runtime-host.mjs');
|
||||||
const calledPath = join(root, 'runtime-host-called.json');
|
const calledPath = join(root, 'runtime-host-called.json');
|
||||||
|
|||||||
@ -663,7 +663,7 @@ async function upCommand(rawArgs: string[]): Promise<void> {
|
|||||||
?? optionalString(config.runtimeHostBin)
|
?? optionalString(config.runtimeHostBin)
|
||||||
?? process.env.MATRIX_RUNTIME_HOST_BIN;
|
?? process.env.MATRIX_RUNTIME_HOST_BIN;
|
||||||
if (!runtimeHostBin) {
|
if (!runtimeHostBin) {
|
||||||
throw new Error('MATRIX_RUNTIME_HOST_BIN_REQUIRED: matrix up requires --runtime-host-bin or MATRIX_RUNTIME_HOST_BIN pointing to the Runtime Host matrix command');
|
throw new Error('MATRIX_RUNTIME_HOST_BIN_REQUIRED: matrix up requires --runtime-host-bin or MATRIX_RUNTIME_HOST_BIN pointing to a managed host matrix command');
|
||||||
}
|
}
|
||||||
const routing = stringOption(parsed.options, 'runtime-host-routing')
|
const routing = stringOption(parsed.options, 'runtime-host-routing')
|
||||||
?? optionalString(config.runtimeHostRouting)
|
?? optionalString(config.runtimeHostRouting)
|
||||||
@ -696,7 +696,7 @@ async function upCommand(rawArgs: string[]): Promise<void> {
|
|||||||
});
|
});
|
||||||
if (result.error) throw result.error;
|
if (result.error) throw result.error;
|
||||||
if (result.status !== 0) {
|
if (result.status !== 0) {
|
||||||
throw new Error(`matrix up Runtime Host command failed with exit ${result.status ?? 'unknown'}`);
|
throw new Error(`matrix up managed host command failed with exit ${result.status ?? 'unknown'}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,7 @@ export interface RuntimePresenceRecordV1 {
|
|||||||
/** Optional: authority root for deployment/ownership plane. */
|
/** Optional: authority root for deployment/ownership plane. */
|
||||||
authorityRoot?: string;
|
authorityRoot?: string;
|
||||||
|
|
||||||
/** Optional: platform root for HiveCast/hosting plane. */
|
/** Optional: provider overlay root for hosting plane metadata. */
|
||||||
platformRoot?: string;
|
platformRoot?: string;
|
||||||
|
|
||||||
/** Optional: human-readable application name. */
|
/** Optional: human-readable application name. */
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
# @matrix/core
|
# @open-matrix/core
|
||||||
|
|
||||||
Matrix runtime SDK — actors, Web Components, transports, serialization, and LISP-on-Protocol.
|
Matrix runtime SDK — actors, Web Components, transports, serialization, and LISP-on-Protocol.
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install @matrix/core
|
npm install @open-matrix/core
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@ -13,7 +13,7 @@ npm install @matrix/core
|
|||||||
### Headless Actor (daemon-side)
|
### Headless Actor (daemon-side)
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { MatrixActor } from '@matrix/core';
|
import { MatrixActor } from '@open-matrix/core';
|
||||||
|
|
||||||
class PingActor extends MatrixActor {
|
class PingActor extends MatrixActor {
|
||||||
static accepts = {
|
static accepts = {
|
||||||
@ -32,7 +32,7 @@ class PingActor extends MatrixActor {
|
|||||||
### Browser Web Component
|
### Browser Web Component
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { MatrixActorHtmlElement } from '@matrix/core';
|
import { MatrixActorHtmlElement } from '@open-matrix/core';
|
||||||
|
|
||||||
class StatusPanel extends MatrixActorHtmlElement {
|
class StatusPanel extends MatrixActorHtmlElement {
|
||||||
static accepts = { showStatus: { text: 'string' } };
|
static accepts = { showStatus: { text: 'string' } };
|
||||||
@ -50,11 +50,11 @@ customElements.define('status-panel', StatusPanel);
|
|||||||
### Programmatic Runtime
|
### Programmatic Runtime
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { MatrixRuntime, InMemoryBroker } from '@matrix/core';
|
import { InMemoryBroker, InMemoryTransport, MatrixRuntime } from '@open-matrix/core';
|
||||||
|
|
||||||
const broker = new InMemoryBroker();
|
const broker = new InMemoryBroker();
|
||||||
const runtime = new MatrixRuntime({ broker });
|
const transport = new InMemoryTransport(broker, { name: 'demo' });
|
||||||
await runtime.start();
|
const runtime = new MatrixRuntime({ transport });
|
||||||
```
|
```
|
||||||
|
|
||||||
## What's Included
|
## What's Included
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/nicholasgalante/Matrix-3.git",
|
"url": "https://github.com/matrix-sdk/matrix-sdk.git",
|
||||||
"directory": "packages/core"
|
"directory": "packages/core"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
@ -61,7 +61,7 @@ export const UserDevicesContract: ServiceContract = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
'devices.revoke': {
|
'devices.revoke': {
|
||||||
description: 'Revoke/unlink one account-level Device Link.',
|
description: 'Revoke/unlink one account-level device credential.',
|
||||||
payload: {
|
payload: {
|
||||||
authorityRoot: { type: 'string', required: false },
|
authorityRoot: { type: 'string', required: false },
|
||||||
deviceId: { type: 'string', required: true },
|
deviceId: { type: 'string', required: true },
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@matrix/theme",
|
"name": "@open-matrix/theme",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "Design token management and theme switching for Matrix components",
|
"description": "Design token management and theme switching for Matrix components",
|
||||||
"components": [
|
"components": [
|
||||||
|
|||||||
@ -354,7 +354,7 @@ export type {
|
|||||||
// Browser Runtime
|
// Browser Runtime
|
||||||
export { BrowserDomStrategy } from './runtime/BrowserDomStrategy';
|
export { BrowserDomStrategy } from './runtime/BrowserDomStrategy';
|
||||||
// MatrixDSLHost and BootstrapOptions moved to @open-matrix/browser-host
|
// MatrixDSLHost and BootstrapOptions moved to @open-matrix/browser-host
|
||||||
// during Phase 1 of core-decontamination (see WORKSTREAMS/core-decontamination).
|
// during the core package split.
|
||||||
// Import from '@open-matrix/browser-host/host' instead.
|
// Import from '@open-matrix/browser-host/host' instead.
|
||||||
|
|
||||||
// Remoting — ComponentProxy
|
// Remoting — ComponentProxy
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
// Input: (define (square x) (* x x))
|
// Input: (define (square x) (* x x))
|
||||||
// Output: ["define", ["square", "x"], ["*", "x", "x"]]
|
// Output: ["define", ["square", "x"], ["*", "x", "x"]]
|
||||||
//
|
//
|
||||||
// This enables running actual Scheme/LISP code on Matrix-3
|
// This enables running actual Scheme/LISP code on Matrix.
|
||||||
|
|
||||||
import type { SExpr } from '../SExpr';
|
import type { SExpr } from '../SExpr';
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
// src/lisp/index.ts
|
// src/lisp/index.ts
|
||||||
// LISP-on-Protocol - Public API
|
// LISP-on-Protocol - Public API
|
||||||
//
|
//
|
||||||
// This module provides the core LISP evaluation engine for Matrix-3.
|
// This module provides the core LISP evaluation engine for Matrix.
|
||||||
// It enables:
|
// It enables:
|
||||||
// - S-expression parsing (traditional LISP syntax to JSON wire format)
|
// - S-expression parsing (traditional LISP syntax to JSON wire format)
|
||||||
// - Pure LISP evaluation (standalone or Matrix-integrated)
|
// - Pure LISP evaluation (standalone or Matrix-integrated)
|
||||||
|
|||||||
@ -76,7 +76,7 @@ interface ComponentInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MatrixRuntime — the ONE unified runtime for Matrix-3.
|
* MatrixRuntime — the unified runtime for Matrix actors.
|
||||||
*
|
*
|
||||||
* Supports both headless (no DOM) and browser (with IDomStrategy) modes.
|
* Supports both headless (no DOM) and browser (with IDomStrategy) modes.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -13,6 +13,6 @@ It may export from the Node-safe root:
|
|||||||
Browser app build utilities remain in `@open-matrix/browser-kit` and are
|
Browser app build utilities remain in `@open-matrix/browser-kit` and are
|
||||||
imported directly from that package.
|
imported directly from that package.
|
||||||
|
|
||||||
It must not depend on Matrix-3 product packages, Host Service, Host Control,
|
It must not depend on provider overlay packages, managed host packages,
|
||||||
system actors, HiveCast installer state, Device Link state, Postgres, or NATS
|
platform system actors, installer state, device-link state, Postgres, or
|
||||||
authority/signing packages.
|
broker-authority/signing packages.
|
||||||
|
|||||||
@ -10,8 +10,6 @@ import { fileURLToPath } from 'node:url';
|
|||||||
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
||||||
const sourceWorkspaceDir = path.resolve(scriptDir, '..');
|
const sourceWorkspaceDir = path.resolve(scriptDir, '..');
|
||||||
let workspaceDir = sourceWorkspaceDir;
|
let workspaceDir = sourceWorkspaceDir;
|
||||||
const repoProjectsDir = path.resolve(sourceWorkspaceDir, '..');
|
|
||||||
const defaultRuntimeHostBin = path.join(repoProjectsDir, 'matrix-3', 'packages', 'hivecast', 'bin', 'matrix.mjs');
|
|
||||||
|
|
||||||
const packages = [
|
const packages = [
|
||||||
'@open-matrix/contracts',
|
'@open-matrix/contracts',
|
||||||
@ -236,8 +234,10 @@ async function main() {
|
|||||||
let keep = process.env.MATRIX_SDK_KEEP_CLI_UAT === '1';
|
let keep = process.env.MATRIX_SDK_KEEP_CLI_UAT === '1';
|
||||||
let runner;
|
let runner;
|
||||||
let packageRunner;
|
let packageRunner;
|
||||||
const runtimeHostBin = process.env.MATRIX_SDK_RUNTIME_HOST_BIN || defaultRuntimeHostBin;
|
const runtimeHostBin = envString('MATRIX_SDK_RUNTIME_HOST_BIN');
|
||||||
|
const managedHostProofEnabled = Boolean(runtimeHostBin);
|
||||||
let runtimeHostStarted = false;
|
let runtimeHostStarted = false;
|
||||||
|
let managedHostProof = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await mkdir(tarballDir, { recursive: true });
|
await mkdir(tarballDir, { recursive: true });
|
||||||
@ -296,19 +296,24 @@ async function main() {
|
|||||||
if (liveKeyConfig) {
|
if (liveKeyConfig) {
|
||||||
liveKeyValidation = await validateLiveKeyConfig(liveKeyConfig);
|
liveKeyValidation = await validateLiveKeyConfig(liveKeyConfig);
|
||||||
}
|
}
|
||||||
const configureKey = liveKeyConfig?.key ?? 'hc_uat_key_redacted';
|
const configureKey = liveKeyConfig?.key ?? 'matrix_sdk_test_key_redacted';
|
||||||
const configureCloud = liveKeyConfig?.cloud ?? 'https://dev.hivecast.ai';
|
const configureCloud = liveKeyConfig?.cloud ?? 'https://example.invalid';
|
||||||
const configureSpace = liveKeyConfig?.space ?? 'fresh-sdk-space';
|
const configureSpace = liveKeyConfig?.space ?? 'fresh-sdk-space';
|
||||||
|
|
||||||
run('pnpm', [
|
const configureArgs = [
|
||||||
'exec', 'matrix', 'configure',
|
'exec', 'matrix', 'configure',
|
||||||
'--dir', authorDir,
|
'--dir', authorDir,
|
||||||
'--key', configureKey,
|
'--key', configureKey,
|
||||||
'--cloud', configureCloud,
|
'--cloud', configureCloud,
|
||||||
'--space', configureSpace,
|
'--space', configureSpace,
|
||||||
|
];
|
||||||
|
if (runtimeHostBin) {
|
||||||
|
configureArgs.push(
|
||||||
'--runtime-host-bin', runtimeHostBin,
|
'--runtime-host-bin', runtimeHostBin,
|
||||||
'--runtime-host-routing', 'workspace-source',
|
'--runtime-host-routing', 'workspace-source',
|
||||||
], { cwd: toolingDir });
|
);
|
||||||
|
}
|
||||||
|
run('pnpm', configureArgs, { cwd: toolingDir });
|
||||||
run('pnpm', ['install', '--ignore-scripts'], { cwd: authorDir });
|
run('pnpm', ['install', '--ignore-scripts'], { cwd: authorDir });
|
||||||
run('pnpm', ['run', 'build'], { cwd: authorDir });
|
run('pnpm', ['run', 'build'], { cwd: authorDir });
|
||||||
|
|
||||||
@ -365,8 +370,9 @@ async function main() {
|
|||||||
await stopChild(runner);
|
await stopChild(runner);
|
||||||
runner = undefined;
|
runner = undefined;
|
||||||
|
|
||||||
if (!existsSync(runtimeHostBin)) {
|
if (managedHostProofEnabled) {
|
||||||
throw new Error(`Runtime Host matrix command not found for managed proof: ${runtimeHostBin}`);
|
if (!runtimeHostBin || !existsSync(runtimeHostBin)) {
|
||||||
|
throw new Error(`Managed host matrix command not found for optional managed proof: ${runtimeHostBin}`);
|
||||||
}
|
}
|
||||||
const up = run('pnpm', [
|
const up = run('pnpm', [
|
||||||
'exec', 'matrix', 'up',
|
'exec', 'matrix', 'up',
|
||||||
@ -399,6 +405,21 @@ async function main() {
|
|||||||
if (managedInvoke.ok !== true || managedInvoke.result?.mount !== 'demo.greeter') {
|
if (managedInvoke.ok !== true || managedInvoke.result?.mount !== 'demo.greeter') {
|
||||||
throw new Error(`Unexpected managed matrix invoke output: ${managedInvokeOutput.stdout}`);
|
throw new Error(`Unexpected managed matrix invoke output: ${managedInvokeOutput.stdout}`);
|
||||||
}
|
}
|
||||||
|
managedHostProof = {
|
||||||
|
runtimeHostBin,
|
||||||
|
up: {
|
||||||
|
ok: upResult.ok,
|
||||||
|
mode: upResult.mode,
|
||||||
|
runtimeId: upService.runtimeId,
|
||||||
|
packageDir: upService.packageDir,
|
||||||
|
},
|
||||||
|
invoke: {
|
||||||
|
ok: managedInvoke.ok,
|
||||||
|
target: managedInvoke.target,
|
||||||
|
result: managedInvoke.result,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
run('pnpm', ['pack', '--pack-destination', packageTarballDir], { cwd: authorDir, stdio: 'pipe' });
|
run('pnpm', ['pack', '--pack-destination', packageTarballDir], { cwd: authorDir, stdio: 'pipe' });
|
||||||
const authorPackageTarball = await findOnlyTarball(packageTarballDir, 'generated author package');
|
const authorPackageTarball = await findOnlyTarball(packageTarballDir, 'generated author package');
|
||||||
@ -461,7 +482,7 @@ async function main() {
|
|||||||
authorDir,
|
authorDir,
|
||||||
cliInstalledSeparately: true,
|
cliInstalledSeparately: true,
|
||||||
authorPackageDependsOnCli: false,
|
authorPackageDependsOnCli: false,
|
||||||
matrix3PathReferences: false,
|
legacyMonorepoPathReferences: false,
|
||||||
actorImport: '@open-matrix/core',
|
actorImport: '@open-matrix/core',
|
||||||
configuredKeyStored: existsSync(path.join(authorDir, '.matrix', 'credentials', 'matrix-api-key.json')),
|
configuredKeyStored: existsSync(path.join(authorDir, '.matrix', 'credentials', 'matrix-api-key.json')),
|
||||||
validKeyConfigSupplied: Boolean(liveKeyConfig),
|
validKeyConfigSupplied: Boolean(liveKeyConfig),
|
||||||
@ -471,19 +492,9 @@ async function main() {
|
|||||||
ok: invoked.ok,
|
ok: invoked.ok,
|
||||||
result: invoked.result,
|
result: invoked.result,
|
||||||
},
|
},
|
||||||
managedRuntimeHost: {
|
managedHostProof: managedHostProof ?? {
|
||||||
runtimeHostBin,
|
skipped: true,
|
||||||
up: {
|
reason: 'MATRIX_SDK_RUNTIME_HOST_BIN not supplied',
|
||||||
ok: upResult.ok,
|
|
||||||
mode: upResult.mode,
|
|
||||||
runtimeId: upService.runtimeId,
|
|
||||||
packageDir: upService.packageDir,
|
|
||||||
},
|
|
||||||
invoke: {
|
|
||||||
ok: managedInvoke.ok,
|
|
||||||
target: managedInvoke.target,
|
|
||||||
result: managedInvoke.result,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
packageManagerInstall: {
|
packageManagerInstall: {
|
||||||
tarball: path.basename(authorPackageTarball),
|
tarball: path.basename(authorPackageTarball),
|
||||||
@ -503,11 +514,11 @@ async function main() {
|
|||||||
} finally {
|
} finally {
|
||||||
if (runner) await stopChild(runner);
|
if (runner) await stopChild(runner);
|
||||||
if (packageRunner) await stopChild(packageRunner);
|
if (packageRunner) await stopChild(packageRunner);
|
||||||
if (runtimeHostStarted) {
|
if (runtimeHostStarted && runtimeHostBin) {
|
||||||
try {
|
try {
|
||||||
runRuntimeHost(runtimeHostBin, ['stop', '--timeout', '15000'], { cwd: authorDir, stdio: 'pipe' });
|
runRuntimeHost(runtimeHostBin, ['stop', '--timeout', '15000'], { cwd: authorDir, stdio: 'pipe' });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`[prove-sdk-cli-uat] failed to stop Runtime Host: ${error instanceof Error ? error.message : String(error)}`);
|
console.error(`[prove-sdk-cli-uat] failed to stop managed host: ${error instanceof Error ? error.message : String(error)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!keep) {
|
if (!keep) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user