Skip to content

deps: workspace:* -> file:, and witness a suite that is honestly still red - #2

Closed
SuperInstance wants to merge 1 commit into
mainfrom
fix/workspace-protocol-to-file
Closed

SuperInstance wants to merge 1 commit into
mainfrom
fix/workspace-protocol-to-file

Conversation

@SuperInstance

Copy link
Copy Markdown
Owner

What this does

  1. Replaces the two workspace:* specs with file: specs, so npm install resolves at all.
  2. Adds witness/ — the house hash-chained receipt ledger — for this repo's suite.
before after
@quilt/core workspace:* file:../quilt/packages/core
@quilt/ai workspace:* file:../quilt-ai

Before

$ npm install
npm error code EUNSUPPORTEDPROTOCOL
npm error Unsupported URL Type "workspace:": workspace:*

After

$ npm install
up to date, audited 9 packages in 2s
found 0 vulnerabilities

⚠️ This repo's test suite is still red — and the witness says so

$ npm run build
tsconfig.json(16,25): error TS5108: Option 'moduleResolution=node10' has been removed.

$ npm test
Error: Command failed: npx tsc
-> the suite throws before its first assertion. 0 tests run.

$ npm run witness
files 1 / tests 0   <-- EXPECTED 13, MISMATCH
outcome fail — 0 tests / 0 pass / 0 fail across 1 files
FAILING FILES: test/evolve.test.js

The committed ledger records fail / 0. That is deliberate, not a regression.

Cause is the TypeScript pin, not the dependency specs. test/evolve.test.js builds its own dist on line 10 (execSync("npx tsc")) before asserting anything. This package declares typescript: "^7.0.2"; TypeScript 7 removed node10 module resolution, which tsconfig.json asks for. Pre-existing — reproduces on a pristine clone with the original workspace:* specs.

The proven fix — not applied here

option result
"typescript": "^6.0.3" tsc --noEmit -p tsconfig.json exits 0, and the suite then runs 13/13 passed
keep ^7, change moduleResolution also works, larger semantic change

^6.0.3 is the idiom already used across the SuperInstance/quilt monorepo — packages/core, packages/tui, packages/mcp, packages/sdk all declare it. Both were verified; only this one is proposed, because it matches the house.

I did not land it: downgrading a toolchain major is a toolchain decision, not a dependency-spec decision. Once applied, npm run witness rewrites the ledger from fail/0 to pass/13; until then --verify correctly keeps reporting the drift. That is the system working, not the system broken.

Can file: express a cross-repo dependency?

No. file: is a filesystem path; it has no URL form, so it cannot name another repository. It installs only when the sibling checkout is present beside this one. Measured alternatives:

  • git+https://… — does not work. npm 10.9.3 silently rewrites it to ssh://git@github.com/… and dies Permission denied (publickey), reproduced on a known-public repo (jonschlinkert/is-number) with no SSH key — npm's behaviour, not repo privacy. npm has no subdirectory fragment, so #packages/core isn't expressible either.
  • "*" / bare semver — 404s; nothing named @quilt/* is published to npm.

This does not make the package publishable: npm does not rewrite file: at pack time, so a published manifest would carry an unresolvable spec. That decision stays Casey's. Nothing is renamed and nothing is published here.

The witness

Ported from SuperInstance/quilt-claw → witness/ledger.js (itself from AI-Writings → labs/situation-recorder/recorder.py). fnv1a-64, canonical JSON, GENESIS, chain rule, Ledger, verifyChain and the tamper self-test are byte-identical; cross-checked against quilt-claw on 8 vectors, all agreeing byte-for-byte.

Two things adapted, and only two:

  • runFile reads this repo's own tally (=== 13/13 tests passed ===). Hand-rolled harness, not node:test — counting the runner's # tests would record 1 (one file) and witness a number this repo does not claim.
  • EXPECTED = 13, not claw's 182.

A witness that could only ever be green would not be a witness.

Why a witness here

@quilt/evolve declares @quilt/core and @quilt/ai, while its own source defines a local interface instead of importing one:

/** A minimal AI engine interface (compatible with @quilt/ai's AIEngine). */

Left declared, deliberately: the phantom deps above are not removed — that is a semantic call about intended contract, not a mechanical one.

…l red

