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

Operations registry and ORM query lane - #1

Merged
wmadden merged 159 commits into
mainfrom
operations-registry
Nov 9, 2025
Merged

wmadden merged 159 commits into
mainfrom
operations-registry

Conversation

@wmadden

@wmadden wmadden commented Nov 9, 2025

Copy link
Copy Markdown
Contributor

No description provided.

# Conflicts:
#	packages/e2e-tests/test/runtime.includes.test.ts
#	packages/e2e-tests/test/runtime.projections.test.ts
wmadden added a commit that referenced this pull request May 9, 2026
…ode dispatch

Three related runtime issues surfaced together when the demo exercised
parameterized codecs through the ORM (cosineDistance/lt) and via SQL
DSL self-joins:

1. forColumn dispatch trusted refs blindly. The ORM lifts the column
   ref out of an OperationExpr that changed the codec id (e.g.
   `cosineDistance(p.embedding, x).lt(1)` carries refs={post,embedding}
   but a `pg/float8@1` comparison codec). forColumn returned the
   vector codec, which then rejected the float literal.

   resolveParamCodec / resolveProjectionCodec now require byColumn.id
   to agree with the declared codec id; a mismatch falls through to
   forCodecId so the float literal dispatches as float8.

2. forColumn missed for aliased self-joins (`db.sql.post.as(p1)
   .innerJoin(db.sql.post.as(p2), …)` projects p1.id, p2.id). byColumn
   is keyed by source table; the alias never matched, fell through to
   forCodecId(sql/char@1), and threw "ambiguous parameterized
   instances".

   Builds an alias→source table map from the query AST and resolves
   refs through it before forColumn dispatch (decode and encode share
   the helper in alias-resolver.ts).

3. F42 detached factory from its descriptor: `voidFactory(undefined)
   (ctx)` lost the `this`-on-descriptor binding, so descriptors whose
   factory body captures `this` (e.g. PgTextDescriptor: `() => new
   PgTextCodec(this)`) produced codecs with `descriptor: undefined`.
   Reading `codec.id` then threw. The bug was latent until #1 above
   started inspecting `byColumn.id`.

   Both factory call sites now use `factory.bind(descriptor)`.

Updates the demo offline-runtime test expectation: ProjectionItem refs
are now populated for top-level identifier projections (a side effect
of the existing select-shortcut path that the test was written before).
wmadden added a commit that referenced this pull request May 9, 2026
…ode dispatch

Three related runtime issues surfaced together when the demo exercised
parameterized codecs through the ORM (cosineDistance/lt) and via SQL
DSL self-joins:

1. forColumn dispatch trusted refs blindly. The ORM lifts the column
   ref out of an OperationExpr that changed the codec id (e.g.
   `cosineDistance(p.embedding, x).lt(1)` carries refs={post,embedding}
   but a `pg/float8@1` comparison codec). forColumn returned the
   vector codec, which then rejected the float literal.

   resolveParamCodec / resolveProjectionCodec now require byColumn.id
   to agree with the declared codec id; a mismatch falls through to
   forCodecId so the float literal dispatches as float8.

2. forColumn missed for aliased self-joins (`db.sql.post.as(p1)
   .innerJoin(db.sql.post.as(p2), …)` projects p1.id, p2.id). byColumn
   is keyed by source table; the alias never matched, fell through to
   forCodecId(sql/char@1), and threw "ambiguous parameterized
   instances".

   Builds an alias→source table map from the query AST and resolves
   refs through it before forColumn dispatch (decode and encode share
   the helper in alias-resolver.ts).

3. F42 detached factory from its descriptor: `voidFactory(undefined)
   (ctx)` lost the `this`-on-descriptor binding, so descriptors whose
   factory body captures `this` (e.g. PgTextDescriptor: `() => new
   PgTextCodec(this)`) produced codecs with `descriptor: undefined`.
   Reading `codec.id` then threw. The bug was latent until #1 above
   started inspecting `byColumn.id`.

   Both factory call sites now use `factory.bind(descriptor)`.

