Skip to content

spec(cli-surface): INV30, how a host's package set serves the CLI - #7412

Merged
josephfarina merged 10 commits into
mainfrom
metaforge/cli-package-set-architecture
Oct 20, 2026
Merged

josephfarina merged 10 commits into
mainfrom
metaforge/cli-package-set-architecture

Conversation

@josephfarina

@josephfarina josephfarina commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

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 in spec:AST-081 FR2 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/host and 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, as spec:AST-081 amended 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-017 DEC-4 and spec:AST-042 (known INV20–INV23 gaps): neither covers package resolution outside the project.
  • Search terms: package set, package root, hosted run, host entry, approved integrations, lockfile pins, foundation/runtime.

The decision extends architecture:cli-surface because 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:

  • A package set is a package root whose node_modules holds 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-081 FR1). Only the host entry activates a set: no flag, environment variable, config key, or command does, and no foundation/runtime module is exported.
  • A project's installed packages always resolve from the project. Inside a project, a root fills only the @astryxdesign/* packages the project leaves uninstalled whose copy in the root ships no integration manifest, so it contributes no integration (spec:AST-081 FR12). A run resolves from at most one root. A run handed to the project's own CLI (spec:AST-081 FR9) uses no root.
  • Whenever the copy that started the run answers, outside a project, in a project that installs no CLI of its own, as the release spec:AST-081 FR2 names, or as FR2's fallback, the root that holds that copy serves the run.
  • When spec:AST-081 FR2 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.
  • A hosted run installs nothing: a release spec:AST-081 FR2 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.
  • Outside a project, each integration the host approves resolves by name from the root that serves the run, in addition to what spec:AST-081 FR12 finds there, with FR12's validation, peer-range, and provider identity rules. An approved name that root does not hold is left out.
  • Enumeration through a root reads only the packages INV14 or spec:AST-081 FR12 name, and a root's own config is never read.
  • Every run a set serves records each resolved package's name, version, and source (project or set), and the host entry returns that record with the run's result (spec:AST-081 FR1); results still name their package (INV28).
  • doctor and its integration checks judge only the project's own install; FR12 decides what they list as available.

Also in the records:

  • spec:AST-081 FR2: "...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 under architecture:cli-surface INV30 and installs nothing, so with no such set the release cannot be obtained." The Global CLI work that owns spec:AST-081 agreed to this clause.
  • INV14 says enumeration, not every reader, reads only the dependency key, and that a hosted run outside a project also loads its host's approved integrations by name (INV30).
  • A system-model paragraph (the working folder stays the caller's, no write lands in a package root, and integration lookups consult a root only outside a project), the owning code (host/index.mjs, foundation/runtime), an "update this record when" line, the INV30 verification row, and two contract tests in verified_by.

What changed from the first version

This pull request first recorded the whole hosting contract. spec:AST-081 now owns the public part, so INV30 keeps only the mechanism:

  • The planning outcomes, the host's standard-error lines, and the delegation to a project's own CLI move to spec:AST-081 FR2, 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.
  • The host replacement for an integration's discover source, and its rewrite of spec:AST-051 FR6 and DEC-2, are dropped. A door's catalog is its own source, named as the door's (spec:AST-081 FR1, DEC-7).
  • The earlier review points are settled: the entry's inputs, result, errors, and call isolation are spec:AST-081 FR1'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).
  • The second review's points are settled: "installs nothing" now agrees with spec:AST-081 FR2, which says so for a hosted run; the verification row's write rule names package roots and the places FR7 allows, since init and upgrade write 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.
  • The third review's points are settled: 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 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.
  • The fourth review's points are settled: an @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 a package.json stands.

Rejected alternatives

  • Resolving a project's pins from more than one root, or from a later root when an earlier one qualifies: it mixes releases inside one run.
  • Activating a package set through a flag or environment variable: a hidden global, which the CLI rules forbid (spec:AST-081 FR1).

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.mjs and foundation/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

