literally-aeo 0.2.0 → 0.2.2
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 +29 -1
- package/dist/author-tools.js +479 -397
- package/dist/cli.mjs +808 -386
- package/dist/lib/access/schema.js +6 -6
- package/dist/lib/agents/author-schema.js +10 -10
- package/dist/lib/agents/author-validation.js +20 -18
- package/dist/lib/agents/copy-validation.js +22 -21
- package/dist/lib/agents/copywriter-input.js +23 -8
- package/dist/lib/agents/facts.js +22 -7
- package/dist/lib/agents/narrative-facts.js +20 -2
- package/dist/lib/agents/verifier.js +25 -24
- package/dist/lib/analysis/domain-classifier.js +19 -20
- package/dist/lib/analysis/domain-labels.js +10 -10
- package/dist/lib/analysis/progress-schema.js +2 -2
- package/dist/lib/analysis/progress.js +18 -19
- 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 +16 -17
- package/dist/lib/author/examples.js +11 -11
- package/dist/lib/bundle/contracts.js +14 -12
- package/dist/lib/bundle/export.js +27 -27
- package/dist/lib/bundle/isolation.js +2 -2
- package/dist/lib/bundle/journal.js +13 -13
- package/dist/lib/bundle/project-journal.js +17 -17
- package/dist/lib/bundle/project.js +25 -25
- package/dist/lib/bundle/read.js +28 -28
- package/dist/lib/bundle/recorder.js +15 -15
- package/dist/lib/bundle/redact.js +13 -13
- package/dist/lib/bundle/trace-coverage.js +13 -13
- package/dist/lib/bundle/verify-integrity.js +15 -15
- package/dist/lib/bundle/verify-measurement.js +21 -21
- package/dist/lib/bundle/verify-report.js +29 -29
- package/dist/lib/bundle/verify.js +37 -37
- package/dist/lib/capture-manifest.js +12 -12
- package/dist/lib/checks/crawler-access.js +4 -1
- package/dist/lib/checks/money-pages.js +13 -0
- package/dist/lib/checks/renderability.js +5 -1
- package/dist/lib/checks/run-checks.js +21 -18
- package/dist/lib/chunks/{chunk-BSRKN6FU.js → chunk-2FOKEIIN.js} +1 -1
- package/dist/lib/chunks/{chunk-JXMDOAKA.js → chunk-2KH7LNK7.js} +11 -11
- package/dist/lib/chunks/{chunk-D3GE3OCB.js → chunk-3CMPR6ZZ.js} +1 -1
- package/dist/lib/chunks/{chunk-TJQ5OPLQ.js → chunk-3OE4UQIB.js} +7 -7
- package/dist/lib/chunks/{chunk-Y4OGZ3Q5.js → chunk-46PVVQYR.js} +1 -1
- package/dist/lib/chunks/{chunk-OU73OUX4.js → chunk-4GLW3ZRO.js} +67 -7
- 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-FFOVLI3U.js → chunk-66T7JC57.js} +12 -10
- package/dist/lib/chunks/{chunk-IE7NAL6B.js → chunk-6HMHXSCS.js} +2 -2
- package/dist/lib/chunks/chunk-75DMLOQ7.js +127 -0
- package/dist/lib/chunks/{chunk-6G25V4CF.js → chunk-7CW6U5WJ.js} +1 -1
- package/dist/lib/chunks/{chunk-CUYVHXHI.js → chunk-7DNLRXEY.js} +3 -3
- package/dist/lib/chunks/{chunk-622NMXN6.js → chunk-7HM6IZ3L.js} +2 -2
- package/dist/lib/chunks/{chunk-F4W5YHDZ.js → chunk-7WO3FFPS.js} +2 -2
- package/dist/lib/chunks/{chunk-ULRXHSJL.js → chunk-7YDXD4MD.js} +9 -6
- package/dist/lib/chunks/{chunk-UEMZYHYJ.js → chunk-7YZPEX3T.js} +2 -2
- package/dist/lib/chunks/{chunk-OBXAHX3L.js → chunk-AASWJR7Q.js} +1 -5
- package/dist/lib/chunks/{chunk-NCXSNHXX.js → chunk-AJO7XVXK.js} +12 -12
- package/dist/lib/chunks/{chunk-2GU6CNQI.js → chunk-AT3XMGES.js} +5 -5
- package/dist/lib/chunks/{chunk-MNWO7EHC.js → chunk-BFWK3TBN.js} +2 -2
- package/dist/lib/chunks/{chunk-BGOIPHJZ.js → chunk-BGAHZIL3.js} +18 -12
- package/dist/lib/chunks/{chunk-ZCOI3HE2.js → chunk-BRENK356.js} +1 -1
- package/dist/lib/chunks/{chunk-KJMU5KH4.js → chunk-BXF4OC74.js} +18 -9
- package/dist/lib/chunks/{chunk-5JPYM4MD.js → chunk-BYHXNFWN.js} +1 -1
- package/dist/lib/chunks/{chunk-NCLFZOZU.js → chunk-CH7OCYDL.js} +1 -1
- package/dist/lib/chunks/{chunk-OKL7GN2F.js → chunk-DL6YQDTE.js} +31 -5
- package/dist/lib/chunks/{chunk-PDS5KWO3.js → chunk-E2YTTB6Q.js} +56 -42
- package/dist/lib/chunks/{chunk-SDWYZM64.js → chunk-EDQTINTL.js} +5 -1
- package/dist/lib/chunks/{chunk-4PD65FRJ.js → chunk-EOO5RBUW.js} +3 -3
- 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-BLKLPUYR.js → chunk-F7DBTXKG.js} +6 -6
- package/dist/lib/chunks/{chunk-EE26FNSY.js → chunk-FDM2YNQL.js} +1 -1
- package/dist/lib/chunks/{chunk-RJ5R6YYA.js → chunk-FJL2V6P5.js} +6 -6
- package/dist/lib/chunks/chunk-FK2JQHAX.js +30 -0
- package/dist/lib/chunks/{chunk-QHUDJVPJ.js → chunk-GLUGYZQO.js} +7 -7
- package/dist/lib/chunks/{chunk-GNMFJ2OK.js → chunk-HCUJ2J7P.js} +8 -8
- package/dist/lib/chunks/{chunk-2ROXN2EC.js → chunk-HGGOGCPX.js} +10 -10
- package/dist/lib/chunks/{chunk-VPZQGND4.js → chunk-HGGRPOSA.js} +3 -3
- package/dist/lib/chunks/{chunk-EJ655TVU.js → chunk-I3UE52ZV.js} +2 -2
- package/dist/lib/chunks/{chunk-ML4W6KC6.js → chunk-J5NPHPXY.js} +5 -4
- package/dist/lib/chunks/{chunk-HFRAHG5C.js → chunk-J7QKT5E7.js} +17 -17
- package/dist/lib/chunks/{chunk-V7OAPKNF.js → chunk-JBOOD6MU.js} +10 -9
- package/dist/lib/chunks/{chunk-YAAUWCJ4.js → chunk-JKPBXPCW.js} +3 -3
- package/dist/lib/chunks/{chunk-5HT55QYX.js → chunk-JQDQVG3D.js} +1 -1
- package/dist/lib/chunks/{chunk-GESHTTSA.js → chunk-JYCVBFH5.js} +2 -2
- package/dist/lib/chunks/{chunk-W2VGLWTS.js → chunk-K2FZFESR.js} +10 -10
- 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-EBUQPCKB.js → chunk-KFAT65P7.js} +1 -1
- package/dist/lib/chunks/{chunk-ZYSPTOKK.js → chunk-KQCRJIEG.js} +1 -1
- package/dist/lib/chunks/{chunk-R6XDZWUL.js → chunk-LR27H2HZ.js} +11 -11
- package/dist/lib/chunks/{chunk-FUAUPNRO.js → chunk-LTCDLURT.js} +7 -7
- 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-UZJSTJFP.js → chunk-MENTBQGB.js} +6 -5
- package/dist/lib/chunks/chunk-MPJCZN4G.js +155 -0
- package/dist/lib/chunks/{chunk-BE4ENGUY.js → chunk-OOLWU667.js} +6 -6
- package/dist/lib/chunks/{chunk-QSJ4IKUF.js → chunk-PIF3GL62.js} +5 -5
- package/dist/lib/chunks/{chunk-W5X7WJYL.js → chunk-PIFTG6YW.js} +3 -3
- package/dist/lib/chunks/{chunk-YRBIC5QH.js → chunk-PKNODC6Y.js} +1 -1
- package/dist/lib/chunks/{chunk-SHUMCKCS.js → chunk-PWOYEIPF.js} +4 -4
- package/dist/lib/chunks/{chunk-RR46EDDR.js → chunk-QD3JXA3Y.js} +25 -25
- package/dist/lib/chunks/{chunk-7ZOJE6BH.js → chunk-QGZ4QSUE.js} +8 -7
- package/dist/lib/chunks/{chunk-D2INDP5W.js → chunk-R5UPOEWE.js} +9 -8
- package/dist/lib/chunks/{chunk-VKM6MMA4.js → chunk-RIJERFGU.js} +34 -3
- package/dist/lib/chunks/{chunk-5B3RNVZ6.js → chunk-RK57YZKM.js} +1 -1
- package/dist/lib/chunks/{chunk-GDKGZQ3T.js → chunk-RXSHKWZJ.js} +3 -3
- package/dist/lib/chunks/{chunk-NGHAP2P5.js → chunk-S6QOXJAL.js} +4 -4
- package/dist/lib/chunks/{chunk-6GHHNPFJ.js → chunk-SIJOQRRK.js} +1 -1
- package/dist/lib/chunks/{chunk-663HABKP.js → chunk-T6XZQOXS.js} +8 -8
- 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-MRL5RUP7.js → chunk-U6BW6LGX.js} +10 -3
- package/dist/lib/chunks/{chunk-L7MEIRJB.js → chunk-UNCUG2YS.js} +15 -6
- package/dist/lib/chunks/{chunk-3JO5TXBA.js → chunk-UYDQXXDQ.js} +4 -4
- package/dist/lib/chunks/{chunk-LOBXOZ2R.js → chunk-V5JJEEBT.js} +1 -1
- package/dist/lib/chunks/{chunk-XR44YSHT.js → chunk-VHKHYAC5.js} +30 -9
- package/dist/lib/chunks/{chunk-Z7V63UZA.js → chunk-VXDMOB7O.js} +4 -4
- package/dist/lib/chunks/{chunk-G62E525I.js → chunk-VXYQWE45.js} +2 -2
- package/dist/lib/chunks/{chunk-W5DC23OP.js → chunk-WCLKIPJV.js} +1 -1
- package/dist/lib/chunks/{chunk-7XO3SQAX.js → chunk-WDT2Y7D7.js} +1 -1
- 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-HTOD4W4E.js → chunk-WZGI7UVM.js} +2 -2
- package/dist/lib/chunks/{chunk-HQG63ZKO.js → chunk-XA27KAUV.js} +17 -17
- package/dist/lib/chunks/{chunk-I3XGRGXE.js → chunk-XAN4CRFP.js} +33 -41
- package/dist/lib/chunks/{chunk-AYY4MYTW.js → chunk-XFUYEFQP.js} +1 -1
- package/dist/lib/chunks/{chunk-FOCJ7HPC.js → chunk-XSER7WEB.js} +11 -11
- package/dist/lib/chunks/{chunk-WVACVWBL.js → chunk-YEUCAPKP.js} +6 -4
- package/dist/lib/chunks/{chunk-7Z27HQWL.js → chunk-YGLWQFKL.js} +3 -3
- package/dist/lib/chunks/{chunk-D7GEQVLL.js → chunk-YKJHFD64.js} +1 -1
- package/dist/lib/chunks/{chunk-OQU5IXAJ.js → chunk-ZOGIJGU3.js} +10 -10
- package/dist/lib/chunks/{chunk-5ZITQDVE.js → chunk-ZQ3ER7JD.js} +12 -13
- package/dist/lib/cli/bundle-commands.js +91 -88
- package/dist/lib/cli/run-commands.js +110 -105
- package/dist/lib/cli/status-command.js +77 -74
- package/dist/lib/codex-workflow/aggregate.js +21 -22
- package/dist/lib/codex-workflow/author-search.js +4 -3
- package/dist/lib/codex-workflow/author-tools.js +17 -15
- package/dist/lib/codex-workflow/author.js +38 -34
- package/dist/lib/codex-workflow/capture.js +25 -25
- package/dist/lib/codex-workflow/checkpoint.js +13 -13
- package/dist/lib/codex-workflow/checks.js +15 -16
- package/dist/lib/codex-workflow/copy-editor.js +31 -30
- package/dist/lib/codex-workflow/copy-recovery.js +11 -11
- package/dist/lib/codex-workflow/copy.js +28 -27
- package/dist/lib/codex-workflow/finish.js +34 -34
- package/dist/lib/codex-workflow/loop.js +65 -62
- package/dist/lib/codex-workflow/quality.js +11 -11
- package/dist/lib/codex-workflow/run-inputs.js +12 -12
- package/dist/lib/codex-workflow/run-source.js +26 -23
- package/dist/lib/codex-workflow/schemas.js +11 -11
- package/dist/lib/codex-workflow/session.js +14 -14
- package/dist/lib/codex-workflow/stage.js +45 -41
- package/dist/lib/codex-workflow/workdir.js +13 -13
- package/dist/lib/engine/audit-file.js +16 -11
- package/dist/lib/engine/author.js +53 -49
- package/dist/lib/engine/cost-estimate.js +18 -16
- package/dist/lib/engine/local-run.js +76 -73
- package/dist/lib/engine/preflight.js +12 -12
- package/dist/lib/engine/rejudge.js +82 -79
- package/dist/lib/engine/run-status.js +77 -74
- package/dist/lib/engine/templates.js +17 -12
- package/dist/lib/grounding/chromium-guard.js +13 -0
- package/dist/lib/grounding/controller.js +11 -10
- package/dist/lib/grounding/extract.js +10 -9
- package/dist/lib/grounding/fetch.js +4 -7
- package/dist/lib/grounding/file-store.js +5 -5
- package/dist/lib/grounding/grounding-runtime.js +32 -31
- package/dist/lib/grounding/guarded-request.js +18 -0
- package/dist/lib/grounding/model.js +9 -8
- package/dist/lib/grounding/profile.js +4 -4
- package/dist/lib/grounding/recorded-tools.js +16 -16
- 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 +11 -11
- package/dist/lib/harness/report/capture-coverage.js +4 -4
- package/dist/lib/lib/checkpoint.js +10 -10
- package/dist/lib/lib/progress-comparison.js +2 -2
- package/dist/lib/models/batching.js +3 -3
- package/dist/lib/models/structured.js +2 -2
- package/dist/lib/models/supported-models.js +1 -1
- package/dist/lib/pipeline.js +20 -21
- package/dist/lib/probes/agent-clis.js +10 -10
- 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 +23 -24
- package/dist/lib/schema.js +19 -13
- package/dist/lib/section-result.js +14 -15
- package/dist/lib/stores/artifacts.js +17 -17
- package/dist/lib/stores/files.js +31 -31
- package/dist/lib/stores/local-versions.js +10 -10
- package/dist/lib/stores/memory.js +33 -33
- package/dist/lib/stores/publication.js +23 -22
- package/dist/lib/surfaces.js +1 -3
- package/dist/lib/viewer/server.js +38 -38
- package/dist/lib/workflow/schema.js +8 -8
- package/dist/types/agents/author-schema.d.ts +3 -3
- package/dist/types/analysis/scoring.d.ts +2 -2
- package/dist/types/bundle/contracts.d.ts +3 -2
- package/dist/types/checks/crawler-access.d.ts +3 -2
- package/dist/types/checks/money-pages.d.ts +19 -0
- package/dist/types/checks/renderability.d.ts +8 -1
- package/dist/types/codex-workflow/author-tools.d.ts +3 -3
- package/dist/types/codex-workflow/run-inputs.d.ts +3 -0
- package/dist/types/codex-workflow/schemas.d.ts +6 -6
- package/dist/types/engine/audit-file.d.ts +6 -1
- package/dist/types/engine/preflight.d.ts +2 -0
- 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/pipeline.d.ts +2 -1
- 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 +22 -0
- package/dist/types/section-result.d.ts +1 -1
- package/package.json +1 -1
- package/resources/guide/OPERATOR.md +12 -3
- package/src/agents/author-schema.ts +13 -1
- package/src/agents/author-validation.ts +24 -6
- package/src/agents/facts.ts +8 -8
- package/src/agents/narrative-facts.ts +9 -20
- package/src/agents/verifier.ts +2 -2
- package/src/analysis/progress.ts +1 -0
- package/src/analysis/scoring.ts +9 -13
- package/src/bundle/contracts.ts +7 -2
- package/src/bundle/verify.ts +3 -3
- package/src/capture-manifest.ts +4 -0
- package/src/checks/crawler-access.ts +70 -50
- package/src/checks/money-pages.ts +48 -0
- package/src/checks/renderability.ts +113 -87
- package/src/checks/run-checks.ts +16 -3
- package/src/cli/run-commands.ts +2 -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/copy-editor.ts +3 -3
- package/src/codex-workflow/loop.ts +2 -2
- package/src/engine/audit-file.ts +79 -2
- package/src/engine/guide/OPERATOR.md +12 -3
- package/src/engine/preflight.ts +50 -0
- 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/supported-models.ts +3 -3
- package/src/pipeline.ts +13 -7
- package/src/probes/agent-clis.ts +2 -3
- package/src/probes/probes.ts +24 -10
- 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-SWJ7KQSL.js +0 -318
- package/dist/lib/chunks/{chunk-CO5T6WU5.js → chunk-OD36HUXA.js} +3 -3
- package/dist/lib/chunks/{chunk-XI5H46DF.js → chunk-SASE7U6E.js} +3 -3
package/src/checks/run-checks.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { recorded, type ExecutionRecorder } from '../bundle/recorder';
|
|
2
|
+
import {
|
|
3
|
+
createHostPacer,
|
|
4
|
+
guardedRequest,
|
|
5
|
+
type SiteRequest,
|
|
6
|
+
} from '../grounding/guarded-request';
|
|
2
7
|
import type { AeoAuditConfig, AeoTechnicalChecks } from '../schema';
|
|
3
8
|
import type { PartialFailure } from '../probes/web-tool-guard';
|
|
4
9
|
import { checkLlmsTxt, runCrawlerAccessCheck } from './crawler-access';
|
|
@@ -11,6 +16,10 @@ import { runRenderabilityCheck } from './renderability';
|
|
|
11
16
|
// run with a stub — checks are live fetches and a Playwright browser.
|
|
12
17
|
// ============================================================================
|
|
13
18
|
|
|
19
|
+
// At most one request at a time per host, this far apart, across every check
|
|
20
|
+
// of the phase (specs/aeo-checks-and-reach-spec.md §3.1).
|
|
21
|
+
const hostIntervalInMs = 1000;
|
|
22
|
+
|
|
14
23
|
export type CheckPhaseResult = {
|
|
15
24
|
checks: AeoTechnicalChecks;
|
|
16
25
|
failures: PartialFailure[];
|
|
@@ -21,6 +30,10 @@ export const runTechnicalChecks = async (
|
|
|
21
30
|
recorder?: ExecutionRecorder,
|
|
22
31
|
): Promise<CheckPhaseResult> => {
|
|
23
32
|
const failures: PartialFailure[] = [];
|
|
33
|
+
const pace = createHostPacer(hostIntervalInMs);
|
|
34
|
+
const request: SiteRequest = (options) => {
|
|
35
|
+
return guardedRequest({ ...options, pace });
|
|
36
|
+
};
|
|
24
37
|
|
|
25
38
|
// One operation per check, with its parameters and its extracted result
|
|
26
39
|
// (spec §7.2). The checks' own HTTP requests and raw bodies stay inside
|
|
@@ -52,13 +65,13 @@ export const runTechnicalChecks = async (
|
|
|
52
65
|
|
|
53
66
|
const [crawlerAccess, llmsTxt, renderability] = await Promise.all([
|
|
54
67
|
check('crawler_access', { domain: config.brand.domain }, () =>
|
|
55
|
-
runCrawlerAccessCheck(config.brand.domain),
|
|
68
|
+
runCrawlerAccessCheck(config.brand.domain, request),
|
|
56
69
|
),
|
|
57
70
|
check('llms_txt', { domain: config.brand.domain }, () =>
|
|
58
|
-
checkLlmsTxt(config.brand.domain),
|
|
71
|
+
checkLlmsTxt(config.brand.domain, request),
|
|
59
72
|
),
|
|
60
73
|
check('renderability', { moneyPages: config.moneyPages }, () =>
|
|
61
|
-
runRenderabilityCheck(config.moneyPages),
|
|
74
|
+
runRenderabilityCheck(config.moneyPages, { request, pace }),
|
|
62
75
|
),
|
|
63
76
|
]);
|
|
64
77
|
|
package/src/cli/run-commands.ts
CHANGED
|
@@ -174,6 +174,7 @@ export const runDoctor = async (flags: Flags) => {
|
|
|
174
174
|
dir: runDirOf(flags),
|
|
175
175
|
model: file.model,
|
|
176
176
|
groundingSearch: usesGroundingSearch(request),
|
|
177
|
+
rendersPages: file.moneyPages.length > 0,
|
|
177
178
|
});
|
|
178
179
|
const ok = checks.every((check) => check.ok);
|
|
179
180
|
|
|
@@ -307,6 +308,7 @@ export const runRun = async (flags: Flags) => {
|
|
|
307
308
|
dir,
|
|
308
309
|
model: file.model,
|
|
309
310
|
groundingSearch: usesGroundingSearch(request),
|
|
311
|
+
rendersPages: file.moneyPages.length > 0,
|
|
310
312
|
});
|
|
311
313
|
const failing = checks.filter((check) => !check.ok);
|
|
312
314
|
|
|
@@ -7,9 +7,16 @@ import {
|
|
|
7
7
|
canonicalResearchUrl,
|
|
8
8
|
extractSourceDocument,
|
|
9
9
|
fetchGroundingSource,
|
|
10
|
+
} from '../grounding/fetch';
|
|
11
|
+
import {
|
|
12
|
+
resolvePublicAddress,
|
|
10
13
|
SourceRetrievalError,
|
|
11
14
|
validateResearchUrl,
|
|
12
|
-
} from '../grounding/
|
|
15
|
+
} from '../grounding/guarded-request';
|
|
16
|
+
import {
|
|
17
|
+
withBoundedPage,
|
|
18
|
+
withGuardedChromium,
|
|
19
|
+
} from '../grounding/chromium-guard';
|
|
13
20
|
import {
|
|
14
21
|
groundingSourceSchema,
|
|
15
22
|
type GroundingSource,
|
|
@@ -987,70 +994,42 @@ export const createAuthorTools = (options: AuthorToolsOptions): AuthorTools => {
|
|
|
987
994
|
};
|
|
988
995
|
|
|
989
996
|
/** Rendered HTML for a public page through the Chromium the image already
|
|
990
|
-
* carries for the renderability check.
|
|
991
|
-
*
|
|
992
|
-
*
|
|
997
|
+
* carries for the renderability check. Every connection the browser makes
|
|
998
|
+
* passes the guarding proxy; the page's own host is checked first so a
|
|
999
|
+
* private destination fails with its own reason, not a tunnel error. */
|
|
993
1000
|
export const renderWithChromium = async (
|
|
994
1001
|
url: URL,
|
|
995
1002
|
signal: AbortSignal,
|
|
996
1003
|
): Promise<string> => {
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
const {
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
if (
|
|
1025
|
-
target.protocol !== 'https:' ||
|
|
1026
|
-
(isIP(host) && !isPublicAddress(host)) ||
|
|
1027
|
-
host === 'localhost' ||
|
|
1028
|
-
host.endsWith('.local') ||
|
|
1029
|
-
host.endsWith('.internal')
|
|
1030
|
-
) {
|
|
1031
|
-
return route.abort();
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
return route.continue();
|
|
1035
|
-
});
|
|
1036
|
-
|
|
1037
|
-
// Closing the page ends the navigation; its own failure changes nothing.
|
|
1038
|
-
const abort = () => {
|
|
1039
|
-
void page.close().catch(() => undefined);
|
|
1040
|
-
};
|
|
1041
|
-
|
|
1042
|
-
signal.addEventListener('abort', abort, { once: true });
|
|
1043
|
-
|
|
1044
|
-
try {
|
|
1045
|
-
await page.goto(url.href, { waitUntil: 'networkidle', timeout: 45_000 });
|
|
1004
|
+
await resolvePublicAddress(url.hostname, signal);
|
|
1005
|
+
|
|
1006
|
+
const { result } = await withGuardedChromium(
|
|
1007
|
+
(context) => {
|
|
1008
|
+
return withBoundedPage(context, 60_000, async (page) => {
|
|
1009
|
+
// Closing the page ends the navigation; its own failure changes
|
|
1010
|
+
// nothing.
|
|
1011
|
+
const abort = () => {
|
|
1012
|
+
void page.close().catch(() => undefined);
|
|
1013
|
+
};
|
|
1014
|
+
|
|
1015
|
+
signal.addEventListener('abort', abort, { once: true });
|
|
1016
|
+
|
|
1017
|
+
try {
|
|
1018
|
+
await page.goto(url.href, {
|
|
1019
|
+
waitUntil: 'networkidle',
|
|
1020
|
+
timeout: 45_000,
|
|
1021
|
+
});
|
|
1022
|
+
|
|
1023
|
+
return await page.content();
|
|
1024
|
+
} finally {
|
|
1025
|
+
signal.removeEventListener('abort', abort);
|
|
1026
|
+
}
|
|
1027
|
+
});
|
|
1028
|
+
},
|
|
1029
|
+
{ userAgent: `${researchUserAgent}/1` },
|
|
1030
|
+
);
|
|
1046
1031
|
|
|
1047
|
-
|
|
1048
|
-
} finally {
|
|
1049
|
-
signal.removeEventListener('abort', abort);
|
|
1050
|
-
}
|
|
1051
|
-
} finally {
|
|
1052
|
-
await browser.close();
|
|
1053
|
-
}
|
|
1032
|
+
return result;
|
|
1054
1033
|
};
|
|
1055
1034
|
|
|
1056
1035
|
/** Every research journal entry, in order; an absent journal is empty. */
|
|
@@ -83,6 +83,7 @@ const sectionArgs = (
|
|
|
83
83
|
language: deps.config.language,
|
|
84
84
|
surfaces: deps.plan.surfaces,
|
|
85
85
|
agentProbes: deps.config.agentProbes,
|
|
86
|
+
chatProbes: deps.config.chatProbes,
|
|
86
87
|
agentCliVersions: deps.agentCliVersions,
|
|
87
88
|
runId: deps.request.runId,
|
|
88
89
|
probeStore: deps.stores.probeStore,
|
|
@@ -79,9 +79,9 @@ export const copyEditCall = (args: {
|
|
|
79
79
|
// facts, in the order it is given up when the whole does not fit the
|
|
80
80
|
// role's input limit: every previous edit carries a full draft, the
|
|
81
81
|
// review history grows a review per block per round, and the rule
|
|
82
|
-
// documents are voice, not evidence.
|
|
83
|
-
//
|
|
84
|
-
//
|
|
82
|
+
// documents are voice, not evidence. One run's copy pass refused the
|
|
83
|
+
// edit before any model call because all of it together was over the
|
|
84
|
+
// limit, and the report shipped without a narrative.
|
|
85
85
|
const trims: { name: string; apply: () => void }[] = [
|
|
86
86
|
{
|
|
87
87
|
name: 'older_edits',
|
|
@@ -775,8 +775,8 @@ export const writeReportCopy = async (
|
|
|
775
775
|
throw error;
|
|
776
776
|
}
|
|
777
777
|
|
|
778
|
-
// The verifier stayed unusable through its tries (
|
|
779
|
-
//
|
|
778
|
+
// The verifier stayed unusable through its tries (one run's six
|
|
779
|
+
// invalid reviews failed the pipeline). The report ships on its
|
|
780
780
|
// verified facts with the improvement note; the saved draft is kept.
|
|
781
781
|
ctx.log(
|
|
782
782
|
`copy verifier stayed ${error.outcome} after its tries; delivering the verified facts without the narrative`,
|
package/src/engine/audit-file.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import {
|
|
4
|
+
maxMoneyPages,
|
|
5
|
+
moneyPageProblem,
|
|
6
|
+
type MoneyPageProblem,
|
|
7
|
+
} from '../checks/money-pages';
|
|
8
|
+
import {
|
|
9
|
+
SourceRetrievalError,
|
|
10
|
+
validateResearchUrl,
|
|
11
|
+
} from '../grounding/guarded-request';
|
|
3
12
|
import type { ModelBudgetLimits } from '../models/accounting';
|
|
4
13
|
import { localModelProfile } from '../models/local-profile';
|
|
5
14
|
import { resolveSupportedModel } from '../models/supported-models';
|
|
@@ -11,6 +20,7 @@ import {
|
|
|
11
20
|
agentProbeConfigSchema,
|
|
12
21
|
allSurfaces,
|
|
13
22
|
brandSchema,
|
|
23
|
+
chatProbeConfigSchema,
|
|
14
24
|
coverageThresholdsSchema,
|
|
15
25
|
defaultMaxPlannedUnits,
|
|
16
26
|
isAgentSurface,
|
|
@@ -84,9 +94,44 @@ export const runPolicySchema = z
|
|
|
84
94
|
// Caps every paid call of the run: probes, Codex stage sessions, host
|
|
85
95
|
// model calls and searches (see BudgetPolicy).
|
|
86
96
|
budget: budgetPolicySchema.prefault({}),
|
|
97
|
+
// Hosts off the brand's site whose pages the site checks may fetch (a
|
|
98
|
+
// docs site on another domain). A permission, not a measurement input:
|
|
99
|
+
// granting one never moves a baseline.
|
|
100
|
+
checkHosts: z.array(z.string().trim().min(1)).max(20).default([]),
|
|
87
101
|
})
|
|
88
102
|
.strict();
|
|
89
103
|
|
|
104
|
+
/** Why a checkHosts entry is refused: it must be a bare public host name. */
|
|
105
|
+
const checkHostProblem = (host: string): string | undefined => {
|
|
106
|
+
try {
|
|
107
|
+
const url = validateResearchUrl(`https://${host}/`);
|
|
108
|
+
|
|
109
|
+
if (url.hostname === host.toLowerCase()) {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
} catch (err) {
|
|
113
|
+
if (!(err instanceof SourceRetrievalError)) {
|
|
114
|
+
throw err;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return `Use a bare public host name such as docs.acme.example, not ${JSON.stringify(host)}.`;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/** A refused money page in audit.json's terms: checkHosts is the remedy
|
|
122
|
+
* for a page on another site. */
|
|
123
|
+
const describeMoneyPageProblem = (
|
|
124
|
+
page: string,
|
|
125
|
+
domain: string,
|
|
126
|
+
problem: MoneyPageProblem,
|
|
127
|
+
): string => {
|
|
128
|
+
if (problem.kind === 'unsafe_url') {
|
|
129
|
+
return `A money page must be a public https URL with no port or credentials: ${problem.message}`;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return `${page} is not on ${domain} or its subdomains. Name its host in runPolicy.checkHosts to let the site checks fetch it.`;
|
|
133
|
+
};
|
|
134
|
+
|
|
90
135
|
export const auditFileSchema = z
|
|
91
136
|
.object({
|
|
92
137
|
version: z.literal(auditFileVersion),
|
|
@@ -102,10 +147,14 @@ export const auditFileSchema = z
|
|
|
102
147
|
.array(aeoSurfaceSchema)
|
|
103
148
|
.min(1)
|
|
104
149
|
.default([...allSurfaces]),
|
|
105
|
-
|
|
150
|
+
// Strict here, unlike the internal config that bundles keep: a
|
|
151
|
+
// misspelled key is refused, never dropped for the default depth.
|
|
152
|
+
agentProbes: agentProbeConfigSchema.strict().prefault({}),
|
|
153
|
+
// Absent = the standard depth (2 runs per prompt, 1 on AI Overview).
|
|
154
|
+
chatProbes: chatProbeConfigSchema.optional(),
|
|
106
155
|
geography: z.string().default('us'),
|
|
107
156
|
language: z.string().default('en'),
|
|
108
|
-
moneyPages: z.array(z.url()).default([]),
|
|
157
|
+
moneyPages: z.array(z.url()).max(maxMoneyPages).default([]),
|
|
109
158
|
productBrief: z.string().trim().min(1),
|
|
110
159
|
// `full` researches and adjudicates the claims answers make about the
|
|
111
160
|
// product; `extraction_only` keeps the claim inventory and skips both.
|
|
@@ -126,6 +175,33 @@ export const auditFileSchema = z
|
|
|
126
175
|
});
|
|
127
176
|
}
|
|
128
177
|
|
|
178
|
+
for (const [index, host] of file.runPolicy.checkHosts.entries()) {
|
|
179
|
+
const problem = checkHostProblem(host);
|
|
180
|
+
|
|
181
|
+
if (problem !== undefined) {
|
|
182
|
+
context.addIssue({
|
|
183
|
+
code: 'custom',
|
|
184
|
+
message: problem,
|
|
185
|
+
path: ['runPolicy', 'checkHosts', index],
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
for (const [index, page] of file.moneyPages.entries()) {
|
|
191
|
+
const problem = moneyPageProblem(page, {
|
|
192
|
+
domain: file.brand.domain,
|
|
193
|
+
checkHosts: file.runPolicy.checkHosts,
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
if (problem !== undefined) {
|
|
197
|
+
context.addIssue({
|
|
198
|
+
code: 'custom',
|
|
199
|
+
message: describeMoneyPageProblem(page, file.brand.domain, problem),
|
|
200
|
+
path: ['moneyPages', index],
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
129
205
|
const keys = file.sections.map((section) => section.key);
|
|
130
206
|
|
|
131
207
|
if (new Set(keys).size !== keys.length) {
|
|
@@ -213,6 +289,7 @@ export const toAuditConfig = (file: AuditFile): AeoAuditConfig => {
|
|
|
213
289
|
}),
|
|
214
290
|
sections: file.sections,
|
|
215
291
|
agentProbes: file.agentProbes,
|
|
292
|
+
...(file.chatProbes !== undefined && { chatProbes: file.chatProbes }),
|
|
216
293
|
moneyPages: file.moneyPages,
|
|
217
294
|
productBrief: file.productBrief,
|
|
218
295
|
surfaces: {
|
|
@@ -114,9 +114,17 @@ sections, the buyer questions in each, the competitors, and the surfaces
|
|
|
114
114
|
(the assistants that will be asked). Apply the user's edits to
|
|
115
115
|
`draft/audit.json` yourself. The optional `model` field names the model
|
|
116
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.
|
|
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
|
|
118
122
|
`literally-aeo doctor --config draft/audit.json --env-file .env --json`
|
|
119
|
-
after editing.
|
|
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.
|
|
120
128
|
|
|
121
129
|
## Checkpoint 6: approve the audit cost
|
|
122
130
|
|
|
@@ -174,7 +182,8 @@ Quote the report; do not add claims it does not make.
|
|
|
174
182
|
|
|
175
183
|
Offer `literally-aeo export run`: a `.aeo.zip` bundle with the captured
|
|
176
184
|
answers, every judgment, the metrics, the report and the journal of every
|
|
177
|
-
operation, which anyone can check offline with `literally-aeo verify
|
|
185
|
+
operation, which anyone can check offline with `literally-aeo verify` from
|
|
186
|
+
this release or a newer one.
|
|
178
187
|
Credentials found in it block the export. Tell the user the bundle shows
|
|
179
188
|
the questions and the answers, so they should share it only where those can
|
|
180
189
|
be read.
|
package/src/engine/preflight.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mkdir, rm, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
import {
|
|
4
5
|
agentAuthEnv,
|
|
@@ -109,6 +110,49 @@ const directoryCheck = async (dir: string): Promise<PreflightCheck> => {
|
|
|
109
110
|
}
|
|
110
111
|
};
|
|
111
112
|
|
|
113
|
+
/** The command that installs the Chromium this package's Playwright drives;
|
|
114
|
+
* an unversioned `npx playwright` may fetch another release's browser. */
|
|
115
|
+
const chromiumInstallCommand = (): string => {
|
|
116
|
+
const manifest: unknown = createRequire(import.meta.url)(
|
|
117
|
+
'playwright/package.json',
|
|
118
|
+
);
|
|
119
|
+
const version =
|
|
120
|
+
typeof manifest === 'object' &&
|
|
121
|
+
manifest !== null &&
|
|
122
|
+
'version' in manifest &&
|
|
123
|
+
typeof manifest.version === 'string'
|
|
124
|
+
? `@${manifest.version}`
|
|
125
|
+
: '';
|
|
126
|
+
|
|
127
|
+
return `npx playwright${version} install chromium`;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/** The renderability check renders every money page in Chromium: a
|
|
131
|
+
* missing browser stops the run here, not after the probes were paid for. */
|
|
132
|
+
const chromiumCheck = async (): Promise<PreflightCheck> => {
|
|
133
|
+
try {
|
|
134
|
+
const { chromium } = await import('playwright');
|
|
135
|
+
const browser = await chromium.launch();
|
|
136
|
+
const version = browser.version();
|
|
137
|
+
|
|
138
|
+
await browser.close();
|
|
139
|
+
|
|
140
|
+
return {
|
|
141
|
+
name: 'chromium (money pages)',
|
|
142
|
+
ok: true,
|
|
143
|
+
detail: `Chromium ${version} launches`,
|
|
144
|
+
};
|
|
145
|
+
} catch (err) {
|
|
146
|
+
const message = err instanceof Error ? err.message.split('\n')[0] : '';
|
|
147
|
+
|
|
148
|
+
return {
|
|
149
|
+
name: 'chromium (money pages)',
|
|
150
|
+
ok: false,
|
|
151
|
+
detail: `does not launch (${message}); run \`${chromiumInstallCommand()}\`, or remove moneyPages from audit.json`,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
112
156
|
/** The model audit.json names, or the recommended one: refused when it is
|
|
113
157
|
* not on the supported list, which the detail then prints. */
|
|
114
158
|
export const modelCheck = (model: string | undefined): PreflightCheck => {
|
|
@@ -174,6 +218,8 @@ export const runPreflight = async (args: {
|
|
|
174
218
|
model?: string;
|
|
175
219
|
/** Full grounding researches through the pinned search provider. */
|
|
176
220
|
groundingSearch?: boolean;
|
|
221
|
+
/** Money pages are rendered in Chromium by the renderability check. */
|
|
222
|
+
rendersPages?: boolean;
|
|
177
223
|
}): Promise<PreflightCheck[]> => {
|
|
178
224
|
const { surfaces, settings } = args;
|
|
179
225
|
const nodeMajor = Number(process.versions.node.split('.')[0]);
|
|
@@ -233,6 +279,10 @@ export const runPreflight = async (args: {
|
|
|
233
279
|
});
|
|
234
280
|
}
|
|
235
281
|
|
|
282
|
+
if (args.rendersPages) {
|
|
283
|
+
checks.push(await chromiumCheck());
|
|
284
|
+
}
|
|
285
|
+
|
|
236
286
|
checks.push(await directoryCheck(args.dir));
|
|
237
287
|
|
|
238
288
|
return checks;
|