Commit Graph
4 Commits
Author SHA1 Message Date
Aron PrinsandClaude Sonnet 4.6 e46c6631e0 fix(sync): teach verify-edit to resolve hermes-local/hermes-gateway → packages/adapters/hermes
The hermes adapter package was consolidated under packages/adapters/hermes/
in v2026.626.0, but the doc files keep the hermes-local.md and
hermes-gateway.md names. verify-edit.mjs derives the source path from the
doc basename, so it was searching packages/adapters/hermes-local and
packages/adapters/hermes-gateway (non-existent) and flagging all claims as
unverified — false positives.

Fix: add an adapter_doc_sources map to anchor-map.json that overrides the
source-path lookup for these two docs, and update fetchAdapterFiles() to
read and apply that map before falling back to the default
packages/adapters/${adapter} pattern.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-06-27 10:01:22 +02:00
Aron PrinsandClaude Opus 4.8 4ed3a26ff8 sync: bring verify-edit in line + scan adapter package sources
Two follow-ups to the server/src env-var scan widening:

1. verify-edit.mjs had its own copy of shouldFetchEnvSource with the same
   narrow server allowlist — apply the identical server/src/**/*.ts widening
   so the verify phase stops emitting unverified env-var false positives.

2. Both scripts now also scan all non-test packages/adapters/<name>/src/**/*.ts.
   Adapter packages read env vars directly in their server/index modules —
   e.g. SANDBOX_INSTALL_COMMAND (packages/adapters/{pi,claude,gemini,cursor}-local/src/...)
   and per-runtime API-key fallbacks — which the old allowlist never fetched.

Verified against parent v2026.618.0:
- check-drift: 0 drift (65 env vars checked).
- verify-edit docs/reference/adapters/sandbox-providers.md: 6/6 claims verified
  (SANDBOX_INSTALL_COMMAND, previously unverified, now resolves).
- sync:test 33/33.

Selection grows to ~452 files, still well under the 700 cap.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-19 09:48:43 +02:00
Aron Prins 52542db923 Fix sync verification edge cases 2026-05-13 21:46:12 +02:00
Aron PrinsandClaude Opus 4.7 c071db51e4 Add post-edit code verification helper
Drift detection catches the coarse case (doc references X, parent
doesn't have X). Verification is finer-grained: doc claims specific
properties (flag names, env vars, route paths, schema field names,
config values) and we check each individual claim against parent
code, post-edit.

scripts/sync/verify-edit.mjs (1266 lines):
- Takes a doc file + parent ref. Extracts claims by kind:
  cli-command, cli-flag, env-var, rest-route,
  adapter-config-field, adapter-config-value, file-path.
- Uses structural cues (Config sections, code fences, tables) to
  avoid extracting from natural prose — guard against
  false-positives on phrasing like "use the `model` field".
- Per-claim verification:
  - cli-* → grep parent cli/src/** for command/flag literals
  - env-var → check .env.example, server/src/config.ts, packages/**/env.ts
  - rest-route → grep matching routes/<surface>.ts with {id}↔:id normalization
  - adapter-* → grep packages/adapters/<name>/** for literal field/value
  - file-path → gh contents API existence check
- Three output buckets: verified, unverified (with Levenshtein-≤3
  fuzzy "did you mean" suggestion), suspicious.
- Cached gh fetches under /tmp/paperclip-sync/verify-<ref-sha>/.
- Same fixture-loader pattern as compare-window/check-drift.

Tests: 6 new (CLI pass/fail, adapter field typo with suggest,
REST route normalization, env var pass, prose-guard
false-positive). 26/26 total passing.

Live test against test/sync-docs-catchup-run:cursor-cloud.md →
20/20 claims verified. The catchup agent's worry that adapter docs
might invent field names didn't materialize on cursor-cloud (every
config field is present in packages/adapters/cursor-cloud/**) — but
the tool would have caught it. acpx-local hasn't been verified yet;
worth running before the next merge decision.

Wired as sync:verify-edit. SKILL.md update to follow.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-13 13:54:46 +02:00