fix: make pair update self-consistent for the dogfooded root install#346
Conversation
Code Review — PR #346: fix: make
|
6962a9b to
a39cb20
Compare
Remediation — review round 1 resolvedAll review findings addressed (+ a correction on agent-browser). Every gate re-run locally and green; agent-browser is now PRESERVED (correction of finding #1 / earlier PR note)Root-cause fix instead of accepting the deletion:
Findings
Gates (re-run)content-ops 633 · pair-cli 836 (incl. #238) · knowledge-hub 206 + |
Code Review (round 2) — PR #346: fix: make
|
pair update now regenerates a root .pair/ that equals the real content-ops transform of the dataset, is link-correct, and idempotent. - content-ops: rewriteSkillLinkPaths + buildSkillLinkPathMap convert .skills/<cat>/<name>/SKILL.md links to .claude/skills/pair-<...> in copied non-.skills registries (.pair/knowledge); threaded through copy pipeline + CLI. - config: the `skills` registry uses behavior `overwrite` (not `mirror`) so the shared .claude/skills/ dir keeps third-party / user-installed skills (e.g. agent-browser) — overwrite updates/adds pair skills but never runs stale cleanup. Renamed/removed pair skills are cleaned up manually (rare, human-gated). - dataset skills-guide.md: the 2 hand-curated spans authored so the mechanical transform reproduces the correct installed form — no manual test overrides. - conformance: secret-scanning + skills-guide-mirror assert root == realTransform(dataset) via the content-ops functions (single source); skills-guide-mirror delegates map construction to the production builder. - check:links now also gates the generated root .pair/knowledge/ (read-only). - regenerated root install from pair update (reconciles pre-existing staleness). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a39cb20 to
c54cd05
Compare
Simplified: agent-browser preserved via config, not codePer maintainer direction, the two-layer ownership code from round 1 (prefix-scoped mirror cleanup + manifest-aware CLI deletion) is reverted. The shared-skills-dir preservation is now handled purely by configuration:
Tests: content-ops now has "preserves a foreign (non-source) entry under overwrite behavior"; the prefix-change mirror test is restored; Gates (re-run): content-ops 633 · pair-cli 836 · knowledge-hub 206 + check:links (dataset+root) · skills:conformance 36 · docs:staleness · lint 6/6. The self-consistency core (link-path conversion, root==realTransform(dataset), check:links over the generated root, findings #2/#3/#4) is unchanged from the round-2 approval. |
Summary
Makes
pair updateproduce a root.pair/install that equals the real content-ops transform of the dataset, is link-correct, and idempotent — so the dogfooded tree is regenerated by the tool, and the conformance tests validate the dataset (source) through that same transform.Why
Running
pair updateon this repo previously broke 3 conformance tests, would have produced broken links, and deleted the third-partyagent-browserskill. Causes: the copy pipeline rewrote skill/commandsin.pair/knowledge/but not markdown link PATHS; twoskills-guide.mdspans were hand-curated; and the.skillsregistry usedmirror, which reaps any non-source entry from the shared.claude/skills/dir.What changed
rewriteSkillLinkPaths+buildSkillLinkPathMapconvert.skills/<cat>/<name>/SKILL.mdlinks to.claude/skills/pair-<...>in copied non-.skillsregistries; threaded through the copy pipeline + CLI.skillsregistrybehavioris nowoverwrite(wasmirror). Stale cleanup runs only undermirror, sooverwriteupdates/adds pair skills but never deletes — third-party / user-installed skills in the shared.claude/skills/dir (e.g.agent-browser) survive. Trade-off: a renamed/removed pair skill leaves its old dir, cleaned up manually (rare, human-gated).skills-guide.md— the 2 hand-curated spans authored so the mechanical transform reproduces the correct installed form (no manual test overrides).secret-scanning+skills-guide-mirrorassertroot == realTransform(dataset)via the content-ops functions (single source);skills-guide-mirrordelegates map construction to the production builder..pair/knowledge/(read-only).pair update(reconciles pre-existing staleness).Verification (all green, local)
content-ops 633 · pair-cli 836 · knowledge-hub 206 +
check:linkson dataset AND root · skills:conformance 36 · docs:staleness · lint 6/6. Idempotent; a foreign skill (agent-browser + a synthetic one) survivespair update— empirically verified.Reviewer notes
@pair/content-opslink-path conversion (consumer install pipeline). The agent-browser preservation is config-only (no ownership code).pair updateemits it (idempotency).See the PR comments for the review-round history (round 2 approved; then simplified to config-only per maintainer direction).
🤖 Generated with Claude Code