Skip to content

docs(spec): admit CLI surface by tier and keep commands thin over the API - #6604

Merged
josephfarina merged 1 commit into
mainfrom
docs/cli-command-admission
Sep 24, 2026
Merged

josephfarina merged 1 commit into
mainfrom
docs/cli-command-admission

Conversation

@josephfarina

@josephfarina josephfarina commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Exact decision needed

Accept AST-042 as current and amend architecture:cli-surface with INV20–INV23, so that review can block a CLI change that adds surface without the right admission, puts behavior in a command handler, reaches the environment outside an API subject's adapter, or prints text outside the shared blocks.

Existing authority searched

  • architecture:cli-surface (current) owns how a command is invoked, what it may emit, and where its code lives. Its system model already calls a command "parse, call, render", but no invariant made that binding, and nothing covered the API subject layout, adapters, or formatter admission. INV20–INV23 extend that record.
  • spec:AST-017 FR14–FR20 own discoverability, environment variables, global options, and configuration. AST-042 links them and does not restate them.
  • docs/contributing/cli-conventions.md already had the command tests and the flag rules, but it creates no policy. AST-042 FR4–FR5 make them binding, and the guide now points at both records.
  • No open pull request owns command admission or these structure rules. An open draft adds an unrelated invariant to cli-surface; it will renumber to INV24.

Decision

  • AST-042 (new, current). FR1: every command is a thin layer over one function exported from @astryxdesign/cli/api. FR2: that API is documented and tested. FR3: text output uses only the documented blocks; a new block kind needs evidence and is shared by every command. FR4: admission tiers — a top-level command needs a current spec from an approval owner, a subcommand needs a stated case and code-owner approval, an option follows FR5 and AST-017. FR5: option rules, including a decided result for every option pair. FR6: moving surface is an admission at the new tier.
  • cli-surface INV20–INV23. The API subject layout, the adapter as a subject's only access to the environment, thin command handlers, and the closed formatter kit. api/blog and clients/cli/commands/blog.mjs are the reference code.
  • The contributor guide and CONTRIBUTING now point at the blog pair and the tiers.

Rejected alternatives

  • Adding these rules to AST-017, which owns compatibility and CLI controls. Admission and structure are a separate fact boundary.
  • Putting the file layout and the adapter rule in the system spec. Internal structure belongs in the architecture record (knowledge-contracts INV18 and DEC-7).
  • One bar for every addition, which either blocks small options or lets top-level commands in too easily.

Claim scope and non-goals

No code or runtime behavior changes. Modules that predate the new rules are listed as known gaps in AST-042's current-state section; this change assigns no migrations. Provider identity and integration lifecycle stay with their own contracts.

Evidence and implementation relationship

The current-state facts come from an inventory of packages/cli at the base commit:

  • 17 top-level commands (from astryx manifest --json), and 28 command docs that name the function they call;
  • theme template calls a function that the API barrel does not export;
  • six handlers (component, discover, layout, search, template, theme) import Project, node:fs, or node:child_process;
  • the theme handler pads a target table, and the docs handler renders authored headings and tables with its own code;
  • the reference docs of 14 exported functions have no throws entry;
  • check:cli-structure checks each API subject, not each function or command.

An independent review checked each claim against the code and checked the reference code against INV20–INV23. Its findings are fixed here: honest verification rows (no mechanical check exists yet for INV21–INV23), FR3 covers authored doc content and large tables through one shared block, and "approval owner" is defined. AST-042's current-state section also states which rules have no mechanical check yet, so a new violation of them fails only in review until those checks land.

Scope

  • Knowledge records and contributor docs only. No code or published package changes, so no Changeset.
  • It records observable behavior in the system spec and keeps internal structure in the architecture record.
  • No internal mechanism is made public; @astryxdesign/cli/api is already a published export.
  • Verification states the evidence and failure signal without prescribing CI job or workflow topology.
  • It records one intentional durable decision, not a review transcript.
  • The canonical owners, affected current claims, and overlapping open work are named.
  • Public text and artifacts contain no internal Meta context.

Validation

  • pnpm check:knowledge
  • pnpm check:repo
  • git diff --check

@vercel

vercel Bot commented Sep 24, 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 Sep 24, 2026 5:07pm UTC

Request Review

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec d30737c

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

astracat-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
⏳ Waiting for review (for maintainers only) Sep 24, 2026, 5:03 PM UTC

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

Approval recommended. This change accepts AST-042 as the current spec for CLI command admission - tiered bars for top-level commands, subcommands, and options, every command as a thin layer over one documented and tested @astryxdesign/cli/api function, and one shared vocabulary for human-readable output - and carries it into the CLI-surface architecture record as INV20-INV23, with the contributor guide and CONTRIBUTING updated to point at both records.

The spec promotion follows the repository's owner-approval convention for this exact revision, the new rules link AST-017's discoverability and compatibility rules instead of restating them, and the stated current-state gaps (for example theme template calling a function the API barrel does not export) check out against the code. pnpm check:knowledge, pnpm check:repo, and git diff --check all pass, and existing non-conforming modules are honestly listed as known gaps with no migration silently assigned. No changes are requested.

[Automated review]

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Storybook ready: Built with this PR's docsite. Sandbox and CI evidence will be added when available.

View Storybook for this PR

… API

Adds AST-042: every command is a thin layer over one documented, tested
function in @astryxdesign/cli/api; text output uses only the documented
blocks; and new surface is admitted by tier (top-level command needs a
current spec, subcommand needs a stated case and code-owner approval,
option follows the option rules and AST-017).

Amends cli-surface with INV20-INV23: the API subject layout, the adapter
as a subject's only access to the environment, thin command handlers, and
the closed formatter kit. The contributor guide now points at both.
@josephfarina
josephfarina force-pushed the docs/cli-command-admission branch from d30737c to de340c5 Compare September 24, 2026 17:03
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec de340c5

@josephfarina
josephfarina merged commit 3b75f17 into main Sep 24, 2026
40 checks passed
@github-actions
github-actions Bot deleted the docs/cli-command-admission branch September 25, 2026 06:23

This branch was successfully deployed

1 active deployment
Preview — de340c5a Deployed Sep 24, 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