bareloop 0.11.0 → 0.12.0

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.
@@ -0,0 +1,352 @@
1
+ /**
2
+ * The proposal's shape, and therefore the whole shape the compiler can express.
3
+ *
4
+ * `rule` is an ENUM off the judge's own rulebook in BOTH places it appears — the
5
+ * card's lines and a case's expected reds — because wherever only a closed set
6
+ * can satisfy a field, the illegal value is made INEXPRESSIBLE rather than
7
+ * rejected after the fact (the `check-passes(name)` model). The SIZE is pinned by
8
+ * `minItems`/`maxItems` from the one constant, so nine and eleven are both
9
+ * unsayable rather than argued about afterwards.
10
+ *
11
+ * `artifact` and `text` are the only free strings, and neither decides anything:
12
+ * one is the code the judge will read, the other is the signer's own words.
13
+ */
14
+ export function proposalSchema(): {
15
+ type: string;
16
+ properties: {
17
+ card: {
18
+ type: string;
19
+ description: string;
20
+ properties: {
21
+ items: {
22
+ type: string;
23
+ minItems: number;
24
+ items: {
25
+ type: string;
26
+ properties: {
27
+ rule: {
28
+ enum: string[];
29
+ description: string;
30
+ };
31
+ text: {
32
+ type: string;
33
+ minLength: number;
34
+ description: string;
35
+ };
36
+ };
37
+ required: string[];
38
+ additionalProperties: boolean;
39
+ };
40
+ };
41
+ };
42
+ required: string[];
43
+ additionalProperties: boolean;
44
+ };
45
+ cases: {
46
+ type: string;
47
+ minItems: number;
48
+ maxItems: number;
49
+ description: string;
50
+ items: {
51
+ type: string;
52
+ properties: {
53
+ id: {
54
+ type: string;
55
+ minLength: number;
56
+ description: string;
57
+ };
58
+ artifact: {
59
+ type: string;
60
+ minLength: number;
61
+ description: string;
62
+ };
63
+ expect: {
64
+ type: string;
65
+ properties: {
66
+ verdict: {
67
+ enum: string[];
68
+ };
69
+ reds: {
70
+ type: string;
71
+ description: string;
72
+ items: {
73
+ type: string;
74
+ properties: {
75
+ rule: {
76
+ enum: string[];
77
+ description: string;
78
+ };
79
+ fn: {
80
+ type: string;
81
+ minLength: number;
82
+ description: string;
83
+ };
84
+ };
85
+ required: string[];
86
+ additionalProperties: boolean;
87
+ };
88
+ };
89
+ };
90
+ required: string[];
91
+ additionalProperties: boolean;
92
+ };
93
+ };
94
+ required: string[];
95
+ additionalProperties: boolean;
96
+ };
97
+ };
98
+ };
99
+ required: string[];
100
+ additionalProperties: boolean;
101
+ };
102
+ /**
103
+ * The output channel. It records and acknowledges; it takes no action, which is
104
+ * why handing it to a toolless compile call does not reopen D3.
105
+ * @param {{calls: any[]}} box
106
+ */
107
+ export function proposalTool(box: {
108
+ calls: any[];
109
+ }): {
110
+ name: string;
111
+ description: string;
112
+ parameters: {
113
+ type: string;
114
+ properties: {
115
+ card: {
116
+ type: string;
117
+ description: string;
118
+ properties: {
119
+ items: {
120
+ type: string;
121
+ minItems: number;
122
+ items: {
123
+ type: string;
124
+ properties: {
125
+ rule: {
126
+ enum: string[];
127
+ description: string;
128
+ };
129
+ text: {
130
+ type: string;
131
+ minLength: number;
132
+ description: string;
133
+ };
134
+ };
135
+ required: string[];
136
+ additionalProperties: boolean;
137
+ };
138
+ };
139
+ };
140
+ required: string[];
141
+ additionalProperties: boolean;
142
+ };
143
+ cases: {
144
+ type: string;
145
+ minItems: number;
146
+ maxItems: number;
147
+ description: string;
148
+ items: {
149
+ type: string;
150
+ properties: {
151
+ id: {
152
+ type: string;
153
+ minLength: number;
154
+ description: string;
155
+ };
156
+ artifact: {
157
+ type: string;
158
+ minLength: number;
159
+ description: string;
160
+ };
161
+ expect: {
162
+ type: string;
163
+ properties: {
164
+ verdict: {
165
+ enum: string[];
166
+ };
167
+ reds: {
168
+ type: string;
169
+ description: string;
170
+ items: {
171
+ type: string;
172
+ properties: {
173
+ rule: {
174
+ enum: string[];
175
+ description: string;
176
+ };
177
+ fn: {
178
+ type: string;
179
+ minLength: number;
180
+ description: string;
181
+ };
182
+ };
183
+ required: string[];
184
+ additionalProperties: boolean;
185
+ };
186
+ };
187
+ };
188
+ required: string[];
189
+ additionalProperties: boolean;
190
+ };
191
+ };
192
+ required: string[];
193
+ additionalProperties: boolean;
194
+ };
195
+ };
196
+ };
197
+ required: string[];
198
+ additionalProperties: boolean;
199
+ };
200
+ execute: (args: any) => Promise<string>;
201
+ };
202
+ /**
203
+ * The compile prompt. Q6's and Q7's answers travel VERBATIM — they are the whole
204
+ * input, and paraphrasing a lay answer is how a rubric stops being the person's.
205
+ *
206
+ * The rulebook is rendered from `JUDGE_RULES` itself rather than restated, for
207
+ * the reason the catalogue block is rendered from the catalogue: the prompt and
208
+ * the gate must describe one set of facts.
209
+ * @param {{answers: Record<string|number, any>, questions?: Record<string|number, string>}} o
210
+ */
211
+ export function cardCasesPrompt({ answers, questions }: {
212
+ answers: Record<string | number, any>;
213
+ questions?: Record<string | number, string>;
214
+ }): string;
215
+ /**
216
+ * THE D5 MOMENT. The proposal is SHOWN; the signer's `fix` is what is STORED.
217
+ *
218
+ * The fix replaces the proposal WHOLE rather than merging into it. A merge would
219
+ * mean a signer who deleted a card line got it back, and "the signer signs the
220
+ * whole hash" is not a rule that survives a field-wise reconciliation. Handing
221
+ * back no fix is a legal answer — signing the proposal as proposed — and it says
222
+ * so (`source`), because *a person read this and changed nothing* and *nobody has
223
+ * looked* are two different facts.
224
+ *
225
+ * THE GATE RUNS OVER WHAT WILL BE STORED, never over the proposal: a signer can
226
+ * fix a legal proposal into an illegal one, and the artifact that reaches the
227
+ * hash is the one that must be legal.
228
+ *
229
+ * `scrubbed` is the INGEST SCRUB'S OWN ANNOUNCEMENT — the paths whose bytes the
230
+ * secret inventory masked on the way in. Empty on every honest artifact, and
231
+ * never silent when it is not: a signer signs a hash over the STORED bytes, so
232
+ * "what you typed is not what was stored" is a fact they are owed rather than one
233
+ * the redactor keeps.
234
+ * @param {{proposal: any, fix?: any}} o
235
+ * @returns {{ok: boolean, reds: Red[], card: any, cases: any[]|null, source: 'signer'|'proposal',
236
+ * scrubbed: {path: string}[]}}
237
+ */
238
+ export function signJudgedArtifacts({ proposal, fix }: {
239
+ proposal: any;
240
+ fix?: any;
241
+ }): {
242
+ ok: boolean;
243
+ reds: Red[];
244
+ card: any;
245
+ cases: any[] | null;
246
+ source: "signer" | "proposal";
247
+ scrubbed: {
248
+ path: string;
249
+ }[];
250
+ };
251
+ /**
252
+ * Fold the two signed artifacts into the close declaration, ENUMERATED.
253
+ *
254
+ * WHERE EACH LANDS, and both are inside the spec so `jobSpecHash` covers them by
255
+ * construction (the hash is over the whole resolved spec):
256
+ * - THE CARD replaces the judged stage's own `params.card`. ONE card, and it is
257
+ * the SIGNED one: the composer's draft is a draft, and two cards in one close
258
+ * is the drift a single storage site exists to prevent. The stage is where it
259
+ * already lives, which is what `validateCard`, the M2 runner and the locate
260
+ * prompt all read.
261
+ * - THE CASES land beside the stages as `calibration.cases` — a close-level
262
+ * artifact, because the set calibrates the RULER and not one stage's params,
263
+ * and because module 5's gate reads it before any stage runs.
264
+ * - THE JUDGE MODEL lands beside them as `calibration.judgeModel`, and it is the
265
+ * PIN (`JUDGE_MODEL`) rather than anything a caller may name. A calibration set
266
+ * is only worth the tier that graded it — §4.2's whole safety argument is worth
267
+ * exactly as much as BA-20's injection evidence, which is haiku-4.5's alone — so
268
+ * the set has to carry which tier certified it or nothing downstream can tell a
269
+ * signed floor from a bumped one. Storing it HERE, inside the spec, is what makes
270
+ * a bump flip `jobSpecHash`: the signature dies, the signer re-signs, and a
271
+ * re-sign is a re-run of the calibration gate. That is the docstring on
272
+ * `JUDGE_MODEL` finally given a detector instead of a promise (F45).
273
+ *
274
+ * A card with NOWHERE TO LAND THROWS. It is a caller's own broken input — a
275
+ * signed rubric folded into a close with no judged ruler — and there is no safe
276
+ * direction to degrade toward: storing it would sign a rubric nothing reads.
277
+ *
278
+ * The input is never mutated: a closeDecl is a signed artefact and rewriting a
279
+ * caller's copy in place is how two readers come to disagree about what was
280
+ * signed.
281
+ * @param {any} closeDecl @param {{card: any, cases: any[]}} o
282
+ * @returns {any} a new closeDecl
283
+ */
284
+ export function foldJudgedArtifacts(closeDecl: any, { card, cases }: {
285
+ card: any;
286
+ cases: any[];
287
+ }): any;
288
+ /**
289
+ * ONE compile call: the person's Q6 and Q7 in, a proposal out.
290
+ *
291
+ * It buys ONE artifact through ONE channel, and the malformed-emission ladder is
292
+ * the SHARED one (`askStructured`) rather than a second copy — a second ladder is
293
+ * a second place for the cap, the reject block and the re-ask to drift.
294
+ *
295
+ * WHAT IS AND IS NOT RETRIED, and the split is the standing one: a reply that
296
+ * carries no proposal is a TRANSPORT fault and is retried under the bound; a
297
+ * proposal that PARSED and then broke the ruling is not — the model answered
298
+ * perfectly clearly and re-asking buys another call to be told the same thing.
299
+ * The proposal is returned as it was said, never repaired: no JSON repair, ever.
300
+ *
301
+ * The book is the CALLER's, so one ceiling governs the survey, the declaration
302
+ * ladder and this compile — the advertised ceiling and the enforced ceiling are
303
+ * the same ceiling.
304
+ * @param {{answers: Record<string|number, any>, questions?: Record<string|number, string>,
305
+ * generate: Function, book?: ReturnType<typeof makeCostBook>,
306
+ * structuredMode?: 'tool'|'text', structureRetries?: number}} o
307
+ * @returns {Promise<{ok: boolean, proposal: any, reds: Red[], stop: string|null,
308
+ * attempts: number, raw: string, cost: any, raws: any[]}>}
309
+ */
310
+ export function proposeJudgedArtifacts({ answers, questions, generate, book, structuredMode, structureRetries, }: {
311
+ answers: Record<string | number, any>;
312
+ questions?: Record<string | number, string>;
313
+ generate: Function;
314
+ book?: ReturnType<typeof makeCostBook>;
315
+ structuredMode?: "tool" | "text";
316
+ structureRetries?: number;
317
+ }): Promise<{
318
+ ok: boolean;
319
+ proposal: any;
320
+ reds: Red[];
321
+ stop: string | null;
322
+ attempts: number;
323
+ raw: string;
324
+ cost: any;
325
+ raws: any[];
326
+ }>;
327
+ /** @typedef {{code: string, path: string, detail: string, [k: string]: any}} Red */
328
+ /** the output channel for the compile. It takes no action; it carries the answer. */
329
+ export const PROPOSAL_TOOL_NAME: "propose_rubric";
330
+ /** what the tool returns. The loop stops on delivery, so the model never reads it. */
331
+ export const PROPOSAL_ACK: "proposal received";
332
+ /** the label the compile call is metered and persisted under — one spelling */
333
+ export const PROPOSAL_LABEL: "judged-compile";
334
+ /** a malformed EMISSION is a transport fault, bounded on its own axis — the same
335
+ * ceiling `authorClose` declares for the declaration channel */
336
+ export const MAX_PROPOSAL_RETRIES: 2;
337
+ /**
338
+ * The system prompt a caller BINDS ITS SEAM WITH — this module owns no provider
339
+ * and picks none, exactly as `authorClose` does not: the compile call arrives as
340
+ * `generate`, and a caller wires it with `makeLoopGenerate(provider, {system:
341
+ * COMPILE_SYSTEM})`, whose own `maxTokens` default (F30) is what holds ten
342
+ * artifacts. Exported rather than inlined so the one register this call is made
343
+ * in is not re-spelled at every integration.
344
+ */
345
+ export const COMPILE_SYSTEM: string;
346
+ export type Red = {
347
+ code: string;
348
+ path: string;
349
+ detail: string;
350
+ [k: string]: any;
351
+ };
352
+ import { makeCostBook } from './authorflow.js';
@@ -6,6 +6,16 @@ export function isDeclaredClose(job: any): boolean;
6
6
  *
