From b144f1a2d32427cc03d56781072df3ed6be271b3 Mon Sep 17 00:00:00 2001 From: "Christopher S. Aondona" Date: Sat, 28 Nov 2026 16:45:37 +0100 Subject: [PATCH 1/2] Make Assay index a getting-started guide --- README.md | 4 +- content/docs/assay/evaluation.mdx | 83 +++++++++++++------------- content/docs/assay/index.mdx | 98 ++++++++++++++++++++++++------- scripts/assay-docs.test.mjs | 16 +++++ scripts/verify-assay-examples.mjs | 2 +- 5 files changed, 138 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index 0daea3f..6583383 100644 --- a/README.md +++ b/README.md @@ -102,9 +102,9 @@ The shared tokens, fonts and base styles in `src/app.css` are synchronized from ## Assay documentation -The Assay collection documents the public release [v0.0.1](https://github.com/0xbuffdev/assay/tree/v0.0.1). Use its package exports, contract types, tests and versioned guides as the technical source of truth. Do not document unreleased behavior as available. +The Assay collection documents the public release [v0.0.1](https://github.com/0xbuffdev/assay/tree/v0.0.1). Use its package exports, contract types, tests and versioned guides as the technical source of truth. Do not document unreleased behavior as available. Public installation commands use the package name without a version suffix; the automated example verifier pins the documented release. -Keep the Assay sidebar compact: installation is the index, evaluation covers criteria and composition, observations covers execution and reviews, integrity covers protected references and disclosure, and two reference pages cover the API and contracts. Use headings within those pages for related topics; add a page only for a distinct reader need. Use sentence-case titles, direct language, explicit prerequisites and expected results. Keep code fragments distinct from complete examples. Use Mermaid for data flows and trust boundaries, not decorative diagrams. +Keep the Assay sidebar compact: Getting started is the index and introduces the product, installation and a short working example; evaluation covers criteria and composition, observations covers execution and reviews, integrity covers protected references and disclosure, and two reference pages cover the API and contracts. Use headings within those pages for related topics; add a page only for a distinct reader need. Use sentence-case titles, direct language, explicit prerequisites and expected results. Keep code fragments distinct from complete examples. Use Mermaid for data flows and trust boundaries, not decorative diagrams. The editorial approach draws on [Vercel's writing guidelines](https://github.com/vercel-labs/writing-guidelines), [Cloudflare's style guide](https://developers.cloudflare.com/style-guide/), [Mintlify's developer documentation checklist](https://www.mintlify.com/library/developer-documentation-best-practices) and [Diátaxis](https://diataxis.fr/). Apply the Content repository's humanizer skill when editing prose. diff --git a/content/docs/assay/evaluation.mdx b/content/docs/assay/evaluation.mdx index c7e83ad..8a574fc 100644 --- a/content/docs/assay/evaluation.mdx +++ b/content/docs/assay/evaluation.mdx @@ -15,9 +15,48 @@ flowchart LR A --> F[Technical result] ``` -## Quick start +Start with the [quick start](/docs/assay#quick-start) for a complete text comparison. -After [installation](/docs/assay), save this example as `calibration.mjs`. It checks a caller-supplied measurement against an inclusive voltage range. +## Criteria + +Every criterion declares an ID, kind, mode, visibility and parameters. Required criteria participate in composition; advisory findings do not. Public criteria may appear in public projections. Restricted objective criteria must use [protected references](/docs/assay/integrity#protected-references). + +| Kind | Observation | Parameters | +| --- | --- | --- | +| exact_text | text | expected | +| normalized_text | text | expected, normalization | +| number_with_tolerance | number | expected, tolerance, optional unit | +| number_range | number | expected, optional unit | +| set_equivalence | set | expected, itemType, order, duplicates | +| boolean_equality | boolean | expected | +| json_equality | json | expected | +| observed_execution | execution | assertions | +| manual_evidence | manual | review: required | +| qualitative_review | qualitative_review | reviewPolicyId, reviewPolicyVersion | + +The first seven kinds compare a literal or content-bound reference expectation. The remaining kinds produce unresolved findings. + +### Text + +Exact comparison uses UTF-16 code-unit equality. Normalized text applies the declared transformations to both values, in this order: line endings (`preserve` or `lf`), case (`sensitive` or `fold`), Unicode (`none`, `NFC` or `NFKC`), whitespace (`preserve` or `collapse`) and trim (`none` or `both`). Case folding uses JavaScript lowercase conversion, not full Unicode case folding. + +### Numbers + +Tolerance is inclusive: the absolute difference must not exceed the greater of the absolute tolerance and the relative tolerance multiplied by the magnitude of the expected value. + +```ts +parameters: { + expected: { type: "literal", value: 100 }, + tolerance: { absolute: 2, relative: 0.05 }, + unit: "mV", +} +``` + +A value of 105 passes; 106 fails. Both tolerances are finite and nonnegative. Numeric ranges specify finite min/max and both inclusion flags; equal endpoints require both flags to be true. Observations must use exactly the declared unit, including its absence. No string coercion or unit conversion occurs. A nonfinite relative bound produces `NUMERIC_OVERFLOW`. + +### Example: numeric range + +This complete example evaluates a caller-supplied measurement against an inclusive voltage range. Save it as `calibration.mjs`. ```js // assay-docs: runnable @@ -79,48 +118,10 @@ if (!evidence.ok) throw new Error("Invalid evidence"); const result = evaluate(definition.value, evidence.value); const view = projectPublicResult(definition.value, result); if (!view.ok) throw new Error("Projection rejected"); -if (view.value.outcome !== "pass") throw new Error("Expected pass"); console.log(view.value.outcome); ``` -Run `node calibration.mjs`. The output is `pass`. Change the observation to 103 and remove the assertion requiring a pass to see `fail`. With no observations, the outcome is `inconclusive`. Changing the unit to V instead of mV rejects the evidence. - -## Criteria - -Every criterion declares an ID, kind, mode, visibility and parameters. Required criteria participate in composition; advisory findings do not. Public criteria may appear in public projections. Restricted objective criteria must use [protected references](/docs/assay/integrity#protected-references). - -| Kind | Observation | Parameters | -| --- | --- | --- | -| exact_text | text | expected | -| normalized_text | text | expected, normalization | -| number_with_tolerance | number | expected, tolerance, optional unit | -| number_range | number | expected, optional unit | -| set_equivalence | set | expected, itemType, order, duplicates | -| boolean_equality | boolean | expected | -| json_equality | json | expected | -| observed_execution | execution | assertions | -| manual_evidence | manual | review: required | -| qualitative_review | qualitative_review | reviewPolicyId, reviewPolicyVersion | - -The first seven kinds compare a literal or content-bound reference expectation. The remaining kinds produce unresolved findings. - -### Text - -Exact comparison uses UTF-16 code-unit equality. Normalized text applies the declared transformations to both values, in this order: line endings (`preserve` or `lf`), case (`sensitive` or `fold`), Unicode (`none`, `NFC` or `NFKC`), whitespace (`preserve` or `collapse`) and trim (`none` or `both`). Case folding uses JavaScript lowercase conversion, not full Unicode case folding. - -### Numbers - -Tolerance is inclusive: the absolute difference must not exceed the greater of the absolute tolerance and the relative tolerance multiplied by the magnitude of the expected value. - -```ts -parameters: { - expected: { type: "literal", value: 100 }, - tolerance: { absolute: 2, relative: 0.05 }, - unit: "mV", -} -``` - -A value of 105 passes; 106 fails. Both tolerances are finite and nonnegative. Numeric ranges specify finite min/max and both inclusion flags; equal endpoints require both flags to be true. Observations must use exactly the declared unit, including its absence. No string coercion or unit conversion occurs. A nonfinite relative bound produces `NUMERIC_OVERFLOW`. +Run `node calibration.mjs`. The output is `pass`. Change the observation to 103 to see `fail`. With no observations, the outcome is `inconclusive`. Changing the unit to V instead of mV rejects the evidence. ### Sets, booleans and JSON diff --git a/content/docs/assay/index.mdx b/content/docs/assay/index.mdx index e47dcc6..eac60b4 100644 --- a/content/docs/assay/index.mdx +++ b/content/docs/assay/index.mdx @@ -1,51 +1,107 @@ --- -title: "Installation" -description: "Install Assay and start evaluating technical evidence." +title: "Getting started" +description: "Learn what Assay does, install it and evaluate your first result." --- -Assay evaluates technical evidence against versioned criteria. It runs offline, has no runtime dependencies, and leaves execution, authorization and decisions to your application. +Assay evaluates technical evidence against criteria you define. Use it to check program output, measurements, structured data and engineering work. -## Requirements +An assessment definition describes what you expect. Evidence contains what you observed. Assay compares the two and returns a technical result with findings for each criterion. It runs offline with no runtime dependencies. -Node.js 24 or later and ECMAScript modules (ESM). Use an `.mjs` file or set `"type": "module"` in your package.json. TypeScript declarations are included. +Your application supplies the evidence and authorizes the criteria. Assay does not execute submitted programs, authenticate observations or award grades. -## Install +## Installation + +Assay requires Node.js 24 or later and ECMAScript modules (ESM). TypeScript declarations are included. ```sh -npm install @0xbuff/assay@0.0.1 +npm install @0xbuff/assay ``` ```sh -pnpm add @0xbuff/assay@0.0.1 +pnpm add @0xbuff/assay ``` ```sh -yarn add @0xbuff/assay@0.0.1 +yarn add @0xbuff/assay ``` -## Verify the installation +## Quick start -Save this as `check.mjs`. +The following example checks whether an observed text value matches the expected output. Save it as `assessment.mjs`. ```js // assay-docs: runnable -import { ASSAY_SCHEMA_VERSION, ASSAY_EVALUATOR_VERSION } from "@0xbuff/assay"; +import { + createAssessmentDefinition, + createEvidenceBundle, + evaluate, +} from "@0xbuff/assay"; + +const definition = createAssessmentDefinition({ + schemaVersion: 4, + assessmentId: "output-check", + revision: "rev1", + policyVersion: "composed-required-v1", + criteria: [{ + id: "output", + kind: "exact_text", + mode: "required", + visibility: "public", + parameters: { expected: { type: "literal", value: "ok" } }, + }], + composition: { + rootGroupId: "root", + groups: [{ + id: "root", + operator: "all", + children: [{ kind: "criterion", id: "output" }], + }], + }, +}); +if (!definition.ok) throw new Error("Invalid definition"); + +const evidence = createEvidenceBundle(definition.value, { + schemaVersion: 4, + observations: [{ + criterionId: "output", + evidenceRef: "observation-1", + kind: "text", + completeness: "complete", + value: "ok", + }], +}); +if (!evidence.ok) throw new Error("Invalid evidence"); + +const result = evaluate(definition.value, evidence.value); +console.log(result.outcome); +``` + +Run the example: -console.log(ASSAY_SCHEMA_VERSION, ASSAY_EVALUATOR_VERSION); +```sh +node assessment.mjs ``` -Run `node check.mjs`. Expected output: +Expected output: ```text -4 v0.0.5 +pass ``` -## Next steps +Change the observation's value to `"error"` to get `fail`, or remove the observation to get `inconclusive`. -- [Evaluation](/docs/assay/evaluation): define criteria, supply evidence and evaluate your first result. -- [Observations](/docs/assay/observations): integrate captured execution facts, optional adapters and reviews. -- [Integrity and security](/docs/assay/integrity): protect expectations and control disclosure. +## What happened + +1. `createAssessmentDefinition` validates the criterion and seals the definition. +2. `createEvidenceBundle` binds the observation to that definition. +3. `evaluate` verifies the records, compares the values and combines the required findings. + +Keep the full evaluation result private. Use [public projection](/docs/assay/integrity#public-projection) and authorize disclosure before returning findings to users. + +## Next steps -These pages describe release `0.0.1`, schema 4, evaluator semantics `v0.0.5` and policy `composed-required-v1`. Older schemas are unsupported. Pin the package and keep your lockfile for reproducibility. +- [Evaluation](/docs/assay/evaluation): define comparisons, combine criteria and interpret outcomes. +- [Observations](/docs/assay/observations): supply execution facts, collect observations and record reviews. +- [API reference](/docs/assay/api): look up available functions and types. -[Source](https://github.com/0xbuffdev/assay) · [Changelog](https://github.com/0xbuffdev/assay/blob/v0.0.1/CHANGELOG.md) · [Apache-2.0 license](https://github.com/0xbuffdev/assay/blob/v0.0.1/LICENSE) +[Source](https://github.com/0xbuffdev/assay) · [Changelog](https://github.com/0xbuffdev/assay/blob/main/CHANGELOG.md) · [License](https://github.com/0xbuffdev/assay/blob/main/LICENSE) diff --git a/scripts/assay-docs.test.mjs b/scripts/assay-docs.test.mjs index e7058f7..ae87266 100644 --- a/scripts/assay-docs.test.mjs +++ b/scripts/assay-docs.test.mjs @@ -27,3 +27,19 @@ test("Assay internal links resolve and complete examples are marked", async () = } assert.ok(runnable >= 5, "Expected complete executable examples"); }); + +test("Getting started introduces Assay and installs the current package", async () => { + const source = await readFile(join(directory, "index.mdx"), "utf8"); + assert.match(source, /^title: "Getting started"$/m); + for (const heading of ["Installation", "Quick start"]) { + assert.ok(source.includes("## " + heading)); + } + for (const command of ["npm install", "pnpm add", "yarn add"]) { + assert.ok(source.includes(command + " @0xbuff/assay\n"), command); + } + for (const file of files) { + const text = await readFile(join(directory, file), "utf8"); + assert.doesNotMatch(text, /(?:npm install|pnpm add|yarn add)\s+@0xbuff\/assay@\S+/, file); + } + assert.match(source, /const result = evaluate\(/); +}); diff --git a/scripts/verify-assay-examples.mjs b/scripts/verify-assay-examples.mjs index 6561b67..a56e2b0 100644 --- a/scripts/verify-assay-examples.mjs +++ b/scripts/verify-assay-examples.mjs @@ -9,7 +9,7 @@ const version = "0.0.1"; const directory = "content/docs/assay"; const temporary = await mkdtemp(join(tmpdir(), "assay-docs-")); const expected = new Map([ - ["index.mdx", ["4 v0.0.5"]], + ["index.mdx", ["pass"]], ["evaluation.mdx", ["pass"]], ["observations.mdx", ["pass", "pass"]], ["integrity.mdx", ["pass withheld"]], From 0648b28e4c57b51b088869708d17baf4a8dad381 Mon Sep 17 00:00:00 2001 From: "Christopher S. Aondona" Date: Sat, 28 Nov 2026 16:49:20 +0100 Subject: [PATCH 2/2] Separate introduction and getting started in flat Assay navigation --- README.md | 2 +- content/docs/assay/evaluation.mdx | 2 +- content/docs/assay/getting-started.mdx | 102 ++++++++++++++++++++++ content/docs/assay/index.mdx | 112 +++++-------------------- content/docs/assay/meta.json | 2 +- scripts/assay-docs.test.mjs | 12 ++- scripts/verify-assay-examples.mjs | 2 +- 7 files changed, 134 insertions(+), 100 deletions(-) create mode 100644 content/docs/assay/getting-started.mdx diff --git a/README.md b/README.md index 6583383..09b1a2a 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ The shared tokens, fonts and base styles in `src/app.css` are synchronized from The Assay collection documents the public release [v0.0.1](https://github.com/0xbuffdev/assay/tree/v0.0.1). Use its package exports, contract types, tests and versioned guides as the technical source of truth. Do not document unreleased behavior as available. Public installation commands use the package name without a version suffix; the automated example verifier pins the documented release. -Keep the Assay sidebar compact: Getting started is the index and introduces the product, installation and a short working example; evaluation covers criteria and composition, observations covers execution and reviews, integrity covers protected references and disclosure, and two reference pages cover the API and contracts. Use headings within those pages for related topics; add a page only for a distinct reader need. Use sentence-case titles, direct language, explicit prerequisites and expected results. Keep code fragments distinct from complete examples. Use Mermaid for data flows and trust boundaries, not decorative diagrams. +Keep the Assay sidebar compact: Introduction is the index and explains the product; Getting started covers installation and a short working example; evaluation covers criteria and composition, observations covers execution and reviews, integrity covers protected references and disclosure, and two reference pages cover the API and contracts. Keep navigation flat, without nested folders or collapsible sections. Use headings within pages for related topics; add a page only for a distinct reader need. Use sentence-case titles, direct language, explicit prerequisites and expected results. Keep code fragments distinct from complete examples. Use Mermaid for data flows and trust boundaries, not decorative diagrams. The editorial approach draws on [Vercel's writing guidelines](https://github.com/vercel-labs/writing-guidelines), [Cloudflare's style guide](https://developers.cloudflare.com/style-guide/), [Mintlify's developer documentation checklist](https://www.mintlify.com/library/developer-documentation-best-practices) and [Diátaxis](https://diataxis.fr/). Apply the Content repository's humanizer skill when editing prose. diff --git a/content/docs/assay/evaluation.mdx b/content/docs/assay/evaluation.mdx index 8a574fc..cc68e84 100644 --- a/content/docs/assay/evaluation.mdx +++ b/content/docs/assay/evaluation.mdx @@ -15,7 +15,7 @@ flowchart LR A --> F[Technical result] ``` -Start with the [quick start](/docs/assay#quick-start) for a complete text comparison. +Start with the [quick start](/docs/assay/getting-started#quick-start) for a complete text comparison. ## Criteria diff --git a/content/docs/assay/getting-started.mdx b/content/docs/assay/getting-started.mdx new file mode 100644 index 0000000..689e32b --- /dev/null +++ b/content/docs/assay/getting-started.mdx @@ -0,0 +1,102 @@ +--- +title: "Getting started" +description: "Install Assay and evaluate your first result." +--- + +This guide takes you from installation to a working text comparison. + +## Installation + +Assay requires Node.js 24 or later and ECMAScript modules (ESM). TypeScript declarations are included. + +```sh +npm install @0xbuff/assay +``` + +```sh +pnpm add @0xbuff/assay +``` + +```sh +yarn add @0xbuff/assay +``` + +## Quick start + +The following example checks whether an observed text value matches the expected output. Save it as `assessment.mjs`. + +```js +// assay-docs: runnable +import { + createAssessmentDefinition, + createEvidenceBundle, + evaluate, +} from "@0xbuff/assay"; + +const definition = createAssessmentDefinition({ + schemaVersion: 4, + assessmentId: "output-check", + revision: "rev1", + policyVersion: "composed-required-v1", + criteria: [{ + id: "output", + kind: "exact_text", + mode: "required", + visibility: "public", + parameters: { expected: { type: "literal", value: "ok" } }, + }], + composition: { + rootGroupId: "root", + groups: [{ + id: "root", + operator: "all", + children: [{ kind: "criterion", id: "output" }], + }], + }, +}); +if (!definition.ok) throw new Error("Invalid definition"); + +const evidence = createEvidenceBundle(definition.value, { + schemaVersion: 4, + observations: [{ + criterionId: "output", + evidenceRef: "observation-1", + kind: "text", + completeness: "complete", + value: "ok", + }], +}); +if (!evidence.ok) throw new Error("Invalid evidence"); + +const result = evaluate(definition.value, evidence.value); +console.log(result.outcome); +``` + +Run the example: + +```sh +node assessment.mjs +``` + +Expected output: + +```text +pass +``` + +Change the observation's value to `"error"` to get `fail`, or remove the observation to get `inconclusive`. + +## What happened + +1. `createAssessmentDefinition` validates the criterion and seals the definition. +2. `createEvidenceBundle` binds the observation to that definition. +3. `evaluate` verifies the records, compares the values and combines the required findings. + +Keep the full evaluation result private. Use [public projection](/docs/assay/integrity#public-projection) and authorize disclosure before returning findings to users. + +## Next steps + +- [Evaluation](/docs/assay/evaluation): define comparisons, combine criteria and interpret outcomes. +- [Observations](/docs/assay/observations): supply execution facts, collect observations and record reviews. +- [API reference](/docs/assay/api): look up available functions and types. + diff --git a/content/docs/assay/index.mdx b/content/docs/assay/index.mdx index eac60b4..2bf83f7 100644 --- a/content/docs/assay/index.mdx +++ b/content/docs/assay/index.mdx @@ -1,107 +1,35 @@ --- -title: "Getting started" -description: "Learn what Assay does, install it and evaluate your first result." +title: "Introduction" +description: "Understand what Assay evaluates and how it fits into your application." --- -Assay evaluates technical evidence against criteria you define. Use it to check program output, measurements, structured data and engineering work. +Assay evaluates technical evidence against criteria you define. It returns reproducible findings that describe whether observed results match your expectations. -An assessment definition describes what you expect. Evidence contains what you observed. Assay compares the two and returns a technical result with findings for each criterion. It runs offline with no runtime dependencies. +Use Assay to check program output, verify measurements, compare structured data or build assessment systems. It runs offline and has no runtime dependencies. -Your application supplies the evidence and authorizes the criteria. Assay does not execute submitted programs, authenticate observations or award grades. +## How it works -## Installation - -Assay requires Node.js 24 or later and ECMAScript modules (ESM). TypeScript declarations are included. - -```sh -npm install @0xbuff/assay -``` - -```sh -pnpm add @0xbuff/assay -``` - -```sh -yarn add @0xbuff/assay -``` - -## Quick start - -The following example checks whether an observed text value matches the expected output. Save it as `assessment.mjs`. - -```js -// assay-docs: runnable -import { - createAssessmentDefinition, - createEvidenceBundle, - evaluate, -} from "@0xbuff/assay"; - -const definition = createAssessmentDefinition({ - schemaVersion: 4, - assessmentId: "output-check", - revision: "rev1", - policyVersion: "composed-required-v1", - criteria: [{ - id: "output", - kind: "exact_text", - mode: "required", - visibility: "public", - parameters: { expected: { type: "literal", value: "ok" } }, - }], - composition: { - rootGroupId: "root", - groups: [{ - id: "root", - operator: "all", - children: [{ kind: "criterion", id: "output" }], - }], - }, -}); -if (!definition.ok) throw new Error("Invalid definition"); - -const evidence = createEvidenceBundle(definition.value, { - schemaVersion: 4, - observations: [{ - criterionId: "output", - evidenceRef: "observation-1", - kind: "text", - completeness: "complete", - value: "ok", - }], -}); -if (!evidence.ok) throw new Error("Invalid evidence"); - -const result = evaluate(definition.value, evidence.value); -console.log(result.outcome); -``` - -Run the example: - -```sh -node assessment.mjs -``` - -Expected output: - -```text -pass +```mermaid +flowchart LR + D[Assessment definition] --> E[Assay] + O[Evidence] --> E + E --> R[Technical result] ``` -Change the observation's value to `"error"` to get `fail`, or remove the observation to get `inconclusive`. +An assessment definition specifies the expected results and how required checks are combined. Evidence contains the observed values. Assay validates the records, compares the values and returns a finding for each criterion and an overall technical outcome. -## What happened +## Capabilities -1. `createAssessmentDefinition` validates the criterion and seals the definition. -2. `createEvidenceBundle` binds the observation to that definition. -3. `evaluate` verifies the records, compares the values and combines the required findings. +- Compare text, numbers, sets, booleans and JSON. +- Combine required criteria using all or any groups. +- Evaluate captured execution facts and collect observations through a host-supplied adapter. +- Record advisory human or model reviews. +- Protect expected values, verify content digests and project public results. -Keep the full evaluation result private. Use [public projection](/docs/assay/integrity#public-projection) and authorize disclosure before returning findings to users. +Your application supplies evidence, authorizes criteria and decides how to use the findings. Assay does not execute submitted programs, authenticate observations, assign grades or issue credentials. -## Next steps +## Get started -- [Evaluation](/docs/assay/evaluation): define comparisons, combine criteria and interpret outcomes. -- [Observations](/docs/assay/observations): supply execution facts, collect observations and record reviews. -- [API reference](/docs/assay/api): look up available functions and types. +Follow [Getting started](/docs/assay/getting-started) to install Assay and run your first evaluation. [Source](https://github.com/0xbuffdev/assay) · [Changelog](https://github.com/0xbuffdev/assay/blob/main/CHANGELOG.md) · [License](https://github.com/0xbuffdev/assay/blob/main/LICENSE) diff --git a/content/docs/assay/meta.json b/content/docs/assay/meta.json index 9798eb5..82abb3f 100644 --- a/content/docs/assay/meta.json +++ b/content/docs/assay/meta.json @@ -4,10 +4,10 @@ "root": true, "pages": [ "index", + "getting-started", "evaluation", "observations", "integrity", - "---Reference---", "api", "contracts" ] diff --git a/scripts/assay-docs.test.mjs b/scripts/assay-docs.test.mjs index ae87266..c5f4f1d 100644 --- a/scripts/assay-docs.test.mjs +++ b/scripts/assay-docs.test.mjs @@ -9,9 +9,9 @@ const pages = new Set(files.map((name) => name.slice(0, -4))); test("Assay has distinct entry, task, explanation and reference pages", async () => { const meta = JSON.parse(await readFile(join(directory, "meta.json"), "utf8")); - const listed = meta.pages.filter((entry) => !entry.startsWith("---")); + const listed = meta.pages; assert.deepEqual([...listed].sort(), [...pages].sort()); - assert.deepEqual(listed, ["index", "evaluation", "observations", "integrity", "api", "contracts"]); + assert.deepEqual(listed, ["index", "getting-started", "evaluation", "observations", "integrity", "api", "contracts"]); }); test("Assay internal links resolve and complete examples are marked", async () => { @@ -28,8 +28,12 @@ test("Assay internal links resolve and complete examples are marked", async () = assert.ok(runnable >= 5, "Expected complete executable examples"); }); -test("Getting started introduces Assay and installs the current package", async () => { - const source = await readFile(join(directory, "index.mdx"), "utf8"); +test("Introduction and Getting started have distinct purposes", async () => { + const intro = await readFile(join(directory, "index.mdx"), "utf8"); + assert.match(intro, /^title: "Introduction"$/m); + assert.doesNotMatch(intro, /(?:npm install|pnpm add|yarn add)\s+@0xbuff\/assay/); + assert.ok(intro.includes("/docs/assay/getting-started")); + const source = await readFile(join(directory, "getting-started.mdx"), "utf8"); assert.match(source, /^title: "Getting started"$/m); for (const heading of ["Installation", "Quick start"]) { assert.ok(source.includes("## " + heading)); diff --git a/scripts/verify-assay-examples.mjs b/scripts/verify-assay-examples.mjs index a56e2b0..49e1f50 100644 --- a/scripts/verify-assay-examples.mjs +++ b/scripts/verify-assay-examples.mjs @@ -9,7 +9,7 @@ const version = "0.0.1"; const directory = "content/docs/assay"; const temporary = await mkdtemp(join(tmpdir(), "assay-docs-")); const expected = new Map([ - ["index.mdx", ["pass"]], + ["getting-started.mdx", ["pass"]], ["evaluation.mdx", ["pass"]], ["observations.mdx", ["pass", "pass"]], ["integrity.mdx", ["pass withheld"]],