Seal Git substrate out of v19 receipts and evidence - #745
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 1 minute Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe v19 API replaces direct receipt substrate identifiers with opaque evidence handles, threads runtime context through receipt-producing operations, and adds storage-aware provenance diagnostics. Public exports, documentation, declaration checks, and tests are updated for the new contracts. ChangesReceipt evidence and provenance
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant Timeline
participant RuntimeContext
participant Receipt
participant Diagnostics
participant Storage
Timeline->>RuntimeContext: create evidence and bind provenance
RuntimeContext->>Receipt: store opaque evidence
Diagnostics->>Storage: resolve provenance for receipt
Storage-->>Diagnostics: return substrate provenance
Diagnostics-->>Timeline: return inspection details
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
Self-review at
|
Code Lawyer review at
|
Release Preflight
If this PR is from a |
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
index.ts (1)
6-10: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winModule doc comment is stale relative to the new root
Evidenceexport.The header says formal read, evidence, and support machinery lives under
@git-stunts/git-warp/advanced, but line 21 now exportsEvidence/EvidenceHandledirectly from root. This contradicts the doc's stated boundary and could confuse consumers about where opaque evidence types live. Update the comment to reflect thatEvidence/EvidenceHandleare first-use root types, reservingadvancedforOptic/Witness/coordinate capture only.📝 Proposed doc fix
- * Storage adapters live under `@git-stunts/git-warp/storage`; formal read, - * evidence, and support machinery lives under `@git-stunts/git-warp/advanced`; - * operator inspection tools live under `@git-stunts/git-warp/diagnostics`. + * Storage adapters live under `@git-stunts/git-warp/storage`; formal optic, + * coordinate, and witness machinery lives under `@git-stunts/git-warp/advanced`; + * operator inspection tools live under `@git-stunts/git-warp/diagnostics`.Also applies to: 21-21
🤖 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 `@index.ts` around lines 6 - 10, Update the module header comment near the root exports to state that Evidence and EvidenceHandle are first-use types exported from the root package, and limit the advanced package description to Optic, Witness, and coordinate-capture machinery. Keep the existing storage and diagnostics boundaries unchanged.src/domain/api/DraftTimelineRuntime.ts (1)
117-187: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick winTOCTOU race in
joinDraftTimeline
await rejectedJoinPrecondition(...)yields beforestate.joining = true, so two back-to-back calls can both pass the guard and commit the same intents. Split the synchronous guard check from async rejection receipt creation so the in-progress flag is set before any await.🤖 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/api/DraftTimelineRuntime.ts` around lines 117 - 187, The asynchronous rejectedJoinPrecondition check in joinDraftTimeline allows concurrent calls to pass before state.joining is set. Split the synchronous state validation from rejectedJoin receipt creation, set state.joining before the first await, and preserve the existing rejection reasons and results for joined, joining, failed, and empty-intent states.src/domain/api/WriteRuntime.ts (1)
36-73: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftPost-commit receipt creation can still fail the write.
commit()completes beforecreateWriteEvidence()andcontext.bindReceipt(), so a failure there leaves the patch applied but reports a write error instead of a receipt. Split receipt binding from the commit path or add a recovery path for the already-committed write.🤖 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/api/WriteRuntime.ts` around lines 36 - 73, Update executeIntentWrite and acceptedWriteReceipt so failures during post-commit evidence creation or receipt binding cannot report the already-applied write as failed. Separate commit completion from receipt construction/binding, or add recovery that returns a valid receipt for the committed patch while preserving operational failure handling for errors occurring before commit.
🤖 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 `@scripts/v19-root-declaration-gate.ts`:
- Around line 5-20: Update the compound-vocabulary validation in the root
declaration gate to inspect each adjacent token pair rather than only
tokens.join(''). Use FORBIDDEN_COMPOUNDS for every pair, so identifiers such as
rootObjectId, sourceObjectIds, and readObjectIdHex are rejected while preserving
the existing FORBIDDEN_TOKENS checks.
In `@src/application/ReceiptProvenanceRegistry.ts`:
- Around line 20-23: Update createOpaqueId to replace JSON.stringify with
delimiter-based serialization of the namespace and parts, using the existing
parts type of readonly (string | number)[] and preserving the current hash input
semantics without introducing JSON APIs in application code.
In `@src/domain/api/Evidence.ts`:
- Around line 9-15: Update the default export for the Evidence type in
Evidence.ts to use a type-only default re-export, replacing the value-style
export while preserving the existing Evidence type definition and default import
contract.
In `@src/domain/api/EvidenceRuntime.ts`:
- Around line 77-83: Extract undefined handling into a shared
freezeOptionalEvidence helper alongside freezeEvidence, delegating defined
values to freezeEvidence. Update the constructors in
src/domain/api/JoinReceipt.ts:37-60, src/domain/api/ReadReceipt.ts:34-59, and
src/domain/api/WriteReceipt.ts:30-55 to use the helper with their existing field
names, replacing each inline ternary.
- Around line 16-97: Define shared named constants for the opaque-id namespaces
used by createWriteEvidence, createJoinEvidence, createReadEvidence, and
createReadSupport, including write, join, read, patch, and index. Replace every
corresponding raw namespace literal passed to createHandle with the appropriate
constant, such as EVIDENCE_NAMESPACE.PATCH, while preserving the existing handle
inputs and ordering.
In `@test/unit/domain/ReceiptDiagnostics.test.ts`:
- Around line 14-24: Extract the duplicate createBoundedReadBasis helper from
ReceiptDiagnostics.test.ts and WarpFacade.test.ts into a shared test helper
module, then import and reuse that single implementation in both tests. Preserve
its existing parameters, runtime setup, materialization, and checkpoint
behavior.
---
Outside diff comments:
In `@index.ts`:
- Around line 6-10: Update the module header comment near the root exports to
state that Evidence and EvidenceHandle are first-use types exported from the
root package, and limit the advanced package description to Optic, Witness, and
coordinate-capture machinery. Keep the existing storage and diagnostics
boundaries unchanged.
In `@src/domain/api/DraftTimelineRuntime.ts`:
- Around line 117-187: The asynchronous rejectedJoinPrecondition check in
joinDraftTimeline allows concurrent calls to pass before state.joining is set.
Split the synchronous state validation from rejectedJoin receipt creation, set
state.joining before the first await, and preserve the existing rejection
reasons and results for joined, joining, failed, and empty-intent states.
In `@src/domain/api/WriteRuntime.ts`:
- Around line 36-73: Update executeIntentWrite and acceptedWriteReceipt so
failures during post-commit evidence creation or receipt binding cannot report
the already-applied write as failed. Separate commit completion from receipt
construction/binding, or add recovery that returns a valid receipt for the
committed patch while preserving operational failure handling for errors
occurring before commit.
🪄 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: 4f41f44c-2df6-47b8-91b8-f1c2b0420425
📒 Files selected for processing (32)
diagnostics.tsdocs/migrations/v19/README.mddocs/topics/api/README.mddocs/topics/getting-started.mddocs/topics/querying.mddocs/topics/reference.mdindex.tsscripts/check-dts-surface.tsscripts/v19-root-declaration-gate.tssrc/application/ReceiptProvenanceRegistry.tssrc/application/openWarp.tssrc/domain/api/ApiRuntimeContext.tssrc/domain/api/DraftTimelineRuntime.tssrc/domain/api/Evidence.tssrc/domain/api/EvidenceRuntime.tssrc/domain/api/JoinReceipt.tssrc/domain/api/ReadReceipt.tssrc/domain/api/ReadingRuntime.tssrc/domain/api/TickRuntime.tssrc/domain/api/TimelineRuntime.tssrc/domain/api/TimelineViewRuntime.tssrc/domain/api/WriteReceipt.tssrc/domain/api/WriteRuntime.tstest/conformance/v18FirstUseOpticsHonesty.test.tstest/type-check/v19-consumer.tstest/type-check/v19-subpaths.tstest/unit/domain/DraftTimelineRuntime.test.tstest/unit/domain/ReceiptDiagnostics.test.tstest/unit/domain/ReceiptOutcome.test.tstest/unit/domain/WarpFacade.test.tstest/unit/scripts/v19-public-api-boundary.test.tstest/unit/scripts/v19-root-declaration-gate.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 (4)
**/*.{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/scripts/v19-root-declaration-gate.test.tsindex.tssrc/domain/api/ApiRuntimeContext.tssrc/domain/api/Evidence.tstest/type-check/v19-subpaths.tssrc/application/ReceiptProvenanceRegistry.tssrc/application/openWarp.tssrc/domain/api/TickRuntime.tssrc/domain/api/ReadReceipt.tstest/unit/scripts/v19-public-api-boundary.test.tssrc/domain/api/WriteRuntime.tssrc/domain/api/EvidenceRuntime.tstest/type-check/v19-consumer.tssrc/domain/api/ReadingRuntime.tssrc/domain/api/TimelineViewRuntime.tstest/conformance/v18FirstUseOpticsHonesty.test.tstest/unit/domain/ReceiptOutcome.test.tsscripts/check-dts-surface.tstest/unit/domain/WarpFacade.test.tssrc/domain/api/JoinReceipt.tstest/unit/domain/DraftTimelineRuntime.test.tsdiagnostics.tstest/unit/domain/ReceiptDiagnostics.test.tssrc/domain/api/DraftTimelineRuntime.tssrc/domain/api/TimelineRuntime.tsscripts/v19-root-declaration-gate.tssrc/domain/api/WriteReceipt.ts
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/ApiRuntimeContext.tssrc/domain/api/Evidence.tssrc/application/ReceiptProvenanceRegistry.tssrc/application/openWarp.tssrc/domain/api/TickRuntime.tssrc/domain/api/ReadReceipt.tssrc/domain/api/WriteRuntime.tssrc/domain/api/EvidenceRuntime.tssrc/domain/api/ReadingRuntime.tssrc/domain/api/TimelineViewRuntime.tssrc/domain/api/JoinReceipt.tssrc/domain/api/DraftTimelineRuntime.tssrc/domain/api/TimelineRuntime.tssrc/domain/api/WriteReceipt.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/ApiRuntimeContext.tssrc/domain/api/Evidence.tssrc/domain/api/TickRuntime.tssrc/domain/api/ReadReceipt.tssrc/domain/api/WriteRuntime.tssrc/domain/api/EvidenceRuntime.tssrc/domain/api/ReadingRuntime.tssrc/domain/api/TimelineViewRuntime.tssrc/domain/api/JoinReceipt.tssrc/domain/api/DraftTimelineRuntime.tssrc/domain/api/TimelineRuntime.tssrc/domain/api/WriteReceipt.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/ApiRuntimeContext.tssrc/domain/api/Evidence.tssrc/domain/api/TickRuntime.tssrc/domain/api/ReadReceipt.tssrc/domain/api/WriteRuntime.tssrc/domain/api/EvidenceRuntime.tssrc/domain/api/ReadingRuntime.tssrc/domain/api/TimelineViewRuntime.tssrc/domain/api/JoinReceipt.tssrc/domain/api/DraftTimelineRuntime.tssrc/domain/api/TimelineRuntime.tssrc/domain/api/WriteReceipt.ts
🔇 Additional comments (32)
diagnostics.ts (1)
5-28: LGTM!Also applies to: 37-61, 63-71, 73-89
test/unit/domain/ReceiptDiagnostics.test.ts (1)
4-13: LGTM!Also applies to: 26-65, 66-88, 90-113, 114-136, 137-150, 152-168
test/conformance/v18FirstUseOpticsHonesty.test.ts (1)
4-4: LGTM!Also applies to: 130-130, 188-188, 202-210
docs/topics/querying.md (1)
100-108: LGTM!test/unit/domain/DraftTimelineRuntime.test.ts (1)
4-7: LGTM!Also applies to: 20-33, 74-80, 95-116, 130-160
test/unit/domain/WarpFacade.test.ts (1)
15-15: LGTM!Also applies to: 139-139, 295-297, 361-361, 422-423, 437-437, 452-458, 564-570
index.ts (1)
21-21: LGTM!Also applies to: 53-53
test/type-check/v19-consumer.ts (1)
12-23: LGTM! The added@ts-expect-errorassertions correctly verifypatchSha,patchShas, andcheckpointShaare no longer exposed, consistent with the opaqueEvidence/EvidenceHandlecontract.Also applies to: 80-81, 114-122, 134-134
test/type-check/v19-subpaths.ts (1)
8-16: LGTM!InspectReceiptOptions/ReceiptSubstrateInspectionusage and the@ts-expect-errorfor missing storage context match theinspectReceiptcontract in diagnostics.ts.Also applies to: 28-40
docs/migrations/v19/README.md (1)
39-44: LGTM! Migration guidance is consistent with the opaque evidence contract and storage-required diagnostics.Also applies to: 111-111, 229-266, 286-286, 307-318, 330-332
docs/topics/api/README.md (1)
119-119: LGTM! The new "Opaque Evidence" section and updated examples correctly describe the storage-neutral evidence handle contract.Also applies to: 162-183, 263-263, 281-281, 413-418, 433-433
docs/topics/getting-started.md (1)
50-58: LGTM!Also applies to: 83-83
docs/topics/reference.md (1)
39-85: LGTM!Also applies to: 149-159
scripts/check-dts-surface.ts (1)
18-18: LGTM!Also applies to: 224-238, 262-262, 363-366, 433-433
test/unit/scripts/v19-public-api-boundary.test.ts (2)
31-32: LGTM!Also applies to: 63-64, 202-202, 242-244
12-13: 🗄️ Data Integrity & IntegrationNo issue with the
Evidenceexport
src/domain/api/Evidence.tsexportsEvidenceas the default type, soexport type { default as Evidence, EvidenceHandle }inindex.tsis valid.> Likely an incorrect or invalid review comment.test/unit/scripts/v19-root-declaration-gate.test.ts (1)
17-49: LGTM!test/unit/domain/ReceiptOutcome.test.ts (1)
9-13: LGTM!Also applies to: 15-42, 69-89, 91-106, 108-134
src/domain/api/ApiRuntimeContext.ts (1)
1-27: LGTM!src/domain/api/ReadingRuntime.ts (1)
9-16: LGTM!Also applies to: 28-48, 69-94, 180-209
src/domain/api/DraftTimelineRuntime.ts (1)
3-5: LGTM on the evidence/context-threading changes outside the guard flow (state shape,createDraftTimeline,previewDraftJoin,writeDraftIntent's SHA capture/validation,joinResult/acceptedJoinReceipt/unacceptedJoinReceipt) — these correctly threadcontextand match thecreateJoinEvidencecontract and existing tests.Also applies to: 15-15, 32-61, 79-83, 108-108, 203-233, 263-315
src/application/ReceiptProvenanceRegistry.ts (1)
1-19: LGTM on the binding/resolution/freeze logic (outside the flaggedJSON.stringifycall).Also applies to: 24-65
src/domain/api/TickRuntime.ts (1)
4-4: LGTM!Also applies to: 14-34, 48-58
src/application/openWarp.ts (1)
7-7: LGTM!Also applies to: 25-40, 50-50
src/domain/api/TimelineRuntime.ts (1)
3-3: LGTM!Also applies to: 17-43
src/domain/api/TimelineViewRuntime.ts (1)
2-24: LGTM!src/domain/api/Evidence.ts (1)
1-6: LGTM!src/domain/api/JoinReceipt.ts (1)
4-5: LGTM!Also applies to: 18-30, 90-99, 107-114
src/domain/api/ReadReceipt.ts (1)
3-4: LGTM!Also applies to: 18-30, 94-98
src/domain/api/WriteReceipt.ts (1)
3-4: LGTM!Also applies to: 16-28, 78-95
src/domain/api/EvidenceRuntime.ts (1)
99-151: LGTM!src/domain/api/WriteRuntime.ts (1)
13-23: LGTM!
Final-head review addendum at
|
Release Preflight
If this PR is from a |
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/EvidenceRuntime.ts`:
- Around line 40-45: Update createWriteRecoveryEvidence and the corresponding
recovery helper to derive recovery evidence IDs from a storage-scoped uniqueness
source, such as a storage-scoped port or injected runtime nonce, instead of
keying nextRecoverySequence solely from ApiRuntimeContext. Ensure reopening the
same worldline cannot regenerate an identical recovery handle for the same
inputs, while preserving the existing recovery evidence behavior.
In `@test/unit/domain/ReceiptDiagnostics.test.ts`:
- Around line 14-24: Update the test case around createApiRuntimeContext and
createOpaqueId to include a duplicate invocation with the same typed input, then
assert the resulting IDs are equal. Preserve the existing distinct-input
collision assertions while also verifying deterministic ID generation.
🪄 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: acf711b0-8323-49b8-9a3c-988b5df4b78b
📒 Files selected for processing (15)
docs/topics/reference.mdindex.tsscripts/v19-root-declaration-gate.tssrc/application/ReceiptProvenanceRegistry.tssrc/domain/api/DraftTimelineRuntime.tssrc/domain/api/EvidenceRuntime.tssrc/domain/api/JoinReceipt.tssrc/domain/api/ReadReceipt.tssrc/domain/api/WriteReceipt.tssrc/domain/api/WriteRuntime.tstest/helpers/BoundedReadBasis.tstest/unit/domain/DraftTimelineRuntime.test.tstest/unit/domain/ReceiptDiagnostics.test.tstest/unit/domain/WarpFacade.test.tstest/unit/scripts/v19-root-declaration-gate.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)
**/*.{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/helpers/BoundedReadBasis.tsindex.tstest/unit/scripts/v19-root-declaration-gate.test.tssrc/application/ReceiptProvenanceRegistry.tssrc/domain/api/WriteReceipt.tssrc/domain/api/ReadReceipt.tssrc/domain/api/JoinReceipt.tssrc/domain/api/WriteRuntime.tsscripts/v19-root-declaration-gate.tstest/unit/domain/ReceiptDiagnostics.test.tssrc/domain/api/EvidenceRuntime.tssrc/domain/api/DraftTimelineRuntime.tstest/unit/domain/DraftTimelineRuntime.test.tstest/unit/domain/WarpFacade.test.ts
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/application/ReceiptProvenanceRegistry.tssrc/domain/api/WriteReceipt.tssrc/domain/api/ReadReceipt.tssrc/domain/api/JoinReceipt.tssrc/domain/api/WriteRuntime.tssrc/domain/api/EvidenceRuntime.tssrc/domain/api/DraftTimelineRuntime.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/WriteReceipt.tssrc/domain/api/ReadReceipt.tssrc/domain/api/JoinReceipt.tssrc/domain/api/WriteRuntime.tssrc/domain/api/EvidenceRuntime.tssrc/domain/api/DraftTimelineRuntime.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/WriteReceipt.tssrc/domain/api/ReadReceipt.tssrc/domain/api/JoinReceipt.tssrc/domain/api/WriteRuntime.tssrc/domain/api/EvidenceRuntime.tssrc/domain/api/DraftTimelineRuntime.ts
🔇 Additional comments (15)
index.ts (1)
8-11: LGTM!Also applies to: 22-22, 54-54
docs/topics/reference.md (1)
32-85: LGTM!Also applies to: 152-159
scripts/v19-root-declaration-gate.ts (1)
65-76: LGTM!test/unit/domain/DraftTimelineRuntime.test.ts (1)
17-35: LGTM!Also applies to: 49-50, 90-92, 102-170
test/unit/domain/WarpFacade.test.ts (1)
19-19: LGTM!test/unit/scripts/v19-root-declaration-gate.test.ts (1)
23-57: LGTM!test/unit/domain/ReceiptDiagnostics.test.ts (1)
11-11: LGTM!Also applies to: 26-168
test/helpers/BoundedReadBasis.ts (1)
1-18: LGTM!src/domain/api/JoinReceipt.ts (1)
5-5: LGTM!Also applies to: 35-57
src/domain/api/ReadReceipt.ts (1)
4-4: LGTM!Also applies to: 34-56, 91-95
src/domain/api/WriteReceipt.ts (1)
4-4: LGTM!Also applies to: 19-19, 30-60
src/application/ReceiptProvenanceRegistry.ts (1)
15-75: LGTM!src/domain/api/EvidenceRuntime.ts (1)
16-38: LGTM!Also applies to: 47-66, 76-127
src/domain/api/WriteRuntime.ts (1)
4-5: LGTM!Also applies to: 21-23, 38-86
src/domain/api/DraftTimelineRuntime.ts (1)
5-6: LGTM!Also applies to: 15-80, 124-359
Final-review follow-up at
|
Release Preflight
If this PR is from a |
Closes #743
Summary
EvidencehandlesTick.ida deterministic opaque identifier while retaining its internal coordinate bindinginspectReceipt()This is an intentional breaking API change for the eventual v19.0.0 release.
Source evidence
src/domain/api/Evidence.ts#3-13@d5b4b47ded6303235fa4314dd22e76e93abecb01]src/domain/api/WriteReceipt.ts#16-31@d5b4b47ded6303235fa4314dd22e76e93abecb01]src/domain/api/JoinReceipt.ts#18-40@d5b4b47ded6303235fa4314dd22e76e93abecb01]src/domain/api/ReadReceipt.ts#18-35@d5b4b47ded6303235fa4314dd22e76e93abecb01]src/domain/api/TickRuntime.ts#48-57@d5b4b47ded6303235fa4314dd22e76e93abecb01]src/application/ReceiptProvenanceRegistry.ts#13-64@d5b4b47ded6303235fa4314dd22e76e93abecb01]diagnostics.ts#11-90@d5b4b47ded6303235fa4314dd22e76e93abecb01]scripts/check-dts-surface.ts#212-235@d5b4b47ded6303235fa4314dd22e76e93abecb01]scripts/v19-root-declaration-gate.ts#30-83@d5b4b47ded6303235fa4314dd22e76e93abecb01]Validation
npm run test:local: 577 files passed, 1 skipped; 7,374 tests passed, 2 skippednpm run test:coverage:ci: 588 files passed, 1 skipped; 7,419 tests passed, 2 skipped; 92.62% line threshold metnpx vitest run test/integration: 19 files, 98 tests passedPATH="$PWD/bin:$PATH" bats test/bats/: 110 tests passednpm run typecheck:surface: zero errors and zero warningsnpm pack --dry-runpassed the full prepack pipelineEvidenceandEvidenceHandleadded;ReadEvidenceremoved