Skip to content

Migrate Writer to the production SDK-only backend - #43

Open
callumalpass wants to merge 1 commit into
mainfrom
chore/sdk-current-production
Open

callumalpass wants to merge 1 commit into
mainfrom
chore/sdk-current-production

Conversation

@callumalpass

Copy link
Copy Markdown
Contributor

Summary

Migrate Writer to its existing SDK-only backend so weekly production-verified repins need no backend migration. UI and i18n are now exactly 0.1.0-beta.148.

Legacy callers and their replacements

  • No-environment/default app entry: removed LegacyApp, ConnectBackend, its Connect application session, gates/picker and unused sign-in/popup preparation. All ordinary builds use the SDK application entry and NativeWriterBackend; absent environment defaults to production, as the manifest builder does. Explicit environment/origin checks still refuse mismatches. No fallback or opt-in backend flag.
  • Demo, large demo and performance fixture: moved from connect-testing / synthetic legacy queries to the retained SDK's MemoryReplica, using the same native backend. Fixture-only catalog and array-type derivation fill gaps in MemoryReplica, not in the production SDK. Browser fault injection now uses public SDK/replica APIs.
  • Workspace/outline tests: use actual SDK leases and record sessions. Removed tests specific to the deleted legacy query transport; native tests and browser coverage remain.
  • Shared JSON views: removed legacy type imports. Writer's JSON draft/session port stays because DraftStore consumes persisted browser backups. Connected namespaces remain collection IDs; the demo namespace remains demo. This is application data, not a protocol compatibility shim.

The SDK original sdk-eaa4e697-production-beta141.tgz is unchanged (SHA256 e64771a90bed2fb3837d4b65df8930fcd124d3059fcb0bcbaf9d64dbfb148205). No SDK changes or repacking. The matching protocol original remains for manifest validation and publisher custody checks. Removed the beta.125 Connect dependency/override, connect-dev/testing dependencies, both query-patched archives and their patch/pin sidecars. No unrelated dependencies changed.

PR #16 was inspected. Its structural workspace session interface is already present on main and retained; its older SDK, proposed control plane, custom session engine and opt-in dual-backend design are not revived.

Flow corrections found during migration

  • Collection resets invalidate expanded annotation bodies as well as discovery metadata.
  • Recovery problems remain visible, and Retry save delegates to SDK flush/receipt recovery without resubmitting an unknown operation.
  • “Use as manuscript” preserves already-typed notes. The pinned SDK's contract promotion only accepts untyped notes, so this named persisted-record flow uses one ordinary SDK CAS update and verifies the contract readback. Existing mapped titles, native sibling values, inferred/explicit types, body and record ID are retained; malformed explicit type values refuse before submission. Regression tests cover these cases.
  • Kept the existing error boundary/draft-download behavior in the shared shell; removed obsolete catalogue entries and regenerated all ten locales without translation services.

Publisher inputs

config/native-publish/production.json binds npm UI beta.148's exact version, SHA512 SRI and tarball SHA256. Native intake supports that registry pin and checks its frozen importer/resolution and installed package identity; SDK/protocol complete-member and producer provenance/trust checks remain intact. The npm UI install is SRI-verified, rather than claiming an archived UI member inventory. Tamper tests cover version, SRI and protected-hash substitutions. Synthetic CI-unit verification uses the current production inputs without hard-coded member counts that would obstruct later SDK repins.

Before a future authorized production publication, the protected writer-production environment's NATIVE_UI_SHA256 must match the new approved value 56f51e9dce7cd83149fe99efbbbdb43203288f724ed6b6e019886e1c3d65ad75. This PR does not mutate GitHub environment variables or release branches.

Historical staging package/lock snapshots intentionally remain unchanged: they are frozen publisher-test inputs, not Writer's active dependency graph. The separately qualified staging publisher still requires its own staging original intake; this PR does not retarget the production SDK to staging.

Verification completed before opening this PR

Finite pnpm checks/builds used the repo's pinned pnpm 11.15.1 through rpnpm (remote build runner); browser/local-service tests ran locally. Node 22.22.0.

  • pnpm install --lockfile-only and pnpm install --frozen-lockfile — passed; only the requested dependency changes in the lock.
  • rpnpm check — passed strict ten-locale completeness/composition/source checks, typecheck and all normal suites: 646 passed, 7 existing skips (core 65 passed/4 skipped; app Node 80/2; app Vitest 274/1; root Node 227/0). Existing skips are optional Pandoc parity/materialization, sibling Reader/contracts checkout comparisons, and ZIP integration coverage; the real browser export tests also passed.
  • rpnpm --pull apps/writer/dist build — passed, including manifest generation/validation and optimized production build. rpnpm ... build:production also passed.
  • rpnpm --class build test:publisher:ci-unit — 282 passed, zero skipped, including original/provenance/installer/forgery tests and the actual current production intake.
  • rpnpm --pull apps/writer/dist --filter @mdbase-writer/app build:editing-test and local test:browser:editing — passed optimized React editing, cursor movement and undo/redo with a real Preview canvas.
  • Cold Vite optimizer cache, local pnpm dev: test:browser — 56 baseline/reliability scenarios passed, including real PDF/DOCX/ZIP exports, typed-note adoption, annotations, conflicts, drafts, failures and recovery.
  • Local test:browser:i18n — passed all ten locales, language negotiation/persistence, formatting, CodeMirror and failed-chunk retention.
  • Local test:browser:a11y — passed 375px/1280px axe and keyboard/dialog focus scenarios.
  • build:feedback-test plus local loopback preview and test:feedback — passed desktop/mobile feedback; all delivery intercepted.
  • Opt-in migrated SDK benchmark (rpnpm --class build --filter @mdbase-writer/app test --config scripts/perf/vitest.config.ts) — passed.
  • git diff --check and empty pnpm why for connect/connect-dev/connect-testing — passed.

Independent static review completed; its adoption preservation findings were fixed directly with regression tests. No remaining migration blocker identified. These are deterministic/demo checks, not live connected-collection or native-device acceptance.

No merge, release/publish workflow dispatch, publication or deployment.

This branch has not been deployed

No deployments
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