@rebilder/agent-readability 0.2.0 → 0.3.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 ADDED
@@ -0,0 +1,29 @@
1
+ # @rebilder/agent-readability changelog
2
+
3
+ Notable changes to `@rebilder/agent-readability`. A patch release never changes a score; a change to the ruleset, the conformance corpus or the page-kind profiles is at least a minor version. Dates are the day each version reached npm.
4
+
5
+ ## Unreleased
6
+
7
+ ## 0.3.0 (2026-09-28)
8
+
9
+ - **Requires Node.js 22 or later.** `engines.node` moves from `>=20.11.0` to `>=22`; Node.js 20 reached end of life in April 2026.
10
+ - Smaller package: sourcemaps now ship with the ESM build only. The CommonJS build carried a second copy of the same maps. Unpacked size drops from about 3.0 MB to 1.9 MB. CommonJS code is unchanged.
11
+ - `./probe` and `./probe/local` types now resolve under TypeScript's older `node10` module resolution.
12
+ - A customer-facing README with a complete `probeStrict()` to `score()` example. Better package description and keywords. This changelog now ships in the package.
13
+ - The README explains how this package differs from `@vercel/agent-readability` and links a guide to running both in CI.
14
+ - The package description names the standard in full: the Rebilder Agent Readability Spec (ARS).
15
+ - No score changes.
16
+
17
+ ## 0.2.0 (2026-08-26)
18
+
19
+ - Implements ARS 0.2: a new ruleset (scores are not comparable with ARS 0.1), a new evidence-density dimension, and new conformance fixtures.
20
+ - Exports the probe's normative pieces from the root so another probe can measure the same thing: `AGENT_ACCEPT`, `BROWSER_ACCEPT`, `ASSET_ACCEPT`, `ARS_ROBOTS_TOKEN`, `parseRobots`, `pathMatches`, `robotsDisallowsScanner` and `utf8Length`.
21
+ - The probe identifies itself as `rebilder-ars/0.2`.
22
+
23
+ ## 0.1.1 (2026-08-11)
24
+
25
+ - Package metadata points at rebilder.com for help instead of a private repository. No code or score change.
26
+
27
+ ## 0.1.0 (2026-08-10)
28
+
29
+ First release: the ARS 0.1 scorer (`score`, `recommend`, the ruleset, page-kind profiles, classifier and money parser), the strict server-side probe (`./probe`) and the local probe for private hosts (`./probe/local`, which loads only with `--allow-private`).
package/README.md CHANGED
@@ -1,184 +1,65 @@
1
1
  # @rebilder/agent-readability
2
2
 
