Skip to content
This repository was archived by the owner on Nov 25, 2026. It is now read-only.

Extract control plane executor - #7

Merged
wmadden merged 15 commits into
extend-coveragefrom
extract-control-plane-executor
Nov 14, 2025
Merged

wmadden merged 15 commits into
extend-coveragefrom
extract-control-plane-executor

Conversation

@wmadden

@wmadden wmadden commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@wmadden
wmadden force-pushed the extract-control-plane-executor branch from 0a7fd6a to 5d7015f Compare November 14, 2025 07:15
@wmadden
wmadden changed the base branch from main to extend-coverage November 14, 2025 07:15
@wmadden
wmadden force-pushed the extract-control-plane-executor branch from 5d7015f to 2fbcc7c Compare November 14, 2025 07:18
@wmadden
wmadden force-pushed the extract-control-plane-executor branch from 2fbcc7c to 8e89324 Compare November 14, 2025 07:35
@wmadden
wmadden merged commit a70b1c2 into extend-coverage Nov 14, 2025
@aqrln
aqrln deleted the extract-control-plane-executor branch December 15, 2025 13:54
wmadden added a commit that referenced this pull request Mar 30, 2026
Phase 3 (minimal Mongo ORM) proved the contract shape. Comparative
analysis with the SQL ORM revealed the Collection chaining API,
CollectionState, and row type inference are shared architectural
patterns. Record this finding:

- ADR 4: shared Collection interface with fluent chaining, family-
  specific compilation at terminal methods, spike-then-extract approach
- Cross-cutting learning #6: shared ORM surface enumeration
- Mongo Overview: Phase 3 complete, DQ #7 resolved, ADR 4 referenced
- PoC plan: Phase 3 moved to completed, Phase 4 rewritten for
  Collection interface direction
wmadden added a commit that referenced this pull request Mar 30, 2026
Phase 3 (minimal Mongo ORM) proved the contract shape. Comparative
analysis with the SQL ORM revealed the Collection chaining API,
CollectionState, and row type inference are shared architectural
patterns. Record this finding:

- ADR 4: shared Collection interface with fluent chaining, family-
  specific compilation at terminal methods, spike-then-extract approach
- Cross-cutting learning #6: shared ORM surface enumeration
- Mongo Overview: Phase 3 complete, DQ #7 resolved, ADR 4 referenced
- PoC plan: Phase 3 moved to completed, Phase 4 rewritten for
  Collection interface direction
wmadden added a commit that referenced this pull request Mar 31, 2026
Phase 3 (minimal Mongo ORM) proved the contract shape. Comparative
analysis with the SQL ORM revealed the Collection chaining API,
CollectionState, and row type inference are shared architectural
patterns. Record this finding:

- ADR 4: shared Collection interface with fluent chaining, family-
  specific compilation at terminal methods, spike-then-extract approach
- Cross-cutting learning #6: shared ORM surface enumeration
- Mongo Overview: Phase 3 complete, DQ #7 resolved, ADR 4 referenced
- PoC plan: Phase 3 moved to completed, Phase 4 rewritten for
  Collection interface direction
jkomyno pushed a commit that referenced this pull request Apr 1, 2026
Phase 3 (minimal Mongo ORM) proved the contract shape. Comparative
analysis with the SQL ORM revealed the Collection chaining API,
CollectionState, and row type inference are shared architectural
patterns. Record this finding:

- ADR 4: shared Collection interface with fluent chaining, family-
  specific compilation at terminal methods, spike-then-extract approach
- Cross-cutting learning #6: shared ORM surface enumeration
- Mongo Overview: Phase 3 complete, DQ #7 resolved, ADR 4 referenced
- PoC plan: Phase 3 moved to completed, Phase 4 rewritten for
  Collection interface direction
jkomyno added a commit that referenced this pull request May 8, 2026
* #7 — SQLite AFTER-trigger mitigation: decision recorded as defer.
  JSDoc on buildRowIdentityCriterion + Query Lanes.md paragraph remain
  the documented mitigation; no runtime guard added until the SQLite
  adapter actually exercises id-less + AFTER-trigger contracts.