Updates the demo offline-runtime test expectation: ProjectionItem refs
are now populated for top-level identifier projections (a side effect
of the existing select-shortcut path that the test was written before).
wmadden added a commit that referenced this pull request May 9, 2026
…ode dispatch

Three related runtime issues surfaced together when the demo exercised
parameterized codecs through the ORM (cosineDistance/lt) and via SQL
DSL self-joins:

1. forColumn dispatch trusted refs blindly. The ORM lifts the column
   ref out of an OperationExpr that changed the codec id (e.g.
   `cosineDistance(p.embedding, x).lt(1)` carries refs={post,embedding}
   but a `pg/float8@1` comparison codec). forColumn returned the
   vector codec, which then rejected the float literal.

   resolveParamCodec / resolveProjectionCodec now require byColumn.id
   to agree with the declared codec id; a mismatch falls through to
   forCodecId so the float literal dispatches as float8.

2. forColumn missed for aliased self-joins (`db.sql.post.as(p1)
   .innerJoin(db.sql.post.as(p2), …)` projects p1.id, p2.id). byColumn
   is keyed by source table; the alias never matched, fell through to
   forCodecId(sql/char@1), and threw "ambiguous parameterized
   instances".

   Builds an alias→source table map from the query AST and resolves
   refs through it before forColumn dispatch (decode and encode share
   the helper in alias-resolver.ts).

3. F42 detached factory from its descriptor: `voidFactory(undefined)
   (ctx)` lost the `this`-on-descriptor binding, so descriptors whose
   factory body captures `this` (e.g. PgTextDescriptor: `() => new
   PgTextCodec(this)`) produced codecs with `descriptor: undefined`.
   Reading `codec.id` then threw. The bug was latent until #1 above
   started inspecting `byColumn.id`.

   Both factory call sites now use `factory.bind(descriptor)`.

