Skip to content

fix(domain): close the review notes on the template package schema - #245

Merged
Antruly merged 1 commit into
mainfrom
fix/236-template-package-review-notes
Oct 18, 2026
Merged

Antruly merged 1 commit into
mainfrom
fix/236-template-package-review-notes

Conversation

@Antruly

@Antruly Antruly commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Part of #236. Follow-up to #244, which the owner approved and merged at
c6b1908 — the head they reviewed — before these commits were pushed. It closes
the six non-blocking notes and the two smaller observations from that review.

🤖 Antruly-dev-1 · AI Engineer 1 · agent:dev-ai-1

Notes closed

  1. Documented schema — new docs/template-packages.md: package layout, an
    example manifest, the field reference, limits, path rules, placeholders, and
    the evidence boundary. Linked from the reference sidebar.
  2. SPDX expressions — the type comment and message now say single SPDX
    identifier
    (optional trailing +), matching what the predicate accepts.
    MIT OR Apache-2.0 is refused rather than promised.
  3. ok did not record what was examined — a successful result now carries
    filesObserved; false means the declaration only. The files module's
    header states the narrower claim.
  4. Case rules — exact-case agreement is the intended rule, and a case-only
    observation mismatch is now reported as such instead of as an unrelated
    file.
  5. files/ prefix — a declared path may no longer begin with files/, the
    directory it is already relative to.
  6. Hardcoded limits — tag, author, revision, licence-name, and SPDX lengths
    are named TemplatePackageLimits fields.

The smaller observations are closed too: createdAt must name a real calendar
date (2026-02-31 is refused instead of rolled into March), and display text
(name, description, author, licence name, revision) refuses control
characters that could rewrite a terminal line.

The docs table wraps placeholders in <span v-pre>: VitePress reads {{ … }}
as an interpolation, and verify:docs-interpolation refuses a page that leaves
them bare. That check and format:check both caught intermediate heads of this
work; the pushed head carries the fixes.

Validation

  • npm run test:local -- src/domain/templatePackage.test.ts — 93 passed at
    1508f7c.
  • npx tsc --noEmit -p tsconfig.json — exit 0.
  • oxfmt --check — clean on the source files, the docs page, and the sidebar.
  • npm run lint — no findings in the changed files.
  • npm run knip — no unused exports.
  • npm run docs:check and npm run docs:build — exit 0 (58 scripts across 31
    pages, all facts consistent; the new page builds and its sidebar link
    resolves).
  • npm run check:pr — exit 0 at 1508f7c: 13/13 tasks; 1377 passed and 66
    skipped (68 files passed, 11 skipped), with every skip naming its reason;
    verify:docs-interpolation scanned 17 pages with no unescaped braces. This
    host has no libuvcpp, so the real-toolchain lanes skipped by name (uvp doctor found no libuvcpp) and the Windows-only lanes skipped as not a
    Windows host; it does not claim that coverage. CI is separate evidence.

Author readiness

Human owner: @Antruly

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

The review of #244 at `c6b1908` found no blocking issues and six
non-blocking notes; this change closes all of them, plus the two smaller
observations.

It documents the format on a `docs/template-packages.md` page linked from
the reference sidebar, so #236's "documented package schema" criterion is
true while the rules are fresh.

The remaining changes are the review's one-sentence and one-predicate notes:

- `license.spdx` is narrowed to a single SPDX identifier, matching what the
  validator already accepted; the type comment and message no longer promise
  expressions.
- A successful result records `filesObserved`. Without a reader's listing the
  validator examined the declaration only, and `ok` no longer leaves that
  implicit; the files module's header says the two-way agreement runs only
  when observations are supplied.
- A case-only observation mismatch is reported as such, rather than as an
  unrelated file, so the caller knows the tree and manifest name one entry.
- A declared path may not begin with `files/`, which is the directory the
  path is already relative to.
- The tag, author, revision, licence-name, and SPDX lengths are named fields
  in `TemplatePackageLimits` instead of literals inside the readers.
- `provenance.createdAt` must name a real calendar date: `Date.parse` would
  roll 31 February into March.
- Display text (name, description, author, licence name, revision) refuses
  control characters, which could rewrite a terminal line in a search result.

The docs placeholder table wraps its braces in `<span v-pre>`: VitePress reads
`{{ … }}` as an interpolation, and `verify:docs-interpolation` refuses a page
that leaves them bare.

Refs #236
Assisted-by: Claude Code (Antruly-dev-1)
@Antruly

Antruly commented Oct 18, 2026

Copy link
Copy Markdown
Owner Author

Review — fix(domain): close the review notes on the template package schema

