Close v18 Optics path and migrate Method tracker#111
Conversation
|
Important Review skippedToo many files! This PR contains 297 files, which is 147 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (297)
You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR lands the v18 Optics public API closeout, enabling coordinate-backed coherent optic reads through a stable causal position without materializing the full graph. New Changesv18 Optics Public API Closeout: Coordinate-Backed Coherent Reads
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly Related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
|
Release Preflight
If you tag this commit as |
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/domain/services/optic/CheckpointTailBasisLoader.ts (1)
59-64:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winTreat empty checkpoint SHA as missing at the boundary.
_readCheckpointSha()currently only rejectsnull. An empty SHA should also map tomissing-checkpointto avoid downstream opaque persistence failures.Suggested patch
private async _readCheckpointSha(): Promise<string> { const checkpointSha = await this._source._readCheckpointSha(); - if (checkpointSha === null) { + if (checkpointSha === null || checkpointSha.length === 0) { throwNoBoundedBasis(this._source.graphName, 'missing-checkpoint'); } return checkpointSha; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/domain/services/optic/CheckpointTailBasisLoader.ts` around lines 59 - 64, In _readCheckpointSha(), treat an empty string the same as null: after calling this._source._readCheckpointSha(), check if checkpointSha is null or checkpointSha === '' and if so call throwNoBoundedBasis(this._source.graphName, 'missing-checkpoint'); otherwise return the SHA; update the _readCheckpointSha method (referencing this._source._readCheckpointSha, checkpointSha, this._source.graphName, and throwNoBoundedBasis) so empty strings are mapped to the missing-checkpoint boundary error.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/domain/services/optic/CoordinateCheckpointTailOpticSource.ts`:
- Around line 27-38: The constructor currently trusts options.frontier and
fields on options.source and can throw raw TypeErrors; add defensive validation
at the start of the CoordinateCheckpointTailOpticSource constructor to assert
options.source exists and has required identity fields (graphName, _persistence,
_codec, _blobStorage, _commitMessageCodec) using assertNonEmpty where
appropriate, validate options.checkpointSha (already present) and validate
options.frontier is non-null and shape-compatible before calling copyFrontier;
replace raw errors by throwing a WarpError (with a clear message) if validation
fails, and wrap the copyFrontier call in a try/catch that converts unexpected
exceptions into a WarpError so the constructor always enforces invariants rather
than leaking TypeErrors.
In `@src/domain/services/Worldline.ts`:
- Around line 136-139: Update the thrown QueryError in the unsupported-selector
branch to use a clear, accurate message instead of "v17 foundation optics
support live worldlines only"; locate the throw new QueryError(...) with code
'E_OPTIC_NO_BOUNDED_BASIS' (inside the unsupported-selector branch that
references this._source.constructor.name) and change the error text to describe
the actual unsupported selector case (e.g., indicate that the selector type is
unsupported or must be a coordinate selector), keeping the same error code and
context payload.
In `@src/domain/types/CoordinateSelector.ts`:
- Around line 81-86: The validateCheckpointSha function currently accepts
strings that are only whitespace; update its validation in validateCheckpointSha
to first ensure checkpointSha is a string, then trim() it and reject if the
trimmed length is 0 (throw the same QueryError message), returning the trimmed
value (or null when input is null/undefined) so whitespace-only inputs are
treated as invalid and the selector invariant is preserved.
In `@src/domain/WarpWorldlineCoordinate.ts`:
- Around line 25-33: The constructor of WarpWorldlineCoordinate must validate
the frontier and createWorldline inputs up front: add explicit runtime checks in
the constructor for options.frontier to be a non-null object with an entries
array (or whatever shape freezeFrontier expects) and for options.createWorldline
to be either undefined or a function before calling freezeFrontier or assigning
to this._createWorldline; if validation fails throw a domain error (e.g.,
TypeError or a custom error) with a clear message. Locate the constructor in
class WarpWorldlineCoordinate and add these checks prior to calling
freezeFrontier(options.frontier) and before setting this._createWorldline so
invalid inputs fail fast and with a domain-style error. Ensure the checks mirror
the same validation you will add in the other constructor uses referenced around
the class (lines noted in the review) so all construction paths enforce the
invariants.
In `@src/domain/WarpWorldlineOpticBasis.ts`:
- Around line 22-24: The assertNonEmpty validator currently allows strings that
are only whitespace; update the function assertNonEmpty(value: string, field:
string) used by WarpWorldlineOpticBasis to treat whitespace-only values as empty
by checking value.trim().length === 0 (or using a regex) in addition to the
existing typeof check, and continue to throw WarpError(field + "...") when
validation fails so the constructor enforces the non-whitespace invariant for
identity fields.
---
Outside diff comments:
In `@src/domain/services/optic/CheckpointTailBasisLoader.ts`:
- Around line 59-64: In _readCheckpointSha(), treat an empty string the same as
null: after calling this._source._readCheckpointSha(), check if checkpointSha is
null or checkpointSha === '' and if so call
throwNoBoundedBasis(this._source.graphName, 'missing-checkpoint'); otherwise
return the SHA; update the _readCheckpointSha method (referencing
this._source._readCheckpointSha, checkpointSha, this._source.graphName, and
throwNoBoundedBasis) so empty strings are mapped to the missing-checkpoint
boundary error.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b89ceb76-8bbb-4362-bb9b-ab2e0d793a17
📒 Files selected for processing (31)
CHANGELOG.mdREADME.mddocs/API_REFERENCE.mddocs/BEARING.mddocs/READINGS_AND_OPTICS.mddocs/design/0265-v18-optics-public-api-closeout/v18-optics-public-api-closeout.mddocs/method/backlog/README.mddocs/method/backlog/v18.0.0/API_optics-public-api-closeout.mddocs/method/backlog/v18.0.0/README.mddocs/method/backlog/v18.0.0/RELEASE_v18-public-release-blockers.mddocs/migrations/v18.0.0.mddocs/releases/v18.0.0/README.mdindex.tssrc/domain/RuntimeHost.tssrc/domain/WarpWorldline.tssrc/domain/WarpWorldlineCoordinate.tssrc/domain/WarpWorldlineOpticBasis.tssrc/domain/capabilities/QueryCapability.tssrc/domain/services/Worldline.tssrc/domain/services/controllers/CheckpointController.tssrc/domain/services/controllers/QueryController.tssrc/domain/services/optic/CheckpointTailBasisLoader.tssrc/domain/services/optic/CheckpointTailOpticSource.tssrc/domain/services/optic/CoordinateCheckpointTailOpticSource.tssrc/domain/types/CoordinateSelector.tssrc/domain/types/WorldlineSelector.tssrc/domain/warp/RuntimeHostProduct.tstest/conformance/v18CoordinateOpticPublicPath.test.tstest/type-check/consumer.tstest/unit/index.exports.test.tstest/unit/scripts/v18-worldline-api-doc-guard.test.ts
… to typed prop iterators Replace raw state.prop loops with WarpStateClass.nodePropertiesFromMap() in StateSerializer.projectState() and LogicalIndexBuildService._populateVisibleData(). Update propVisibleV5() to accept NodePropertyEntry instead of raw encoded key, removing the decodePropKey decode step from its body. Fix EdgePropKey.test.ts import path (decodeEdgePropKey was not exported by JoinReducer). Retire TemporalQuery.ts and VisibleStateScope.ts from the raw-compatibility audit; they were migrated to state.nodeProperties()/edgeProperties() in the previous session.
…l raw prop.get/set callers Add getNodeProp(), getEdgeProp(), getEncodedProp(), and mutatePropLWW() to WarpState, encapsulating all direct prop-map access behind typed methods. Migrate callers: - ContentAttachmentProjection: state.getNodeProp/getEdgeProp - propHelpers: state.mutatePropLWW / state.getEncodedProp - OpStrategy: same (shared protected helpers) - NodePropSet / EdgePropSet / PropSet / OpStrategies: ReceiptBuilder now accepts WarpState directly (propOutcomeForKey / propSetOutcome / edgePropSetOutcome) and calls state.getEncodedProp internally - PatchController: iterate nodeProperties()/edgeProperties() + getEncodedProp Retires 7 files from the raw-compatibility audit.
Release Preflight
If you tag this commit as |
|
@codex second opinion requested. Code Lawyer Self-Audit Findings
These are separate from the five unresolved CodeRabbit inline review threads and will be handled in the same one-issue-at-a-time queue. |
Code Lawyer Activity Summary
Verification:
|
Release Preflight
If you tag this commit as |
Summary
prepareOpticBasis(),coordinate(), andcoordinate.optic()Issue
Refs #546
Refs #547
Refs #549
Refs #552
Refs #572
Refs #573
Test plan
v18-coordinate-optics-closeoutnpm run lint:linksnpx vitest run test/unit/scripts/backlog-feature-scope.test.ts test/unit/scripts/backlog-debt-release-home.test.ts test/unit/scripts/observer-geometry-ladder-shape.test.ts test/unit/scripts/warp-drift-release-slotting-shape.test.ts test/unit/scripts/query-builder-closeout.test.ts test/unit/scripts/warpgraph-factory-closeout.test.ts test/unit/scripts/warpgraph-runtime-bridge-closeout.test.ts test/unit/scripts/factory-functions-in-tests-shape.test.ts test/unit/scripts/incremental-index-updater-closeout-shape.test.ts test/unit/scripts/orsetlike-contract-closeout.test.ts test/unit/scripts/remaining-big-files-closeout-shape.test.ts test/unit/scripts/streaming-memory-audit-closeout.test.ts test/unit/scripts/uniform-git-cas-closeout.test.tsnpm run typecheck:test.github/workflows/pr-issue-reference.yml: syntheticRefs #546PR passes; synthetic PR with no issue reference failsNotes
This PR updates the tracker and release posture. It does not implement the bounded-memory product gate. v18 remains blocked until the gate issues above are resolved and merged.