Skip to content

Release v18.1.0 prep and reify Optic runtime noun - #666

Merged
flyingrobots merged 14 commits into
mainfrom
release/v18.1.0-prep
Jun 24, 2026
Merged

Release v18.1.0 prep and reify Optic runtime noun#666
flyingrobots merged 14 commits into
mainfrom
release/v18.1.0-prep

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

Refs #665.
Refs #663.

Validation

  • npm run lint
  • npm run typecheck
  • npm run typecheck:consumer
  • npm run test:local
  • npx vitest run test/unit/domain/index.exports.test.ts test/unit/domain/services/optic/Optic.test.ts test/unit/domain/services/optic/WorldlineOptic.test.ts test/unit/domain/services/optic/TraversalOptic.test.ts
  • npx vitest run test/conformance/v17CheckpointTailOpticReadBasis.test.ts test/conformance/v18FirstUseOpticsHonesty.test.ts test/conformance/v18NeighborhoodOpticReadBasis.test.ts test/conformance/v18TraversalOpticReadBasis.test.ts
  • npx vitest run test/unit/scripts/runtime-noun-doc-graph.test.ts
  • npx markdownlint-cli README.md CHANGELOG.md docs/GLOSSARY.md docs/topics/optics.md docs/design/0275-v18-reified-optics/v18-reified-optics.md docs/releases/v18.1.0/README.md
  • npm run lint:md:code -- README.md docs/topics docs/design/0275-v18-reified-optics/v18-reified-optics.md docs/releases/v18.1.0/README.md CHANGELOG.md examples/README.md
  • npm run release:guard -- --tag v18.1.0 --stage prep-pr
  • Pre-push IRONCLAD M9 firewall passed, including link check, lint/type/policy/surface/markdown gates, and npm run test:local.

Summary by CodeRabbit

Release Notes

  • New Features
    • Exported Optic as a runtime-backed noun for bounded optic reads, with posture/support-rule types
    • Updated read APIs to accept Optic objects for node, node-property, neighborhood, and traversal reads
    • Added runnable examples for bounded reads, observer apertures, and optics-based reads
  • Documentation
    • Expanded README and added optics, bounded-reads, and observers docs plus the v18.1.0 release-evidence packet/design docs
  • Bug Fixes
    • Blank optic targets/properties are now rejected as schema errors (E_OPTIC_FAILURE_SCHEMA)
  • Tests
    • Updated/removed brittle documentation-alignment tests; added/expanded optic-focused unit coverage
  • Version
    • Bumped to 18.1.0 across packages

Reify Optic as a first-class runtime read-intent noun for node, node-property, neighborhood, and traversal reads.

Add coordinate, aperture, basis, and support posture classes; lower fluent WorldlineOptic scopes into frozen Optic values; and require checkpoint-tail execution to consume the reified target and support posture.

Export the new runtime nouns, add consumer/export/runtime-noun tests, update the v18.1.0 release evidence, and move public docs from target-language to transition-language for the implemented Optic surface.

Refs #665
Drop unit-script tests that assert README and documentation corpus wording/shape instead of runtime behavior.

The stable local suite now covers behavior without requiring README phrasing to preserve implementation-detail assertions.
Remove Gate D suffix exchange from the v18.1.0 active goalpost language and record that #663 is closed as a release-scope correction, not as proof of live Continuum Gate D interop.

Continuum #33 and Echo #591 remain the live stack gates for bidirectional network suffix exchange evidence.

Closes #663
Fix the package-root consumer smoke test after reified Optic added ContinuumEvidencePosture usage.
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 461d7901-a201-4e11-95a1-9d0384e67c7f

📥 Commits

Reviewing files that changed from the base of the PR and between 721cb38 and 0044795.

📒 Files selected for processing (1)
  • test/unit/domain/services/optic/TraversalOptic.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/unit/domain/services/optic/TraversalOptic.test.ts

📝 Walkthrough

Walkthrough

Introduces Optic as a first-class immutable runtime domain object for v18.1.0. Four posture value-objects (OpticAperturePosture, OpticBasisPosture, OpticCoordinatePosture, OpticSupportRule) are added, then aggregated into a validated Optic class. All fluent read-chain classes are refactored to carry and propagate Optic instances instead of raw node ID strings. Public exports are extended, new unit tests and examples are added, documentation is substantially expanded, legacy test files are removed, and all package versions are bumped to 18.1.0.