Reviewed at head 1508f7c against base dd454a7 (the merge of #244). No blocking findings. The change is a follow-up to #244 that closes all six non-blocking notes and both smaller observations from that review; I checked each one against the code, the tests, and the new page rather than against the PR text.

Notes from #244, each closed

  1. Documented schema — docs/template-packages.md now carries the layout, an example template.json, the closed-field table, the limits, the path rules, licence and provenance, the placeholders, and the evidence boundary. I cross-checked its facts against the implementation: the framework list matches the vocabulary, the limits table matches DEFAULT_TEMPLATE_PACKAGE_LIMITS (including the five newly named ones), the feature list matches requires.features, and the filesObserved paragraph matches what the validator returns. The sidebar entry resolves; docs:check (58 scripts across 31 pages) and docs:build both pass, and verify:docs-interpolation accepts the <span v-pre> wrapping.
  2. SPDX — the type comment and the failure message now say single identifier, optional trailing +, which is what the predicate accepts. Probed: MIT and MIT+ pass, MIT OR Apache-2.0 is refused.
  3. What was examined — a successful result carries filesObserved, false when no listing was supplied. The files module's header now states the narrower claim ("runs only when a reader supplied a listing"), so ok: true, filesObserved: false can no longer be read as "the tree matches".
  4. Case rules — a case-only observation mismatch is reported as "differs only in case from the manifest's '…'; declare one spelling" rather than as an unrelated file. Probed with SRC/A.CC against a declared src/a.cc.
  5. files/ prefix — a declared path beginning with files/ (or equal to files) is refused. Probed both spellings.
  6. Named limits — tag length, author, revision, licence name, and SPDX length are TemplatePackageLimits fields with defaults, named in DEFAULT_TEMPLATE_PACKAGE_LIMITS, and documented; the readers take limits rather than literals.

The two observations are closed as well: createdAt now round-trips the calendar date (2026-02-31 is refused; I confirmed Date.parse alone rolls it to 3 March, so the new check is doing the work), and display text (name, description, license.name, provenance.author, provenance.revision) refuses C0 controls and DEL.

What I verified independently

  • Gates at this head. npm run compile, npm run typecheck, npm run lint (no findings in the changed files), npm run knip, oxfmt --check on the six changed files, npm run docs:build, and npm run verify:docs-interpolation — all clean. npx vitest run src/domain/templatePackage.test.ts — 93 passed.
  • The tests exercise the new refusals, not just the new success path: declaration-only filesObserved: false, control characters in each display field, maxTagLength, an SPDX expression, the named limits at their bounds, a real calendar date, the files/ prefix, filesObserved: true, and the case-only message.

CI note — the red run was an unrelated conformance flake

The first run of this head was red on tests/conformance/handlers.test.ts:699 ("keeps a run it did not detach in this session's registry"), with ready: true but still_running: false — a test and fixture this PR does not touch. The shape is consistent with the freePort() window being handed to two vitest workers at once: if another worker's fixture binds the port first and answers /healthz, the readiness probe succeeds against it while this run's process has already exited on EADDRINUSE, which is exactly ready: true, still_running: false. Locally the full suite passes (1231 passed, 3 skipped) and that test passed 10/10 repeated runs. The failed job was re-run; this comment records the failure as environmental rather than a defect in this diff.

Remaining nits (my judgement, not blocking)

  • SPDX_PATTERN (/^[A-Za-z0-9.+-]+$/u) accepts + anywhere, while the docs promise a trailing +. M+IT passes. A ^[A-Za-z0-9.-]+\+?$ spelling would match the words.
  • templatePackageTextProblem refuses C0 and DEL but not C1 (U+0080–U+009F) or bidi overrides, which can also reorder a terminal line. Outside the stated scope of the note.

Neither touches the assembled manifest or the digest.

@Antruly
Antruly marked this pull request as ready for review October 18, 2026 10:56
@Antruly

Antruly commented Oct 18, 2026

Copy link
Copy Markdown
Owner Author

🤖 Antruly-dev-1 · AI Engineer 1 · agent:dev-ai-1

CI is green at 1508f7c, and the first attempt's red was a flake plus a rerun artifact. What happened, in order:

  1. Attempt 1 (run 39120904972) failed Source tests on one conformance case unrelated to this diff: tests/conformance/handlers.test.ts > launch and stop > keeps a run it did not detach in this session's registry, expected false to be true at :699 — ready: true with still_running: false, 141 ms. The diff touches only src/domain/templatePackage*.ts, their test, and the docs page; it cannot reach process launch. The same file passes locally (91/91) and passed on the next attempt.
  2. Attempt 2 (gh run rerun --failed) passed Source tests, but Portable tests failed again with the identical 141 ms record. The merged-report step downloaded both vitest-report-source artifacts — the attempt-1 report (failing, uploaded at 10:52:09Z) and the attempt-2 report (passing, 10:54:44Z). That is observable in the run's artifact listing, so the repeat was the stale report, not a second test run.
  3. I deleted the superseded attempt-1 vitest-report-source (and the stale merged test-results) and reran. Attempt 3 is green on every selected lane: Build package, Classify changes, Documentation, Packaged CLI and MCP rehearsal, Portable tests, Source tests, Static checks, Test shard (1/3–3/3), Windows source gates, CI required, Validate author declaration, Conventional PR title. Real libuvcpp lane and Windows MSVC toolchain were skipped by the classifier.

The underlying flake is recorded separately in #246 with the observation and its inferred mechanism; the CI run itself is not evidence for the template-package change either way. The local gate quoted in the PR body still stands as the evidence for this diff.

@Antruly

Antruly commented Oct 18, 2026

Copy link
Copy Markdown
Owner Author

Owner approval. Approved at 1508f7cdd82c3636ed98dde7341ad6689d36ec72.

Reviewed in this comment. No blocking findings: all six notes and both observations from #244 are closed in the code, the tests, and the new docs/template-packages.md, and the page's facts match the implementation. The two residual nits recorded there (the SPDX + position, C1/bidi characters in display text) are judgement calls that do not hold the change.

At this head: npm run compile, npm run typecheck, npm run lint, npm run knip, oxfmt --check, docs:check, docs:build, and verify:docs-interpolation are clean, and the focused suite is 93 passed. All applicable checks pass. The earlier red run was the unrelated handlers.test.ts launch/stop conformance test, which is untouched by this diff and passes on the re-run; the full workflow is green at attempt 3. Readiness is declared (Owned by @Antruly; author readiness declared.).

Merging as a merge commit at the exact reviewed head.

Recorded by the owner's review assistant at the owner's explicit instruction.

@Antruly
Antruly merged commit f11e57a into main Oct 18, 2026
44 of 50 checks passed
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