7
7
  * `offer` and `needs` pass through untouched when a declaration carries them
8
8
  * (v1's schema does not let one), so `checkMenu`'s derivation is unchanged.
9
+ *
10
+ * THE JUDGE TIER RIDES ALONG, and it rides as a STAMP for the same reason `offer`
11
+ * does. The tier that graded this close's calibration set is a CLOSE-level fact
12
+ * (`calibration.judgeModel`), and the stage that would buy a judge call is a STAGE;
13
+ * `runStage` is handed stages and never the declaration they came out of. Rather than
14
+ * plumb a second close-level channel down through every executor seam, the one place
15
+ * that already turns a declaration into stages carries it across — and it carries it
16
+ * from the SIGNED bytes, so a stage can never name a tier the signature does not.
17
+ * `runJudgedFloor` refuses a mismatch; the absence of a stamp is the SPEC gate's
18
+ * business (`validateCloseDecl` reds a set with no model), never a runtime fall-back.
9
19
  * @param {any} closeDecl
10
20
  * @returns {any[]|null} null when this is not a declaration
11
21
  */
@@ -98,7 +108,9 @@ export function guardNames(closeDecl: any, verdictType: string): string[];
98
108
  * @param {(s: string) => string} [redact] the scrub, applied at THIS boundary
99
109
  * @param {{timeoutMs?: number, cwd?: string, seedRef?: string,
100
110
  * seedTrees?: any, gapCap?: number, maxBuffer?: number, baselineMode?: 'auto'|'worktree',
101
- * humanRuling?: {decision: string, text?: string|null}|null}} [opts]
111
+ * humanRuling?: {decision: string, text?: string|null}|null,
112
+ * judgeLoop?: ((o: {system: string}) => any)|null,
113
+ * onJudgeCost?: ((c: any) => void)|null}} [opts]
102
114
  * @returns {Promise<any>}
