Resolve last advisory, derive version from package.json, give stele-core a test suite - #57
Merged
Merged
Conversation
…st stele-core **Dependabot.** #42 cleared the three stele-core advisories, including the Hono CORS ReDoS, which mattered here because that middleware is what guards /api/*. The last one was @babel/core, transitive via eslint-plugin-react-hooks — lint and build time only, never in bundle.html, hence LOW. Pinned with a pnpm override to ^7.29.7 rather than left open; the lockfile now resolves 7.29.7. **Version.** This was not an ambiguity, it was rot. v1.1.0 was tagged and released on 2026-06-06, package.json was bumped for it, and src/lib/version.ts was not — zero commits touched it between the two tags. Since STELE_VERSION is stamped into every narrative export as `steleVersion`, exports from the shipped 1.1.0 build claimed to be 1.0.0. package.json is authoritative because it is what the tag and release.yml publish against, so the constant is now injected from it by vite's `define` and cannot drift again. A test asserts the wiring holds, since a removed define would silently make it undefined rather than fail. **stele-core tests.** It had none — the reason it reached main with live type errors, and the reason the injectivity fix was only ever covered on the browser side. 39 cases over the chain encoding, the /api/* perimeter, the schema invariants, and the write-conflict classifier. No database needed: the chain is pure and the perimeter goes through Hono's request handler, so the suite runs in CI without a service container. node:test rather than vitest, deliberately. tsx is already a devDependency, so this adds zero packages to a security-sensitive service whose own review flagged install-time supply-chain risk. Mutation-tested rather than assumed: dropping the P2034 check fails 2, letting an empty API_SECRET fall open fails 1, reverting the chain to a delimiter join fails 1. The suite discriminates.
Comment on lines
+84
to
+87
| "pnpm": { | ||
| "overrides": { | ||
| "@babel/core": "^7.29.7" | ||
| } |
There was a problem hiding this comment.
Frozen pnpm installation is blocked by ignored package override
pnpm install --frozen-lockfile now fails before dependencies are installed. pnpm 11.9.0 reports that it no longer reads pnpm.overrides from package.json, while the committed lockfile still records that override, and exits with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH. Move the override to pnpm 11's supported configuration location and regenerate the lockfile so CI and clean reproducible installs can run.
Artifacts
Frozen-install inputs before execution
- A disposable worktree captured the override declaration, matching lockfile entry, and input hashes before the installation attempt, showing the configuration state being tested.
Frozen installation failure with ignored override
- The executed CI frozen installation reports that pnpm ignores package.json pnpm.overrides and exits 1 with ERR_PNPM_LOCKFILE_CONFIG_MISMATCH, confirming the blocking mismatch.
Disposable frozen-lockfile reproduction runner
- The review-authored runner creates and removes an isolated Git worktree, executes the frozen install, and writes the paired command-output captures, so no repository dependency changes are retained.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: package.json
Line: 84-87
Comment:
**Frozen pnpm installation is blocked by ignored package override**
`pnpm install --frozen-lockfile` now fails before dependencies are installed. pnpm 11.9.0 reports that it no longer reads `pnpm.overrides` from `package.json`, while the committed lockfile still records that override, and exits with `ERR_PNPM_LOCKFILE_CONFIG_MISMATCH`. Move the override to pnpm 11's supported configuration location and regenerate the lockfile so CI and clean reproducible installs can run.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reopens #45, which was closed without merging — the branch's remote copy had been auto-deleted on close, but it was still live in a local worktree, unmerged. Original description:
Three things.
Dependabot — all clear
#42 cleared the three
stele-coreadvisories: Hono CORS ReDoS (which mattered specifically because that middleware guards/api/*), fast-uri host confusion, and find-my-way HTTP/2 DDoS. Verified against the newstele-coreCI job before merging.The last one was
@babel/core, transitive viaeslint-plugin-react-hooks— lint/build time only, never inbundle.html, hence LOW. Pinned with apnpm.overridesentry to^7.29.7rather than left open; the lockfile now resolves 7.29.7.Version — this was rot, not an ambiguity
The
1.1.0vs1.0.0split has been sitting in the journal as "needs a human decision on which is authoritative". It doesn't:v1.1.0was tagged and released 2026-06-06 (f1a5c2e chore: bump version to 1.1.0).git log v1.0.0..v1.1.0 -- src/lib/version.ts→ 0 commits. It was simply forgotten.package.jsonis authoritative because it's whatgit tag v*andrelease.ymlpublish against. The harm was concrete:STELE_VERSIONis stamped into every narrative export assteleVersion, so exports from the shipped 1.1.0 build claimed to be 1.0.0 — wrong provenance in the one artifact whose purpose is provenance.Fixed structurally rather than by editing a literal: vite
defineinjects it frompackage.json, so it can't drift again. A test guards the wiring, since a removeddefinewould make the constantundefinedrather than fail loudly.stele-core — 39 tests, no database
It had none. That's why it reached main with live type errors, and why the injectivity fix was covered on the browser side but not the server side.
Coverage: the chain encoding (injectivity witnesses, replay verification, session binding, client-supplied-hash rejection), the
/api/*perimeter (scheme handling, prefix/suffix tokens, fail-closed on unset and emptyAPI_SECRET, preflight passes untokened, non-/api/*untouched), the schema invariants (integrityHashstripped,secretsDetectedboolean-only), and the write-conflict classifier.No service container needed — the chain is pure and the perimeter runs through Hono's request handler.
node:test, not vitest, deliberately.tsxis already a devDependency, so this adds zero packages to a security-sensitive service whose own review flagged install-time supply-chain risk.Mutation-tested, not assumed: dropping the
P2034check fails 2 cases; letting an emptyAPI_SECRETfall open fails 1; reverting the chain to a delimiter join fails 1. Baseline 39/39.CI verified green on this branch at the time (
tsc,stele-core) — note main has advanced since (#44, #46, dependabot merges), so CI needs to re-run here before merging.🤖 Generated with Claude Code
Greptile Summary
This change derives the application version from package metadata, adds stele-core regression coverage, and updates the Babel resolution. The production build and version tests confirmed that the emitted bundle uses the package version and contains no unresolved version token. However, clean frozen root dependency installation now fails because the package override configuration and committed lockfile are incompatible with the repository's pnpm version. This prevents CI and other reproducible installs from proceeding.
Confidence Score: 4/5
Not safe to merge until the pnpm override configuration and lockfile are aligned, because the expected frozen installation path fails before builds or tests can run.
The installation failure was reproduced using the actual frozen pnpm command in an isolated worktree, with pnpm reporting the exact configuration mismatch. The version injection behavior was also exercised through a production build and passing version tests.
Files Needing Attention: package.json and pnpm-lock.yaml need attention; place the @babel/core override in a configuration location supported by pnpm 11 and regenerate the lockfile accordingly.
What T-Rex did
Comments Outside Diff (1)
General comment
ERR_PNPM_LOCKFILE_CONFIG_MISMATCH. pnpm 11.9.0 reports thatpnpm.overridesin package.json is ignored, yet the checked-in lockfile has an overrides section, so CI and other reproducible installs cannot proceed.package.json:84-87stores the override in the deprecated/ignoredpnpmpackage field, whilepnpm-lock.yaml:7-8retains it as active lockfile configuration. The runtime configuration and lockfile configuration therefore differ.pnpm-lock.yamlwith the repository’s pinned pnpm version; alternatively align the supported active configuration with the lockfile before requiring frozen installs.Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix: resolve remaining advisory, derive ..." | Re-trigger Greptile