Files
641ff95502 CLI: --version reports the npm package version (#731)
* CLI: --version reports the npm package version

npx impeccable --version printed 3.6.0 after the 4.0.0 release because
the shim handed every argument to the engine, whose baked-in
CLI_VERSION still said 3.6.0. The shim now answers --version and -v
from its own package.json, as docs/CLI-CONTRACT.md specifies, without
locating or downloading a binary; a test covers both flags. The
engine's CLI_VERSION moves to 4.0.0 for the next engine release, with
the cli-version golden re-recorded and the delta noted.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vau2X53xGTjjTCXWMVBoNY

* CLI shim: --version wins whenever it leads, trailing arguments or not

Co-Authored-By: Claude Code <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vau2X53xGTjjTCXWMVBoNY

---------

Co-authored-by: Claude Code <noreply@anthropic.com>
2026-09-04 13:52:32 -07:00

14 KiB

Accepted deltas

Cases listed here differ from their JS golden on purpose. Each entry names the case id, what differs, and why it is an improvement. Nothing gets on this list without review.

Format: - \`: ()`

Recorded 2026-08-17: the engine names its own commands

The JS scripts printed their own file names in usage lines, directives, and the hook manifests they wrote. The binary prints the verb (impeccable doctor) or the launcher path ("<scripts>/impeccable" hook). Each case below was re-recorded from the engine after a line-level review confirmed the only change is that wording; behavior, exit codes, and every other byte are unchanged.

  • doctor-help, doctor-help-short: Usage: node doctor.mjs … is now Usage: impeccable doctor [--json] [--fix] [--target <path>].
  • doctor-legacy-text: the closing hint reads Run \ doctor --fix``.
  • pin-usage-no-args, pin-usage-one-arg: Usage: impeccable pin <pin|unpin> <command>.
  • surface-brief-usage, surface-brief-unknown, surface-brief-write-usage: usage lines name impeccable surface-brief.
  • critique-usage, critique-unknown: usage lines name impeccable critique-storage.
  • context-monorepo-target-missing: MONOREPO_TARGET_REQUIRED says impeccable context ran without --target.
  • hadmin-on, hadmin-on-twice, hadmin-off-then-status, hadmin-on-repairs-existing-manifest, hadmin-on-malformed-manifest-backup: hooks on writes manifests that run the launcher ("<scripts>/impeccable" hook, Cursor hook-before-edit) instead of node "<scripts>/hook.mjs".
  • hook-session-fresh-then-pending-then-stop, hook-session-two-sessions, hbe-denial-downgrade-after-6: the short footer names impeccable hooks ignore-value.
  • live-help, live-accept-help, live-inject-help, live-insert-help, live-server-help, live-resume-help, live-commit-help, live-discard-help, live-complete-help, live-complete-no-id: usage text names impeccable live* verbs.
  • live-server-already-running, live-daemon-server-status-poll-complete, live-status-empty, live-status-generating, live-status-many-sessions, live-status-stale-server-json, live-status-legacy-sessions-dir, live-status-from-subdir, live-status-manual-apply, live-resume-manual-apply, live-status-mount-failed, live-resume-mount-failed, live-resume-generating, live-resume-by-id, live-resume-first-active-sorted, live-resume-accept-requested, live-resume-carbonize-required: recovery hints and next-command lines spell <self> live-poll / live-server / live-complete / live-commit-manual-edits instead of the .mjs names.

Recorded 2026-08-17: live-inject adds 'wasm-unsafe-eval' to a CSP meta script-src

The detector the live overlay loads from the helper origin is a WebAssembly module in the engine (its docs/WASM-BUNDLE.md); a script-src that names the origin but not 'wasm-unsafe-eval' still refuses to compile it. The JS patchCspMeta predates the wasm bundle and appended only the origin.

  • live-inject-csp-meta-no-connect-src: the patched <meta http-equiv="Content-Security-Policy"> reads script-src 'self' http://localhost:8412 'wasm-unsafe-eval' (was script-src 'self' http://localhost:8412). The data-impeccable-csp-original marker, the connect-src and img-src additions, idempotence, and the revert on unpatch are unchanged. live-inject-vite-csp-meta and live-inject-next-jsx carry meta tags the patch does not touch, so their goldens did not move.

Recorded 2026-08-31: detector-engine ports landed, gap goldens restored

The section previously here pinned the gap between main's post-freeze detector fixes and the engine. Those fixes are now ported (engine repo commits: c0aa75f oklch in visual-contrast/neon-text, upstream 1b7da15b #592; 5cdeec8 color-mix nested hex, upstream 54440319 #578; the 1D grid fix, upstream a236137b #615, rode along in 9046e8f via a concurrent staging race; 6d36231 comment stripping for regex matchers, upstream 067665cc #589 + ddb60993 + ba873f75 + 9a7d0fbc; 33aef88 root-relative linked stylesheets, upstream 2b88aa52 #652 + daae1d41; 6d0ecf1 URL userinfo redaction with origin-scoped basic auth, upstream d5873ff8 + d690349d #657; 09f8ae7 inert exact ignore-value refusal, upstream be87f5eb #662; 20c8347 the comp-fidelity rules organic-clip-path and buried-raster, upstream 58561610). The affected goldens were re-recorded from the fixed engine and each json fixture golden was byte-verified against the last JS engine state in history (db1462b9^, which carries both main's drift and the comp-fidelity rules):

  • Moved to post-fix behavior: detect-fixture-json-codex-grid-1d-pass-html, detect-fixture-text-codex-grid-1d-pass-html (no finding, exit 0), detect-fixture-json-organic-clip-path-html, detect-fixture-text-organic-clip-path-html, detect-fixture-json-buried-raster-html, detect-fixture-text-buried-raster-html (the new rules fire), detect-fixture-json-glow-html, detect-fixture-text-glow-html (glow's .photo-opaque-grad column now carries its intended buried-raster finding), and the sweeps detect-dir-json-all-fixtures, detect-dir-text-all-fixtures, detect-dir-quiet-all-fixtures, detect-no-advisory-json, detect-no-advisory-text.
  • Unchanged on re-record (already matched the fixed JS in the static engine): detect-fixture-json-color-html, detect-fixture-text-color-html, detect-fixture-json-oklch-neon-text-html, detect-fixture-text-oklch-neon-text-html (the oklch and color-mix fixes observably change the browser-side visual-contrast path, which these static scans do not exercise), detect-scope-type, detect-scope-both.

The frozen call vectors for checkHtmlPatterns (tests/oracle/vectors/calls/rules.checks/checkHtmlPatterns.jsonl) were re-recorded the same way: args untouched, results replayed through the db1462b9^ JS (14 of 101 moved: the comp-fidelity scans and the comment-stripping/inline-fragment fixes to enclosingCssSelector). No case in this section is an accepted delta any more; the engine matches the final JS.

Recorded 2026-08-31: main's Aug 17-31 verb fixes ported to the engine, goldens re-recorded

The goldens below froze pre-fix behavior. Each fix landed on main in JS and was ported to the engine; the cases were re-recorded from the binary and reviewed line by line, so they now pin the fixed behavior.

  • hook-session-fresh-then-pending-then-stop, hook-session-two-sessions: the Stop deep pass syncs the remembered set to the live scan, including findings the per-edit pass already surfaced, so a second Stop with nothing new is silent and a fixed-then-reintroduced finding fires again (upstream 3c442af7).
  • hadmin-on, hadmin-on-twice, hadmin-off-then-status, hadmin-on-repairs-existing-manifest, hadmin-on-malformed-manifest-backup: the Claude manifests hooks on writes match on Edit|Write and the description names the current tools; Claude Code folded multi-edit behavior into Edit (upstream 7d5c60d2).
  • live-commit-mock-unreported-file-change: the rollback-failure results share one constructor, which moved unreportedFiles and notes after pageUrl in the emitted JSON (upstream 1f2c3f9d).

Recorded 2026-08-31: main's Sep-1 verb fixes ported after the rust-swap rebase

Five more fixes landed on main in JS between the swap branch and its rebase. Each was ported to the engine and the affected goldens re-recorded from the binary after a line-level review; the engine's output was also diffed byte-for-byte against the upstream JS on the same inputs before recording.

  • critique-usage, critique-unknown: the usage line now lists the new close subcommand (upstream 5211bdf4, #660).
  • critique-latest-existing: latest applies the #660 identity/freshness path: a legacy snapshot carrying no fingerprint for a concrete local target is closed and latest exits 2 instead of printing the stale body (upstream 5211bdf4, #660).
  • critique-write-then-read: write stamps target_identity/target_fingerprint/target_path, uses a fixed-width ~NNNN collision suffix when two snapshots share a UTC second, latest freshness-closes the read snapshot, and trend now surfaces the closed flag and identity fields (upstream 5211bdf4, #660).
  • critique-write-monorepo-child: write stamps the resolved target_identity, and a latest run from a sibling app resolves to a different identity so it exits 2 rather than returning the neighbor's backlog (upstream 5211bdf4, #660).
  • detect-fixture-json-overused-font-html, detect-fixture-text-overused-font-html: new fixture added on the swap branch; overused-font primary selection now skips only the CSS generics, so a system stack keeps its system face as primary and later web-font fallbacks like Roboto no longer flag (upstream 2cfd6076, #678).
  • detect-dir-json-all-fixtures, detect-dir-text-all-fixtures, detect-dir-quiet-all-fixtures, detect-scope-type, detect-scope-both, detect-no-advisory-json, detect-no-advisory-text: the directory sweep picks up the new overused-font fixture and the #678 primary-face change (upstream 2cfd6076, #678).

Recorded 2026-08-31: E8 hook-manifest self-heal on upgrade

Two new cases pin the fix for triage E8 (the v3-to-launcher upgrade path). The JS automaticHookMode counted any hook command naming the skill as an active hook, including the JS-era node .../hook.mjs form. After a skill update the .mjs script no longer exists, so that manifest points at a dead command yet still suppressed MANUAL_DETECTOR_REQUIRED, leaving the detector dark. The engine now treats a manifest that names ONLY the .mjs form as not an active launcher hook, so the manual detector fallback fires until install/update repairs the manifest to the launcher form. The launcher form still counts as active exactly as before. No existing golden moved: every other context case runs under the source provider, whose manifest list is empty, so none of them scan a hook manifest.

  • context-stale-hook-manifest: a .claude/settings.local.json naming node "${CLAUDE_PROJECT_DIR}/.claude/skills/impeccable/scripts/hook.mjs" under the claude-code provider emits MANUAL_DETECTOR_REQUIRED (the stale marker no longer counts as active).
  • context-launcher-hook-active: the same manifest in the launcher form ("…/impeccable" hook) suppresses MANUAL_DETECTOR_REQUIRED, confirming the launcher marker is still recognized as active.

Recorded 2026-09-01: the harness stages workspaces at their real path

Two goldens were re-recorded after stageWorkspace started returning the realpath of the staged directory. macOS's tmpdir is a symlink (/var -> /private/var), and the old goldens carried that artifact rather than the verbs' behavior; Linux, where the two paths are the same, never reproduced them. The binary's output is unchanged; the input the harness fed it is.

  • context-dir-override: productPath is elsewhere/PRODUCT.md, the plain relative path, instead of ../../../../../../..<WS>/elsewhere/PRODUCT.md (a relative path from the symlinked cwd to the resolved one).
  • live-accept-source-locked: the accept now reports source_locked, which is what the case is named for. The staged lock named the file under the symlinked path, so the verb never matched it against its own resolved path and the old golden recorded a successful accept.

context-lowercase-product-name runs only on case-insensitive hosts (platforms: ['darwin', 'win32'] in the case): product.md is found through the canonical name there and through the fallback scan elsewhere, both right.

Recorded 2026-09-03: #710 resolves an explicit target at its own git boundary

Upstream 672ca296 (#710) scopes an explicit --target to its own repository. A route-shaped target that begins with / is an absolute path outside the workspace, so route cases that used to resolve inside the fixture now resolve against the filesystem root. Every case below was re-recorded after confirming origin/main's context.mjs / surface-brief.mjs produce the same stdout and the same exit code for the same run.

  • context-full-target-route, surface-brief-path-slash, surface-brief-path-outside, surface-brief-read-route: stdout and exit code match origin/main byte for byte; nothing here is a delta beyond the upstream change itself.
  • surface-brief-write-route: the write now fails on both engines (exit 1) because /.impeccable/surfaces is not writable. Node reports ENOENT: no such file or directory, mkdir '/.impeccable/surfaces'; the engine reports the failed write as No such file or directory (os error 2). Same failure, different wording for an unwritable filesystem root.

Recorded 2026-09-03: the OpenCode pinned command names the launcher

Upstream 9736a9f6 (#483) makes pin write an OpenCode slash-command bridge whose body tells the agent to run node <skill-base-dir>/scripts/context.mjs. The engine names its own command everywhere else the launcher replaced a script path (see the 2026-08-17 section above), so the bridge says <skill-base-dir>/scripts/impeccable context instead. Nothing else in the file, the file set, or the printed lines differs from the JS.

  • pin-opencode-project, pin-opencode-user-scope, pin-opencode-skips-foreign-command, pin-opencode-then-unpin, pin-opencode-unpin-skips-foreign.

Recorded 2026-09-04: --version follows the npm package to 4.0.0

The npm shim answers --version / -v itself from its own package.json (docs/CLI-CONTRACT.md), so the number users see tracks the package they installed. The binary's CLI_VERSION moves from 3.6.0 to 4.0.0 with the CLI 4.0.0 release; it is what the binary prints when run directly.

  • cli-version.