Add openWarp timeline facade#728
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR adds the v19 ChangesWarp/Timeline facade
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant openWarp
participant Warp
participant openWarpWorldline
participant createTimeline
participant Timeline
Caller->>openWarp: openWarp({ storage, writer })
openWarp->>Warp: new Warp(writer, openTimeline)
Caller->>Warp: warp.timeline('events')
Warp->>openWarpWorldline: open(storage, writer, 'events')
openWarpWorldline-->>Warp: WarpWorldline
Warp->>createTimeline: createTimeline(runtime)
createTimeline->>Timeline: new Timeline(worldlineName, writerId)
createTimeline-->>Caller: Timeline
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
Release Preflight
If this PR is from a |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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/api/openWarp.ts`:
- Around line 15-29: openWarp() currently validates options before creating the
promise, so invalid input throws synchronously instead of returning a rejected
Promise<Warp>. Update openWarp() to run assertOpenWarpOptions() inside the
async/promise path—either make openWarp() async or wrap the validation and Warp
construction in the promise chain—so bad options are rejected consistently. Use
the openWarp() and assertOpenWarpOptions() symbols to keep the fix localized.
In `@src/domain/api/Timeline.ts`:
- Around line 36-44: `assertTimelineIdentity` duplicates the same empty-string
validation already implemented by `assertNonEmpty` in `Warp.ts`; consolidate
both into one shared identity validator so the logic stays in sync. Extract the
shared check into a reusable helper (for example, a parameterized
`assertIdentity`/similar function), then update `Timeline.ts` and `Warp.ts` to
call it with their respective message/code values while preserving the existing
`WarpError` context shape.
In `@src/domain/api/Warp.ts`:
- Around line 38-46: The shared non-empty identity check currently lives in the
Warp.ts module alongside the Warp class, but it should be extracted into a
dedicated validator module and reused by both Warp.ts and Timeline.ts. Move
assertNonEmpty into a shared helper (for example, assertIdentity.ts), update
openWarp.ts and the Timeline.ts identity validation to import and use that
helper, and remove the duplicate private assertTimelineIdentity logic so the
identity validation is centralized.
In `@test/unit/domain/WarpFacade.test.ts`:
- Around line 1-73: Add a regression test to verify the v19 root export surface
does not include openWarpWorldline. In WarpFacade.test.ts, extend the existing
facade/export coverage by importing the root module via index.ts and asserting
that openWarpWorldline is not present on that module object, alongside the
current openWarp, Warp, and Timeline checks. This keeps the public facade
contract locked down and protects the explicit root-export restriction.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 354b0504-97b1-44a6-8263-d579f91e3261
📒 Files selected for processing (11)
CHANGELOG.mdbrowser.tsdocs/topics/reference.mdindex.tssrc/domain/api/Timeline.tssrc/domain/api/TimelineRuntime.tssrc/domain/api/Warp.tssrc/domain/api/openWarp.tstest/type-check/tsconfig.jsontest/type-check/v19-consumer.tstest/unit/domain/WarpFacade.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
- GitHub Check: coverage-threshold
- GitHub Check: test-node (22)
- GitHub Check: preflight
🧰 Additional context used
📓 Path-based instructions (4)
src/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,tsx,js,jsx}: Do not introduceany,as any,as unknown as,unknown(outside adapters),Record<string, unknown>(outside adapters),*Likeplaceholder types,JSON.parse/JSON.stringify(outside adapters),fetch(outside adapters),process.env(outside adapters),@ts-ignore, orz.any()in core code; use validated boundary models and ports instead.
Use constructor-injected ports for external capabilities; do not rely on ambient dependencies for I/O, clocks, persistence, or entropy.
Do not createutils.ts,helpers.ts,misc.ts, orcommon.ts; name files after the actual concept they model.
Prefer one file per class, type, or object; if a file accumulates peer concepts, split it.
Keep helper corridors, fake shape trust, transitional duplication, and compile-time theater out of the codebase; runtime-honest TypeScript must reflect actual behavior.
No enum usage; prefer runtime-backed domain forms and unions.
Do not use boolean trap parameters; prefer named option objects or separate methods.
Avoid magic strings or numbers when a named constant should exist.
Keep domain bytes asUint8Array;Bufferbelongs in infrastructure adapters.
Files:
src/domain/api/Timeline.tssrc/domain/api/Warp.tssrc/domain/api/openWarp.tssrc/domain/api/TimelineRuntime.ts
src/domain/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/domain/**/*.{ts,tsx,js,jsx}: Insrc/domain/**, do not useDate.now(),new Date(),Date(),performance.now(),Math.random(),crypto.randomUUID(),crypto.getRandomValues(),setTimeout,setInterval, rawnew Error(...)/new TypeError(...), or direct imports from Node built-ins; time, entropy, and external capabilities must enter through ports or parameters, and domain errors should extendWarpError.
Construct domain objects only in core when doing so establishes validated runtime truth; do not build infrastructure adapters, host APIs, persistence implementations, wall clocks, or entropy sources inside core.
Prefer discriminated unions and explicit result types instead of boolean-flag bags, and model expected failures as return values rather than exceptions.
src/domain/must not import host APIs or Node-specific globals; hexagonal architecture boundaries are mandatory.
Domain code must not use the wall clock directly; time must enter through a port or parameter.
Files:
src/domain/api/Timeline.tssrc/domain/api/Warp.tssrc/domain/api/openWarp.tssrc/domain/api/TimelineRuntime.ts
src/domain/**/!(*.test).{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use explicit domain concepts with validated constructors,
Object.freeze, andinstanceofdispatch; domain objects should be runtime-backed nouns, not ad hoc shape bags.
Files:
src/domain/api/Timeline.tssrc/domain/api/Warp.tssrc/domain/api/openWarp.tssrc/domain/api/TimelineRuntime.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: Do not use direct imports fromsrc/infrastructure/**insrc/domain/**orsrc/ports/**; depend on a port instead.
Do not use direct Node built-ins insrc/domain/**orsrc/ports/**; use a port instead.
Files:
src/domain/api/Timeline.tsindex.tsbrowser.tstest/type-check/v19-consumer.tssrc/domain/api/Warp.tssrc/domain/api/openWarp.tssrc/domain/api/TimelineRuntime.tstest/unit/domain/WarpFacade.test.ts
🧠 Learnings (1)
📚 Learning: 2026-03-08T19:50:17.519Z
Learnt from: flyingrobots
Repo: git-stunts/git-warp PR: 65
File: CHANGELOG.md:88-88
Timestamp: 2026-03-08T19:50:17.519Z
Learning: Follow the Keep a Changelog convention for CHANGELOG.md. Allow duplicate subheadings across versions (e.g., '### Added', '### Fixed'). Configure markdownlint MD024 with {"siblings_only": true} to avoid cross-version false positives.
Applied to files:
CHANGELOG.md
🔇 Additional comments (10)
index.ts (1)
18-22: LGTM!browser.ts (1)
25-29: LGTM!docs/topics/reference.md (1)
33-118: LGTM!CHANGELOG.md (1)
12-13: LGTM!test/type-check/tsconfig.json (1)
11-11: LGTM!test/type-check/v19-consumer.ts (1)
1-40: LGTM!src/domain/api/Timeline.ts (1)
15-34: LGTM!src/domain/api/TimelineRuntime.ts (1)
1-22: LGTM!src/domain/api/Warp.ts (1)
17-36: LGTM!src/domain/api/openWarp.ts (1)
31-39: LGTM!
|
@codex second opinion requested. Phase I self-audit found one additional issue beyond the existing CodeRabbit threads:
|
|
@codex second opinion requested. Follow-up self-audit during validation found one additional patch-local issue:
|
Activity Summary
Validation:
Resolved review threads: 4/4. Console SitRep: patch-local findings are closed and pushed; CI/CodeRabbit should now rerun on |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/api/Warp.ts`:
- Around line 24-27: The identity failure payload is duplicated across Warp
validation calls, so extract the repeated message/code pair into a shared
constant and reuse it everywhere. Update the `assertIdentity` calls in `Warp`
(constructor and `timeline`) and in `assertOpenWarpOptions` in `openWarp.ts` to
reference that constant instead of inline literals, keeping the failure text and
code consistent in one place.
In `@test/unit/domain/WarpFacade.test.ts`:
- Around line 11-13: The current WarpFacade test relies on readRepoSource and
raw toContain/not.toContain string matching, which is brittle and tied to file
text rather than the centralized-validation invariant. Replace those source-text
assertions with a behavior- or structure-based check in WarpFacade.test.ts,
using the relevant Warp and Timeline module imports or a lint/AST-based
assertion to verify no duplicate validator is exported instead of grepping
repository source.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 861df14b-cb37-45e8-8057-431a9c626492
📒 Files selected for processing (5)
src/domain/api/Timeline.tssrc/domain/api/Warp.tssrc/domain/api/assertIdentity.tssrc/domain/api/openWarp.tstest/unit/domain/WarpFacade.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: coverage-threshold
- GitHub Check: type-firewall-lint
- GitHub Check: test-node (22)
- GitHub Check: preflight
🧰 Additional context used
📓 Path-based instructions (4)
src/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,tsx,js,jsx}: Do not introduceany,as any,as unknown as,unknown(outside adapters),Record<string, unknown>(outside adapters),*Likeplaceholder types,JSON.parse/JSON.stringify(outside adapters),fetch(outside adapters),process.env(outside adapters),@ts-ignore, orz.any()in core code; use validated boundary models and ports instead.
Use constructor-injected ports for external capabilities; do not rely on ambient dependencies for I/O, clocks, persistence, or entropy.
Do not createutils.ts,helpers.ts,misc.ts, orcommon.ts; name files after the actual concept they model.
Prefer one file per class, type, or object; if a file accumulates peer concepts, split it.
Keep helper corridors, fake shape trust, transitional duplication, and compile-time theater out of the codebase; runtime-honest TypeScript must reflect actual behavior.
No enum usage; prefer runtime-backed domain forms and unions.
Do not use boolean trap parameters; prefer named option objects or separate methods.
Avoid magic strings or numbers when a named constant should exist.
Keep domain bytes asUint8Array;Bufferbelongs in infrastructure adapters.
Files:
src/domain/api/assertIdentity.tssrc/domain/api/openWarp.tssrc/domain/api/Timeline.tssrc/domain/api/Warp.ts
src/domain/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/domain/**/*.{ts,tsx,js,jsx}: Insrc/domain/**, do not useDate.now(),new Date(),Date(),performance.now(),Math.random(),crypto.randomUUID(),crypto.getRandomValues(),setTimeout,setInterval, rawnew Error(...)/new TypeError(...), or direct imports from Node built-ins; time, entropy, and external capabilities must enter through ports or parameters, and domain errors should extendWarpError.
Construct domain objects only in core when doing so establishes validated runtime truth; do not build infrastructure adapters, host APIs, persistence implementations, wall clocks, or entropy sources inside core.
Prefer discriminated unions and explicit result types instead of boolean-flag bags, and model expected failures as return values rather than exceptions.
src/domain/must not import host APIs or Node-specific globals; hexagonal architecture boundaries are mandatory.
Domain code must not use the wall clock directly; time must enter through a port or parameter.
Files:
src/domain/api/assertIdentity.tssrc/domain/api/openWarp.tssrc/domain/api/Timeline.tssrc/domain/api/Warp.ts
src/domain/**/!(*.test).{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use explicit domain concepts with validated constructors,
Object.freeze, andinstanceofdispatch; domain objects should be runtime-backed nouns, not ad hoc shape bags.
Files:
src/domain/api/assertIdentity.tssrc/domain/api/openWarp.tssrc/domain/api/Timeline.tssrc/domain/api/Warp.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: Do not use direct imports fromsrc/infrastructure/**insrc/domain/**orsrc/ports/**; depend on a port instead.
Do not use direct Node built-ins insrc/domain/**orsrc/ports/**; use a port instead.
Files:
src/domain/api/assertIdentity.tstest/unit/domain/WarpFacade.test.tssrc/domain/api/openWarp.tssrc/domain/api/Timeline.tssrc/domain/api/Warp.ts
🔇 Additional comments (10)
test/unit/domain/WarpFacade.test.ts (2)
59-63: Regression test added as requested.This addresses the previously requested coverage confirming
openWarpWorldlineis not a root export.
1-14: LGTM!Also applies to: 15-58, 65-83, 95-110
src/domain/api/openWarp.ts (3)
34-45: Validation logic is correct. Note: theE_OPEN_WARP_IDENTITYfailure literal here duplicates the same pair used twice inWarp.ts— see the consolidation suggestion raised there rather than repeating it here.
1-14: LGTM!
16-32: LGTM! This resolves the previously flagged issue whereopenWarp()threw synchronously instead of rejecting the returned promise — validation now runs inside thePromise.resolve().then()callback.src/domain/api/assertIdentity.ts (1)
1-16: LGTM!src/domain/api/Timeline.ts (2)
16-42: LGTM! The prior duplicate identity-validation logic flagged againstassertTimelineIdentityis now resolved via the sharedassertIdentityhelper.
44-51: LGTM!src/domain/api/Warp.ts (2)
22-31: LGTM overall — the prior "extract shared validator" concern is resolved viaassertIdentity. One residual DRY gap remains: see refactor suggestion below.Also applies to: 37-43
46-53: LGTM!
Release Preflight
If this PR is from a |
|
@codex please confirm this self-review finding.
Agent prompt: Verify that the browser-root export assertion does not mutate shared |
|
Resolved the self-review finding from #728 (comment).
Verification:
|
There was a problem hiding this comment.
♻️ Duplicate comments (2)
test/unit/domain/WarpFacade.test.ts (2)
82-90: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffBrittle source-string assertions for centralized validation, previously flagged.
Same concern as raised earlier in this review thread: relying on
readRepoSource+toContain/not.toContainon raw file text to prove "no duplicate validator" will break on harmless refactors (reformatting, renaming, moving functions) without verifying the actual invariant. Prefer a behavior-based check (e.g., importWarp/Timelinemodules and assert they don't export a validator function) or an AST/lint-based rule.🤖 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 `@test/unit/domain/WarpFacade.test.ts` around lines 82 - 90, The test in WarpFacade.test.ts is using brittle raw source-string checks via readRepoSource and toContain/not.toContain to enforce validator placement, so refactors can break it without changing behavior. Replace this with a behavior-based assertion by importing the Warp and Timeline modules directly and checking their exports, or use an AST/lint-style check, while still verifying that assertIdentity remains exposed only from assertIdentity and not from Warp or Timeline.
33-39: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffSame source-grep brittleness as previously flagged, now also here.
Asserting the browser-root boundary via raw
toContain/not.toContainstring checks onbrowser.ts's source ties the test to file formatting rather than the actual export surface. A harmless reformat or reordering of the export statement (e.g., splitting across lines, changing quote style) would silently pass despite verifying nothing real, or could false-fail on a valid refactor.Since the dynamic-import approach was intentionally dropped to avoid mutating shared runtime state, consider asserting against a parsed AST of
browser.ts(e.g., via TypeScript's compiler API) instead of raw substring matching, to keep the check both safe and resilient to formatting changes.🤖 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 `@test/unit/domain/WarpFacade.test.ts` around lines 33 - 39, The browser-root boundary test in WarpFacade.test.ts is relying on brittle raw source substring checks against browser.ts instead of the actual export surface. Update the test to inspect a parsed AST for browser.ts, using a TypeScript compiler API-based helper or equivalent, and assert that the relevant exports (openWarp, Warp, Timeline, OpenWarpOptions, WarpStorage) are absent from the browser entrypoint regardless of formatting or line wrapping. Keep the existing readRepoSource/browser.ts lookup but replace the toContain/not.toContain assertions with symbol-aware export detection.
🤖 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.
Duplicate comments:
In `@test/unit/domain/WarpFacade.test.ts`:
- Around line 82-90: The test in WarpFacade.test.ts is using brittle raw
source-string checks via readRepoSource and toContain/not.toContain to enforce
validator placement, so refactors can break it without changing behavior.
Replace this with a behavior-based assertion by importing the Warp and Timeline
modules directly and checking their exports, or use an AST/lint-style check,
while still verifying that assertIdentity remains exposed only from
assertIdentity and not from Warp or Timeline.
- Around line 33-39: The browser-root boundary test in WarpFacade.test.ts is
relying on brittle raw source substring checks against browser.ts instead of the
actual export surface. Update the test to inspect a parsed AST for browser.ts,
using a TypeScript compiler API-based helper or equivalent, and assert that the
relevant exports (openWarp, Warp, Timeline, OpenWarpOptions, WarpStorage) are
absent from the browser entrypoint regardless of formatting or line wrapping.
Keep the existing readRepoSource/browser.ts lookup but replace the
toContain/not.toContain assertions with symbol-aware export detection.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3c67b533-5a8d-47b2-abbd-70b677c0c001
📒 Files selected for processing (2)
CHANGELOG.mdtest/unit/domain/WarpFacade.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
- GitHub Check: preflight
- GitHub Check: test-node (22)
- GitHub Check: coverage-threshold
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: Do not use direct imports fromsrc/infrastructure/**insrc/domain/**orsrc/ports/**; depend on a port instead.
Do not use direct Node built-ins insrc/domain/**orsrc/ports/**; use a port instead.
Files:
test/unit/domain/WarpFacade.test.ts
🧠 Learnings (1)
📚 Learning: 2026-03-08T19:50:17.519Z
Learnt from: flyingrobots
Repo: git-stunts/git-warp PR: 65
File: CHANGELOG.md:88-88
Timestamp: 2026-03-08T19:50:17.519Z
Learning: Follow the Keep a Changelog convention for CHANGELOG.md. Allow duplicate subheadings across versions (e.g., '### Added', '### Fixed'). Configure markdownlint MD024 with {"siblings_only": true} to avoid cross-version false positives.
Applied to files:
CHANGELOG.md
🔇 Additional comments (6)
test/unit/domain/WarpFacade.test.ts (5)
56-60: Regression test foropenWarpWorldlineabsence from root exports, as previously requested, is now present and correctly implemented.
1-31: LGTM!
42-54: LGTM!
62-80: LGTM!
92-107: LGTM!CHANGELOG.md (1)
12-18: LGTM!
Release Preflight
If this PR is from a |
Code Lawyer Activity Summary
Resolved review threads by GraphQL:
Verification:
Self-audit: no additional self-discovered issues beyond the two unresolved PR review threads. |
There was a problem hiding this comment.
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/WarpFacade.test.ts`:
- Around line 32-72: The current check only collects exported names, so it can
miss reintroduced private duplicates like assertTimelineIdentity or
assertNonEmpty. Update the AST scanning in
exportedNamesFor/collectExportedDeclarationName to also inspect all top-level
declarations via the broader allDeclaredNamesFor-style walk, and include
non-exported function/variable declarations when matching the banned
identifiers. Keep the existing export-based logic, but add a parallel pass that
flags those private names even when they are not exported.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 10a0e0d5-d373-412d-b036-a364b65a4c1f
📒 Files selected for processing (4)
src/domain/api/OpenWarpIdentityFailure.tssrc/domain/api/Warp.tssrc/domain/api/openWarp.tstest/unit/domain/WarpFacade.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
- GitHub Check: coverage-threshold
- GitHub Check: test-node (22)
- GitHub Check: preflight
🧰 Additional context used
📓 Path-based instructions (4)
src/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.{ts,tsx,js,jsx}: Do not introduceany,as any,as unknown as,unknown(outside adapters),Record<string, unknown>(outside adapters),*Likeplaceholder types,JSON.parse/JSON.stringify(outside adapters),fetch(outside adapters),process.env(outside adapters),@ts-ignore, orz.any()in core code; use validated boundary models and ports instead.
Use constructor-injected ports for external capabilities; do not rely on ambient dependencies for I/O, clocks, persistence, or entropy.
Do not createutils.ts,helpers.ts,misc.ts, orcommon.ts; name files after the actual concept they model.
Prefer one file per class, type, or object; if a file accumulates peer concepts, split it.
Keep helper corridors, fake shape trust, transitional duplication, and compile-time theater out of the codebase; runtime-honest TypeScript must reflect actual behavior.
No enum usage; prefer runtime-backed domain forms and unions.
Do not use boolean trap parameters; prefer named option objects or separate methods.
Avoid magic strings or numbers when a named constant should exist.
Keep domain bytes asUint8Array;Bufferbelongs in infrastructure adapters.
Files:
src/domain/api/OpenWarpIdentityFailure.tssrc/domain/api/openWarp.tssrc/domain/api/Warp.ts
src/domain/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
src/domain/**/*.{ts,tsx,js,jsx}: Insrc/domain/**, do not useDate.now(),new Date(),Date(),performance.now(),Math.random(),crypto.randomUUID(),crypto.getRandomValues(),setTimeout,setInterval, rawnew Error(...)/new TypeError(...), or direct imports from Node built-ins; time, entropy, and external capabilities must enter through ports or parameters, and domain errors should extendWarpError.
Construct domain objects only in core when doing so establishes validated runtime truth; do not build infrastructure adapters, host APIs, persistence implementations, wall clocks, or entropy sources inside core.
Prefer discriminated unions and explicit result types instead of boolean-flag bags, and model expected failures as return values rather than exceptions.
src/domain/must not import host APIs or Node-specific globals; hexagonal architecture boundaries are mandatory.
Domain code must not use the wall clock directly; time must enter through a port or parameter.
Files:
src/domain/api/OpenWarpIdentityFailure.tssrc/domain/api/openWarp.tssrc/domain/api/Warp.ts
src/domain/**/!(*.test).{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use explicit domain concepts with validated constructors,
Object.freeze, andinstanceofdispatch; domain objects should be runtime-backed nouns, not ad hoc shape bags.
Files:
src/domain/api/OpenWarpIdentityFailure.tssrc/domain/api/openWarp.tssrc/domain/api/Warp.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: Do not use direct imports fromsrc/infrastructure/**insrc/domain/**orsrc/ports/**; depend on a port instead.
Do not use direct Node built-ins insrc/domain/**orsrc/ports/**; use a port instead.
Files:
src/domain/api/OpenWarpIdentityFailure.tssrc/domain/api/openWarp.tssrc/domain/api/Warp.tstest/unit/domain/WarpFacade.test.ts
🔇 Additional comments (4)
src/domain/api/OpenWarpIdentityFailure.ts (1)
1-4: LGTM! Centralizes the previously duplicated identity-failure payload as requested in prior review feedback.src/domain/api/Warp.ts (1)
1-39: LGTM! Resolves the prior duplicate-validator and duplicated-failure-literal review comments; identity validation is now centralized viaassertIdentity+OPEN_WARP_IDENTITY_FAILURE, andtimeline()correctly surfaces validation failures as promise rejections.Also applies to: 41-48
src/domain/api/openWarp.ts (1)
1-9: LGTM!Promise.resolve().then(...)wrapping correctly defersassertOpenWarpOptionsvalidation into the promise path (resolving the prior sync-throw issue), andOPEN_WARP_IDENTITY_FAILUREreuse removes the previously duplicated failure literal.Also applies to: 10-15, 17-33, 35-43
test/unit/domain/WarpFacade.test.ts (1)
74-147: LGTM! Behavioral coverage foropenWarp/Warp/Timeline(facade instantiation, freezing, hidden internals, root/browser export parity, validation error messages, and theOPEN_WARP_IDENTITY_FAILUREpayload) matches the implementation and prior review resolutions.
Release Preflight
If this PR is from a |
|
Resolved the remaining CodeRabbit thread at
Verification:
|
Release Preflight
If this PR is from a |
|
@codex self-review confirmation requested. Code Lawyer Self-Review Findings
Mitigation prompt for an implementation agent: |
Release Preflight
If this PR is from a |
Code Lawyer Activity Summary
Verification:
Self-audit after the fix: no additional Code Lawyer findings. Merge gate remains locked on human approvals: current latest-review count is 0 approvals, 0 changes requested. |
Summary
openWarp({ storage, writer })product opener.WarpandTimelinefacade handles to root and browser entrypoints.Fixes #722
Validation
npx vitest run test/unit/domain/WarpFacade.test.tsnpm run typecheck:srcnpm run typecheck:testnpm run typecheck:consumernpm run typecheck:surfacenpm run lint -- --quietnpm run lint:source-backed-referencenpm run lint:docs-topologynpm run test:localIRONCLAD M9gates passed