Updates the demo offline-runtime test expectation: ProjectionItem refs
are now populated for top-level identifier projections (a side effect
of the existing select-shortcut path that the test was written before).
jkomyno added a commit that referenced this pull request May 11, 2026
CodeRabbit (PR #440 review at fbabbdc) flagged that the file declared
`status: complete` while acceptance criterion 2 (duplicate-tuple
integration test) was still unchecked. The criterion was written when
solutions B and C were on the table; chosen action A (runtime guard)
makes the duplicate-tuple integration fixture not load-bearing, since
the unit-test path through `executeNestedUpdateMutation` already
exercises the error contract end-to-end.

Re-frame criterion 2 as "triaged + withdrawn under chosen action A"
with the rationale preserved inline, so the checklist matches the
frontmatter without losing the deferral context. No code change.

Signed-off-by: jkomyno <[email protected]>
wmadden added a commit that referenced this pull request May 12, 2026
Captures the design pass driven by the example-app forcing function:

- decisions.md: canonical decision log (A1-A7 TS authoring, B1-B6 PSL
  authoring, C1-C8 cross-cutting). Records the closes on holes #1, #2,
  #3, #4, #5, #15, #16, #17 and the elevation of roles/posture/extension
  structure to first-class concepts.

- design-holes.md: marks resolved holes against decisions, updates the
  blocking-holes summary table.

- rls.md: rewritten to the .rls([...]) array form (TS) and top-level
  policy <name> { key = value } blocks (PSL), with ref() helper semantics
  documented.

- overview.md: refreshed at-a-glance snippet, capability bullets, stretch
  goals to align with the array-of-descriptors RLS surface and the
  out-of-scope-for-v0.1 framing of functions-as-IR.

- example/src/prisma/contract.ts: rewritten to exercise the settled
  surface (composite uniques in .attributes(), .rls([...]) descriptor
  array, ref() helper for cross-model predicates, no capability flag).

- extension-package.md, posture.md, README.md: cross-reference updates
  pointing at decisions.md and reflecting the role IR + subpath
  entrypoint decisions.
wmadden added a commit that referenced this pull request May 13, 2026
Captures the design pass driven by the example-app forcing function:

- decisions.md: canonical decision log (A1-A7 TS authoring, B1-B6 PSL
  authoring, C1-C8 cross-cutting). Records the closes on holes #1, #2,
  #3, #4, #5, #15, #16, #17 and the elevation of roles/posture/extension
  structure to first-class concepts.

- design-holes.md: marks resolved holes against decisions, updates the
  blocking-holes summary table.

- rls.md: rewritten to the .rls([...]) array form (TS) and top-level
  policy <name> { key = value } blocks (PSL), with ref() helper semantics
  documented.

- overview.md: refreshed at-a-glance snippet, capability bullets, stretch
  goals to align with the array-of-descriptors RLS surface and the
  out-of-scope-for-v0.1 framing of functions-as-IR.

- example/src/prisma/contract.ts: rewritten to exercise the settled
  surface (composite uniques in .attributes(), .rls([...]) descriptor
  array, ref() helper for cross-model predicates, no capability flag).

- extension-package.md, posture.md, README.md: cross-reference updates
  pointing at decisions.md and reflecting the role IR + subpath
  entrypoint decisions.
wmadden added a commit that referenced this pull request May 13, 2026
Captures the design pass driven by the example-app forcing function:

- decisions.md: canonical decision log (A1-A7 TS authoring, B1-B6 PSL
  authoring, C1-C8 cross-cutting). Records the closes on holes #1, #2,
  #3, #4, #5, #15, #16, #17 and the elevation of roles/posture/extension
  structure to first-class concepts.

- design-holes.md: marks resolved holes against decisions, updates the
  blocking-holes summary table.

- rls.md: rewritten to the .rls([...]) array form (TS) and top-level
  policy <name> { key = value } blocks (PSL), with ref() helper semantics
  documented.

- overview.md: refreshed at-a-glance snippet, capability bullets, stretch
  goals to align with the array-of-descriptors RLS surface and the
  out-of-scope-for-v0.1 framing of functions-as-IR.

- example/src/prisma/contract.ts: rewritten to exercise the settled
  surface (composite uniques in .attributes(), .rls([...]) descriptor
  array, ref() helper for cross-model predicates, no capability flag).

- extension-package.md, posture.md, README.md: cross-reference updates
  pointing at decisions.md and reflecting the role IR + subpath
  entrypoint decisions.

Signed-off-by: Will Madden <[email protected]>
wmadden added a commit that referenced this pull request May 13, 2026
Captures the design pass driven by the example-app forcing function:

- decisions.md: canonical decision log (A1-A7 TS authoring, B1-B6 PSL
  authoring, C1-C8 cross-cutting). Records the closes on holes #1, #2,
  #3, #4, #5, #15, #16, #17 and the elevation of roles/posture/extension
  structure to first-class concepts.

- design-holes.md: marks resolved holes against decisions, updates the
  blocking-holes summary table.

- rls.md: rewritten to the .rls([...]) array form (TS) and top-level
  policy <name> { key = value } blocks (PSL), with ref() helper semantics
  documented.

- overview.md: refreshed at-a-glance snippet, capability bullets, stretch
  goals to align with the array-of-descriptors RLS surface and the
  out-of-scope-for-v0.1 framing of functions-as-IR.

- example/src/prisma/contract.ts: rewritten to exercise the settled
  surface (composite uniques in .attributes(), .rls([...]) descriptor
  array, ref() helper for cross-model predicates, no capability flag).

- extension-package.md, posture.md, README.md: cross-reference updates
  pointing at decisions.md and reflecting the role IR + subpath
  entrypoint decisions.

Signed-off-by: Will Madden <[email protected]>
wmadden added a commit that referenced this pull request May 13, 2026
Captures the design pass driven by the example-app forcing function:

- decisions.md: canonical decision log (A1-A7 TS authoring, B1-B6 PSL
  authoring, C1-C8 cross-cutting). Records the closes on holes #1, #2,
  #3, #4, #5, #15, #16, #17 and the elevation of roles/posture/extension
  structure to first-class concepts.

- design-holes.md: marks resolved holes against decisions, updates the
  blocking-holes summary table.

- rls.md: rewritten to the .rls([...]) array form (TS) and top-level
  policy <name> { key = value } blocks (PSL), with ref() helper semantics
  documented.

- overview.md: refreshed at-a-glance snippet, capability bullets, stretch
  goals to align with the array-of-descriptors RLS surface and the
  out-of-scope-for-v0.1 framing of functions-as-IR.

- example/src/prisma/contract.ts: rewritten to exercise the settled
  surface (composite uniques in .attributes(), .rls([...]) descriptor
  array, ref() helper for cross-model predicates, no capability flag).

- extension-package.md, posture.md, README.md: cross-reference updates
  pointing at decisions.md and reflecting the role IR + subpath
  entrypoint decisions.

Signed-off-by: Will Madden <[email protected]>
wmadden added a commit that referenced this pull request May 14, 2026
Records the orchestrator intent-validation pass for m1 R2 (high-reasoning
checkpoint #1) and translates the three observations surfaced by the pass
into M2 R1 reviewer watch-points: lowering of family-shared verifier and
parser bodies (MongoSchemaVerifierBase.verifyCommonMongoSchema,
MongoContractSerializerBase.parseMongoContractStructure) from abstract to
concrete in the family layer rather than the target layer; meaningful
exercise of MongoTargetStorage inheritance over MongoStorage; and a grep
guard against any namespace.id === "__unspecified__" branches in M2 code
(per the singleton-subclass pattern committed in both ADR drafts).

The orchestrator note in code-review.md is local-only (reviews/ is
gitignored by repo convention); the watch-points in learnings.md are
committed because the orchestrator uses them when delegating M2 R1.
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 15, 2026
Records the orchestrator intent-validation pass for m1 R2 (high-reasoning
checkpoint #1) and translates the three observations surfaced by the pass
into M2 R1 reviewer watch-points: lowering of family-shared verifier and
parser bodies (MongoSchemaVerifierBase.verifyCommonMongoSchema,
MongoContractSerializerBase.parseMongoContractStructure) from abstract to
concrete in the family layer rather than the target layer; meaningful
exercise of MongoTargetStorage inheritance over MongoStorage; and a grep
guard against any namespace.id === "__unspecified__" branches in M2 code
(per the singleton-subclass pattern committed in both ADR drafts).

The orchestrator note in code-review.md is local-only (reviews/ is
gitignored by repo convention); the watch-points in learnings.md are
committed because the orchestrator uses them when delegating M2 R1.

Signed-off-by: Will Madden <[email protected]>
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 22, 2026
The hard-gate operator-confirmation at step 5 asked the operator to
re-litigate every default-classified file on every close-out — including
the obvious cases (spec.md → transient, plan.md → transient) the
default-rule table exists precisely to handle. Friction without signal;
the operator already opted into close-out by invoking the skill.

Soften the gate: proceed silently when the run is entirely clean default
classifications. Surface to the operator only when the run contains:
ambiguous files, step-4.5 dispositions (rewrite/lift/soften/reclassify),
ADR-worthy design-decisions, or destination collisions. The
classification block still lands in the close-out PR description for
the reviewer's audit trail.

Common-pitfall #1 inverted to match (over-surfacing is the new failure
mode); checklist item adjusted.

Signed-off-by: Will Madden <[email protected]>
wmadden added a commit that referenced this pull request May 22, 2026
The hard-gate operator-confirmation at step 5 asked the operator to
re-litigate every default-classified file on every close-out — including
the obvious cases (spec.md → transient, plan.md → transient) the
default-rule table exists precisely to handle. Friction without signal;
the operator already opted into close-out by invoking the skill.

Soften the gate: proceed silently when the run is entirely clean default
classifications. Surface to the operator only when the run contains:
ambiguous files, step-4.5 dispositions (rewrite/lift/soften/reclassify),
ADR-worthy design-decisions, or destination collisions. The
classification block still lands in the close-out PR description for
the reviewer's audit trail.

Common-pitfall #1 inverted to match (over-surfacing is the new failure
mode); checklist item adjusted.

Signed-off-by: Will Madden <[email protected]>
wmadden-electric added a commit that referenced this pull request Jun 15, 2026
Read the rule with the eyes of an agent mid-task. Fixes the gaps an
agent following it literally would still trip on:

- The rule's namesake "don't" (re-running to refine a filter) was
  bullet #2; promote it to #1.
- "Don't pass --force to turbo" left the right thing unsaid; name
  the cached invocation (pnpm turbo typecheck plain).
- The recipe captured the exit code but never told the agent to read
  it back; add the tail step plus a note for the crash-before-tests
  case (log has no FAIL lines).
- The re-run-after-a-fix case was unspecified; say to overwrite the
  same file with >.
- wip/ was presented as a magic convention; note that it's gitignored
  at the repo root.
- Scope-limit the rule explicitly to the listed slow commands; tell
  agents short commands run normally.
- Replace the orphaned "if a pipe is unavoidable" line with a worked
  tee + PIPESTATUS example.
- Drop the meta "largest waste of agent time" framing — it's for the
  reviewer, not the executing agent.

Bytes threshold bumped 31500 → 32000 to fit the richer recipe; lines
threshold unchanged.

Co-authored-by: Claude Opus 4.7 <[email protected]>
Signed-off-by: willbot <[email protected]>
Signed-off-by: Will Madden <[email protected]>
SevInf added a commit that referenced this pull request Jun 18, 2026
Slice 4 (resolve-in-symbol-table) dispatch 1 \u2014 reverse project decision #4:
centralize the resolution the SQL + Mongo packages each re-derive into views.

New src/resolve.ts (the shared home, Open Question #1 working position) holds
the proven resolution ported faithfully from the SQL cst-read.ts/symbol-views.ts:
- resolveFieldTypeAnnotation: QualifiedNameAst split (typeName/typeNamespaceId/
  typeContractSpaceId) + optional/list/isConstructor, with the over-qualified
  malformed signal.
- readResolvedAttribute(s) + readResolvedConstructorCall: verbatim-source arg
  value rendering (printSyntax(...).trim()), dotted attribute names.
- nodePslSpan/rangeToPslSpan: the Range -> PslSpan map.
- ResolvedAttribute / ResolvedAttributeArg / ResolvedTypeConstructorCall.

buildSymbolTable now resolves once:
- FieldSymbol gains typeName/typeNamespaceId?/typeContractSpaceId?/optional/list/
  typeConstructor?/attributes/malformedType?. Over-qualified field types emit
  PSL_INVALID_QUALIFIED_TYPE into the symbol-table diagnostics (a ParseDiagnostic,
  same code as before) and set malformedType (replacing the per-package
  typeAlreadyReported view flag).
- ScalarSymbol/TypeAliasSymbol gain the resolved binding shape (baseType?/
  typeConstructor?/isConstructor/attributes) via ResolvedNamedTypeBinding.
- ModelSymbol/CompositeTypeSymbol gain their model/composite-level attributes.

Faithful port: same diagnostic code, same span derivation, same verbatim arg
rendering, same isConstructor gating \u2014 so D2/D3 are pure deletions + field-access
rewires. The Resolved* types are exported from the package index.

Tests: 11 new symbol-table resolution tests (qualified split bare/dot/colon/
over-qualified, optional/list, constructor, field+model+composite attributes,
scalar-vs-alias resolved binding). psl-parser 361/361 green; typecheck clean;
lint:deps green. Interpreter view layers untouched (deleted in D2/D3).

Note for D2: CstFieldView declared a typeRef? field that symbol-views.ts never
populated (always undefined from the view path); FieldSymbol omits it. The SQL
helpers that read field.typeRef sourced it from a non-view path \u2014 D2 handles
that sourcing.

Signed-off-by: Serhii Tatarintsev <[email protected]>
SevInf added a commit that referenced this pull request Jun 19, 2026
Turn the dispatch-4 // dispatch-5 bridge into the real provider integration.

Diagnostic surfacing (the load-bearing fix): the bridge surfaced neither
parses nor buildSymbolTables diagnostics, dropping the parity the legacy
parsePslDocument path had (it threaded document.diagnostics through the
interpreters now-removed mapParserDiagnostics). The provider now collects BOTH
lists -- parse(schema).diagnostics and buildSymbolTable(...).diagnostics, kept
separate per the project decision -- maps each ParseDiagnostic
{ code, message, range } to a ContractSourceDiagnostic (sourceId: schemaPath,
span via rangeToPslSpan), and short-circuits with notOk when either is
non-empty, rather than interpreting a structurally broken document. Adds two
provider tests asserting the restored surfacing (PSL_UNTERMINATED_BLOCK from
parse, PSL_DUPLICATE_DECLARATION from buildSymbolTable).

pslBlockDescriptors rehoming (Open Question #1): the descriptor-agnostic CST
parse/buildSymbolTable no longer consume the thread and no SQL src/ consumer
remains, so it is dropped with an inline deferral note. The enum case is
covered by enum-block reconstruction; descriptor-typed block-parameter
validation is the tracked slice-3 follow-up. See the dispatch report for a
canary finding on PSL_EXTENSION_DUPLICATE_PARAMETER.

src/ typecheck + lint clean; provider.test.ts green (22 tests). The 14
interpreter-driven suites remain red pending the dispatch-6 test fan-out.

Signed-off-by: Serhii Tatarintsev <[email protected]>
SevInf added a commit that referenced this pull request Jun 19, 2026
Migrate the 14 interpreter-driven test suites off the legacy
parsePslDocument({ schema }) + { document } shape onto the shared
symbolTableInputFromParseArgs helper (an object-form shim over
buildSymbolTableInput, added to fixtures.ts), spreading the resulting
{ symbolTable, sourceFile, sourceId } into the migrated interpreter input.
Mechanical: parsePslDocument( -> symbolTableInputFromParseArgs(, and every
`document` property usage -> a `...document` spread; the now-unused
parsePslDocument imports are dropped.

Rewrites the one structurally-coupled test (interpreter.diagnostics) that
hand-built a fake ParsePslDocumentResult to hit the
PSL_UNSUPPORTED_NAMED_TYPE_BASE guard: a real `types { Broken }` binding (no
`= type`) reaches that guard via the symbol-table walk, so the fake AST + its
testSpan/ParsePslDocumentResult imports are removed.

Slice DoD: enum-block.ts no longer imports the framework PslExtensionBlock*
types (replaced by a package-local ReconstructedExtensionBlock structural
mirror) and the doc-comment Psl* mentions are reworded, so
`rg PslModel|PslField|PslCompositeType|PslNamedTypeDeclaration|PslExtensionBlock|parsePslDocument src`
is now empty. typecheck (src + test) and lint:deps clean.

275/277 tests pass. The 2 remaining failures are a SURFACED PARITY DIVERGENCE
(not rewritten per the dispatch CRITICAL rule): both assert
PSL_UNSUPPORTED_TOP_LEVEL_BLOCK for a `datasource {}` / descriptor-less `enum`
top-level block, which the descriptor-agnostic CST parser no longer rejects
(it accepts any non-reserved keyword as a generic block). This is a consequence
of the dropped pslBlockDescriptors thread (slice spec Open Question #1) and
needs an operator decision \u2014 see the dispatch report.

Signed-off-by: Serhii Tatarintsev <[email protected]>
SevInf added a commit that referenced this pull request Jun 19, 2026
…ons, review log

Records slice 2 (migrate-sql-interpreter) completion: dispatch plan additions
(5b/5c/6b), resolved Open Question #1 (pslBlockDescriptors rehomed to the
interpreter walk), the two new project open items (doubled qualified-name
codes; descriptor-typed block params for slice 3), and the reviewer round log
through slice-2 DoD.

Signed-off-by: Serhii Tatarintsev <[email protected]>
SevInf added a commit that referenced this pull request Jun 19, 2026
Slice 4 (resolve-in-symbol-table) dispatch 1 \u2014 reverse project decision #4:
centralize the resolution the SQL + Mongo packages each re-derive into views.

New src/resolve.ts (the shared home, Open Question #1 working position) holds
the proven resolution ported faithfully from the SQL cst-read.ts/symbol-views.ts:
- resolveFieldTypeAnnotation: QualifiedNameAst split (typeName/typeNamespaceId/
  typeContractSpaceId) + optional/list/isConstructor, with the over-qualified
  malformed signal.
- readResolvedAttribute(s) + readResolvedConstructorCall: verbatim-source arg
  value rendering (printSyntax(...).trim()), dotted attribute names.
- nodePslSpan/rangeToPslSpan: the Range -> PslSpan map.
- ResolvedAttribute / ResolvedAttributeArg / ResolvedTypeConstructorCall.

buildSymbolTable now resolves once:
- FieldSymbol gains typeName/typeNamespaceId?/typeContractSpaceId?/optional/list/
  typeConstructor?/attributes/malformedType?. Over-qualified field types emit
  PSL_INVALID_QUALIFIED_TYPE into the symbol-table diagnostics (a ParseDiagnostic,
  same code as before) and set malformedType (replacing the per-package
  typeAlreadyReported view flag).
- ScalarSymbol/TypeAliasSymbol gain the resolved binding shape (baseType?/
  typeConstructor?/isConstructor/attributes) via ResolvedNamedTypeBinding.
- ModelSymbol/CompositeTypeSymbol gain their model/composite-level attributes.

Faithful port: same diagnostic code, same span derivation, same verbatim arg
rendering, same isConstructor gating \u2014 so D2/D3 are pure deletions + field-access
rewires. The Resolved* types are exported from the package index.

Tests: 11 new symbol-table resolution tests (qualified split bare/dot/colon/
over-qualified, optional/list, constructor, field+model+composite attributes,
scalar-vs-alias resolved binding). psl-parser 361/361 green; typecheck clean;
lint:deps green. Interpreter view layers untouched (deleted in D2/D3).

Note for D2: CstFieldView declared a typeRef? field that symbol-views.ts never
populated (always undefined from the view path); FieldSymbol omits it. The SQL
helpers that read field.typeRef sourced it from a non-view path \u2014 D2 handles
that sourcing.

Signed-off-by: Serhii Tatarintsev <[email protected]>
SevInf added a commit that referenced this pull request Jun 19, 2026
Turn the dispatch-4 // dispatch-5 bridge into the real provider integration.

Diagnostic surfacing (the load-bearing fix): the bridge surfaced neither
parses nor buildSymbolTables diagnostics, dropping the parity the legacy
parsePslDocument path had (it threaded document.diagnostics through the
interpreters now-removed mapParserDiagnostics). The provider now collects BOTH
lists -- parse(schema).diagnostics and buildSymbolTable(...).diagnostics, kept
separate per the project decision -- maps each ParseDiagnostic
{ code, message, range } to a ContractSourceDiagnostic (sourceId: schemaPath,
span via rangeToPslSpan), and short-circuits with notOk when either is
non-empty, rather than interpreting a structurally broken document. Adds two
provider tests asserting the restored surfacing (PSL_UNTERMINATED_BLOCK from
parse, PSL_DUPLICATE_DECLARATION from buildSymbolTable).

pslBlockDescriptors rehoming (Open Question #1): the descriptor-agnostic CST
parse/buildSymbolTable no longer consume the thread and no SQL src/ consumer
remains, so it is dropped with an inline deferral note. The enum case is
covered by enum-block reconstruction; descriptor-typed block-parameter
validation is the tracked slice-3 follow-up. See the dispatch report for a
canary finding on PSL_EXTENSION_DUPLICATE_PARAMETER.

src/ typecheck + lint clean; provider.test.ts green (22 tests). The 14
interpreter-driven suites remain red pending the dispatch-6 test fan-out.

Signed-off-by: Serhii Tatarintsev <[email protected]>
SevInf added a commit that referenced this pull request Jun 19, 2026
Migrate the 14 interpreter-driven test suites off the legacy
parsePslDocument({ schema }) + { document } shape onto the shared
symbolTableInputFromParseArgs helper (an object-form shim over
buildSymbolTableInput, added to fixtures.ts), spreading the resulting
{ symbolTable, sourceFile, sourceId } into the migrated interpreter input.
Mechanical: parsePslDocument( -> symbolTableInputFromParseArgs(, and every
`document` property usage -> a `...document` spread; the now-unused
parsePslDocument imports are dropped.

Rewrites the one structurally-coupled test (interpreter.diagnostics) that
hand-built a fake ParsePslDocumentResult to hit the
PSL_UNSUPPORTED_NAMED_TYPE_BASE guard: a real `types { Broken }` binding (no
`= type`) reaches that guard via the symbol-table walk, so the fake AST + its
testSpan/ParsePslDocumentResult imports are removed.

Slice DoD: enum-block.ts no longer imports the framework PslExtensionBlock*
types (replaced by a package-local ReconstructedExtensionBlock structural
mirror) and the doc-comment Psl* mentions are reworded, so
`rg PslModel|PslField|PslCompositeType|PslNamedTypeDeclaration|PslExtensionBlock|parsePslDocument src`
is now empty. typecheck (src + test) and lint:deps clean.

275/277 tests pass. The 2 remaining failures are a SURFACED PARITY DIVERGENCE
(not rewritten per the dispatch CRITICAL rule): both assert
PSL_UNSUPPORTED_TOP_LEVEL_BLOCK for a `datasource {}` / descriptor-less `enum`
top-level block, which the descriptor-agnostic CST parser no longer rejects
(it accepts any non-reserved keyword as a generic block). This is a consequence
of the dropped pslBlockDescriptors thread (slice spec Open Question #1) and
needs an operator decision \u2014 see the dispatch report.

Signed-off-by: Serhii Tatarintsev <[email protected]>
SevInf added a commit that referenced this pull request Jun 19, 2026
…ons, review log

Records slice 2 (migrate-sql-interpreter) completion: dispatch plan additions
(5b/5c/6b), resolved Open Question #1 (pslBlockDescriptors rehomed to the
interpreter walk), the two new project open items (doubled qualified-name
codes; descriptor-typed block params for slice 3), and the reviewer round log
through slice-2 DoD.

Signed-off-by: Serhii Tatarintsev <[email protected]>
SevInf added a commit that referenced this pull request Jun 19, 2026
Slice 4 (resolve-in-symbol-table) dispatch 1 \u2014 reverse project decision #4:
centralize the resolution the SQL + Mongo packages each re-derive into views.

New src/resolve.ts (the shared home, Open Question #1 working position) holds
the proven resolution ported faithfully from the SQL cst-read.ts/symbol-views.ts:
- resolveFieldTypeAnnotation: QualifiedNameAst split (typeName/typeNamespaceId/
  typeContractSpaceId) + optional/list/isConstructor, with the over-qualified
  malformed signal.
- readResolvedAttribute(s) + readResolvedConstructorCall: verbatim-source arg
  value rendering (printSyntax(...).trim()), dotted attribute names.
- nodePslSpan/rangeToPslSpan: the Range -> PslSpan map.
- ResolvedAttribute / ResolvedAttributeArg / ResolvedTypeConstructorCall.

buildSymbolTable now resolves once:
- FieldSymbol gains typeName/typeNamespaceId?/typeContractSpaceId?/optional/list/
  typeConstructor?/attributes/malformedType?. Over-qualified field types emit
  PSL_INVALID_QUALIFIED_TYPE into the symbol-table diagnostics (a ParseDiagnostic,
  same code as before) and set malformedType (replacing the per-package
  typeAlreadyReported view flag).
- ScalarSymbol/TypeAliasSymbol gain the resolved binding shape (baseType?/
  typeConstructor?/isConstructor/attributes) via ResolvedNamedTypeBinding.
- ModelSymbol/CompositeTypeSymbol gain their model/composite-level attributes.

Faithful port: same diagnostic code, same span derivation, same verbatim arg
rendering, same isConstructor gating \u2014 so D2/D3 are pure deletions + field-access
rewires. The Resolved* types are exported from the package index.

Tests: 11 new symbol-table resolution tests (qualified split bare/dot/colon/
over-qualified, optional/list, constructor, field+model+composite attributes,
scalar-vs-alias resolved binding). psl-parser 361/361 green; typecheck clean;
lint:deps green. Interpreter view layers untouched (deleted in D2/D3).

Note for D2: CstFieldView declared a typeRef? field that symbol-views.ts never
populated (always undefined from the view path); FieldSymbol omits it. The SQL
helpers that read field.typeRef sourced it from a non-view path \u2014 D2 handles
that sourcing.

Signed-off-by: Serhii Tatarintsev <[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.

2 participants