103
115
  */
104
116
  export function runDeclaredStages(stages: any[], redact?: (s: string) => string, opts?: {
@@ -113,6 +125,10 @@ export function runDeclaredStages(stages: any[], redact?: (s: string) => string,
113
125
  decision: string;
114
126
  text?: string | null;
115
127
  } | null;
128
+ judgeLoop?: ((o: {
129
+ system: string;
130
+ }) => any) | null;
131
+ onJudgeCost?: ((c: any) => void) | null;
116
132
  }): Promise<any>;
117
133
  /**
118
134
  * The trend reader's input for ONE close verdict, whichever executor produced
@@ -155,6 +171,12 @@ export const DECLARED_GENRES: readonly "TYPES"[];
155
171
  * channel of its own.
156
172
  */
157
173
  export const CLOSE_DECL_FIELDS: readonly string[];
174
+ /** what a stored calibration set carries, ENUMERATED: the frozen cases and the judge
175
+ * tier that graded them. Both are inside the spec, so `jobSpecHash` covers both — which
176
+ * is the whole mechanism behind "a judge-model bump forces a full recalibration"
177
+ * (src/judged.js, `JUDGE_MODEL`): the field moves, the hash moves, the signature dies,
178
+ * and the re-sign re-runs the gate. Anything else in there is a field nobody reads. */
179
+ export const CALIBRATION_FIELDS: readonly string[];
158
180
  /**
159
181
  * The prefix M1 puts on EVERY gap line of a declared stage (its `ctx.gapKeep`).
160
182
  * A literal, so the anchored pattern below is exact.
@@ -215,10 +237,17 @@ export const HUMAN_CHECKPOINTS: readonly string[];
215
237
  * validator reads one hierarchy table rather than hard-coding a class.
216
238
  *
217
239
  * `hard` is by CONSTRUCTION: every mechanical kind is a command whose measurement
218
- * is the truth. `hitl` joined it at N4 slice 1, and only because `human-confirms`
219
- * is genuinely LIVE — the widening and the kind go in one commit, or this table
220
- * admits a class the executor cannot render. The `soft` class is still absent:
221
- * `judged-floor` is locked, so no declaration can reach above hitl.
240
+ * is the truth. `hitl` joined it at N4 slice 1, and `soft` at softgreen module 3
241
+ * — each only because its kind is genuinely LIVE (`human-confirms`, then
242
+ * `judged-floor`): the widening and the kind go in one commit, or this table
243
+ * admits a class the executor cannot render.
244
+ *
245
+ * `hitl` STAYS despite the class's retirement (PRD v1.71: the human stage moved
246
+ * out of the close and became the review door at the end of every run). It is
247
+ * kept because `jobs/litectx-maintainer.json` is a SIGNED spec carrying a hitl
248
+ * declaration, and a signed spec is untouchable — dropping the spelling here
249
+ * would invalidate a signature the operator already gave, which is a re-sign
250
+ * nobody asked for. Retiring it is a separate, deliberate deletion.
222
251
  *
223
252
  * The direction that matters is unchanged. This says which class a declaration
224
253
  * MAY claim; `closeCeiling` says which class its stages actually NEED. A pick
package/types/index.d.ts CHANGED
@@ -1,20 +1,24 @@
1
1
  export { makeSpine } from "./spine.js";
2
2
  export { runPlan } from "./planrun.js";
3
- export { runJob } from "./run.js";
4
3
  export { ralph, runClose, runStages, CLOSE_FAULTS } from "./ralph.js";
5
4
  export { globToPrefix, scanSecrets } from "./validate.js";
6
5
  export { validateJob, jobSpecHash, checkApproval, checkMenu, CLOSE_TYPES, CLASS_BY_CLOSE, GOLD_COMPARE, CADENCE_UNITS, PROVIDERS, CONDITION_KEYS, TOOL_MENU, LOCKED_TOOLS, STORE_VERBS, VERDICT_TYPES, LOCKED_VERDICTS } from "./job.js";
7
6
  export { validatePlan, stageClose, EXIT_TYPES, MAX_EXITS_PER_STEP, MAX_PLAN_STEPS, WRITE_VERBS, closeStagesOf } from "./plan.js";
8
7
  export { snapshotScope, evalExits } from "./exits.js";
9
- export { BRIDGE_SCHEMA, validateBridge, deriveStatus, listingRow, loadGate, mintBridge, appendGreen, appendRed, loadBridge, loadRegistry, saveBridge, makeRegistry, registryExists } from "./bridges.js";
8
+ export { runJob, ACCOUNTED_ROUND_TYPES } from "./run.js";
9
+ export { BRIDGE_SCHEMA, validateBridge, deriveStatus, listingRow, loadGate, mintBridge, appendGreen, appendRed, loadBridge, loadRegistry, saveBridge, makeRegistry, registryExists, QUARANTINED_VERDICTS, QUARANTINED_CODE, quarantinesCredit, newestEligibleVersion, reuseEligibility, recordDoor } from "./bridges.js";
10
10
  export { renderListing, selectionPrompt } from "./selection.js";
11
- export { validateEnvelope, resolveTrySpec, resolveReuse, reuseSpecHash, selectBridge, runReuse, REUSE_GRADED_RED, readResume, resumeTreeGate, CHECKPOINT_OUTCOMES, PAUSE_TTL_MS, checkpointAgeGate } from "./reuse.js";
11
+ export { validateEnvelope, resolveTrySpec, resolveReuse, reuseSpecHash, selectBridge, runReuse, REUSE_GRADED_RED, readResume, resumeTreeGate, CHECKPOINT_OUTCOMES, PAUSE_TTL_MS, checkpointAgeGate, applyDoorDecision, writeRunGreenRow } from "./reuse.js";
12
12
  export { classifyIncidents, foldLedger, ledgerDeltas, updateLedger, LEDGER_CLASSES } from "./ledger.js";
13
13
  export { workBranchName, prepareWorkBranch, WORK_BRANCH_PREFIX, WORK_BRANCH_RE } from "./workbranch.js";
14
- export { runDeclaredClose, runStage, seedRead, seedAtHead, seedListing, changedSet, makeSeedTrees, LIVE_KINDS, STOP_FAULTS, JUDGED_MARKER, EXIT_GREEN, EXIT_RED, EXIT_STOP, HUMAN_DECISIONS, SEED_EXEMPT_KINDS, normalizeHumanRuling } from "./kinds.js";
15
- export { validateDeclaration, normalizeDeclaration, KIND_CATALOGUE, CATALOGUE_KINDS, CATALOGUE_LIVE_KINDS, LOCKED_KINDS, TYPES_GENRE, TYPES_GENRE_TEMPLATE, GENRE_LANGUAGES, genreEnv, genreOwnedEnvNames, genreInstruments, DIRECTIONS, BASELINES, MAX_STAGES, VERDICT_CLASSES, LOCKED_CLASSES, LIVE_CLASSES, CLASS_BATTERIES, classGuards, closeCeiling, NEVER_OFFERED_KINDS } from "./authoring.js";
14
+ export { runDeclaredClose, runStage, seedRead, seedAtHead, seedListing, changedSet, makeSeedTrees, LIVE_KINDS, STOP_FAULTS, JUDGED_MARKER, EXIT_GREEN, EXIT_RED, EXIT_STOP, HUMAN_DECISIONS, SEED_EXEMPT_KINDS, JUDGED_FLOOR_KIND, normalizeHumanRuling, resolveHumanRuling, JUDGE_ATTEMPTS, MAX_JUDGED_PATHS, REVIEW_DOOR, DOOR_OPEN_OUTCOMES, REVIEW_DOOR_CLASSES, doorOpens, mechanicalStages } from "./kinds.js";
15
+ export { answerReviewDoor, doorRecordOf, doorAgeGate } from "./reviewdoor.js";
16
+ export { JUDGE_MODEL, JUDGE_MAX_TOKENS, JUDGE_RULES, JUDGE_RULE_IDS, LOCATE_AXES, LOCATE_LABEL, validateCard, validateFacts, locatePrompt, runLocate, decide, defaultJudgeLoop, CALIBRATION_SIZE, CASE_VERDICTS, validateCalibrationSet, validateJudgedArtifacts, expectedOf } from "./judged.js";
17
+ export { proposeJudgedArtifacts, signJudgedArtifacts, foldJudgedArtifacts, proposalSchema, proposalTool, cardCasesPrompt, PROPOSAL_TOOL_NAME, PROPOSAL_LABEL, MAX_PROPOSAL_RETRIES, COMPILE_SYSTEM } from "./cardauthor.js";
18
+ export { runCalibration, compareExpectation, factsResist, artifactHash, INJECTION_LOCATE_BATTERY, INJECTION_CARD, CALIBRATION_LABEL, CASUALTY_AXES } from "./calibrate.js";
19
+ export { validateDeclaration, normalizeDeclaration, KIND_CATALOGUE, CATALOGUE_KINDS, CATALOGUE_LIVE_KINDS, LOCKED_KINDS, TYPES_GENRE, TYPES_GENRE_TEMPLATE, GENRE_LANGUAGES, genreEnv, genreOwnedEnvNames, genreInstruments, DIRECTIONS, BASELINES, MAX_STAGES, VERDICT_CLASSES, LOCKED_CLASSES, LIVE_CLASSES, CLASS_BATTERIES, classGuards, classMenu, closeCeiling, NEVER_OFFERED_KINDS } from "./authoring.js";
16
20
  export { runAuthorScout, buildSeedListing, seedFileList, classifySurvey, AUTHOR_SCOUT_VERBS, SCOUT_ATTEMPTS, SURVEY_CAUSES, SCOUT_RETRY_CAUSES } from "./authorscout.js";
17
21
  export { scrubRaw, RAW_PERSIST_MAX, RAW_TRIM_MARKER } from "./text.js";
18
- export { authorClose, authorPrompt, declarationSchema, makeLoopGenerate, MAX_REVISIONS, QUESTION_SETS, GREEN_QUESTIONS, CLASS_STATEMENTS, questionsFor, requiredAnswersFor } from "./authorflow.js";
22
+ export { authorClose, authorPrompt, declarationSchema, makeLoopGenerate, MAX_REVISIONS, QUESTION_SETS, GREEN_QUESTIONS, SOFTGREEN_QUESTIONS, CLASS_STATEMENTS, questionsFor, requiredAnswersFor } from "./authorflow.js";
19
23
  export { validateCloseDecl, runDeclaredStages, declaredStages, isDeclaredClose, guardNames, closeGrade, DECLARED_GENRES, DECLARED_GAP_PREFIX, DECLARED_GAP_KEEP, DECLARED_CLOSE_CLASSES, CLOSE_DECL_FIELDS, HUMAN_PAUSE, HITL_PAUSE, HITL_DECISION_RED, HUMAN_CHECKPOINTS } from "./declaredclose.js";
20
24
  export { runInterview, authorCloseForJob, assembleSpec, prepareSigning, refusalEvents, refuseLockedKind, GENRE, REFUSAL_LIB, REFUSAL_CATEGORY, AUTHORED_SPEC_FIELDS } from "./authorjob.js";
package/types/job.d.ts CHANGED
@@ -153,16 +153,29 @@ export const MIN_WALL_MS: 120000;
153
153
  * counts admission demand, and a generic invalid-value would bury it as a typo. */
