@herbertgao/pi-extensions 2026.11.5 → 2026.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/CHANGELOG.md +10 -0
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +5 -4
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +5 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +4 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/compact-thinking.ts +6 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/footer.ts +22 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/feature/shell/session-tokens.ts +3 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +22 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/index.ts +5 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/ccstyle-tool.ts +38 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/codemode.ts +2 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-header.ts +4 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-layout.ts +6 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-palette.ts +4 -4
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-presentation.ts +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/tool-io.ts +3 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/transcript-mode.ts +465 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/transcript-scope.ts +44 -0
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
- package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-dark-hc.json +2 -4
- package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-dark.json +3 -5
- package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-light-hc.json +2 -4
- package/node_modules/@herbertgao/pi-cc-extensions/themes/cc-light.json +3 -5
- package/node_modules/@herbertgao/pi-impeccable/CHANGELOG.md +10 -0
- package/node_modules/@herbertgao/pi-impeccable/README.md +2 -2
- package/node_modules/@herbertgao/pi-impeccable/package.json +4 -4
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/SKILL.md +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/asset-producer.md +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/documenter.md +4 -4
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/finish-reviewer.md +2 -2
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/manual-edit-applier.md +3 -2
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/hooks.md +13 -7
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/init.md +2 -0
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/live.md +5 -3
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/new-work.md +2 -2
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/VERSION +1 -1
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/engine-checksums.txt +5 -5
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/impeccable +39 -22
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/impeccable.cmd +43 -15
- package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/live-browser.js +357 -139
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- Generated from skill/agents/ at build time. Do not edit; edit the agent definition. -->
|
|
2
|
-
This harness has no subagent capability, so you are running this role inline. Step fully out of the work you just finished, adopt only this file's instructions for the pass, and disclose the substitution in one line
|
|
2
|
+
This harness has no subagent capability, so you are running this role inline. Step fully out of the work you just finished, adopt only this file's instructions for the pass, and disclose the substitution in one line of your closing message to the user, outside the output contract. Where the text below addresses a parent agent, you are both parties: produce the full output contract first, then act on it yourself.
|
|
3
3
|
|
|
4
4
|
# Impeccable Asset Producer
|
|
5
5
|
|
package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/reference/degraded/documenter.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- Generated from skill/agents/ at build time. Do not edit; edit the agent definition. -->
|
|
2
|
-
This harness has no subagent capability, so you are running this role inline. Step fully out of the work you just finished, adopt only this file's instructions for the pass, and disclose the substitution in one line
|
|
2
|
+
This harness has no subagent capability, so you are running this role inline. Step fully out of the work you just finished, adopt only this file's instructions for the pass, and disclose the substitution in one line of your closing message to the user, outside the output contract. Where the text below addresses a parent agent, you are both parties: produce the full output contract first, then act on it yourself.
|
|
3
3
|
|
|
4
4
|
# Impeccable Documenter
|
|
5
5
|
|
|
@@ -9,16 +9,16 @@ Complete the check within your turn ceiling. Batch Reads, take `reference/docume
|
|
|
9
9
|
|
|
10
10
|
## Input Contract
|
|
11
11
|
|
|
12
|
-
Expect: the project root; the artifact path(s); the direction contract text (THESIS, OWN-WORLD, STORY, FIRST VIEWPORT, FORM); PRODUCT.md path; the path to the skill's `reference/document.md`;
|
|
12
|
+
Expect: the project root; the artifact path(s); the direction contract text (THESIS, OWN-WORLD, STORY, FIRST VIEWPORT, FORM); PRODUCT.md path; the path to the skill's `reference/document.md`; the boundary to write at (project or app root); and, when a DESIGN.md already exists there, the user's choice for it (refresh, overwrite, or merge), the answer `reference/document.md` requires before any rewrite, which the parent collects. A merge preserves confirmed incumbent decisions and reconciles them with the build.
|
|
13
13
|
|
|
14
14
|
## Workflow
|
|
15
15
|
|
|
16
16
|
1. Read `reference/document.md` in full; it is the operating spec for DESIGN.md's format, token schema, sidecar, and section order. Follow it exactly.
|
|
17
17
|
2. Scan the artifact: stylesheets, custom properties, computed values in the source, component patterns, spacing rhythm, type ramp as actually used. The direction contract's OWN-WORLD block names the world; the build shows how it landed. Where they diverge, the build wins and the prose may note the divergence.
|
|
18
|
-
3. For a new world or approved system change, write DESIGN.md and its sidecar from durable, reused rules in the build. Ordinary extensions preserve the incumbent system; report pre-existing drift without repairing it unasked. Do not write merely to prove this pass ran.
|
|
18
|
+
3. For a new world or approved system change, write DESIGN.md and its sidecar from durable, reused rules in the build, honoring the user's choice when a DESIGN.md already exists; when it exists and no choice arrived, write nothing and return that the choice is owed. Ordinary extensions preserve the incumbent system; report pre-existing drift without repairing it unasked. Do not write merely to prove this pass ran.
|
|
19
19
|
4. Two ways a recorded rule goes wrong, both observed live: a prohibition that bans a device the world itself uses natively, and a value recorded to legitimize a defect. Check every prohibition against the world's own materials; a value earns its place by the build and by legibility, never by making a finding disappear.
|
|
20
20
|
5. Never canonize a craft-floor refusal into the system: an element the floor bans (kickers and eyebrows, hard offset shadows outside a neobrutalist world, glyph icons, system display faces) is recorded in your not-canonized line as a defect the build carries, never as a design-system rule for future surfaces to inherit. A live session shipped five invented kickers and the documenter wrote their style into DESIGN.md; that is how one violation becomes the house style.
|
|
21
21
|
|
|
22
22
|
## Output Contract
|
|
23
23
|
|
|
24
|
-
Return: paths written, or “No changes” with the source and system files checked; a five-line system summary (palette, type ramp, named rules); and one line naming defects or drift not canonized or repaired, and why. No other prose.
|
|
24
|
+
Return: paths written, or “No changes” with the source and system files checked and, when an existing DESIGN.md stopped the write, the choice owed; a five-line system summary (palette, type ramp, named rules); and one line naming defects or drift not canonized or repaired, and why. No other prose.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- Generated from skill/agents/ at build time. Do not edit; edit the agent definition. -->
|
|
2
|
-
This harness has no subagent capability, so you are running this role inline. Step fully out of the work you just finished, adopt only this file's instructions for the pass, and disclose the substitution in one line
|
|
2
|
+
This harness has no subagent capability, so you are running this role inline. Step fully out of the work you just finished, adopt only this file's instructions for the pass, and disclose the substitution in one line of your closing message to the user, outside the output contract. Where the text below addresses a parent agent, you are both parties: produce the full output contract first, then act on it yourself.
|
|
3
3
|
|
|
4
4
|
# Impeccable Finish Reviewer
|
|
5
5
|
|
|
@@ -27,7 +27,7 @@ Do not run a second detector pass; mechanical findings belong to the parent's ho
|
|
|
27
27
|
|
|
28
28
|
## Disposition
|
|
29
29
|
|
|
30
|
-
The first line of your return is `disposition: recapture`, `disposition: rebuild`, `disposition: fix`, or `disposition: ship`. These four words are the whole vocabulary; never invent another. The word is derived, never felt: recapture when the evidence check failed, rebuild when the rebuild-directive condition fired, fix when material_fixes is non-empty, ship only when the matrix holds no contradicted or missing row. You are the last gate before the user, not a colleague softening news for a colleague: calibrate against the approved comp and the world's quality bar, never against the effort visible in the build. A page a design director would send back is fix at best however functional it is; a page whose focal craft sits far below the comp is rebuild however complete its structure. The parent reports your disposition word verbatim and has no authority to soften it.
|
|
30
|
+
The first line of your return is `disposition: recapture`, `disposition: rebuild`, `disposition: fix`, or `disposition: ship`. These four words are the whole vocabulary; never invent another. The word is derived, never felt: recapture when the evidence check failed, rebuild when the rebuild-directive condition fired, fix when material_fixes is non-empty, ship only when material_fixes is empty and the matrix holds no contradicted or missing row. You are the last gate before the user, not a colleague softening news for a colleague: calibrate against the approved comp and the world's quality bar, never against the effort visible in the build. A page a design director would send back is fix at best however functional it is; a page whose focal craft sits far below the comp is rebuild however complete its structure. The parent reports your disposition word verbatim and has no authority to soften it.
|
|
31
31
|
|
|
32
32
|
## Output Contract
|
|
33
33
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- Generated from skill/agents/ at build time. Do not edit; edit the agent definition. -->
|
|
2
|
-
This harness has no subagent capability, so you are running this role inline. Step fully out of the work you just finished, adopt only this file's instructions for the pass, and disclose the substitution in one line
|
|
2
|
+
This harness has no subagent capability, so you are running this role inline. Step fully out of the work you just finished, adopt only this file's instructions for the pass, and disclose the substitution in one line of your closing message to the user, outside the output contract. Where the text below addresses a parent agent, you are both parties: produce the full output contract first, then act on it yourself.
|
|
3
3
|
|
|
4
4
|
# Impeccable Manual Edit Applier
|
|
5
5
|
|
|
@@ -46,7 +46,8 @@ The user already clicked Apply. Do not ask what to do. Do not discard edits. Do
|
|
|
46
46
|
19. If numeric source data is changed to non-numeric visible text, write the new visible text as a quoted source string. Never substitute a similar number or a bare identifier.
|
|
47
47
|
20. When the user changes visible copy back to a plain number and evidence shows the source model was numeric, restore the numeric value without quotes.
|
|
48
48
|
21. If a dependency is ambiguous or broad, fail that entry and leave no partial edits for it.
|
|
49
|
-
22.
|
|
49
|
+
22. An op with `deleted: true` and `removeElement: true` removes the whole element from source, children included, never just its text. Locate it by `sourceHint`, then by `leaf.outerHTML` and `originalText`; delete exactly that element's source range and leave no empty wrapper, orphaned children, or dangling markup. If the element is rendered from a loop or data item, remove that item instead; if the range is ambiguous, fail the entry.
|
|
50
|
+
23. Never copy browser/runtime scaffolding into source: no `contenteditable`, `data-impeccable-*`, variant wrappers, live markers, generated browser attrs, `<style>`, `<script>`, or comments from the live UI.
|
|
50
51
|
|
|
51
52
|
## Entry Atomicity
|
|
52
53
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Manage the **design detector hook** for the current project.
|
|
4
4
|
|
|
5
|
-
The hook runs the impeccable design detector on direct file edits to design-relevant files (`.tsx`, `.jsx`, `.html`, `.vue`, `.svelte`, `.astro`, `.css`, `.scss`, `.sass`, `.less`, `.ts`, `.js`). Claude Code, Codex, Cursor, and GitHub Copilot use a post-tool-use hook and push a short system reminder into the agent's context after the edit; findings get a correction prompt, pending issues get a re-nudge, and clean UI-ish files get a short ack unless quiet mode is on (`hook.quiet` in config). Plain `.ts` and `.js` files are still scanned, but stay quiet unless the detector finds something. Grok Build fires the same PostToolUse scan to mark touched files, then surfaces findings on Stop `additionalContext`. Do not expect a Grok per-edit reminder: Grok discards that stdout.
|
|
5
|
+
The hook runs the impeccable design detector on direct file edits to design-relevant files (`.tsx`, `.jsx`, `.html`, `.vue`, `.svelte`, `.astro`, `.css`, `.scss`, `.sass`, `.less`, `.ts`, `.js`). Claude Code, Codex, Cursor, and GitHub Copilot use a post-tool-use hook and push a short system reminder into the agent's context after the edit; findings get a correction prompt, pending issues get a re-nudge, and clean UI-ish files get a short ack unless quiet mode is on (`hook.quiet` in config). Plain `.ts` and `.js` files are still scanned, but stay quiet unless the detector finds something. Grok Build fires the same PostToolUse scan to mark touched files, then surfaces findings on Stop `additionalContext`. Do not expect a Grok per-edit reminder: Grok discards that stdout. On Hermes Agent the per-edit findings arrive inside the `write_file` or `patch` tool result itself, as its `impeccable` field.
|
|
6
6
|
|
|
7
|
-
The detector rules run in two tiers. The per-edit hook surfaces only the immediate tier: mechanical, unambiguous problems worth interrupting an edit for, such as broken images, overflowing content, contrast and legibility failures, gradient text, glow shadows, and design-system drift. Everything else (copy cadence, palette and typography taste, layout rhythm) is deferred to a deep pass on the `Stop` hook event, which runs the full rule set over every UI file touched in the session and surfaces the remaining findings once, deduplicated against what the per-edit pass already reported. A session with nothing left to report stops silently. Set `hook.perEditRules` to `"all"` in `.impeccable/config.json` to restore the full rule set on every edit. The Stop deep pass is wired for Claude Code, Codex, and Grok Build, which dispatch a native `Stop` hook event
|
|
7
|
+
The detector rules run in two tiers. The per-edit hook surfaces only the immediate tier: mechanical, unambiguous problems worth interrupting an edit for, such as broken images, overflowing content, contrast and legibility failures, gradient text, glow shadows, and design-system drift. Everything else (copy cadence, palette and typography taste, layout rhythm) is deferred to a deep pass on the `Stop` hook event, which runs the full rule set over every UI file touched in the session and surfaces the remaining findings once, deduplicated against what the per-edit pass already reported. A session with nothing left to report stops silently. Set `hook.perEditRules` to `"all"` in `.impeccable/config.json` to restore the full rule set on every edit. The Stop deep pass is wired for Claude Code, Codex, and Grok Build, which dispatch a native `Stop` hook event, and for Hermes Agent, whose plugin sends it from `pre_verify`. Cursor does not get one (its `stop` hook can only answer with a follow-up user message), and GitHub Copilot's stop-style events do not feed context back to the model, so they keep the full detector per edit. Grok also fires an observe-only Stop with `reason: "shutdown"` after `end_turn`; skip that one, scan only `end_turn`.
|
|
8
8
|
|
|
9
9
|
Every hook is a mechanical pass. The reflexes no scanner catches live in [craft-floor.md](craft-floor.md), which the skill loads before it edits UI, so they apply whether or not a hook is wired. A session with no automatic hook gets one `MANUAL_DETECTOR_REQUIRED` directive from `impeccable context` asking for a single detector run at the end.
|
|
10
10
|
|
|
@@ -14,19 +14,25 @@ Declare server-side template extensions under **`detector.extensions`** when the
|
|
|
14
14
|
|
|
15
15
|
Manual `.pi/skills/impeccable/scripts/impeccable detect` scans use the same project filter config by default: `detector.ignoreRules`, `detector.ignoreFiles`, `detector.ignoreValues`, and `detector.designSystem.enabled`. `hook.enabled` only controls automatic hook execution, not manual CLI scans. Use `.pi/skills/impeccable/scripts/impeccable detect --no-config ...` for a raw detector run that ignores project config/context. Use `.pi/skills/impeccable/scripts/impeccable ignores ...` for direct CLI CRUD on the same detector ignores.
|
|
16
16
|
|
|
17
|
-
Supported harnesses: Claude Code (`.claude/settings.local.json` for a project-scope install;
|
|
17
|
+
Supported harnesses: Claude Code (`.claude/settings.local.json` for a project-scope install; `$CLAUDE_CONFIG_DIR/settings.json` for a user-scope install, defaulting to `~/.claude/settings.json`; a project hook moved into shared `.claude/settings.json` is honored in place too), Codex (`.codex/hooks.json` in the project), Cursor (`.cursor/hooks.json` in the project), Grok Build (`.grok/hooks/impeccable.json` in the project; requires `/hooks-trust` or `--trust`), GitHub Copilot (`.github/hooks/impeccable.json` in the project, a team-shared committed file that both the Copilot CLI and the cloud agent read), and Hermes Agent (the `impeccable-design-hook` plugin in `~/.hermes/plugins/`; the user enables it once with `hermes plugins enable impeccable-design-hook`; a project install's launcher runs only in a project Hermes trusts, via `hermes skills trust`). For the Copilot CLI, repo-level hooks fire once `.github/hooks/impeccable.json` is committed to the repository's default branch.
|
|
18
18
|
|
|
19
19
|
On **Cursor**, the hook runs on `postToolUse` for the `Write` tool (every agent file edit) and returns its reminder as `additional_context`, which Cursor adds after the tool result. Projects set up before this ran a `preToolUse` gate (`hook-before-edit`) that blocked bad writes before they landed; that gate still works until `hooks on`, `impeccable update`, or `impeccable doctor --fix` moves the entry to `postToolUse`.
|
|
20
20
|
|
|
21
21
|
Gemini installs session and completion hooks in `.gemini/settings.json`, merged into the settings already there (comments are tolerated; a commented file is backed up to `settings.json.bak` before the rewrite, and a file that is not valid JSON is left alone). It does not install a per-edit detector hook. The `BeforeTool` hook only rewrites shell commands that run `build-phase`, and only on macOS and Linux; on Windows (where Gemini runs hooks through PowerShell) no session id reaches the shell, so a comp build is not tied to the session and the completion reminder stays silent.
|
|
22
22
|
|
|
23
|
+
When there is no project Claude skill, `hooks on` looks for `skills/impeccable/scripts/impeccable` inside `CLAUDE_CONFIG_DIR` (default `~/.claude`) and writes the hook into that account's `settings.json`, using the installed launcher's absolute path. Relative account directories resolve against the caller's working directory. An explicit account directory is exclusive: another account's default skill and settings are never substituted. Status and context read the same account settings. If no design harness can be wired, `hooks on` says so, reports skipped invalid settings or the missing skill lookup paths, and gives the next step.
|
|
24
|
+
|
|
25
|
+
Status checks the current event entries and matchers in each manifest, including the Stop pass where supported. Claude Code counts as wired when either project settings file (or its user settings file) contains the current entries. A legacy command, partial manifest, or missing file is reported as not wired. If enabled in config but no design harness is wired, status says so and gives `impeccable hooks on` as the repair command. An installed and enabled Hermes design-hook plugin also counts as wired; `on` acknowledges it without changing the plugin configuration. Wiring confirms the manifest entries; harness trust requirements and session reloads still apply.
|
|
26
|
+
|
|
27
|
+
When `hook.consent` is `"accepted"` in the project's `config.local.json` and the hook is enabled, `impeccable context` restores missing or stale entries for installed harness skills and reports repairs in one line. Shared config consent does not authorize this write. Automatic repair preserves unrelated settings and hooks and leaves malformed manifests alone. Without local consent, context writes no manifests and keeps `MANUAL_DETECTOR_REQUIRED`, naming the missing or stale harness wiring. Explicitly disabled hooks stay disabled.
|
|
28
|
+
|
|
23
29
|
## Routing
|
|
24
30
|
|
|
25
31
|
The first argument is the action. Defaults to `status`.
|
|
26
32
|
|
|
27
33
|
| Action | What it does |
|
|
28
34
|
|---|---|
|
|
29
|
-
| `status` | Print current state, shared/local config paths, ignored rules / files / values, env override. |
|
|
35
|
+
| `status` | Print current state, shared/local config paths, ignored rules / files / values, env override, and actual manifest wiring for each harness. |
|
|
30
36
|
| `on` | Set `enabled: true` in `.impeccable/config.json`, record local hook consent as accepted, and install/repair provider hook manifests when the skill is installed. |
|
|
31
37
|
| `off` | Set `enabled: false` in `.impeccable/config.json`. |
|
|
32
38
|
| `ignore-rule <id>` | Append `<id>` to `detector.ignoreRules`; for `overused-font`, requires `--all-values`. Suppresses the rule across the whole project. |
|
|
@@ -46,7 +52,7 @@ The first argument is the action. Defaults to `status`.
|
|
|
46
52
|
```
|
|
47
53
|
|
|
48
54
|
3. If `<action>` is `off`, follow up with a one-line note: "Done. New edits will not trigger the design hook in this project until you run `/impeccable hooks on`."
|
|
49
|
-
4. If `<action>` is `on`,
|
|
55
|
+
4. If `<action>` is `on`, report what the command installed or repaired. If no installed skill folders were found or settings were skipped, surface that result and do not claim the hook will run. Otherwise note that the harness must load the updated settings (and satisfy any trust requirements) before it runs. On Hermes Agent, `on` cannot install or enable the plugin: if `impeccable context` reported `MANUAL_DETECTOR_REQUIRED`, tell the user to run `npx impeccable install` and then `hermes plugins enable impeccable-design-hook` instead.
|
|
50
56
|
5. If `<action>` is `ignore-value`, `ignore-file`, or `ignore-rule`, just print the script output. The default scope is shared `.impeccable/config.json`; add `--local` only when the user explicitly asks for a private exception.
|
|
51
57
|
6. If `<action>` is `status`, just print the script output. Do not add commentary unless the user asked a follow-up question.
|
|
52
58
|
|
|
@@ -56,7 +62,7 @@ The hook itself never writes ignore config; every exception goes through `impecc
|
|
|
56
62
|
|
|
57
63
|
- **Real design problem**: fix it. Never add an ignore to skip a fix or to push a blocked write through.
|
|
58
64
|
- **Confident false positive or sanctioned exception**: persist the narrowest ignore yourself and disclose it in your reply. The bar is evidence you can name: an intentional demo or fixture, documentation of bad design, literal or domain-appropriate motion (a ball that bounces), or a choice the user already confirmed. Put that evidence in `--reason` as `"<who decided: evidence>"`; write "user confirmed" only when the user actually did.
|
|
59
|
-
- **Unsure**: leave the finding standing and
|
|
65
|
+
- **Unsure**: leave the finding standing and give the reason in one line. Ask the user only when you genuinely cannot decide.
|
|
60
66
|
|
|
61
67
|
Self-serve stops at `ignore-value`. `ignore-file` and `ignore-rule` silence too much to add on your own judgment; ask the user first.
|
|
62
68
|
|
|
@@ -106,7 +112,7 @@ Example whole-file exception, for a file that is out of scope entirely:
|
|
|
106
112
|
- Do not edit the launcher or the binary behind `impeccable hook` and `impeccable hook-before-edit` from this flow. Those are skill plumbing.
|
|
107
113
|
- When a user asks how far to trust the hook, say it runs the engine unsandboxed with the agent's environment and network access (in the Copilot cloud agent too, once `.github/hooks/impeccable.json` is committed), and that the launcher checks a downloaded engine against `.pi/skills/impeccable/scripts/engine-checksums.txt` before its first run; **never** call it sandboxed.
|
|
108
114
|
- The hook never blocks an edit; it emits a post-edit reminder. (A Cursor project still on the old `preToolUse` gate can block a write until its manifest is migrated.) Disabling stops the reminders.
|
|
109
|
-
- The hook is bundled with the Impeccable skill. Project installs use `.claude/settings.local.json`, `.codex/hooks.json`, `.cursor/hooks.json`, `.github/hooks/impeccable.json`, and `.gemini/settings.json`; a user-scope Claude install uses `~/.claude/settings.json
|
|
115
|
+
- The hook is bundled with the Impeccable skill. Project installs use `.claude/settings.local.json`, `.codex/hooks.json`, `.cursor/hooks.json`, `.github/hooks/impeccable.json`, and `.gemini/settings.json`; a user-scope Claude install uses the active account's `$CLAUDE_CONFIG_DIR/settings.json` (default `~/.claude/settings.json`). On Codex, the user must approve the hook via `/hooks` the first time. On Cursor, confirm hooks are enabled under Settings -> Hooks. On GitHub Copilot, the CLI loads `.github/hooks/impeccable.json` once it is committed to the repository's default branch, and the cloud agent reads it from the repo directly.
|
|
110
116
|
|
|
111
117
|
## Failure modes
|
|
112
118
|
|
|
@@ -121,6 +121,8 @@ Then configure live mode when useful: skip native or non-runnable projects and l
|
|
|
121
121
|
|
|
122
122
|
Summarize captured and deliberately undecided facts. Do not offer DESIGN.md merely because it is missing.
|
|
123
123
|
|
|
124
|
+
Tell the user once which files to commit: PRODUCT.md, DESIGN.md, `.impeccable/config.json`, `.impeccable/surfaces/`, `.impeccable/design.json`, `.impeccable/live/config.json`, and `.impeccable/critique/ignore.md`. A blanket `.impeccable/` ignore hides them from teammates and other worktrees. The runtime directories (`questions/`, `mocks/`, `review/`, critique snapshots) ignore themselves, and `.impeccable/config.local.json` stays on the developer's machine.
|
|
125
|
+
|
|
124
126
|
Recommend the next action from the actual project state:
|
|
125
127
|
|
|
126
128
|
- Empty or early project: ask naturally for the surface to be built, or use `/impeccable shape <surface>` when the user wants a confirmed brief without implementation. New-work will establish a visual world only when the requested work needs one.
|
|
@@ -196,7 +196,7 @@ Complete HTML replacement of the original element per variant, not a CSS-only pa
|
|
|
196
196
|
</div>
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
-
Replace the style opening tag with `cssAuthoring.styleTag` when the tool returns a different one. **Each variant div contains exactly one top-level element**, same tag as the original; loose siblings break outline tracking and accept. First variant visible, all others `display: none`. The browser's MutationObserver accepts atomic or progressive arrival; accepting an arrived variant fences the worker, so later publications are rejected.
|
|
199
|
+
Replace the style opening tag with `cssAuthoring.styleTag` when the tool returns a different one, and close it with `cssAuthoring.styleClose` (`</component>` on `.vue`). **Each variant div contains exactly one top-level element**, same tag as the original; loose siblings break outline tracking and accept. First variant visible, all others `display: none`. The browser's MutationObserver accepts atomic or progressive arrival; accepting an arrived variant fences the worker, so later publications are rejected.
|
|
200
200
|
|
|
201
201
|
For `styleMode: "scoped"`, author every `:scope` rule with a descendant combinator: the `@scope` boundary is the variant wrapper div, not your element, so a bare `:scope { ... }` styles a `display: contents` shell. Always step in (`:scope > .card`, `:scope .hero-title`). The fake test agent's CSS in the [repo agent template](https://github.com/pbakaus/impeccable/blob/8dac6ae7e020c43ab10ce9b41939f6fd42627b96/tests/live-e2e/agent.mjs) is a faithful template.
|
|
202
202
|
|
|
@@ -276,11 +276,11 @@ Event: `{id, variantId, _acceptResult, _completionAck}`. The poll script already
|
|
|
276
276
|
|
|
277
277
|
`carbonize: true` means the accepted variant is stitched into source with helper markers and inline CSS (so the browser renders with no gap). That stitch-in is temporary; rewrite it into permanent form before anything else, or dead `@scope` rules, wrapper divs, and marker comments accumulate across sessions. Five steps, synchronously, before the next poll:
|
|
278
278
|
|
|
279
|
-
1. **Locate the carbonize block** in `_acceptResult.file`: bracketed by `<!-- impeccable-carbonize-start/end SESSION_ID -->` with a
|
|
279
|
+
1. **Locate the carbonize block** in `_acceptResult.file`: bracketed by `<!-- impeccable-carbonize-start/end SESSION_ID -->` with a `data-impeccable-css` style element; read the `<!-- impeccable-param-values -->` comment first when present, it drives steps 3 and 4.
|
|
280
280
|
2. **Move the CSS rules** into the project's real stylesheet (whichever already owns styling for the surrounding element).
|
|
281
281
|
3. **Bake param values while rewriting selectors**: retarget `@scope ([data-impeccable-variant="N"])` to real semantic classes; keep only the `:scope[data-p-<id>="VALUE"]` branch matching the chosen value; substitute `var(--p-<id>)` literals or update the var's default.
|
|
282
282
|
4. **Unwrap the accepted content**: delete the inner variant div (and on JSX the outer `data-impeccable-carbonize` div); drop `data-impeccable-params` and all `data-p-*` attributes.
|
|
283
|
-
5. **Delete** the inline
|
|
283
|
+
5. **Delete** the inline `data-impeccable-css` style element, the param-values comment, both carbonize markers, and any `@scope` rules for non-accepted variants.
|
|
284
284
|
|
|
285
285
|
Then run `impeccable live-complete --id SESSION_ID` and verify `phase: "completed"` before polling again. The command is a gate, not a formality: it refuses with `error: "source_dirty"` plus findings while any live-mode leftover remains; fix and rerun (`--force` only for false positives).
|
|
286
286
|
|
|
@@ -304,6 +304,8 @@ The user already clicked Apply. Do not ask what to do, discard, or redirect to G
|
|
|
304
304
|
|
|
305
305
|
When native subagents are available, delegate source edits to `impeccable_manual_edit_applier` / `impeccable-manual-edit-applier`. Pass cwd, scripts path, event id, page URL, chunk/deadline, `batch`, `evidencePath`, and the canonical JSON result schema. The subagent must not poll or reply. If unavailable, apply inline with the same contract.
|
|
306
306
|
|
|
307
|
+
An op with `deleted: true` and `removeElement: true` is the browser's Remove badge: delete that whole element from source, children included, not just its text. Locate it by `sourceHint`, then by `leaf.outerHTML` and `originalText`, and remove exactly that element's source range; leave no empty wrapper, orphaned children, or dangling markup behind.
|
|
308
|
+
|
|
307
309
|
If `repair` is present, the previous Apply changed source but final validation failed. Fix the current source and return the same canonical JSON result; do not roll files back yourself. The browser will ask the user before any rollback.
|
|
308
310
|
|
|
309
311
|
After source edits finish, reply exactly once with `.pi/skills/impeccable/scripts/impeccable live-poll --reply EVENT_ID done --data '{"status":"done","appliedEntryIds":["8hexid"],"failed":[],"files":["src/page.html"],"notes":[]}'`. Use `status:"partial"` or `status:"error"` with `failed[]` when not every entry applied. Then poll again. Never reply without the event id; `--reply done --file ...` is invalid for manual Apply.
|
|
@@ -48,7 +48,7 @@ The script deals three of your structures; the dice pick which three reach the u
|
|
|
48
48
|
4. Run `.pi/skills/impeccable/scripts/impeccable concept-seed --scope direction --mode <mode>` and follow what it prints. No substitute, no skip: on a new or replacement world, writing artifact code before this script has run and its assignment is acknowledged is a contract violation, whatever the harness, the model, or the time pressure; the roll is what keeps every run from converging on the category default. The script assigns the direction to build and deals catalog challengers. Fuse each challenger before judging it: the challenger supplies the form and its system grammar, the product supplies every fact, clarity wins conflicts. Weigh fused challengers against the assigned direction on exactly two axes, audience identification and product clarity. Losing to strong grounded material is a valid outcome; beating a thin or tool-monoculture list is the point. Close with a verdict per challenger, decided before any borrowing: wins (beats the assigned direction on both axes; becomes the build candidate), competitive (holds one axis; stays a full alternate), or declined (loses both). A declined challenger is not spent: name the one discipline of its system the assigned direction lacks, and raise the assigned direction to match before presenting it. A donation transfers ambition and system discipline (a palette's total commitment, a grid's density courage, a form's structural honesty), never the challenger's clothes. A component treatment, such as a button's shadow or a display face, is clothes, not discipline; a lifted motif is a costume note, not a raise, and one world owns the page. Write each raise into the presented direction as its own line, named for its donor; a raise nobody can read did not happen.
|
|
49
49
|
5. Present one direction, fully committed and already raised by the hand it beat, raises visible as named lines: world, first viewport, visitor path, signature interaction, cross-surface reach, honest risk. Route each challenger by verdict: winning and competitive challengers are full alternates with their QUALITY BAR cards and one-line case; declined challengers render demoted, compact and quiet, each carrying its verdict and what the direction kept from it, never full-size, never silently dropped, still adoptable on request. The verdict informs the user's choice, never pre-empts it; the demoted row is the hand's proof of judgment. A hand holds at most three full-card challengers: when the roll deals more, the three strongest join and the rest wait in the re-roll pool, noted in one line; dropping a challenger from the hand itself takes a named product-truth failure, disclosed. The hand's size follows the verdicts, never a number the user named: when the weighing yields fewer full cards than asked, deliver the honest hand, say in one line why it is smaller, and offer a re-roll to deal candidates that could earn full cards. A declined challenger is never promoted to fill a slot; a promoted card looks exactly like a competitive one, so the promotion leaves no trace. The standing exit does not count toward a requested number once the user has seen and rejected it; it stays present as the quiet door. Add one card for your own top-ranked grounded candidate when it is not the assigned direction, kicker IMPECCABLE’S PICK, same anatomy as every card, with an honest risk line naming its familiarity when true: the strongest grounded direction is often where most runs in this category land, and the user deciding that trade is the point of showing it. Familiar and effective is a legitimate destination, not a failure of nerve; the pick card and the standing exit serve it at two depths. One pick card, never two, never a ranked list: a lineup of your candidates hands selection back to a taste function and invites the safest card. The pick never takes the lead position; when the dice assign your top candidate there is no pick card, and the assigned card notes it topped your list. Add re-roll with an optional one-line steer, in three registers: plain (a fresh hand, same spread), safer (your remaining conventional grounded candidates plus the canon against named competitors), bolder (foreign forms only, at full commitment). The register is the user's steering on the familiar-to-bold axis, never yours to pre-select; when the answer carries one, re-run the seed with `--register <value>` and the next `--reroll` round, and follow what it prints. A user saying "bolder" or "safer" while a direction round is open means these registers, never the bolder or harden commands. The two channels share this structure and differ only in richness: cards and boards on the decision page, names and one-liners through the structured tool, whose option list carries the assigned direction, the pick, the winning and competitive challengers, and the standing exit last; declined challengers fold into the assigned option's description as their kept lines, so the raise survives the text channel.
|
|
50
50
|
|
|
51
|
-
The standing exit: every direction round offers one quiet, permanent alternative, the category standard, played straight. It is the user's door, never yours: never recommend it, never weigh it against the roll, never let it soften the dealt directions; the counterweights bind the unchosen default, not the chosen one. When the user takes it (the canon action, a safer-steer, or plain words asking for the familiar or competitor-like path), convention becomes the commitment: ask once for two or three products this should sit alongside, make their craft level the bar, and execute the canon at full fidelity, without irony or smuggled quirk. Record a standing preference as a brand commitment in PRODUCT.md. Re-roll eliminates every direction already shown, grounded and challenger alike; after two consecutive re-rolls, ask what quality is missing. Re-roll on your own only on named factual grounds, when the assigned direction cannot carry the product's truth or task; taste is never grounds. The user may re-roll freely, and a user- or brief-pinned direction beats the roll, always. Resolve collisions field by field: preserve every user- or brief-pinned constraint. In dimensions the brief leaves open, the assignment still binds through its topology, controls, state vocabulary, and ritual; when only its materials conflict with a pinned visual direction or PRODUCT.md brand commitment, translate that material expression and name the translation in the presented direction. A look mismatch is not grounds to re-roll. Present the decision visually: write an options payload with the assigned direction leading, its raised lines included; the pick card when one exists; the dealt challengers as alternates with their QUALITY BAR cards, verdicts, and kept lines; re-roll with its safer and bolder registers; steer; canon enabled; and `buildPath` carrying the recorded default with `toggle: true` whenever image generation exists (details in the build-path paragraph below). A degraded roll with no challengers still uses the page, as a single text-only card with re-roll. Every option declares its identity: `kind` is `assigned`, `pick`, `challenger`,
|
|
51
|
+
The standing exit: every direction round offers one quiet, permanent alternative, the category standard, played straight. It is the user's door, never yours: never recommend it, never weigh it against the roll, never let it soften the dealt directions; the counterweights bind the unchosen default, not the chosen one. When the user takes it (the canon action, a safer-steer, or plain words asking for the familiar or competitor-like path), convention becomes the commitment: ask once for two or three products this should sit alongside, make their craft level the bar, and execute the canon at full fidelity, without irony or smuggled quirk. Record a standing preference as a brand commitment in PRODUCT.md. Re-roll eliminates every direction already shown, grounded and challenger alike; after two consecutive re-rolls, ask what quality is missing. Re-roll on your own only on named factual grounds, when the assigned direction cannot carry the product's truth or task; taste is never grounds. The user may re-roll freely, and a user- or brief-pinned direction beats the roll, always. Resolve collisions field by field: preserve every user- or brief-pinned constraint. In dimensions the brief leaves open, the assignment still binds through its topology, controls, state vocabulary, and ritual; when only its materials conflict with a pinned visual direction or PRODUCT.md brand commitment, translate that material expression and name the translation in the presented direction. A look mismatch is not grounds to re-roll. Present the decision visually: write an options payload with the assigned direction leading, its raised lines included; the pick card when one exists; the dealt challengers as alternates with their QUALITY BAR cards, verdicts, and kept lines; re-roll with its safer and bolder registers; steer; canon enabled; and `buildPath` carrying the recorded default with `toggle: true` whenever image generation exists (details in the build-path paragraph below). A degraded roll with no challengers still uses the page, as a single text-only card with re-roll. Every option declares its identity: `kind` is `assigned`, `pick`, `challenger`, `grounded` (another of your own grounded directions, such as each card of a safer hand's lineup, any number of them), or `dealt` (a surface round's dealt structures other than the lead), and each challenger carries `catalogId`, the SOURCE ID concept-seed printed for its world, never the card's own id; `--start` and `--update` refuse a direction or surface payload without them, and the page reports the choice from them. Give every card the same anatomy: thesis, palette, materials, first viewport, honest risk, and the challengers' case lines (`--schema` prints the exact shape); the page renders identity from these fields, demotes declined challengers to their row on its own, and a challenger's catalog image rides as labeled inspiration, never the promise of the build. Author `canonCard` too: the category standard as one honest card, same anatomy; the page keeps it subordinate, and the counterweights still bind you. Run `.pi/skills/impeccable/scripts/impeccable serve-question --start --payload <file>` (`--schema` first for the payload shape). It daemonizes, prints the page URL and a key, and exits; open that URL for the user, in-app browser first, then the system opener, then showing the URL. Collect the choice with `--wait --key <key>`, repeating while it exits 3; the ANSWER prints as JSON. An ANSWER of `{"optionId":"reroll"}` keeps the server alive and the page open on a loading hand: rerun concept-seed with the same `--scope` and `--mode` plus `--from <seed-key> --reroll <n>` (1 on the first re-roll, counting up), build the next payload, deliver it with `--update --key <same key> --payload <file>`, then return to `--wait` on that key. Never `--start` a second server or fall back to chat here: either strands the open tab on a hand that never arrives. Exit 4 means the page closed unanswered: re-present once through the structured question tool, and with no answer there either, proceed unattended with the assigned direction and state the assumptions. A harness that can leave a shell blocked in the background may run the script without `--start` and let it auto-open and block. A harness that cannot hold a blocking `--wait` (it detaches long-running commands without ever returning their output, or reaps a backgrounded child) takes the structured tool without starting the page and discloses the substitution in the first reply, so the tab is never left unanswered. A shell that hands back a still-running command as a session you can poll holds the wait: poll that session until it exits, and rerun `--wait` only after it exits without an answer. Never predict any other fallback: run the script, and only exit code 2 from starting it, or that wait check before starting, routes the decision to the structured tool; those are the fallback, never an error to retry. concept-seed closes every roll with this procedure, condensed, as a PRESENTATION block that names the recorded build path.
|
|
52
52
|
|
|
53
53
|
When image generation exists, every card also declares a `comp` path under `.impeccable/mocks/decision/`, the canon card included. Where the harness sandboxes its shell, start the page through the least-sandboxed command path it offers: a sandboxed shell cannot bind the board's port, and the first-attempt failure costs a retry every session. Serve the page first, then produce the comps; the page shimmer-waits per slot and the user may answer before they land. Load [visualize.md](visualize.md) before writing the first decision comp prompt, not at the comp round: each card's image is that direction's north-star comp at full fidelity under its comp discipline and the MODE RULES block concept-seed printed, and a prompt written before reading them misses every rule there: the requested surface as the real page, its first viewport and the start of the section below it, held like every comp to visualize.md's rule that a template skeleton stays the template whatever world paints it (your own pick included: a safe layout under a world skin is the template), a short prompt in visualize.md's shape, real product name and real content, no invented commercial claims, in that card's own palette, type character, and material world, committed all the way. Once a round declares comps it has not generated yet, `impeccable serve-question --start` (and `--update`, and a flip to comp) prints a `NEXT read <path>/visualize.md` line; read that file then, before the first prompt. `--wait` prints `COMP SIDECAR MISSING` for any landed decision comp with no prompt sidecar (the image's full file name plus `.json`: `a.png` gets `a.png.json`); write the missing sidecar before you continue. `COMP STALE` names a file an earlier round left at one of this hand's slots; regenerate it there. Generation takes the same time at any fidelity, so an unfinished draft pays comp cost for draft quality; fairness between cards is equal fidelity in each card's own grammar, one surface, one aspect, never shared unfinishedness. The frame's aspect is the surface's own: portrait at device viewport for a native app or mobile-first surface, landscape for desktop web; the decision page adapts to either, and a phone screen comped landscape is a broken frame, not a neutral default. Produce in reading order, the assigned card, then the pick, then the full-card hand, then canon, each file written with its prompt sidecar the moment it is done, so a re-roll's spend front-loads onto the cards read first; declined challengers get no comp, their catalog thumb is their face. With parallel subagents, fan out one agent per card: each spawn is the shipped asset producer with a single-comp packet, that card's fields, its world's card images when the NEXT line names them, PRODUCT.md, the shared frame, the path to visualize.md for its comp discipline, the COMPS section of the MODE RULES block copied verbatim (the subagent never sees the roll's output), and the card's declared path, up to four in flight. Regenerate inline any slot still empty when its agent returns; drop without ceremony any slot still empty when the user answers. No other supervision is owed. Without parallel subagents, generate in the main thread after serving, same order, and let the harness's own generation display carry the progress; the wait for the answer follows the last file. The chosen card's comp is not spent by the choice: comp-led, it enters the comp round as compositional option one; code-led, it returns at the finish review as the critique reference, what the image dared that the build did not. Unchosen comps stay in `.impeccable/mocks/decision/` as the round's spent hand; they carry no approval and imply none. With no image generation, cards carry their identity in palette chips and facts, and that page is complete, not a lesser version; the page then also demotes every challenger's catalog art to a labeled thumbnail on its own, because salience must encode the verdict, never the accident of which cards have images.
|
|
54
54
|
|
|
@@ -147,6 +147,6 @@ A rebuild and a fix round share one asset rule: a raster either round creates or
|
|
|
147
147
|
|
|
148
148
|
Report the final verdict under the reviewer's own disposition word and at its actual scope. A verdict pass scores the listed fixes and nothing else: "the reviewer scored all three fixes resolved" is a claim it supports, "no material issues remain" is not. A table with open material findings is never announced as a pass, never softened, and never dressed as whole-surface approval when only a fix list was scored. When the user answers a ship with evidence against it, their own screenshot, a named mismatch with the comp, that evidence outranks every capture you made: put their material in the packet and spawn a fresh reviewer for a new full review. Patching inline and self-certifying is how a rejected page ships twice.
|
|
149
149
|
|
|
150
|
-
After the last correction, spawn the shipped documenter, `impeccable-documenter` (`impeccable_documenter` in codex), with the project root, artifact path, direction contract, PRODUCT.md, [document.md](document.md), and
|
|
150
|
+
After the last correction, on a new or replacement world or an approved system change where a DESIGN.md already exists at the write boundary, collect the choice [document.md](document.md) requires: show the user the existing file. Ask the user directly to clarify what you cannot infer. Offer refresh, overwrite, or merge. Then spawn the shipped documenter, `impeccable-documenter` (`impeccable_documenter` in codex), with the project root, artifact path, direction contract, PRODUCT.md, [document.md](document.md), write boundary, and that choice; the documenter cannot ask and writes nothing over an existing DESIGN.md without it. Without subagents, load [degraded/documenter.md](degraded/documenter.md) and [document.md](document.md) before writing. Verify the outcome: new worlds and approved system changes require token-bearing DESIGN.md **and** `.impeccable/design.json`, not prose alone. Ordinary extensions compare the finished build against the incumbent system, preserve its files, and report the evidence checked; report pre-existing drift without repairing it unasked. Recheck after later edits. Finish only when review and documentation are complete.
|
|
151
151
|
|
|
152
152
|
On a comp-led build, record the final review disposition with `.pi/skills/impeccable/scripts/impeccable build-phase finish --disposition <ship|fix|rebuild|recapture>` before the final response. A refused `ship` is an unfinished build; report the outstanding phase with the verdict. Any edit after the last captured gate, a fix for a hook finding after `ship` included, voids that capture: run `finish --disposition ship` again before you stop, which rechecks the current files against the gate and names any recapture it needs. Never record `fix` to end a run over an open gate: take the route the gate names, and when the user leaves it open, report that phase as open.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.19
|
package/node_modules/@herbertgao/pi-impeccable/skills/impeccable/scripts/engine-checksums.txt
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
# The launchers, the npm shim, `impeccable install` and scripts/fetch-engine.mjs verify
|
|
3
3
|
# every engine download against this file. Written by
|
|
4
4
|
# `node scripts/check-engine-release.mjs --record` after each engine release.
|
|
5
|
-
0.1.
|
|
6
|
-
0.1.
|
|
7
|
-
0.1.
|
|
8
|
-
0.1.
|
|
9
|
-
0.1.
|
|
5
|
+
0.1.19 impeccable-darwin-arm64 c35d0b0b250afceb5ab6ee7edfe190a04d76d25c56bac01935a7a1b06d0df818
|
|
6
|
+
0.1.19 impeccable-darwin-x64 df7c2b9cec89df54d1d9722a35aecc48b965dfad190c4ec2e766ce3f7743a544
|
|
7
|
+
0.1.19 impeccable-linux-x64 07b763dc00012e9acf219fe2d2e8980f0810fb8af2e4a41c090107a8351d412f
|
|
8
|
+
0.1.19 impeccable-linux-arm64 73b5662e42f060aba716016c34a7274cc49a998cd0d5da8b84a95d9e4edea729
|
|
9
|
+
0.1.19 impeccable-windows-x64.exe 30427e0cfea383a0adbc5cc554481c3f18337eeabcc4eaf7d9bb48ad2e8b5676
|
|
@@ -6,12 +6,16 @@
|
|
|
6
6
|
# The unversioned home binary and the PATH candidate are validated with the
|
|
7
7
|
# engine-probe handshake first: the retired 3.x npm CLI also installed a bin
|
|
8
8
|
# named `impeccable`, and exec'ing it would fail every verb with
|
|
9
|
-
# "Unknown command".
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
#
|
|
9
|
+
# "Unknown command". The sibling binary must also report the version in
|
|
10
|
+
# VERSION: it is gitignored, so a skill upgrade that copies files over this
|
|
11
|
+
# directory leaves the old engine in place. A local build of the same version
|
|
12
|
+
# passes, which is why it is not hashed. IMPECCABLE_BIN is the operator's
|
|
13
|
+
# explicit choice and is exec'd without a probe. The version-pinned cache and
|
|
14
|
+
# the download are verified against engine-checksums.txt (next to this
|
|
15
|
+
# script), never against anything published beside the binary; a
|
|
16
|
+
# <binary>.verified stamp holding the manifest digest and the binary's size
|
|
17
|
+
# skips rehashing until either changes or the binary is newer than the stamp.
|
|
18
|
+
# No path hashes on every run: hooks run this launcher on every edit.
|
|
15
19
|
set -eu
|
|
16
20
|
|
|
17
21
|
# True when the candidate answers the engine handshake (prints
|
|
@@ -23,7 +27,7 @@ set -eu
|
|
|
23
27
|
probe_ok() {
|
|
24
28
|
probe_out=$(IMPECCABLE_LAUNCHER_PROBE=1 "$1" engine-probe 2>/dev/null) || return 1
|
|
25
29
|
case "$probe_out" in
|
|
26
|
-
impeccable-engine*) return 0 ;;
|
|
30
|
+
impeccable-engine*) probe_version=${probe_out#impeccable-engine }; return 0 ;;
|
|
27
31
|
esac
|
|
28
32
|
return 1
|
|
29
33
|
}
|
|
@@ -35,7 +39,8 @@ probing=${IMPECCABLE_LAUNCHER_PROBE:-}
|
|
|
35
39
|
# still counts.
|
|
36
40
|
manifest_digest() {
|
|
37
41
|
[ -f "$manifest" ] || return 0
|
|
38
|
-
|
|
42
|
+
sep=$(printf ' \t\r')
|
|
43
|
+
while IFS="$sep" read -r m_version m_asset m_sum _ || [ -n "$m_version" ]; do
|
|
39
44
|
case "$m_version" in ''|'#'*) continue ;; esac
|
|
40
45
|
if [ "$m_version" = "$1" ] && [ "$m_asset" = "$2" ]; then
|
|
41
46
|
printf '%s' "$m_sum"
|
|
@@ -45,8 +50,7 @@ manifest_digest() {
|
|
|
45
50
|
return 0
|
|
46
51
|
}
|
|
47
52
|
# Sets $expected (and, on Windows on ARM, which runs x64 binaries,
|
|
48
|
-
# $expected_x64) from engine-checksums.txt.
|
|
49
|
-
# path: hooks run this launcher on every edit.
|
|
53
|
+
# $expected_x64) from engine-checksums.txt.
|
|
50
54
|
read_expected() {
|
|
51
55
|
expected=$(manifest_digest "$version" "$asset")
|
|
52
56
|
expected_x64=""
|
|
@@ -54,6 +58,11 @@ read_expected() {
|
|
|
54
58
|
expected_x64=$(manifest_digest "$version" impeccable-windows-x64.exe)
|
|
55
59
|
fi
|
|
56
60
|
}
|
|
61
|
+
# Sets $size to the byte count of the cached binary (BSD wc pads it).
|
|
62
|
+
cached_size() {
|
|
63
|
+
size=$(wc -c < "$cached") || size=""
|
|
64
|
+
size=${size##* }
|
|
65
|
+
}
|
|
57
66
|
# Sets $actual to the sha256 of $1, empty when no hash tool works.
|
|
58
67
|
hash_file() {
|
|
59
68
|
actual=""
|
|
@@ -65,6 +74,9 @@ hash_file() {
|
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
77
|
+
# VS Code syncs a plugin without the executable bit. Its hooks run this through
|
|
78
|
+
# sh, so restore the bit for the commands the skill runs directly (#1249).
|
|
79
|
+
[ -x "$0" ] || chmod +x "$0" 2>/dev/null || :
|
|
68
80
|
manifest="$dir/engine-checksums.txt"
|
|
69
81
|
|
|
70
82
|
# What the binary needs to know about its home: the skill directory (for
|
|
@@ -94,15 +106,17 @@ case "$(uname -m 2>/dev/null || echo unknown)" in
|
|
|
94
106
|
*) arch=unknown ;;
|
|
95
107
|
esac
|
|
96
108
|
|
|
109
|
+
version=""
|
|
110
|
+
[ -f "$dir/VERSION" ] && version=$(tr -d '[:space:]' < "$dir/VERSION")
|
|
97
111
|
bin="$dir/bin/$os-$arch/impeccable"
|
|
98
112
|
[ "$os" = windows ] && bin="$bin.exe"
|
|
99
113
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
114
|
+
# Lost the executable bit in transit (zip extraction, some copiers).
|
|
115
|
+
if [ -f "$bin" ] && { [ -x "$bin" ] || chmod +x "$bin" 2>/dev/null; }; then
|
|
116
|
+
if [ -n "$probing" ] || [ -z "$version" ] || { probe_ok "$bin" && [ "$probe_version" = "$version" ]; }; then
|
|
117
|
+
exec "$bin" "$@"
|
|
118
|
+
fi
|
|
119
|
+
echo "impeccable: skipping $bin: it reports engine ${probe_version:-unknown} but this skill pins $version; delete it to stop this warning" >&2
|
|
106
120
|
fi
|
|
107
121
|
# On Windows (an MSYS/Git Bash shell) the cached names carry .exe so this
|
|
108
122
|
# launcher and impeccable.cmd share one cache.
|
|
@@ -113,20 +127,22 @@ if [ -z "$probing" ] && [ -x "$home_bin" ] && probe_ok "$home_bin"; then
|
|
|
113
127
|
exec "$home_bin" "$@"
|
|
114
128
|
fi
|
|
115
129
|
# Version-pinned user cache, filled by the download below or by `impeccable update`.
|
|
116
|
-
version=""
|
|
117
|
-
[ -f "$dir/VERSION" ] && version=$(tr -d '[:space:]' < "$dir/VERSION")
|
|
118
130
|
cache_root="${IMPECCABLE_HOME:-${HOME:-/nonexistent}/.impeccable}"
|
|
119
131
|
cached="$cache_root/bin/$version/impeccable$exe"
|
|
120
132
|
asset="impeccable-$os-$arch"
|
|
121
133
|
[ "$os" = windows ] && asset="$asset.exe"
|
|
122
134
|
if [ -n "$version" ] && [ -x "$cached" ]; then
|
|
123
|
-
|
|
135
|
+
read_expected
|
|
136
|
+
cached_size
|
|
137
|
+
stamp=""
|
|
138
|
+
stamp_size=""
|
|
139
|
+
{ IFS="$(printf ' \t\r')" read -r stamp stamp_size _ < "$cached.verified"; } 2>/dev/null || :
|
|
140
|
+
if [ -n "$stamp" ] && [ "$stamp_size" = "$size" ] && { [ "$stamp" = "$expected" ] || [ "$stamp" = "$expected_x64" ]; } && [ ! "$cached" -nt "$cached.verified" ]; then
|
|
124
141
|
exec "$cached" "$@"
|
|
125
142
|
fi
|
|
126
|
-
read_expected
|
|
127
143
|
hash_file "$cached"
|
|
128
144
|
if [ -n "$actual" ] && { [ "$actual" = "$expected" ] || [ "$actual" = "$expected_x64" ]; }; then
|
|
129
|
-
{ echo "$actual" > "$cached.verified"; } 2>/dev/null || :
|
|
145
|
+
{ echo "$actual $size" > "$cached.verified"; } 2>/dev/null || :
|
|
130
146
|
exec "$cached" "$@"
|
|
131
147
|
fi
|
|
132
148
|
echo "impeccable: cannot verify the cached engine $cached against $manifest; not using it" >&2
|
|
@@ -235,7 +251,8 @@ if [ -n "$version" ] && [ "$os" != unknown ] && [ "$arch" != unknown ]; then
|
|
|
235
251
|
exit 127
|
|
236
252
|
fi
|
|
237
253
|
check_download "$cached"
|
|
238
|
-
|
|
254
|
+
cached_size
|
|
255
|
+
{ echo "$actual $size" > "$cached.verified"; } 2>/dev/null || :
|
|
239
256
|
exec "$cached" "$@"
|
|
240
257
|
fi
|
|
241
258
|
rm -f "$tmp" 2>/dev/null
|
|
@@ -11,13 +11,16 @@ rem Linear goto flow keeps every expansion on its own line, and avoids
|
|
|
11
11
|
rem delayed expansion eating ! characters in user arguments.
|
|
12
12
|
rem - The unversioned user binary and the PATH candidate are validated with
|
|
13
13
|
rem the engine-probe handshake (see :probe) so the retired 3.x npm CLI,
|
|
14
|
-
rem whose bin is also named impeccable, is never exec'd.
|
|
15
|
-
rem
|
|
14
|
+
rem whose bin is also named impeccable, is never exec'd. The sibling binary
|
|
15
|
+
rem must also report the version in VERSION: it is not tracked, so a skill
|
|
16
|
+
rem upgrade can leave an old engine in place. IMPECCABLE_BIN stays trusted.
|
|
16
17
|
rem - Downloads and the version-pinned cache are verified via certutil
|
|
17
18
|
rem against engine-checksums.txt next to this file, and fail closed; a
|
|
18
|
-
rem .verified stamp lets later runs skip hashing the cache
|
|
19
|
-
rem
|
|
20
|
-
rem
|
|
19
|
+
rem .verified stamp lets later runs skip hashing the cache while it holds
|
|
20
|
+
rem the manifest digest and the binary's size and is not older than the
|
|
21
|
+
rem binary. On ARM64 the arm64 asset is tried first and the x64 asset is the
|
|
22
|
+
rem fallback (Windows on ARM runs x64 binaries), each only when the manifest
|
|
23
|
+
rem has a line for it.
|
|
21
24
|
if not defined IMPECCABLE_SKILL_DIR set "IMPECCABLE_SKILL_DIR=%~dp0.."
|
|
22
25
|
if not defined IMPECCABLE_SELF set "IMPECCABLE_SELF=%~f0"
|
|
23
26
|
set "arch=x64"
|
|
@@ -29,8 +32,18 @@ set "run=%IMPECCABLE_BIN%"
|
|
|
29
32
|
goto run
|
|
30
33
|
:no_env_bin
|
|
31
34
|
|
|
35
|
+
set "version="
|
|
36
|
+
if exist "%~dp0VERSION" set /p version=<"%~dp0VERSION"
|
|
32
37
|
set "bin=%~dp0bin\windows-%arch%\impeccable.exe"
|
|
33
38
|
if not exist "%bin%" goto no_sibling
|
|
39
|
+
if defined IMPECCABLE_LAUNCHER_PROBE goto sibling_ok
|
|
40
|
+
if not defined version goto sibling_ok
|
|
41
|
+
call :probe "%bin%"
|
|
42
|
+
if "%probe_version%"=="%version%" goto sibling_ok
|
|
43
|
+
if not defined probe_version set "probe_version=unknown"
|
|
44
|
+
echo impeccable: skipping "%bin%": it reports engine %probe_version% but this skill pins %version%; delete it to stop this warning 1>&2
|
|
45
|
+
goto no_sibling
|
|
46
|
+
:sibling_ok
|
|
34
47
|
set "run=%bin%"
|
|
35
48
|
goto run
|
|
36
49
|
:no_sibling
|
|
@@ -44,16 +57,27 @@ set "run=%home_bin%"
|
|
|
44
57
|
goto run
|
|
45
58
|
:no_home_bin
|
|
46
59
|
|
|
47
|
-
set "version="
|
|
48
|
-
if exist "%~dp0VERSION" set /p version=<"%~dp0VERSION"
|
|
49
60
|
if not defined IMPECCABLE_HOME set "IMPECCABLE_HOME=%USERPROFILE%\.impeccable"
|
|
50
61
|
set "cached=%IMPECCABLE_HOME%\bin\%version%\impeccable.exe"
|
|
51
62
|
set "asset=impeccable-windows-%arch%.exe"
|
|
52
63
|
set "manifest=%~dp0engine-checksums.txt"
|
|
53
64
|
if not defined version goto no_cache
|
|
54
65
|
if not exist "%cached%" goto no_cache
|
|
55
|
-
if exist "%cached%.verified" goto cache_trusted
|
|
56
66
|
call :read_expected
|
|
67
|
+
for %%f in ("%cached%") do set "size=%%~zf"
|
|
68
|
+
set "stamp="
|
|
69
|
+
if exist "%cached%.verified" for /f "usebackq tokens=1,2" %%s in ("%cached%.verified") do set "stamp=%%s"& set "stamp_size=%%t"
|
|
70
|
+
if not defined stamp goto cache_hash
|
|
71
|
+
if not "%stamp_size%"=="%size%" goto cache_hash
|
|
72
|
+
if /I "%stamp%"=="%expected%" goto cache_stamp_matches
|
|
73
|
+
if /I "%stamp%"=="%expected_x64%" goto cache_stamp_matches
|
|
74
|
+
goto cache_hash
|
|
75
|
+
:cache_stamp_matches
|
|
76
|
+
rem Newest first: the stamp must be listed before the binary it vouches for.
|
|
77
|
+
set "newest="
|
|
78
|
+
for /f "delims=" %%f in ('dir /b /a:-d /o:-d "%cached%*" 2^>nul') do if not defined newest set "newest=%%f"
|
|
79
|
+
if /I "%newest%"=="impeccable.exe.verified" goto cache_trusted
|
|
80
|
+
:cache_hash
|
|
57
81
|
call :sha256 "%cached%" "%TEMP%\impeccable-hash-%RANDOM%%RANDOM%.txt"
|
|
58
82
|
if not defined actual goto cache_unverified
|
|
59
83
|
if /I "%actual%"=="%expected%" goto cache_verified
|
|
@@ -62,7 +86,7 @@ if /I "%actual%"=="%expected_x64%" goto cache_verified
|
|
|
62
86
|
echo impeccable: cannot verify the cached engine "%cached%" against "%manifest%"; not using it 1>&2
|
|
63
87
|
goto no_cache
|
|
64
88
|
:cache_verified
|
|
65
|
-
(>"%cached%.verified" echo %actual%) 2>nul
|
|
89
|
+
(>"%cached%.verified" echo %actual% %size%) 2>nul
|
|
66
90
|
:cache_trusted
|
|
67
91
|
set "run=%cached%"
|
|
68
92
|
goto run
|
|
@@ -150,8 +174,7 @@ exit /b 127
|
|
|
150
174
|
|
|
151
175
|
:read_expected
|
|
152
176
|
rem Sets expected (and, on ARM64, expected_x64: Windows on ARM runs x64
|
|
153
|
-
rem binaries) from engine-checksums.txt.
|
|
154
|
-
rem hooks run this launcher on every edit.
|
|
177
|
+
rem binaries) from engine-checksums.txt.
|
|
155
178
|
call :manifest_digest "%asset%" expected
|
|
156
179
|
set "expected_x64="
|
|
157
180
|
if "%arch%"=="arm64" call :manifest_digest impeccable-windows-x64.exe expected_x64
|
|
@@ -211,7 +234,8 @@ if errorlevel 1 goto place_failed
|
|
|
211
234
|
call :discard_staging
|
|
212
235
|
call :check_download "%cached%"
|
|
213
236
|
if errorlevel 1 exit /b 127
|
|
214
|
-
(
|
|
237
|
+
for %%f in ("%cached%") do set "size=%%~zf"
|
|
238
|
+
(>"%cached%.verified" echo %actual% %size%) 2>nul
|
|
215
239
|
set "run=%cached%"
|
|
216
240
|
goto run
|
|
217
241
|
|
|
@@ -228,9 +252,11 @@ exit /b %errorlevel%
|
|
|
228
252
|
|
|
229
253
|
:probe
|
|
230
254
|
rem Sets probe_ok=1 when %1 answers the engine handshake: prints
|
|
231
|
-
rem "impeccable-engine <version>" and exits 0
|
|
232
|
-
rem unknown verb with "Unknown command",
|
|
255
|
+
rem "impeccable-engine <version>" and exits 0, and probe_version to that
|
|
256
|
+
rem version. The 3.x npm CLI answers any unknown verb with "Unknown command",
|
|
257
|
+
rem exit 1, so it never passes.
|
|
233
258
|
set "probe_ok="
|
|
259
|
+
set "probe_version="
|
|
234
260
|
set "probe_tmp=%TEMP%\impeccable-probe-%RANDOM%%RANDOM%.txt"
|
|
235
261
|
set "IMPECCABLE_LAUNCHER_PROBE=1"
|
|
236
262
|
"%~1" engine-probe >"%probe_tmp%" 2>nul
|
|
@@ -238,7 +264,9 @@ set "probe_err=%ERRORLEVEL%"
|
|
|
238
264
|
set "IMPECCABLE_LAUNCHER_PROBE="
|
|
239
265
|
if not "%probe_err%"=="0" goto probe_done
|
|
240
266
|
findstr /b /c:"impeccable-engine" "%probe_tmp%" >nul 2>nul
|
|
241
|
-
if
|
|
267
|
+
if errorlevel 1 goto probe_done
|
|
268
|
+
set "probe_ok=1"
|
|
269
|
+
for /f "usebackq tokens=2" %%v in ("%probe_tmp%") do if not defined probe_version set "probe_version=%%v"
|
|
242
270
|
:probe_done
|
|
243
271
|
del "%probe_tmp%" >nul 2>nul
|
|
244
272
|
exit /b 0
|