* #8 — Asymmetric `returning` gate: comment at executeUpdateCount
  records the explicit design choice. Surface-level updateCount/
  deleteCount require the capability; FK-rewrite cleanup
  (disconnect/setNull) does not, since no row data is read.

* #9 — Trim WHAT-restating sentence from buildRowIdentityCriterion
  comment block. Remaining lines explain the genuinely non-obvious
  WHY: RETURNING-by-construction invariant + duplicate-tuple caveat
  + SQLite AFTER-trigger caveat.

* #10 — Add typed `withoutPrimaryKey<TTable>(contract, table)` helper
  to test/helpers.ts mirroring `withCapabilities`. Migrate four call
  sites (createIdlessTagsCollection, createIdlessUsersCollection, two
  unit tests in mutation-executor.test.ts) from inline
  `as unknown as TestContract` casts to the helper. Cast lives in one
  place now.

* #11 — Drop redundant `updateCount returns zero` integration test
  on id-less Tags. The zero-match path is already covered by unit
  tests on PK contracts and does not exercise id-less specifics.

* #12 — Extract `getPrimaryKeyColumns(contract, tableName): readonly
  string[]` helper in collection-contract.ts. Replaces three
  duplicated raw-storage accesses (resolvePrimaryKeyColumn,
  pickCountReturningColumn, buildRowIdentityCriterion, the new P1
  guard).

* #13 — Plan doc references the post-rename name throughout.

* #14 — Trim `resolvePrimaryKeyColumn` error to one sentence; the
  API guidance prose duplicated content already in Query Lanes.md.

All 8 P3 todos marked complete. pnpm test:packages 110/110 green;
pnpm lint:deps 0 violations. sql-orm-client suite is 501 (one fewer
than before due to dropped redundant test).
wmadden added a commit that referenced this pull request May 9, 2026
…oc admits Probes as optional (M1 T1.5)

User-driven replan from m1 R1: the persona currently encodes the
*value* (be suspicious of qualifier prefixes) without the *cognitive
move* (ask: what does this distinguish it from?). Suspicion-as-value
produces "I noticed naming concerns" output; suspicion-as-trigger-
plus-question produces "this prefix performs a non-existent
partition" output. The five probes operationalise the architect's
naming/typology cognitive habits as concrete questions with concrete
triggers and (where applicable) criteria for a good answer.

architect.md changes:

  * Insert ## Probes between ## Responsibilities and ## Vocabulary
    cues (orchestrator-pinned location). All other sections (stance,
    priorities, responsibilities, vocabulary cues, out of scope) are
    byte-identical.
  * Five probes pasted verbatim from the orchestrator-notes record
    in projects/agent-personas/reviews/code-review.md § Orchestrator
    notes § m1 R1 → m1 R2 § Probe set:
      1. Discriminator-completeness probe (concrete / singular /
         structural / stable answer required for any qualifier-
         style prefix)
      2. Consumer-vs-essence probe (does the name describe what the
         type IS, or who happens to use it?)
      3. Concept-vs-mechanism probe (domain concept vs implementation
         mechanism)
      4. Symmetry probe (sibling types should be structurally
         symmetric)
      5. 'Reads cold' probe (cold-expectation vs actual responsibility)

_shape.md changes:

  * Promote singular "Optional section" header to plural "Optional
    sections" so the new probes entry doesn't look like a peer of the
    Out-of-scope section.
  * Add ## Probes as optional section #7. Body explains:
      - Probes are concrete *questions* the persona asks in specific
        situations, distinct from Priorities (what to watch for first)
        and Vocabulary cues (language patterns to use/avoid).
      - Each probe pairs (a) trigger with (b) question and ideally
        (c) criteria for a good answer.
      - Section exists because suspicion-as-value produces vague
        output; suspicion-as-trigger-plus-question produces specific
        output.
      - Not every persona needs probes. Review-class personas
        (architect, principal-engineer, devrel) typically benefit;
        implementation-class personas (developer, modes that produce
        more than evaluate) should omit rather than invent thin
        probes.
      - architect.md ## Probes is the v1 reference example.
  * Append a sixth review-checklist item that asks the author to
    confirm the optional Probes section is present-if-applicable
    (review-class personas with cognitive habits that decompose into
    trigger-plus-question pairs) or omitted-if-thin.

No A/B re-test this round per the orchestrator's plan.md amendment;
verification of probe effectiveness is deferred to M3 / Task 3.5
(E2E /drive-pr-local-review against PR #434, the natural test bed).

AC-5 stays PASS — the new probes section is verified by cold-read in
the m1 R2 validation gate, not by re-running the A/B test (the
construction's verdict-shifting effect was already demonstrated at
m1 R1; the probes are a refinement of effectiveness, not a re-test
of the construction).

Refs: TML-2397, projects/agent-personas/spec.md AC1 (persona content
quality); plan.md Task 1.5; reviews/code-review.md § Orchestrator
notes § m1 R1 → m1 R2.
wmadden added a commit that referenced this pull request May 9, 2026
…oc admits Probes as optional (M1 T1.5)

User-driven replan from m1 R1: the persona currently encodes the
*value* (be suspicious of qualifier prefixes) without the *cognitive
move* (ask: what does this distinguish it from?). Suspicion-as-value
produces "I noticed naming concerns" output; suspicion-as-trigger-
plus-question produces "this prefix performs a non-existent
partition" output. The five probes operationalise the architect's
naming/typology cognitive habits as concrete questions with concrete
triggers and (where applicable) criteria for a good answer.

architect.md changes:

  * Insert ## Probes between ## Responsibilities and ## Vocabulary
    cues (orchestrator-pinned location). All other sections (stance,
    priorities, responsibilities, vocabulary cues, out of scope) are
    byte-identical.
  * Five probes pasted verbatim from the orchestrator-notes record
    in projects/agent-personas/reviews/code-review.md § Orchestrator
    notes § m1 R1 → m1 R2 § Probe set:
      1. Discriminator-completeness probe (concrete / singular /
         structural / stable answer required for any qualifier-
         style prefix)
      2. Consumer-vs-essence probe (does the name describe what the
         type IS, or who happens to use it?)
      3. Concept-vs-mechanism probe (domain concept vs implementation
         mechanism)
      4. Symmetry probe (sibling types should be structurally
         symmetric)
      5. 'Reads cold' probe (cold-expectation vs actual responsibility)

_shape.md changes:

  * Promote singular "Optional section" header to plural "Optional
    sections" so the new probes entry doesn't look like a peer of the
    Out-of-scope section.
  * Add ## Probes as optional section #7. Body explains:
      - Probes are concrete *questions* the persona asks in specific
        situations, distinct from Priorities (what to watch for first)
        and Vocabulary cues (language patterns to use/avoid).
      - Each probe pairs (a) trigger with (b) question and ideally
        (c) criteria for a good answer.
      - Section exists because suspicion-as-value produces vague
        output; suspicion-as-trigger-plus-question produces specific
        output.
      - Not every persona needs probes. Review-class personas
        (architect, principal-engineer, devrel) typically benefit;
        implementation-class personas (developer, modes that produce
        more than evaluate) should omit rather than invent thin
        probes.
      - architect.md ## Probes is the v1 reference example.
  * Append a sixth review-checklist item that asks the author to
    confirm the optional Probes section is present-if-applicable
    (review-class personas with cognitive habits that decompose into
    trigger-plus-question pairs) or omitted-if-thin.

No A/B re-test this round per the orchestrator's plan.md amendment;
verification of probe effectiveness is deferred to M3 / Task 3.5
(E2E /drive-pr-local-review against PR #434, the natural test bed).

AC-5 stays PASS — the new probes section is verified by cold-read in
the m1 R2 validation gate, not by re-running the A/B test (the
construction's verdict-shifting effect was already demonstrated at
m1 R1; the probes are a refinement of effectiveness, not a re-test
of the construction).

Refs: TML-2397, projects/agent-personas/spec.md AC1 (persona content
quality); plan.md Task 1.5; reviews/code-review.md § Orchestrator
notes § m1 R1 → m1 R2.
wmadden added a commit that referenced this pull request May 9, 2026
Post-rebase reconciliation surfaced during validation after
tml-2397-contract-space-aggregate was rebased onto the updated
tml-2397-contract-spaces-first-class-schema-contributions-from. The base
picked up M1-cleanup work (F2/F3/F4/F6 + explicit-space marker writes +
materialise-package rename) that our M2/M2.5 work had not flowed through.

- Re-route MigrationPackage (now from framework-components/control) and
  OnDiskMigrationPackage (with dirPath metadata, in migration-tools/package)
  imports across the aggregate module.
- Pass required spaceId on every planner / migration-plan construction;
  synth strategy + adapter test fixtures use APP_SPACE_ID.
- Pass required space parameter on every marker read.
- Replace literal 'app' string with APP_SPACE_ID in target-postgres /
  target-sqlite runners.
- Carry through the writeExtensionMigrationPackage to
  materialiseMigrationPackage rename in cli, adapter tests, and the
  integration suite.
- Restore ensure-control-tables error propagation in executeOnConnection
  so legacy-marker-shape detection does not fall through to a readMarker
  against a missing space column.
- Replace the deleted ExtensionContractSpace type with
  ContractSpace<Contract<SqlStorage>> in family-sql self-consistency tests.
- Content-address TEST_HEAD_HASH in the relocated contract-space-fixture
  (the patch-equivalent of the --skip-ed source commit 6fda2c1; base
  relocated the pre-content-addressed shape, leaving placeholder hashes
  that fail descriptor self-consistency).
- Re-point the cli-e2e fixture at the relative contract-space-fixture
  path after the workspace package was deleted by base relocation.

All validation gates pass: typecheck, lint:deps, test:packages, build,
e2e (91/91), and the M2.5 R1 rg gates (zero matches in source).
test:integration is 552/553; the single failure on cli.emit-cli-process
round-trip is the documented Open Item #7 pre-existing flake.
wmadden added a commit that referenced this pull request May 9, 2026
Post-rebase reconciliation surfaced during validation after
tml-2397-contract-space-aggregate was rebased onto the updated
tml-2397-contract-spaces-first-class-schema-contributions-from. The base
picked up M1-cleanup work (F2/F3/F4/F6 + explicit-space marker writes +
materialise-package rename) that our M2/M2.5 work had not flowed through.

- Re-route MigrationPackage (now from framework-components/control) and
  OnDiskMigrationPackage (with dirPath metadata, in migration-tools/package)
  imports across the aggregate module.
- Pass required spaceId on every planner / migration-plan construction;
  synth strategy + adapter test fixtures use APP_SPACE_ID.
- Pass required space parameter on every marker read.
- Replace literal 'app' string with APP_SPACE_ID in target-postgres /
  target-sqlite runners.
- Carry through the writeExtensionMigrationPackage to
  materialiseMigrationPackage rename in cli, adapter tests, and the
  integration suite.
- Restore ensure-control-tables error propagation in executeOnConnection
  so legacy-marker-shape detection does not fall through to a readMarker
  against a missing space column.
- Replace the deleted ExtensionContractSpace type with
  ContractSpace<Contract<SqlStorage>> in family-sql self-consistency tests.
- Content-address TEST_HEAD_HASH in the relocated contract-space-fixture
  (the patch-equivalent of the --skip-ed source commit 6fda2c1; base
  relocated the pre-content-addressed shape, leaving placeholder hashes
  that fail descriptor self-consistency).
- Re-point the cli-e2e fixture at the relative contract-space-fixture
  path after the workspace package was deleted by base relocation.

All validation gates pass: typecheck, lint:deps, test:packages, build,
e2e (91/91), and the M2.5 R1 rg gates (zero matches in source).
test:integration is 552/553; the single failure on cli.emit-cli-process
round-trip is the documented Open Item #7 pre-existing flake.
wmadden added a commit that referenced this pull request May 10, 2026
Closes Open Item #7. The import-allowlist gate in loadContractFromTs walked every esbuild-bundled input, which surfaced internal node:fs/promises imports inside allowlisted @prisma-next/* dependencies as false positives — exactly the symptom test/cli.emit-cli-process.e2e.test.ts > round-trip was hitting in CI.

Switch to a resolver-internal collected set (the resolver already has the importer context to distinguish entry-direct from transitive imports) and drop the metafile post-pass entirely. Update the disallowed-import fixture to reference the imported binding so esbuild's TS loader can't strip it as unused before resolution.
wmadden added a commit that referenced this pull request May 10, 2026
Post-rebase reconciliation surfaced during validation after
tml-2397-contract-space-aggregate was rebased onto the updated
tml-2397-contract-spaces-first-class-schema-contributions-from. The base
picked up M1-cleanup work (F2/F3/F4/F6 + explicit-space marker writes +
materialise-package rename) that our M2/M2.5 work had not flowed through.

- Re-route MigrationPackage (now from framework-components/control) and
  OnDiskMigrationPackage (with dirPath metadata, in migration-tools/package)
  imports across the aggregate module.
- Pass required spaceId on every planner / migration-plan construction;
  synth strategy + adapter test fixtures use APP_SPACE_ID.
- Pass required space parameter on every marker read.
- Replace literal 'app' string with APP_SPACE_ID in target-postgres /
  target-sqlite runners.
- Carry through the writeExtensionMigrationPackage to
  materialiseMigrationPackage rename in cli, adapter tests, and the
  integration suite.
- Restore ensure-control-tables error propagation in executeOnConnection
  so legacy-marker-shape detection does not fall through to a readMarker
  against a missing space column.
- Replace the deleted ExtensionContractSpace type with
  ContractSpace<Contract<SqlStorage>> in family-sql self-consistency tests.
- Content-address TEST_HEAD_HASH in the relocated contract-space-fixture
  (the patch-equivalent of the --skip-ed source commit 6fda2c1; base
  relocated the pre-content-addressed shape, leaving placeholder hashes
  that fail descriptor self-consistency).
- Re-point the cli-e2e fixture at the relative contract-space-fixture
  path after the workspace package was deleted by base relocation.

All validation gates pass: typecheck, lint:deps, test:packages, build,
e2e (91/91), and the M2.5 R1 rg gates (zero matches in source).
test:integration is 552/553; the single failure on cli.emit-cli-process
round-trip is the documented Open Item #7 pre-existing flake.
wmadden added a commit that referenced this pull request May 10, 2026
Closes Open Item #7. The import-allowlist gate in loadContractFromTs walked every esbuild-bundled input, which surfaced internal node:fs/promises imports inside allowlisted @prisma-next/* dependencies as false positives — exactly the symptom test/cli.emit-cli-process.e2e.test.ts > round-trip was hitting in CI.

Switch to a resolver-internal collected set (the resolver already has the importer context to distinguish entry-direct from transitive imports) and drop the metafile post-pass entirely. Update the disallowed-import fixture to reference the imported binding so esbuild's TS loader can't strip it as unused before resolution.
wmadden added a commit that referenced this pull request May 10, 2026
Post-rebase reconciliation surfaced during validation after
tml-2397-contract-space-aggregate was rebased onto the updated
tml-2397-contract-spaces-first-class-schema-contributions-from. The base
picked up M1-cleanup work (F2/F3/F4/F6 + explicit-space marker writes +
materialise-package rename) that our M2/M2.5 work had not flowed through.

- Re-route MigrationPackage (now from framework-components/control) and
  OnDiskMigrationPackage (with dirPath metadata, in migration-tools/package)
  imports across the aggregate module.
- Pass required spaceId on every planner / migration-plan construction;
  synth strategy + adapter test fixtures use APP_SPACE_ID.
- Pass required space parameter on every marker read.
- Replace literal 'app' string with APP_SPACE_ID in target-postgres /
  target-sqlite runners.
- Carry through the writeExtensionMigrationPackage to
  materialiseMigrationPackage rename in cli, adapter tests, and the
  integration suite.
- Restore ensure-control-tables error propagation in executeOnConnection
  so legacy-marker-shape detection does not fall through to a readMarker
  against a missing space column.
- Replace the deleted ExtensionContractSpace type with
  ContractSpace<Contract<SqlStorage>> in family-sql self-consistency tests.
- Content-address TEST_HEAD_HASH in the relocated contract-space-fixture
  (the patch-equivalent of the --skip-ed source commit 6fda2c1; base
  relocated the pre-content-addressed shape, leaving placeholder hashes
  that fail descriptor self-consistency).
- Re-point the cli-e2e fixture at the relative contract-space-fixture
  path after the workspace package was deleted by base relocation.

All validation gates pass: typecheck, lint:deps, test:packages, build,
e2e (91/91), and the M2.5 R1 rg gates (zero matches in source).
test:integration is 552/553; the single failure on cli.emit-cli-process
round-trip is the documented Open Item #7 pre-existing flake.
wmadden added a commit that referenced this pull request May 10, 2026
Closes Open Item #7. The import-allowlist gate in loadContractFromTs walked every esbuild-bundled input, which surfaced internal node:fs/promises imports inside allowlisted @prisma-next/* dependencies as false positives — exactly the symptom test/cli.emit-cli-process.e2e.test.ts > round-trip was hitting in CI.

Switch to a resolver-internal collected set (the resolver already has the importer context to distinguish entry-direct from transitive imports) and drop the metafile post-pass entirely. Update the disallowed-import fixture to reference the imported binding so esbuild's TS loader can't strip it as unused before resolution.
wmadden added a commit that referenced this pull request May 12, 2026
Closes design holes #7, #8, #11, #13, #14 with one architectural decision
(C12 in decisions.md): introduce the runtime target-layer class in v0.1
and have Supabase extend it.

The runtime layer was class-based but missing the target tier:
RuntimeCore (framework, abstract) <- SqlRuntimeImpl (sql family, internal).
This project lifts SqlRuntimeImpl -> SqlRuntime (exported), adds
PostgresRuntime (thin subclass, target-layer extension point), and lands
SupabaseRuntime as PostgresRuntime's subclass. SET LOCAL is issued by
SupabaseRuntime.execute() against the raw connection -- below the user
middleware chain, structurally non-bypassable. Implicit transaction
guarantees never-outlives-txn SET LOCAL state. JWT validation is eager
behind a uniformly async factory.

Mirrors TML-2459's three-layer IR pattern at the runtime axis. ~50 LOC
of framework refactor; rationale and implementation sketch in the new
ADR draft.
wmadden added a commit that referenced this pull request May 13, 2026
Closes design holes #7, #8, #11, #13, #14 with one architectural decision
(C12 in decisions.md): introduce the runtime target-layer class in v0.1
and have Supabase extend it.

The runtime layer was class-based but missing the target tier:
RuntimeCore (framework, abstract) <- SqlRuntimeImpl (sql family, internal).
This project lifts SqlRuntimeImpl -> SqlRuntime (exported), adds
PostgresRuntime (thin subclass, target-layer extension point), and lands
SupabaseRuntime as PostgresRuntime's subclass. SET LOCAL is issued by
SupabaseRuntime.execute() against the raw connection -- below the user
middleware chain, structurally non-bypassable. Implicit transaction
guarantees never-outlives-txn SET LOCAL state. JWT validation is eager
behind a uniformly async factory.

Mirrors TML-2459's three-layer IR pattern at the runtime axis. ~50 LOC
of framework refactor; rationale and implementation sketch in the new
ADR draft.
wmadden added a commit that referenced this pull request May 13, 2026
Closes design holes #7, #8, #11, #13, #14 with one architectural decision
(C12 in decisions.md): introduce the runtime target-layer class in v0.1
and have Supabase extend it.

The runtime layer was class-based but missing the target tier:
RuntimeCore (framework, abstract) <- SqlRuntimeImpl (sql family, internal).
This project lifts SqlRuntimeImpl -> SqlRuntime (exported), adds
PostgresRuntime (thin subclass, target-layer extension point), and lands
SupabaseRuntime as PostgresRuntime's subclass. SET LOCAL is issued by
SupabaseRuntime.execute() against the raw connection -- below the user
middleware chain, structurally non-bypassable. Implicit transaction
guarantees never-outlives-txn SET LOCAL state. JWT validation is eager
behind a uniformly async factory.

Mirrors TML-2459's three-layer IR pattern at the runtime axis. ~50 LOC
of framework refactor; rationale and implementation sketch in the new
ADR draft.

Signed-off-by: Will Madden <[email protected]>
wmadden added a commit that referenced this pull request May 13, 2026
Closes design holes #7, #8, #11, #13, #14 with one architectural decision
(C12 in decisions.md): introduce the runtime target-layer class in v0.1
and have Supabase extend it.

The runtime layer was class-based but missing the target tier:
RuntimeCore (framework, abstract) <- SqlRuntimeImpl (sql family, internal).
This project lifts SqlRuntimeImpl -> SqlRuntime (exported), adds
PostgresRuntime (thin subclass, target-layer extension point), and lands
SupabaseRuntime as PostgresRuntime's subclass. SET LOCAL is issued by
SupabaseRuntime.execute() against the raw connection -- below the user
middleware chain, structurally non-bypassable. Implicit transaction
guarantees never-outlives-txn SET LOCAL state. JWT validation is eager
behind a uniformly async factory.

Mirrors TML-2459's three-layer IR pattern at the runtime axis. ~50 LOC
of framework refactor; rationale and implementation sketch in the new
ADR draft.

Signed-off-by: Will Madden <[email protected]>
wmadden added a commit that referenced this pull request May 13, 2026
Closes design holes #7, #8, #11, #13, #14 with one architectural decision
(C12 in decisions.md): introduce the runtime target-layer class in v0.1
and have Supabase extend it.

The runtime layer was class-based but missing the target tier:
RuntimeCore (framework, abstract) <- SqlRuntimeImpl (sql family, internal).
This project lifts SqlRuntimeImpl -> SqlRuntime (exported), adds
PostgresRuntime (thin subclass, target-layer extension point), and lands
SupabaseRuntime as PostgresRuntime's subclass. SET LOCAL is issued by
SupabaseRuntime.execute() against the raw connection -- below the user
middleware chain, structurally non-bypassable. Implicit transaction
guarantees never-outlives-txn SET LOCAL state. JWT validation is eager
behind a uniformly async factory.

Mirrors TML-2459's three-layer IR pattern at the runtime axis. ~50 LOC
of framework refactor; rationale and implementation sketch in the new
ADR draft.

Signed-off-by: Will Madden <[email protected]>
wmadden added a commit that referenced this pull request May 14, 2026
…emaVerify removal) into M2.5

TML-2464 (tml-2464-strip-single-spacemulti-space-branching-once-every-target-is)
is paused on user instruction until target-extensible-ir lands. Its
branch carries 6 commits, three of which deliver AC #7:

  b4548c1b3  rename schemaVerifyAgainstSchema -> verifySchema (cross-family)
  e6c9d1563  compose introspect + verifySchema at family-verify call sites
  d0712a45e  remove async schemaVerify from family interface

Cherry-pick probe onto target-extensible-ir HEAD: the rename and
compose commits auto-merge cleanly; d0712a45e conflicts in
family-mongo/control-instance.ts against M2 R1 helpers - exactly the
file M2.5 will rewrite for SPI dispatch.

Two options were viable: (a) write M2.5 against the pre-rename
naming and rebase TML-2464 on top later, or (b) absorb AC #7 into
M2.5 so the SPI dispatch lands on the post-rename naming.
Option (b) wins on naming consistency (no second rename pass through
M2.5 surface area), conflict avoidance (the third commit naturally
folds into the SPI refactor of the same file), and user authorisation
(user paused TML-2464 explicitly to enable this convergence).

Spec gains:
- status banner note on the absorption with cherry-pick probe trail
- new section 0 detailing the rename, compose-at-call-sites, and
  async-removal cherry-pick guidance
- section 5 update calling out the async-removal fold-in into the
  SPI dispatch refactor
- acceptance criterion verifying the absorption landed

Plan gains:
- M2.5 task list grows from 9 to 10 (adds task 0)
- task counts in spec link updated
- cross-project deps note for TML-2464 records the blockedBy relation
  set in Linear and the AC #7 absorption with TML-2464 resume scope
  (ACs #1-6 + #8)

Linear: TML-2464 blockedBy TML-2459 set; comment posted naming the
absorption + resume scope so the future TML-2464 implementer does not
redo AC #7 work.

Full reasoning trail in wip/unattended-decisions.md section 12.
wmadden added a commit that referenced this pull request May 14, 2026
family-mongo/control-instance.ts no longer imports marker-ledger
or introspectSchema from the adapter package directly. All wire-level
calls route through the MongoControlAdapter SPI surfaced by the
control stack via a getControlAdapter() helper that mirrors the
SQL family pattern.

Per TML-2464 AC #7 the async schemaVerify method is removed from the
family interface and from MongoFamilyInstance. The CLI control client
already composes introspect + verifySchema at the call site (cherry-
picked earlier in this milestone).

verifySchema (the renamed sync verifier) keeps its body: validate
contract, return verifyMongoSchema against the pre-projected schema.

MongoFamilyInstance is now built as a plain object literal returned
from createMongoFamilyInstance — the class-form was only carrying
the constructor; the SQL family already follows this shape.

Refs: TML-2459
wmadden added a commit that referenced this pull request May 15, 2026
…emaVerify removal) into M2.5

TML-2464 (tml-2464-strip-single-spacemulti-space-branching-once-every-target-is)
is paused on user instruction until target-extensible-ir lands. Its
branch carries 6 commits, three of which deliver AC #7:

  b4548c1b3  rename schemaVerifyAgainstSchema -> verifySchema (cross-family)
  e6c9d1563  compose introspect + verifySchema at family-verify call sites
  d0712a45e  remove async schemaVerify from family interface

Cherry-pick probe onto target-extensible-ir HEAD: the rename and
compose commits auto-merge cleanly; d0712a45e conflicts in
family-mongo/control-instance.ts against M2 R1 helpers - exactly the
file M2.5 will rewrite for SPI dispatch.

Two options were viable: (a) write M2.5 against the pre-rename
naming and rebase TML-2464 on top later, or (b) absorb AC #7 into
M2.5 so the SPI dispatch lands on the post-rename naming.
Option (b) wins on naming consistency (no second rename pass through
M2.5 surface area), conflict avoidance (the third commit naturally
folds into the SPI refactor of the same file), and user authorisation
(user paused TML-2464 explicitly to enable this convergence).

Spec gains:
- status banner note on the absorption with cherry-pick probe trail
- new section 0 detailing the rename, compose-at-call-sites, and
  async-removal cherry-pick guidance
- section 5 update calling out the async-removal fold-in into the
  SPI dispatch refactor
- acceptance criterion verifying the absorption landed

Plan gains:
- M2.5 task list grows from 9 to 10 (adds task 0)
- task counts in spec link updated
- cross-project deps note for TML-2464 records the blockedBy relation
  set in Linear and the AC #7 absorption with TML-2464 resume scope
  (ACs #1-6 + #8)

Linear: TML-2464 blockedBy TML-2459 set; comment posted naming the
absorption + resume scope so the future TML-2464 implementer does not
redo AC #7 work.

Full reasoning trail in wip/unattended-decisions.md section 12.

Signed-off-by: Will Madden <[email protected]>
wmadden added a commit that referenced this pull request May 15, 2026
family-mongo/control-instance.ts no longer imports marker-ledger
or introspectSchema from the adapter package directly. All wire-level
calls route through the MongoControlAdapter SPI surfaced by the
control stack via a getControlAdapter() helper that mirrors the
SQL family pattern.

Per TML-2464 AC #7 the async schemaVerify method is removed from the
family interface and from MongoFamilyInstance. The CLI control client
already composes introspect + verifySchema at the call site (cherry-
picked earlier in this milestone).

verifySchema (the renamed sync verifier) keeps its body: validate
contract, return verifyMongoSchema against the pre-projected schema.

MongoFamilyInstance is now built as a plain object literal returned
from createMongoFamilyInstance — the class-form was only carrying
the constructor; the SQL family already follows this shape.

Refs: TML-2459

Signed-off-by: Will Madden <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant