Skip to content

feat(atlas): release-truth doctor + error-atlas acceptance harness + loader hardening#5

Merged
templetwo merged 1 commit into
mainfrom
dogfood/v0.10-release-truth-atlas-harness
Jun 17, 2026
Merged

feat(atlas): release-truth doctor + error-atlas acceptance harness + loader hardening#5
templetwo merged 1 commit into
mainfrom
dogfood/v0.10-release-truth-atlas-harness

Conversation

@templetwo

Copy link
Copy Markdown
Owner

Dogfood of T2Helix v0.10.0 against its own repo. The mission premise held: the README lagged the implementation, and probing the atlas loader surfaced a real robustness bug. Both are now fixed, detectable, and locked by tests.

What changed

Loader hardening (lib/atlas.js, scripts/import-atlas.js)

  • importAtlas() now wraps record() per-entry: a throw (e.g. content over the 100KB MAX_CONTENT_BYTES cap) is counted as a dropped row (fingerprint only, no content leak) instead of aborting the whole batch. Found by dogfood — a single 300KB line previously killed the entire load and stranded every valid entry after it. Restores the loader's "load the valid subset, report the rest" contract.
  • New pure detectConflicts() + a conflicts field on the return: same-pattern / different-resolution entries are surfaced (CLI warns on stderr) instead of silently buried. Both still load (append-only — an error can have more than one valid fix); the resolution text is never exposed (secret-bearing), only pattern + fingerprints.

Acceptance matrix (test/atlas-acceptance.js, +15 tests)

  • Explicit 12-case matrix: valid minimal / dense-with-extra-fields / duplicate-same-resolution / duplicate-conflicting-resolution / missing pattern / missing resolution / non-string pattern / non-string resolution / huge-entry-does-not-abort-the-batch / malformed JSON / empty-array+empty-file / mixed valid+invalid, plus two CLI end-to-end cases (huge → exit 1 partial, conflict → exit 0 + stderr).

Release-truth doctor (scripts/release-doctor.js, npm run release:doctor)

  • Verifies README/docs prose against machine sources: package↔CHANGELOG version, README version currency, tool count (static TOOLS-registry parse — not a server spawn, which can truncate a one-shot tools/list on stdin-close), hook count, test count (live or non-brittle), Node range vs engines, atlas-documented, manifest-version. Exits nonzero on drift. First run caught: stale "203 tests total", README changelog lagging 6 versions, manifest has no version field.

Doc truth (README.md, package.json)

  • Reworded the brittle hardcoded test count, fixed the npm test suite list, added a "Current release: v0.10.0 → CHANGELOG" pointer. release:doctor now reports STATUS: TRUE.

Receipts

  • npm test268 passed, 0 failed (was 253; +15 acceptance). No existing behavior changed; the importAtlas return-shape addition is non-breaking (existing 18 import-atlas tests untouched).
  • npm run release:doctorSTATUS: TRUE, exit 0.
  • Adversarial diff review (18 agents across 4 dimensions, each finding independently verified) — 0 confirmed findings.

Open follow-up (not in this PR)

Give .claude-plugin/plugin.json a version field synced from package.json — the first concrete surface of "should there be a single machine-readable release-truth source?", and it upgrades the doctor's manifest↔package check from informational to a hard cross-check.

🤖 Generated with Claude Code

…loader hardening

Dogfood of T2Helix v0.10.0 against its own repo. Three threads:

LOADER HARDENING (lib/atlas.js, scripts/import-atlas.js)
- Isolate per-record failures in importAtlas(): a thrown record() (e.g. content
  over the 100KB MAX_CONTENT_BYTES cap) is now counted as `dropped` (fingerprint
  only, no content leak) instead of aborting the whole batch and stranding the
  valid entries after it. Found by dogfood: a single 300KB line previously killed
  the entire load. Restores the "load the valid subset, report the rest" contract.
- detectConflicts(): same-pattern / different-resolution entries are SURFACED
  (importAtlas() returns `conflicts`; the CLI warns on stderr) instead of silently
  buried. Both still load (append-only — an error can have >1 valid fix); the
  resolution text is never exposed (secret-bearing field), only pattern + fps.

ACCEPTANCE MATRIX (test/atlas-acceptance.js, +15 tests)
- Explicit 12-case matrix: valid minimal / dense-with-extra-fields / duplicate
  same-resolution / duplicate CONFLICTING-resolution / missing pattern / missing
  resolution / non-string pattern / non-string resolution / huge-entry-does-not-
  abort-the-batch / malformed JSON / empty-array+empty-file / mixed valid+invalid,
  plus two CLI end-to-end cases (huge→exit 1 partial, conflict→exit 0 + stderr).

RELEASE-TRUTH DOCTOR (scripts/release-doctor.js, npm run release:doctor)
- Verifies README/docs prose against machine sources: package↔CHANGELOG version,
  README version currency, tool count (static TOOLS-registry parse — not a server
  spawn, which can truncate a one-shot tools/list on stdin-close), hook count,
  test count (live or non-brittle), Node range vs engines, atlas-documented,
  manifest-version. Exit nonzero on any drift. Caught: stale "203 tests total",
  README changelog lagging 6 versions, manifest has no version field.

DOC TRUTH (README.md, package.json)
- Reworded the brittle hardcoded test count, fixed the npm-test suite list, added
  a "Current release: v0.10.0 → CHANGELOG" pointer. release:doctor now STATUS:TRUE.

Suite 268 green (was 253). No existing behavior changed; all additions backward
compatible (the importAtlas return-shape addition is non-breaking).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@templetwo
templetwo merged commit 427b3e3 into main Jun 17, 2026
8 checks passed
templetwo pushed a commit that referenced this pull request Jun 17, 2026
…ce harness

Patch release for the hardening/verification merged in #5 (no behavior change):
- lib/atlas.js: oversized entry isolated as a dropped row, no longer aborts the batch
- lib/atlas.js: detectConflicts() surfaces divergent-resolution duplicates
- scripts/release-doctor.js + npm run release:doctor
- test/atlas-acceptance.js (15-case matrix)
- README release-truth corrections

Validated by the new doctor: release:doctor STATUS:TRUE (version 0.10.1 consistent
across package.json / CHANGELOG / README). Suite 268 green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@templetwo
templetwo deleted the dogfood/v0.10-release-truth-atlas-harness branch July 14, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant