literally-aeo 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -7
- package/dist/author-tools.js +512 -461
- package/dist/cli.mjs +3512 -2010
- package/dist/lib/access/schema.js +6 -6
- package/dist/lib/agents/author-schema.js +11 -12
- package/dist/lib/agents/author-validation.js +19 -20
- package/dist/lib/agents/copy-validation.js +22 -22
- package/dist/lib/agents/copywriter-input.js +22 -7
- package/dist/lib/agents/facts.js +21 -6
- package/dist/lib/agents/narrative-facts.js +20 -2
- package/dist/lib/agents/verifier.js +26 -25
- package/dist/lib/analysis/domain-classifier.js +21 -22
- package/dist/lib/analysis/domain-labels.js +11 -12
- package/dist/lib/analysis/progress-schema.js +2 -2
- package/dist/lib/analysis/progress.js +19 -21
- package/dist/lib/analysis/retrieval.js +20 -3
- package/dist/lib/analysis/scoring.js +20 -3
- package/dist/lib/analysis/search-analyzer.js +19 -5
- package/dist/lib/analysis/sentiment.js +18 -19
- package/dist/lib/author/examples.js +12 -13
- package/dist/lib/bundle/contracts.js +15 -14
- package/dist/lib/bundle/export.js +34 -31
- package/dist/lib/bundle/isolation.js +17 -0
- package/dist/lib/bundle/journal.js +14 -15
- package/dist/lib/bundle/project-journal.js +19 -18
- package/dist/lib/bundle/project.js +31 -28
- package/dist/lib/bundle/read.js +35 -32
- package/dist/lib/bundle/recorder.js +17 -16
- package/dist/lib/bundle/redact.js +14 -15
- package/dist/lib/bundle/trace-coverage.js +14 -15
- package/dist/lib/bundle/verify-integrity.js +16 -17
- package/dist/lib/bundle/verify-measurement.js +22 -23
- package/dist/lib/bundle/verify-report.js +29 -30
- package/dist/lib/bundle/verify.js +37 -38
- package/dist/lib/bundle/writer-lock.js +3 -1
- package/dist/lib/capture-manifest.js +13 -14
- package/dist/lib/checks/crawler-access.js +4 -1
- package/dist/lib/checks/renderability.js +5 -1
- package/dist/lib/checks/run-checks.js +23 -19
- package/dist/lib/chunks/chunk-2B5QF6UQ.js +159 -0
- package/dist/lib/chunks/chunk-2FOKEIIN.js +93 -0
- package/dist/lib/chunks/{chunk-KRFHQQS7.js → chunk-2KH7LNK7.js} +24 -24
- package/dist/lib/chunks/{chunk-NVBMIPXR.js → chunk-3GPUCXVA.js} +44 -26
- package/dist/lib/chunks/{chunk-3EBWDHPK.js → chunk-3OE4UQIB.js} +14 -16
- package/dist/lib/chunks/{chunk-FNDJUELJ.js → chunk-3OWJBGQE.js} +14 -14
- package/dist/lib/chunks/{chunk-Y4OGZ3Q5.js → chunk-46PVVQYR.js} +1 -1
- package/dist/lib/chunks/{chunk-EV4DRS5M.js → chunk-4XIAXX7K.js} +1 -1
- package/dist/lib/chunks/{chunk-IBOWGKN7.js → chunk-52F5XYOW.js} +1 -1
- package/dist/lib/chunks/{chunk-3DG7GHFA.js → chunk-66DVMLGR.js} +10 -10
- package/dist/lib/chunks/{chunk-FFOVLI3U.js → chunk-66T7JC57.js} +12 -10
- package/dist/lib/chunks/{chunk-KMRQSIZW.js → chunk-6GOBBNDU.js} +16 -1
- package/dist/lib/chunks/{chunk-WUELMJ22.js → chunk-6HMHXSCS.js} +2 -2
- package/dist/lib/chunks/{chunk-SWS3K62X.js → chunk-6JICXLDA.js} +3 -3
- package/dist/lib/chunks/{chunk-SBAZBOPI.js → chunk-6P7EZJI7.js} +4 -2
- package/dist/lib/chunks/chunk-75DMLOQ7.js +127 -0
- package/dist/lib/chunks/{chunk-RMFT4KKK.js → chunk-7CW6U5WJ.js} +1 -1
- package/dist/lib/chunks/{chunk-5VNYUCLL.js → chunk-7HM6IZ3L.js} +6 -9
- package/dist/lib/chunks/{chunk-X6E44EGV.js → chunk-7LBSNDRR.js} +10 -8
- package/dist/lib/chunks/{chunk-S2AM76LT.js → chunk-7WO3FFPS.js} +3 -3
- package/dist/lib/chunks/{chunk-ULRXHSJL.js → chunk-7YDXD4MD.js} +9 -6
- package/dist/lib/chunks/{chunk-HFOYASRQ.js → chunk-AAFHXNLU.js} +4 -4
- package/dist/lib/chunks/{chunk-OBXAHX3L.js → chunk-AASWJR7Q.js} +1 -5
- package/dist/lib/chunks/{chunk-MD4AVTK2.js → chunk-AJKV46SM.js} +3 -3
- package/dist/lib/chunks/{chunk-IEVAFDW7.js → chunk-AJO7XVXK.js} +12 -12
- package/dist/lib/chunks/{chunk-GMKF2FU4.js → chunk-AK6YNTCV.js} +1 -1
- package/dist/lib/chunks/{chunk-WKH6BJAZ.js → chunk-BFWK3TBN.js} +6 -6
- package/dist/lib/chunks/{chunk-FKLNEB2P.js → chunk-BGAHZIL3.js} +51 -17
- package/dist/lib/chunks/{chunk-ZCOI3HE2.js → chunk-BRENK356.js} +1 -1
- package/dist/lib/chunks/{chunk-S7KJZIUR.js → chunk-BXF4OC74.js} +18 -9
- package/dist/lib/chunks/{chunk-NCLFZOZU.js → chunk-CH7OCYDL.js} +1 -1
- package/dist/lib/chunks/{chunk-FPAN3VRW.js → chunk-DDS4G4DO.js} +27 -19
- package/dist/lib/chunks/{chunk-ZLOOC46D.js → chunk-DL6YQDTE.js} +34 -8
- package/dist/lib/chunks/chunk-DVFFYY5G.js +74 -0
- package/dist/lib/chunks/{chunk-PDS5KWO3.js → chunk-E2YTTB6Q.js} +56 -42
- package/dist/lib/chunks/{chunk-YR67JG2V.js → chunk-E3OGPTUY.js} +8 -3
- package/dist/lib/chunks/{chunk-SDWYZM64.js → chunk-EDQTINTL.js} +5 -1
- package/dist/lib/chunks/chunk-ESEMYWUH.js +257 -0
- package/dist/lib/chunks/{chunk-YHS5IEVZ.js → chunk-F2NSJ6PG.js} +12 -8
- package/dist/lib/chunks/{chunk-7GXRDAUY.js → chunk-F7DBTXKG.js} +6 -6
- package/dist/lib/chunks/chunk-FAUFE7MI.js +31 -0
- package/dist/lib/chunks/{chunk-4E4NDGOZ.js → chunk-FDM2YNQL.js} +1 -1
- package/dist/lib/chunks/{chunk-47IZBMP2.js → chunk-FIC7JSR4.js} +2 -2
- package/dist/lib/chunks/{chunk-CJ5YD3CU.js → chunk-FJL2V6P5.js} +6 -6
- package/dist/lib/chunks/{chunk-KHU5DRBE.js → chunk-FL6LN2K6.js} +9 -9
- package/dist/lib/chunks/{chunk-HSZ3DM74.js → chunk-GEFKDW7X.js} +15 -2
- package/dist/lib/chunks/{chunk-XNRSHATN.js → chunk-HI3PD3KR.js} +8 -8
- package/dist/lib/chunks/{chunk-AUB5THIS.js → chunk-I3UE52ZV.js} +2 -2
- package/dist/lib/chunks/{chunk-IAR6XGEW.js → chunk-J5NPHPXY.js} +5 -4
- package/dist/lib/chunks/{chunk-XJVXASDD.js → chunk-JBOOD6MU.js} +11 -10
- package/dist/lib/chunks/{chunk-5KKLUM7M.js → chunk-JKPBXPCW.js} +3 -3
- package/dist/lib/chunks/{chunk-5HT55QYX.js → chunk-JQDQVG3D.js} +1 -1
- package/dist/lib/chunks/{chunk-3KQFLOC7.js → chunk-JXBLGCXZ.js} +1 -1
- package/dist/lib/chunks/{chunk-D2INDP5W.js → chunk-JYFEXVWC.js} +7 -6
- package/dist/lib/chunks/{chunk-X2Y2ZNG3.js → chunk-K2FZFESR.js} +8 -8
- package/dist/lib/chunks/{chunk-DC6PN7QJ.js → chunk-K4Y5NT4M.js} +11 -7
- package/dist/lib/chunks/chunk-K7YFL5KB.js +182 -0
- package/dist/lib/chunks/{chunk-ZYSPTOKK.js → chunk-KQCRJIEG.js} +1 -1
- package/dist/lib/chunks/{chunk-LPND3VNQ.js → chunk-KSOHZKV5.js} +43 -35
- package/dist/lib/chunks/{chunk-FBFZBLTY.js → chunk-LR27H2HZ.js} +15 -16
- package/dist/lib/chunks/{chunk-KZR25REO.js → chunk-LTI2YYU3.js} +1 -1
- package/dist/lib/chunks/{chunk-EPQHVILQ.js → chunk-MA27TFEY.js} +5 -3
- package/dist/lib/chunks/{chunk-J46W3EMQ.js → chunk-MENTBQGB.js} +8 -7
- package/dist/lib/chunks/chunk-MPJCZN4G.js +155 -0
- package/dist/lib/chunks/{chunk-56VOFZ7T.js → chunk-MTDYBJXH.js} +92 -26
- package/dist/lib/chunks/{chunk-PCYNBDZ7.js → chunk-OD36HUXA.js} +17 -12
- package/dist/lib/chunks/{chunk-WDSCJEDG.js → chunk-OQFAMKLN.js} +11 -11
- package/dist/lib/chunks/{chunk-Z4LMDKBU.js → chunk-PWOYEIPF.js} +4 -4
- package/dist/lib/chunks/{chunk-XL4JIQ5X.js → chunk-PXB4PWJI.js} +7 -3
- package/dist/lib/chunks/{chunk-7ZOJE6BH.js → chunk-QGZ4QSUE.js} +8 -7
- package/dist/lib/chunks/chunk-QJZTDZMB.js +321 -0
- package/dist/lib/chunks/{chunk-MHAKYFDF.js → chunk-R2AJYV6A.js} +22 -22
- package/dist/lib/chunks/{chunk-5B3RNVZ6.js → chunk-RK57YZKM.js} +1 -1
- package/dist/lib/chunks/{chunk-ZXGATMMH.js → chunk-RPTADJXD.js} +1 -1
- package/dist/lib/chunks/{chunk-2NJEWPCV.js → chunk-RXSHKWZJ.js} +3 -3
- package/dist/lib/chunks/chunk-RYCRL3YA.js +106 -0
- package/dist/lib/chunks/{chunk-E3OEE5XN.js → chunk-SD7LR26G.js} +3 -3
- package/dist/lib/chunks/{chunk-GVC4LH2N.js → chunk-SIJOQRRK.js} +1 -1
- package/dist/lib/chunks/{chunk-ZBDUE3A5.js → chunk-SLAPBFRH.js} +12 -7
- package/dist/lib/chunks/{chunk-CKUTDJAB.js → chunk-SMPP7B7F.js} +45 -10
- package/dist/lib/chunks/{chunk-POUSX3T4.js → chunk-SQQ56UP2.js} +15 -6
- package/dist/lib/chunks/{chunk-I3TMFPK4.js → chunk-T5XQ6NXD.js} +6 -4
- package/dist/lib/chunks/{chunk-EYKINDNK.js → chunk-TAPVCSCR.js} +1 -1
- package/dist/lib/chunks/{chunk-ISN6MBNB.js → chunk-U5USH2HB.js} +7 -7
- package/dist/lib/chunks/chunk-U64NCRRR.js +97 -0
- package/dist/lib/chunks/{chunk-D2LPQO6Y.js → chunk-U6BW6LGX.js} +10 -3
- package/dist/lib/chunks/chunk-U772TN32.js +67 -0
- package/dist/lib/chunks/{chunk-XHWRSGX3.js → chunk-UYDQXXDQ.js} +4 -4
- package/dist/lib/chunks/{chunk-CPT2GKKW.js → chunk-V5JJEEBT.js} +1 -1
- package/dist/lib/chunks/{chunk-YWJPJI3W.js → chunk-VL253W5C.js} +3 -1
- package/dist/lib/chunks/{chunk-I7VNIW6Q.js → chunk-VPXYGN4I.js} +86 -15
- package/dist/lib/chunks/{chunk-Z7V63UZA.js → chunk-VXDMOB7O.js} +4 -4
- package/dist/lib/chunks/chunk-W5X7WJYL.js +91 -0
- package/dist/lib/chunks/{chunk-6AUEDSTU.js → chunk-WCLKIPJV.js} +1 -1
- package/dist/lib/chunks/{chunk-QFVRCSJ2.js → chunk-WDOA5JEH.js} +2 -0
- package/dist/lib/chunks/chunk-WDT2Y7D7.js +117 -0
- package/dist/lib/chunks/{chunk-OVUCZLH2.js → chunk-WIBMVNIH.js} +2 -2
- package/dist/lib/chunks/{chunk-5T3V6XJS.js → chunk-WNIXDMJL.js} +1 -1
- package/dist/lib/chunks/{chunk-OORO55OM.js → chunk-WZGI7UVM.js} +23 -8
- package/dist/lib/chunks/{chunk-2GY42RIJ.js → chunk-XAKME6NM.js} +1 -1
- package/dist/lib/chunks/{chunk-Q2PWES4B.js → chunk-XAN4CRFP.js} +33 -41
- package/dist/lib/chunks/{chunk-MIF5IYNR.js → chunk-XDG6NPJB.js} +26 -29
- package/dist/lib/chunks/{chunk-IPNK7FYT.js → chunk-XFUYEFQP.js} +1 -1
- package/dist/lib/chunks/{chunk-OQVIRYT5.js → chunk-XNTFOVCE.js} +2 -2
- package/dist/lib/chunks/chunk-Y2CZ6FZY.js +61 -0
- package/dist/lib/chunks/{chunk-D7GEQVLL.js → chunk-YKJHFD64.js} +1 -1
- package/dist/lib/chunks/chunk-YZEZRQIG.js +194 -0
- package/dist/lib/chunks/chunk-ZIGNJAPC.js +11 -0
- package/dist/lib/chunks/{chunk-5ZITQDVE.js → chunk-ZQ3ER7JD.js} +12 -13
- package/dist/lib/cli/bundle-commands.js +102 -94
- package/dist/lib/cli/guide-command.js +25 -0
- package/dist/lib/cli/io.js +1 -1
- package/dist/lib/cli/run-commands.js +310 -140
- package/dist/lib/cli/status-command.js +236 -0
- package/dist/lib/codex-workflow/aggregate.js +22 -24
- package/dist/lib/codex-workflow/author-search.js +4 -3
- package/dist/lib/codex-workflow/author-tools.js +18 -17
- package/dist/lib/codex-workflow/author.js +39 -36
- package/dist/lib/codex-workflow/capture.js +26 -25
- package/dist/lib/codex-workflow/checkpoint.js +14 -15
- package/dist/lib/codex-workflow/checks.js +16 -18
- 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 +33 -32
- package/dist/lib/codex-workflow/copy-recovery.js +12 -13
- package/dist/lib/codex-workflow/copy.js +30 -29
- package/dist/lib/codex-workflow/finish.js +37 -38
- package/dist/lib/codex-workflow/host-models.js +7 -7
- package/dist/lib/codex-workflow/loop.js +71 -65
- package/dist/lib/codex-workflow/quality.js +12 -13
- package/dist/lib/codex-workflow/run-inputs.js +13 -14
- package/dist/lib/codex-workflow/run-source.js +28 -24
- package/dist/lib/codex-workflow/schemas.js +12 -13
- package/dist/lib/codex-workflow/session.js +15 -16
- package/dist/lib/codex-workflow/stage.js +51 -45
- package/dist/lib/codex-workflow/workdir.js +14 -15
- package/dist/lib/engine/audit-file.js +18 -13
- package/dist/lib/engine/author.js +62 -53
- package/dist/lib/engine/budget.js +7 -1
- package/dist/lib/engine/cost-estimate.js +43 -0
- package/dist/lib/engine/local-run.js +79 -71
- package/dist/lib/engine/preflight.js +17 -13
- package/dist/lib/engine/rejudge.js +87 -79
- package/dist/lib/engine/resources.js +1 -1
- package/dist/lib/engine/run-configuration.js +2 -1
- package/dist/lib/engine/run-status.js +153 -0
- package/dist/lib/engine/templates.js +19 -14
- package/dist/lib/grounding/chromium-guard.js +13 -0
- package/dist/lib/grounding/controller.js +13 -12
- package/dist/lib/grounding/extract.js +12 -11
- package/dist/lib/grounding/fetch.js +4 -7
- package/dist/lib/grounding/file-store.js +5 -5
- package/dist/lib/grounding/grounding-runtime.js +34 -32
- package/dist/lib/grounding/guarded-request.js +18 -0
- package/dist/lib/grounding/model.js +11 -10
- package/dist/lib/grounding/profile.js +4 -4
- package/dist/lib/grounding/recorded-tools.js +18 -17
- package/dist/lib/grounding/session.js +3 -3
- package/dist/lib/grounding/tools.js +4 -3
- package/dist/lib/grounding/validation.js +2 -2
- package/dist/lib/harness/report/artifacts.js +12 -13
- package/dist/lib/harness/report/capture-coverage.js +4 -4
- package/dist/lib/lib/checkpoint.js +11 -12
- package/dist/lib/lib/progress-comparison.js +2 -2
- 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 +21 -21
- package/dist/lib/probes/agent-cli-parsers.js +1 -1
- package/dist/lib/probes/agent-clis.js +13 -12
- package/dist/lib/probes/charged-trace.js +10 -0
- package/dist/lib/probes/probes.js +12 -12
- package/dist/lib/probes/web-tool-guard.js +3 -3
- package/dist/lib/report/contracts.js +4 -4
- package/dist/lib/report/core/progress-comparison.js +2 -2
- package/dist/lib/report/core/progress-schema.js +2 -2
- package/dist/lib/report/core/schema.js +2 -4
- package/dist/lib/report/core/surfaces.js +1 -3
- package/dist/lib/runner.js +25 -26
- package/dist/lib/schema.js +20 -15
- package/dist/lib/section-result.js +15 -17
- package/dist/lib/stores/artifacts.js +18 -19
- package/dist/lib/stores/files.js +32 -32
- package/dist/lib/stores/local-versions.js +11 -12
- package/dist/lib/stores/memory.js +34 -35
- package/dist/lib/stores/publication.js +23 -23
- package/dist/lib/surfaces.js +1 -3
- package/dist/lib/viewer/server.js +38 -39
- package/dist/lib/workflow/schema.js +9 -10
- package/dist/types/agents/author-schema.d.ts +3 -3
- package/dist/types/agents/copy-validation.d.ts +4 -4
- package/dist/types/agents/verifier.d.ts +6 -6
- package/dist/types/analysis/scoring.d.ts +2 -2
- package/dist/types/bundle/contracts.d.ts +3 -2
- 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/checks/crawler-access.d.ts +3 -2
- package/dist/types/checks/renderability.d.ts +8 -1
- 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/author-tools.d.ts +3 -3
- 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 +31 -113
- package/dist/types/codex-workflow/schemas.d.ts +6 -6
- package/dist/types/codex-workflow/stage.d.ts +16 -5
- package/dist/types/engine/audit-file.d.ts +9 -3
- 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 +7 -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/grounding/chromium-guard.d.ts +41 -0
- package/dist/types/grounding/fetch.d.ts +0 -10
- package/dist/types/grounding/guarded-request.d.ts +76 -0
- package/dist/types/harness/report/artifacts.d.ts +1 -0
- package/dist/types/lib/checkpoint.d.ts +5 -6
- 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/pipeline.d.ts +2 -1
- package/dist/types/probes/charged-trace.d.ts +8 -0
- package/dist/types/probes/probe-trace.d.ts +2 -0
- package/dist/types/probes/probes.d.ts +2 -1
- package/dist/types/report/contracts.d.ts +2 -0
- package/dist/types/report/core/schema.d.ts +3 -1
- package/dist/types/report/core/surfaces.d.ts +0 -1
- package/dist/types/schema.d.ts +50 -113
- package/dist/types/section-result.d.ts +1 -1
- package/dist/types/workflow/schema.d.ts +79 -152
- package/package.json +2 -1
- package/resources/guide/OPERATOR.md +189 -0
- package/src/agents/author-schema.ts +13 -1
- package/src/agents/author-validation.ts +2 -5
- package/src/agents/copy-validation.ts +8 -12
- package/src/agents/facts.ts +8 -8
- package/src/agents/narrative-facts.ts +9 -20
- package/src/agents/verifier.ts +12 -16
- package/src/analysis/progress.ts +1 -0
- package/src/analysis/scoring.ts +9 -13
- package/src/bundle/contracts.ts +9 -4
- 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/verify.ts +3 -3
- package/src/bundle/writer-lock.ts +27 -0
- package/src/capture-manifest.ts +4 -0
- package/src/checks/crawler-access.ts +70 -50
- package/src/checks/renderability.ts +113 -87
- package/src/checks/run-checks.ts +16 -3
- 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 +238 -18
- package/src/cli/status-command.ts +113 -0
- package/src/codex-workflow/aggregate.ts +1 -0
- package/src/codex-workflow/author-tools.ts +39 -60
- package/src/codex-workflow/capture.ts +1 -0
- package/src/codex-workflow/codex-binary.ts +105 -0
- package/src/codex-workflow/codex-home.ts +50 -40
- package/src/codex-workflow/copy-editor.ts +3 -3
- 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 +38 -11
- package/src/codex-workflow/stage.ts +126 -17
- package/src/engine/audit-file.ts +98 -9
- 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 +189 -0
- package/src/engine/local-run.ts +38 -8
- package/src/engine/preflight.ts +140 -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/grounding/chromium-guard.ts +273 -0
- package/src/grounding/controller.ts +1 -1
- package/src/grounding/fetch.ts +39 -276
- package/src/grounding/guarded-request.ts +428 -0
- package/src/grounding/tools.ts +2 -1
- package/src/grounding/validation.ts +1 -1
- package/src/lib/checkpoint.ts +15 -16
- 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/pipeline.ts +13 -7
- package/src/probes/agent-clis.ts +26 -5
- package/src/probes/charged-trace.ts +87 -0
- package/src/probes/probe-trace.ts +2 -0
- package/src/probes/probes.ts +72 -12
- package/src/report/core/schema.ts +4 -1
- package/src/report/core/surfaces.ts +4 -8
- package/src/runner.ts +1 -0
- package/src/schema.ts +68 -4
- package/src/section-result.ts +6 -5
- package/dist/lib/chunks/chunk-6EH4N3EU.js +0 -113
- 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/dist/lib/chunks/chunk-SWJ7KQSL.js +0 -318
- package/dist/lib/chunks/chunk-WE2WPNG2.js +0 -104
- package/dist/lib/chunks/{chunk-XI5H46DF.js → chunk-SASE7U6E.js} +3 -3
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# Operating literally-aeo for a user
|
|
2
|
+
|
|
3
|
+
You are an AI agent running an AEO audit on the user's own machine, for a
|
|
4
|
+
user who is usually not a developer. This guide is the protocol. Phrase
|
|
5
|
+
things your own way; never skip a checkpoint, never reorder the paid steps,
|
|
6
|
+
and never spend money the user has not approved as an amount.
|
|
7
|
+
|
|
8
|
+
The engine enforces the cap, not you: every paid run needs `--max-usd`, and
|
|
9
|
+
a run stops (exit 2) before it would cross it. Your job is to get the user's
|
|
10
|
+
informed yes for an amount, then pass exactly that amount.
|
|
11
|
+
|
|
12
|
+
## Rules that hold throughout
|
|
13
|
+
|
|
14
|
+
- **Keys never pass through the chat.** Never ask for a key, password or
|
|
15
|
+
token in the conversation, never print one, never `cat` the `.env` file.
|
|
16
|
+
The user pastes keys into `.env` in their own editor. `literally-aeo
|
|
17
|
+
doctor` reports settings by name and source only; that is all you need.
|
|
18
|
+
- **Consent per system change.** Installing Node or another tool, or
|
|
19
|
+
changing shell configuration, needs the user's yes for that change.
|
|
20
|
+
- **One folder per brand.** Keep everything for a brand under
|
|
21
|
+
`~/literally-aeo/<brand>/` (the `.env`, the brief, `draft/`, `run/`),
|
|
22
|
+
never in Documents or the user's working folders.
|
|
23
|
+
- **Never delete a run directory to start fresh.** Running the same command
|
|
24
|
+
again resumes and reuses every answer already paid for. Deleting it pays
|
|
25
|
+
for them again.
|
|
26
|
+
- **Exit codes:** 0 done; 1 failed (invalid input or an error: read the
|
|
27
|
+
message); 2 stopped and resumable (a missing setting, a failed canary,
|
|
28
|
+
another writer, or the cap); 3 done with disclosed limits.
|
|
29
|
+
- **Machine-readable output:** add `--json` to any command and read stdout.
|
|
30
|
+
Progress goes to stderr.
|
|
31
|
+
- **Disclose untrusted reads.** Tell the user once, plainly: the analysis
|
|
32
|
+
stages run Codex in a sandbox that restricts writes and network access,
|
|
33
|
+
not reads, and the answers and pages it reads are untrusted text. The
|
|
34
|
+
stage prompts treat them as material, never as instructions. On a machine
|
|
35
|
+
holding confidential files, a container is the safer place to run.
|
|
36
|
+
|
|
37
|
+
## Checkpoint 1: install and check
|
|
38
|
+
|
|
39
|
+
1. Check `node --version` (24 or newer). If Node is missing or older, say
|
|
40
|
+
what you would install and how, and do it only on a yes.
|
|
41
|
+
2. `npm install -g literally-aeo`. Codex ships with the package; there is
|
|
42
|
+
nothing else to install for the analysis stages.
|
|
43
|
+
3. `mkdir -p ~/literally-aeo/<brand> && cd ~/literally-aeo/<brand>`, then
|
|
44
|
+
`literally-aeo init`. It writes an example `audit.json` (a fictional
|
|
45
|
+
company: a placeholder for `doctor`, replaced in checkpoint 5) and
|
|
46
|
+
`.env.example`, never over an existing file.
|
|
47
|
+
4. `literally-aeo doctor --json`. Read `checks`: what is missing, the Codex
|
|
48
|
+
binary the engine will run, and which coding-agent CLIs (`claude`,
|
|
49
|
+
`codex`, `cursor-agent`) are installed. `doctor` cannot tell whether a
|
|
50
|
+
CLI is logged in: a run checks that with a canary before any paid work,
|
|
51
|
+
so never tell the user a login works until a run has passed it.
|
|
52
|
+
|
|
53
|
+
## Checkpoint 2: accounts and keys
|
|
54
|
+
|
|
55
|
+
Explain each account in one sentence, what it pays for, and the cheapest
|
|
56
|
+
way to start:
|
|
57
|
+
|
|
58
|
+
- **Vercel AI Gateway** (`AI_GATEWAY_API_KEY`): pays for the assistant
|
|
59
|
+
answers the audit measures and every model call that judges them.
|
|
60
|
+
- **DataForSEO** (`DATAFORSEO_LOGIN`, `DATAFORSEO_PASSWORD`): pays for
|
|
61
|
+
Google AI Overviews, the searches that check the product claims answers
|
|
62
|
+
make, and the research behind the proposed config.
|
|
63
|
+
|
|
64
|
+
Copy `.env.example` to `.env` (`cp .env.example .env`) and ask the user to
|
|
65
|
+
open `.env` in their editor and paste the values. Then run
|
|
66
|
+
`literally-aeo doctor --env-file .env --json` again until every setting the
|
|
67
|
+
run needs reports present.
|
|
68
|
+
|
|
69
|
+
Coding-agent surfaces (Claude Code, Codex, Cursor) are measured with the
|
|
70
|
+
CLI's own login on this machine. They matter most when the buyers are
|
|
71
|
+
developers. If the user cannot or will not set one up, remove it from
|
|
72
|
+
`surfaces` in `audit.json` in checkpoint 5 and tell them it is now out of
|
|
73
|
+
scope for this audit.
|
|
74
|
+
|
|
75
|
+
## Checkpoint 3: the brief
|
|
76
|
+
|
|
77
|
+
Ask, in plain words:
|
|
78
|
+
|
|
79
|
+
- the company name and website;
|
|
80
|
+
- what they want AI assistants to recommend them for;
|
|
81
|
+
- competitors they know (optional);
|
|
82
|
+
- pages that matter most, such as pricing or a product page (optional);
|
|
83
|
+
- anything else worth knowing (optional).
|
|
84
|
+
|
|
85
|
+
Write their answers to `brief.json`:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"companyName": "Acme Files",
|
|
90
|
+
"website": "https://acme.example",
|
|
91
|
+
"desiredRecommendation": "Secure file sharing for regulated teams",
|
|
92
|
+
"competitors": "Rival Drive (rival.example)",
|
|
93
|
+
"moneyPages": "https://acme.example/pricing",
|
|
94
|
+
"notes": ""
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Checkpoint 4: approve the research cost
|
|
99
|
+
|
|
100
|
+
Run `literally-aeo author --brief brief.json --estimate --json` and show the
|
|
101
|
+
estimate. It spends nothing. Only on a yes, run
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
literally-aeo author --brief brief.json --output draft --env-file .env --max-usd <approved amount>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
It researches the company and proposes `draft/audit.json`, with
|
|
108
|
+
`draft/author-record.json` beside it. Keep both files together.
|
|
109
|
+
|
|
110
|
+
## Checkpoint 5: approve the questions
|
|
111
|
+
|
|
112
|
+
Read `draft/audit.json` and present it as a short list, never as JSON: the
|
|
113
|
+
sections, the buyer questions in each, the competitors, and the surfaces
|
|
114
|
+
(the assistants that will be asked). Apply the user's edits to
|
|
115
|
+
`draft/audit.json` yourself. The optional `model` field names the model
|
|
116
|
+
that judges and writes the report; leave it out to use the recommended
|
|
117
|
+
one, which `literally-aeo doctor` lists with every supported model. If the
|
|
118
|
+
user would rather measure fewer questions more deeply, set
|
|
119
|
+
`chatProbes.runsPerPrompt` and `agentProbes.runsPerPrompt` (1 to 25 runs
|
|
120
|
+
of each question per assistant); left out, each question is asked twice
|
|
121
|
+
(once on AI Overviews). Run
|
|
122
|
+
`literally-aeo doctor --config draft/audit.json --env-file .env --json`
|
|
123
|
+
after editing. Money pages must be on the company's site or its
|
|
124
|
+
subdomains; for a page on another host the user owns (a docs site, say),
|
|
125
|
+
add that host to `runPolicy.checkHosts`. With money pages, doctor also
|
|
126
|
+
checks that Chromium launches and, if not, names the command that
|
|
127
|
+
installs it.
|
|
128
|
+
|
|
129
|
+
## Checkpoint 6: approve the audit cost
|
|
130
|
+
|
|
131
|
+
Run `literally-aeo plan --config draft/audit.json --output run --json`.
|
|
132
|
+
Show the estimate's low to high range, what drives it (answers per surface,
|
|
133
|
+
the model), and the categories (`estimate.categories`). Recommend
|
|
134
|
+
`recommendedCapUsd`, the high end, as the cap. Say it is an estimate, not a
|
|
135
|
+
quote. The user's approved amount is the cap.
|
|
136
|
+
|
|
137
|
+
## Checkpoint 7: run and watch
|
|
138
|
+
|
|
139
|
+
Start the run in the background:
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
literally-aeo run --config draft/audit.json --env-file .env --output run --max-usd <approved amount>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
It takes from minutes to hours. Follow it with
|
|
146
|
+
`literally-aeo status run --json`: `phase`, `answers` (captured of planned),
|
|
147
|
+
`spend` (charged against `capUsd`, by category), `lastError`. Poll every few
|
|
148
|
+
minutes, not continuously. Tell the user what changed, briefly.
|
|
149
|
+
|
|
150
|
+
When the process exits:
|
|
151
|
+
|
|
152
|
+
- **0**: done. Go to checkpoint 8.
|
|
153
|
+
- **3**: done with disclosed limits (unjudged answers, a narrative marked
|
|
154
|
+
as needing improvement). Explain the limits in plain words, then go to
|
|
155
|
+
checkpoint 8.
|
|
156
|
+
- **2**: stopped and resumable. Read `literally-aeo status run --json` and
|
|
157
|
+
the stderr message and explain why. If `stoppedAtBudget` is true, the cap
|
|
158
|
+
was reached: show what was spent (`spend`) and what is left to do, and
|
|
159
|
+
ask whether to raise it, to what total. Only on a new yes, run the same
|
|
160
|
+
command with `--max-usd <new total cap>`; the raise is recorded, and the
|
|
161
|
+
answers already paid for are reused. Otherwise fix the cause (a setting,
|
|
162
|
+
a login) and run the same command again; it resumes.
|
|
163
|
+
- **1**: read the error, fix the input if you can, and explain it if you
|
|
164
|
+
cannot. Never delete `run/`.
|
|
165
|
+
|
|
166
|
+
To judge the same answers again with another model, use
|
|
167
|
+
`literally-aeo rejudge run --output run-<model> --model <id> --env-file .env`:
|
|
168
|
+
nothing is asked again, and only the judging is paid for. Without
|
|
169
|
+
`--max-usd` it prints its estimate and spends nothing; show that, get an
|
|
170
|
+
amount approved, and run it again with `--max-usd <approved amount>`. A run
|
|
171
|
+
never changes its own model: editing `model` in `audit.json` over an
|
|
172
|
+
existing run directory is refused.
|
|
173
|
+
|
|
174
|
+
## Checkpoint 8: explain the result
|
|
175
|
+
|
|
176
|
+
Open the report with `literally-aeo view run` (a one-time link on this
|
|
177
|
+
machine only). Summarize: where the brand is mentioned and cited, on which
|
|
178
|
+
assistants, who is recommended instead, and what the report recommends.
|
|
179
|
+
Quote the report; do not add claims it does not make.
|
|
180
|
+
|
|
181
|
+
## Checkpoint 9: keep and share
|
|
182
|
+
|
|
183
|
+
Offer `literally-aeo export run`: a `.aeo.zip` bundle with the captured
|
|
184
|
+
answers, every judgment, the metrics, the report and the journal of every
|
|
185
|
+
operation, which anyone can check offline with `literally-aeo verify` from
|
|
186
|
+
this release or a newer one.
|
|
187
|
+
Credentials found in it block the export. Tell the user the bundle shows
|
|
188
|
+
the questions and the answers, so they should share it only where those can
|
|
189
|
+
be read.
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
aeoAuditConfigSchema,
|
|
4
|
+
aeoSectionConfigSchema,
|
|
5
|
+
agentProbeConfigSchema,
|
|
6
|
+
} from '../schema';
|
|
3
7
|
import { proposedProductFactSchema } from '../grounding/schema';
|
|
4
8
|
|
|
5
9
|
// ============================================================================
|
|
@@ -17,8 +21,16 @@ export const authorOutputSchema = aeoAuditConfigSchema
|
|
|
17
21
|
sourceOverrides: true,
|
|
18
22
|
productGrounding: true,
|
|
19
23
|
competitorQualification: true,
|
|
24
|
+
// Depth decides what a run costs, so the operator sets it in audit.json
|
|
25
|
+
// with the estimate in front of them, never the author.
|
|
26
|
+
chatProbes: true,
|
|
20
27
|
})
|
|
21
28
|
.extend({
|
|
29
|
+
// The agent batch the author could always propose: 1 or 2 runs per
|
|
30
|
+
// prompt. A deeper one is the operator's call, as chat depth is.
|
|
31
|
+
agentProbes: agentProbeConfigSchema
|
|
32
|
+
.extend({ runsPerPrompt: z.number().int().min(1).max(2).default(2) })
|
|
33
|
+
.prefault({}),
|
|
22
34
|
sections: z
|
|
23
35
|
.array(
|
|
24
36
|
aeoSectionConfigSchema.extend({
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { aeoAuditConfigSchema, type AeoAuditConfig } from '../schema';
|
|
2
2
|
import { normalizeDomain } from '../analysis/scoring';
|
|
3
3
|
import banlist from '../author/banlist.json';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
fetchGroundingSource,
|
|
7
|
-
SourceRetrievalError,
|
|
8
|
-
} from '../grounding/fetch';
|
|
4
|
+
import { canonicalResearchUrl, fetchGroundingSource } from '../grounding/fetch';
|
|
5
|
+
import { SourceRetrievalError } from '../grounding/guarded-request';
|
|
9
6
|
import { credentialDetected } from './credentials';
|
|
10
7
|
import {
|
|
11
8
|
authorNotesSchema,
|
|
@@ -10,7 +10,6 @@ import type { GroundingBundle } from '../grounding/schema';
|
|
|
10
10
|
import { validateGroundingBundle } from '../grounding/validation';
|
|
11
11
|
import {
|
|
12
12
|
internalModelRoleDigest,
|
|
13
|
-
resolveInternalModelProfile,
|
|
14
13
|
type InternalModelRoleConfig,
|
|
15
14
|
} from '../models/profiles';
|
|
16
15
|
import { ModelBudgetError } from '../models/accounting';
|
|
@@ -260,7 +259,7 @@ export const validateAgentCopy = async (args: {
|
|
|
260
259
|
runId: string;
|
|
261
260
|
configVersion?: number;
|
|
262
261
|
grounding?: GroundingBundle;
|
|
263
|
-
verifierProfile
|
|
262
|
+
verifierProfile: InternalModelRoleConfig;
|
|
264
263
|
verifier: RecommendationVerifier;
|
|
265
264
|
previous?: AeoReportCopy | null;
|
|
266
265
|
brandLogo?: AeoReportCopy['brandLogo'];
|
|
@@ -343,8 +342,7 @@ export const validateAgentCopy = async (args: {
|
|
|
343
342
|
};
|
|
344
343
|
}
|
|
345
344
|
|
|
346
|
-
const profile =
|
|
347
|
-
args.verifierProfile ?? resolveInternalModelProfile().roles.premiseVerifier;
|
|
345
|
+
const profile = args.verifierProfile;
|
|
348
346
|
let catalog;
|
|
349
347
|
|
|
350
348
|
try {
|
|
@@ -776,7 +774,7 @@ export type CopyFactsUnchangedOptions = {
|
|
|
776
774
|
config: AeoAuditConfig;
|
|
777
775
|
runId: string;
|
|
778
776
|
grounding?: GroundingBundle;
|
|
779
|
-
verifierProfile
|
|
777
|
+
verifierProfile: InternalModelRoleConfig;
|
|
780
778
|
};
|
|
781
779
|
|
|
782
780
|
export const copyFactsUnchanged = (
|
|
@@ -786,7 +784,7 @@ export const copyFactsUnchanged = (
|
|
|
786
784
|
config,
|
|
787
785
|
runId,
|
|
788
786
|
grounding,
|
|
789
|
-
verifierProfile
|
|
787
|
+
verifierProfile,
|
|
790
788
|
}: CopyFactsUnchangedOptions,
|
|
791
789
|
): boolean => {
|
|
792
790
|
const facts = new Map(
|
|
@@ -869,7 +867,7 @@ export const validateHumanCopy = async (args: {
|
|
|
869
867
|
configVersion: number;
|
|
870
868
|
grounding: GroundingBundle;
|
|
871
869
|
verifier: RecommendationVerifier;
|
|
872
|
-
verifierProfile
|
|
870
|
+
verifierProfile: InternalModelRoleConfig;
|
|
873
871
|
secrets?: readonly string[];
|
|
874
872
|
signal?: AbortSignal;
|
|
875
873
|
}): Promise<
|
|
@@ -921,8 +919,7 @@ export const validateHumanCopy = async (args: {
|
|
|
921
919
|
);
|
|
922
920
|
}
|
|
923
921
|
|
|
924
|
-
const profile =
|
|
925
|
-
args.verifierProfile ?? resolveInternalModelProfile().roles.premiseVerifier;
|
|
922
|
+
const profile = args.verifierProfile;
|
|
926
923
|
let facts: ReportFact[];
|
|
927
924
|
|
|
928
925
|
try {
|
|
@@ -1101,7 +1098,7 @@ export const assertCopyValidation = (args: {
|
|
|
1101
1098
|
snapshot: AeoSnapshot;
|
|
1102
1099
|
runId: string;
|
|
1103
1100
|
grounding: unknown;
|
|
1104
|
-
verifierProfile
|
|
1101
|
+
verifierProfile: InternalModelRoleConfig;
|
|
1105
1102
|
}): CopyValidationReceipt => {
|
|
1106
1103
|
const grounding = validateGroundingBundle(args.grounding, {
|
|
1107
1104
|
reportKey: args.config.reportKey,
|
|
@@ -1112,8 +1109,7 @@ export const assertCopyValidation = (args: {
|
|
|
1112
1109
|
const provenance = isStoredProvenance(args.provenance)
|
|
1113
1110
|
? args.provenance
|
|
1114
1111
|
: null;
|
|
1115
|
-
const profile =
|
|
1116
|
-
args.verifierProfile ?? resolveInternalModelProfile().roles.premiseVerifier;
|
|
1112
|
+
const profile = args.verifierProfile;
|
|
1117
1113
|
const verifierPromptVersions: Record<number, number> = {
|
|
1118
1114
|
3: 1,
|
|
1119
1115
|
4: 2,
|
package/src/agents/facts.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
import { canonicalJson } from '../lib/canonical-json';
|
|
3
3
|
import { isDomainCited } from '../analysis/domain-match';
|
|
4
|
+
import { plannedProbeUnitsForSection } from '../lib/checkpoint';
|
|
4
5
|
import type { AeoAuditConfig, AeoSnapshot } from '../schema';
|
|
5
|
-
import { isAgentSurface, surfaceRunCounts } from '../surfaces';
|
|
6
6
|
import type {
|
|
7
7
|
ClaimAssessment,
|
|
8
8
|
ClaimCandidate,
|
|
@@ -129,13 +129,13 @@ export const buildFactCatalog = ({
|
|
|
129
129
|
const rows = section.visibility.matrix.filter(
|
|
130
130
|
(row) => row.surface === surface,
|
|
131
131
|
);
|
|
132
|
-
const count =
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
const count = plannedProbeUnitsForSection({
|
|
133
|
+
sectionKey: section.key,
|
|
134
|
+
prompts: configured.prompts,
|
|
135
|
+
surfaces: [surface],
|
|
136
|
+
agentProbes: config.agentProbes,
|
|
137
|
+
chatProbes: config.chatProbes,
|
|
138
|
+
}).length;
|
|
139
139
|
|
|
140
140
|
for (const metric of ['mentions', 'citations'] as const) {
|
|
141
141
|
const numerator = rows.filter((row) =>
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
+
import { plannedProbeUnitsForSection } from '../lib/checkpoint';
|
|
1
2
|
import type { AeoAuditConfig, AeoSnapshot, AeoSurface } from '../schema';
|
|
2
|
-
import {
|
|
3
|
-
allSurfaces,
|
|
4
|
-
isAgentSurface,
|
|
5
|
-
surfaceLabels,
|
|
6
|
-
surfaceRunCounts,
|
|
7
|
-
} from '../surfaces';
|
|
3
|
+
import { allSurfaces, isAgentSurface, surfaceLabels } from '../surfaces';
|
|
8
4
|
import type { ReportFact } from './facts';
|
|
9
5
|
import { pendingReportCopy } from './copy-schema';
|
|
10
6
|
|
|
@@ -110,16 +106,6 @@ export const buildNarrativeFacts = (
|
|
|
110
106
|
unit: 'count',
|
|
111
107
|
sentence: `This audit tested ${config.brand.name} in the ${market} section using these questions: ${JSON.stringify(configured.prompts.map(({ text }) => text))}. These are the configured audit questions, not measured search demand or verified customer conversations. Locale: ${config.geography}, language: ${config.language}.`,
|
|
112
108
|
});
|
|
113
|
-
const planned = (surface: AeoSurface) => {
|
|
114
|
-
return isAgentSurface(surface)
|
|
115
|
-
? Math.min(
|
|
116
|
-
configured.prompts.length,
|
|
117
|
-
config.agentProbes.maxPromptsPerSection ??
|
|
118
|
-
configured.prompts.length,
|
|
119
|
-
) * config.agentProbes.runsPerPrompt
|
|
120
|
-
: configured.prompts.length * surfaceRunCounts[surface];
|
|
121
|
-
};
|
|
122
|
-
|
|
123
109
|
for (const group of ['chat', 'agents'] as const) {
|
|
124
110
|
const surfaces = section.visibility.surfaces.filter(
|
|
125
111
|
(surface) => isAgentSurface(surface) === (group === 'agents'),
|
|
@@ -132,10 +118,13 @@ export const buildNarrativeFacts = (
|
|
|
132
118
|
const rows = section.visibility.matrix.filter((row) =>
|
|
133
119
|
surfaces.includes(row.surface),
|
|
134
120
|
);
|
|
135
|
-
const denominator =
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
121
|
+
const denominator = plannedProbeUnitsForSection({
|
|
122
|
+
sectionKey: section.key,
|
|
123
|
+
prompts: configured.prompts,
|
|
124
|
+
surfaces,
|
|
125
|
+
agentProbes: config.agentProbes,
|
|
126
|
+
chatProbes: config.chatProbes,
|
|
127
|
+
}).length;
|
|
139
128
|
const names =
|
|
140
129
|
group === 'agents' ? 'coding agents' : 'chat and search assistants';
|
|
141
130
|
const entities = [
|
package/src/agents/verifier.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { ModelCallAccounting } from '../models/accounting';
|
|
3
3
|
import type { GroundingSource } from '../grounding/schema';
|
|
4
|
-
import {
|
|
5
|
-
resolveInternalModelProfile,
|
|
6
|
-
type InternalModelRoleConfig,
|
|
7
|
-
} from '../models/profiles';
|
|
4
|
+
import type { InternalModelRoleConfig } from '../models/profiles';
|
|
8
5
|
import {
|
|
9
6
|
generateStructured,
|
|
10
7
|
structuredCallReservation,
|
|
@@ -25,9 +22,9 @@ const verdictSchema = z
|
|
|
25
22
|
path: z.string(),
|
|
26
23
|
/** The verdict itself. The premise findings and the flag must
|
|
27
24
|
* agree, and only the flag lets `errors` reject a block: a
|
|
28
|
-
* passing review may still carry stray text there
|
|
29
|
-
*
|
|
30
|
-
*
|
|
25
|
+
* passing review may still carry stray text there: a measured
|
|
26
|
+
* model wrote "None found." and "none" into `errors` for blocks
|
|
27
|
+
* it had approved, and each cost a copy generation. */
|
|
31
28
|
passed: z.boolean(),
|
|
32
29
|
allPremisesCovered: z.boolean(),
|
|
33
30
|
actionAppropriate: z.boolean(),
|
|
@@ -315,14 +312,14 @@ export const checkPremiseVerdicts = (
|
|
|
315
312
|
// A declared premise judged on a related fact rather than the one
|
|
316
313
|
// the writer cited is not refused: the verdict is what matters, the
|
|
317
314
|
// receipt keeps the verifier's own basis, and refusing it cost three
|
|
318
|
-
// of seven verifications
|
|
315
|
+
// of seven verifications in a measured run for nothing.
|
|
319
316
|
}
|
|
320
317
|
|
|
321
318
|
// The premise findings are the evidence; the block flag follows them. A
|
|
322
319
|
// pass over an unsupported premise is a failed block with that finding,
|
|
323
320
|
// which the verifier's own edit then repairs: refusing it as an invalid
|
|
324
|
-
// review sent
|
|
325
|
-
// failed the pipeline
|
|
321
|
+
// review once sent a run's copy pass round the same review six times
|
|
322
|
+
// and failed the pipeline. A failure that names nothing is
|
|
326
323
|
// still a verdict the host cannot act on. A pass with stray text in
|
|
327
324
|
// `errors` is a pass.
|
|
328
325
|
if (!review.passed && !blockRejections.size) {
|
|
@@ -344,12 +341,11 @@ export const checkPremiseVerdicts = (
|
|
|
344
341
|
|
|
345
342
|
export const createRecommendationVerifier = (args: {
|
|
346
343
|
accounting: ModelCallAccounting;
|
|
347
|
-
profile
|
|
344
|
+
profile: InternalModelRoleConfig;
|
|
348
345
|
transport?: StructuredTransport;
|
|
349
346
|
memory?: VerifierMemory;
|
|
350
347
|
}): RecommendationVerifier => {
|
|
351
|
-
const profile =
|
|
352
|
-
args.profile ?? resolveInternalModelProfile().roles.premiseVerifier;
|
|
348
|
+
const { profile } = args;
|
|
353
349
|
|
|
354
350
|
return async (requested, signal) => {
|
|
355
351
|
const history = (await args.memory?.read()) ?? {};
|
|
@@ -530,9 +526,9 @@ export const createRecommendationVerifier = (args: {
|
|
|
530
526
|
* the caller can classify it.
|
|
531
527
|
*
|
|
532
528
|
* Fitting the input limit is not enough on its own for a reasoning model.
|
|
533
|
-
* Measured
|
|
534
|
-
* thinking past 40,960 output tokens without returning a verdict,
|
|
535
|
-
* billed for all of it. What bounds the call is how many judgements it
|
|
529
|
+
* Measured: packing every block that fit into one call left a reasoning
|
|
530
|
+
* model thinking past 40,960 output tokens without returning a verdict,
|
|
531
|
+
* having been billed for all of it. What bounds the call is how many judgements it
|
|
536
532
|
* contains, not how many bytes.
|
|
537
533
|
*/
|
|
538
534
|
export const verifierChunks = (
|
package/src/analysis/progress.ts
CHANGED
package/src/analysis/scoring.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { normalizeDomain } from '../report/core/normalize-domain';
|
|
2
|
-
import type
|
|
3
|
-
import { surfaceRunCounts, plannedRunsPerPrompt } from '../surfaces';
|
|
2
|
+
import { runsPerPromptOn, type AeoSurface, type ProbeDepth } from '../schema';
|
|
4
3
|
|
|
5
4
|
// ============================================================================
|
|
6
5
|
// Scorecard aggregation (ported from the console's intelligence/scoring.ts).
|
|
@@ -62,19 +61,17 @@ export const computeAISearchSummary = (args: {
|
|
|
62
61
|
prompts: PromptForScoring[];
|
|
63
62
|
results: AnalyzedProbeForScoring[];
|
|
64
63
|
surfaces: readonly AeoSurface[];
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
// surface; omit for the canonical surfaceRunCounts denominators.
|
|
68
|
-
runsPerSurface?: number;
|
|
64
|
+
// The configured depth the plan asked each prompt at.
|
|
65
|
+
depth: ProbeDepth;
|
|
69
66
|
}): ScoringSummary => {
|
|
70
|
-
const { competitorDomains, prompts, results, surfaces } = args;
|
|
67
|
+
const { competitorDomains, prompts, results, surfaces, depth } = args;
|
|
71
68
|
|
|
72
69
|
// Probe planning: total probes attempted = prompts × (sum of runs across
|
|
73
70
|
// the scoped surfaces). Failures lower share of voice instead of hiding.
|
|
74
|
-
const totalRunsPerPrompt =
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
const totalRunsPerPrompt = surfaces.reduce(
|
|
72
|
+
(sum, surface) => sum + runsPerPromptOn(surface, depth),
|
|
73
|
+
0,
|
|
74
|
+
);
|
|
78
75
|
const totalPrompts = prompts.length * totalRunsPerPrompt;
|
|
79
76
|
|
|
80
77
|
const mentioned = results.filter((r) => r.clientMentioned).length;
|
|
@@ -89,8 +86,7 @@ export const computeAISearchSummary = (args: {
|
|
|
89
86
|
|
|
90
87
|
for (const surface of surfaces) {
|
|
91
88
|
const modelResults = results.filter((r) => r.model === surface);
|
|
92
|
-
const
|
|
93
|
-
const total = prompts.length * runsPerPrompt;
|
|
89
|
+
const total = prompts.length * runsPerPromptOn(surface, depth);
|
|
94
90
|
|
|
95
91
|
byModel[surface] = {
|
|
96
92
|
sov:
|
package/src/bundle/contracts.ts
CHANGED
|
@@ -11,10 +11,15 @@ import { canonicalDigest } from './json';
|
|
|
11
11
|
// ============================================================================
|
|
12
12
|
|
|
13
13
|
export const toolId = 'literally-aeo';
|
|
14
|
-
// The
|
|
15
|
-
//
|
|
16
|
-
export const toolVersion = '0.
|
|
17
|
-
|
|
14
|
+
// The package version, recorded in every journal and bundle; the build and
|
|
15
|
+
// version.spec.ts refuse a mismatch with package.json.
|
|
16
|
+
export const toolVersion = '0.2.1';
|
|
17
|
+
// Version 2: config.json may set chatProbes, and agentProbes.runsPerPrompt
|
|
18
|
+
// above 2. A verifier that reads only version 1 then refuses the bundle as
|
|
19
|
+
// unsupported instead of dropping its depth and failing it.
|
|
20
|
+
export const bundleSchemaVersion = 2;
|
|
21
|
+
// A version 1 bundle reads as version 2 at the standard depth.
|
|
22
|
+
export const readableBundleSchemaVersions: readonly number[] = [1, 2];
|
|
18
23
|
export const traceSchemaVersion = 1;
|
|
19
24
|
export const canonicalization = 'literally-aeo-canonical-json-v1';
|
|
20
25
|
// Bump when the arithmetic the verifier recomputes changes
|