Repository navigation
spec(cli-surface): INV30, how a host's package set serves the CLI - #7412
Conversation
Define the in-process package-set seam, project authority, exact pin matching, caller working-directory behavior, and integration provenance for hosts that run Astryx without a project install.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Visual Regression40 of 486 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 20 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
This pull request is on hold for a maintainer decision. INV30 adds a new invariant to the CLI surface record, so approval needs a maintainer to approve or reject it as the governing spec for hosted runs. The maintainer also needs to decide whether a hosted run is a supported CLI flow, which AST-017 FR14 requires to be documented and discoverable through a documented API, or a private host seam that the record explicitly places outside that rule. Whichever way that goes, these edits are needed before it can land:
- Reconcile INV14, which still says nothing the project did not declare can contribute, with the host's approved list contributing packages.
- Say how the new stderr lines and the "nothing runs" refusal behave under
--json(INV12, INV2, INV3, INV8). - Define how a pin that is only a range matches a root ("those exact versions" conflicts with the declared-range fallback), and which root serves when several match.
- Settle the host
discoverhandler with AST-051, which owns where discover sources come from.
[Automated review]
| never mixes versions.** The seam is reachable only from code in the same | ||
| process: no CLI flag, environment variable, config key, or command selects or | ||
| reveals it, and the package's exports do not include it. Planning one |
There was a problem hiding this comment.
This keeps the hosted mode out of every documented surface. spec:AST-017 FR14 requires any CLI behavior in a supported flow, including behavior selected automatically, to be documented and discoverable. It also requires automation to use the documented programmatic API, and every normal invocation mode to have a documented command, option, or configuration surface. Either state that hosted runs are a private host seam outside FR14's supported flows, or give the seam the documented, explicit API that FR14 and FR18 call for. The ban on environment variables already matches FR14.
| the project did install. One stderr line names the packages served and the | ||
| project's install command. | ||
| - No root carries the pinned set: nothing runs. The report names each pinned | ||
| package, what the project pins, and the versions each root carries, or | ||
| that none carries it. |
There was a problem hiding this comment.
How do these stderr lines, and the ones in the hand-off and approved-list outcomes, behave under --json? INV12 makes humanLog and humanWarn no-ops there. The nothing runs outcome also needs a failure form: one --json envelope with a registered code (INV2, INV3), and an exit status that is the same in both output modes (INV8).
| - There is no project, or it pins no Astryx package: the newest root serves | ||
| the run, and its approved integration list stands in for the project's | ||
| declared dependencies. A package the list names that the root lacks is | ||
| named on stderr and left out. |
There was a problem hiding this comment.
Here the approved list contributes packages the project never declared. INV14 still says nothing the project did not declare can contribute, and its verification row fails when An undeclared package contributes. Amend INV14 and its row to name the host's approved list as the only other source of declarations, or narrow this outcome.
| A project's pins never resolve against the newest root unless that root | ||
| carries those exact versions. Enumeration through a root stays |
There was a problem hiding this comment.
those exact versions doesn't fit the declared-range fallback above, because a range has no exact version. This sentence also names the newest root, while the outcome allows any root. Please define how a pin that is only a range matches, and which root serves when more than one carries the pinned set, so that planning really has exactly one outcome.
| may supply an in-process handler in place of an integration's `discover` | ||
| named export. The handler is validated like the export it replaces, and the | ||
| integration keeps its package name, so its catalog is reported as that |
There was a problem hiding this comment.
spec:AST-051 owns where discover sources come from, and its FR6 says sources are functions a project or integration provides. A replacement supplied by the host is a third provider. Please settle this clause with AST-051's owner and record it in FR6, linked from here, so the fact keeps one owner.
There was a problem hiding this comment.
This pull request is on hold for a maintainer decision. INV30, the reworded INV14, and the reworded AST-051 FR6 and DEC-2 are new spec requirements, so a maintainer needs to approve or reject them and settle whether a hosted run is a supported CLI flow, which AST-017 FR14 requires to be documented and reachable through a documented API, or a private host seam that the records explicitly place outside FR14. The latest revision resolves the earlier INV14, --json, and version tie-break points; whichever way the decision goes, these edits remain:
- Report a host-replaced discover source as host-supplied, or have AST-017 FR20 amended, since FR20 requires each part's source to be inspectable and declared in its integration module.
- Scope INV14's “never its value” sentence to enumeration, and say how INV30 matches a pin that is not a version range.
- Define what “agrees with” an installed pin means and what makes a root the “newest”.
- Record the host replacement as its own AST-051 decision rather than under DEC-2's original decider and date.
[Automated review]
| approved list; only those names may resolve from the selected package root. | ||
| Neither path walks `node_modules`, so a package absent from both the project's | ||
| declarations and the active host list cannot contribute. Only a project | ||
| dependency's KEY is read, never its value, so an npm alias or a non-semver |
There was a problem hiding this comment.
INV30 matches a pinned package that is not installed against its declared range, which is this dependency's value, and a pin that is not a range (an npm alias, file:, git, workspace, or a dist-tag) has nothing to satisfy. This sentence still says the value is never read and that such pins resolve like any other. Please scope it to enumeration and say in INV30 how a non-range pin is matched.
| - The project pins Astryx packages it has not installed: the first root in | ||
| the host-supplied order serves them only when it has a CLI, carries the | ||
| exact valid lockfile version where one exists or a published version that | ||
| satisfies the declared range otherwise, and agrees with every pinned |
There was a problem hiding this comment.
agrees with carries the promise in INV30's title that versions never mix, but it is not defined. Please say what agreement is, for example that the root carries exactly the version the project installed for each pinned package it did install, so a root holding a different version that merely satisfies the range cannot serve.
| reports each pinned package, what the project pins, and the versions each | ||
| root carries on stderr. JSON mode writes one `ERR_VERSIONS_UNAVAILABLE` | ||
| envelope on stdout and no warning. | ||
| - There is no project, or it pins no Astryx package: the newest root serves |
There was a problem hiding this comment.
Which root is the newest? Pinned projects use the host-supplied order, but this outcome names no ordering. Please define it (for example the highest CLI version, or the first root in the host-supplied order) so planning keeps exactly one outcome.
| `discover` named export. A programmatic host MAY replace that named export | ||
| only for an integration the active package set serves; the replacement uses | ||
| the same function contract, occupies that integration's place in source | ||
| order, and keeps that integration's package identity. It MUST NOT replace a |
There was a problem hiding this comment.
Keeping the integration's identity means discover reports the host's function as this integration's own source. spec:AST-017 FR20 has every integration contribution declared statically in its integration module, and lets a caller inspect the source of each part as the app or a named integration. Please report a replaced source as host-supplied for that integration (keeping its place in source order), or have a maintainer amend FR20 to allow this.
| ### DEC-2 — Available integrations come from sources, not from the CLI | ||
|
|
||
| **Reference:** `spec:AST-051/DEC-2` | ||
| **Decider:** `josephfarina`, `2026-09-30` |
There was a problem hiding this comment.
DEC-2 keeps this decider and date while gaining the host-replacement rule, so the log dates a new decision to the original one; architecture:cli-surface also cites DEC-2 for a source-order guarantee that only FR6 states. Please record the host replacement as its own decision, with its decider and date set at approval, and cite that.
12c63ae to
f06b2e9
Compare
There was a problem hiding this comment.
This pull request is on hold for a maintainer decision: INV30, the new public @astryxdesign/cli/host entry and its runHostedCli, the ERR_VERSIONS_UNAVAILABLE code, the reworded INV14, and the reworded AST-051 FR6 and DEC-2 are new or changed spec requirements, so a maintainer needs to approve or reject them, including whether hosted runs become a supported flow under AST-017 FR14 and FR18. Whichever way that goes, these record edits remain:
- Define
runHostedCli's inputs, result, and errors, and state that each call's package set, approved list, and working directory stay isolated from concurrent calls (AST-017 FR14, FR18). - Report a host-replaced discover source as host-supplied, or have AST-017 FR20 amended, since FR20 traces each part to the app or a named integration.
- Scope INV14's “never its value” sentence to enumeration, say how INV30 matches a pin that is not a version range, and define “agrees with” and “newest root”.
- Record the host replacement as its own AST-051 decision instead of under DEC-2's original decider and date, and update the description, which still says no package export reaches the seam.
[Automated review]
|
|
||
| - **INV30 — A hosted package set serves only what the project leaves open, and | ||
| never mixes versions.** Invocation is reachable only through the versioned | ||
| programmatic entry `@astryxdesign/cli/host`: no CLI flag, environment variable, |
There was a problem hiding this comment.
This makes @astryxdesign/cli/host a public entry, but the records define none of runHostedCli's inputs, defaults, result, or errors, nor what “versioned” means. spec:AST-017 FR14 requires public controls to define their accepted values, default, precedence and interactions, error behavior, and a representative invocation, and FR18 requires them to be explicit inputs that do not depend on ambient process state, with concurrent calls independent. The “active set” activated in-process (lines 101 and 418) needs that guarantee stated, and the INV30 row should cover concurrent runs, not only leaks between sequential ones.
| `discover` named export. A programmatic host MAY replace that named export | ||
| only for an integration the active package set serves; the replacement uses | ||
| the same function contract, occupies that integration's place in source | ||
| order, and keeps that integration's package identity. It MUST NOT replace a |
There was a problem hiding this comment.
Keeping the integration's identity means discover reports the host's function as this integration's own source. spec:AST-017 FR20 has every integration contribution declared statically in its integration module and lets a caller inspect the source of each part as the app or a named integration. Please report a replaced source as host-supplied for that integration (keeping its place in source order), or have a maintainer amend FR20 to allow this.
| approved list; only those names may resolve from the selected package root. | ||
| Neither path walks `node_modules`, so a package absent from both the project's | ||
| declarations and the active host list cannot contribute. Only a project | ||
| dependency's KEY is read, never its value, so an npm alias or a non-semver |
There was a problem hiding this comment.
INV30 matches a pinned package that is not installed against its declared range, which is this dependency's value, and a pin that is not a range (an npm alias, file:, git, workspace, or a dist-tag) has nothing to satisfy. This sentence still says the value is never read and that such pins resolve like any other. Please scope it to enumeration and say in INV30 how a non-range pin is matched.
| - The project pins Astryx packages it has not installed: the first root in | ||
| the host-supplied order serves them only when it has a CLI, carries the | ||
| exact valid lockfile version where one exists or a published version that | ||
| satisfies the declared range otherwise, and agrees with every pinned |
There was a problem hiding this comment.
agrees with carries the title's promise that versions never mix, but it is not defined. Please say what agreement is, for example that the root carries exactly the version the project installed for each pinned package it did install, so a root holding a different version that merely satisfies the range cannot serve.
| reports each pinned package, what the project pins, and the versions each | ||
| root carries on stderr. JSON mode writes one `ERR_VERSIONS_UNAVAILABLE` | ||
| envelope on stdout and no warning. | ||
| - There is no project, or it pins no Astryx package: the newest root serves |
There was a problem hiding this comment.
Which root is the newest? Pinned projects use the host-supplied order (line 351), but this outcome names no ordering. Please define it, for example as the first root in the host-supplied order, so planning keeps exactly one outcome.
| merges every source. A catalog host that needs sign-in works through the | ||
| function, which runs with the credentials its host already has, and a project | ||
| can add or replace what it reads without a CLI release. | ||
| merges every source. A programmatic host may replace the source of an |
There was a problem hiding this comment.
DEC-2 keeps its original decider and date while gaining the host-replacement rule, so the log dates a new decision to 2026-09-30. architecture:cli-surface also cites DEC-2 for a source-order guarantee that only FR6 states. Please record the host replacement as its own decision, with its decider and date set at approval, and cite that.
AST-081 (global mode) now owns the host entry's public contract: its inputs, which release answers a hosted run, and every line a hosted run prints. INV30 keeps the mechanism: how a host's package set is matched to a project, which integrations it contributes outside a project, what a run it serves records, and that project checks judge only the project's own install. The AST-051 FR6/DEC-2 rewrite is dropped: a door's catalog is its own discover source, named as the door's (AST-081 FR1).
cli-surface.md: main's record plus this pull request's narrowed INV30, INV14 sentence, system-model paragraph, owning code, update-when line, verification row, and verified_by tests. AST-051 is main's: this pull request no longer edits it.
A release AST-081 FR2 names comes only from the host's package sets; when none carries it, the run goes on as FR2 says for a release that cannot be obtained. The verification row gains the matching failure signal.
Brings in the global-mode spec (spec:AST-081). cli-surface.md keeps both sides: main's record, with its INV14 sentence on computer-level integrations and its spec:AST-081 deciding-specs entry, plus this pull request's INV30, INV14 sentences, system-model paragraph, owning code, update-when line, verification row, and verified_by tests.
There was a problem hiding this comment.
This pull request is on hold for a maintainer decision: INV30, its verification row and the reworded INV14 add requirements that main does not state, so a maintainer needs to approve or reject them, including whether a hosted run may never install a release, which would also need spec:AST-081 FR2 amended. Whichever way that goes, these record edits remain:
- Reconcile "a hosted run installs nothing" with
spec:AST-081FR2, which installs the matched release into the per-user cache when a project's own CLI cannot start and lets nothing fall back while that release can be obtained. - Narrow the INV30 row's "a write lands outside the caller's working folder" to package roots and the places FR7 names, since
astryx initandastryx upgradewrite at a project root above the working folder. - Say which root serves a hosted run outside a project, or in a project with only Core or nothing installed.
- Define which packages "every Astryx package the project pins" covers, and where the per-run provenance record is read.
[Automated review]
| - A hosted run installs nothing: a release `spec:AST-081` FR2 names comes | ||
| only from the host's package sets, and when none carries it, the run goes | ||
| on as FR2 says for a release that cannot be obtained. |
There was a problem hiding this comment.
This conflicts with current spec:AST-081 FR2. When a project's own CLI is installed but cannot start, FR2 has the matched release answer from the per-user cache, installed the first time it is needed, and says nothing falls back while that release can be obtained (DEC-1 says why). Here a hosted run that no package set serves falls back to the starting copy instead. Either amend FR2 and DEC-1 in this pull request to give hosted runs that exception, or drop this bullet and the row's install clause so hosted runs follow FR2. Also, "when none carries it" misses a root that carries the release but lacks a pinned version; "when no root qualifies" covers both cases.
| | INV25 | `foundation/discovery/cli-self-docs.test.mjs`, `api/doctor/doctor.test.mjs` | A CLI doc with no namespace, a namespace no topic reads, or no section in its topic passes doctor. | | ||
| | INV28 | `test/inv28-package-provenance.test.mjs`, `clients/cli/commands/text-json-parity.test.mjs`, `cli-api-types-verify` | A result about one artifact has no envelope `package`, a listed artifact has no `package`, or text omits the package the envelope names. | | ||
| | INV29 | `api/doctor/doctor.test.mjs` (configured-integrations: not installed, no manifest, manifest throws; self-named authored package, direct and through a symlinked `node_modules` or `cwd`; provider-conflict set-aside; an astryx.config that imports but cannot load the project → failed `config` check) | A configured integration that cannot load leaves `doctor` at exit 0, or an installed-but-unnamed one fails it | | ||
| | INV30 | `foundation/runtime/package-set.test.mjs`, `foundation/runtime/hosted-runtime.test.mjs` | A run resolves from two roots, from a root whose CLI is not the release `spec:AST-081` FR2 names or that lacks a pinned version the project would install, or from a later root when an earlier one qualifies; a hosted run installs a release; a lookup consults a root before the project's own install, or with no set active; an approved integration resolves from another root or skips its validation; a root's config is read; a write lands outside the caller's working folder; a run records a package without its source; or a project check judges the package set. | |
There was a problem hiding this comment.
"A write lands outside the caller's working folder" would fail writes that current records require: astryx init writes at the project root above the working folder (INV31), astryx upgrade works on the project root (spec:AST-040 FR9), and spec:AST-081 FR7 allows the per-user cache, configuration and state files, while FR1 requires the same file changes through every door. Could the signal be "a write lands in a package root, or outside the places spec:AST-081 FR7 names", with the system-model sentence on line 104 saying writes land where a direct run in the caller's folder puts them?
| - A hosted run installs nothing: a release `spec:AST-081` FR2 names comes | ||
| only from the host's package sets, and when none carries it, the run goes | ||
| on as FR2 says for a release that cannot be obtained. | ||
| - Outside a project, each integration the host approves resolves by name |
There was a problem hiding this comment.
Which root is "the root that serves the run" outside a project, or in a project that FR2 gives to the copy that started the run (only Core, or a fresh clone)? The selection rule above ("The first root in the host's order that qualifies serves") covers only named-release runs, so with two or more sets the outcome is open. Please state it: for example, the root holding the copy that started the run, or the first root in the host's order.
| - When `spec:AST-081` FR2 has a hosted run in a project answered by a named | ||
| release, the matched release or the release of a project CLI the host | ||
| declined, a root serves the run only when its CLI is that release and it | ||
| holds, for every Astryx package the project pins but has not installed, the |
There was a problem hiding this comment.
spec:AST-040 FR9 defines an Astryx package as an @astryxdesign/* (or legacy @xds/*) package. Read that way, a third-party integration the project declares but has not installed is never version-checked, yet the system model lets the root fill it. Should this say every package the root would fill (CLI, Core, and each integration the project declares)?
| - Every run a package set serves records, for each package it resolves, its | ||
| name, version, and whether it comes from the project or the package set; | ||
| results still name each artifact's package (INV28). |
There was a problem hiding this comment.
Where is this record read? It is not the envelope (OQ1 still asks whether meta should carry the resolved integration set), and the host entry's result in spec:AST-081 FR1 does not mention it. If callers can read it, spec:AST-017 FR14 needs it documented; if not, saying it is internal to foundation/runtime keeps the row's check meaningful.
- spec:AST-081 FR2: a hosted run takes the matched release from its host's package sets and installs nothing, as INV30 says, so the two records agree. - INV30: a run the starting copy answers is served by the root that holds that copy; a run handed to the project's own CLI uses no root; "Astryx package" is defined; the host entry returns the provenance record. - The system-model paragraph and the verification row no longer say every write lands in the working folder: no write lands in a package root, and writes stay in the places spec:AST-081 FR7 names.
There was a problem hiding this comment.
This pull request is on hold for a maintainer decision: INV30, its verification row, the reworded INV14 and the new spec:AST-081 FR2 clause add requirements that main does not state, so a maintainer needs to approve or reject them. If they are adopted, two record edits remain:
- Reconcile INV30's fill of an integration a project declares but has not installed with
spec:AST-081FR12, row G43, DEC-17 and INV14, which say a door's package-set integration contributes nothing inside a project, by filling only@astryxdesign/*packages there or by amending those claims here. - Fall back “when no root qualifies” instead of “when none carries it” (in INV30 and the FR2 clause), and let the starting copy's root serve every run that copy answers, so a set that carries the named release but lacks a pinned version has a defined outcome.
[Automated review]
| - A project's Astryx packages are the `@astryxdesign/*` packages and the | ||
| integrations it declares (INV14); a declared package the project has not | ||
| installed counts as an integration when the root's copy ships an integration | ||
| manifest. |
There was a problem hiding this comment.
This lets the serving root load, inside a project, an integration the project declares but has not installed. Current spec:AST-081 FR12 counts a door's package set as a computer-level install root and says such an integration “adds no component, template, doc, theme, codemod, discover source, or command name” inside a project; row G43 only lists it as available, and INV14 above still says “Inside a project they contribute nothing”. Either fill only @astryxdesign/* packages inside a project, or amend FR12, G43, DEC-17 and INV14 here, and check versions in every run that fills one, since starting-copy runs check none.
| - A hosted run installs nothing: a release `spec:AST-081` FR2 names comes only | ||
| from the host's package sets, and when none carries it, the run goes on as | ||
| FR2 says for a release that cannot be obtained. |
There was a problem hiding this comment.
“When none carries it” misses a root that carries the named release but lacks a version the project would install: the bullet above bars it from serving, yet the release is carried, and FR2 says nothing falls back while the matched release can be obtained. Could this, and the FR2 clause, say “when no root qualifies”, and could the starting-copy bullet cover every run that copy answers, fallback included?
… root qualifies - Inside a project a root fills only @astryxdesign/* packages and contributes no integration, as spec:AST-081 FR12, row G43, and DEC-17 say. - A hosted run falls back as spec:AST-081 FR2 says when no root qualifies, and the starting copy's root serves every run that copy answers, FR2's fallback included. The FR2 clause says the same.
There was a problem hiding this comment.
This pull request is on hold for a maintainer decision: INV30, its verification row, the reworded INV14 and the new spec:AST-081 FR2 clause add requirements that main does not state, so a maintainer needs to approve or reject them, including whether a hosted run should never install the release FR2 names. If they are adopted, three record edits remain:
- Inside a project, fill only
@astryxdesign/*packages that ship no integration manifest:@astryxdesign/richtextis an integration, whichspec:AST-081FR12, row G43 and INV14 keep out of a project, and the system model's integration lookups need the same scope. - Say which root serves when the copy that started a hosted run is itself the release FR2 names, so that run is never announced as a fallback by the release that answers it.
- Scope “Enumeration through a root stays declaration-driven” so it does not override FR12's reading of a package-set root that has no
package.json.
[Automated review]
| - A project's installed packages always resolve from the project. Inside a | ||
| project, a root fills only the `@astryxdesign/*` packages the project leaves | ||
| uninstalled and contributes no integration (`spec:AST-081` FR12). A run |
There was a problem hiding this comment.
@astryxdesign/richtext is an @astryxdesign/* package that ships astryx.integration.mjs (components and templates), so filling every uninstalled @astryxdesign/* package lets a set contribute an integration inside a project, against spec:AST-081 FR12, row G43, INV14 (“Inside a project they contribute nothing”) and this bullet's own “contributes no integration”. Could this fill only @astryxdesign/* packages that ship no integration manifest (such as Core), with the qualification at lines 512–514 over the same set and the system model's integration lookups (lines 105–106) scoped to outside a project?
| does not satisfy a range. The first root in the host's order that qualifies | ||
| serves. | ||
| - A hosted run installs nothing: a release `spec:AST-081` FR2 names comes only | ||
| from a root that qualifies, and when no root qualifies, that release cannot | ||
| be obtained and FR2's fallback applies. |
There was a problem hiding this comment.
When the copy that started the run is itself the named release (spec:AST-081 FR2: “the copy that started the run when it is that release”; FR9: a copy “does not hand off when it is itself the release FR2 names”), these lines and lines 506–508 disagree: if its set lacks a pinned @astryxdesign/* version, the run is announced as a fallback by the release that answers, and if an earlier set qualifies, the copy can neither hand off nor pair with that set's packages. Could lines 506–508 name this case, and this bullet cover only a named release other than the starting copy?
| - Enumeration through a root stays declaration-driven (INV14), and a root's | ||
| own config is never read. |
There was a problem hiding this comment.
spec:AST-081 FR12 reads a package-set root without a package.json by listing “every package directly in its node_modules”, while this sentence points to INV14's “node_modules is never walked”. Could it say a root adds nothing to a project's enumeration, and that outside a project a root's integrations are those FR12 reads plus the approved names?
…'s root - Inside a project a root fills only @astryxdesign/* packages whose copy ships no integration manifest, so an integration under that scope is never filled there (spec:AST-081 FR12, INV14); the system model limits integration lookups through a root to outside a project. - When the copy that started the run is itself the release spec:AST-081 FR2 names, that copy's root serves and nothing falls back; the qualify rule covers a named release other than the starting copy. - Enumeration through a root reads only the packages INV14 or FR12 name.
|
/approve-spec 8e06b25 |
Exact decision needed
How a host's package sets serve the CLI: when a package root may stand in for packages a project leaves uninstalled, how a root is matched to a project, which integrations a root contributes outside a project, what a run it serves records, and what project checks read. Which release answers a hosted run, what a host passes, and what a hosted run prints are
spec:AST-081's (global mode), not this record's; one clause inspec:AST-081FR2 says a hosted run takes a release only from a qualifying package set and installs nothing.Existing authority searched
architecture:cli-surface(current): INV14 (declaration-driven enumeration), INV28 (every result names its package), the module map, and the "update this record when" list. None of them say how a package set outside the project is matched, enumerated, or recorded.spec:AST-081(global mode, spec(AST-081): global mode, so the CLI answers in any folder and a project's own release answers inside it #7601): FR1 owns the host entry@astryxdesign/cli/hostand its inputs: the package sets, the integrations a host approves for use outside a project (resolved by name from the package set that serves the run, in addition to the computer-level integrations FR12 finds there), the door's own discover sources, the reason it declined a project's CLI, and the command name. FR2 and FR3 decide which release answers a hosted run; FR2 installs the matched release into the per-user cache when a project's own CLI cannot start, which a hosted run does not do. FR5 and FR9 own every line a hosted run prints. FR12 owns computer-level integrations, including those in a door's package set. Its current-state impact leaves to INV30 how a host's package sets are matched, enumerated, and recorded.spec:AST-051(current) FR6, asspec:AST-081amended it: a door's catalog is its own discover source, named as the door's. This pull request no longer edits AST-051.spec:AST-017DEC-4 andspec:AST-042(known INV20–INV23 gaps): neither covers package resolution outside the project.foundation/runtime.The decision extends
architecture:cli-surfacebecause that record owns CLI resolution, enumeration, and provenance invariants; a new record would split those facts.Decision
INV30 in
architecture:cli-surface, limited to the package-set mechanism:node_modulesholds a CLI, the Core equal to it, and the integrations installed with them. A host passes its sets, in its order of preference, through the host entry (spec:AST-081FR1). Only the host entry activates a set: no flag, environment variable, config key, or command does, and nofoundation/runtimemodule is exported.@astryxdesign/*packages the project leaves uninstalled whose copy in the root ships no integration manifest, so it contributes no integration (spec:AST-081FR12). A run resolves from at most one root. A run handed to the project's own CLI (spec:AST-081FR9) uses no root.spec:AST-081FR2 names, or as FR2's fallback, the root that holds that copy serves the run.spec:AST-081FR2 has a hosted run in a project answered by a named release other than the copy that started the run (the matched release, or the release of a project CLI the host declined), a root qualifies only when its CLI is that release and it holds, for every package the project declares that a root may fill, the version the project would install: the valid lockfile version, else a published version in the declared range. A declared value that is not a version range matches only through its lockfile version, and an unrequested prerelease never satisfies a range. The first qualifying root in the host's order serves.spec:AST-081FR2 names comes only from the copy that started the run, when it is that release, or from a root that qualifies; when neither does, that release cannot be obtained and FR2's fallback applies.spec:AST-081FR12 finds there, with FR12's validation, peer-range, and provider identity rules. An approved name that root does not hold is left out.spec:AST-081FR12 name, and a root's own config is never read.spec:AST-081FR1); results still name their package (INV28).doctorand its integration checks judge only the project's own install; FR12 decides what they list as available.Also in the records:
spec:AST-081FR2: "...installed there through the package manager the first time a project needs it; a hosted run takes it only from a package set that qualifies underarchitecture:cli-surfaceINV30 and installs nothing, so with no such set the release cannot be obtained." The Global CLI work that ownsspec:AST-081agreed to this clause.host/index.mjs,foundation/runtime), an "update this record when" line, the INV30 verification row, and two contract tests inverified_by.What changed from the first version
This pull request first recorded the whole hosting contract.
spec:AST-081now owns the public part, so INV30 keeps only the mechanism:spec:AST-081FR2, FR3, FR5, and FR9. Two outcomes differ there. A project's own CLI answers whatever its version, and a project with only Core, or a fresh clone, is answered by the copy that started the run (for a hosted run, the host's CLI). The hand-off line follows FR9.spec:AST-051FR6 and DEC-2, are dropped. A door's catalog is its own source, named as the door's (spec:AST-081FR1, DEC-7).spec:AST-081FR1's; there is no host-replaced source to report; INV14's key-only sentence is scoped to enumeration; a pin that is not a version range is defined; and "agrees with" and "newest root" are gone (the host's order decides).spec:AST-081FR2, which says so for a hosted run; the verification row's write rule names package roots and the places FR7 allows, sinceinitandupgradewrite at a project root above the working folder; the root that serves a run the starting copy answers is the one that holds that copy; "Astryx package" is defined; and the host entry's result carries the provenance record.@astryxdesign/*packages and contributes no integration, asspec:AST-081FR12, row G43, and DEC-17 say; a hosted run falls back when no root qualifies, not only when no root carries the release; and the starting copy's root serves every run that copy answers, FR2's fallback included.@astryxdesign/*package whose copy ships an integration manifest is an integration and is not filled inside a project; when the copy that started the run is itself the release FR2 names, that copy's root serves and nothing falls back; and enumeration through a root reads only the packages INV14 or FR12 name, so FR12's reading of a root without apackage.jsonstands.Rejected alternatives
spec:AST-081FR1).Claim scope and non-goals
Covers how a package set is matched to a project, which integrations it contributes, what a run it serves records, and which lookups consult it. It does not cover which release answers a hosted run, the host entry's inputs, or what a hosted run prints (
spec:AST-081), how a host builds, stores, or updates its package sets, how it chooses approved integrations, or any network transport.Evidence and implementation relationship
Evidence layer: contract tests
foundation/runtime/package-set.test.mjsandfoundation/runtime/hosted-runtime.test.mjs. Failure signals are in the INV30 verification row. The implementation lands separately (the host entry, built on the command-name door); this pull request contains the record only.Order and overlaps
spec:AST-081(spec(AST-081): global mode, so the CLI answers in any folder and a project's own release answers inside it #7601) is on main, and this pull request merged it in. INV14 keeps both additions: the hosted-run sentence here andspec:AST-081's sentence on computer-level integrations. Main'sspec:AST-081deciding-specs entry stays as it is; this pull request adds no deciding spec.Writing rubric results
spec:AST-081FR2 clause are present-tense system behavior.#plus digits,/pull/,/issues/).Scope
Validation
pnpm check:knowledge: passesscripts/check-knowledge.test.mjs: 121 passedspec:AST-081: passesgit diff --check: passesprettier --checkon main (its verification table), so the new row follows the unpadded rows there instead of reformatting the table.