@rebilder/agent-readability 0.2.0 → 0.4.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/CHANGELOG.md +40 -0
- package/README.md +44 -162
- package/dist/index.cjs +415 -193
- package/dist/index.d.cts +46 -27
- package/dist/index.d.ts +46 -27
- package/dist/index.js +413 -192
- package/dist/index.js.map +1 -1
- package/dist/probe/index.cjs +743 -9
- package/dist/probe/index.d.cts +15 -11
- package/dist/probe/index.d.ts +15 -11
- package/dist/probe/index.js +743 -7
- package/dist/probe/index.js.map +1 -1
- package/dist/probe/local.cjs +743 -9
- package/dist/probe/local.d.cts +2 -2
- package/dist/probe/local.d.ts +2 -2
- package/dist/probe/local.js +743 -7
- package/dist/probe/local.js.map +1 -1
- package/dist/{robots-policy-DE8jix-e.d.ts → robots-policy-BeffrTf0.d.cts} +15 -6
- package/dist/{robots-policy-DE8jix-e.d.cts → robots-policy-BeffrTf0.d.ts} +15 -6
- package/package.json +28 -9
- package/dist/index.cjs.map +0 -1
- package/dist/probe/index.cjs.map +0 -1
- package/dist/probe/local.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ArsDimensionId, a as ArsBasis, b as ArsFactProfile, c as ArsRuleset, d as ArsBand, e as
|
|
2
|
-
export {
|
|
1
|
+
import { A as ArsDimensionId, a as ArsBasis, b as ArsFactProfile, c as ArsRuleset, d as ArsBand, e as ArsHttpCapture, f as ArsEvidence, g as ArsResult, h as ArsRecommendation, i as ArsPageKind } from './robots-policy-BeffrTf0.cjs';
|
|
2
|
+
export { j as AGENT_ACCEPT, k as ARS_ROBOTS_TOKEN, l as ARS_SPEC_VERSION, m as ASSET_ACCEPT, n as ArsAudience, o as ArsAudienceDecision, p as ArsCheck, q as ArsCheckEvidence, r as ArsCheckId, s as ArsCostReport, t as ArsDimension, u as ArsFactKind, v as ArsFactObservation, w as ArsFlag, x as ArsFlagId, y as ArsGrade, z as ArsOutcome, B as ArsPolicyReport, C as ArsProbeError, D as ArsProbeRecord, E as ArsUnscoredReason, F as ArsVantage, G as BROWSER_ACCEPT, H as robotsDisallowsScanner } from './robots-policy-BeffrTf0.cjs';
|
|
3
3
|
|
|
4
4
|
/** Descriptive metadata per check: which dimension it belongs to, its published label, its basis. */
|
|
5
5
|
interface ArsCheckMeta {
|
|
@@ -177,7 +177,7 @@ declare const ARS_MEASURED_WEIGHT = 63;
|
|
|
177
177
|
declare const ARS_HEURISTIC_WEIGHT = 37;
|
|
178
178
|
declare const ARS_HEURISTIC_WEIGHT_CEILING = 40;
|
|
179
179
|
/**
|
|
180
|
-
* ARS 0.
|
|
180
|
+
* ARS 0.3's frozen ruleset. Weights and bands are 0.2's; the action lexicon grew.
|
|
181
181
|
*
|
|
182
182
|
* DESIGNED CEILINGS, printed in the spec (§8) as intentional rather than
|
|
183
183
|
* discovered, and stated here in 0.2's numbers: no content negotiation loses
|
|
@@ -189,7 +189,7 @@ declare const ARS_HEURISTIC_WEIGHT_CEILING = 40;
|
|
|
189
189
|
* rather than described.
|
|
190
190
|
*/
|
|
191
191
|
declare const DEFAULT_RULESET: {
|
|
192
|
-
readonly version: "0.
|
|
192
|
+
readonly version: "0.3.0";
|
|
193
193
|
readonly weights: {
|
|
194
194
|
readonly 'retrievability.reachable': 11;
|
|
195
195
|
readonly 'retrievability.robots-policy': 10;
|
|
@@ -308,7 +308,7 @@ declare const DEFAULT_RULESET: {
|
|
|
308
308
|
readonly document: readonly ["name", "dateModified", "publisher"];
|
|
309
309
|
readonly unknown: readonly ["name"];
|
|
310
310
|
};
|
|
311
|
-
readonly actionLexicon: readonly ["add to bag", "add to basket", "add to cart", "apply", "apply now", "book", "book now", "buy", "buy now", "call now", "checkout", "contact", "contact us", "donate", "download", "email us", "enroll", "get a quote", "get quote", "get started", "join", "make an appointment", "order", "order now", "purchase", "register", "request", "request a demo", "request a quote", "reserve", "schedule", "sign up", "signup", "start", "start free trial", "subscribe"];
|
|
311
|
+
readonly actionLexicon: readonly ["add to bag", "add to basket", "add to cart", "apply", "apply now", "book", "book now", "buy", "buy now", "call", "call now", "check availability", "check out", "checkout", "contact", "contact us", "create account", "create an account", "donate", "download", "email us", "enquire", "enrol", "enroll", "free trial", "get a demo", "get a quote", "get directions", "get in touch", "get quote", "get started", "get the app", "get tickets", "hire", "inquire", "install", "join", "make an appointment", "message us", "order", "order now", "order online", "pre-order", "preorder", "purchase", "register", "rent", "request", "request a demo", "request a quote", "reserve", "schedule", "shop", "shop now", "sign up", "signup", "start", "start free trial", "subscribe", "talk to sales", "talk to us", "text us", "try", "upgrade"];
|
|
312
312
|
/** 2 MiB decoded. Streamed and aborted at the cap; `await response.text()` is forbidden. */
|
|
313
313
|
readonly maxBodyBytes: number;
|
|
314
314
|
/** 3 hops. Every hop re-resolves DNS and re-validates (§5.2). */
|
|
@@ -350,7 +350,7 @@ declare const DEFAULT_RULESET: {
|
|
|
350
350
|
};
|
|
351
351
|
|
|
352
352
|
/**
|
|
353
|
-
* score.ts — the ARS 0.
|
|
353
|
+
* score.ts — the ARS 0.3 scoring engine. The whole pure half comes together here.
|
|
354
354
|
*
|
|
355
355
|
* THE CONTRACT. `score(evidence, ruleset)` is a pure function: same evidence,
|
|
356
356
|
* same ruleset, same `ArsResult`, byte for byte, in any conformant
|
|
@@ -375,14 +375,21 @@ declare const DEFAULT_RULESET: {
|
|
|
375
375
|
* TWO GATES EXIST, AND THEY POINT THE SAFE WAY. D2.3 (`Vary: Accept`) and D2.4
|
|
376
376
|
* (substance parity) are gated on D2.1 (a machine representation was served),
|
|
377
377
|
* which is a MEASURED check gating others. That direction is fine and is what
|
|
378
|
-
* makes the published ceiling provable: no content negotiation loses D2.1 (
|
|
379
|
-
* D2.3 (3) + D2.4 (3) → max
|
|
378
|
+
* makes the published ceiling provable: no content negotiation loses D2.1 (9) +
|
|
379
|
+
* D2.3 (3) + D2.4 (3) → max 85 → capped at B. The forbidden direction — a
|
|
380
380
|
* heuristic that can zero measured points — appears nowhere. In particular D2.4
|
|
381
381
|
* and D5.3 are SCORED CHECKS, NOT GATES: a parity failure loses its own 3 points
|
|
382
|
-
* and raises a `warn`, and leaves D2's other
|
|
383
|
-
* the whole reason "measured
|
|
382
|
+
* and raises a `warn`, and leaves D2's other 15 measured points alone. That is
|
|
383
|
+
* the whole reason "measured 63 / heuristic 37" is an honest split rather than a
|
|
384
384
|
* presentational one.
|
|
385
385
|
*
|
|
386
|
+
* EVIDENCE IS WRITTEN FOR THE SITE OWNER. Labels, values, remedies and flag
|
|
387
|
+
* messages are printed on the public scan page, so they use plain words and name
|
|
388
|
+
* a header or file only where a developer needs it to act. "Content
|
|
389
|
+
* negotiation" in particular is written as what it means to a merchant: the
|
|
390
|
+
* page sends AI assistants a Markdown copy when they ask for one. None of this
|
|
391
|
+
* text is in the conformance projection, so rewording it is a PATCH.
|
|
392
|
+
*
|
|
386
393
|
* WHICH REPRESENTATION SCORES WHAT (the decision `./extract` states in its own
|
|
387
394
|
* header, repeated here because it is the reason the golden pair means anything):
|
|
388
395
|
* D3 (coverage) and D4 (position) score the AGENT representation, because ARS
|
|
@@ -454,9 +461,16 @@ declare const SUBPOINTS: {
|
|
|
454
461
|
band: readonly number[];
|
|
455
462
|
noscriptFloor: number;
|
|
456
463
|
};
|
|
457
|
-
/**
|
|
464
|
+
/**
|
|
465
|
+
* D2.1, 9 for a machine copy served at the page's own address on `Accept`
|
|
466
|
+
* negotiation: a machine media type AND a body that is not HTML. ARS 0.3: 6
|
|
467
|
+
* when the page does not negotiate but the Markdown copy it declares as an
|
|
468
|
+
* alternate was fetched and is real. Less than full because only agents that
|
|
469
|
+
* look for the link reach it, and they pay a second request to do so.
|
|
470
|
+
*/
|
|
458
471
|
negotiatedResponse: {
|
|
459
472
|
full: number;
|
|
473
|
+
linkedCopy: number;
|
|
460
474
|
};
|
|
461
475
|
/** D2.2, 3. All-or-nothing. */
|
|
462
476
|
declaredAlternates: {
|
|
@@ -540,22 +554,27 @@ declare function rulesetHash(ruleset: ArsRuleset): string;
|
|
|
540
554
|
*/
|
|
541
555
|
declare function evidenceHash(evidence: ArsEvidence): string;
|
|
542
556
|
/**
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
*
|
|
546
|
-
*
|
|
547
|
-
* ARS 0.2 ships as a DRAFT (§3.10, "Calibration") and its corpus is still open:
|
|
548
|
-
* fixtures are landing. So the value below is deliberately NOT a corpus digest —
|
|
549
|
-
* it is the SHA-256 of the ASCII string `ars-0.2-corpus-unfrozen`. Anyone who
|
|
550
|
-
* recomputes the digest of the shipped corpus will find it does not match, which
|
|
551
|
-
* is the correct signal: a score carrying this constant is a draft score. It is
|
|
552
|
-
* computed rather than pasted so that no reader has to trust a magic literal.
|
|
553
|
-
*
|
|
554
|
-
* THE STRING CARRIES THE SPEC VERSION for the same reason `rulesetHash` exists:
|
|
555
|
-
* 0.1 and 0.2 score the same page differently, so a 0.1 draft score and a 0.2
|
|
556
|
-
* draft score must not be able to present identical identity triples.
|
|
557
|
+
* Version marker for the ARS 0.3 corpus (spec §2.4.3).
|
|
558
|
+
* This is the hash of the versioned marker string, not of fixture contents.
|
|
559
|
+
* A corpus-content digest replaces it at corpus freeze in a MINOR release.
|
|
557
560
|
*/
|
|
558
561
|
declare const ARS_CORPUS_HASH: string;
|
|
562
|
+
/** Whether a capture is a machine copy: a machine media type and a body that is not HTML. */
|
|
563
|
+
declare function isMachineCopy(capture: ArsHttpCapture): boolean;
|
|
564
|
+
/**
|
|
565
|
+
* The Markdown copies a page declares as alternates, as absolute URLs without a
|
|
566
|
+
* fragment, deduplicated, in a fixed order: `Link` headers on each capture, then
|
|
567
|
+
* `<link rel="alternate" type="text/markdown">` in each capture's HTML.
|
|
568
|
+
*/
|
|
569
|
+
declare function declaredMarkdownAlternates(captures: readonly (ArsHttpCapture | null)[]): string[];
|
|
570
|
+
/**
|
|
571
|
+
* THE ONE MARKDOWN ALTERNATE ARS FETCHES (§3.3, ARS 0.3), shared by the probe and
|
|
572
|
+
* the scorer so the two cannot disagree about which URL was meant. The first
|
|
573
|
+
* declared Markdown copy that is on the target's origin and is not the page's
|
|
574
|
+
* own address; null when the agent probe already received a machine copy, when
|
|
575
|
+
* it did not get a 2xx, or when nothing qualifies. One extra request at most.
|
|
576
|
+
*/
|
|
577
|
+
declare function markdownAlternateTarget(agent: ArsHttpCapture | null, browser: ArsHttpCapture | null, origin: string): string | null;
|
|
559
578
|
/** The band a score falls in. Bands headline; the integer is secondary (§3.6). */
|
|
560
579
|
declare function bandFor(score: number, ruleset?: ArsRuleset): ArsBand | null;
|
|
561
580
|
/**
|
|
@@ -876,7 +895,7 @@ declare function profileFor(pageKind: ArsPageKind): ArsFactProfile;
|
|
|
876
895
|
*
|
|
877
896
|
* WHY `Money` IS DECLARED HERE RATHER THAN IMPORTED. It is structurally
|
|
878
897
|
* identical to `@rebilder/render-md`'s `Money`, and duplicating it is
|
|
879
|
-
* deliberate:
|
|
898
|
+
* deliberate: the package-graph check forbids
|
|
880
899
|
* `agent-readability → render-md` (and the reverse) in the `ars-boundary` rule.
|
|
881
900
|
* The two packages point in opposite directions — gateway/render-md turn a
|
|
882
901
|
* source of truth into output; the scorer turns a response into a judgment — so
|
|
@@ -943,4 +962,4 @@ declare function minorUnitDigits(code: string): number;
|
|
|
943
962
|
*/
|
|
944
963
|
declare function parseMoneyText(text: string, hints?: MoneyHints): ParsedMoney | null;
|
|
945
964
|
|
|
946
|
-
export { ARS_CORPUS_HASH, ARS_HEURISTIC_WEIGHT, ARS_HEURISTIC_WEIGHT_CEILING, ARS_MEASURED_WEIGHT, ArsBand, ArsBasis, type ArsCheckMeta, type ArsClassification, ArsDimensionId, ArsEvidence, ArsFactProfile, ArsPageKind, type ArsPass1Signals, ArsRecommendation, type ArsRecommendationInput, ArsResult, ArsRuleset, CHECK_META, DEFAULT_RULESET, DIMENSION_META, type Money, type MoneyHints, PROFILES, type ParsedMoney, SUBPOINTS, bandFor, canonicalJson, classify, evidenceHash, minorUnitDigits, parseMoneyText, parseRobots, pathMatches, profileFor, recommend, rulesetHash, score, sha256Hex, utf8Length };
|
|
965
|
+
export { ARS_CORPUS_HASH, ARS_HEURISTIC_WEIGHT, ARS_HEURISTIC_WEIGHT_CEILING, ARS_MEASURED_WEIGHT, ArsBand, ArsBasis, type ArsCheckMeta, type ArsClassification, ArsDimensionId, ArsEvidence, ArsFactProfile, ArsHttpCapture, ArsPageKind, type ArsPass1Signals, ArsRecommendation, type ArsRecommendationInput, ArsResult, ArsRuleset, CHECK_META, DEFAULT_RULESET, DIMENSION_META, type Money, type MoneyHints, PROFILES, type ParsedMoney, SUBPOINTS, bandFor, canonicalJson, classify, declaredMarkdownAlternates, evidenceHash, isMachineCopy, markdownAlternateTarget, minorUnitDigits, parseMoneyText, parseRobots, pathMatches, profileFor, recommend, rulesetHash, score, sha256Hex, utf8Length };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ArsDimensionId, a as ArsBasis, b as ArsFactProfile, c as ArsRuleset, d as ArsBand, e as
|
|
2
|
-
export {
|
|
1
|
+
import { A as ArsDimensionId, a as ArsBasis, b as ArsFactProfile, c as ArsRuleset, d as ArsBand, e as ArsHttpCapture, f as ArsEvidence, g as ArsResult, h as ArsRecommendation, i as ArsPageKind } from './robots-policy-BeffrTf0.js';
|
|
2
|
+
export { j as AGENT_ACCEPT, k as ARS_ROBOTS_TOKEN, l as ARS_SPEC_VERSION, m as ASSET_ACCEPT, n as ArsAudience, o as ArsAudienceDecision, p as ArsCheck, q as ArsCheckEvidence, r as ArsCheckId, s as ArsCostReport, t as ArsDimension, u as ArsFactKind, v as ArsFactObservation, w as ArsFlag, x as ArsFlagId, y as ArsGrade, z as ArsOutcome, B as ArsPolicyReport, C as ArsProbeError, D as ArsProbeRecord, E as ArsUnscoredReason, F as ArsVantage, G as BROWSER_ACCEPT, H as robotsDisallowsScanner } from './robots-policy-BeffrTf0.js';
|
|
3
3
|
|
|
4
4
|
/** Descriptive metadata per check: which dimension it belongs to, its published label, its basis. */
|
|
5
5
|
interface ArsCheckMeta {
|
|
@@ -177,7 +177,7 @@ declare const ARS_MEASURED_WEIGHT = 63;
|
|
|
177
177
|
declare const ARS_HEURISTIC_WEIGHT = 37;
|
|
178
178
|
declare const ARS_HEURISTIC_WEIGHT_CEILING = 40;
|
|
179
179
|
/**
|
|
180
|
-
* ARS 0.
|
|
180
|
+
* ARS 0.3's frozen ruleset. Weights and bands are 0.2's; the action lexicon grew.
|
|
181
181
|
*
|
|
182
182
|
* DESIGNED CEILINGS, printed in the spec (§8) as intentional rather than
|
|
183
183
|
* discovered, and stated here in 0.2's numbers: no content negotiation loses
|
|
@@ -189,7 +189,7 @@ declare const ARS_HEURISTIC_WEIGHT_CEILING = 40;
|
|
|
189
189
|
* rather than described.
|
|
190
190
|
*/
|
|
191
191
|
declare const DEFAULT_RULESET: {
|
|
192
|
-
readonly version: "0.
|
|
192
|
+
readonly version: "0.3.0";
|
|
193
193
|
readonly weights: {
|
|
194
194
|
readonly 'retrievability.reachable': 11;
|
|
195
195
|
readonly 'retrievability.robots-policy': 10;
|
|
@@ -308,7 +308,7 @@ declare const DEFAULT_RULESET: {
|
|
|
308
308
|
readonly document: readonly ["name", "dateModified", "publisher"];
|
|
309
309
|
readonly unknown: readonly ["name"];
|
|
310
310
|
};
|
|
311
|
-
readonly actionLexicon: readonly ["add to bag", "add to basket", "add to cart", "apply", "apply now", "book", "book now", "buy", "buy now", "call now", "checkout", "contact", "contact us", "donate", "download", "email us", "enroll", "get a quote", "get quote", "get started", "join", "make an appointment", "order", "order now", "purchase", "register", "request", "request a demo", "request a quote", "reserve", "schedule", "sign up", "signup", "start", "start free trial", "subscribe"];
|
|
311
|
+
readonly actionLexicon: readonly ["add to bag", "add to basket", "add to cart", "apply", "apply now", "book", "book now", "buy", "buy now", "call", "call now", "check availability", "check out", "checkout", "contact", "contact us", "create account", "create an account", "donate", "download", "email us", "enquire", "enrol", "enroll", "free trial", "get a demo", "get a quote", "get directions", "get in touch", "get quote", "get started", "get the app", "get tickets", "hire", "inquire", "install", "join", "make an appointment", "message us", "order", "order now", "order online", "pre-order", "preorder", "purchase", "register", "rent", "request", "request a demo", "request a quote", "reserve", "schedule", "shop", "shop now", "sign up", "signup", "start", "start free trial", "subscribe", "talk to sales", "talk to us", "text us", "try", "upgrade"];
|
|
312
312
|
/** 2 MiB decoded. Streamed and aborted at the cap; `await response.text()` is forbidden. */
|
|
313
313
|
readonly maxBodyBytes: number;
|
|
314
314
|
/** 3 hops. Every hop re-resolves DNS and re-validates (§5.2). */
|
|
@@ -350,7 +350,7 @@ declare const DEFAULT_RULESET: {
|
|
|
350
350
|
};
|
|
351
351
|
|
|
352
352
|
/**
|
|
353
|
-
* score.ts — the ARS 0.
|
|
353
|
+
* score.ts — the ARS 0.3 scoring engine. The whole pure half comes together here.
|
|
354
354
|
*
|
|
355
355
|
* THE CONTRACT. `score(evidence, ruleset)` is a pure function: same evidence,
|
|
356
356
|
* same ruleset, same `ArsResult`, byte for byte, in any conformant
|
|
@@ -375,14 +375,21 @@ declare const DEFAULT_RULESET: {
|
|
|
375
375
|
* TWO GATES EXIST, AND THEY POINT THE SAFE WAY. D2.3 (`Vary: Accept`) and D2.4
|
|
376
376
|
* (substance parity) are gated on D2.1 (a machine representation was served),
|
|
377
377
|
* which is a MEASURED check gating others. That direction is fine and is what
|
|
378
|
-
* makes the published ceiling provable: no content negotiation loses D2.1 (
|
|
379
|
-
* D2.3 (3) + D2.4 (3) → max
|
|
378
|
+
* makes the published ceiling provable: no content negotiation loses D2.1 (9) +
|
|
379
|
+
* D2.3 (3) + D2.4 (3) → max 85 → capped at B. The forbidden direction — a
|
|
380
380
|
* heuristic that can zero measured points — appears nowhere. In particular D2.4
|
|
381
381
|
* and D5.3 are SCORED CHECKS, NOT GATES: a parity failure loses its own 3 points
|
|
382
|
-
* and raises a `warn`, and leaves D2's other
|
|
383
|
-
* the whole reason "measured
|
|
382
|
+
* and raises a `warn`, and leaves D2's other 15 measured points alone. That is
|
|
383
|
+
* the whole reason "measured 63 / heuristic 37" is an honest split rather than a
|
|
384
384
|
* presentational one.
|
|
385
385
|
*
|
|
386
|
+
* EVIDENCE IS WRITTEN FOR THE SITE OWNER. Labels, values, remedies and flag
|
|
387
|
+
* messages are printed on the public scan page, so they use plain words and name
|
|
388
|
+
* a header or file only where a developer needs it to act. "Content
|
|
389
|
+
* negotiation" in particular is written as what it means to a merchant: the
|
|
390
|
+
* page sends AI assistants a Markdown copy when they ask for one. None of this
|
|
391
|
+
* text is in the conformance projection, so rewording it is a PATCH.
|
|
392
|
+
*
|
|
386
393
|
* WHICH REPRESENTATION SCORES WHAT (the decision `./extract` states in its own
|
|
387
394
|
* header, repeated here because it is the reason the golden pair means anything):
|
|
388
395
|
* D3 (coverage) and D4 (position) score the AGENT representation, because ARS
|
|
@@ -454,9 +461,16 @@ declare const SUBPOINTS: {
|
|
|
454
461
|
band: readonly number[];
|
|
455
462
|
noscriptFloor: number;
|
|
456
463
|
};
|
|
457
|
-
/**
|
|
464
|
+
/**
|
|
465
|
+
* D2.1, 9 for a machine copy served at the page's own address on `Accept`
|
|
466
|
+
* negotiation: a machine media type AND a body that is not HTML. ARS 0.3: 6
|
|
467
|
+
* when the page does not negotiate but the Markdown copy it declares as an
|
|
468
|
+
* alternate was fetched and is real. Less than full because only agents that
|
|
469
|
+
* look for the link reach it, and they pay a second request to do so.
|
|
470
|
+
*/
|
|
458
471
|
negotiatedResponse: {
|
|
459
472
|
full: number;
|
|
473
|
+
linkedCopy: number;
|
|
460
474
|
};
|
|
461
475
|
/** D2.2, 3. All-or-nothing. */
|
|
462
476
|
declaredAlternates: {
|
|
@@ -540,22 +554,27 @@ declare function rulesetHash(ruleset: ArsRuleset): string;
|
|
|
540
554
|
*/
|
|
541
555
|
declare function evidenceHash(evidence: ArsEvidence): string;
|
|
542
556
|
/**
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
*
|
|
546
|
-
*
|
|
547
|
-
* ARS 0.2 ships as a DRAFT (§3.10, "Calibration") and its corpus is still open:
|
|
548
|
-
* fixtures are landing. So the value below is deliberately NOT a corpus digest —
|
|
549
|
-
* it is the SHA-256 of the ASCII string `ars-0.2-corpus-unfrozen`. Anyone who
|
|
550
|
-
* recomputes the digest of the shipped corpus will find it does not match, which
|
|
551
|
-
* is the correct signal: a score carrying this constant is a draft score. It is
|
|
552
|
-
* computed rather than pasted so that no reader has to trust a magic literal.
|
|
553
|
-
*
|
|
554
|
-
* THE STRING CARRIES THE SPEC VERSION for the same reason `rulesetHash` exists:
|
|
555
|
-
* 0.1 and 0.2 score the same page differently, so a 0.1 draft score and a 0.2
|
|
556
|
-
* draft score must not be able to present identical identity triples.
|
|
557
|
+
* Version marker for the ARS 0.3 corpus (spec §2.4.3).
|
|
558
|
+
* This is the hash of the versioned marker string, not of fixture contents.
|
|
559
|
+
* A corpus-content digest replaces it at corpus freeze in a MINOR release.
|
|
557
560
|
*/
|
|
558
561
|
declare const ARS_CORPUS_HASH: string;
|
|
562
|
+
/** Whether a capture is a machine copy: a machine media type and a body that is not HTML. */
|
|
563
|
+
declare function isMachineCopy(capture: ArsHttpCapture): boolean;
|
|
564
|
+
/**
|
|
565
|
+
* The Markdown copies a page declares as alternates, as absolute URLs without a
|
|
566
|
+
* fragment, deduplicated, in a fixed order: `Link` headers on each capture, then
|
|
567
|
+
* `<link rel="alternate" type="text/markdown">` in each capture's HTML.
|
|
568
|
+
*/
|
|
569
|
+
declare function declaredMarkdownAlternates(captures: readonly (ArsHttpCapture | null)[]): string[];
|
|
570
|
+
/**
|
|
571
|
+
* THE ONE MARKDOWN ALTERNATE ARS FETCHES (§3.3, ARS 0.3), shared by the probe and
|
|
572
|
+
* the scorer so the two cannot disagree about which URL was meant. The first
|
|
573
|
+
* declared Markdown copy that is on the target's origin and is not the page's
|
|
574
|
+
* own address; null when the agent probe already received a machine copy, when
|
|
575
|
+
* it did not get a 2xx, or when nothing qualifies. One extra request at most.
|
|
576
|
+
*/
|
|
577
|
+
declare function markdownAlternateTarget(agent: ArsHttpCapture | null, browser: ArsHttpCapture | null, origin: string): string | null;
|
|
559
578
|
/** The band a score falls in. Bands headline; the integer is secondary (§3.6). */
|
|
560
579
|
declare function bandFor(score: number, ruleset?: ArsRuleset): ArsBand | null;
|
|
561
580
|
/**
|
|
@@ -876,7 +895,7 @@ declare function profileFor(pageKind: ArsPageKind): ArsFactProfile;
|
|
|
876
895
|
*
|
|
877
896
|
* WHY `Money` IS DECLARED HERE RATHER THAN IMPORTED. It is structurally
|
|
878
897
|
* identical to `@rebilder/render-md`'s `Money`, and duplicating it is
|
|
879
|
-
* deliberate:
|
|
898
|
+
* deliberate: the package-graph check forbids
|
|
880
899
|
* `agent-readability → render-md` (and the reverse) in the `ars-boundary` rule.
|
|
881
900
|
* The two packages point in opposite directions — gateway/render-md turn a
|
|
882
901
|
* source of truth into output; the scorer turns a response into a judgment — so
|
|
@@ -943,4 +962,4 @@ declare function minorUnitDigits(code: string): number;
|
|
|
943
962
|
*/
|
|
944
963
|
declare function parseMoneyText(text: string, hints?: MoneyHints): ParsedMoney | null;
|
|
945
964
|
|
|
946
|
-
export { ARS_CORPUS_HASH, ARS_HEURISTIC_WEIGHT, ARS_HEURISTIC_WEIGHT_CEILING, ARS_MEASURED_WEIGHT, ArsBand, ArsBasis, type ArsCheckMeta, type ArsClassification, ArsDimensionId, ArsEvidence, ArsFactProfile, ArsPageKind, type ArsPass1Signals, ArsRecommendation, type ArsRecommendationInput, ArsResult, ArsRuleset, CHECK_META, DEFAULT_RULESET, DIMENSION_META, type Money, type MoneyHints, PROFILES, type ParsedMoney, SUBPOINTS, bandFor, canonicalJson, classify, evidenceHash, minorUnitDigits, parseMoneyText, parseRobots, pathMatches, profileFor, recommend, rulesetHash, score, sha256Hex, utf8Length };
|
|
965
|
+
export { ARS_CORPUS_HASH, ARS_HEURISTIC_WEIGHT, ARS_HEURISTIC_WEIGHT_CEILING, ARS_MEASURED_WEIGHT, ArsBand, ArsBasis, type ArsCheckMeta, type ArsClassification, ArsDimensionId, ArsEvidence, ArsFactProfile, ArsHttpCapture, ArsPageKind, type ArsPass1Signals, ArsRecommendation, type ArsRecommendationInput, ArsResult, ArsRuleset, CHECK_META, DEFAULT_RULESET, DIMENSION_META, type Money, type MoneyHints, PROFILES, type ParsedMoney, SUBPOINTS, bandFor, canonicalJson, classify, declaredMarkdownAlternates, evidenceHash, isMachineCopy, markdownAlternateTarget, minorUnitDigits, parseMoneyText, parseRobots, pathMatches, profileFor, recommend, rulesetHash, score, sha256Hex, utf8Length };
|