@firstdraft.com/cli 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -63
- package/docs/README.md +11 -12
- package/docs/commands.md +53 -25
- package/docs/errors.md +64 -29
- package/docs/release-history.md +8 -0
- package/package.json +1 -1
- package/src/cli.js +301 -29
- package/src/commands/compilation.js +355 -1
- package/src/commands/plan-compile.js +119 -10
- package/src/plan-compile-progress.js +6 -2
package/README.md
CHANGED
|
@@ -1,84 +1,106 @@
|
|
|
1
1
|
# First Draft CLI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
publication
|
|
3
|
+
firstdraft is the command-line client shared by First Draft agents and automation. It manages local Foundation Plan
|
|
4
|
+
files, calls the versioned Service API, exposes reviewed analysis and GapSets, materializes verified Compilations,
|
|
5
|
+
and coordinates private GitHub publication.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
a compatible First Draft service and are intended for coordinated trials; publishing this CLI does not make the
|
|
11
|
-
wider service generally available.
|
|
7
|
+
Trying First Draft as a tester? Start with the
|
|
8
|
+
[Drawing Board guide](https://github.com/firstdraft/drawing-board#build-an-app-with-first-draft), which installs a
|
|
9
|
+
compatible CLI and Skill together.
|
|
12
10
|
|
|
13
|
-
##
|
|
11
|
+
## What this repository owns
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
- local Plan initialization, UUIDs, application keys, and source hashing;
|
|
14
|
+
- conditional whole-document push and conflict reporting;
|
|
15
|
+
- analysis polling and complete GapSet output;
|
|
16
|
+
- direct Compile-and-materialize and private publish orchestration;
|
|
17
|
+
- retained Compilation inspection and artifact download;
|
|
18
|
+
- terminal output, exit status, and recovery contracts;
|
|
19
|
+
- the dependency-free npm package; and
|
|
20
|
+
- package provenance and release promotion.
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
The Service owns Foundation Plan meaning and server-side lifecycle. Skills own the agent conversation. This
|
|
23
|
+
repository owns the exact command and transport behavior between them.
|
|
24
|
+
|
|
25
|
+
## Start with the right document
|
|
26
|
+
|
|
27
|
+
| Task | Read first |
|
|
28
|
+
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------- |
|
|
29
|
+
| Change the CLI | [Agent instructions](https://github.com/firstdraft/cli/blob/main/AGENTS.md), then [documentation map](docs/README.md) |
|
|
30
|
+
| Find a command or output contract | [Command reference](docs/commands.md) |
|
|
31
|
+
| Interpret an error or recover safely | [Errors and recovery](docs/errors.md) |
|
|
32
|
+
| Prepare or promote a package | [Release runbook](RELEASING.md) |
|
|
33
|
+
| Inspect dated package observations | [Release history](docs/release-history.md) |
|
|
34
|
+
| Report a vulnerability | [Security policy](SECURITY.md) |
|
|
21
35
|
|
|
22
|
-
|
|
23
|
-
`@firstdraft.com/cli@0.1.0`, when a repeatable installation matters. Candidate publication under `next` is not stable
|
|
24
|
-
release completion and does not displace the supported `latest` release before promotion; see the
|
|
25
|
-
[release policy](RELEASING.md) and [dated release history](docs/release-history.md).
|
|
36
|
+
Run firstdraft --help or a command group's --help for concise terminal syntax.
|
|
26
37
|
|
|
27
|
-
##
|
|
38
|
+
## Repository layout
|
|
28
39
|
|
|
29
|
-
|
|
40
|
+
| Path | Responsibility |
|
|
41
|
+
| -------- | ------------------------------------------------------------- |
|
|
42
|
+
| bin/ | Published executable entrypoint |
|
|
43
|
+
| src/ | Commands, API client, local Plan state, and output contracts |
|
|
44
|
+
| test/ | Command, protocol, recovery, and package tests |
|
|
45
|
+
| scripts/ | Test runner and package allowlist/smoke checks |
|
|
46
|
+
| docs/ | Command, error, release-history, and maintainer documentation |
|
|
47
|
+
|
|
48
|
+
## Development
|
|
49
|
+
|
|
50
|
+
Development uses the Node.js and npm versions pinned in `.tool-versions`. Follow
|
|
51
|
+
[Work on the repository](docs/README.md#work-on-the-repository) for the complete install, audit, and check sequence.
|
|
30
52
|
|
|
31
53
|
```sh
|
|
32
|
-
|
|
54
|
+
npm run check
|
|
33
55
|
```
|
|
34
56
|
|
|
35
|
-
|
|
36
|
-
|
|
57
|
+
The complete check runs type checking, ESLint, Prettier verification, tests, package allowlist validation, and a
|
|
58
|
+
smoke installation of the packed tarball. Use the narrower scripts while iterating:
|
|
37
59
|
|
|
38
60
|
```sh
|
|
39
|
-
|
|
61
|
+
npm run typecheck
|
|
62
|
+
npm run lint
|
|
63
|
+
npm test
|
|
64
|
+
npm run pack:check
|
|
65
|
+
npm run pack:smoke
|
|
40
66
|
```
|
|
41
67
|
|
|
42
|
-
|
|
68
|
+
To exercise the checkout directly:
|
|
43
69
|
|
|
44
70
|
```sh
|
|
45
|
-
|
|
46
|
-
firstdraft plan compile
|
|
71
|
+
node bin/firstdraft.js --help
|
|
47
72
|
```
|
|
48
73
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
Run `firstdraft --help` or a command group's `--help` for concise terminal syntax. The documentation map explains
|
|
84
|
-
which source owns each longer-lived contract.
|
|
74
|
+
Remote commands read FIRSTDRAFT_API_TOKEN from the environment. See
|
|
75
|
+
[Push a Foundation Plan](docs/commands.md#push-a-foundation-plan) for FIRSTDRAFT_API_URL and origin pinning. Keep
|
|
76
|
+
tokens out of arguments, shell history, fixtures, snapshots, and logs.
|
|
77
|
+
|
|
78
|
+
## Package contract
|
|
79
|
+
|
|
80
|
+
The published CLI supports Node.js 22 or newer. Direct automation callers can install the stable package with:
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
npm install --global @firstdraft.com/cli
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Pin an exact compatible version when a repeatable installation matters; [RELEASING.md](RELEASING.md) owns channel
|
|
87
|
+
and promotion meaning.
|
|
88
|
+
|
|
89
|
+
The published package:
|
|
90
|
+
|
|
91
|
+
- installs the firstdraft executable;
|
|
92
|
+
- runs reviewed JavaScript source directly;
|
|
93
|
+
- has no runtime dependencies or install scripts;
|
|
94
|
+
- performs no telemetry, update check, or network request unless the caller invokes an API command;
|
|
95
|
+
- reads Bearer credentials only from the environment; and
|
|
96
|
+
- carries npm provenance linking registry bytes to its GitHub workflow and commit.
|
|
97
|
+
|
|
98
|
+
Inspect the packed file list whenever a source or documentation path moves. The public documentation graph,
|
|
99
|
+
including the release runbook and dated release history, ships with the package. `AGENTS.md` and the source-only
|
|
100
|
+
`release/compatibility.json` do not.
|
|
101
|
+
|
|
102
|
+
## Release boundary
|
|
103
|
+
|
|
104
|
+
Merging source is not package publication. Publishing a candidate, moving npm dist-tags, coordinating the Skills
|
|
105
|
+
package, and promoting a stable release are distinct steps in [RELEASING.md](RELEASING.md). Verify the exact packed
|
|
106
|
+
digest and Service compatibility before any promotion.
|
package/docs/README.md
CHANGED
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
Use this page to find the narrowest authoritative document for a task. Runtime source and tests remain the final
|
|
4
4
|
evidence for implemented behavior; if they contradict a document, surface the contradiction instead of guessing.
|
|
5
5
|
|
|
6
|
-
| If the task concerns... | Read first
|
|
7
|
-
| -------------------------------------------------------------------------------------- |
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
6
|
+
| If the task concerns... | Read first |
|
|
7
|
+
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
8
|
+
| Beginner tester journey | [Drawing Board guide](https://github.com/firstdraft/drawing-board#build-an-app-with-first-draft) |
|
|
9
|
+
| Direct CLI installation, repository orientation, or package contract | [Root README](../README.md) |
|
|
10
|
+
| Commands, options, environment variables, API behavior, output, or materialization | [Command reference](commands.md) |
|
|
11
|
+
| Stable errors, exit codes, retry safety, ambiguous outcomes, or local recovery | [Errors and recovery](errors.md) |
|
|
12
|
+
| Version policy, release preparation, publication, verification, rollback, or promotion | [Release policy and runbook](../RELEASING.md) |
|
|
13
|
+
| What was observed for an earlier tag, package, or dist-tag | [Release history](release-history.md) |
|
|
14
|
+
| Vulnerability reporting | [Security policy](../SECURITY.md) |
|
|
14
15
|
|
|
15
16
|
## Authority boundaries
|
|
16
17
|
|
|
17
|
-
- [README.md](../README.md) owns
|
|
18
|
+
- [README.md](../README.md) owns repository orientation, direct installation, package boundaries, and routes.
|
|
18
19
|
- [commands.md](commands.md) owns detailed command semantics. Built-in `--help`, runtime source, and tests own exact
|
|
19
20
|
executable syntax and behavior.
|
|
20
21
|
- [errors.md](errors.md) owns handled-error interpretation and recovery guidance.
|
|
@@ -26,9 +27,7 @@ evidence for implemented behavior; if they contradict a document, surface the co
|
|
|
26
27
|
## Retrieval quality
|
|
27
28
|
|
|
28
29
|
Start here, then load the one owning document for the task. Follow a cross-link only when the task crosses an
|
|
29
|
-
authority boundary
|
|
30
|
-
headings, short paragraphs, command maps, and checklists; create another page only when it has a distinct audience,
|
|
31
|
-
task, or authority.
|
|
30
|
+
authority boundary. Create another page only for a distinct audience, task, or authority.
|
|
32
31
|
|
|
33
32
|
The documentation tests keep `AGENTS.md` at or below 2 KiB, the root README at or below 6 KiB, and this map at or
|
|
34
33
|
below 4 KiB. They also require every public topic to remain reachable from this map or the root README and verify
|
package/docs/commands.md
CHANGED
|
@@ -4,10 +4,10 @@ This page owns the detailed public semantics of the current command surface. Run
|
|
|
4
4
|
group's `--help` for concise executable syntax. See [Errors and recovery](errors.md) before retrying a failed mutation.
|
|
5
5
|
|
|
6
6
|
The current `0.2.x` source line contains the auditable command shell, local Foundation Plan initialization, local
|
|
7
|
-
application-key and UUID generation, conditional whole-document push, whole-graph analysis status polling,
|
|
8
|
-
|
|
9
|
-
`0.3.x` API contract. See the [release policy](../RELEASING.md) for versioning and channel
|
|
10
|
-
[release history](release-history.md) for the transition from prereleases.
|
|
7
|
+
application-key and UUID generation, conditional whole-document push, whole-graph analysis status polling, direct
|
|
8
|
+
Compile-and-materialize and private publish orchestration, and retained-Compilation inspection. CLI `0.2.x`
|
|
9
|
+
requires the service's `0.3.x` API contract. See the [release policy](../RELEASING.md) for versioning and channel
|
|
10
|
+
semantics and [release history](release-history.md) for the transition from prereleases.
|
|
11
11
|
|
|
12
12
|
## Command map
|
|
13
13
|
|
|
@@ -18,7 +18,7 @@ compile-and-publish orchestration, and read-only retained-Compilation download.
|
|
|
18
18
|
| `firstdraft generate uuid` | No | Generate one or more Foundation Plan subject identities |
|
|
19
19
|
| `firstdraft plan push` | Yes | Conditionally submit the exact whole Plan |
|
|
20
20
|
| `firstdraft plan status` | Yes | Read or wait for the current whole-graph analysis |
|
|
21
|
-
| `firstdraft plan compile` | Yes | Push
|
|
21
|
+
| `firstdraft plan compile` | Yes | Push and analyze, then materialize or publish |
|
|
22
22
|
| `firstdraft compilation status` | Yes | Inspect a retained Compilation by ID |
|
|
23
23
|
| `firstdraft compilation download` | Yes | Verify and materialize a successful retained Compilation |
|
|
24
24
|
|
|
@@ -131,34 +131,62 @@ repeats only validated `processing` responses and stops on its first failed read
|
|
|
131
131
|
a bounded number of times because the command sends only `GET` requests. See
|
|
132
132
|
[read-only failures](errors.md#read-only-status-failures) if the problem persists.
|
|
133
133
|
|
|
134
|
-
## Compile
|
|
134
|
+
## Compile the current Plan
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
To compile into a local application directory, run:
|
|
137
137
|
|
|
138
138
|
```sh
|
|
139
|
-
firstdraft plan compile
|
|
139
|
+
firstdraft plan compile --output ./application
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
`plan compile`
|
|
142
|
+
Both `plan compile` modes first push the exact current bytes in
|
|
143
143
|
`.firstdraft/foundation-plan.json`, even when those bytes are unchanged, and saves the accepted ETag using the same
|
|
144
144
|
contract as `plan push`. It then waits up to two minutes for an analysis whose graph version and
|
|
145
145
|
`head_source_sha256` exactly match that accepted push, polling past a terminal result retained for an older Head.
|
|
146
146
|
Invalid JSON, schema diagnostics, semantic diagnostics, a failed analysis, a superseded analysis, or a recurring
|
|
147
147
|
diagnostic stop the command with structured output; no Compilation or Publication is requested.
|
|
148
148
|
|
|
149
|
-
Only a `valid` analysis proceeds to the
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
149
|
+
Only a `valid` analysis proceeds to the selected completion mode. Immediately before either conditional mutation,
|
|
150
|
+
the CLI re-reads the local Plan and requires its exact bytes and saved state to match the accepted Head. It extracts
|
|
151
|
+
the accepted source SHA-256 from the saved ETag, hashes the current local bytes, and sends that complete ETag in
|
|
152
|
+
`If-Match`.
|
|
153
|
+
|
|
154
|
+
### Materialize a direct Compilation
|
|
155
|
+
|
|
156
|
+
With `--output`, the CLI requires an explicit absent destination beneath an existing real directory. It validates
|
|
157
|
+
that destination before pushing the Plan, checks it again after analysis, and never overwrites, merges into, or
|
|
158
|
+
repairs an existing path.
|
|
159
|
+
|
|
160
|
+
After valid analysis, the CLI requests one Compilation for that exact reviewed Head and never starts GitHub
|
|
161
|
+
Publication. It validates that the `202` response identifies the same Project, graph version, Head, Analysis,
|
|
162
|
+
Compiler release, and target; polls only that retained Compilation for up to ten minutes; downloads its exact
|
|
163
|
+
artifact; and applies the same integrity and atomic materialization contract as `compilation download`. An ambiguous
|
|
164
|
+
Compilation start is not retried automatically. After a validated `202`, later status, artifact, authentication,
|
|
165
|
+
and materialization failures retain the last validated Compilation projection so the caller can recover by ID
|
|
166
|
+
without starting duplicate work. Follow the [direct Compilation recovery procedure](errors.md#direct-compilation-recovery).
|
|
167
|
+
|
|
168
|
+
Success writes one JSON object to stdout containing the validated Project, Compilation, and absolute output path.
|
|
169
|
+
The installed directory contains exactly the artifact files and modes; the CLI does not add a Git repository, run a
|
|
170
|
+
formatter, or repair generated source. When the output is nested inside another Git worktree, initialize the
|
|
171
|
+
application as its own repository before running generated checks that inspect Git; otherwise Git resolves to the
|
|
172
|
+
parent worktree. Progress on stderr reports analysis and Compilation only.
|
|
173
|
+
|
|
174
|
+
### Publish through GitHub
|
|
175
|
+
|
|
176
|
+
Without `--output`, the existing GitHub Publication journey remains unchanged:
|
|
177
|
+
|
|
178
|
+
```sh
|
|
179
|
+
firstdraft plan compile
|
|
180
|
+
```
|
|
154
181
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
time
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
182
|
+
Invoking this form authorizes the internal GitHub Publication lifecycle. The command writes stable human-readable
|
|
183
|
+
progress to stderr, with every line prefixed by `First Draft:`. It reports analysis, Compilation completion or
|
|
184
|
+
terminal failure or cancellation, the current GitHub phase, and an allowlisted reason, retry count, and exact UTC
|
|
185
|
+
retry time when a GitHub preflight check is delayed. A retained retry with no next time is reported as paused and
|
|
186
|
+
requiring operator recovery. Progress never includes IDs, hashes, repository names or URLs, raw server projections,
|
|
187
|
+
local paths, or environment values. Success writes exactly the validated private GitHub repository URL plus a
|
|
188
|
+
newline to stdout. If the command fails after progress has begun, its structured JSON error envelope is the final
|
|
189
|
+
stderr document after the progress lines.
|
|
162
190
|
|
|
163
191
|
The closed API `0.3.x` progress-reason allowlist is `github.configuration_missing`, `github.oauth_unavailable`,
|
|
164
192
|
`github.api_unavailable`, `github.reauthorization_required`, `github.account_mismatch`,
|
|
@@ -177,14 +205,14 @@ identity, and repository identity. Do not run concurrent Compile commands; use t
|
|
|
177
205
|
[publication recovery procedure](errors.md#publication-recovery) after an invocation exits.
|
|
178
206
|
|
|
179
207
|
This release cannot repoint a Project's Publication to a later accepted Head. The public CLI therefore has no
|
|
180
|
-
`plan publish` command
|
|
181
|
-
|
|
182
|
-
URL-only `plan compile` journey.
|
|
208
|
+
`plan publish` command. Direct local Compilation and GitHub Publication are separate completion modes after the same
|
|
209
|
+
exact Plan push and valid Analysis.
|
|
183
210
|
|
|
184
211
|
## Inspect a retained Compilation
|
|
185
212
|
|
|
186
213
|
These lower-level commands are for callers that already hold a retained Compilation ID from authenticated API
|
|
187
|
-
metadata or operational tooling
|
|
214
|
+
metadata or operational tooling. The no-output `plan compile` form prints only the final repository URL, while
|
|
215
|
+
`plan compile --output` waits for and downloads its own direct Compilation:
|
|
188
216
|
|
|
189
217
|
```sh
|
|
190
218
|
firstdraft compilation status 01900000-0000-7000-8000-000000000001
|
package/docs/errors.md
CHANGED
|
@@ -16,12 +16,15 @@ remain human-readable text on standard error with exit 2. Unexpected programming
|
|
|
16
16
|
|
|
17
17
|
## Ambiguous mutations
|
|
18
18
|
|
|
19
|
-
`plan compile` supplies `phase: "push" | "publication"` when `request_outcome_unknown` requires
|
|
20
|
-
recovery:
|
|
19
|
+
`plan compile` supplies `phase: "push" | "compilation" | "publication"` when `request_outcome_unknown` requires
|
|
20
|
+
phase-specific recovery:
|
|
21
21
|
|
|
22
22
|
- `phase: "push"` means the Plan mutation may have been accepted. Stop and reconcile local Head state. Until First
|
|
23
23
|
Draft has a Foundation Plan Head reconciliation endpoint, an accepted request whose response cannot be verified
|
|
24
24
|
may require manual recovery. Do not construct an ETag from the Plan digest or trust an unverified response.
|
|
25
|
+
- `phase: "compilation"` means a direct `--output` Compilation may have started, but its retained identity is unknown.
|
|
26
|
+
The CLI never repeats that `POST`. Do not start another Compilation until the Project is reconciled through First
|
|
27
|
+
Draft or an operator can identify the retained work.
|
|
25
28
|
- `phase: "publication"` means the singleton Publication mutation was not resolved. Do not run concurrent Compile
|
|
26
29
|
commands. After the prior invocation exits, wait and rerun `plan compile` with unchanged Plan bytes to safely
|
|
27
30
|
reconcile or resume the retained singleton.
|
|
@@ -39,9 +42,39 @@ A network failure from `plan status` is safe to retry a bounded number of times
|
|
|
39
42
|
`invalid_server_response` instead means the response violated the CLI/server contract; retrying the unchanged read
|
|
40
43
|
will not repair it.
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
Only the lower-level `compilation status <compilation-id>` command is read-only. Its
|
|
46
|
+
`compilation_status_unavailable` result is safe to retry a bounded number of times;
|
|
43
47
|
`invalid_compilation_status` requires contract reconciliation. A wait stops rather than following a changed
|
|
44
|
-
analysis or Compilation identity.
|
|
48
|
+
analysis or Compilation identity. This read-only retry guidance does not apply to `plan compile --output`, which
|
|
49
|
+
starts a new Compilation after analysis.
|
|
50
|
+
|
|
51
|
+
## Direct Compilation recovery
|
|
52
|
+
|
|
53
|
+
Do not blindly rerun `plan compile --output` after its Compilation start was accepted or may have been accepted.
|
|
54
|
+
That command creates new work; it is not a retained-Compilation reconciliation command.
|
|
55
|
+
|
|
56
|
+
If `request_outcome_unknown` reports `phase: "compilation"`, the start request did not yield a validated retained
|
|
57
|
+
ID. The CLI sent exactly one `POST` and did not retry it. Stop until First Draft or an operator can reconcile the
|
|
58
|
+
Project and identify whether work was retained.
|
|
59
|
+
|
|
60
|
+
Once the start response has yielded a validated retained Compilation, later status, artifact, authentication, and
|
|
61
|
+
materialization failure envelopes include that last validated projection as `current`. Preserve
|
|
62
|
+
`current.compilation.id` and recover without creating duplicate work:
|
|
63
|
+
|
|
64
|
+
- after `compilation_status_unavailable`, use
|
|
65
|
+
`firstdraft compilation status <current.compilation.id>`; this lower-level read is safe to retry boundedly;
|
|
66
|
+
- after `invalid_compilation_status` or `invalid_artifact`, preserve the retained ID and reconcile the CLI/Service
|
|
67
|
+
contract instead of retrying the unchanged invalid read;
|
|
68
|
+
- after `artifact_unavailable`, wait if appropriate and use
|
|
69
|
+
`firstdraft compilation download <current.compilation.id> --output <new-absent-path>`; and
|
|
70
|
+
- after `materialization_failed`, repair the destination condition, then use the same lower-level download command
|
|
71
|
+
with a new absent path.
|
|
72
|
+
|
|
73
|
+
After `compilation_wait_timed_out`, retained work may still continue. Use
|
|
74
|
+
`firstdraft compilation status <current.compilation.id>` for one read-only status check; do not rerun
|
|
75
|
+
`plan compile --output`. `compilation_failed`, `compilation_cancelled`, and `compilation_changed` already carry the
|
|
76
|
+
validated `current` projection appropriate to their stopping boundary. Authentication recovery may refresh the
|
|
77
|
+
credential, but it must continue from the retained ID rather than starting another Compilation.
|
|
45
78
|
|
|
46
79
|
## Publication recovery
|
|
47
80
|
|
|
@@ -60,28 +93,30 @@ stopped without following the replacement.
|
|
|
60
93
|
|
|
61
94
|
## Error index
|
|
62
95
|
|
|
63
|
-
| Commands | `error` | Exit | Meaning
|
|
64
|
-
| -------------------------------------------- | -------------------------------------------------------------------------------------------------- | ---: |
|
|
65
|
-
| Any leaf command | `invalid_arguments` | 2 | Syntax was invalid; no request was made.
|
|
66
|
-
| `plan init` | `local_initialization_failed` | 1 | Initialization failed without overwriting an existing path.
|
|
67
|
-
| `plan push`, `plan compile` | `invalid_configuration` | 2 | API origin or saved Head state is incompatible.
|
|
68
|
-
| Network commands | `authentication_required` | 1 | The token is missing or First Draft returned a validated authentication problem.
|
|
69
|
-
| Plan commands, `compilation *` | `local_input_unreadable` | 1 | Required local Plan or private state could not be read.
|
|
70
|
-
| Status, Compile, Compilation commands | `project_not_pushed` | 1 | No API origin is pinned for the local Project.
|
|
71
|
-
| `plan push`, `plan compile` | `request_outcome_unknown` | 1 | A mutation or its response could not be verified; `plan compile` identifies its
|
|
72
|
-
| `plan push`, `plan compile` | `local_state_not_saved` | 1 | The Plan was accepted but the private ETag state could not be replaced; includes `recovery_state`.
|
|
73
|
-
| `plan push`, `plan compile` | `server_rejected` | 1 | First Draft returned validated Plan diagnostics or rejected the request with a validated problem.
|
|
74
|
-
| `plan status` | `server_rejected` | 1 | First Draft rejected the analysis status request with a validated non-authentication problem.
|
|
75
|
-
| `plan status` | `status_unavailable`, `invalid_server_response` | 1 | The analysis read failed or violated its protocol.
|
|
76
|
-
| `plan compile` | `analysis_status_unavailable`, `invalid_analysis_status`, `analysis_status_rejected` | 1 | The bounded analysis read failed, was invalid, or was rejected.
|
|
77
|
-
| Analysis waits | `analysis_changed`, `wait_timed_out`, `analysis_wait_timed_out` | 1 | The pinned analysis changed or remained processing at the deadline.
|
|
78
|
-
| `plan compile` | `plan_not_valid` | 1 | Analysis completed without `valid`; `current` contains diagnostics and status.
|
|
79
|
-
| `plan compile` | `local_plan_changed` | 1 | Local bytes changed after acceptance
|
|
80
|
-
| `plan compile`
|
|
81
|
-
| `plan compile`
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `compilation download`
|
|
85
|
-
| `compilation
|
|
86
|
-
| `compilation download` | `
|
|
87
|
-
|
|
|
96
|
+
| Commands | `error` | Exit | Meaning |
|
|
97
|
+
| -------------------------------------------- | -------------------------------------------------------------------------------------------------- | ---: | ------------------------------------------------------------------------------------------------------ |
|
|
98
|
+
| Any leaf command | `invalid_arguments` | 2 | Syntax was invalid; no request was made. |
|
|
99
|
+
| `plan init` | `local_initialization_failed` | 1 | Initialization failed without overwriting an existing path. |
|
|
100
|
+
| `plan push`, `plan compile` | `invalid_configuration` | 2 | API origin or saved Head state is incompatible. |
|
|
101
|
+
| Network commands | `authentication_required` | 1 | The token is missing or First Draft returned a validated authentication problem. |
|
|
102
|
+
| Plan commands, `compilation *` | `local_input_unreadable` | 1 | Required local Plan or private state could not be read. |
|
|
103
|
+
| Status, Compile, Compilation commands | `project_not_pushed` | 1 | No API origin is pinned for the local Project. |
|
|
104
|
+
| `plan push`, `plan compile` | `request_outcome_unknown` | 1 | A mutation or its response could not be verified; `plan compile` identifies its mutation phase. |
|
|
105
|
+
| `plan push`, `plan compile` | `local_state_not_saved` | 1 | The Plan was accepted but the private ETag state could not be replaced; includes `recovery_state`. |
|
|
106
|
+
| `plan push`, `plan compile` | `server_rejected` | 1 | First Draft returned validated Plan diagnostics or rejected the request with a validated problem. |
|
|
107
|
+
| `plan status` | `server_rejected` | 1 | First Draft rejected the analysis status request with a validated non-authentication problem. |
|
|
108
|
+
| `plan status` | `status_unavailable`, `invalid_server_response` | 1 | The analysis read failed or violated its protocol. |
|
|
109
|
+
| `plan compile` | `analysis_status_unavailable`, `invalid_analysis_status`, `analysis_status_rejected` | 1 | The bounded analysis read failed, was invalid, or was rejected. |
|
|
110
|
+
| Analysis waits | `analysis_changed`, `wait_timed_out`, `analysis_wait_timed_out` | 1 | The pinned analysis changed or remained processing at the deadline. |
|
|
111
|
+
| `plan compile` | `plan_not_valid` | 1 | Analysis completed without `valid`; `current` contains diagnostics and status. |
|
|
112
|
+
| `plan compile` | `local_plan_changed` | 1 | Local bytes or saved state changed after acceptance, before the selected mutation. |
|
|
113
|
+
| `plan compile --output` | `compilation_start_rejected`, `compilation_status_unavailable`, `invalid_compilation_status` | 1 | Direct start was rejected or retained status failed; post-start errors include `current`. |
|
|
114
|
+
| `plan compile --output` | `compilation_changed`, `compilation_wait_timed_out`, `compilation_failed`, `compilation_cancelled` | 1 | The pinned direct Compilation changed, timed out, failed, or was cancelled. |
|
|
115
|
+
| `plan compile` | `publication_start_rejected`, `publication_status_unavailable`, `invalid_publication_status` | 1 | Publication start or status failed its validated transport contract. |
|
|
116
|
+
| `plan compile` | `publication_changed`, `publication_wait_timed_out`, `publication_failed`, `publication_cancelled` | 1 | The pinned Publication changed, timed out, or reached a non-success terminal state. |
|
|
117
|
+
| `compilation status`, `compilation download` | `compilation_status_unavailable`, `invalid_compilation_status` | 1 | The retained status could not be read or violated its exact contract. |
|
|
118
|
+
| `compilation status --wait` | `compilation_changed`, `compilation_wait_timed_out` | 1 | Retained identity/provenance changed or the wait ended. |
|
|
119
|
+
| `compilation download` | `compilation_not_succeeded` | 1 | Status was not `succeeded`; no artifact request was made. |
|
|
120
|
+
| Download commands | `artifact_unavailable`, `invalid_artifact` | 1 | Artifact transport or integrity validation failed; direct Compile post-start errors include `current`. |
|
|
121
|
+
| Download commands | `invalid_output_path` | 2 | The destination was not an absent path beneath an existing real directory. |
|
|
122
|
+
| Download commands | `materialization_failed` | 1 | The output raced or installation failed; direct Compile post-start errors include `current`. |
|
package/docs/release-history.md
CHANGED
|
@@ -30,3 +30,11 @@ the living [release policy and runbook](../RELEASING.md).
|
|
|
30
30
|
The alpha versions remain immutable registry history but, as of the August 12 observation, neither distribution
|
|
31
31
|
channel selected them. Protected tag `v0.1.0` and package version `0.1.0` were consumed and immutable. Preparing
|
|
32
32
|
source or documentation does not mutate either dist-tag.
|
|
33
|
+
|
|
34
|
+
## 0.2.0 candidate publication
|
|
35
|
+
|
|
36
|
+
- On August 27, 2026, protected tag `v0.2.0` published ordinary version `0.2.0` under `next`; `latest` remained
|
|
37
|
+
`0.1.0`. The candidate established compatibility with API contract `0.3.x` but did not displace the separately
|
|
38
|
+
promoted stable release.
|
|
39
|
+
- Package version `0.2.0` and protected tag `v0.2.0` are consumed and immutable. A backward-compatible addition to
|
|
40
|
+
the `0.2.x` line therefore requires a higher patch version rather than reusing those identities.
|