Skip to content

feat(design): local corpus doctrine + tsdown bump + release 0.1.84 - #93

Merged
fusengine merged 3 commits into
mainfrom
feat/design-corpus
Jul 29, 2026
Merged

feat(design): local corpus doctrine + tsdown bump + release 0.1.84#93
fusengine merged 3 commits into
mainfrom
feat/design-corpus

Conversation

@fusengine

Copy link
Copy Markdown
Owner

Summary

  • Local design corpus as the source of taste for the design-expert gates: per-runtime corpus resolution (Claude marketplace tree vs Codex versioned cache, semver-selected, no process.cwd() fallback), corpus reads tracked as state progression, citation<->read join tolerant of both naming conventions and layouts, template-platform allowlist inverted into a frozen denylist.
  • Design quota changes: at least one screenshot required in every mode; corpus-present quotas { full: 2, page: 1, component: 1 } plus corpus reads; corpus-absent leaves pre-doctrine quotas untouched.
  • apply_patch wired into the design pipeline (Codex add/delete ops validated against the PRE gates; POST re-reads the real file, promote-only).
  • Fixes: pluginsWriteGuard bypass on relative paths closed; String.replace substitution-pattern bypass in the design content gate closed ($&, $`, $', $$).
  • Dependency bump: tsdown 0.22.13 -> 0.22.14 (transitively bumps verkit 0.1.2 -> 0.3.0, rolldown-plugin-dts).
  • Release bump: package.json 0.1.83 -> 0.1.84, CHANGELOG entry added.

Changes

  • src/policy/design/* (corpus.ts, corpus-resolve.ts, design-system-rules.ts, template-urls.ts, gates-pipeline.ts, gates.ts, state.ts, transitions.ts)
  • src/runtime/design-content-gate.ts, design-files-gate.ts, design-helpers.ts, design.ts, handle-post.ts, handle-pre.ts, handle-types.ts, pre-allow.ts
  • test/design-*.test.ts (14 new files), test/apexauth-usermessage.test.ts
  • package.json, bun.lock, CHANGELOG.md

Test plan

  • bun test -> 981 pass / 1 skip / 0 fail, 2976 expect() calls, 982 tests, 178 files
  • bunx tsc --noEmit -> exit 0
  • Security scan on the full diff (filenames + content patterns for secrets/keys/credentials/absolute paths) -> clean
  • CI green on this PR

Breaking changes

None.

The design-expert plugin produced generic, interchangeable pages because
its inspiration phase browsed ~100 Framer/Webflow templates. A local
corpus of 11 references (refs-design/) becomes the source of taste. The
harness still enforced the OLD doctrine (4 screenshots, an allowlist of
template platforms) and therefore blocked anyone following the new one.
This makes the harness EXECUTE the new doctrine without weakening the gate.

- corpus resolution per runtime: Claude marketplace tree vs Codex
  plugins/cache/<mp>/<plugin>/<version>/, with semver selection; the
  process.cwd() fallback is removed entirely
- corpus reads recorded as state progression; the citation<->read join
  tolerates both naming conventions and both layouts
- quotas: >=1 screenshot in every mode, always; corpus present ->
  { full: 2, page: 1, component: 1 } plus the corpus reads
- template-platform allowlist inverted into a denylist (template-urls.ts,
  deliberately frozen - the source of taste is the published corpus)
- apply_patch (Codex primitive) brought into the design pipeline: PRE
  path/phase/quota gates, op:"add" validated as a Write, delete skipped,
  cwd wired for the POST re-read
- pluginsWriteGuard extended to relative paths; corpusRoot and pluginsRoot
  resolved independently
- substitution bypass closed on all four quadrants

Corpus absent leaves the requirement waived (pre-doctrine quotas) - the
branch stays dormant until refs-design/ ships to the marketplace.

901 -> 982 tests, 166 -> 178 files. Ten adversarial review rounds
(fresh-context challenger + factual audit each round); every conserved
mechanism mutation-tested, no survivors.
Bump PATCH and record the design corpus doctrine in the CHANGELOG
(feat 2107330): per-runtime corpus resolution, revised quotas,
apply_patch in the design pipeline, pluginsWriteGuard on relative
paths, substitution bypass closed.
@fusengine
fusengine merged commit cda7ef8 into main Jul 29, 2026
1 check passed
@fusengine
fusengine deleted the feat/design-corpus branch July 29, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant