Skip to content

chore: full-repo cleanup — dead code, duplicate code, stale docs#851

Merged
determined-001 merged 8 commits into
mainfrom
chore/full-repo-cleanup-2026-07
Jul 6, 2026
Merged

chore: full-repo cleanup — dead code, duplicate code, stale docs#851
determined-001 merged 8 commits into
mainfrom
chore/full-repo-cleanup-2026-07

Conversation

@determined-001

Copy link
Copy Markdown
Owner

Summary

Full-repo cleanup pass: dead/unused code, duplicated logic, and stale docs across all four packages, root config, and the docs site.

  • Dead code: unused functions/exports, dead imports, unused deps, inert pnpm-overrides duplicate, an orphaned React component.
  • Duplicate code: extracted 3 copy-pasted blocks into shared helpers (TtlLruCache, fullJitterBackoffMs, acquireSseConnection).
  • Real bug fix: packages/pulse-webhooks/bin/orbital was broken (wrong import name, wrong path) — the orbital dlq CLI could not run. Fixed, and made replayDLQ do a real signed HTTP redelivery instead of a no-op stub.
  • Docs: README/PROGRESS/ROADMAP/ARCHITECTURE/COOKBOOK/docs/proposal.md (the live SCF grant application) all described Soroban event subscription, cursor persistence, and the abi-registry package as unshipped "Phase 1" — all three are actually shipped and tested. Corrected across all affected docs, reframed the grant funding ask to the genuinely-remaining milestones, and fixed 4 docs pointing at the wrong GitHub org/repo.

See individual commits for the full breakdown — each is scoped to one concern.

Test plan

  • pnpm lint — 0 warnings
  • pnpm build — all 4 packages compile clean
  • pnpm -r test — 940 tests green (abi-registry 128, pulse-core 558/7 skipped, pulse-webhooks 188, pulse-notify 66)
  • pnpm --filter orbital/web build — typechecks and builds clean, new/updated docs pages statically generate
  • Manually smoke-tested replayDLQ's real HTTP delivery end-to-end (mock server, verified signature)

Note: the npm-publish step enabled in release.yml still needs an NPM_TOKEN secret added under repo settings before the next tagged release.

Deletes unreferenced functions (extractSymbol, toIdentifierName), dead
default exports (FileCursorStore, S3CursorStore), a dead deprecated type
alias, unused imports, and an unused param on generateContractArtifacts.
Also drops the root package.json "overrides" block, which pnpm v10 never
reads (only pnpm-workspace.yaml's copy is consulted), and removes unused
tsx/vite devDependency drift across packages. Deletes the orphaned
apps/web/components/CodeSnippet.tsx, superseded by CodeSection.tsx.
Removes unused imports/vars in test files (unused destructures, unused
mock helpers, unused React imports) flagged by eslint's no-unused-vars.
No behavior change.
Three near-identical blocks were copy-pasted across sibling files; pulled
each into one shared implementation with no behavior change (existing
tests pass unchanged):

- abi-registry: AbiRegistryClient and LocalAbiRegistryClient each carried
  their own byte-identical TTL-cache constants/type/get/set logic ->
  extracted to TtlLruCache. (LocalAbiRegistryClient's stray `catch (e)`
  unused-binding lint fix rides along in this diff.)
- pulse-core: EventEngine and SorobanSubscriber each computed the same
  full-jitter exponential backoff inline -> extracted to
  fullJitterBackoffMs in backoff.ts. (EventEngine's unused CursorStore
  import removal rides along in this diff.)
- pulse-notify: connectionPool's acquireEventConnection and
  acquireContractEventConnection shared ~90 lines of identical
  onopen/onmessage/onerror/devtools wiring -> extracted to
  acquireSseConnection. Also merged the near-duplicate ConnectionKey/
  ConnectionSubscriber types from connectionPool.ts and wsTransport.ts
  into one connectionTypes.ts.
…rypoint

bin/orbital imported `{ DeadLetterStore }` from a module that only exports
`MemoryDeadLetterStore`, and resolved paths against `../src/*.js` instead
of the built `../dist/*.js` — the `orbital dlq` CLI could not run at all
as shipped.

- Fix the import name and dist-relative paths in bin/orbital.
- Extract WebhookDelivery's private HMAC signing into an exported
  `signWebhookPayload` (packages/pulse-webhooks/src/signing.ts), reused by
  verifyWebhookRaw's expected-signature computation (pure refactor, no
  behavior change).