154
154
  export const LOCKED_TOOLS: readonly string[];
155
155
  /** Layer 2 (design record 2026-07-21, decision 5): the verdict-type radio of
156
- * the four-field plan shape. v1 ADMITS only `green`; soft-green/hitl are
157
- * declared-but-locked — declaring one is a `request-red` (the tool-menu
158
- * pattern: disclosure ≠ admission), so the ledger counts the demand and the
159
- * non-code rung later fills a declared slot instead of reshaping the schema. */
156
+ * the four-field plan shape. All three are ADMITTED as of softgreen module 3;
157
+ * the declared-but-locked mechanism below (`LOCKED_VERDICTS`) is what carried
158
+ * them here one rung at a time — declaring a locked one is a `request-red` (the
159
+ * tool-menu pattern: disclosure ≠ admission), so the ledger counted the demand
160
+ * instead of the schema being reshaped when the rung finally landed. */
160
161
  export const VERDICT_TYPES: readonly string[];
161
- /** N4 slice 1: `hitl` is ADMITTED — the class whose *done* needs a person runs
162
- * through the same signed spec, the same agent-authored plan and the same
163
- * arbiter as a green job (the nine rulings, 2026-08-07; the three-button surface,
164
- * 2026-08-12). `soft-green` stays declared-but-locked until its judged floor is
165
- * built and proven (slice 2): a wobbly ruler must not mint anything. */
162
+ /** N4 slice 1 admitted `hitl`; softgreen module 3 admits `soft-green`, and the
163
+ * menu is now EMPTY — every class the radio names is built.
164
+ *
165
+ * `soft-green`'s lock was never a policy, it was a missing floor: a judged
166
+ * verdict with no ruler mints nothing honestly. Modules 1 and 2 built the ruler
167
+ * (a pinned judge that only LOCATES, an arbiter-owned `decide()`, a calibration
168
+ * gate) and wired it as the `judged-floor` kind, so the lock has nothing left to
169
+ * protect (design record 2026-08-17 §4, and the 2026-08-18 thresholds addendum).
170
+ *
171
+ * EMPTY here means "nothing is locked", which is a TRUE statement about a closed
172
+ * menu — not F59's absent-read-as-empty, where a `{}` stood in for a fact nobody
173
+ * gathered. The mechanism below stays exactly as it is: it is read at call time
174
+ * from this constant, so re-locking a class (or admitting a fourth) is one edit
175
+ * and the counted `request-red` path comes back with it. `LOCKED_CLASSES` in
176
+ * src/authoring.js is the twin and moved in the same commit; the suite pins the
177
+ * two identical. */
178
+ /** @type {readonly string[]} */
166
179
  export const LOCKED_VERDICTS: readonly string[];
167
180
  export const CADENCE_UNITS: readonly string[];
168
181
  /** SP-2: API-first; local deferred (PRD §5/§8). `clipipe-subscription` (F42,