Changes

Optic Reification and Fluent Read Chain Refactor

Layer / File(s) Summary
Posture value-objects and support rule
src/domain/services/optic/OpticAperturePosture.ts, src/domain/services/optic/OpticBasisPosture.ts, src/domain/services/optic/OpticCoordinatePosture.ts, src/domain/services/optic/OpticSupportRule.ts
Four closed-set domain value-objects encapsulating validated posture strings with static constructors, predicate helpers, equality checks, and QueryError-throwing validators (E_OPTIC_SCHEMA).
Core Optic domain class
src/domain/services/optic/Optic.ts
Adds exported types (OpticPostureFields, OpticFields, OpticContextValue) and the Optic class: normalizes posture inputs at construction, enforces instanceof checks for target and evidence posture, validates support-rule/optic-kind compatibility, provides static factory constructors for all four optic kinds, instance derivation methods, and toContextValue() serialization.
Fluent read-chain classes refactored to carry Optic
src/domain/services/optic/WorldlineOptic.ts, src/domain/services/optic/NodeOptic.ts, src/domain/services/optic/NodePropertyOptic.ts, src/domain/services/optic/NeighborhoodOptic.ts, src/domain/services/optic/TraversalOptic.ts
WorldlineOptic stores a shared frozen _posture and calls Optic static factories for all downstream scopes. Each read-chain class replaces raw ID fields with a validated _optic, adds toOptic() accessor, and delegates reads through the optic. TraversalOptic adds traversalSupportRule() to apply bounded traversal support rules.
CheckpointTailWitnessLocator optic-driven reads and ProjectionHandle posture wiring
src/domain/services/optic/CheckpointTailWitnessLocator.ts, src/domain/services/ProjectionHandle.ts
CheckpointTailWitnessLocator public read methods updated to accept Optic, validate optic kind, extract identifiers, construct per-optic traversal readers with bounded-support enforcement via requireExecutableTraversalSupport. ProjectionHandle injects OpticCoordinatePosture.capturedCoordinate() when constructing coordinate-backed optics. Removes shared _traversalReader field.
Public API exports
index.ts
Extends the package entry point with runtime named exports for Optic and all four posture/support-rule classes, and type-only exports for all optic field/posture/context value types.
Unit tests, type-check, and export validation
test/unit/domain/services/optic/Optic.test.ts, test/unit/domain/services/optic/WorldlineOptic.test.ts, test/unit/domain/services/optic/TraversalOptic.test.ts, test/unit/domain/index.exports.test.ts, test/unit/scripts/runtime-noun-doc-graph.test.ts, test/type-check/consumer.ts, test/unit/scripts/dependency-hygiene.test.ts
Adds comprehensive unit test suites for Optic, WorldlineOptic, and TraversalOptic covering construction, frozen state, derivation, validation, and error handling. Extends type-check consumer and export tests to cover new symbols. Updates runtime-noun-doc-graph to register Optic as a transition noun. Narrows dependency-hygiene patch inventory.
Removed obsolete test files
test/unit/scripts/architecture-doc-shape.test.ts, test/unit/scripts/documentation-corpus-graph.test.ts, test/unit/scripts/public-api-cost-inventory.test.ts, test/unit/scripts/warp-doctrine-runtime-alignment.test.ts
Removes four static doc structure and alignment validation test suites no longer applicable to the reworked testing strategy.
API-0275 design doc and v18.1.0 release evidence packet
docs/design/0275-v18-reified-optics/v18-reified-optics.md, docs/releases/v18.1.0/README.md
Adds complete design documentation for reified optics (decision, contract, validation, acceptance criteria, risks, retrospective) and v18.1.0 release-evidence packet documenting gate, scope, validation, determinism, fixtures, documentation consistency, residual risks, and non-goals.
Topic documentation and runnable examples
docs/topics/optics.md, docs/topics/bounded-reads.md, docs/topics/observers.md, examples/optics.ts, examples/bounded-reads.ts, examples/observers.ts, examples/README.md, eslint.config.ts
Adds three topic documentation pages explaining bounded optic reads, causal cones, support rules, and aperture-based filtering. Adds three runnable example scripts with example README and explicit ESLint language options for the examples directory.
README rewrite and reference/release doc updates
README.md, docs/API_REFERENCE.md, docs/READINGS_AND_OPTICS.md, docs/BEARING.md, docs/ROADMAP.md, docs/VISION.md
Substantially rewrites README with updated hero/tagline, expanded "Core ideas" glossary table and Mermaid mindmap, reworked "How it works" covering determinism/CRDT/causal cones/holographic history, updated API surface and architectural moments. Updates reference docs with blank-target schema error semantics. Updates release tracking and architectural ladder for v18.1.0 release and gating.
Glossary, changelog, and conformance test updates
docs/GLOSSARY.md, CHANGELOG.md, test/conformance/v18CoordinateOpticPublicPath.test.ts
Updates Optic glossary status from target to transition with expanded description. Updates CHANGELOG.md with v18.1.0 release heading, bullets for exported Optic runtime noun and blank-target schema validation. Updates conformance test to reject blank optic targets with E_OPTIC_FAILURE_SCHEMA instead of treating as absent.
Package version bumps, config, and patch removals
package.json, jsr.json, packages/warp-adapters/package.json, packages/warp-kernel/package.json, packages/warp-orset/package.json, patches/README.md, patches/@mapbox+node-pre-gyp+2.0.3.patch
Bumps all package versions from 18.0.x to 18.1.0. Removes obsolete @mapbox/node-pre-gyp@2.0.3 patch file and its README rationale.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • git-stunts/git-warp#643: Both PRs refactor CheckpointTailWitnessLocator and optic wrappers; this PR adds reified Optic domain objects while the other extends neighborhood/traversal basis reads through those same locator service boundaries.
  • git-stunts/git-warp#660: Both PRs update the runtime noun documentation-graph test and glossary; this PR adds Optic as a transition noun while the other overhauls the contract-testing surface for exported runtime nouns.
  • git-stunts/git-warp#620: Both PRs modify test/unit/scripts/architecture-doc-shape.test.ts (the main PR deletes it entirely as obsolete, while the other PR rewrites it to validate docs/ARCHITECTURE.md structure).