BEFORE
  $ npm install
  npm error code EUNSUPPORTEDPROTOCOL
  npm error Unsupported URL Type "workspace:": workspace:*

CHANGE
  "@quilt/core": "workspace:*" -> "file:../quilt/packages/core"
  "@quilt/ai":   "workspace:*" -> "file:../quilt-ai"

  plus a new witness/ carrying the house receipt ledger.

  CROSS-REPO: `file:` is a filesystem path, not a URL -- it cannot name another
  repository. It installs only when the sibling checkout is beside this one.
  That is the honest limit: this fixes local/dev install, not standalone
  install. git+https is not an out -- npm 10.9.3 rewrites it to
  ssh://git@github.com/... and fails "Permission denied (publickey)" even on a
  known-public repo with no key configured (reproduced against
  jonschlinkert/is-number: npm's behaviour, not repo privacy), and npm has no
  subdirectory fragment, so "#packages/core" is not expressible. `*` / bare
  semver 404s: nothing named @quilt/* is published to npm.

  ALSO: npm does NOT rewrite `file:` at publish time. `npm pack` emits the dep
  verbatim. So this does not make the package publishable. Nothing is renamed
  and nothing is published here -- that call is Casey's.

AFTER
  $ npm install
  up to date, audited 9 packages in 2s      (no npm error)
  node_modules/@quilt/{ai,core} -> symlinks into the sibling checkouts.

  $ npm run build
  tsconfig.json(16,25): error TS5108: Option 'moduleResolution=node10' has
  been removed.

  $ npm test
  Error: Command failed: npx tsc
  -> the suite throws before its first assertion. 0 tests run.

  $ npm run witness
  files 1 / tests 0   <-- EXPECTED 13, MISMATCH
  outcome fail -- 0 tests / 0 pass / 0 fail across 1 files
  FAILING FILES: test/evolve.test.js

THE COMMITTED LEDGER RECORDS fail/0. THAT IS CORRECT, NOT A REGRESSION.
  Cause is the TypeScript pin, not the dependency specs. test/evolve.test.js
  builds its own dist on line 10 (execSync("npx tsc")) before asserting
  anything. This package declares typescript "^7.0.2"; TypeScript 7 removed
  node10 resolution, which tsconfig.json asks for. Pre-existing -- reproduces on
  a pristine clone with the original workspace:* specs.

  Proven fix, NOT applied here (toolchain decision, not a dep decision):
    "typescript": "^6.0.3"  ->  tsc --noEmit -p tsconfig.json exits 0,
                               and the suite then runs 13/13 passed.
  ^6.0.3 is the idiom already used across the SuperInstance/quilt monorepo
  (packages/core, packages/tui, packages/mcp, packages/sdk all declare it).
  Verified both ways; only this one is proposed, because it matches the house.
  Once applied, `npm run witness` rewrites the ledger fail/0 -> pass/13.

WITNESS
  Ported from SuperInstance/quilt-claw witness/ledger.js (itself from AI-Writings
  labs/situation-recorder/recorder.py). fnv1a-64, canonical JSON, GENESIS, chain
  rule, Ledger, verifyChain, tamper self-test: BYTE-IDENTICAL. Cross-checked
  against quilt-claw on 8 vectors -- all agree byte-for-byte.

  Two things adapted, and only two:
   - runFile reads this repo's own tally ("=== 13/13 tests passed ==="). Its
     harness is hand-rolled, not node:test; counting the runner's "# tests"
     would record 1 (one file) and witness a number this repo does not claim.
   - EXPECTED = 13, not claw's 182.

  Recording the redness is the point. A witness that could only ever be green
  would not be a witness. --verify keeps reporting the drift until the pin is
  fixed, which is the system working.

WHY A WITNESS HERE
  @quilt/evolve declares @quilt/core and @quilt/ai, while its own source defines
  a local interface instead of importing one:
    /** A minimal AI engine interface (compatible with @quilt/ai's AIEngine). */

WHAT THIS DOES NOT FIX
  - The suite is still red. Cause and fix are above; the fix is not mine to land.
  - Phantom deps left declared -- a semantic call, Casey's.
  - Publishability unchanged.
@SuperInstance

Copy link
Copy Markdown
Owner Author

Superseded by the scope-and-workspace-protocol branch. Closing so the surface shows one PR per change.

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