Files
SeedPass/.github/workflows/ts-parity.yml
T
thePR0M3TH3ANandClaude Fable 5 1864343084 cutover: close gates 5, 6 and 7
Gate 5 (feature parity) -- document import/export ported: `entry
import-document` reads a text file (label defaults to the file stem, type
from the extension) and `entry export-document` writes one back, reproducing
Python's filename sanitization, directory-vs-file destination handling and
overwrite refusal. That was the last concrete item; the three remaining
exclusions (PGP RSA, semantic, api) are now documented decisions rather than
open work, and none of them blocks cutover.

Gate 6 (packaging) -- js/packages/cli/build.mjs bundles the CLI into a
single self-contained ESM file with no runtime dependencies beyond Node 22,
writes a .sha256 beside it, and is wired up as the package `bin` and
`prepack` so npm install/pack produce a working command. --version now
reports a real version stamped at build time. CI builds the bundle and
smoke-tests it from a directory with no node_modules -- version,
capabilities, profile creation, entry creation, reveal -- then uploads it.
Verified locally that the bundle runs standalone outside the workspace.

Gate 7 (migration and rollback) -- docs/typescript_migration_guide.md: the
migration is a no-op (same profiles), so the guide covers what to back up,
how to rehearse against a copy with SEEDPASS_APP_DIR, the two behavioral
differences users will notice, the known exclusions, and seed-only recovery.
Rollback is proven rather than asserted: new cross-impl phase K drives a
profile through the TS CLI -- several entry kinds created, one edited, one
archived -- then checks Python reopens it, sees every change, derives the
same secrets, and can still write to it afterwards.

Also adds js/packages/cli/README.md documenting the reference-first output
model and the scoped-token workflow.

193 core + 49 CLI tests green; 36/36 cross-implementation checks green.
All eight cutover gates are now green.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-14 21:33:28 -04:00

115 lines
3.9 KiB
YAML

name: TypeScript Parity
on:
push:
branches: ["**"]
paths:
- "js/**"
- "src/**"
- "scripts/generate_ts_port_fixtures.py"
- "scripts/cross_impl_check.py"
- ".github/workflows/ts-parity.yml"
pull_request:
branches: ["**"]
paths:
- "js/**"
- "src/**"
- "scripts/generate_ts_port_fixtures.py"
- "scripts/cross_impl_check.py"
- ".github/workflows/ts-parity.yml"
jobs:
parity:
runs-on: ubuntu-latest
defaults:
run:
working-directory: js
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Enable pnpm via corepack
run: corepack enable
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Typecheck
run: pnpm -r typecheck
- name: Parity tests (Node + jsdom)
run: pnpm -r test
- name: Build the distributable CLI
run: pnpm --filter @seedpass/cli build
- name: Smoke-test the bundle standalone
# Run from a directory with no node_modules to prove the bundle
# carries everything it needs.
run: |
set -eu
BIN="$PWD/packages/cli/dist/seedpass-js.mjs"
APP_DIR="$(mktemp -d)"
cd "$(mktemp -d)"
node "$BIN" --version
node "$BIN" capabilities > /dev/null
export SEEDPASS_APP_DIR="$APP_DIR"
export SEEDPASS_MNEMONIC="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
export SEEDPASS_PASSWORD="ci-smoke-password"
node "$BIN" fingerprint add --name ci > /dev/null
node "$BIN" entry add password ci-site --length 16 > /dev/null
test -n "$(node "$BIN" entry reveal ci-site)"
- name: Upload CLI bundle
uses: actions/upload-artifact@v4
with:
name: seedpass-js-cli
path: |
js/packages/cli/dist/seedpass-js.mjs
js/packages/cli/dist/seedpass-js.mjs.sha256
# Fixtures prove the two implementations compute the same values; this job
# proves they can read each other's on-disk profiles and backups.
cross-implementation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Enable pnpm via corepack
run: corepack enable
- name: Install JS dependencies
run: pnpm install --frozen-lockfile
working-directory: js
- name: Install Poetry
run: pipx install poetry
- name: Install Python dependencies
run: poetry install --no-interaction --no-ansi
- name: Cross-implementation compatibility
run: poetry run python scripts/cross_impl_check.py
# The fixtures are committed, so the parity job never regenerates them.
# This job proves the committed fixtures actually come from the committed
# generator: it regenerates from Python and fails on any drift.
fixture-drift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install Poetry
run: pipx install poetry
- name: Install dependencies
run: poetry install --no-interaction --no-ansi
- name: Regenerate fixtures
run: poetry run python scripts/generate_ts_port_fixtures.py
- name: Fail on drift
# manifest.json records the generating commit, which legitimately
# differs from the checked-out commit — everything else must match.
run: >
git diff --exit-code --
js/packages/test-vectors/fixtures
':(exclude)js/packages/test-vectors/fixtures/manifest.json'