Skip to content

fix(check): skip links in code samples, and say what approve turns on - #60

Merged
tenphi merged 2 commits into
mainfrom
claude/ecstatic-cori-peq9hk
Nov 21, 2026
Merged

tenphi merged 2 commits into
mainfrom
claude/ecstatic-cori-peq9hk

Conversation

@tenphi

@tenphi tenphi commented Nov 21, 2026

Copy link
Copy Markdown
Owner

In short

What changed

check and code samples (#55)

  • src/check.ts: before it matches links, withoutCode() blanks fenced code blocks (backtick and tilde fences) and code spans.
    • A fence closes on the same character, at least as long, with nothing after it. A fence that is never closed runs to the end of the page, as in CommonMark.
    • A fence may be indented, as in a list item; its closing fence may be indented at most 3 columns more.
    • Code spans become spaces, so [a] and (b.md) around a span cannot join into a link.
    • Indented code blocks still count: telling one from a list item's paragraph needs a full Markdown parser. The spec and the changeset say to put a sample link in a fence.
  • test/check.test.ts: the issue's case, tilde fences, code spans, a fence in a nested list item, a real missing link that still fails, and an unclosed fence. Both new tests fail without the fix.
  • Spec 2.10 says which links check skips. npm run sync updated the docs hash in the lock.
  • Not in scope: check: docs built at prepack go unchecked, and links to files the tarball leaves out pass #52 (.mdx pages, docs built at prepack).

What approve does (#57)

Checked against the code: trustOf() reads only trust, the block lists the tools of trusted packages, and only allow rules, hooks and MCP servers are held back.

  • docs/guide/getting-started.mdx: step 2 says the scripts work after trust and a sync, with the agent's usual prompt; step 3 is "Turn on the rest", and says what approve writes.
  • docs/guide/setup.md: the same in "In short" and the two trust steps.

Checks

npm run typecheck, npm test (120 pass), npm run check, npm run docs:doctor, npm run build:docs and npm run docs:check.

Found while adding harnesspm to Cookbook: tenphi/cookbook#210.


Generated by Claude Code

- check blanks fenced code blocks and code spans before it checks links, so a sample link no longer fails prepack (#55). An unclosed fence runs to the end of the page, as in CommonMark; indented code blocks still count.
- The getting-started and setup guides say that trust turns a package's scripts on, and approve writes what an agent may not grant itself (#57).

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

# Conflicts:
#	docs/spec/02-package-format.md
#	harnesspm.lock.json
#	src/check.ts
@github-actions

Copy link
Copy Markdown
Contributor

📦 Snapshot release

Published 0.0.0-snapshot.5cf0850.

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

@tenphi
tenphi merged commit 6bb3968 into main Nov 21, 2026
4 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 21, 2026

This branch was previously deployed

1 inactive deployment
release — 95f87438 Deployed Nov 21, 2026 by tenphi via Snapshot release #90
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.

docs: "Use a harness" says approve turns the tools on, but trust already does check: links inside code samples are reported as missing files

2 participants