Skip to content

CI gate, mock-proxy fixture registry and lane topology fixes (#43) - #48

Merged
michielbdejong merged 9 commits into
mainfrom
claude/atomic-plugins-issue-43-1b43ea
Sep 23, 2026
Merged

michielbdejong merged 9 commits into
mainfrom
claude/atomic-plugins-issue-43-1b43ea

Conversation

@michielbdejong

@michielbdejong michielbdejong commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Addresses the repo-setup parts of #43. Reflector (§4a) and connection-code rotation (§4c) are deliberately out of scope; §4c's points went onto #40.

Changes

§2: workflow_dispatch could report a false green (edf9ef5)
ci.yml, devonian-ci.yml, syncables-ci.yml and reflector-ci.yml now run dorny/paths-filter only on pull_request. Every other event forces the full matrix, as merge_group already did, so a manual dispatch can no longer skip every job and pass CI. The reflector-ci.yml change is only this gate fix; no reflector code is touched.

§3a: per-platform mock fixtures (1785847, 0185511, ea16056)

  • mock-proxy.mjs is now a generic host. It keeps the protocol (PKCE, /connect, redemption, code rotation).
  • Each platform's fixture lives in its own plugin's folder, at integrations/<plugin>/fixtures/<platform>/scenario.mjs: pets/fixtures/pets/, timesheets/fixtures/clockify/, issue-tracker/fixtures/github-issues/, calendar/fixtures/google-calendar/. Only the registry, integrations/localthought/fixtures/index.mjs, is shared.
  • MOCK_PROXY_PLATFORMS is now honoured: it restricts /catalog, /catalog/<id>.*, /connect and /proxy.
  • Unset or empty serves every fixture, so atomic-server's e2e-server.sh is unaffected. Platforms without a fixture are logged and skipped.
  • serve.mjs starts no mock for a lane whose platforms is []. The shared stack, which passes no list, gets every fixture.
  • server.github, server.calendar and server.clockify remain as aliases for upstream specs.
  • Caveat: atomic-server's dagger e2e mounts only integrations/localthought/, so it has to mount all of integrations/ once it takes this layout. That's dagger e2e: mount all of integrations/ for the mock proxy atomic-server#1639. PARALLEL_LANES.md §4 records this and what's still not started: recordings, record.mjs, fixture.test.mjs, and the drift guard.

Lane topology bug (1e3bd13)
Since #38 the SPA loads from atomic-server directly (FRONTEND_URL), but serve.mjs still set MOCK_FRONTEND_ORIGIN to the dev-server. The mock rejects /connect callbacks from any other origin, so pets.spec.ts's consent step would 400 once the §1a click failure stops masking it. This commit fixes that, drops the unused DEV_SERVER_UPSTREAM, and corrects ci.yml comments that still called the dev-server a proxy.

CI health, found on this PR's first run (1cd87c9, 3cc511e, c45f894)

  • E2E sign-in hang: every e2e job hung on "Setting up dev drive…". SKIP_WASM_BUILD=1 skipped the browser bundle that ClientDb loads from /wasm/atomic_wasm.js. The build job now builds it separately, as atomic-server's dagger pipeline does, with the pinned wasm-pack installer and --no-opt. Verified on run 35836765219: the step succeeds and pets gets past sign-in.
  • Teardown race: notion's e2e tier hit Database already open. Cannot acquire lock. stop() now waits for every process to exit, and the lane lock is no longer released between tiers.
  • Missing Playwright traces: lane jobs uploaded from the wrong directory, so failures shipped no traces. They now upload from integrations/tooling/{playwright-report,test-results}.
  • Dead script: deleted localthought/wasm-smoke.mjs, which imported WASM exports that atomic-server #1618 removed.

Verification

  • node --test integrations/tooling/*.test.mjs integrations/localthought/mock-proxy.test.mjs: 32 pass, 1 fail. The failure is certify.test.mjs "bundles are reproducible…", which needs browser/node_modules/.bin/esbuild from a full atomic-server checkout and can't run standalone.
  • Two new mock-proxy tests cover the platform restriction and the empty-list default.
  • The old and new mock proxy returned identical output for a 32-request script covering all four platforms: GitHub writes/labels/comments/bad JSON, calendar pagination and query validation, Clockify pagination, and pets paging.
  • Not verified: the lane e2e tiers and the workflow changes. Both need this PR's CI run. Per Follow-ups after the per-plugin CI lane split (#37, #38) #43 §1b, main has never run green, so read red here as "not yet verified" first.

Known red after this PR

  • Lane: pets (e2e) now gets past sign-in, and on its first attempt past the §1a click, then fails waiting for "Install and connect". At the pinned atomic-server, the setup dialog needs BrowserIntegrations.describe(), which no longer exists on either side. Decision: move to reflector, tracked in Move LocalThought setup/sync onto reflector (pets e2e is blocked until then) #52. This lane stays red until then.

Elsewhere

🤖 Generated with Claude Code

Michiel de Jong and others added 5 commits September 23, 2026 08:55
dorny/paths-filter has no pull_request context on a manual dispatch, so
if it came back empty every job skipped and `CI` reported success on a
run that tested nothing. Treat every non-pull_request event like
merge_group: skip the filter and force the full matrix. Applies to
ci.yml, devonian-ci.yml, syncables-ci.yml and reflector-ci.yml.

Refs #43 (section 2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mock dispatched on `platform` through an `if` chain with pets inline,
and ignored the MOCK_PROXY_PLATFORMS run-lane.mjs already passes, so
every lane's proxy served the full built-in set.

Each platform is now one integrations/localthought/fixtures/<id>/
scenario.mjs (the old mock-github/-calendar/-clockify modules, moved;
pets extracted), registered in fixtures/index.mjs. mock-proxy.mjs keeps
only the protocol: PKCE, /connect, redemption, code rotation.

MOCK_PROXY_PLATFORMS now restricts /catalog, /catalog/<id>.*, /connect
and /proxy to the listed platforms. Unset or empty still serves every
fixture, so atomic-server's e2e-server.sh and dagger (which never set
it) are unchanged. Platforms with no fixture yet (todoist, moneybird,
notion) are logged and skipped. server.github/.calendar/.clockify stay
as aliases.

Fixtures live under localthought/, not tooling/ as PARALLEL_LANES §4
proposed, because upstream dagger copies only that directory. Old and
new proxies give identical responses to a 32-request script exercising
all four platforms.

Refs #43 (section 3a).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since #38 the SPA loads from atomic-server directly (FRONTEND_URL in
run-lane.mjs and ci.yml's plugin-system job), but serve.mjs still told
the mock proxy the frontend was the dev-server. The mock rejects any
/connect whose redirect_uri has another origin, so pets.spec.ts's
consent step would 400 once the Integrations-card click (#43 section 1a)
stops failing first. Also drops the dev-server's DEV_SERVER_UPSTREAM,
which nothing reads since the proxy was deleted, and corrects ci.yml
comments that still described the dev-server as a proxy.

Not verified end to end: the e2e tier needs a full atomic-server
checkout and binary.

Refs #43.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the fixture registry, an empty MOCK_PROXY_PLATFORMS means "every
fixture" (so atomic-server's scripts, which never set it, keep working).
That made a lane declaring `platforms: []` get a mock serving everything.
bringUp now distinguishes the two: `platforms` omitted (the shared,
non-lane stack) starts the mock with every fixture; an empty list starts
no mock at all.

Refs #43, #47.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Everything specific to one plugin lives in integrations/<plugin>/, so
plugins can be developed in parallel and a fixture change triggers only
its own lane:

  pets/fixtures/pets/                     (scenario.mjs, document.json)
  timesheets/fixtures/clockify/
  issue-tracker/fixtures/github-issues/
  calendar/fixtures/google-calendar/

Only the registry, localthought/fixtures/index.mjs, stays shared; it
imports each fixture by relative path. No plugin's tsconfig or vitest
include picks up fixtures/. The 32-request parity script still gives
responses identical to the original mock.

Caveat, recorded in PARALLEL_LANES.md: atomic-server's dagger e2e copies
only integrations/localthought/ into its container, so it must copy all
of integrations/ once it takes this layout.

Refs #43.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Michiel de Jong and others added 2 commits September 23, 2026 10:21
Every e2e job (pets, notion, generic plugin system; timesheets locally)
hung on "Setting up dev drive…" and timed out in `waitForURL`. The
page's ClientDb loads /wasm/atomic_wasm.js at startup; CI run
35742352282 logs `Failed to fetch dynamically imported module:
.../wasm/atomic_wasm.js?v=dev` (`?v=dev` is vite's "no bundle built"
marker), and atomic-server answers that path with its HTML fallback.

SKIP_WASM_BUILD=1 was copied from atomic-server's downstream-saas job,
which never runs the dist in a browser. Its dagger e2e pipeline sets
the same variable but only after building the bundle separately into
public/wasm/ (wasmBuild() + jsBuild()). Do the same here: install
wasm-pack with atomic-server's pinned, checksum-verified installer,
add wasm32-unknown-unknown to the pinned toolchain, and build with
--no-opt so no binaryen download is needed (the flakiness the skip
originally avoided).

Not yet verified: the first CI run with this change is the test.

Refs #43, #44.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It imported describeIntegration/fetchIntegration from wasm/pkg, which
atomic-server #1618 removed (and which 3640748 already dropped from
browser.ts here), so it could only fail at import. Nothing ran it; the
README and a ci.yml comment still mentioned it.

Refs #43.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ep Playwright traces

Two CI health fixes from PR #48's first run:

- notion's e2e tier failed with "Failed to create redb …: Database
  already open. Cannot acquire lock": stop() only sent signals, so the
  e2e tier's atomic-server started on the same .lane-store/notion before
  the live tier's had exited. stop() now resolves once every child has
  exited (SIGKILL after 10s). Between tiers run-lane.mjs awaits it via
  stopStack(), which also stops releasing the lane lock mid-run; only
  process exit calls cleanup() now.

- The lane jobs uploaded atomic-plugins/browser/e2e/playwright-report,
  but integrations/tooling/playwright.config.ts writes its report and
  test-results/ next to itself, so failing runs uploaded nothing
  (if-no-files-found: ignore). Set outputDir explicitly, upload both
  directories from integrations/tooling/ (and test-results/ for the
  plugin-system job too), and warn instead of ignoring a miss.

Refs #43.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michielbdejong

Copy link
Copy Markdown
Contributor Author

merging this because other processes are waiting for it

@michielbdejong
michielbdejong merged commit 97ab90b into main Sep 23, 2026
10 checks passed
michielbdejong pushed a commit that referenced this pull request Sep 23, 2026
Issue #45. No behaviour change; lanes.json note and PARALLEL_LANES.md
"Still open" only.

- Tiers stay []: shared-checks runs certify.mjs --layer js on every
  integrations/** change, and that already runs exactly the tsc and vitest
  a typecheck/unit tier would, plus bundle reproducibility. A tier waits
  for a server-dependent money test, as the issue says.
- moneybird is named by the lane but consumed by nothing in this repo:
  integrations/money/ is an MT940/camt.053 uploader, and the moneybird
  catalog entry is package-less (read by atomic-server's generic
  API-plugin path). A recorded fixture would have no in-repo adapter to
  validate it against and no tier that starts a mock proxy to serve it;
  recording also needs a Moneybird account. Not hand-written, per §4.
- A future Moneybird fixture and recorder go in
  integrations/money/fixtures/moneybird/, not
  integrations/localthought/fixtures/: plugin-specific files stay in the
  plugin's folder; the shared registry (PR #48) imports it as
  ../../money/fixtures/moneybird/scenario.mjs.

The PARALLEL_LANES.md hunk keeps the bullet's last line unchanged so it
merges cleanly with PR #48, which rewrites the next bullet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michielbdejong pushed a commit that referenced this pull request Sep 23, 2026
…check

Everything for the todoist mock-proxy fixture up to the part that needs a
live Todoist account. It builds on PR #48's fixture registry and lives in
the issue-tracker plugin folder, whose lane names todoist (strict plugin
folder containment).

- issue-tracker/fixtures/todoist/record.mjs fetches the catalog document
  from the real proxy (public, no token needed). With TODOIST_TOKEN set, it
  also records /api/v1/projects and /api/v1/tasks as paged, redacted
  api/GET__api__v1__<collection>__page-<n>.json files. The redaction list is
  exported as REDACTIONS and documented in the file header. It fails
  closed: any string field it does not know is replaced and listed in
  api/meta.json. Output is formatted with the repo's oxfmt.
- document.yaml was recorded here from
  https://localthought.io/catalog/todoist.yaml on 2026-09-23 (oxfmt only
  re-indented YAML lists).
- scenario.mjs implements the fixtures/index.mjs interface. It replays api/
  by cursor, reads by id from the recorded rows, and returns 403 on
  writes, like the real data:read catalog.
- issue-tracker/todoist-fixture.test.ts runs in the issue-tracker unit
  tier. It checks the recorder's redaction on every run. Once api/ exists,
  it also checks that every field localthought/todoist.ts reads is present
  and typed, runs the rows through todoistProjection, replays pagination,
  and asserts the fixture is registered.

Not done: api/ is not recorded, because there were no Todoist credentials.
todoist is also not registered in localthought/fixtures/index.mjs (PR #48's
file), since an unrecorded fixture must not be served. The command and the
follow-up edits (index.mjs import from ../../issue-tracker/..., and
mock-proxy.test.mjs) are in record.mjs's header.

Refs #46.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michielbdejong pushed a commit that referenced this pull request Sep 23, 2026
…ion (#48)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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