Repository navigation
feat(domain): add the uvp.template/1 manifest schema and validator - #244
Conversation
A template package is data: a closed manifest, a source tree under `files/`, a README, a licence, and an optional preview. This adds the pure domain half, with no store, filesystem write, network call, or tool contract. The schema is closed and the vocabulary is shared: categories, frameworks, the two placeholders a v1 package may declare, and the limits are exported constants, so a later store and search read the same set rather than re-spelling it. Paths follow Windows rules on every host, because a package extracted on Linux may be built on Windows. Versions are full SemVer 2.0.0 values; requirement ranges accept only a comparator set this revision can spell, and are not evaluated here. Digests are over the RFC 8785 canonical manifest. The declared `files` list and the reader's observations are checked against each other in both directions; an observation that reports no digest, symlink flag, or binary flag is left unexamined rather than read as success. The validator reports every problem in one pass and never throws. Refs #236 Assisted-by: Claude Code (Antruly-dev-1)
Review —
|
|
Owner approval. Approved at Reviewed in this comment. No blocking findings: the five modules stay inside the stated P1 boundary (no reader, store, or tool), and I verified the closed-key parsing, the path and limit rules, the two-way file agreement when observations are supplied, and the canonical digest — including probes beyond the test file. The six non-blocking notes recorded there (schema docs before P2, SPDX expressions vs the stated contract, the observation boundary in the success type, case rules, the At this head: Merging as a merge commit at the exact reviewed head. Recorded by the owner's review assistant at the owner's explicit instruction. |
|
Merged at 🤖 Antruly-dev-1 · AI Engineer 1 · agent:dev-ai-1 |
Part of #236 — P1 of the template-package increments. Refs, not Fixes: the
local store, the directory/zip reader, search, rendering, and the tool contracts
remain open.
🤖 Antruly-dev-1 · AI Engineer 1 · agent:dev-ai-1
What this adds
Five pure
domainmodules, with no adapter, contract, or catalog change:templatePackage.tstemplatePackageManifest.tsvalidateTemplatePackage: closed-key parsing, field rules, and the assembled manifesttemplatePackageFiles.tsfileslist and the two-way agreement with a reader's observationstemplatePackageProblems.tstemplatePackage.test.tsThe validator reports every problem in one pass and never throws, so an
importer can write a complete report before writing anything to disk.
Decisions recorded here
The maintainer confirmed Q1–Q5 in the working session: the store root is
$UVP_TEMPLATE_HOME, else~/.uvp/templates; a package is a directory or a.zip; v1 has placeholders only, no conditions; search returns metadata only,default limit 20 with a
truncatedflag; the six tool names and effects areaccepted. This increment fixes only the manifest vocabulary those decisions
need; it adds no tool.
Q8 limits are provisional. These are named, documented, and changeable
before P2/P4 without a schema change:
What this deliberately does not claim
observations from a reader that listed
files/.observation only when the reader supplied one; an observation without a
digest leaves the question unexamined, not answered.
reader's
symlinkandbinaryflags.license.spdxis checked for syntax only.requiresranges are accepted only in a comparatorspelling this revision can state; comparing them to an installed version is
a later increment.
established by validating its package.
Validation
npm run test:local -- src/domain/templatePackage.test.ts— 86 passed.npx tsc --noEmit -p tsconfig.json— exit 0.npm run lint— no findings in the new files.oxfmt --check— clean on all five files.npm run knip— no unused exports.npm run check:pr— exit 0 atc6b1908: 13/13 tasks; 1370 passed and 66skipped (68 files passed, 11 skipped), with every skip naming its reason.
This run had no libuvcpp installed, so the real-toolchain lanes skipped by
name (
uvp doctor found no libuvcpp) and the Windows-only lanes skipped asnot a Windows host; it does not claim that coverage. The CI lanes on this PR
are separate evidence and are still running.
Author readiness
Human owner: @Antruly