Skip to content

fix(build): vite base for Pages deploy#22

Merged
w1ne merged 1 commit intodevelopfrom
fix/vite-base-path
Apr 29, 2026
Merged

fix(build): vite base for Pages deploy#22
w1ne merged 1 commit intodevelopfrom
fix/vite-base-path

Conversation

@w1ne
Copy link
Copy Markdown
Owner

@w1ne w1ne commented Apr 29, 2026

Summary

Pages deploy succeeded but the site rendered blank because Vite's base was '/' while Pages serves at /kernelCAD-web/. Asset paths 404'd. Fixed by setting base conditionally:

```ts
base: command === 'build' ? '/kernelCAD-web/' : '/'
```

Dev keeps '/' so `npm run dev` works unchanged.

Test plan

  • `npm run build` produces HTML with /kernelCAD-web/-prefixed asset URLs
  • After merge + workflow_dispatch deploy, site renders in chrome-devtools without 404s

The site is published at https://n1n3.net/kernelCAD-web/ but vite.config.ts
had base: '/'. Asset URLs in the built HTML therefore pointed at the apex
(e.g. /assets/index-XXX.js → 404), giving a blank white page on Pages.
Set base conditionally on command so dev still uses '/'.
@w1ne w1ne merged commit 1b1a3c5 into develop Apr 29, 2026
2 checks passed
@w1ne w1ne deleted the fix/vite-base-path branch April 30, 2026 08:23
w1ne added a commit that referenced this pull request May 3, 2026
…erns + lookup_cookbook MCP tool + eval --cookbook flag (#22) (#59)

* docs(cookbook): v1 design spec — workstream #22

Curated library of canonical .kcad.ts pattern snippets, indexed for
in-prompt retrieval. Distinct from corpus expansion (cookbook is for
agents to reference, corpus is for evaluation). Continuous.

v1 scope:
- 12 starter pattern snippets seeded from eval expert solutions and the
  documented kernel surface
- Markdown frontmatter file format (id, title, tags, keywords,
  when_to_use, fenced TS body)
- BM25 retrieval over title/tags/keywords/when_to_use; score floor 0.5;
  ~40 LoC pure TS, no external deps
- Hybrid agent surface: build-generated SKILL.md cookbook index +
  MCP tool lookup_cookbook(query, k)
- Eval --cookbook flag with pre-injection (separate cache_control
  block); A/B golden test on bracket-holes
- CI gates: validate frontmatter, evaluate every body clean, diff-check
  generated SKILL.md section
- Continuous growth contract: same-PR additions, eval-driven additions,
  snapshot-test gate on ranking shifts

Native-framed per the no-competitor-refs rule. Lineage captured in
~/.claude/projects/-home-andrii/memory/kernelcad_design_lineage.md
under '#22 cookbook with retrieval (2026-05-03) — design-time lineage'.

* docs(cookbook): v1 implementation plan — workstream #22

19 tasks (102 bite-sized steps) covering:
- yaml dep + tags whitelist + 12 starter snippets
- Pure BM25 retrieval module (~60 LoC, no deps)
- Snippet loader with frontmatter + tag-whitelist validation
- search() composition with score floor + k clamping
- 3 CI gates (validate, evaluate, build) wired into qc
- SKILL.md cookbook index generator + diff-check
- MCP tool lookup_cookbook
- TranscriptEvent kind cookbook_inject + renderer
- AgentClient systemAddendum (separate cache_control block)
- Eval --cookbook flag + per-task pre-injection
- A/B golden test on bracket-holes
- npm run eval:ab convenience script
- CHANGELOG entry

TDD throughout (test before implementation). Frequent commits (one per
task). Ready for subagent-driven-development execution.

Spec lineage: docs/superpowers/specs/2026-05-03-cookbook-with-retrieval-design.md (2ab8190).

* chore(cookbook): add yaml dep + tags whitelist + snippets folder

* feat(cookbook): pure BM25 tokenizer + scorer

* feat(cookbook): snippet loader with frontmatter + tag validation

* feat(cookbook): public search() with score floor + k clamping

* feat(cookbook): 12 starter pattern snippets

* fix(cookbook): use 3-backtick fences in snippet bodies

* fix(cookbook): drop no-op translate from mirror-half-part snippet

* feat(cookbook): cookbook:validate npm script

* feat(cookbook): cookbook:evaluate gate (every body must kernelcad evaluate clean)

* test(cookbook): snapshot top-3 IDs for 5 hand-picked queries

* feat(cookbook): SKILL.md cookbook index generator

* fix(cookbook): use plan-verbatim empty-cookbook placeholder text

* revert: keep '_(empty)_' placeholder so plan-verbatim test still passes

* feat(cookbook): SKILL.md cookbook index — markers + generated section

* chore(cookbook): wire cookbook:validate/evaluate/build + diff-check into qc

- Add cookbook:validate, cookbook:evaluate, and cookbook:build to qc script
- Add git diff --exit-code check on src/skill/SKILL.md to catch drift
- Fix lint error: remove unused import of loadSnippets (re-exported via export statement)

* feat(mcp): lookup_cookbook tool — BM25 retrieval over cookbook

* feat(eval): cookbook_inject TranscriptEvent + renderer

* feat(eval): AgentClient supports optional systemAddendum (separate cache block)

* feat(eval): cookbook injector — wraps search() for the harness

* feat(eval): --cookbook flag wires per-task injection into runner

* test(eval): A/B golden — bracket-holes identical with/without --cookbook

* chore(eval): eval:ab script — runs suite twice, prints score delta

* fix(eval): eval:ab forwards argv to inner runs (e.g. --mock, task name)

* docs(changelog): cookbook v1 — workstream #22

---------

Co-authored-by: w1ne <w1ne@users.noreply.github.com>
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