halfcycle 0.4.8 → 0.4.10

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.
Files changed (48) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/bin/bin.bundle.mjs +2162 -335
  3. package/commands/agent-teams-orchestration.md +1 -1
  4. package/commands/consistency-check.md +1 -1
  5. package/commands/context-update.md +1 -1
  6. package/commands/halfcycle-design.md +1 -1
  7. package/commands/halfcycle-setup.md +1 -1
  8. package/commands/stack-assembly-worker.md +1 -1
  9. package/commands/task-execution.md +1 -1
  10. package/commands/task-graph.md +1 -1
  11. package/commands/write-spec.md +1 -1
  12. package/dist/bin.d.ts +2 -1
  13. package/dist/bin.d.ts.map +1 -1
  14. package/dist/bin.js +0 -0
  15. package/dist/build-record/obtain.d.ts +14 -7
  16. package/dist/build-record/obtain.d.ts.map +1 -1
  17. package/dist/build-record/render-v2.d.ts +32 -6
  18. package/dist/build-record/render-v2.d.ts.map +1 -1
  19. package/dist/build-record/write.d.ts +2 -2
  20. package/dist/build-record/write.d.ts.map +1 -1
  21. package/dist/cli-contract.d.ts +2 -9
  22. package/dist/cli-contract.d.ts.map +1 -1
  23. package/dist/cli.js +3859 -1946
  24. package/dist/cli.js.map +3 -3
  25. package/dist/close-phase.d.ts +223 -134
  26. package/dist/close-phase.d.ts.map +1 -1
  27. package/dist/draw/index.d.ts +29 -6
  28. package/dist/draw/index.d.ts.map +1 -1
  29. package/dist/identity.d.ts +78 -9
  30. package/dist/identity.d.ts.map +1 -1
  31. package/dist/index.js +1685 -232
  32. package/dist/index.js.map +3 -3
  33. package/dist/install.d.ts +16 -0
  34. package/dist/install.d.ts.map +1 -1
  35. package/dist/open-phase.d.ts +25 -1
  36. package/dist/open-phase.d.ts.map +1 -1
  37. package/dist/plan.d.ts +75 -23
  38. package/dist/plan.d.ts.map +1 -1
  39. package/dist/pre-create-checks.d.ts.map +1 -1
  40. package/dist/review.d.ts +231 -0
  41. package/dist/review.d.ts.map +1 -0
  42. package/dist/shown-record.d.ts +46 -0
  43. package/dist/shown-record.d.ts.map +1 -0
  44. package/dist/system-report.d.ts +28 -4
  45. package/dist/system-report.d.ts.map +1 -1
  46. package/package.json +11 -11
  47. package/dist/project-page.d.ts +0 -24
  48. package/dist/project-page.d.ts.map +0 -1
@@ -25,6 +25,7 @@
25
25
  * treats its own.
26
26
  */
27
27
  import { type MethodUpdate, type PhaseEntryDecision } from '@halfcycle/events';
28
+ import { type HeadCommitOutcome } from './close-phase.js';
28
29
  /**
29
30
  * A local phase stamp that could not be written, on a phase that DID move.
30
31
  *
@@ -68,7 +69,30 @@ export interface OpenedPhase {
68
69
  * and writes nothing about a move, exactly as it did before this field existed.
69
70
  */
70
71
  methodUpdated: MethodUpdate | null;
72
+ /**
73
+ * Whether this open could read a HEAD commit to send as where the phase starts,
74
+ * and the commit or the cause when it could not (`what-halfcycle-saw` AC1). At
75
+ * project scope this is still whatever the local read found — `describeStartCommit`
76
+ * is what decides nothing is printed there.
77
+ */
78
+ startCommitSent: HeadCommitOutcome;
79
+ /**
80
+ * The start commit in force after this open, per the plane's answer — the commit
81
+ * the phase counts its changes from, or `null` when there is none. `undefined`
82
+ * when the answer carries no such field at all: an older control, read loosely the
83
+ * same way `methodUpdated` is.
84
+ */
85
+ startCommit: string | null | undefined;
71
86
  }
87
+ /**
88
+ * O1–O2–O3 (`what-halfcycle-saw` AC1): what this open says about where Halfcycle
89
+ * counts the phase's changes from, printed after the existing open line
90
+ * (`describeOpen`). `null` when nothing more is said: at project scope; when the
91
+ * plane's answer carries no `startCommit` field at all (an older control); or when
92
+ * the answer's start is `null` after this open DID send a commit — a mismatch this
93
+ * CLI does not try to explain.
94
+ */
95
+ export declare function describeStartCommit(phase: string | null, sent: HeadCommitOutcome, answerStartCommit: string | null | undefined): string | null;
72
96
  /**
73
97
  * The line that says what a successful open did (cp4f T-20, acceptance walk F7).
74
98
  *
@@ -189,5 +213,5 @@ export declare function writePhaseStamp(engagementId: string, phase: string | nu
189
213
  * warns without being able to say why.
190
214
  * @throws Error on transport failure or a body that is not the expected shape.
191
215
  */
