Repository navigation
spec(cli-surface): refusing a write outside its confined root is a fix - #7545
josephfarina wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
Hey Joey, I'd rather AST-017 not hold CLI-specific breaking rules. Could you put the write-confinement classification in the CLI record ( |
30134ac to
50a994a
Compare
|
/approve-spec 50a994a |
…7 owns the release process (#7608) ## Exact decision needed Who decides what counts as breaking for a published surface that is not a component, such as the CLI? Today `spec:AST-017` holds every surface's breaking rules, so a CLI owner who wants to say "this CLI correction is a `[fix]`, not breaking" has to change AST-017. This PR makes each non-component surface define its own compatibility contract in its own current record, and keeps AST-017 as the owner of the release process that applies the result. Components keep their rules in AST-017. ## Existing authority searched - `spec:AST-017` (current, owners `cixzhang`, `josephfarina`): FR1–FR6 define breaking for every surface; FR3, FR9–FR13 and FR45 carry CLI-specific classification; FR32–FR34 classify corrections with a released victim; the Authority relationships section says `architecture:cli-surface` and `spec:AST-042` own CLI structure, admission and parity, while AST-017 owns "compatibility and release transition". Nothing lets a surface record decide its own breaking rules. - `architecture:cli-surface` (current, owner `josephfarina`, approved by `cixzhang`): INV3 (error codes are append-only) and INV10 (every write is confined) already state CLI contract facts, but the record does not say how a correction to them is classified, because AST-017 claims that. - Open work on the same record: `#7545` (draft) adds a CLI write-confinement rule as FR54 and DEC-21. DEC-21 is already used on main (successor plan, merged in `#7445`). This PR takes the next free IDs on main, FR54 and DEC-22, so `#7545` collides on FR54. Under this PR its content belongs in `architecture:cli-surface` (next to INV10) instead of AST-017; if it stays in AST-017 it must renumber. ## Decision `spec:AST-017/DEC-22`, decider `cixzhang`. - **FR54 (new):** each published surface other than a component takes its compatibility contract from its own current record. For the CLI that record is `architecture:cli-surface`. The contract states which consumer scenarios are valid and supported, what counts as a released victim, and which corrections are `[fix]` vs `[breaking]`. The surface record's owners decide it through that record's normal approval. - Where the surface record states a rule for a case, that rule decides it. Where it is silent, FR1–FR6 and AST-017's existing rules for that surface apply, so nothing is left unclassified. - A surface rule turns on the change and its contract, never on risk or adoption (FR6), and covers only released, published surfaces (FR2). - AST-017's release process applies to the result unchanged: Changeset categories and bump tiers, migration evidence, experimental isolation, patch/minor/emergency paths, deprecation and coexistence, release gates. - A surface record defines only whether a change is breaking, never how it ships. Anything any surface record classifies as `[breaking]` lands only in a declared minor (FR31) or through the emergency path (FR35), never in a patch release; no surface record can make it patch-eligible by redefining a release rule. - Components keep AST-017's rules, including FR3 and FR53. - **Pointers:** Intent, FR1, FR32, Authority relationships, and Current-state impact point to FR54. FR54 and DEC-22 join the `compatibility` review trigger. The verification table gains an FR54 row. - **Not in this PR:** any CLI breaking rule itself, including write confinement. That is the CLI record owner's to add in `architecture:cli-surface`. ## Rejected alternatives - Keep every surface's breaking rules in AST-017. This makes AST-017's owners decide contracts for surfaces they do not own, and every CLI classification change waits on a global record. - Move AST-017's existing CLI rules (FR9–FR13, FR45) into `architecture:cli-surface` in the same PR. That is a larger, separate change for the CLI owner; FR54's "silent means AST-017 applies" keeps them working until the CLI record replaces them. ## Claim scope and non-goals - Governs only who defines the compatibility contract for non-component surfaces, and that AST-017's process applies to the result. - Does not change any classification today: no surface record states its own rule yet, so every current outcome is unchanged. - Does not change component classification, accessibility fixes (FR53), the tier gate, or release mechanics. ## Evidence and implementation relationship No implementation. `pnpm check:changesets` and release tooling are unaffected: they check categories and tiers, which stay in AST-017. ## Writing rubric results - R1 narration: none; FR54 and DEC-22 are present tense. The DEC-22 rationale states the ownership fact, not the history of the change. - R2 research in the record: none. - R3 evidence naming a change: none; the FR54 verification row names the review and representative cases. - R4 rejected alternatives over one line or outside a decision: one, inside DEC-22, one line. - R5 pull request or issue references remaining: none added (searched the diff for `#` followed by digits, `/pull/`, `/issues/`). - R6 ruled open questions still listing options: none; Open questions stays "None". ## Scope - [x] This PR contains specification records only. - [x] It records observable behavior and preserves equivalent internal implementations. - [x] Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract. - [x] Verification states the evidence layer and failure signal without prescribing CI job/workflow topology. - [x] It records one intentional durable decision, not a rescue for a separable tagalong. - [x] The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision. - [x] Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them. - [x] Public text and artifacts contain no internal Meta context. ## Validation - `pnpm check:knowledge` - Prettier - `git diff --check`
PR Analysis Report
No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Visual Regression38 of 474 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 18 more. Generated by PR Enrichment workflow | View full report |
This follows
cixzhang's suggestion on this pull request: the CLI's write-confinement classification lives in the CLI record,architecture:cli-surface, next to INV10, andspec:AST-017keeps the release process. This change no longer editsspec:AST-017.Exact decision needed
The owner of
architecture:cli-surface(josephfarina) approves one rule, INV10a:If approved, a Changeset for such a refusal is
[fix],patch, and cites INV10a. If not, the same refusal stays[breaking]and waits for a declared minor.It lands after #7608, which makes each published surface other than a component define its own compatibility contract in its own current record. Until then,
spec:AST-017FR32 classifies the same case as[breaking].Existing authority searched
architecture:cli-surfaceINV10 (current): "Every write is confined. Output paths passassertWithin, which canonicalises symlinks and rejects a NUL byte; an escape isERR_PATH_TRAVERSAL." It states the confinement, but not how a correction to it is classified.spec:AST-017(current) on main:[breaking]and lands in a declared minor.spec:AST-017FR54 and DEC-22, so each published surface other than a component takes its compatibility contract from its own current record, and namesarchitecture:cli-surfaceas the CLI's. It already adds the FR1 and FR32 pointers that hand the case to this record, so this change adds no text tospec:AST-017. DEC-11 needs no separate pointer: it covers a correction with a valid released victim, and INV10a states that a caller relying on a write outside the root is not one.docs/contributing/cli-conventions.md: "Any path you write passes throughassertWithin." This is guidance, not a record.architecture:cli-surfaceon main has INV1–INV29 and DEC-1. Among open pull requests, spec(cli-surface): INV30, how a host's package set serves the CLI #7412 claims INV30, and spec(cli-surface): agent docs reach every agent from the project's own files #7539 claims INV31 and DEC-2.architecture:internationalizationplaces INV1a, and DEC-3.spec:AST-017gets no new ID. Main ends at FR53 and DEC-21, and spec(AST-017): each non-component surface defines what breaks; AST-017 owns the release process #7608 takes FR54 and DEC-22.docs/architecture/cli-surface.md:spec:AST-017.Decision
architecture:cli-surface/DEC-3, deciderjosephfarina, the record's owner.[fix]and patch-eligible under thespec:AST-017release process.Rejected alternatives
spec:AST-017, as this pull request first did.cixzhangprefers thatspec:AST-017own the release process and not hold CLI-specific breaking rules. Its decision number also collided with a decision since merged on main.spec:AST-017FR35's emergency path. It keeps the change[breaking]and needs a separate record and approval for each case, though these corrections are one recurring class with one shape.The record keeps the second and fourth as one
Rejected:line in DEC-3.Claim scope and non-goals
spec:AST-017release process: categories and tiers, the declared-tier gate, the emergency path, and coexistence rules all stay as they are.Evidence and implementation relationship
There is no implementation in this pull request. A Changeset can cite the rule as
architecture:cli-surface/INV10a, matching how existing release notes cite records (for examplespec:AST-017/FR45). I checked this on main, which declares 0.7.2, a patch plan: a[fix]patchChangeset that cites INV10a passespnpm check:changesetsand parses as categoryfix, and the same entry as[breaking]minoris refused.Writing rubric results
Rejected:line inside DEC-3.#followed by digits,/pull/and/issues/).Scope
Validation
pnpm check:knowledge: passes ("Knowledge templates and records are aligned.").scripts/check-knowledge.test.mjs: 121 passed.prettier --checkondocs/architecture/cli-surface.mdalready fails on main, because its Verification table needs re-padding. This change leaves that table alone, so it doesn't conflict with the open pull requests that edit it.git diff --check: clean.