Poem

🐇 Hop, hop — the Optic noun has landed at last,
No more bare node-ids bouncing round the read path so fast,
Frozen postures, support rules, evidence too,
The causal cone narrows to just what is true,
v18.1.0 ships — and the warren rejoices anew!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the primary changes: preparing a release (v18.1.0) and reifying Optic as a runtime noun.
Description check ✅ Passed The description includes a clear summary, issue references (#665, #663), comprehensive validation steps, and addresses all key aspects of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/v18.1.0-prep

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/domain/services/optic/Optic.ts (1)

239-253: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract optic-kind literals into named constants.

supportRuleMatchesTarget and isExactEntityOpticKind currently hardcode optic-kind strings; centralizing them as constants reduces typo/drift risk as the optic surface evolves.

♻️ Proposed refactor
+const NODE_OPTIC_KIND = 'node';
+const NODE_PROPERTY_OPTIC_KIND = 'node-property';
+const NEIGHBORHOOD_OPTIC_KIND = 'neighborhood';
+const TRAVERSAL_OPTIC_KIND = 'traversal';
+
 function supportRuleMatchesTarget(
   opticKind: OpticKindValue,
   supportRule: OpticSupportRule,
 ): boolean {
   if (isExactEntityOpticKind(opticKind)) {
     return supportRule.isExactEntity();
   }
-  if (opticKind === 'neighborhood') {
+  if (opticKind === NEIGHBORHOOD_OPTIC_KIND) {
     return supportRule.isNeighborhood();
   }
-  if (opticKind === 'traversal') {
+  if (opticKind === TRAVERSAL_OPTIC_KIND) {
     return isTraversalSupportRule(supportRule);
   }
   return false;
 }
 
 function isExactEntityOpticKind(opticKind: OpticKindValue): boolean {
-  return opticKind === 'node' || opticKind === 'node-property';
+  return opticKind === NODE_OPTIC_KIND || opticKind === NODE_PROPERTY_OPTIC_KIND;
 }

As per coding guidelines, "Use named constants instead of magic strings or numbers in TypeScript code."

🤖 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/Optic.ts` around lines 239 - 253, Extract the
hardcoded optic-kind string literals into named constants to reduce typo and
drift risk. In the functions supportRuleMatchesTarget and
isExactEntityOpticKind, replace the hardcoded strings 'neighborhood',
'traversal', 'node', and 'node-property' with named constants. Define these
constants at the module level or in a suitable shared location, then update both
functions to use these constants instead of the literal strings.

Source: Coding guidelines

src/domain/services/optic/WorldlineOptic.ts (1)

50-54: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use OpticSupportRule.globalDiscoveryRefused() instead of a raw string.

'global-discovery-refused' is a magic string and duplicates a protocol value that already has a domain constructor.

♻️ Proposed fix
+import OpticSupportRule from './OpticSupportRule.ts';
...
       optic: Optic.traversal({
         ...this._posture,
         startNodeId,
-        supportRule: 'global-discovery-refused',
+        supportRule: OpticSupportRule.globalDiscoveryRefused(),
       }),

As per coding guidelines, "Use named constants instead of magic strings or numbers in TypeScript code."

🤖 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/WorldlineOptic.ts` around lines 50 - 54, The
supportRule property in the optic.traversal() call within WorldlineOptic is
using a magic string 'global-discovery-refused' instead of the proper domain
constructor. Replace the string value with
OpticSupportRule.globalDiscoveryRefused() to follow the coding guidelines that
require using named constants instead of magic strings. This ensures the code
uses the domain constructor that already encapsulates this protocol value.

Source: Coding guidelines

src/domain/services/ProjectionHandle.ts (1)

142-157: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract one shared builder for captured-coordinate WorldlineOptic.

_coordinateOptic() and _coordinateExactReadOptic() now duplicate the same coordinate-source wrapping + coordinatePosture wiring. Pull that block into one private helper to prevent future drift.

As per coding guidelines, "Do not leave helper corridors, fake shape trust, or transitional duplication behind at the end of a slice. No sludge."

Also applies to: 232-239

🤖 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/ProjectionHandle.ts` around lines 142 - 157, The
_coordinateOptic() method and _coordinateExactReadOptic() method both contain
duplicate code for creating a WorldlineOptic with the same coordinate-source
wrapping pattern and coordinatePosture configuration. Extract this shared logic
into a new private helper method (for example, _createCapturedCoordinateOptic)
that takes the necessary parameters like source, checkpointSha, and frontier,
then constructs and returns the WorldlineOptic with
CoordinateCheckpointTailOpticSource and
OpticCoordinatePosture.capturedCoordinate(). Replace the duplicate blocks in
both _coordinateOptic() and _coordinateExactReadOptic() with calls to this new
helper method.

Source: Coding guidelines

🤖 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/NodeOptic.ts`:
- Around line 12-18: The NodeOptic constructor accepts any Optic without
validating that it has kind 'node', causing errors to occur later in the read()
method instead of at construction time. Add a validation check in the
constructor after assigning the optic to this._optic to verify that
options.optic has opticKind === 'node', throwing an appropriate error if this
invariant is not met (mirroring the pattern used in TraversalOptic). This
enforces validation at the constructor boundary as required by the coding
guidelines.

---

Nitpick comments:
In `@src/domain/services/optic/Optic.ts`:
- Around line 239-253: Extract the hardcoded optic-kind string literals into
named constants to reduce typo and drift risk. In the functions
supportRuleMatchesTarget and isExactEntityOpticKind, replace the hardcoded
strings 'neighborhood', 'traversal', 'node', and 'node-property' with named
constants. Define these constants at the module level or in a suitable shared
location, then update both functions to use these constants instead of the
literal strings.

In `@src/domain/services/optic/WorldlineOptic.ts`:
- Around line 50-54: The supportRule property in the optic.traversal() call
within WorldlineOptic is using a magic string 'global-discovery-refused' instead
of the proper domain constructor. Replace the string value with
OpticSupportRule.globalDiscoveryRefused() to follow the coding guidelines that
require using named constants instead of magic strings. This ensures the code
uses the domain constructor that already encapsulates this protocol value.

In `@src/domain/services/ProjectionHandle.ts`:
- Around line 142-157: The _coordinateOptic() method and
_coordinateExactReadOptic() method both contain duplicate code for creating a
WorldlineOptic with the same coordinate-source wrapping pattern and
coordinatePosture configuration. Extract this shared logic into a new private
helper method (for example, _createCapturedCoordinateOptic) that takes the
necessary parameters like source, checkpointSha, and frontier, then constructs
and returns the WorldlineOptic with CoordinateCheckpointTailOpticSource and
OpticCoordinatePosture.capturedCoordinate(). Replace the duplicate blocks in
both _coordinateOptic() and _coordinateExactReadOptic() with calls to this new
helper method.
🪄 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: 9cc53e6c-0814-48f1-ab2c-9f4a368e19e8

📥 Commits

Reviewing files that changed from the base of the PR and between 33ed62a and 8116208.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (40)
  • CHANGELOG.md
  • README.md
  • docs/GLOSSARY.md
  • docs/design/0275-v18-reified-optics/v18-reified-optics.md
  • docs/releases/v18.1.0/README.md
  • docs/topics/bounded-reads.md
  • docs/topics/observers.md
  • docs/topics/optics.md
  • eslint.config.ts
  • examples/README.md
  • examples/bounded-reads.ts
  • examples/observers.ts
  • examples/optics.ts
  • index.ts
  • jsr.json
  • package.json
  • packages/warp-adapters/package.json
  • packages/warp-kernel/package.json
  • packages/warp-orset/package.json
  • src/domain/services/ProjectionHandle.ts
  • src/domain/services/optic/CheckpointTailWitnessLocator.ts
  • src/domain/services/optic/NeighborhoodOptic.ts
  • src/domain/services/optic/NodeOptic.ts
  • src/domain/services/optic/NodePropertyOptic.ts
  • src/domain/services/optic/Optic.ts
  • src/domain/services/optic/OpticAperturePosture.ts
  • src/domain/services/optic/OpticBasisPosture.ts
  • src/domain/services/optic/OpticCoordinatePosture.ts
  • src/domain/services/optic/OpticSupportRule.ts
  • src/domain/services/optic/TraversalOptic.ts
  • src/domain/services/optic/WorldlineOptic.ts
  • test/type-check/consumer.ts
  • test/unit/domain/index.exports.test.ts
  • test/unit/domain/services/optic/Optic.test.ts
  • test/unit/domain/services/optic/TraversalOptic.test.ts
  • test/unit/domain/services/optic/WorldlineOptic.test.ts
  • test/unit/scripts/architecture-doc-shape.test.ts
  • test/unit/scripts/documentation-corpus-graph.test.ts
  • test/unit/scripts/public-api-cost-inventory.test.ts
  • test/unit/scripts/runtime-noun-doc-graph.test.ts
💤 Files with no reviewable changes (3)
  • test/unit/scripts/documentation-corpus-graph.test.ts
  • test/unit/scripts/architecture-doc-shape.test.ts
  • test/unit/scripts/public-api-cost-inventory.test.ts

Comment thread src/domain/services/optic/NodeOptic.ts
@flyingrobots

Copy link
Copy Markdown
Member Author

@codex Self-review findings for PR #666.

Pre-review gate passed: local worktree was clean (git status --porcelain empty) and git fetch origin completed before diff review. Merge target reviewed: origin/main.

Severity Evidence Infraction Mitigation prompt
Critical package.json:83, patches/@mapbox+node-pre-gyp+2.0.3.patch:1, patches/README.md:7-12; failed PR checks all stop in npm ci with Patch file found for package node-pre-gyp which is not present at node_modules/@mapbox/node-pre-gyp. package-lock.json no longer contains @mapbox/node-pre-gyp. Release-blocking CI/install failure from a stale patch-package entry. The branch cannot be merged while GitHub runners cannot install dependencies. Remove patches/@mapbox+node-pre-gyp+2.0.3.patch and the corresponding patches/README.md section, unless the dependency is intentionally restored. Then rerun npm ci, npm run lint, npm run typecheck, npm run typecheck:consumer, and npm run test:local; push to refresh PR checks.
High examples/observers.ts:10, examples/optics.ts:10 New TypeScript examples introduce Promise<unknown>, violating the repo's anti-sludge rule banning unknown outside adapter-owned boundary parsing. These are new runnable examples, not quarantined legacy code. Replace Promise<unknown> with concrete public return types or remove the explicit return annotations so TypeScript infers the actual API result types. Do not introduce unknown, any, or cast-based aliases in the examples.
Medium src/domain/services/optic/CheckpointTailWitnessLocator.ts:112-120, src/domain/services/optic/CheckpointTailWitnessLocator.ts:202-206, src/domain/services/optic/TraversalOptic.ts:37-42, src/domain/services/optic/TraversalOptic.ts:69-77, src/domain/services/optic/Optic.ts:245-259 Traversal execution still derives boundedness from raw read options rather than enforcing the reified Optic support-rule posture. A direct caller can supply a traversal Optic whose support rule is global-discovery-refused and still execute by passing bounded options. That weakens the stated goal that Optic owns support semantics. Make traversal support posture execution-authoritative. At minimum, reject global-discovery-refused optics before traversal execution when bounded traversal is requested and add mismatch tests. Prefer a runtime-backed traversal-window noun carrying the actual bounds so Optic owns both the support posture and the concrete support window.
Low docs/releases/v18.1.0/README.md:71-72, docs/releases/v18.1.0/README.md:199-202; current GitHub issue state: #665 closed at 2026-06-23T21:46:37Z. Release evidence still says #665 remains open/release-tracking and asks for future closeout evidence, which is now stale relative to the tracker state. Update the release evidence to reflect the current split truth: #665 is closed as the Optic reification tracker, PR #666 is the unmerged implementation/release-prep vehicle, and final tag evidence still needs merge/guard/preflight results.
Low README.md:101-102 Markdown readability/style: the closing </details> is immediately followed by ### Bounded reads in practice with no blank line separating the HTML block from the next heading. Markdownlint allows it, but rendered-source readability is worse than the surrounding document style. Insert a blank line after </details> before the next heading.

Issue count: Critical 1, High 1, Medium 1, Low 2.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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 `@test/unit/domain/services/optic/TraversalOptic.test.ts`:
- Around line 49-53: In the TraversalOptic.test.ts test assertion block that
validates the error with code 'E_OPTIC_SCHEMA', the test is currently asserting
against context.cause but the actual rejection path emits context.reason
instead. Update the assertion to check context.reason with the value
'requires-global-scan' to match the actual error contract being emitted by the
traversal-support rejection path.
🪄 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: 7a1f3bcb-1751-4762-b8df-ec9dc05f98f0

📥 Commits

Reviewing files that changed from the base of the PR and between 8116208 and 9c67b4c.

📒 Files selected for processing (9)
  • README.md
  • docs/releases/v18.1.0/README.md
  • examples/observers.ts
  • examples/optics.ts
  • patches/@mapbox+node-pre-gyp+2.0.3.patch
  • patches/README.md
  • src/domain/services/optic/CheckpointTailWitnessLocator.ts
  • test/unit/domain/services/optic/TraversalOptic.test.ts
  • test/unit/scripts/dependency-hygiene.test.ts
💤 Files with no reviewable changes (3)
  • patches/README.md
  • test/unit/scripts/dependency-hygiene.test.ts
  • patches/@mapbox+node-pre-gyp+2.0.3.patch
✅ Files skipped from review due to trivial changes (1)
  • docs/releases/v18.1.0/README.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • examples/observers.ts
  • src/domain/services/optic/CheckpointTailWitnessLocator.ts
  • README.md

Comment thread test/unit/domain/services/optic/TraversalOptic.test.ts
@flyingrobots

Copy link
Copy Markdown
Member Author

@codex Code Lawyer self-audit additions after thread-aware review.

Severity Source Evidence Issue Required mitigation
P2 Self src/domain/services/optic/NodePropertyOptic.ts:9-15, src/domain/services/optic/NeighborhoodOptic.ts:17-23 Constructor-boundary validation gap mirrors the unresolved NodeOptic thread: these fluent scope wrappers accept any Optic and defer kind mismatch to read execution. Add constructor-time instanceof Optic and exact opticKind validation for node-property and neighborhood scopes, with deterministic regression coverage.
P4 Self src/domain/services/optic/NodeOptic.ts:43-46 NodeOptic.traverse() still uses raw 'global-discovery-refused' instead of the existing OpticSupportRule constructor. Replace raw support-rule strings in source optic construction paths with OpticSupportRule.globalDiscoveryRefused() and verify no source construction path keeps the literal.

These are added to the same fix queue as the unresolved CodeRabbit thread and global review findings.

@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 18.1.0
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If you tag this commit as v18.1.0, release workflow will publish.

@flyingrobots

Copy link
Copy Markdown
Member Author

@codex Activity Summary — Code Lawyer pass on PR #666.

# Severity Source File(s) Commit Outcome
1 P2 PR + Self src/domain/services/optic/NodeOptic.ts, NodePropertyOptic.ts, NeighborhoodOptic.ts, test/unit/domain/services/optic/WorldlineOptic.test.ts 4a2ecc66 Added constructor-time Optic kind validation for node, node-property, and neighborhood scope wrappers; added regression coverage; resolved inline thread.
2 P4 PR global + Self src/domain/services/optic/NodeOptic.ts, WorldlineOptic.ts 3dfd28cb Replaced raw traversal support-rule strings with OpticSupportRule.globalDiscoveryRefused().
3 P5 PR global src/domain/services/optic/Optic.ts bb7fd24e Extracted typed optic-kind constants for support-rule matching.
4 P5 PR global src/domain/services/ProjectionHandle.ts 24040f4c Extracted shared captured-coordinate WorldlineOptic builder and removed duplicate coordinate-source wrapping.
5 P3 PR test/unit/domain/services/optic/TraversalOptic.test.ts ddb2b170 Narrowed traversal rejection assertion to the emitted context.reason contract; resolved inline thread.

Validation run locally after fixes:

  • npm run lint
  • npm run typecheck
  • npm run typecheck:consumer
  • npm run test:local
  • npm run release:guard -- --tag v18.1.0 --stage prep-pr
  • Pre-push IRONCLAD M9: link check, static gates, surface check, markdown gates, and stable unit shards all passed.

Thread state after this pass: all fetched review threads resolved.

@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 18.1.0
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If you tag this commit as v18.1.0, release workflow will publish.

@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 18.1.0
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If you tag this commit as v18.1.0, release workflow will publish.

@flyingrobots

Copy link
Copy Markdown
Member Author

@codex Code Lawyer self-audit found one additional fix before merge.

Severity Source File Lines Issue Required mitigation
P4 Self test/unit/domain/services/optic/TraversalOptic.test.ts 57-59 Test helper constructs a fake CheckpointTailWitnessLocator with a TypeScript as assertion. The repo doctrine rejects cast-based shape trust, and this helper can use a real locator with the existing test source instead. Replace the casted Object.create(...) as CheckpointTailWitnessLocator helper with construction of a real CheckpointTailWitnessLocator from TestCheckpointTailOpticSource, then rerun the focused optic tests and local gates.

@flyingrobots

Copy link
Copy Markdown
Member Author

@codex Activity Summary — Code Lawyer follow-up pass on PR #666.

# Severity Source File(s) Commit Outcome
1 P4 Self test/unit/domain/services/optic/TraversalOptic.test.ts 0044795f Replaced cast-based fake CheckpointTailWitnessLocator test helper with a real runtime locator backed by TestCheckpointTailOpticSource.

Validation run locally after the fix:

  • npx vitest run test/unit/domain/services/optic/TraversalOptic.test.ts
  • npm run lint
  • npm run typecheck
  • npm run release:guard -- --tag v18.1.0 --stage prep-pr
  • npm run test:coverage:ci
  • Pre-push IRONCLAD M9: link check, static gates, markdown gates, surface check, policy gates, and stable unit shards all passed.

Thread state before push: all fetched review threads resolved. Awaiting GitHub CI and CodeRabbit on 0044795f.

@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 18.1.0
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If you tag this commit as v18.1.0, release workflow will publish.

@flyingrobots
flyingrobots merged commit 414efac into main Jun 24, 2026
18 checks passed
@flyingrobots
flyingrobots deleted the release/v18.1.0-prep branch June 24, 2026 03:48
@coderabbitai coderabbitai Bot mentioned this pull request Jul 13, 2026
4 tasks
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.

1 participant