rig-create 1.1.0 → 1.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/docs/CHECKS.md +1 -1
- package/docs/LIVE-REVIEW.md +4 -4
- package/package.json +2 -2
- package/src/restart.ts +29 -6
package/docs/CHECKS.md
CHANGED
|
@@ -1541,7 +1541,7 @@ and known regressions under `ledger`.
|
|
|
1541
1541
|
| `RESTART_NOT_A_PROJECT` | the folder has no readable `rig-create/project@0` `project.json` | run restart on a create project folder |
|
|
1542
1542
|
| `RESTART_NOT_IN_GIT` | the project folder is not inside a git work tree, so git history cannot hold the record restart replaces | put the project under git, commit `project.json`, then restart |
|
|
1543
1543
|
| `RESTART_RECORD_UNCOMMITTED` | `project.json` is untracked, staged but never committed, or differs from its version at HEAD | commit `project.json`, then restart |
|
|
1544
|
-
| `RESTART_INPUT_INVALID` | a kept input fails the input writer's checks,
|
|
1544
|
+
| `RESTART_INPUT_INVALID` | a kept input fails the input writer's checks, or a left-out legacy entry is the declared `painting` without a writer-valid twin for the same bytes | restore the file, or register it again with `input add` (`input add --painting` for the painting) |
|
|
1545
1545
|
| `RESTART_PART_SET_INCOMPLETE` | a kept part set (inputs under `<set>/parts/*.png` or `<set>/parts.json`) lacks `<set>/parts.json`, a part PNG, or its rig: `rig.json` and `mesh_report.json` at `<set>/rig/` or `<set>/` | register the missing files with `input add`, or stop keeping the set |
|
|
1546
1546
|
| `RESTART_MALFORMED` | `restarts` is not a list, or an entry lacks `{ at, by, reason, previous_record_sha256 }` | restore the entry `restart` wrote |
|
|
1547
1547
|
| `RESTART_SOURCE_CHANGED` | `project.json` changed while `restart` was validating | retry against the current record |
|
package/docs/LIVE-REVIEW.md
CHANGED
|
@@ -30,7 +30,7 @@ the record request refuses `JOB_DIRECTION_VERDICT_REQUIRED` without writing.
|
|
|
30
30
|
After verdict ingest, `job open --plan` asks `signoff direction-review` on the
|
|
31
31
|
record page. Ingest `signoff direction-review --from-review <actId>`, then
|
|
32
32
|
`advance accepted`. This route is supported by release-pinned
|
|
33
|
-
[Review 4.0
|
|
33
|
+
[Review 4.1.0](https://github.com/rig-c/review/tree/v4.1.0), including the
|
|
34
34
|
record direction-review sign-off from
|
|
35
35
|
[Review #795](https://github.com/rig-c/review/pull/795).
|
|
36
36
|
|
|
@@ -348,14 +348,14 @@ again.
|
|
|
348
348
|
| `post` checkpoints | record plan | `job open --plan` in `post` when the checkpoint is enabled and at-checkpoint |
|
|
349
349
|
| `parts-review` | draft | `draft-rig` commits in `parts-review`, or the agent runs `job open` to refresh the draft after `parts-review --from-review` / `diff-classes` |
|
|
350
350
|
| `rig-review` | rig version | `advance rig-review` commits the move into `rig-review`, `rig-version` commits in `rig-review`, or the agent runs `job open` to refresh the live `rig` head after `review <n> --from-review` |
|
|
351
|
-
| `direction-review` | record plan, using release-pinned Review 4.0
|
|
351
|
+
| `direction-review` | record plan, using release-pinned Review 4.1.0 | `job open --plan` after the current post's accepted live verdict is ingested; ingest the real signature, then `advance accepted` |
|
|
352
352
|
| `plan-approved`, `rigging-interview`, `post-interview` | record plan | `job open --plan` in the approval stage |
|
|
353
|
-
| `interview` | record plan, using release-pinned Review 4.0
|
|
353
|
+
| `interview` | record plan, using release-pinned Review 4.1.0 with the interview carrier ([Review #803](https://github.com/rig-c/review/pull/803), issue #800) | `job open --plan` after `interview --check` passes and the displayed plan has steps; ingest `signoff interview --from-review <actId>`, then `advance plan-approved` |
|
|
354
354
|
|
|
355
355
|
Interview picks use `job open --question <id>`. After ingesting every pick,
|
|
356
356
|
run `interview --check`, then `job open --plan` for the interview signature.
|
|
357
357
|
This record route is supported by release-pinned
|
|
358
|
-
[Review 4.0
|
|
358
|
+
[Review 4.1.0](https://github.com/rig-c/review/tree/v4.1.0), including the
|
|
359
359
|
[Review #803](https://github.com/rig-c/review/pull/803) carrier (issue #800).
|
|
360
360
|
The record subject is `plan`, with non-empty
|
|
361
361
|
displayed steps, even though the signature approves the interview answers
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rig-create",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Create a rig project: its folder, decision record, repository and pinned rig-c packages",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@rig-c/core": "3.7.0",
|
|
34
34
|
"@rig-c/parts": "2.37.0",
|
|
35
|
-
"@rig-c/review": "4.0
|
|
35
|
+
"@rig-c/review": "4.1.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/bun": "^1.3.0",
|
package/src/restart.ts
CHANGED
|
@@ -110,16 +110,36 @@ export function restartCommand(args: string[], now: number): { stdout: string; e
|
|
|
110
110
|
} catch { return notProject(`is not a ${PROJECT_SCHEMA} record`); }
|
|
111
111
|
const inputs = { dir, project, refusals: [] as Finding[], warnings: [] as Finding[] };
|
|
112
112
|
checkInputs(inputs);
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
const invalidInput = (finding: Finding): never => refuse('RESTART_INPUT_INVALID', `${finding.path}: ${finding.code}: ${finding.message}; a restart keeps only inputs the input writer would record, so restore the file or register it again with input add`);
|
|
114
|
+
const firstRefusal = inputs.refusals[0] ?? inputs.warnings.find(finding => finding.code !== 'INPUT_WRITER_MISSING');
|
|
115
|
+
if (firstRefusal !== undefined) invalidInput(firstRefusal);
|
|
116
|
+
const legacyPaths = new Set(inputs.warnings.filter(finding => finding.code === 'INPUT_WRITER_MISSING').map(finding => finding.path));
|
|
117
|
+
const keptInputs: Json[] = [];
|
|
118
|
+
const leftOut: { index: number; entry: JsonObject }[] = [];
|
|
119
|
+
asArray(project.inputs).forEach((raw, index) => {
|
|
120
|
+
if (legacyPaths.has(`inputs[${index}]`)) leftOut.push({ index, entry: isObject(raw) ? raw : {} });
|
|
121
|
+
else keptInputs.push(raw);
|
|
122
|
+
});
|
|
123
|
+
let painting = project.painting;
|
|
124
|
+
if (typeof painting === 'string' && !keptInputs.some(entry => isObject(entry) && entry.path === painting)) {
|
|
125
|
+
const legacyPainting = leftOut.find(({ entry }) => entry.path === painting)?.entry;
|
|
126
|
+
const twin = legacyPainting !== undefined && typeof legacyPainting.sha256 === 'string' && typeof legacyPainting.bytes === 'number'
|
|
127
|
+
? keptInputs.filter(isObject).find(entry => entry.sha256 === legacyPainting.sha256 && entry.bytes === legacyPainting.bytes && typeof entry.path === 'string')
|
|
128
|
+
: undefined;
|
|
129
|
+
if (twin !== undefined) painting = twin.path;
|
|
130
|
+
}
|
|
131
|
+
const keptCheck = { dir, project: { ...project, ...(painting !== undefined ? { painting } : {}), inputs: keptInputs }, refusals: [] as Finding[], warnings: [] as Finding[] };
|
|
132
|
+
checkInputs(keptCheck);
|
|
133
|
+
const keptFinding = keptCheck.refusals[0] ?? keptCheck.warnings[0];
|
|
134
|
+
if (keptFinding !== undefined) invalidInput(keptFinding);
|
|
135
|
+
const gaps = partSetGaps(keptInputs);
|
|
116
136
|
if (gaps.length) refuse('RESTART_PART_SET_INCOMPLETE', `inputs: a kept part set needs its parts.json and its rig with its PNGs, missing ${gaps.join('; ')}; register the missing files with input add, or stop keeping the set`);
|
|
117
137
|
const candidate = freshProjectRecord(typeof project.name === 'string' ? project.name : '', now);
|
|
118
138
|
if (project.name !== undefined) candidate.name = project.name;
|
|
119
139
|
if (project.title !== undefined) candidate.title = project.title;
|
|
120
|
-
if (
|
|
140
|
+
if (painting !== undefined) candidate.painting = painting;
|
|
121
141
|
if (project.same_artwork !== undefined) candidate.same_artwork = project.same_artwork;
|
|
122
|
-
candidate.inputs =
|
|
142
|
+
candidate.inputs = keptInputs;
|
|
123
143
|
candidate.fix_ledger = project.fix_ledger ?? [];
|
|
124
144
|
const entry: JsonObject = { at: new Date(now).toISOString(), by: opts['--by'], reason, previous_record_sha256: createHash('sha256').update(original).digest('hex') };
|
|
125
145
|
candidate.restarts = [...asArray(project.restarts), entry];
|
|
@@ -132,9 +152,12 @@ export function restartCommand(args: string[], now: number): { stdout: string; e
|
|
|
132
152
|
if (rejected !== undefined) refuse(rejected.code, rejected.message);
|
|
133
153
|
writeRecord(file, original, candidate, 'restart');
|
|
134
154
|
const rows = asArray(candidate.fix_ledger).length;
|
|
155
|
+
const leftOutText = leftOut.length
|
|
156
|
+
? `; left out legacy input(s) ${leftOut.map(({ index, entry: item }) => typeof item.path === 'string' && item.path.trim() !== '' ? `inputs[${index}] (${item.path})` : `inputs[${index}]`).join(', ')}`
|
|
157
|
+
: '';
|
|
135
158
|
return {
|
|
136
159
|
stdout: json ? JSON.stringify(entry, null, 2)
|
|
137
|
-
: `restart: project record restarted at stage ${String(candidate.stage)}; kept ${asArray(candidate.inputs).length} input(s) and ${rows} ledger row(s); the earlier record (sha256 ${String(entry.previous_record_sha256)}) is in git history`,
|
|
160
|
+
: `restart: project record restarted at stage ${String(candidate.stage)}; kept ${asArray(candidate.inputs).length} input(s) and ${rows} ledger row(s)${leftOutText}; the earlier record (sha256 ${String(entry.previous_record_sha256)}) is in git history`,
|
|
138
161
|
exit: 0,
|
|
139
162
|
};
|
|
140
163
|
} finally { release(); }
|