Skip to content

Fix dev->main merge test expectations#65

Merged
flyon merged 26 commits intodevfrom
codex/fix-main-build-errors
Apr 6, 2026
Merged

Fix dev->main merge test expectations#65
flyon merged 26 commits intodevfrom
codex/fix-main-build-errors

Conversation

@flyon
Copy link
Copy Markdown
Contributor

@flyon flyon commented Apr 6, 2026

Summary

  • merge main into the fix branch so the PR reflects the actual dev -> main merge result
  • update negation-related SPARQL golden expectations for required outer filter bindings
  • update serialization expectations to the expression-based where JSON emitted by the merged code

Why

The open dev -> main PR was red only on the synthetic merge result. dev alone was green, but main contributes additional negation and serialization coverage in the same files, and the merged result had seven stale assertions.

Validation

  • npm test -- --runInBand --runTestsByPath src/tests/sparql-select-golden.test.ts src/tests/serialization.test.ts
  • npm test -- --runInBand

claude and others added 26 commits April 1, 2026 20:34
Compare Linked with popular JS/TS libraries (Prisma, Drizzle, TypeORM,
MikroORM, Sequelize, Kysely, Knex, Neo4j OGM, Neogma) across type safety,
query style, schema definition, relationships, and SQLAlchemy pattern alignment.

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
Use the public npm package for skill installation instead of a custom
script that required SSH access to the private agents repo.

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
Each doc covers current codebase state, how other libraries handle it,
open questions, and potential API designs:

- 016: Aggregations (sum/avg/min/max/groupBy)
- 017: Upsert (create-or-update semantics)
- 018: Transactions (mutation batching)
- 019: Multi-column sorting (per-key direction)
- 020: Distinct (explicit control)
- 021: Computed properties (reusable expression fragments on shapes)
- 022: Negation (NOT/notEquals/none)

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
Clarify what Linked is in relation to the ORM/query builder landscape
(like Drizzle/Prisma but for RDF/SPARQL). Update setup instructions
to reflect the new npx-based setup command.

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
Resolved all open questions through interactive ideation:
- Retire Evaluation class, unify on ExpressionNode for all WHERE paths
- Add .none() on collections (sugar for .some().not())
- Expr.not() prefix and .not() postfix suffice for general negation
- Skip prefix f.age.not().gt() — ambiguous scope
- Keep .minus() alongside .none() — different SPARQL semantics

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
4-phase plan: migrate .equals() to ExpressionNode, migrate .some()/.every(),
add .none(), then remove Evaluation class and old WHERE infrastructure.

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
Phase 1+2+3 of negation implementation (022):
- Add 'equals' to EXPRESSION_METHODS for proxy interception
- Rewrite QueryShape/QueryPrimitive/QueryPrimitiveSet .equals() to return ExpressionNode
- Rewrite QueryShapeSet .some()/.every() to return ExistsCondition
- Add .none() on QueryShapeSet
- Add ExistsCondition class for EXISTS quantifier conditions
- Add lowerExistsCondition in IRLower for ExistsCondition → IRExistsExpression
- Add toExpressionNode helper for QueryBuilderObject → ExpressionNode
- Update tests for new pipeline paths

Status: 68/68 golden IR tests pass. 5 edge case failures remain
(inline where on primitives, root shape equality, size equality,
context values). These need special handling during migration.

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
Handle cases where toExpressionNode can't resolve a property path:
- Root shape self-reference (p.equals(...))
- Inline where on primitives (h.equals(...))
- Shape reference comparison (p.bestFriend.equals({id}))

Falls back to old Evaluation path when segments are empty.
Down to 2 remaining edge case failures (context paths, count equals).

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
- Override .equals() on SetSize to always use Evaluation path (preserves
  count/GROUP BY/HAVING semantics in SPARQL)
- Handle query context references in toExpressionNode — detect context
  origin and produce context_property_expr IR
- findContextId walks the QBO chain to find __queryContextId markers

All 927 non-Fuseki tests pass (0 failures).

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
All .equals() calls now produce ExpressionNode without Evaluation:
- Root shape: tracedAliasExpression([]) resolves to root alias
- Inline where: InlineWhereProxy produces alias expression for bound value
- SetSize: builds aggregate_expr(count, ...) ExpressionNode directly
- Context root: reference_expr with context IRI
- Context property: context_property_expr

Added tracedAliasExpression() and alias_expr resolution in
resolveExpressionRefs. Added aggregate_expr resolution too.

All 927 non-Fuseki tests pass.

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
- Gut Evaluation class (empty deprecated stub remains for type compat)
- Remove dead code: DesugaredWhereComparison, DesugaredWhereBoolean,
  CanonicalWhereComparison, CanonicalWhereLogical, CanonicalWhereExists,
  CanonicalWhereNot, toWhereComparison, toWhereArg, toExists, toComparison,
  canonicalizeComparison, flattenLogical, isDesugaredWhere
- Simplify canonicalizeWhere to passthrough for expression + exists
- Simplify lowerWhere to only handle expression + exists_condition
- Remove isEvaluation from FieldSet
- Remove Evaluation from WhereClause type
- Fix type inference: use structural check for ExpressionNode→boolean
  mapping to avoid false matches on other classes
- Add 15 negation type inference tests (compile-only)
- Update ir-canonicalize tests for new pipeline

All 927 non-Fuseki tests pass. TypeScript compiles clean.

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
- Remove remaining dead code: Evaluation stub, WhereMethods enum,
  isWhereEvaluationPath, WhereEvaluationPath, DesugaredEvaluationSelect,
  evaluation_select handler, collectRefs, isEvaluation
- Add .none() query fixture (whereNone) + IR golden test + SPARQL golden test
- Write final report (docs/reports/013-negation-and-evaluation-retirement.md)
- Remove plan doc (docs/plans/022-negation.md)
- Add changeset for minor version bump

929 tests pass, 0 failures.

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
Three new query fixtures with IR golden + SPARQL golden tests:
- whereSomeNot: .some().not() produces identical SPARQL to .none()
- whereEqualsNot: .equals().not() produces FILTER(!(?var = "value"))
- whereNoneAndEquals: .none().and() chains NOT EXISTS with equality

935 tests pass, 0 failures.

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
Complete the SPARQL golden coverage for all negation patterns:
- whereNeq: .neq() produces FILTER(?var != "value")
- whereExprNot: Expr.not() wrapping compound AND produces
  FILTER(!(?a && ?b))

939 tests pass, 0 failures.

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
Gap 4: Replace fragile structural check with direct T extends ExpressionNode
  for boolean type mapping — works now that Evaluation is fully removed
Gap 1: toExpressionNode() return type is always ExpressionNode (remove | null)
Gap 3: Update error messages in buildPredicateExpression

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
Gap 1: Remove stale | null from toExpressionNode return type
Gap 2: Update stale Evaluation references in report 010
Gap 3: Fix error message in buildPredicateExpression

939 tests pass, 0 failures.

https://claude.ai/code/session_019MDcpswuKKNx9YhC2S2vT7
Unify WHERE pipeline on ExpressionNode, retire Evaluation, add .none()
chore: version package for release
chore: version package for release
@flyon flyon merged commit 56a3d3a into dev Apr 6, 2026
4 checks passed
@flyon flyon deleted the codex/fix-main-build-errors branch April 6, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants