Skip to content

fix(lock): hash only the llms.txt and pages of a docs unit - #15

Merged
tenphi merged 2 commits into
mainfrom
claude/clever-lovelace-wz2ua2
Nov 16, 2026
Merged

tenphi merged 2 commits into
mainfrom
claude/clever-lovelace-wz2ua2

Conversation

@tenphi

@tenphi tenphi commented Nov 16, 2026

Copy link
Copy Markdown
Owner

What changed

The lock's hash of a docs unit now covers only the docs unit's content: its llms.txt and its .md and .mdx pages. Before, it covered every file in the docs folder.

  • src/lock.ts: hashDir takes a filter. Docs units pass isDocsFile. Skills keep hashing every file, because a skill's supporting files are part of the skill.
  • Spec 6.3 says what a docs unit's content hash covers, and links to 2.7.
  • A test in test/sync.test.ts, written first and failing on main: a source or test file next to the pages leaves the lock as it is, while a page or llms.txt changes it.
  • A patch changeset.

Why

UI Kit (cube-js/cube-ui-kit#1643) keeps its pages next to its components and points docs at ../src, as spec 2.7 allows. Every change to a .tsx file then changed the uikit:docs hash, so:

  • any UI Kit PR that touched src/ failed CI's harnesspm sync --check until it re-synced and committed the lock;
  • parallel PRs would conflict on that one lock line.

It showed up when a test-only fix on that PR failed the lint job with harnesspm.lock.json is out of date.

Compatibility

  • A docs folder with only llms.txt and pages keeps its hash, so most locks do not change.
  • A docs folder that holds other files gets a new hash once. The next sync rewrites it, and the pnpm install that brings this version runs that sync in prepare.
  • Nothing else reads the hash but the telemetry sync event's changed list. It now reports a docs unit as changed only when its pages do.

Verification

  • npm run typecheck, npm test (85 tests) and npm run check pass. npm run sync updated this repo's lock for the spec change.
  • The new test fails on main with "a source or test file is not a docs page" (sync --check exits 1) and passes with the fix.
  • On UI Kit's branch, run from this branch's source: the first sync changes one line of the lock (uikit:docs), and the Glaze and Tasty docs hashes stay the same. After that, a test-file edit passes sync --check, while a .docs.mdx edit still fails it, as it should.

Generated by Claude Code

The lock hashed every file in a docs folder. A package that points
`docs` at its source folder, with pages next to the code, as UI Kit
does with `docs: "../src"`, got a stale lock from every change to a
source or test file, so `sync --check` failed on unrelated pull
requests.

A docs unit is its `llms.txt` and its `.md` and `.mdx` pages (spec
2.7), so its hash now covers only those. Spec 6.3 says so. A docs
folder of only pages keeps its hash.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gr8S7GamurMRrRt4fBQ4Zy
@github-actions

Copy link
Copy Markdown
Contributor

📦 Snapshot release

Published 0.0.0-snapshot.3fefb7a.

npx @tenphi/[email protected] --help
npm install -D @tenphi/[email protected]

@tenphi
tenphi merged commit 75d904d into main Nov 16, 2026
4 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 16, 2026
tenphi pushed a commit to cube-js/cube-ui-kit that referenced this pull request Nov 16, 2026
harnesspm 0.4.2 hashes a docs unit by its llms.txt and its .md and
.mdx pages only (tenphi/harnesspm#15). UI Kit's harness indexes
`docs: "../src"`, so before, every change to a component or test
file made the lock stale and failed `harnesspm sync --check` in CI.

`harnesspm sync` rewrote the `uikit:docs` hash once, and harnesspm's
own docs and skills hashes for the new version.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gr8S7GamurMRrRt4fBQ4Zy

This branch was previously deployed

1 inactive deployment
release — 351fdbe4 Deployed Nov 16, 2026 by tenphi via Snapshot release #38
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.

2 participants