Implements SC2/SC3/SC5b/SC7 + additive-field invariant for the v4.2
annotation pipeline:
Fixtures (tests/fixtures/annotation/):
- annotation-brief.md — brief-validator-clean fixture
- annotation-plan.md — plan-validator-clean (2 steps)
- annotation-review.md — review-validator-clean
- annotation-plan-large.md — 51 steps (SC3 scale fixture)
Integration tests:
- tests/integration/annotation-roundtrip.test.mjs — 7 cases:
SC2 byte-identical empty round-trip across brief/plan/review,
SC3 scale (51 steps + 100 anchors) round-trip,
SC7 parseAnchors(stripAnchors(addAnchors(...))) === [] per target.
- tests/integration/schema-rollback.test.mjs — 4 cases:
SC5b validator-FAIL -> revisionGuard rolls back byte-identical
(sha256 invariant) for brief/plan/review + cross-target sweep.
.local.bak deleted on rollback path (validator-PASS path tested
in lib/util/revision-guard tests).
- tests/lib/source-annotations.test.mjs — 6 cases mirroring
tests/lib/source-findings.test.mjs additive-field pattern: each
validator (brief/plan/review) accepts source_annotations as
additive-optional, parser extracts as array of dicts, entries
conform to documented shape, baseline forward-compat (artifacts
without source_annotations still validate).
Verify: node --test tests/integration/annotation-roundtrip.test.mjs
tests/integration/schema-rollback.test.mjs
tests/lib/source-annotations.test.mjs -> 17 pass / 0 fail.
Full npm test: 577 pass / 0 fail / 2 skipped (Docker).
Refs plan.md Step 7 + plan-critic M4 + plan-critic B4.
972 B
972 B
| type | brief_version | task | slug | research_topics | research_status |
|---|---|---|---|---|---|
| trekbrief | 1.0 | Demo task for annotation round-trip fixture | annotation-brief-demo | 0 | complete |
Demo brief for annotation round-trip
This fixture is used by tests/integration/annotation-roundtrip.test.mjs
to verify SC2 (byte-identical empty-anchor round-trip) and SC7 (per-target
isolation against validateBrief).
It carries no anchors. The round-trip test runs:
stripAnchors(addAnchors(body, [])) === body.
Intent
Provide a minimal brief that validates against brief-validator.mjs so
the round-trip integration test has a real artifact to revise.
Goal
The brief should validate cleanly (no errors, no warnings) and contain enough body text that adding an anchor and stripping it back is a non-trivial operation.
Success Criteria
- File parses via
parseDocument. validateBriefreturnsvalid: true.stripAnchors(addAnchors(body, []))is byte-identical to body.