An open source design system that's fully customizable and agent ready
TypeScript
spec(cli-surface): the integration doc checks govern from the CLI surface record (#7686)
Joey5814894e542c
diff --git a/docs/architecture/cli-surface.md b/docs/architecture/cli-surface.mdindex afa77b9c82..83476990cb 100644--- a/docs/architecture/cli-surface.md+++ b/docs/architecture/cli-surface.md@@ -133,6 +133,46 @@ and remains available through explicit Core package selection.exits 1, the same way in text and JSON (INV8). A command offers `--strict`only through a record that names it; `astryx integration check`(`spec:AST-039` FR14) is the one that does (DEC-4).+- **INV33 — Documented component props agree with the source.**+ `astryx doctor integration components` MUST compare every prop table a+ component descriptor documents with the props of the export it describes, read+ with the TypeScript the project installs. It MUST warn about a documented prop+ the code lacks, a prop the package's own source declares that the table omits,+ a `required` flag the code contradicts, and a documented type that does not+ match the code under the loose comparison the command documents. It MUST list+ a documented type it cannot judge as unchecked rather than report a match or a+ mismatch. Without the project's TypeScript it MUST say that the comparison was+ skipped and why, and MUST NOT report a pass.+- **INV34 — Every descriptor satisfies its published authoring type.**+ `astryx doctor integration validate` MUST check each descriptor an+ integration's roots hold, and each translation a descriptor carries, against+ the type `@astryxdesign/cli/authoring` publishes for that kind in an+ integration, as the TypeScript the project installs checks a value written+ with that type. It MUST warn about every unknown field, missing required+ field, and value outside its field's type, naming the field and the change+ that fixes it, including a field the compiler reaches only once an earlier+ unknown field is gone. A value the loader accepts and the CLI reads MUST+ satisfy that type. Where an integration may author more than Core's type for a+ kind allows, such as any template `category`, `@astryxdesign/cli/authoring`+ MUST publish an additional integration type for that kind, and Core's type+ MUST stay unchanged. Without the project's TypeScript it MUST say that the+ descriptors were not type-checked and why, and MUST NOT report a pass.+- **INV35 — One command checks an integration, and can gate its build.** The+ `astryx integration check` command, which takes no package argument, MUST run+ the `validate`, `components`, `templates`, and `docs` checks against the+ integration package in the current folder, report each check's own result and+ a summary, and exit 1 exactly when one of those checks would exit 1 on its+ own. With `--strict` it MUST also exit 1 on any warning and on any check, or+ comparison within a check, that did not run, such as a package with no+ integration manifest or a comparison that needs the project's TypeScript,+ reporting each as an error from the same findings the default run reports+ (INV32). An item a comparison lists as unchecked,+ such as a prop type it cannot read, does not fail `--strict`. Its exit codes+ and JSON shape are a compatibility contract for the builds that run it: a new+ check, or a new failure code, MAY join it only in a minor release that names+ the addition. A name a patch release adds to Core or the CLI (a component,+ template, or topic) MAY raise a conflict with a package's own name. Each+ `doctor integration` subcommand, exit code, and JSON MUST stay unchanged.- **INV9 — A command that cannot support `--json` is rejected before any sideeffect**, not part-way through the work.- **INV10 — Every write is confined.** Output paths pass `assertWithin`, which@@ -453,6 +493,17 @@ Rejected: a command that fails on warnings by default (a CLI upgrade turnsgreen builds red); a gate flag or command with another name for each case(each one a new contract to keep).+### DEC-5 — Integration doc checks are command contracts++**Decider:** `josephfarina`, `2026-10-18`++INV33, INV34 and INV35 state the prop and descriptor-type checks that+`doctor integration` runs and the `integration check` command that builds run.+They are command contracts beside INV32, so this record governs them, and+`spec:AST-039` FR12, FR13 and FR14 point here.+Rejected: governing them only from `spec:AST-039` (a draft record does not+govern).+## Verification| Invariant | Evidence | Failure signal |@@ -478,6 +529,9 @@ green builds red); a gate flag or command with another name for each case| 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 || INV32 | `test/cli-strict-guard.test.mjs` lists every command offering `--strict` and every command whose exit depends on warnings; `api/integration/check/check.test.mjs` compares a strict run with the default run | A second command offers `--strict`, a command exits 1 on a warning alone without `--strict`, or a strict run reports a finding the default run does not or outside the command's issue format. |+| INV33 | `foundation/discovery/prop-drift.test.mjs`, `foundation/discovery/type-text.test.mjs`, `clients/cli/commands/doctor-integration.test.mjs`, `test/core-prop-docs.test.mjs` | A removed or renamed prop or a changed union passes unreported, or a missing compiler reads as a pass. |+| INV34 | `foundation/discovery/doc-types.test.mjs`, `clients/cli/commands/doctor-integration.test.mjs`, `test/core-doc-types.test.mjs` | An unknown, missing, or mistyped field passes unreported, or a missing compiler reads as a pass. |+| INV35 | `api/integration/check/check.test.mjs`, `clients/cli/commands/integration-check.test.mjs`, `test/integration-check-failures.test.mjs`, `api/search/search.integration-check.test.mjs` | The default exit differs from a check's own, a warning or a skipped comparison passes `--strict`, text and JSON exit differently, a new failing finding is added without the list changing, or a search for ci does not find the command first. |## Open questionsdiff --git a/docs/specs/AST-039/spec.md b/docs/specs/AST-039/spec.mdindex 487efd30be..5807589e98 100644--- a/docs/specs/AST-039/spec.md+++ b/docs/specs/AST-039/spec.md@@ -134,46 +134,12 @@ change.MUST NOT change a file its siblings share; only the integration manifest and`package.json` may change, to declare a new root. Review MUST reject a changethat adds a central catalog, and writer tests MUST fail on one.-- **FR12 — Documented component props agree with the source.**- `astryx doctor integration components` MUST compare every prop table a- component descriptor documents with the props of the export it describes, read- with the TypeScript the project installs. It MUST warn about a documented prop- the code lacks, a prop the package's own source declares that the table omits,- a `required` flag the code contradicts, and a documented type that does not- match the code under the loose comparison the command documents. It MUST list- a documented type it cannot judge as unchecked rather than report a match or a- mismatch. Without the project's TypeScript it MUST say that the comparison was- skipped and why, and MUST NOT report a pass.-- **FR13 — Every descriptor satisfies its published authoring type.**- `astryx doctor integration validate` MUST check each descriptor an- integration's roots hold, and each translation a descriptor carries, against- the type `@astryxdesign/cli/authoring` publishes for that kind in an- integration, as the TypeScript the project installs checks a value written- with that type. It MUST warn about every unknown field, missing required- field, and value outside its field's type, naming the field and the change- that fixes it, including a field the compiler reaches only once an earlier- unknown field is gone. A value the loader accepts and the CLI reads MUST- satisfy that type. Where an integration may author more than Core's type for a- kind allows, such as any template `category`, `@astryxdesign/cli/authoring`- MUST publish an additional integration type for that kind, and Core's type- MUST stay unchanged. Without the project's TypeScript it MUST say that the- descriptors were not type-checked and why, and MUST NOT report a pass.-- **FR14 — One command checks an integration, and can gate its build.** The- `astryx integration check` command, which takes no package argument, MUST run- the `validate`, `components`, `templates`, and `docs` checks against the- integration package in the current folder, report each check's own result and- a summary, and exit 1 exactly when one of those checks would exit 1 on its- own. With `--strict` it MUST also exit 1 on any warning and on any check, or- comparison within a check, that did not run, such as a package with no- integration manifest or a comparison that needs the project's TypeScript,- reporting each as an error from the same findings the default run reports- (`architecture:cli-surface` INV32). An item a comparison lists as unchecked,- such as a prop type it cannot read, does not fail `--strict`. Its exit codes- and JSON shape are a compatibility contract for the builds that run it: a new- check, or a new failure code, MAY join it only in a minor release that names- the addition. A name a patch release adds to Core or the CLI (a component,- template, or topic) MAY raise a conflict with a package's own name. Each- `doctor integration` subcommand, exit code, and JSON MUST stay unchanged.+- **FR12 — Documented component props agree with the source.** Governed by+ `architecture:cli-surface` INV33.+- **FR13 — Every descriptor satisfies its published authoring type.** Governed by+ `architecture:cli-surface` INV34.+- **FR14 — One command checks an integration, and can gate its build.** Governed by+ `architecture:cli-surface` INV35.### Compatibility transition