mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-14 07:06:45 +03:00
Trim dead code and tighten the branch to surgical scope
- palette-picker.js: drop the superseded APP/DOCS/INDEX copy tables, the disabled font-rail hoist machinery, LOREM.caption, and an orphan marker - design-context.css + dcx-hierarchy.css: drop the demo-era specimen, radius, and spacing-bar rule groups nothing renders - index.astro: drop an unreferenced boards const - de-export module-internal names (store, bindings, portability, visual-cues); remove picker-server's unused doc-session kill switch and document --doc in its help - palette.mjs: realpath the entry guard so symlinked installs still run the CLI (same guard as visual-cues.mjs) - revert serve-question.mjs copy ride-along; drop the plan/ gitignore entry; dedupe a build-picker comment; file design-context with the system category entries; alphabetize IMPECCABLE_SUB_COMMANDS - new-work.md: drop a same-screen restatement of the comp/world ranking - CLAUDE.md: correct the picker gate baseline to the measured 606 and explain the per-element multiplication; the trims removed the two dead-block font findings - DESIGN-CONTEXT-ARCHITECTURE.md: list portability.mjs in the code layout Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
6c2a79891c
commit
065bd4f3ca
@@ -14,7 +14,7 @@
|
||||
* reader is the prose around it.
|
||||
*/
|
||||
|
||||
export const BINDINGS = {
|
||||
const BINDINGS = {
|
||||
'palette.primary': { file: 'answers', path: 'palette-primary', kind: 'color', downstream: 'design-md' },
|
||||
'palette.secondary': { file: 'answers', path: 'palette-secondary', kind: 'color', downstream: 'design-md' },
|
||||
'palette.tertiary': { file: 'answers', path: 'palette-tertiary', kind: 'color', downstream: 'design-md' },
|
||||
|
||||
@@ -24,8 +24,8 @@ import {
|
||||
SCHEMA_VERSION,
|
||||
} from './store.mjs';
|
||||
|
||||
export const BUNDLE_KIND = 'impeccable-design-context';
|
||||
export const BUNDLE_SCHEMA = 1;
|
||||
const BUNDLE_KIND = 'impeccable-design-context';
|
||||
const BUNDLE_SCHEMA = 1;
|
||||
|
||||
const MAX_FILE_BYTES = 1024 * 1024;
|
||||
const MAX_BUNDLE_BYTES = 20 * 1024 * 1024;
|
||||
@@ -88,7 +88,7 @@ async function collectFiles(cwd, { includeAssets = true } = {}) {
|
||||
return { files, skipped };
|
||||
}
|
||||
|
||||
export async function buildBundle(cwd, { includeAssets = true, now = new Date() } = {}) {
|
||||
async function buildBundle(cwd, { includeAssets = true, now = new Date() } = {}) {
|
||||
const target = paths(cwd);
|
||||
const answers = await readAnswers(cwd);
|
||||
if (!answers) throw new Error('No design interview found. Run /impeccable document to create one.');
|
||||
@@ -154,7 +154,7 @@ function perSurfaceTable(answers, surfaces) {
|
||||
}
|
||||
|
||||
/** One document a reader, or another tool, can follow without this toolchain. */
|
||||
export function renderMarkdown(bundle) {
|
||||
function renderMarkdown(bundle) {
|
||||
const context = bundle.context?.context || {};
|
||||
const answers = bundle.answers || {};
|
||||
const name = bundle.product?.name || 'This product';
|
||||
|
||||
@@ -22,8 +22,8 @@ import fs from 'node:fs';
|
||||
import { readFile, mkdir, rename, rm, writeFile } from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
|
||||
export const STORE_DIR = '.impeccable/design-context';
|
||||
export const WORKSPACE_DIR = '.impeccable/visual-cues';
|
||||
const STORE_DIR = '.impeccable/design-context';
|
||||
const WORKSPACE_DIR = '.impeccable/visual-cues';
|
||||
/* The shape of context.json. Bump only when the shape changes, never for a release. */
|
||||
export const SCHEMA_VERSION = 1;
|
||||
|
||||
@@ -45,7 +45,6 @@ export function paths(cwd = process.cwd()) {
|
||||
journalJsonl: path.join(runtime, 'journal.jsonl'),
|
||||
draftJson: path.join(runtime, 'draft.json'),
|
||||
exportsDir: path.join(store, 'exports'),
|
||||
workspaceDir: path.resolve(cwd, WORKSPACE_DIR),
|
||||
cuesJson: path.resolve(cwd, WORKSPACE_DIR, 'cues.json'),
|
||||
fontsManifestJson: path.resolve(cwd, WORKSPACE_DIR, 'fonts.json'),
|
||||
};
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
*/
|
||||
|
||||
import crypto from 'node:crypto';
|
||||
import { realpathSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
|
||||
// Seeds are inlined (129 entries, hand-curated via a tinder review of
|
||||
@@ -500,7 +502,10 @@ function hueWord(H) {
|
||||
// no side effects.
|
||||
export { SEEDS };
|
||||
|
||||
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
||||
// argv[1] must be realpath'd: a skill installed via symlink makes argv[1]
|
||||
// the symlink path, which never equality-matches import.meta.url's realpath,
|
||||
// so the CLI would silently never run (same guard as visual-cues.mjs).
|
||||
if (process.argv[1] && import.meta.url === pathToFileURL(realpathSync(resolve(process.argv[1]))).href) {
|
||||
const args = parseArgs(process.argv.slice(2));
|
||||
const seed = pickSeed(SEEDS, args);
|
||||
const [L, C, H] = seed.oklch;
|
||||
|
||||
@@ -60,6 +60,7 @@ Options:
|
||||
--cues-dir PATH Visual cues directory (default: .impeccable/visual-cues)
|
||||
--timeout MINUTES Exit 2 if nothing submits (default: 60)
|
||||
--fresh Start blank, ignoring any previous answers or draft
|
||||
--doc Reopen the design context document; no questionnaire
|
||||
--help Show this help
|
||||
|
||||
Output:
|
||||
@@ -422,9 +423,6 @@ async function copyChosenCue(answers) {
|
||||
}
|
||||
|
||||
async function spawnDocSession() {
|
||||
/* The read-only path is otherwise unreachable from a test, and a document
|
||||
that renders without an edit session is a real state worth exercising. */
|
||||
if (process.env.IMPECCABLE_DOC_SESSION_DISABLE === '1') return null;
|
||||
try {
|
||||
const docPort = await findOpenPort(port + 1);
|
||||
const docToken = randomUUID();
|
||||
|
||||
@@ -375,7 +375,7 @@ if (hasFlag('start')) {
|
||||
const state = JSON.parse(fs.readFileSync(stateFile(key), 'utf8'));
|
||||
console.log(`QUESTION URL: ${state.url}`);
|
||||
console.log(`QUESTION KEY: ${key}`);
|
||||
console.log('Open the URL for the user now: on Cursor with browser_navigate (the in-IDE browser), on another harness with its in-app browser tool, otherwise the system opener (macOS `open`, Linux `xdg-open`), otherwise show the URL.');
|
||||
console.log('Open the URL for the user now: in-app browser when the harness has one, otherwise the system opener (macOS `open`, Linux `xdg-open`), otherwise show the URL.');
|
||||
console.log(`Then collect the answer with: node ${fileURLToPath(import.meta.url)} --wait --key ${key}`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ function paeth(a, b, c) {
|
||||
return c;
|
||||
}
|
||||
|
||||
export function decodePng(buf) {
|
||||
function decodePng(buf) {
|
||||
if (!buf.subarray(0, 8).equals(PNG_SIG)) throw new Error('not a PNG file');
|
||||
// Walk the chunk stream: each chunk is [4-byte length][4-byte type][data][4-byte crc].
|
||||
// IHDR carries the header fields; IDAT is the (possibly multi-chunk)
|
||||
@@ -306,8 +306,8 @@ function main() {
|
||||
}
|
||||
|
||||
// Only auto-run when invoked directly (`node visual-cues.mjs ...`), not
|
||||
// when another module imports its exports (decodePng, etc.), e.g. from a
|
||||
// test file. import.meta.url is Node's realpath of the entry file, so
|
||||
// when another module imports it. import.meta.url is Node's realpath of
|
||||
// the entry file, so
|
||||
// argv[1] must be realpath'd too, not just path.resolve'd: a skill
|
||||
// installed via symlink (the standard `skills link`/install path) makes
|
||||
// argv[1] the symlink path, which never equality-matches the resolved
|
||||
|
||||
Reference in New Issue
Block a user