Writing rubric results

  • R1 narration: none; INV30, the INV14 sentences, the system-model paragraph, and the spec:AST-081 FR2 clause are present-tense system behavior.
  • R2 research in the record: none.
  • R3 evidence naming a change: none; the INV30 evidence cell names contract tests.
  • R4 rejected alternatives over one line or outside a decision: none added; the one-root rule is stated inside INV30.
  • R5 pull request or issue references remaining: none in the record (searched for # plus digits, /pull/, /issues/).
  • R6 ruled open questions still listing options: none; OQ1 is unchanged and unanswered.

Scope

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract.
  • Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
  • It records one intentional durable decision, not a rescue for a separable tagalong.
  • The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision.
  • Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
  • Public text and artifacts contain no internal Meta context.

Validation

  • pnpm check:knowledge: passes
  • scripts/check-knowledge.test.mjs: 121 passed
  • Prettier on spec:AST-081: passes
  • git diff --check: passes
  • Prettier: the added lines follow the record's wrapping. The record already fails prettier --check on main (its verification table), so the new row follows the unpadded rows there instead of reformatting the table.

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.
@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 20, 2026 10:20pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 13, 2026
@astracat-bot

astracat-bot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Oct 20, 2026, 10:33 PM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 13, 2026
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

40 of 486 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 754,077
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,188
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
RichTextEditor Markdown parity: side by side probe dark 94,866
RichTextEditor Markdown parity: side by side probe light 89,762
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
Markdown Default neutral dark 7,573
Markdown Default neutral light 7,566

and 20 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 discover handler with AST-051, which owns where discover sources come from.

[Automated review]

Comment thread docs/architecture/cli-surface.md Outdated
Comment on lines +310 to +312
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/architecture/cli-surface.md Outdated
Comment on lines +323 to +327
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment thread docs/architecture/cli-surface.md Outdated
Comment on lines +328 to +331
- 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/architecture/cli-surface.md Outdated
Comment on lines +333 to +334
A project's pins never resolve against the newest root unless that root
carries those exact versions. Enumeration through a root stays

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/architecture/cli-surface.md Outdated
Comment on lines +340 to +342
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

Comment thread docs/architecture/cli-surface.md Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/architecture/cli-surface.md Outdated
- 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/architecture/cli-surface.md Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

Comment thread docs/architecture/cli-surface.md Outdated

- **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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/architecture/cli-surface.md Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/architecture/cli-surface.md Outdated
- 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/architecture/cli-surface.md Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@josephfarina josephfarina changed the title Document CLI package-set hosting contract spec(cli-surface): INV30, how a host's package set serves the CLI Oct 20, 2026
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.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-081 FR2, 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 init and astryx upgrade write 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]

Comment thread docs/architecture/cli-surface.md Outdated
Comment on lines +513 to +515
- 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/architecture/cli-surface.md Outdated
| 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. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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?

Comment thread docs/architecture/cli-surface.md Outdated
- 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/architecture/cli-surface.md Outdated
- 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)?

Comment thread docs/architecture/cli-surface.md Outdated
Comment on lines +523 to +525
- 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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-081 FR12, 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]

Comment thread docs/architecture/cli-surface.md Outdated
Comment on lines +517 to +520
- 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/architecture/cli-surface.md Outdated
Comment on lines +521 to +523
- 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“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.

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/richtext is an integration, which spec:AST-081 FR12, 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]

Comment thread docs/architecture/cli-surface.md Outdated
Comment on lines +500 to +502
- 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Comment thread docs/architecture/cli-surface.md Outdated
Comment on lines +517 to +521
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread docs/architecture/cli-surface.md Outdated
Comment on lines +526 to +527
- Enumeration through a root stays declaration-driven (INV14), and a root's
own config is never read.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 8e06b25

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 20, 2026
@josephfarina
josephfarina merged commit d216097 into main Oct 20, 2026
53 checks passed
@github-actions
github-actions Bot deleted the metaforge/cli-package-set-architecture branch October 21, 2026 06:22

This branch was successfully deployed

1 active deployment
Preview — 8e06b25e Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant