literally-aeo 0.1.1 → 0.2.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.
- package/README.md +42 -6
- package/dist/author-tools.js +33 -64
- package/dist/cli.mjs +2723 -1616
- package/dist/lib/agents/author-schema.js +4 -5
- package/dist/lib/agents/author-validation.js +5 -6
- package/dist/lib/agents/copy-validation.js +4 -5
- package/dist/lib/agents/verifier.js +8 -8
- package/dist/lib/analysis/domain-classifier.js +8 -8
- package/dist/lib/analysis/domain-labels.js +3 -4
- package/dist/lib/analysis/progress.js +3 -4
- package/dist/lib/analysis/sentiment.js +8 -8
- package/dist/lib/author/examples.js +5 -6
- package/dist/lib/bundle/contracts.js +5 -6
- package/dist/lib/bundle/export.js +22 -19
- package/dist/lib/bundle/isolation.js +17 -0
- package/dist/lib/bundle/journal.js +6 -7
- package/dist/lib/bundle/project-journal.js +11 -10
- package/dist/lib/bundle/project.js +19 -16
- package/dist/lib/bundle/read.js +23 -20
- package/dist/lib/bundle/recorder.js +9 -8
- package/dist/lib/bundle/redact.js +6 -7
- package/dist/lib/bundle/trace-coverage.js +6 -7
- package/dist/lib/bundle/verify-integrity.js +8 -9
- package/dist/lib/bundle/verify-measurement.js +10 -11
- package/dist/lib/bundle/verify-report.js +11 -12
- package/dist/lib/bundle/verify.js +17 -18
- package/dist/lib/bundle/writer-lock.js +3 -1
- package/dist/lib/capture-manifest.js +3 -4
- package/dist/lib/checks/run-checks.js +10 -9
- package/dist/lib/chunks/chunk-2B5QF6UQ.js +159 -0
- package/dist/lib/chunks/{chunk-ZBDUE3A5.js → chunk-2GU6CNQI.js} +12 -7
- package/dist/lib/chunks/{chunk-CKUTDJAB.js → chunk-2ROXN2EC.js} +42 -7
- package/dist/lib/chunks/{chunk-XHWRSGX3.js → chunk-3JO5TXBA.js} +1 -1
- package/dist/lib/chunks/{chunk-XL4JIQ5X.js → chunk-4PD65FRJ.js} +7 -3
- package/dist/lib/chunks/{chunk-GMKF2FU4.js → chunk-5JPYM4MD.js} +1 -1
- package/dist/lib/chunks/{chunk-5VNYUCLL.js → chunk-622NMXN6.js} +6 -9
- package/dist/lib/chunks/{chunk-XNRSHATN.js → chunk-663HABKP.js} +5 -5
- package/dist/lib/chunks/{chunk-RMFT4KKK.js → chunk-6G25V4CF.js} +1 -1
- package/dist/lib/chunks/{chunk-GVC4LH2N.js → chunk-6GHHNPFJ.js} +1 -1
- package/dist/lib/chunks/{chunk-KMRQSIZW.js → chunk-6GOBBNDU.js} +16 -1
- package/dist/lib/chunks/{chunk-SBAZBOPI.js → chunk-6P7EZJI7.js} +4 -2
- package/dist/lib/chunks/chunk-7XO3SQAX.js +117 -0
- package/dist/lib/chunks/{chunk-SWS3K62X.js → chunk-7Z27HQWL.js} +3 -3
- package/dist/lib/chunks/{chunk-IPNK7FYT.js → chunk-AYY4MYTW.js} +1 -1
- package/dist/lib/chunks/{chunk-WDSCJEDG.js → chunk-BE4ENGUY.js} +10 -10
- package/dist/lib/chunks/{chunk-FKLNEB2P.js → chunk-BGOIPHJZ.js} +39 -11
- package/dist/lib/chunks/{chunk-7GXRDAUY.js → chunk-BLKLPUYR.js} +2 -2
- package/dist/lib/chunks/chunk-BSRKN6FU.js +93 -0
- package/dist/lib/chunks/{chunk-PCYNBDZ7.js → chunk-CO5T6WU5.js} +14 -9
- package/dist/lib/chunks/{chunk-E3OEE5XN.js → chunk-CUYVHXHI.js} +2 -2
- package/dist/lib/chunks/{chunk-2GY42RIJ.js → chunk-D3GE3OCB.js} +1 -1
- package/dist/lib/chunks/chunk-DVFFYY5G.js +74 -0
- package/dist/lib/chunks/{chunk-ZXGATMMH.js → chunk-EBUQPCKB.js} +1 -1
- package/dist/lib/chunks/{chunk-4E4NDGOZ.js → chunk-EE26FNSY.js} +1 -1
- package/dist/lib/chunks/{chunk-AUB5THIS.js → chunk-EJ655TVU.js} +1 -1
- package/dist/lib/chunks/{chunk-S2AM76LT.js → chunk-F4W5YHDZ.js} +2 -2
- package/dist/lib/chunks/chunk-FAUFE7MI.js +31 -0
- package/dist/lib/chunks/{chunk-FNDJUELJ.js → chunk-FOCJ7HPC.js} +7 -7
- package/dist/lib/chunks/{chunk-FPAN3VRW.js → chunk-FUAUPNRO.js} +26 -18
- package/dist/lib/chunks/{chunk-OQVIRYT5.js → chunk-G62E525I.js} +2 -2
- package/dist/lib/chunks/{chunk-2NJEWPCV.js → chunk-GDKGZQ3T.js} +2 -2
- package/dist/lib/chunks/{chunk-HSZ3DM74.js → chunk-GEFKDW7X.js} +15 -2
- package/dist/lib/chunks/{chunk-47IZBMP2.js → chunk-GESHTTSA.js} +2 -2
- package/dist/lib/chunks/chunk-GNMFJ2OK.js +321 -0
- package/dist/lib/chunks/{chunk-NVBMIPXR.js → chunk-HFRAHG5C.js} +44 -26
- package/dist/lib/chunks/{chunk-MHAKYFDF.js → chunk-HQG63ZKO.js} +11 -11
- package/dist/lib/chunks/{chunk-OORO55OM.js → chunk-HTOD4W4E.js} +21 -6
- package/dist/lib/chunks/{chunk-Q2PWES4B.js → chunk-I3XGRGXE.js} +1 -1
- package/dist/lib/chunks/{chunk-WUELMJ22.js → chunk-IE7NAL6B.js} +1 -1
- package/dist/lib/chunks/{chunk-KRFHQQS7.js → chunk-JXMDOAKA.js} +17 -17
- package/dist/lib/chunks/{chunk-S7KJZIUR.js → chunk-KJMU5KH4.js} +2 -2
- package/dist/lib/chunks/{chunk-POUSX3T4.js → chunk-L7MEIRJB.js} +1 -1
- package/dist/lib/chunks/{chunk-CPT2GKKW.js → chunk-LOBXOZ2R.js} +1 -1
- package/dist/lib/chunks/{chunk-IAR6XGEW.js → chunk-ML4W6KC6.js} +1 -1
- package/dist/lib/chunks/{chunk-WKH6BJAZ.js → chunk-MNWO7EHC.js} +4 -4
- package/dist/lib/chunks/{chunk-D2LPQO6Y.js → chunk-MRL5RUP7.js} +1 -1
- package/dist/lib/chunks/{chunk-IEVAFDW7.js → chunk-NCXSNHXX.js} +3 -3
- package/dist/lib/chunks/{chunk-HFOYASRQ.js → chunk-NGHAP2P5.js} +4 -4
- package/dist/lib/chunks/{chunk-ZLOOC46D.js → chunk-OKL7GN2F.js} +3 -3
- package/dist/lib/chunks/{chunk-3DG7GHFA.js → chunk-OQU5IXAJ.js} +5 -5
- package/dist/lib/chunks/{chunk-I7VNIW6Q.js → chunk-OU73OUX4.js} +16 -10
- package/dist/lib/chunks/{chunk-56VOFZ7T.js → chunk-QHUDJVPJ.js} +90 -24
- package/dist/lib/chunks/{chunk-KHU5DRBE.js → chunk-QSJ4IKUF.js} +9 -9
- package/dist/lib/chunks/{chunk-FBFZBLTY.js → chunk-R6XDZWUL.js} +7 -8
- package/dist/lib/chunks/{chunk-CJ5YD3CU.js → chunk-RJ5R6YYA.js} +5 -5
- package/dist/lib/chunks/{chunk-LPND3VNQ.js → chunk-RR46EDDR.js} +33 -25
- package/dist/lib/chunks/chunk-RYCRL3YA.js +106 -0
- package/dist/lib/chunks/{chunk-Z4LMDKBU.js → chunk-SHUMCKCS.js} +2 -2
- package/dist/lib/chunks/{chunk-3EBWDHPK.js → chunk-TJQ5OPLQ.js} +10 -12
- package/dist/lib/chunks/chunk-U64NCRRR.js +97 -0
- package/dist/lib/chunks/chunk-U772TN32.js +67 -0
- package/dist/lib/chunks/{chunk-YR67JG2V.js → chunk-UEMZYHYJ.js} +8 -3
- package/dist/lib/chunks/{chunk-J46W3EMQ.js → chunk-UZJSTJFP.js} +5 -5
- package/dist/lib/chunks/{chunk-XJVXASDD.js → chunk-V7OAPKNF.js} +3 -3
- package/dist/lib/chunks/{chunk-WE2WPNG2.js → chunk-VKM6MMA4.js} +66 -7
- package/dist/lib/chunks/{chunk-YWJPJI3W.js → chunk-VL253W5C.js} +3 -1
- package/dist/lib/chunks/{chunk-MD4AVTK2.js → chunk-VPZQGND4.js} +3 -3
- package/dist/lib/chunks/{chunk-X2Y2ZNG3.js → chunk-W2VGLWTS.js} +3 -3
- package/dist/lib/chunks/{chunk-6AUEDSTU.js → chunk-W5DC23OP.js} +1 -1
- package/dist/lib/chunks/chunk-W5X7WJYL.js +91 -0
- package/dist/lib/chunks/{chunk-QFVRCSJ2.js → chunk-WDOA5JEH.js} +2 -0
- package/dist/lib/chunks/{chunk-I3TMFPK4.js → chunk-WVACVWBL.js} +2 -2
- package/dist/lib/chunks/{chunk-MIF5IYNR.js → chunk-XDG6NPJB.js} +26 -29
- package/dist/lib/chunks/{chunk-X6E44EGV.js → chunk-XR44YSHT.js} +2 -2
- package/dist/lib/chunks/chunk-Y2CZ6FZY.js +61 -0
- package/dist/lib/chunks/{chunk-5KKLUM7M.js → chunk-YAAUWCJ4.js} +1 -1
- package/dist/lib/chunks/{chunk-3KQFLOC7.js → chunk-YRBIC5QH.js} +1 -1
- package/dist/lib/chunks/chunk-ZIGNJAPC.js +11 -0
- package/dist/lib/cli/bundle-commands.js +71 -65
- package/dist/lib/cli/guide-command.js +25 -0
- package/dist/lib/cli/io.js +1 -1
- package/dist/lib/cli/run-commands.js +270 -104
- package/dist/lib/cli/status-command.js +234 -0
- package/dist/lib/codex-workflow/aggregate.js +8 -9
- package/dist/lib/codex-workflow/author-tools.js +6 -7
- package/dist/lib/codex-workflow/author.js +17 -17
- package/dist/lib/codex-workflow/capture.js +10 -9
- package/dist/lib/codex-workflow/checkpoint.js +6 -7
- package/dist/lib/codex-workflow/checks.js +6 -7
- package/dist/lib/codex-workflow/codex-binary.js +13 -0
- package/dist/lib/codex-workflow/codex-home.js +6 -3
- package/dist/lib/codex-workflow/copy-editor.js +14 -14
- package/dist/lib/codex-workflow/copy-recovery.js +3 -4
- package/dist/lib/codex-workflow/copy.js +11 -11
- package/dist/lib/codex-workflow/finish.js +17 -18
- package/dist/lib/codex-workflow/host-models.js +7 -7
- package/dist/lib/codex-workflow/loop.js +42 -38
- package/dist/lib/codex-workflow/quality.js +3 -4
- package/dist/lib/codex-workflow/run-inputs.js +5 -6
- package/dist/lib/codex-workflow/run-source.js +14 -13
- package/dist/lib/codex-workflow/schemas.js +5 -6
- package/dist/lib/codex-workflow/session.js +7 -8
- package/dist/lib/codex-workflow/stage.js +26 -23
- package/dist/lib/codex-workflow/workdir.js +6 -7
- package/dist/lib/engine/audit-file.js +7 -6
- package/dist/lib/engine/author.js +37 -31
- package/dist/lib/engine/budget.js +7 -1
- package/dist/lib/engine/cost-estimate.js +41 -0
- package/dist/lib/engine/local-run.js +48 -42
- package/dist/lib/engine/preflight.js +10 -6
- package/dist/lib/engine/rejudge.js +56 -50
- package/dist/lib/engine/resources.js +1 -1
- package/dist/lib/engine/run-configuration.js +2 -1
- package/dist/lib/engine/run-status.js +151 -0
- package/dist/lib/engine/templates.js +8 -7
- package/dist/lib/grounding/controller.js +7 -7
- package/dist/lib/grounding/extract.js +6 -6
- package/dist/lib/grounding/grounding-runtime.js +18 -17
- package/dist/lib/grounding/model.js +5 -5
- package/dist/lib/grounding/recorded-tools.js +10 -9
- package/dist/lib/harness/report/artifacts.js +4 -5
- package/dist/lib/lib/checkpoint.js +3 -4
- package/dist/lib/models/batching.js +5 -5
- package/dist/lib/models/cost-coefficients.js +20 -0
- package/dist/lib/models/local-profile.js +10 -0
- package/dist/lib/models/pricing.js +6 -0
- package/dist/lib/models/profiles.js +7 -14
- package/dist/lib/models/structured-images.js +1 -1
- package/dist/lib/models/structured.js +4 -4
- package/dist/lib/models/supported-models.js +20 -0
- package/dist/lib/pipeline.js +9 -8
- package/dist/lib/probes/agent-cli-parsers.js +1 -1
- package/dist/lib/probes/agent-clis.js +6 -5
- package/dist/lib/probes/charged-trace.js +10 -0
- package/dist/lib/probes/probes.js +6 -6
- package/dist/lib/runner.js +10 -10
- package/dist/lib/schema.js +3 -4
- package/dist/lib/section-result.js +3 -4
- package/dist/lib/stores/artifacts.js +3 -4
- package/dist/lib/stores/files.js +9 -9
- package/dist/lib/stores/local-versions.js +4 -5
- package/dist/lib/stores/memory.js +6 -7
- package/dist/lib/stores/publication.js +5 -6
- package/dist/lib/viewer/server.js +18 -19
- package/dist/lib/workflow/schema.js +2 -3
- package/dist/types/agents/copy-validation.d.ts +4 -4
- package/dist/types/agents/verifier.d.ts +6 -6
- package/dist/types/bundle/contracts.d.ts +1 -1
- package/dist/types/bundle/isolation.d.ts +37 -0
- package/dist/types/bundle/project-journal.d.ts +2 -0
- package/dist/types/bundle/recorder.d.ts +4 -0
- package/dist/types/bundle/writer-lock.d.ts +9 -0
- package/dist/types/cli/guide-command.d.ts +4 -0
- package/dist/types/cli/status-command.d.ts +2 -0
- package/dist/types/codex-workflow/codex-binary.d.ts +26 -0
- package/dist/types/codex-workflow/codex-home.d.ts +24 -20
- package/dist/types/codex-workflow/copy-editor.d.ts +1 -1
- package/dist/types/codex-workflow/copy.d.ts +3 -4
- package/dist/types/codex-workflow/finish.d.ts +5 -3
- package/dist/types/codex-workflow/host-models.d.ts +7 -3
- package/dist/types/codex-workflow/loop.d.ts +10 -1
- package/dist/types/codex-workflow/run-inputs.d.ts +28 -113
- package/dist/types/codex-workflow/stage.d.ts +16 -5
- package/dist/types/engine/audit-file.d.ts +3 -2
- package/dist/types/engine/author.d.ts +7 -1
- package/dist/types/engine/budget.d.ts +46 -15
- package/dist/types/engine/cost-estimate.d.ts +40 -0
- package/dist/types/engine/local-run.d.ts +6 -0
- package/dist/types/engine/preflight.d.ts +5 -0
- package/dist/types/engine/resources.d.ts +2 -0
- package/dist/types/engine/run-configuration.d.ts +4 -3
- package/dist/types/engine/run-status.d.ts +75 -0
- package/dist/types/engine/templates.d.ts +1 -2
- package/dist/types/models/cost-coefficients.d.ts +106 -0
- package/dist/types/models/local-profile.d.ts +12 -0
- package/dist/types/models/pricing.d.ts +8 -0
- package/dist/types/models/profiles.d.ts +55 -160
- package/dist/types/models/served-model.d.ts +2 -3
- package/dist/types/models/structured.d.ts +3 -3
- package/dist/types/models/supported-models.d.ts +48 -0
- package/dist/types/probes/charged-trace.d.ts +8 -0
- package/dist/types/probes/probe-trace.d.ts +2 -0
- package/dist/types/schema.d.ts +28 -113
- package/dist/types/workflow/schema.d.ts +79 -152
- package/package.json +2 -1
- package/resources/guide/OPERATOR.md +180 -0
- package/src/agents/copy-validation.ts +8 -12
- package/src/agents/verifier.ts +10 -14
- package/src/bundle/contracts.ts +3 -3
- package/src/bundle/isolation.ts +157 -0
- package/src/bundle/project-journal.ts +4 -0
- package/src/bundle/project.ts +20 -7
- package/src/bundle/recorder.ts +5 -0
- package/src/bundle/writer-lock.ts +27 -0
- package/src/cli/guide-command.ts +28 -0
- package/src/cli/io.ts +2 -0
- package/src/cli/literally-aeo.ts +39 -19
- package/src/cli/run-commands.ts +236 -18
- package/src/cli/status-command.ts +113 -0
- package/src/codex-workflow/codex-binary.ts +105 -0
- package/src/codex-workflow/codex-home.ts +50 -40
- package/src/codex-workflow/copy.ts +7 -10
- package/src/codex-workflow/finish.ts +13 -8
- package/src/codex-workflow/host-models.ts +33 -24
- package/src/codex-workflow/loop.ts +36 -9
- package/src/codex-workflow/stage.ts +126 -17
- package/src/engine/audit-file.ts +10 -8
- package/src/engine/author.ts +47 -2
- package/src/engine/budget.ts +138 -43
- package/src/engine/cost-estimate.ts +178 -0
- package/src/engine/guide/OPERATOR.md +180 -0
- package/src/engine/local-run.ts +38 -8
- package/src/engine/preflight.ts +90 -7
- package/src/engine/resources.ts +9 -4
- package/src/engine/run-configuration.ts +19 -1
- package/src/engine/run-status.ts +452 -0
- package/src/engine/templates.ts +5 -2
- package/src/models/cost-coefficients.ts +140 -0
- package/src/models/local-profile.ts +150 -0
- package/src/models/pricing.ts +31 -0
- package/src/models/profiles.ts +58 -419
- package/src/models/served-model.ts +2 -3
- package/src/models/structured-images.ts +5 -4
- package/src/models/structured.ts +20 -7
- package/src/models/supported-models.ts +112 -0
- package/src/probes/agent-clis.ts +24 -2
- package/src/probes/charged-trace.ts +87 -0
- package/src/probes/probe-trace.ts +2 -0
- package/src/probes/probes.ts +48 -2
- package/dist/lib/chunks/chunk-CFFPOTP4.js +0 -356
- package/dist/lib/chunks/chunk-LIZX4N3H.js +0 -110
- package/dist/lib/chunks/chunk-OYKV5NDM.js +0 -28
package/src/engine/local-run.ts
CHANGED
|
@@ -28,7 +28,12 @@ import {
|
|
|
28
28
|
} from '../probes/agent-clis';
|
|
29
29
|
import { createFileResearchSessionStore } from '../grounding/file-store';
|
|
30
30
|
import { openGroundingRuntime } from '../grounding/grounding-runtime';
|
|
31
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
createFileModelAccounting,
|
|
33
|
+
type ModelCallAccounting,
|
|
34
|
+
} from '../models/accounting';
|
|
35
|
+
import { resolveSupportedModel } from '../models/supported-models';
|
|
36
|
+
import { chargedProbeTrace } from '../probes/charged-trace';
|
|
32
37
|
import type { InternalModelContext } from '../models/context';
|
|
33
38
|
import { ProbeLimiter } from '../probes/limits';
|
|
34
39
|
import { planRun, type RunPlan } from '../runner';
|
|
@@ -134,6 +139,9 @@ export type LocalRun = {
|
|
|
134
139
|
/** The run's pinned model context: every host call charges its ledger
|
|
135
140
|
* and is recorded in the run journal. */
|
|
136
141
|
internalModels: InternalModelContext;
|
|
142
|
+
/** The same ledger unwrapped, for the Codex sessions, which the journal
|
|
143
|
+
* records as operations of their own. */
|
|
144
|
+
ledger: ModelCallAccounting;
|
|
137
145
|
ground: GroundRun;
|
|
138
146
|
/** The directory's writer lock and its run journal, held from before the
|
|
139
147
|
* first canary: the workflow continues under both (prepareWorkdir held). */
|
|
@@ -154,6 +162,8 @@ export const openLocalRun = async (
|
|
|
154
162
|
dir: string,
|
|
155
163
|
options: {
|
|
156
164
|
signal?: AbortSignal;
|
|
165
|
+
/** The cap approved on the command line (`run --max-usd`). */
|
|
166
|
+
maxUsd?: number;
|
|
157
167
|
amendment?: BudgetAmendment;
|
|
158
168
|
derivedFromRunId?: string;
|
|
159
169
|
} = {},
|
|
@@ -203,12 +213,14 @@ const openLockedLocalRun = async (
|
|
|
203
213
|
dir: string,
|
|
204
214
|
{
|
|
205
215
|
signal,
|
|
216
|
+
maxUsd,
|
|
206
217
|
amendment,
|
|
207
218
|
derivedFromRunId,
|
|
208
219
|
runId,
|
|
209
220
|
held,
|
|
210
221
|
}: {
|
|
211
222
|
signal?: AbortSignal;
|
|
223
|
+
maxUsd?: number;
|
|
212
224
|
amendment?: BudgetAmendment;
|
|
213
225
|
derivedFromRunId?: string;
|
|
214
226
|
runId: string;
|
|
@@ -217,7 +229,9 @@ const openLockedLocalRun = async (
|
|
|
217
229
|
): Promise<LocalRun> => {
|
|
218
230
|
const { recorder } = held;
|
|
219
231
|
const budget = await resolveRunBudget(dir, file.runPolicy.budget, {
|
|
220
|
-
|
|
232
|
+
model: resolveSupportedModel(file.model).id,
|
|
233
|
+
...(maxUsd !== undefined && { maxUsd }),
|
|
234
|
+
...(amendment && { amendment }),
|
|
221
235
|
});
|
|
222
236
|
const config = toAuditConfig(file);
|
|
223
237
|
const request = {
|
|
@@ -237,17 +251,20 @@ const openLockedLocalRun = async (
|
|
|
237
251
|
|
|
238
252
|
return Promise.resolve();
|
|
239
253
|
};
|
|
254
|
+
// One ledger for every paid call of the run: probes, Codex sessions,
|
|
255
|
+
// host model calls and searches (specs/aeo-claude-operator-spec.md §4.2).
|
|
256
|
+
const ledger = createFileModelAccounting({
|
|
257
|
+
filename: path.join(bank, 'model-budget.json'),
|
|
258
|
+
limits: budget.limits,
|
|
259
|
+
assertOwned,
|
|
260
|
+
});
|
|
240
261
|
const grounding = openGroundingRuntime({
|
|
241
262
|
request,
|
|
242
263
|
config,
|
|
243
264
|
analysisStore: stores.analysisStore,
|
|
244
265
|
env: getEnvironment(),
|
|
245
266
|
signal,
|
|
246
|
-
rawAccounting:
|
|
247
|
-
filename: path.join(bank, 'model-budget.json'),
|
|
248
|
-
limits: budget.limits,
|
|
249
|
-
assertOwned,
|
|
250
|
-
}),
|
|
267
|
+
rawAccounting: ledger,
|
|
251
268
|
store: createFileResearchSessionStore(
|
|
252
269
|
path.join(bank, 'research'),
|
|
253
270
|
assertOwned,
|
|
@@ -280,6 +297,7 @@ const openLockedLocalRun = async (
|
|
|
280
297
|
);
|
|
281
298
|
}
|
|
282
299
|
|
|
300
|
+
const probes = chargedProbeTrace(probeTraceOf(recorder, 'probe'), ledger);
|
|
283
301
|
const capture = await captureForRun({
|
|
284
302
|
config,
|
|
285
303
|
request,
|
|
@@ -288,10 +306,21 @@ const openLockedLocalRun = async (
|
|
|
288
306
|
agentCliVersions,
|
|
289
307
|
limiter: new ProbeLimiter(request.limits),
|
|
290
308
|
internalModels,
|
|
291
|
-
trace:
|
|
309
|
+
trace: probes.trace,
|
|
292
310
|
signal,
|
|
293
311
|
logContext: { reportKey: config.reportKey, runId, local: true },
|
|
312
|
+
}).catch((err: unknown) => {
|
|
313
|
+
// A unit the cap refused fails as unrecorded, and the capture may
|
|
314
|
+
// report only the shortfall: the cap is the reason, and the run stops
|
|
315
|
+
// resumable with everything captured so far banked.
|
|
316
|
+
throw probes.exhausted() ?? err;
|
|
294
317
|
});
|
|
318
|
+
const exhausted = probes.exhausted();
|
|
319
|
+
|
|
320
|
+
if (exhausted) {
|
|
321
|
+
throw exhausted;
|
|
322
|
+
}
|
|
323
|
+
|
|
295
324
|
const captured = (await stores.probeStore.list()).filter(
|
|
296
325
|
(entry): entry is CapturedUnitRecord => entry.status === 'captured',
|
|
297
326
|
);
|
|
@@ -315,6 +344,7 @@ const openLockedLocalRun = async (
|
|
|
315
344
|
source,
|
|
316
345
|
budget,
|
|
317
346
|
internalModels,
|
|
347
|
+
ledger,
|
|
318
348
|
ground: (manifest, options) => grounding.ground(manifest, options),
|
|
319
349
|
held,
|
|
320
350
|
};
|
package/src/engine/preflight.ts
CHANGED
|
@@ -7,10 +7,20 @@ import {
|
|
|
7
7
|
versionForSurface,
|
|
8
8
|
} from '../probes/agent-clis';
|
|
9
9
|
import {
|
|
10
|
+
agentSurfaces,
|
|
10
11
|
isAgentSurface,
|
|
11
12
|
type AeoAgentSurface,
|
|
12
13
|
type AeoSurface,
|
|
13
14
|
} from '../schema';
|
|
15
|
+
import {
|
|
16
|
+
codexBinaryVersion,
|
|
17
|
+
resolveCodexBinary,
|
|
18
|
+
} from '../codex-workflow/codex-binary';
|
|
19
|
+
import {
|
|
20
|
+
describeSupportedModels,
|
|
21
|
+
findSupportedModel,
|
|
22
|
+
recommendedModelId,
|
|
23
|
+
} from '../models/supported-models';
|
|
14
24
|
import type { Settings } from './env-file';
|
|
15
25
|
|
|
16
26
|
// ============================================================================
|
|
@@ -99,11 +109,69 @@ const directoryCheck = async (dir: string): Promise<PreflightCheck> => {
|
|
|
99
109
|
}
|
|
100
110
|
};
|
|
101
111
|
|
|
112
|
+
/** The model audit.json names, or the recommended one: refused when it is
|
|
113
|
+
* not on the supported list, which the detail then prints. */
|
|
114
|
+
export const modelCheck = (model: string | undefined): PreflightCheck => {
|
|
115
|
+
const id = model ?? recommendedModelId;
|
|
116
|
+
const supported = findSupportedModel(id);
|
|
117
|
+
|
|
118
|
+
if (!supported) {
|
|
119
|
+
return {
|
|
120
|
+
name: 'model',
|
|
121
|
+
ok: false,
|
|
122
|
+
detail: [
|
|
123
|
+
`${id} is not supported; use one of:`,
|
|
124
|
+
...describeSupportedModels(),
|
|
125
|
+
].join('\n '),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return {
|
|
130
|
+
name: 'model',
|
|
131
|
+
ok: true,
|
|
132
|
+
detail: [
|
|
133
|
+
`${supported.id}${model === undefined ? ' (recommended; audit.json names none)' : ''}`,
|
|
134
|
+
supported.stageRuntimeVerifiedAt === null
|
|
135
|
+
? 'not yet verified on the Codex stage runtime through the gateway'
|
|
136
|
+
: `verified on the Codex stage runtime ${supported.stageRuntimeVerifiedAt}`,
|
|
137
|
+
].join('; '),
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/** The Codex the stages run: this package's own, unless overridden. */
|
|
142
|
+
const codexCheck = async (): Promise<PreflightCheck> => {
|
|
143
|
+
try {
|
|
144
|
+
const binary = resolveCodexBinary();
|
|
145
|
+
const version = await codexBinaryVersion(binary);
|
|
146
|
+
const origin =
|
|
147
|
+
binary.source === 'dependency'
|
|
148
|
+
? "the package's own pinned dependency"
|
|
149
|
+
: `AEO_CODEX_BIN=${binary.path}`;
|
|
150
|
+
|
|
151
|
+
return {
|
|
152
|
+
name: 'codex (stage runtime)',
|
|
153
|
+
ok: version !== null,
|
|
154
|
+
detail:
|
|
155
|
+
version === null
|
|
156
|
+
? `${binary.path} did not start; reinstall literally-aeo`
|
|
157
|
+
: `${version}, from ${origin}`,
|
|
158
|
+
};
|
|
159
|
+
} catch (err) {
|
|
160
|
+
return {
|
|
161
|
+
name: 'codex (stage runtime)',
|
|
162
|
+
ok: false,
|
|
163
|
+
detail: `not installed with the package (${err instanceof Error ? err.message : String(err)}); reinstall literally-aeo`,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
102
168
|
/** runPreflight checks what a run over these surfaces needs locally. */
|
|
103
169
|
export const runPreflight = async (args: {
|
|
104
170
|
surfaces: readonly AeoSurface[];
|
|
105
171
|
settings: Settings;
|
|
106
172
|
dir: string;
|
|
173
|
+
/** audit.json's `model`; absent means the recommended model. */
|
|
174
|
+
model?: string;
|
|
107
175
|
/** Full grounding researches through the pinned search provider. */
|
|
108
176
|
groundingSearch?: boolean;
|
|
109
177
|
}): Promise<PreflightCheck[]> => {
|
|
@@ -118,13 +186,9 @@ export const runPreflight = async (args: {
|
|
|
118
186
|
ok: nodeMajor >= minimumNodeMajor,
|
|
119
187
|
detail: `${process.version} (${minimumNodeMajor} or newer required)`,
|
|
120
188
|
},
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
ok: versions.codex !== null,
|
|
125
|
-
detail:
|
|
126
|
-
versions.codex ?? 'not found on PATH; the workflow stages need it',
|
|
127
|
-
},
|
|
189
|
+
modelCheck(args.model),
|
|
190
|
+
// Every stage session runs on Codex, whatever is measured.
|
|
191
|
+
await codexCheck(),
|
|
128
192
|
settingCheck(gatewaySetting, settings),
|
|
129
193
|
];
|
|
130
194
|
|
|
@@ -150,6 +214,25 @@ export const runPreflight = async (args: {
|
|
|
150
214
|
});
|
|
151
215
|
}
|
|
152
216
|
|
|
217
|
+
// Which coding-agent CLIs this machine has, for a config that would
|
|
218
|
+
// measure them: what to install or log in to, or what to leave out.
|
|
219
|
+
for (const surface of agentSurfaces) {
|
|
220
|
+
if (agents.includes(surface)) {
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const version = versionForSurface(surface, versions);
|
|
225
|
+
|
|
226
|
+
checks.push({
|
|
227
|
+
name: `${surface} CLI`,
|
|
228
|
+
ok: true,
|
|
229
|
+
detail:
|
|
230
|
+
version === null
|
|
231
|
+
? `\`${cliNameForSurface(surface)}\` not installed; needed only when the config measures coding agents`
|
|
232
|
+
: `${cliNameForSurface(surface)} ${version} installed; this config does not measure it`,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
|
|
153
236
|
checks.push(await directoryCheck(args.dir));
|
|
154
237
|
|
|
155
238
|
return checks;
|
package/src/engine/resources.ts
CHANGED
|
@@ -4,10 +4,11 @@ import { enginePackageRoot } from './package-root';
|
|
|
4
4
|
|
|
5
5
|
// ============================================================================
|
|
6
6
|
// The engine's own files (specs/aeo-open-source-cli-spec.md §4.1): the copy
|
|
7
|
-
// and author rules, the banlist
|
|
8
|
-
// install carries them in resources/; a checkout
|
|
9
|
-
// src/. Never the caller's working directory, and
|
|
10
|
-
// private editorial files unless AEO_EDITORIAL_DIR names
|
|
7
|
+
// and author rules, the banlist, the neutral editorial context and the
|
|
8
|
+
// operator guide. A packed install carries them in resources/; a checkout
|
|
9
|
+
// reads them in place under src/. Never the caller's working directory, and
|
|
10
|
+
// never a publisher's private editorial files unless AEO_EDITORIAL_DIR names
|
|
11
|
+
// them.
|
|
11
12
|
// ============================================================================
|
|
12
13
|
|
|
13
14
|
export type EngineResources = {
|
|
@@ -15,6 +16,8 @@ export type EngineResources = {
|
|
|
15
16
|
root: string;
|
|
16
17
|
author: string;
|
|
17
18
|
editorial: string;
|
|
19
|
+
/** The operator guide `literally-aeo guide` prints. */
|
|
20
|
+
guide: string;
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
const exists = async (file: string) => {
|
|
@@ -34,6 +37,7 @@ export const engineResources = async (): Promise<EngineResources> => {
|
|
|
34
37
|
root,
|
|
35
38
|
author: path.join(packed, 'author'),
|
|
36
39
|
editorial: path.join(packed, 'editorial'),
|
|
40
|
+
guide: path.join(packed, 'guide', 'OPERATOR.md'),
|
|
37
41
|
};
|
|
38
42
|
}
|
|
39
43
|
|
|
@@ -41,5 +45,6 @@ export const engineResources = async (): Promise<EngineResources> => {
|
|
|
41
45
|
root,
|
|
42
46
|
author: path.join(root, 'src', 'author'),
|
|
43
47
|
editorial: path.join(root, 'src', 'engine', 'editorial'),
|
|
48
|
+
guide: path.join(root, 'src', 'engine', 'guide', 'OPERATOR.md'),
|
|
44
49
|
};
|
|
45
50
|
};
|
|
@@ -2,6 +2,7 @@ import { readFile } from 'node:fs/promises';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { writeFileAtomically } from '../codex-workflow/pending';
|
|
5
|
+
import { isRecord } from '../lib/type-guards';
|
|
5
6
|
|
|
6
7
|
// ============================================================================
|
|
7
8
|
// What a local run keeps about its own configuration
|
|
@@ -50,18 +51,35 @@ export const readRecordedAuthorEvidence = async (
|
|
|
50
51
|
|
|
51
52
|
/** recordRunConfiguration writes the run's audit.json and author evidence
|
|
52
53
|
* into its directory, replacing what an earlier invocation wrote. */
|
|
54
|
+
/** The operator's configuration with the model the run actually used. */
|
|
55
|
+
const configWithModel = (text: string, model: string): string => {
|
|
56
|
+
const config: unknown = JSON.parse(text);
|
|
57
|
+
|
|
58
|
+
if (!isRecord(config)) {
|
|
59
|
+
throw new Error('The configuration to record is not a JSON object.');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return `${JSON.stringify({ ...config, model }, null, 2)}\n`;
|
|
63
|
+
};
|
|
64
|
+
|
|
53
65
|
export const recordRunConfiguration = async ({
|
|
54
66
|
dir,
|
|
55
67
|
configFile,
|
|
56
68
|
evidence,
|
|
69
|
+
model,
|
|
57
70
|
}: {
|
|
58
71
|
dir: string;
|
|
59
72
|
configFile: string;
|
|
60
73
|
evidence: RecordedAuthorEvidence;
|
|
74
|
+
/** A model named outside the file (`rejudge --model`): the recorded
|
|
75
|
+
* configuration is the one the run ran with, not the file's. */
|
|
76
|
+
model?: string;
|
|
61
77
|
}): Promise<void> => {
|
|
78
|
+
const text = await readFile(configFile, 'utf8');
|
|
79
|
+
|
|
62
80
|
await writeFileAtomically(
|
|
63
81
|
path.join(dir, auditCopyFile),
|
|
64
|
-
|
|
82
|
+
model === undefined ? text : configWithModel(text, model),
|
|
65
83
|
);
|
|
66
84
|
await writeFileAtomically(
|
|
67
85
|
path.join(dir, authorEvidenceFile),
|