192
- export declare function openPhase(credential: RepoCredential, phase: string | null, entry: PhaseEntryDecision, home?: string): Promise<OpenedPhase>;
216
+ export declare function openPhase(credential: RepoCredential, phase: string | null, entry: PhaseEntryDecision, home?: string, repoRoot?: string): Promise<OpenedPhase>;
193
217
  //# sourceMappingURL=open-phase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"open-phase.d.ts","sourceRoot":"","sources":["../src/open-phase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAY3B;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,sFAAsF;AACtF,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,qDAAqD;IACrD,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;OAIG;IACH,YAAY,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACvC,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,MAAM,CAAC;QACtB,yEAAyE;QACzE,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;QAC/B,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF;;;;;OAKG;IACH,aAAa,EAAE,YAAY,GAAG,IAAI,CAAC;CACpC;AAcD;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,eAAe,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gBAAiB,SAAQ,KAAK;aAEvB,MAAM,EAAE,MAAM;aAEd,OAAO,EAAE,MAAM,GAAG,IAAI;aACtB,aAAa,EAAE,MAAM,GAAG,IAAI;gBAH5B,MAAM,EAAE,MAAM,EAC9B,OAAO,EAAE,MAAM,EACC,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,aAAa,GAAE,MAAM,GAAG,IAAW;CAKtD;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,kFAItB,CAAC;AAEX,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,IAAI,CAAC,EAAE,MAAM,GACZ,cAAc,CA4BhB;AAuBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,IAAI,CAAC,EAAE,MAAM,GACZ,iBAAiB,GAAG,IAAI,CAmB1B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,SAAS,CAC7B,UAAU,EAAE,cAAc,EAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,KAAK,EAAE,kBAAkB,EACzB,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,WAAW,CAAC,CAyFtB"}
package/dist/plan.d.ts CHANGED
@@ -18,9 +18,8 @@
18
18
  * file's name is `renderPhaseSegment`'s (INV-023), and "is the file's phase the phase
19
19
  * asked for" compares the two segments it renders, because that function is where a
20
20
  * number and its decimal string become one phase. The shown record's format is
21
- * `@halfcycle/core`'s `serialiseShownPlans` and `parseShownPlans`; this module keeps
22
- * only the I/O. Whether a typed number reaches this phase is `resolvePhaseReference`
23
- * (`@halfcycle/core`). The two approval-line swaps take their sentences and the floor
21
+ * `@halfcycle/core`'s, and its I/O is `./shown-record.ts`'s `updateShownRecord`, which
22
+ * keeps the reviews `review --show` listed. The two approval-line swaps take their sentences and the floor
24
23
  * from `client-version.ts` (`@halfcycle/events`); the switched-off swap is decided by
25
24
  * the server's `typedApprovalOffered`, never by the client's copy of the switch, and
26
25
  * delivery's `clientOffersChatApproval` is never called here. "Is this a service
@@ -31,6 +30,28 @@
31
30
  * picture package (INV-001). `test/plan-verb.test.ts` reads that package's source and
32
31
  * holds the two equal.
33
32
  *
