refactor(gatorwalk-factory): separate engine and tracker code behind a seam the tests enforce (swamp-club #2793) #384

Merged
seth merged 3 commits from cue/2793-gatorwalk-factory-separate into main 2026-09-30 17:26:43 +00:00
Owner

Closes swamp-club #2793.

gatorwalk-factory's engine and tracker code now live in separate directories. A test, not a package boundary, enforces the seam between them. There is no behaviour change: model types, method names and data names are the same.

Layout

  • Model entry points: extensions/models/engine/ (lifecycle, work_item) and extensions/models/tracker/ (linear, swamp_club). swamp loads models from nested directories; this was checked both repo-local and through extension source add, and the moved registration test covers it.
  • Libraries: _lib/engine/, _lib/tracker/core/ (the contract, now adapter.ts, plus tracker_methods, projection and claim), and _lib/tracker/backends/ (the Lab and Linear clients and their fakes).
  • integration/: split into engine/, tracker/ and extension/ (whole-extension tests). harness.ts stays at the root as shared test infrastructure.

The seam

  • _lib/engine/tracker.ts is the only engine module tracker code may import. It exports exactly what tracker code uses.
  • _lib/engine/tracker_testing.ts adds the fakes and work-item operations that tracker tests drive.
  • extensions/models/boundary_test.ts enforces five rules:
    • engine code imports only engine code;
    • tracker code imports the engine only through the two surfaces;
    • tracker core imports no backend;
    • production code imports no test code;
    • the surface exports nothing that tracker code does not import.
  • It also refuses relative or computed dynamic imports. Each rule is shown failing on a planted import.
  • DESIGN.md has a new "The seam" section under "Trackers" explaining why this is a test rather than a package split.

Changes beyond import paths

These are listed so the no-behaviour-change claim can be audited:

  • ModelDataRecord, and a DataReadingContext that replaces ClaimContext's definition, move from claim.ts to work_item_ops.ts. ClaimContext is now an alias of it. This means fake_swamp no longer imports claim.
  • The projection fixtures move from the engine's test_support.ts to _lib/tracker/core/test_support.ts.
  • Two test cases move with their bodies unchanged:
    • the Lab-status check, from engine/lifecycles_test.ts to tracker/examples_test.ts;
    • "every model type registers", from cli_test.ts to integration/extension/models_test.ts.
  • splitWords moves from skill_commands.ts into integration/harness.ts, and the harness no longer re-exports LINEAR_TYPE and SWAMP_CLUB_TYPE.
  • import.meta.url fixture paths are adjusted for each file's new depth, including one test that #2804 added.
  • deno check now takes directories, both in deno.json and in the gatorwalk-factory target of verification/checks.yaml, so the subdirectories are checked.

Verification

Attested on 7ce7d5897. All verify-build checks passed, including the gatorwalk unit suite (460 tests) and the real-engine suite (23 tests). The code, adversarial and ci-security reviews all passed.

🤖 Generated with Claude Code

Closes swamp-club #2793. gatorwalk-factory's engine and tracker code now live in separate directories. A test, not a package boundary, enforces the seam between them. There is no behaviour change: model types, method names and data names are the same. ## Layout - Model entry points: `extensions/models/engine/` (lifecycle, work_item) and `extensions/models/tracker/` (linear, swamp_club). swamp loads models from nested directories; this was checked both repo-local and through `extension source add`, and the moved registration test covers it. - Libraries: `_lib/engine/`, `_lib/tracker/core/` (the contract, now `adapter.ts`, plus tracker_methods, projection and claim), and `_lib/tracker/backends/` (the Lab and Linear clients and their fakes). - `integration/`: split into `engine/`, `tracker/` and `extension/` (whole-extension tests). `harness.ts` stays at the root as shared test infrastructure. ## The seam - `_lib/engine/tracker.ts` is the only engine module tracker code may import. It exports exactly what tracker code uses. - `_lib/engine/tracker_testing.ts` adds the fakes and work-item operations that tracker tests drive. - `extensions/models/boundary_test.ts` enforces five rules: - engine code imports only engine code; - tracker code imports the engine only through the two surfaces; - tracker core imports no backend; - production code imports no test code; - the surface exports nothing that tracker code does not import. - It also refuses relative or computed dynamic imports. Each rule is shown failing on a planted import. - DESIGN.md has a new "The seam" section under "Trackers" explaining why this is a test rather than a package split. ## Changes beyond import paths These are listed so the no-behaviour-change claim can be audited: - `ModelDataRecord`, and a `DataReadingContext` that replaces `ClaimContext`'s definition, move from `claim.ts` to `work_item_ops.ts`. `ClaimContext` is now an alias of it. This means `fake_swamp` no longer imports claim. - The projection fixtures move from the engine's `test_support.ts` to `_lib/tracker/core/test_support.ts`. - Two test cases move with their bodies unchanged: - the Lab-status check, from `engine/lifecycles_test.ts` to `tracker/examples_test.ts`; - "every model type registers", from `cli_test.ts` to `integration/extension/models_test.ts`. - `splitWords` moves from `skill_commands.ts` into `integration/harness.ts`, and the harness no longer re-exports `LINEAR_TYPE` and `SWAMP_CLUB_TYPE`. - `import.meta.url` fixture paths are adjusted for each file's new depth, including one test that #2804 added. - `deno check` now takes directories, both in `deno.json` and in the gatorwalk-factory target of `verification/checks.yaml`, so the subdirectories are checked. ## Verification Attested on 7ce7d5897. All `verify-build` checks passed, including the gatorwalk unit suite (460 tests) and the real-engine suite (23 tests). The code, adversarial and ci-security reviews all passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Pure moves with git mv. Relative imports and import.meta.url fixture
paths are adjusted for the new depths; nothing else changes. The tracker
contract tracker.ts becomes tracker/core/adapter.ts so it is not a second
tracker.ts beside the engine's surface for tracker code.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Tracker code now reaches the engine only through _lib/engine/tracker.ts,
and tracker tests also through _lib/engine/tracker_testing.ts.
boundary_test.ts enforces the rules on the real tree, and shows each rule
failing on a planted import: engine code imports only engine code; tracker
code uses the two surfaces; tracker core imports no backend; production
code imports no test code; the surface exports only what tracker code
imports.

To get there, with no behaviour change:
- ModelDataRecord and the data-reading method context move from claim.ts
  into work_item_ops.ts, so fake_swamp no longer imports claim.
- The projection fixtures move from the engine's test_support.ts into
  _lib/tracker/core/test_support.ts.
- Two test cases move unchanged: the Lab-status check from
  engine/lifecycles_test.ts to tracker/examples_test.ts, and the
  model-registration test from integration/engine/cli_test.ts to
  integration/extension/models_test.ts.
- splitWords moves into integration/harness.ts, so the tracker suite
  does not import the skill tests, and the harness no longer re-exports
  the tracker type names.
- deno check takes directories, in deno.json and in the gatorwalk-factory
  target of verification/checks.yaml, so the new subdirectories are
  checked.
- DESIGN.md gains "The seam" under "Trackers"; paths in DESIGN.md,
  README.md and the skill follow the move.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
fix(gatorwalk-factory): testdata path in the examples test #2804 added, at its new depth (swamp-club #2793)
All checks were successful
CI / Review Integrity (pull_request) Successful in 1m15s
CI / Validate Attestation (pull_request) Successful in 1m2s
7ce7d58977
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
seth merged commit 2cda3388cd into main 2026-09-30 17:26:43 +00:00
seth deleted branch cue/2793-gatorwalk-factory-separate 2026-09-30 17:26:43 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
swamp-club/swamp-extensions!384
No description provided.