- Make `replayDLQ` real: it now delegates to the store's existing
  `replay()`/`ReplayHandler` mechanism instead of silently re-adding the
  entry. bin/orbital wires a real fetch-based ReplayHandler signed via
  `signWebhookPayload`, configurable via `--secret`/`ORBITAL_WEBHOOK_SECRET`.
- Reuse `signWebhookPayload` in apps/web's webhook-sample demo route
  instead of a second inline HMAC implementation.
- Add missing test coverage: cli.test.ts (list/dump/replay) and
  signing.test.ts (round-trips against verifyWebhookRaw, pinned ADR-003
  fixture).
isEventType is exported public API (published to npm) but had zero test
coverage. Covers single-type narrowing, multi-type OR-narrowing, the
negative case, and filtering an event array by type.
Packages are already live on npm under the @orbital-stellar scope
(published out-of-band), so the previously-commented-out publish step
would otherwise keep looking like an unfinished TODO forever. Uncommented
it to handle future version-bump releases.

Note: this step still requires an NPM_TOKEN secret to be added under the
repo's GitHub Actions secrets before the next tagged release — that's a
settings change, not something this commit can do.
README.md, PROGRESS.md, ROADMAP.md, docs/ARCHITECTURE.md,
docs/COOKBOOK.md, and docs/proposal.md all described Soroban event
subscription, cursor persistence, and the abi-registry package as
unshipped "Phase 1" work, when all three are fully implemented, tested,
and wired end-to-end. Corrects the status across all of them so they
agree with each other and with the code:

- Soroban subscription, cursor/retry persistence, and the ABI registry
  client are marked shipped, not planned.
- docs/proposal.md (the live SCF grant application) is reframed so its
  funding ask covers only the genuinely-remaining milestones (M3
  discriminated-union refinement, M5 starter boilerplates, M6 stability
  pledge) instead of pitching already-shipped work (M1, M2) as unbuilt.
- Package counts/tables updated from three to four packages
  (abi-registry was missing) in PROGRESS.md, CONTRIBUTING.md,
  CHANGELOG.md, and docs/proposal.md.
- Stale test counts (103/13) replaced with current figures across
  docs/ARCHITECTURE.md and docs/proposal.md.
- pulse-webhooks/README.md gains a documented "Durable retry queues"
  section (RetryQueue was shipped but undocumented).
- Fixed four docs linking to the wrong GitHub org/repo
  (github.com/orbital/orbital instead of
  github.com/determined-001/orbital_stellar).
- Fixed broken links in webhook-durability.md (pointed at nonexistent
  reference/cli pages) and apps/web/README.md's wrong package name.
- Wired the orphaned cursor-persistence guide into the docs nav
  (apps/web/lib/docroutes.ts) and authored the previously-missing
  migrate-from-eventsource guide the nav already linked to.
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
orbital-dev Error Error Jul 6, 2026 4:49pm

apps/web/app/api/webhook-sample/route.ts now imports
@orbital-stellar/pulse-webhooks (added earlier in this cleanup to dedupe
its HMAC signing), but ci.yml's typecheck-web job and release.yml's
release job only built pulse-core before typechecking apps/web — the
new import couldn't resolve since pulse-webhooks' dist/index.d.ts was
never emitted first. Added a real build step (not --noEmit) for
pulse-webhooks before each apps/web typecheck step.
@determined-001 determined-001 merged commit b64d83b into main Jul 6, 2026
15 of 16 checks passed
@determined-001 determined-001 deleted the chore/full-repo-cleanup-2026-07 branch July 6, 2026 16:55
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.

2 participants