33
+ * THREE MORE ANSWERS (`close-review-and-carry-drop` AC7, ruling S-f). `removal-owed`
34
+ * (CL11) is a 409 naming every part `docs/system.json` must lose before a new plan is
35
+ * taken; `reportPhasePlan`'s answer-parsing switch is exhaustive over
36
+ * `phasePlanResultSchema`'s four outcomes, with a `never` default (`assertNever`), so a
37
+ * fifth outcome added to the wire without a matching case here is a compile error
38
+ * instead of a silent fall-through to "could not record the plan just now". CL10 (a
39
+ * carried part left out of its target's plan) is an ordinary `refused` problem at
40
+ * `path: ''`, so `planRefusedLines` prints it against the plan file as it prints every
41
+ * other problem — one more sentence, no new code. `recorded`'s optional `carriedFrom`
42
+ * marks a carried part `carried over from phase "<name>"` (CL13) in `--show`'s change
43
+ * lines, by the phase's name, never Halfcycle's own number (FW-03 round 2), with no
44
+ * second read of anything.
45
+ *
46
+ * THE REDRAW LINE (`part-state-and-builds` AC7, #1742). After a recorded plan, when the
47
+ * project already has this phase's embedded picture under `docs/diagrams/`
48
+ * (`embedImageName(phaseDiagramBase(phase))`, `./draw/write.ts` — the one home of a
49
+ * phase's diagram names, never copied here), `runPlan` prints the sentence asking for
50
+ * `draw phase` to be run again: after the state sentence without `--show`, and before
51
+ * the approval line with it, so the redraw line is never the last thing printed. The
52
+ * phase is quoted for the shell (`quoteForShell`, `@halfcycle/core`), as every other
53
+ * printed command is.
54
+ *
34
55
  * WHAT LEAVES THE MACHINE. The checked description (through the shared stage), then
35
56
  * `{ descriptionVersion, plan }`. Nothing is written into the person's tree; the shown
36
57
  * record is machine state under the home folder (INV-019).
@@ -40,7 +61,7 @@
40
61
  * reads, so none names an internal register, route or setting; no comment sits beside
41
62
  * an object member.
42
63
  */
43
- import { type PhasePlan, type PhasePlanChange, type PhasePlanProblem, type PlannedScopeState, type SystemDescription } from '@halfcycle/events';
64
+ import { type CarriedFromEntry, type PhasePlan, type PhasePlanChange, type PhasePlanProblem, type PlannedScopeState, type RemovalOwedPart, type SystemDescription } from '@halfcycle/events';
44
65
  import { type ShownPlanEntry } from '@halfcycle/core';
45
66
  import type { RepoCredential } from './open-phase.js';
46
67
  import { type DescriptionVerb, type SystemDeps, type SystemRun } from './system-report.js';
@@ -96,8 +117,11 @@ export type PlanFileCheck = {
96
117
  export declare function readAndCheckPlan(repoRoot: string, phase: string, description: SystemDescription, verb: DescriptionVerb): PlanFileCheck;
97
118
  /**
98
119
  * What came of reporting the plan. `recorded`: the service's answer, as its schema
99
- * parsed it. `refused`: the service's own problems. `no-route`: this service cannot
100
- * take a plan yet. `unavailable`: it could not be reported, and `why` says so.
120
+ * parsed it, `carriedFrom` present only when at least one part of this plan was
121
+ * carried in. `refused`: the service's own problems (CL10 among them, at `path: ''`).
122
+ * `removal-owed`: `docs/system.json` still holds a part an earlier close dropped or
123
+ * removed (CL11); nothing was sent. `no-route`: this service cannot take a plan yet.
124
+ * `unavailable`: it could not be reported, and `why` says so.
101
125
  */
102
126
  export type PlanOutcome = {
103
127
  kind: 'recorded';
@@ -106,9 +130,13 @@ export type PlanOutcome = {
106
130
  state: PlannedScopeState;
107
131
  changedParts: readonly string[];
108
132
  typedApprovalOffered: boolean;
133
+ carriedFrom?: readonly CarriedFromEntry[];
109
134
  } | {
110
135
  kind: 'refused';
111
136
  problems: PhasePlanProblem[];
137
+ } | {
138
+ kind: 'removal-owed';
139
+ parts: readonly RemovalOwedPart[];
112
140
  } | {
113
141
  kind: 'no-route';
114
142
  } | {
@@ -135,20 +163,15 @@ export type ShownWrite = {
135
163
  };
136
164
  /**
137
165
  * Record on this machine that `entry` was shown: `~/.halfcycle/engagements/<id>/`
138
- * `shown-plans.json`, the directory composed by `engagementStateDir` (which checks the
139
- * id) and the filename `SHOWN_PLANS_FILENAME`. Never throws.
166
+ * `shown-plans.json`, through `updateShownRecord` (`./shown-record.ts`), the CLI's one
167
+ * writer of that file. Never throws.
140
168
  *
141
169
  * The record keeps the latest entry per phase, so the entry for this phase is
142
170
  * replaced. An entry holding this number under another phase is dropped too: the
143
171
  * service gives each phase one number and never changes it, so such an entry is
144
- * stale, and `serialiseShownPlans` refuses two entries with one number, which would
145
- * otherwise fail every later write. A missing or malformed record reads as nothing
146
- * shown (`parseShownPlans`).
147
- *
148
- * Written to a temporary file in the same folder, mode `0600` set on it before the
149
- * rename (a rename carries the source's bits), then renamed into place, so a reader
150
- * sees the old record or the new one and never a part of one. `chmod` is skipped on
151
- * Windows, where the bits mean nothing.
172
+ * stale, and the serialiser refuses two entries with one number, which would
173
+ * otherwise fail every later write. The record's listed reviews are kept as they
174
+ * are. A missing or malformed record reads as nothing shown.
152
175
  */
153
176
  export declare function writeShownPlan(engagementId: string, entry: ShownPlanEntry, home?: string): ShownWrite;
154
177
  /**
@@ -167,7 +190,23 @@ export declare function planRefusedLines(verb: DescriptionVerb, phase: string, p
167
190
  * The line for a phase name `isValidPhaseIdentity` refuses, prefixed by the verb that
168
191
  * is running. Nothing has been sent when it is printed.
169
192
  */
170
- export declare function notAPhaseNameLine(verb: DescriptionVerb, phase: string): string;
193
+ export declare function notAPhaseNameLine(verb: DescriptionVerb | 'review', phase: string): string;
194
+ /**
195
+ * CL11 — one line per part `docs/system.json` must lose before a new plan is taken
196
+ * (`close-review-and-carry-drop` AC7), prefixed by the verb that is running. Names the
197
+ * phase whose review did it by name, never Halfcycle's own number (FW-03 round 2).
198
+ * Nothing was sent when these print.
199
+ */
200
+ export declare function removalOwedLines(verb: DescriptionVerb, parts: readonly RemovalOwedPart[]): string;
201
+ /**
202
+ * The redraw line (#1742, `part-state-and-builds` AC7): printed after a recorded plan
203
+ * when this phase already has its embedded picture under `docs/diagrams/`. `null` when
204
+ * there is none to redraw, so the caller prints nothing. Never throws: a phase that
205
+ * reaches here already passed `isValidPhaseIdentity`, but a failure composing the base
206
+ * name still reads as "nothing to redraw" rather than crashing the verb that recorded
207
+ * the plan.
208
+ */
209
+ export declare function redrawLine(repoRoot: string, phase: string): string | null;
171
210
  /** The pieces `runPlan` reaches outside itself through; replaced in tests. */
172
211
  export interface PlanDeps extends SystemDeps {
173
212
  readonly reportPlan: (credential: RepoCredential, plan: PhasePlan, descriptionVersion: number) => Promise<PlanOutcome>;
@@ -183,13 +222,26 @@ export declare function planStateSentence(state: PlannedScopeState): string;
183
222
  * otherwise a pinned version below the floor (none included) gives the update
184
223
  * sentence; otherwise the typing offer.
185
224
  *
186
- * The offer names the phase, and its number too when typing the number would reach
187
- * this phase among the phases shown on this machine (`resolvePhaseReference`): a
188
- * phase whose name is that number would otherwise take it.
225
+ * The offer names the phase alone, by its name, never Halfcycle's own plan-order
226
+ * number (FW-03 round 2; walk findings F4, F8). Round 1 offered the number as a
227
+ * second way to type `approve` when typing it would reach the same phase
228
+ * (`resolvePhaseReference`) — but a walker still read `approve 1, or approve 2`
229
+ * as a choice between two phases, because the method itself numbers phases from
230
+ * 0 while this field counts from 1, so the two counts disagree on every project
231
+ * that follows the method, not only on a phase named a plain number. The number
232
+ * is never offered, for any phase.
233
+ *
234
+ * Each of the three ends with the console's way (`system-view-page` AC7): the phase's
235
+ * System view address on `engagementId`, the project the credential is for. It is the
236
+ * last thing on the line. With an id that is not an engagement id there is no address
237
+ * and that sentence is left out whole.
238
+ */
239
+ export declare function approvalLine(phase: string, number: number, typedApprovalOffered: boolean, pinnedVersion: string | undefined, shown: readonly ShownPlanEntry[], engagementId: string): string;
240
+ /**
241
+ * One line per change, in plan order: the part's name, the carried mark (CL13) when
242
+ * `carriedFrom` names it, what changes, the plan's line, and the changed mark.
189
243
  */
190
- export declare function approvalLine(phase: string, number: number, typedApprovalOffered: boolean, pinnedVersion: string | undefined, shown: readonly ShownPlanEntry[]): string;
191
- /** One line per change, in plan order: the part's name, what changes, the plan's line, and the changed mark. */
192
- export declare function changeLines(plan: PhasePlan, description: SystemDescription, changed: readonly string[]): string;
244
+ export declare function changeLines(plan: PhasePlan, description: SystemDescription, changed: readonly string[], carriedFrom?: readonly CarriedFromEntry[]): string;
193
245
  /**
194
246
  * The whole verb, in the order the module header gives. Exit 0 only when the plan is
195
247
  * recorded and, with `--show`, the shown record is written. When that write fails the
@@ -1 +1 @@
1
- {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../src/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAKH,OAAO,EAQL,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,gBAAgB,EAErB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAC;AAE5B,kFAAkF;AAClF,eAAO,MAAM,UAAU,+DAA+D,CAAC;AAEvF,yEAAyE;AACzE,eAAO,MAAM,YAAY,gBAAgB,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAE1D;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAIxE,CAAC;AAEF;;;;GAIG;AACH,M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}
1
+ {"version":3,"file":"pre-create-checks.d.ts","sourceRoot":"","sources":["../src/pre-create-checks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAWH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,QAEgC,CAAC;AAEjE,6EAA6E;AAC7E,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CAAC,CAKpG;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI7D;AA0BD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,IAAI,CAWzG;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAU5D;AAUD,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAA+D,CAAC;AA6F9G;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUnE"}
@@ -0,0 +1,231 @@
1
+ /**
2
+ * The client half of `npx halfcycle@latest review <phase> --show` and
3
+ * `review <phase> --answer <part> "<answer>"` (System view · E3, feature
4
+ * `typed-close-review` AC2, AC5, AC6).
5
+ *
6
+ * `--show` reads the phase's close review (`GET …/phases/:phase/review`, the control
7
+ * service's `readPhaseReview`), prints every part, what the agents reported beside what
8
+ * Halfcycle saw, and each decision so far (RV1–RV7), then records on this machine the
9
+ * review it listed, so a review line the owner types binds to it. `--answer` sends the
10
+ * agent's answer to the owner's question on one part (`POST …/review/answers`) and prints
11
+ * AN1, or its refusal (AN2–AN5).
12
+ *
13
+ * EVERY RV AND AN LINE LIVES HERE (AC5), and nothing else in the CLI words them. The TR
14
+ * lines are the runner's (`user-prompt-submit-lines.ts`), never these.
15
+ *
16
+ * ONE HOME FOR EVERYTHING THIS VERB DOES NOT WORD (INV-003). Nothing about the review is
17
+ * derived here; the view is the control service's one derivation, read through
18
+ * `phaseReviewViewSchema`, and this module only prints it:
19
+ * - which parts are decidable, waiting or settled is the view's (`decidable`, `waiting`,
20
+ * `decision`), never recomputed;
21
+ * - what Halfcycle saw is `observedLines` and `observedPhaseLines`, the agents' reasons
22
+ * are `agentSaid` (with `NO_TASK_SAID_LINE`), the code line is `codeLinkLine`, and RV4b
23
+ * (fix F5, a finished part Halfcycle's LIVE count still says nothing changed under,
24
+ * checked with `partChangedUnderPaths` rather than trusting the view's stored `built`
25
+ * alone) is `NOTHING_COUNTED_DESPITE_FINISHED_LINE`, all `@halfcycle/events`' and
26
+ * referenced, never copied;
27
+ * - which acts a part takes is `reviewActsFor`, which RV7 reads to list the lines a part
28
+ * allows;
29
+ * - the answer's text rule is `reviewAnswerRequestSchema` (`statementText` at
30
+ * `REVIEW_ANSWER_MAX`), and the credential screen is core's `looksLikeSecret`;
31
+ * - the shown record's format is core's; its I/O is `./shown-record.ts`'s
32
+ * `updateShownRecord`, the CLI's one writer of that file;
33
+ * - the sign-in remedy is core's `HOOK_REMEDY`.
34
+ *
35
+ * WHEN NOTHING WAS COUNTED AT ALL. The view's `observed` is `null` when the control
36
+ * service holds no counts for the round. `observedLines` needs a value, so this verb
37
+ * hands it the value that means "nothing counted" (`NOTHING_COUNTED`, the counting state
38
+ * `cannot-count`, no part, no figure), and RV4 then reads `Changes not counted` and the
39
+ * checks line in that function's words, never a sentence of this module's. RV1b prints
40
+ * nothing then: there is no counting state to describe, and RV1a already says the phase
41
+ * could not be counted.
42
+ *
43
+ * WHAT LEAVES THE MACHINE. `--show` sends nothing but the read. `--answer` sends
44
+ * `{ part, answer }` only after the answer passed the same rule on this machine (AN3,
45
+ * AN4); a refused answer is never sent (INV-020).
46
+ *
47
+ * INV-001: Node builtins, the global `fetch`, `@halfcycle/events` and `@halfcycle/core`
48
+ * only. SHIPS TO CLIENT DISK inside the CLI: every string here is a sentence a person
49
+ * reads, so none names an internal register, route or setting; no comment sits beside
50
+ * an object member.
51
+ */
52
+ import { type ShownReviewEntry } from '@halfcycle/core';
53
+ import { type PhaseReviewView, type ReviewViewPart } from '@halfcycle/events';
54
+ import type { RepoCredential } from './open-phase.js';
55
+ import type { SystemRun } from './system-report.js';
56
+ /** The usage line, printed for no phase, an extra argument, an unknown flag, or neither mode. */
57
+ export declare const REVIEW_USAGE = "npx halfcycle@latest review <phase> (--show | --answer <part> \"<answer>\") [--repo <root>]";
58
+ /** The view of a round: open, or the round that closed the phase. */
59
+ export type ReviewedView = Extract<PhaseReviewView, {
60
+ state: 'open' | 'closed';
61
+ }>;
62
+ /** The view when no round is open and none closed the phase. */
63
+ export type NoReviewView = Extract<PhaseReviewView, {
64
+ state: 'none';
65
+ }>;
66
+ /**
67
+ * What the arguments after `review` came to: exactly one positional (the phase), and
68
+ * exactly one of `--show` or `--answer <part> <answer>`, with at most one
69
+ * `--repo <root>`. The two values after `--answer` are taken as they are, so an answer
70
+ * may begin with a dash. Anything else is usage.
71
+ */
72
+ export type ReviewArgs = {
73
+ ok: true;
74
+ mode: 'show';
75
+ phase: string;
76
+ repoRoot: string | undefined;
77
+ } | {
78
+ ok: true;
79
+ mode: 'answer';
80
+ phase: string;
81
+ part: string;
82
+ answer: string;
83
+ repoRoot: string | undefined;
84
+ } | {
85
+ ok: false;
86
+ };
87
+ export declare function parseReviewArgs(argv: readonly string[]): ReviewArgs;
88
+ /** RV1a: printed when the view's `counted` is false. */
89
+ export declare const RV1A_LINE = "Halfcycle could not count what this phase changed, so judge each part on what the agents reported alone.";
90
+ /**
91
+ * RV2's status, exactly one of seven (S-aa). A settled part reads its decision; an
92
+ * unsettled one reads whether a question waits for the agent's answer, then whether it
93
+ * was sent back in this round, else that it waits for the owner's decision (a part
94
+ * whose question was answered included).
95
+ */
96
+ export declare function partStatus(part: ReviewViewPart, round: number): string;
97
+ /**
98
+ * THE LISTING, RV1 to RV7, in the spec's order: RV1, RV1a when Halfcycle could not
99
+ * count, RV1b one line each, then per part RV2–RV6 with RV4a and RV4b, then RV7.
100
+ */
101
+ export declare function reviewListingLines(view: ReviewedView): string[];
102
+ /** RV8: the refusal for a view with no open review, by its state. */
103
+ export declare function rv8Line(view: NoReviewView | Extract<PhaseReviewView, {
104
+ state: 'closed';
105
+ }>): string;
106
+ /** RV9: refused, not signed in. */
107
+ export declare const RV9_LINE = "halfcycle review: this project is not signed in on this computer. Run \"npx halfcycle\" in the project folder to sign in.";
108
+ /** RV10: refused, cannot reach. */
109
+ export declare const RV10_LINE = "halfcycle review: Halfcycle could not be reached just now. Check this computer's connection, then run this again.";
110
+ /** RV11: refused, the listing could not be recorded on this computer. */
111
+ export declare const RV11_LINE = "halfcycle review: the list just shown could not be recorded on this computer, so a typed decision cannot use it. Run this again.";
112
+ /** AN1: the answer is on the part. */
113
+ export declare function an1Line(name: string): string;
114
+ /** AN2: refused, no question waits on the part. */
115
+ export declare function an2Line(part: string, phase: string): string;
116
+ /** AN3: refused on this computer, the answer's shape. */
117
+ export declare const AN3_LINE = "halfcycle review: the answer must be one paragraph of at most 1,000 characters, with no line breaks.";
118
+ /** AN4: refused on this computer, the answer looks secret. */
119
+ export declare const AN4_LINE = "halfcycle review: the answer looks like it holds a password or key, so it was not sent. Write it again without it.";
120
+ /** AN5: refused by Halfcycle, the words. */
121
+ export declare const AN5_LINE = "halfcycle review: the answer was not accepted. Reword it in plain words and run this again.";
122
+ /**
123
+ * The shown record's review entry for a listed round (AC2): `decidable` is the view's;
124
+ * `awaitingAnswer` is true when one of the part's questions has no answer; `sentBack`
125
+ * is true when one of its send-backs is from the listed round.
126
+ */
127
+ export declare function shownReviewEntry(view: ReviewedView, shownAt: string): ShownReviewEntry;
128
+ /** What writing the shown review came to. */
129
+ export type ShownReviewWrite = {
130
+ ok: true;
131
+ } | {
132
+ ok: false;
133
+ };
134
+ /**
135
+ * Record on this machine that `entry` was listed, through `updateShownRecord`. The
136
+ * record keeps the latest review per phase, so this phase's review is replaced; a review
137
+ * holding this number under another phase is stale and dropped, as `writeShownPlan` drops
138
+ * a plan's. The shown plans are kept as they are. Never throws.
139
+ */
140
+ export declare function writeShownReview(engagementId: string, entry: ShownReviewEntry, home?: string): ShownReviewWrite;
141
+ /** The address of one phase's review, or of a path under it: each segment encoded once. */
142
+ export declare function reviewUrl(credential: RepoCredential, phase: string, rest?: string): string;
143
+ /** What reading the review came to. */
144
+ export type ReviewRead = {
145
+ kind: 'view';
146
+ view: PhaseReviewView;
147
+ } | {
148
+ kind: 'not-signed-in';
149
+ } | {
150
+ kind: 'unreachable';
151
+ };
152
+ /**
153
+ * Read the phase's review. Never throws. A body that parses under
154
+ * `phaseReviewViewSchema` on a 200 is the view; a 401 is not signed in; anything else
155
+ * (no answer, a status the read does not give, a body the schema refuses) is cannot
156
+ * reach, never a view.
157
+ */
158
+ export declare function readReview(credential: RepoCredential, phase: string): Promise<ReviewRead>;
159
+ /** What sending the answer came to. */
160
+ export type AnswerSend = {
161
+ kind: 'recorded';
162
+ name: string;
163
+ } | {
164
+ kind: 'no-question';
165
+ } | {
166
+ kind: 'refused';
167
+ } | {
168
+ kind: 'not-signed-in';
169
+ } | {
170
+ kind: 'unreachable';
171
+ };
172
+ /**
173
+ * Send the agent's answer. Never throws. A body that parses under
174
+ * `reviewAnswerResultSchema` is authoritative whatever its status, except that
175
+ * `unavailable` is cannot reach; a 401 is not signed in; anything else is cannot reach.
176
+ */
177
+ export declare function sendReviewAnswer(credential: RepoCredential, phase: string, body: {
178
+ part: string;
179
+ answer: string;
180
+ }): Promise<AnswerSend>;
181
+ /** The pieces the verb reaches outside itself through; replaced in tests. */
182
+ export interface ReviewDeps {
183
+ readonly readCredential: (repoRoot: string) => RepoCredential;
184
+ readonly readReview: (credential: RepoCredential, phase: string) => Promise<ReviewRead>;
185
+ readonly sendAnswer: (credential: RepoCredential, phase: string, body: {
186
+ part: string;
187
+ answer: string;
188
+ }) => Promise<AnswerSend>;
189
+ readonly recordShown: (engagementId: string, entry: ShownReviewEntry) => ShownReviewWrite;
190
+ readonly now: () => Date;
191
+ }
192
+ /**
193
+ * `review <phase> --show`. Exit 0 when the listing is printed and recorded. A view with
194
+ * no open review prints RV8 and exits 1; a failed write prints the listing, then RV11,
195
+ * and exits 1.
196
+ */
197
+ export declare function runReviewShow(repoRoot: string, phase: string, deps: ReviewDeps): Promise<SystemRun>;
198
+ /**
199
+ * What checking the answer on this computer came to: the request to send, the line for
200
+ * a refused answer, or `usage` for a part that is not a part id.
201
+ */
202
+ export type AnswerCheck = {
203
+ ok: true;
204
+ body: {
205
+ part: string;
206
+ answer: string;
207
+ };
208
+ } | {
209
+ ok: false;
210
+ line: string;
211
+ } | {
212
+ ok: false;
213
+ usage: true;
214
+ };
215
+ /**
216
+ * Check the answer by the wire's own rule (`reviewAnswerRequestSchema`) before anything
217
+ * is sent (AC6). A credential-shaped answer is AN4, whatever else is wrong with it, so
218
+ * the person is told to take the secret out; any other problem with the answer is AN3.
219
+ */
220
+ export declare function checkAnswer(part: string, answer: string): AnswerCheck;
221
+ /**
222
+ * `review <phase> --answer <part> "<answer>"`. Exit 0 when the answer is recorded (AN1,
223
+ * naming the part from the answer's `recorded`, with no second read); exit 1 for every
224
+ * refusal; exit 2 for a part that is not a part id, which is usage.
225
+ */
226
+ export declare function runReviewAnswer(repoRoot: string, phase: string, part: string, answer: string, deps: ReviewDeps): Promise<{
227
+ stdout: string;
228
+ stderr: string;
229
+ exitCode: 0 | 1 | 2;
230
+ }>;
231
+ //# sourceMappingURL=review.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../src/review.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AE,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAChI,QAAQ,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,KAAK,gBAAgB,CAAC;IAC1F,QAAQ,CAAC,GAAG,EAAE,MAAM,IAAI,CAAC;CAC1B;AAeD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAazG;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GACpD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC3B;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,IAAI,CAAA;CAAE,CAAC;AAE/B;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAKrE;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,UAAU,GACf,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC,CAsBlE"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The shown record's I/O on this machine — the one place the CLI writes
3
+ * `~/.halfcycle/engagements/<id>/shown-plans.json`.
4
+ *
5
+ * Two verbs write it: `plan <phase> --show` (a shown plan, `writeShownPlan` in
6
+ * `plan.ts`) and `review <phase> --show` (a listed review, `writeShownReview` in
7
+ * `review.ts`). Both go through `updateShownRecord`, which reads the WHOLE record,
8
+ * lets the caller replace its own half, and writes the whole record back, so listing
9
+ * a plan never drops a listed review and listing a review never drops a shown plan.
10
+ * A second writer with its own read-modify-write would be the way one verb erases
11
+ * the other's entry.
12
+ *
13
+ * The one other write is the runner's prompt hook, which may not import this module
14
+ * (INV-001): after a typed review line is recorded it moves THAT listed review forward
15
+ * (`packages/runner/src/hooks/shown-record.ts`, `typed-close-review` S-v). It is built
16
+ * the same way, replaces only the one review entry it was sent from, and writes nothing
17
+ * when that entry was listed again meanwhile.
18
+ *
19
+ * The format is `@halfcycle/core`'s (`parseShownRecord`, `serialiseShownRecord`),
20
+ * never restated here; this module keeps only the I/O. A missing or malformed record
21
+ * reads as nothing shown.
22
+ *
23
+ * Written to a temporary file in the same folder, mode `0600` set on it before the
24
+ * rename (a rename carries the source's bits), then renamed into place, so a reader
25
+ * sees the old record or the new one and never a part of one. `chmod` is skipped on
26
+ * Windows, where the bits mean nothing.
27
+ *
28
+ * INV-001: Node builtins and `@halfcycle/core` only. Machine state under the home
29
+ * folder; nothing is written into the person's project (INV-019).
30
+ */
31
+ import { type ShownRecord } from '@halfcycle/core';
32
+ /** What updating the shown record came to: on success, the whole record now written. */
33
+ export type ShownRecordWrite = {
34
+ ok: true;
35
+ record: ShownRecord;
36
+ } | {
37
+ ok: false;
38
+ };
39
+ /**
40
+ * Read the shown record for `engagementId`, pass it to `update`, and write what
41
+ * `update` returns. Never throws: an engagement id `engagementStateDir` refuses, a
42
+ * record the serialiser refuses, or any failed write answers `{ ok: false }`, and a
43
+ * temporary file left behind is removed.
44
+ */
45
+ export declare function updateShownRecord(engagementId: string, update: (current: ShownRecord) => ShownRecord, home?: string): ShownRecordWrite;
46
+ //# sourceMappingURL=shown-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shown-record.d.ts","sourceRoot":"","sources":["../src/shown-record.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,OAAO,EAAgE,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGjH,wFAAwF;AACxF,MAAM,MAAM,gBAAgB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAA;CAAE,CAAC;AAEjF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,WAAW,EAC7C,IAAI,CAAC,EAAE,MAAM,GACZ,gBAAgB,CA6BlB"}
@@ -97,14 +97,17 @@ export declare function unownedPatterns(description: SystemDescription, tracked:
97
97
  export declare function unownedPatternLines(unowned: readonly UnownedPattern[], verb: DescriptionVerb): string;
98
98
  /**
99
99
  * What came of reporting the description. `recorded`: the service holds it as
100
- * `version` (a description it already had returns that version). `refused`: the
101
- * service's own problems. `no-route`: this service cannot take a description yet.
102
- * `unavailable`: it could not be reported, and `why` says so.
100
+ * `version` (a description it already had returns that version; `unchanged` tells the
101
+ * two apart by the service's status, 200 for unchanged and 201 for a new version,
102
+ * and is absent from a stand-in that never sets it). `refused`: the service's own
103
+ * problems. `no-route`: this service cannot take a description yet. `unavailable`:
104
+ * it could not be reported, and `why` says so.
103
105
  */
104
106
  export type ReportOutcome = {
105
107
  kind: 'recorded';
106
108
  version: number;
107
109
  reportedAt: string;
110
+ unchanged?: boolean;
108
111
  } | {
109
112
  kind: 'refused';
110
113
  problems: SystemDescriptionProblem[];
@@ -151,6 +154,7 @@ export type DescriptionStage = {
151
154
  version: number;
152
155
  credential: RepoCredential;
153
156
  warnings: string;
157
+ unchanged?: boolean;
154
158
  };
155
159
  /** The verbs that report the description first. Names the prefix of every line. */
156
160
  export type DescriptionVerb = 'system' | 'draw' | 'plan';
@@ -160,6 +164,21 @@ export type DescriptionVerb = 'system' | 'draw' | 'plan';
160
164
  * description here; `draw` ignores the argument.
161
165
  */
162
166
  export type BeforeSend = (description: SystemDescription) => string | null;
167
+ /** What reading the credential came to, or the one line every verb prints for it missing. */
168
+ export type CredentialRead = {
169
+ ok: true;
170
+ credential: RepoCredential;
171
+ } | {
172
+ ok: false;
173
+ line: string;
174
+ };
175
+ /**
176
+ * Read this project's credential, worded for the verb that is running. Shared by
177
+ * `checkAndReportDescription` and by `draw phase`'s closed arm (`part-state-and-builds`
178
+ * AC5), which reads it before the description stage, so the sentence for "not
179
+ * connected on this machine" has one home.
180
+ */
181
+ export declare function readCredentialOrLine(repoRoot: string, deps: Pick<SystemDeps, 'readCredential'>, verb: DescriptionVerb): CredentialRead;
163
182
  /**
164
183
  * READ, CHECK, WARN, REPORT — the one path `system`, `draw` and `plan` take before
165
184
  * anything else (feature `diagram-files-for-docs`, step 1 and 2 of the command). The
@@ -174,6 +193,11 @@ export type BeforeSend = (description: SystemDescription) => string | null;
174
193
  * the line to print, or `null` to go on.
175
194
  */
176
195
  export declare function checkAndReportDescription(repoRoot: string, deps: SystemDeps, verb: DescriptionVerb, beforeSend?: BeforeSend): Promise<DescriptionStage>;
177
- /** The whole `system` verb: the shared stage, then its version printed. */
196
+ /**
197
+ * The whole `system` verb: the shared stage, then its version printed. U1
198
+ * (feature `what-halfcycle-saw`): when the description equalled the latest
199
+ * version and nothing was stored, this prints that it is unchanged rather than
200
+ * a line that reads like a second version.
201
+ */
178
202
  export declare function runSystem(repoRoot: string, deps: SystemDeps): Promise<SystemRun>;
179
203
  //# sourceMappingURL=system-report.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"system-report.d.ts","sourceRoot":"","sources":["../src/system-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC9B,MAAM,mBAAmB,CAAC;AAI3B,OAAO,K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