3
- The Agent Readability Score (**ARS 0.2**). **The default export (`.`) is a pure, deterministic function of its inputs and nothing else** — no network, no clock, no randomness, no LLM, and zero runtime dependencies. The guarantee we publish is: _for a given `evidenceHash`, `rulesetHash` and `corpusHash`, `score()` returns a byte-identical `ArsResult` in any conformant implementation, in any language._ A number without all three hashes is not an ARS score. Purity is enforced at **build time** by an ESLint `no-restricted-globals` / `no-restricted-properties` rule over `src/` (`Date`, `Math.random`, `fetch`, `performance`), not by a runtime stub that would only prove our own fixtures behave. The one impure half lives behind a separate entry point, `./probe`, which is server-only and exempt from that rule — and from nothing else.
3
+ Score how well AI agents can read a web page. This is the reference implementation of the [Rebilder Agent Readability Spec](https://rebilder.com/spec/ars) (ARS 0.2): it checks whether the facts an agent needs for that kind of page are present, findable and cheap to read, and ranks the fixes.
4
4
 
5
- ## Contract
5
+ The scorer is a pure, deterministic function with no dependencies: no network, no clock, no randomness, no model. A separate entry point fetches live pages safely.
6
6
 
7
- | Entry point | What it is |
8
- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9
- | `.` | `score()`, `recommend()`, `bandFor()`, `DEFAULT_RULESET`, the ruleset/evidence hashes, the page-kind profiles, the classifier, the money parser, and all published types. Pure. Safe anywhere. |
10
- | `./probe` | Fetches evidence from a live origin: SSRF policy with DNS pinning, a streamed 2 MiB body cap, an injected politeness limiter, robots.txt handling. Node-only. |
7
+ **Comparing it with `@vercel/agent-readability`?** Vercel's package detects AI agents, routes them to markdown through framework middleware, and audits a whole site against a Vercel checklist that it also calls the Agent Readability Spec. This package scores one URL at a time against Rebilder's ARS, a separate standard with fixed weights, page-kind fact checks and a public conformance corpus. It does not serve anything to agents; [`@rebilder/gateway`](https://www.npmjs.com/package/@rebilder/gateway) does that. You can run both, for example [Vercel's audit and `rebilder check` in the same CI job](https://rebilder.com/docs/vercel-agent-readability).
11
8
 
12
- The two halves meet at exactly one type. The probe produces an `ArsEvidence` bundle; `score()` consumes that bundle plus an `ArsRuleset` and produces an `ArsResult`. There is no third input.
9
+ ## Install
13
10
 
14
- The tokenizer and the extractor are **not** exported: they are the mechanism of the score, not its interface, and freezing them into the public surface would make every extraction bugfix a breaking change.
15
-
16
- ```ts
17
- import { DEFAULT_RULESET, parseMoneyText, score } from '@rebilder/agent-readability'
18
-
19
- const result = score(evidence, DEFAULT_RULESET)
20
- result.grade // 'A' | 'B' | 'C' | 'D' | 'F' — or null, for the three non-grades
21
- result.score // 0..100, or null. Integers. No decimals, ever.
22
- result.dimensions // always 7, weights always summing to 100
23
- result.dimensions[0].checks[0].basis // 'measured' | 'heuristic', per check, always
24
- result.recommendations // ranked, deduplicated: Σ pointsAvailable ≤ 100 − score
25
-
26
- parseMoneyText('$1,499.00') // { amount: 149900, currency: 'USD', qualified: false }
27
- parseMoneyText('From $9') // { amount: 900, currency: 'USD', qualified: true }
28
- parseMoneyText('1,500') // null — no currency, and the separator is ambiguous
29
- ```
30
-
31
- ## What ARS measures, and what it does not
32
-
33
- ARS scores **format and retrievability**: whether the facts a caller needs _for this kind of page_ are present, findable, and cheap _relative to what that kind of page costs_. Two lines print on every surface that shows a grade, and they are not boilerplate:
34
-
35
- > ARS measures format and retrievability. It does not measure whether the facts are true, or whether any assistant cites this page.
36
-
37
- - **Fixed weights, 100 points, identical for every page kind.** No conditional weights, no redistribution, no heuristic gate over measured points. Redistribution is a gaming vector; a heuristic that can zero measured points makes those points heuristic.
38
- - **What varies by page kind is the fact set and the byte reference**, never a weight. That is what stops long-form content being charged against a budget that has nothing to do with it — the defect in every design that used absolute byte bands. It does not make long-form content cost-free: D3.1's density term has no page-kind component, and D7 (below) has none either, so a long article that states no figures pays on both.
39
- - **D7 evidence density, new in 0.2, 8 points.** D1–D6 grade whether an agent can reach and parse a page. D7 grades whether there was anything on it worth quoting: distinct quantities, labelled `Term: value` pairs, and comparable table rows. Question-shaped headings earn nothing, deliberately — the absorption evidence does not support them.
40
- - **Measured 63 / heuristic 37**, published, with a spec ceiling of 40 on heuristic weight. The figure is honest because the two comparison checks (D2.4 substance parity, D5.3 structured-data agreement) are _scored checks, not gates_: failing parity loses its own 3 points and raises a `warn`, and does not touch D2's other 15 measured points.
41
- - **Ordinal, not cardinal.** Bands headline, integers are secondary, no decimals ever.
42
- - **Three non-grades**, none of which is an F: `opt-out` (a deliberate, well-formed robots disallow — a choice, not a failure), `unscored — blocked`, and `unscored — unreachable / non-2xx / robots-unavailable / robots-disallow-scanner / truncated-evidence`.
43
- - **Blocking training crawlers while allowing assistants scores identically to a fully open site.** The `training` audience is strictly neutral and can never lower a score.
44
-
45
- **Conflict-of-interest disclosure**, printed at the top of `/spec/ars`, on every scanner result, and in the CLI `--help`:
46
-
47
- > ARS is authored by Rebilder, which sells content-negotiation middleware. One ARS check — D2.1, content negotiation, worth 9 of 100 — can be satisfied by Rebilder's free gateway, and reaching an A requires it. The full ruleset, thresholds, and conformance corpus are published so this bias is auditable rather than hidden.
48
-
49
- ## Modules in this package
50
-
51
- ### `src/types.ts` — the published contract
52
-
53
- Transcribed from design §3.9. These types are the schema of `expected.json` in the conformance corpus, which is what a second implementation in Go or Python has to reproduce. Adding a field here is adding a field an outside team must reverse-engineer.
54
-
55
- ### `src/ruleset.ts` — `DEFAULT_RULESET`
56
-
57
- Every number a second implementation needs, and nothing that varies between runs: check weights (22 checks summing to 100), the §3.6 scoring bands, crawler audience tokens, the D5.2 required-property table, the action lexicon, the A–F grade bands, and the three probe limits that are inputs to the score (2 MiB body cap, 3 redirects, 5 000ms timeout — two implementations with different caps produce different scores, so they are hashed with everything else).
58
-
59
- `rulesetHash` is the SHA-256 of the RFC 8785 canonical JSON of this object. **Editing a number here is a spec version change, not a code change**: per §3.1, any edit that moves a conformance `expected.json` is at minimum a MINOR, and MINOR means scores stop being comparable and every published surface re-scores in a batch.
60
-
61
- ### `src/profiles.ts` — the eight page-kind profiles
62
-
63
- `product`, `collection`, `article`, `place`, `service`, `faq`, `document`, `unknown`. A closed set; every kind has a complete profile, and the mapping is total by construction (`PROFILE_BY_KIND` is a total `Record`, so a missing profile is a compile error). Core facts score at full weight, extended facts at ¼ credit — one definition, applied everywhere. `unknown` is not an easy exit: it still scores D5.2 against "any recognised schema.org type present".
64
-
65
- ### `src/html.ts` — a tolerant, non-executing tokenizer
66
-
67
- Hand-rolled, and that is a normative decision rather than a preference: **a third-party parser version is an unversioned input to a deterministic score.** A dependency that changes how a malformed `<div` is recovered would change scores on a `pnpm update`, with no ARS version bump and no conformance diff. The recovery rules here _are_ the spec.
68
-
69
- - Byte offsets are **UTF-8 byte offsets**, not string indices, because `ArsHttpCapture.bytes` is defined as the decoded UTF-8 byte length and D4 scores offsets against it. One `€` before the price is enough to make the two disagree.
70
- - Counted text follows the §3.6 rule exactly: everything except `<script>`, `<style>`, `<template>`, `hidden`, and inline `style="display:none"`. **No CSS resolution** — a cascade engine would not be deterministic across implementations, so a class that hides an element in a stylesheet does not hide it here.
71
- - `tokenizeHtml` **never throws**, for any input. A scanner that can be crashed by the page it is scanning is a denial-of-service endpoint.
72
-
73
- One reading decision is flagged in the file header: JSON-LD script contents are surfaced separately (`doc.jsonLd`) and are **not** counted as visible text, because the other reading would trivially satisfy both D5.3 and the definition of "corroborated".
74
-
75
- ### `src/parse-money.ts` — text → `Money`, or `null`
76
-
77
- Real work, budgeted as such. `@rebilder/render-md`'s `money.ts` only _formats_ an already-structured `Money`; it cannot parse text, and the claim that it could hid the largest single piece of extraction work in the program.
78
-
79
- **Fails closed.** Ambiguous input returns `null`, and a `null` price is simply not a fact — it costs coverage points and nothing else. A _wrong_ price would be published on a scanner page as truth and would make a parity check accuse a merchant of a divergence they did not commit. Supported: leading/trailing symbols, ISO code prefix/suffix, comma and period as both group and decimal separator (disambiguated by position and by the minor-unit width of the resolved currency), space/NBSP/apostrophe group separators, zero-decimal currencies, ranges and qualifiers (→ the lower bound, `qualified: true`, which excludes them from the D2.4 parity comparison).
80
-
81
- `Money` is declared here rather than imported from `@rebilder/render-md`. The duplication is deliberate: `tooling/check-package-graph.ts` forbids that dependency edge in both directions, because the two packages point in opposite directions — gateway/render-md turn a source of truth into output; the scorer turns a response into a judgment.
82
-
83
- ### `src/score.ts` — the scoring engine
84
-
85
- `score(evidence, ruleset = DEFAULT_RULESET) → ArsResult`. Twenty-two checks, seven dimensions, 100 points, one pure function.
86
-
87
- **Integer arithmetic only.** Every number is produced by exact integer division (`(n − n % d) / d`, which never rounds, unlike `Math.floor(n / d)` on a double quotient) and half-up rounding via `(n + d/2) / d`. `Math.round`, `0.25 ×` and `0.5 ×` appear nowhere in the scoring path. Two implementations that disagree in the third decimal disagree about grades at the band boundary, and the boundaries are what the product publishes.
88
-
89
- **Which representation scores what.** D3 (coverage) and D4 (position) score the **agent** representation, because ARS measures what a caller actually receives — a merchant whose Markdown omits `availability` loses coverage even though the HTML declares it. D1.3 (render independence) and D5 (structured data) score the representation that carries a **document**. Corroboration crosses the two: a price stated in the negotiated Markdown _and_ in the HTML's JSON-LD is observed in two sources, which is the only reason a correct gateway install can reach an A.
90
-
91
- **Two gates, both pointing the safe way.** D2.3 (`Vary: Accept`) and D2.4 (substance parity) score 0 unless D2.1 earned points — a **measured** check gating others. That is what makes the published ceiling provable: no content negotiation loses 9 + 3 + 3 → **max 85 → capped at B**. **An A requires a machine representation, and as of 0.2 it no longer requires structured data**: D5 fell from 15 points to 6, so a page with none can still reach 94. The forbidden direction — a heuristic that can zero measured points — appears nowhere, and fixture `053` re-derives the heuristic-controlled weight (37) from the gate graph to prove it.
92
-
93
- **Comparison is asymmetric, deliberately.** D2.4 and D5.3 ask whether the value one side would _publish_ (its lowest-offset unqualified observation, the same choice the published fact set makes) appears anywhere among the values the other side _stated_. Requiring the two headline values to be equal produces false accusations on ordinary pages — `tooling/fixtures/demo-pdp-before.html` names a backordered variant above the line that says the product is in stock, and both statements are true. Accepting any shared value lets a real divergence hide behind an incidental match, because "Free shipping over $50" appears in both representations. The asymmetric rule catches the second and not the first, which is the conservative direction: a missed divergence costs a merchant nothing, and a false one is published next to their name.
94
-
95
- **Gate order for non-grades**, and none of them is an F: `robots-disallow-scanner` (a statement about our own conduct, and only `vantage: 'public'` is gated — an owner consents for their own origin) → `robots-unavailable` → `opt-out` (the site's decision, reported before any failure of ours) → fetch failures → `evidence-incomplete` → `truncated-evidence`. A non-grade still carries all seven dimensions with their weights, every check at `earned: 0` with an evidence line naming the reason, and the policy and cost reports — but no sub-scores, because publishing those next to `score: null` would be scoring by another name.
96
-
97
- **Known limitations of 0.2, stated rather than discovered:**
98
-
99
- - **D5.2 walks JSON-LD only.** Microdata and RDFa satisfy D5.1 (present and parsing) but are not traversed for required properties, so a microdata-only page scores 2/6 on D5 rather than the full 6.
100
- - **A declared paywall is flagged, not exempted.** `isAccessibleForFree: false`, HTTP 402 and `WWW-Authenticate` raise the `paywalled` flag; the §3.8 exemption of the gated part from coverage and position needs `hasPart` + `cssSelector` support in the extractor and is not implemented.
101
- - **`corpusHash` is not yet a corpus digest.** The pure half cannot read the corpus directory, so the value is a pinned constant regenerated at corpus freeze. ARS 0.2 ships as a draft with its corpus still open, so `ARS_CORPUS_HASH` is the SHA-256 of the ASCII string `ars-0.2-corpus-unfrozen` — anyone comparing it against a computed digest of the shipped corpus will find it does not match, which is the correct signal.
102
- - **`SUBPOINTS` and the classification tables are not covered by `rulesetHash`.** §3.9's `ArsRuleset` has no field for either. They are published (exported, and printed in the spec) and the corpus is what pins them.
103
- - **SHA-256 is implemented in this file.** `node:crypto` would make the package Node-only and `apps/rebilder-web` imports the root entry point; `crypto.subtle` is async and `score()` is not; a dependency is out by contract. It is checked against the FIPS 180-4 vectors in `tests/score.test.ts`.
104
-
105
- ### `src/recommend.ts` — what to fix, in what order, and what it is worth
106
-
107
- `recommend({ dimensions, score })` computes remedies over a dependency DAG. A recommendation's `pointsAvailable` counts only the checks not already claimed by a higher-ranked one, **plus** the checks it uniquely unlocks — D2.1 owns D2.3 and D2.4 while it is at zero, and only while it is at zero. Sums are capped per dimension, output order is rank order, and a recommendation may claim its unlocks only if it also closes something itself. Every number is a real gap between `earned` and `weight`; a page at 100 gets an empty list rather than a list of platitudes. `Σ pointsAvailable ≤ 100 − score` is asserted over the whole corpus.
108
-
109
- ### `src/index.ts` — the published surface
110
-
111
- `score`, `recommend`, `bandFor`, the three hashes, `DEFAULT_RULESET`, `CHECK_META`, `DIMENSION_META`, `SUBPOINTS`, the profiles, `classify`, `parseMoneyText`, and every type in §3.9. **The tokenizer and the extractor are deliberately not exported.** They are the mechanism of the score, not its interface: they change whenever a real page teaches us something, which is what a MINOR is for, and exporting them would freeze the way ARS reads a page into the way ARS is used.
112
-
113
- ## Boundaries
114
-
115
- ```
116
- cli ──┐
117
- ├──► agent-readability (. pure, ./probe server-only)
118
- mcp ──┘
119
- gateway ──X──► agent-readability (forbidden, BOTH directions)
120
- agent-readability ──X──► gateway
121
- rebilder-web ──► agent-readability (. only, never ./probe)
122
- rebilder-api ──► agent-readability (. and ./probe)
11
+ ```sh
12
+ npm install @rebilder/agent-readability
123
13
  ```
124
14
 
125
- Enforced by `tooling/check-package-graph.ts`, which also forbids deep imports: `.` and `./probe` are the entire public API. `rebilder-web` never makes an outbound fetch to an arbitrary host — the scan routes through `rebilder-api` — and that property is only real if the probe entry point cannot be imported there.
15
+ Want a score without writing code? Run `npx rebilder check <url>`, or give your AI assistant the `@rebilder/mcp-server` tools.
126
16
 
127
- ## Development
17
+ ## Score a live page
128
18
 
129
- ```bash
130
- pnpm --filter @rebilder/agent-readability typecheck
131
- pnpm --filter @rebilder/agent-readability lint # includes the purity rule
132
- pnpm --filter @rebilder/agent-readability test # includes the conformance corpus
133
- ```
134
-
135
- The root `ars:conform` alias named in design §3.10 is **not wired yet**; the corpus runs as part of this package's `test` script in the meantime.
19
+ ```ts
20
+ import { score } from '@rebilder/agent-readability'
21
+ import { probeStrict, strictPolicyForRun } from '@rebilder/agent-readability/probe'
136
22
 
137
- ## The conformance corpus
23
+ // 1. Fetch the evidence: the page as an agent and as a browser, plus robots.txt,
24
+ // llms.txt and /.well-known/ucp. Public https hosts only.
25
+ const outcome = await probeStrict('https://example.com/products/trail-pack', strictPolicyForRun())
26
+ if (!outcome.ok) throw new Error(`${outcome.rejection}: ${outcome.detail}`)
138
27
 
139
- `conformance/NNN-name/` and its runner (`tests/conformance.test.ts`) are the language-neutral standard. The spec describes the score in prose; the corpus says what the prose means, in JSON, in a form a Go or Python implementation can consume without reading TypeScript.
28
+ // 2. Score it. Pure and deterministic: the same evidence always gives the same result.
29
+ const result = score(outcome.evidence)
140
30
 
141
- ```
142
- conformance/NNN-name/
143
- evidence.json the INPUT — an ArsEvidence bundle, response bodies included
144
- expected.json SPEC-DERIVABLE fields only. A second implementation must reproduce this.
145
- identity.json rulesetHash / corpusHash / evidenceHash — properties of OUR artifact.
146
- A second implementation is explicitly NOT required to match them, and
147
- that split is what makes independent certification possible at all.
148
- README.md one paragraph on what the fixture proves
31
+ console.log(result.grade, result.score) // e.g. 'B' 81; null for a page that could not be graded
32
+ for (const fix of result.recommendations) {
33
+ console.log(`+${fix.pointsAvailable} ${fix.title}`)
34
+ }
149
35
  ```
150
36
 
151
- **The runner globs.** Every directory under `conformance/` is picked up with no edit to the runner — fixtures land from several people at once, and a hand-maintained list is a list that silently skips the one someone forgot to register. A directory with no `evidence.json`, no `expected.json`, no `README.md` or unparseable JSON is an **error**, never a skip.
37
+ `score()` takes an `ArsEvidence` bundle and returns an `ArsResult`: the grade (`A` to `F`) and score (0 to 100), seven dimensions with every check and its evidence, whether each check is measured or heuristic, the page kind, the facts found, the context cost, and ranked recommendations whose points never add up to more than the page is missing.
152
38
 
153
- **What `expected.json` pins**, and what it deliberately does not: every number and every identifier — `earned` per check and per dimension, grade, score, band label, page kind and confidence, the fact set, the flags raised, the policy decisions, the cost report, and the recommendation arithmetic. Not the three hashes (they are `identity.json`'s job), and not a single human-facing string — check labels, evidence lines, flag messages, recommendation copy. Those are ours to reword in a PATCH, and a corpus that pinned them would turn copy edits into spec changes.
39
+ ## Entry points
154
40
 
155
- **`corpusHash` is recorded but not asserted per fixture.** It is a digest over the whole corpus, so it moves every time anyone adds a fixture; pinning it while the corpus is open would make every new fixture break every old one. `rulesetHash` and `evidenceHash` are asserted, because they are properties of inputs that do not move.
41
+ | Import | What it is | Where it runs |
42
+ |---|---|---|
43
+ | `@rebilder/agent-readability` | `score()`, `recommend()`, the ruleset, the page-kind profiles, the classifier, the money parser and every published type | Anywhere, including browsers and edge runtimes |
44
+ | `@rebilder/agent-readability/probe` | `probeStrict()`: fetches evidence from a public https origin. DNS-validated and pinned against private addresses, 2 MiB streamed body cap, 3 redirects, 5 second timeout, robots.txt read first, a politeness limiter | Node.js servers |
45
+ | `@rebilder/agent-readability/probe/local` | `probeLocal()`: also allows private hosts and plain http, for checking your own staging site | A terminal only. It refuses to load unless the process was started with `--allow-private`, and always in a hosted runtime |
156
46
 
157
- **Regenerating:**
47
+ The probe identifies itself as `rebilder-ars/0.2 (+https://rebilder.com/bots)`, never as another company's crawler, and obeys a robots.txt group that disallows `rebilder-ars`.
158
48
 
159
- ```bash
160
- ARS_CONFORM_UPDATE=1 pnpm --filter @rebilder/agent-readability test
161
- ```
49
+ ## What the score measures
162
50
 
163
- writes `expected.json` and `identity.json` from the current implementation **and then fails the run**, so an update can never be mistaken for a pass. Read the diff before committing it: blessing output you have not checked is how a corpus stops encoding the spec and starts encoding the bug.
51
+ ARS measures format and retrievability. It does not measure whether the facts are true, or whether any assistant cites the page.
164
52
 
165
- ### The golden pair
53
+ - **Fixed weights, 100 points, the same for every page kind.** What varies by kind (product, place, service, article, FAQ, collection, document) is which facts count and how many bytes a page of that kind reasonably costs.
54
+ - **63 points are measured and 37 are heuristic**, and every check reports which it is.
55
+ - **Two outcomes are not grades.** `outcome.kind` is `opt-out` when the site's robots.txt deliberately opts out, which is a choice, not a failure. It is `unscored` when there was nothing to grade: blocked at the edge, unreachable, a non-2xx response, too many redirects, robots.txt unavailable or disallowing the scanner, or incomplete evidence. Neither is an F.
56
+ - **Blocking training crawlers while allowing assistants scores the same as a fully open site.**
57
+ - **Reproducible.** For a given `evidenceHash`, `rulesetHash` and `corpusHash`, `score()` returns a byte-identical result in any conforming implementation. A number without those three hashes is not an ARS score.
166
58
 
167
- `001-pdp-gateway-md` and `002-pdp-raw-html` carry the **same 91,226-byte HTML body** — the real committed page at `tooling/fixtures/demo-pdp-before.html` — and differ only in what the agent probe receives and in the response headers, which is exactly the one variable §3.3 allows. The same page scores **59 (D)** raw and **93 (A)** with the gateway installed. Four of the seven points 001 still lacks are gaps in `@rebilder/gateway` itself: it declares no `Link: rel="alternate"` (D2.2, 3 points) and no canonical on the Markdown response (D6.1, 1 point). The corpus is where that is visible, and closing it will move `expected.json` — which is a MINOR, and correctly so.
59
+ The specification, the scoring bands and the conformance corpus are published at [rebilder.com/spec/ars](https://rebilder.com/spec/ars), so the score can be implemented in any language. Page-kind fact lists are also published on their own as [`@rebilder/profiles`](https://www.npmjs.com/package/@rebilder/profiles).
168
60
 
169
- ### Property fixtures 050–059
61
+ ## Versioning
170
62
 
171
- Design §3.10 names ten properties. Two need an evidence bundle to be about anything and are **corpus directories**; the other eight are properties of the ruleset, the profiles, the parsers or the build, and live in `tests/score.test.ts` as `describe('05N …')` blocks. Every id appears in exactly one of the two places:
63
+ A patch release never changes a score. If the ruleset, the conformance corpus or the page-kind profiles change, the release is at least a minor version. `ARS_SPEC_VERSION` is the specification version and moves on its own schedule.
172
64
 
173
- | id | where |
174
- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
175
- | `050-byte-identical-replay` | **directory** (+ corpus-wide replay assertion in the runner, and the volatile-header assertions in `score.test.ts`) |
176
- | `051-multi-value-headers` | **directory** |
177
- | `052-weights-sum-100…` | test |
178
- | `053-heuristic-controlled…` | test |
179
- | `054-band-boundaries` | test |
180
- | `055-no-network` | test (asserts the ESLint gate, which is the real check, plus a source scan) |
181
- | `056-no-clock` | test (same shape) |
182
- | `057-tokenizer-fuzz` | test (seeded LCG — a fuzz corpus that differs between machines teaches nobody anything) |
183
- | `058-profiles-total-and-typed` | test |
184
- | `059-money-parser` | test |
65
+ Release notes are in `CHANGELOG.md` in this package. Licensed under Apache-2.0.
package/dist/index.cjs CHANGED
@@ -4752,5 +4752,3 @@ exports.rulesetHash = rulesetHash;
4752
4752
  exports.score = score;
4753
4753
  exports.sha256Hex = sha256Hex;
4754
4754
  exports.utf8Length = utf8Length;
4755
- //# sourceMappingURL=index.cjs.map
4756
- //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -540,20 +540,9 @@ declare function rulesetHash(ruleset: ArsRuleset): string;
540
540
  */
541
541
  declare function evidenceHash(evidence: ArsEvidence): string;
542
542
  /**
543
- * `corpusHash` — SHA-256 over the FROZEN conformance corpus (§3.1). Computing it
544
- * requires reading the corpus directory, which the pure half cannot do, so it is
545
- * a constant regenerated at corpus freeze.
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.
543
+ * Version marker for the ARS 0.2 corpus (spec §2.4.3).
544
+ * This is the hash of the versioned marker string, not of fixture contents.
545
+ * A corpus-content digest replaces it at corpus freeze in a MINOR release.
557
546
  */
558
547
  declare const ARS_CORPUS_HASH: string;
559
548
  /** The band a score falls in. Bands headline; the integer is secondary (§3.6). */
package/dist/index.d.ts CHANGED
@@ -540,20 +540,9 @@ declare function rulesetHash(ruleset: ArsRuleset): string;
540
540
  */
541
541
  declare function evidenceHash(evidence: ArsEvidence): string;
542
542
  /**
543
- * `corpusHash` — SHA-256 over the FROZEN conformance corpus (§3.1). Computing it
544
- * requires reading the corpus directory, which the pure half cannot do, so it is
545
- * a constant regenerated at corpus freeze.
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.
543
+ * Version marker for the ARS 0.2 corpus (spec §2.4.3).
544
+ * This is the hash of the versioned marker string, not of fixture contents.
545
+ * A corpus-content digest replaces it at corpus freeze in a MINOR release.
557
546
  */
558
547
  declare const ARS_CORPUS_HASH: string;
559
548
  /** The band a score falls in. Bands headline; the integer is secondary (§3.6). */