Skip to content

SDK relationship events, graph analytics, and bounded agent context#556

Merged
unbraind merged 6 commits into
mainfrom
feat/sdk-relationship-events-analytics-context
Jul 14, 2026
Merged

SDK relationship events, graph analytics, and bounded agent context#556
unbraind merged 6 commits into
mainfrom
feat/sdk-relationship-events-analytics-context

Conversation

@unbraind

@unbraind unbraind commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • add immutable attributable relationship event history with optimistic concurrency, replayable time/version snapshots, stable identities, and cursor pagination
  • add registry-driven execution/critical-path, impact, knowledge-graph, and temporal analytics
  • add bounded, explainable agent graph context with evidence, semantic reasons, token/cost limits, cancellation, and continuation
  • document the public SDK and resolve CodeFactor Fix 'Using a spread operator here creates a new array unnecessarily.' issue in tests\unit\sdk\relationships.spec.ts #555
  • reconcile live GitHub security, dependency, nightly, release, Sentry, and telemetry findings into pm

pm items

Verification

  • 287 test files / 5,678 tests
  • 100% statements (36,575/36,575)
  • 100% branches (26,252/26,252)
  • 100% functions (7,405/7,405)
  • 100% lines (35,721/35,721)
  • lint, jscpd, typecheck, docs/skills, contracts, static quality, dependency audit, and secrets checks pass
  • packed npx smoke and 88-command package-first dogfood pass
  • fresh pnpm-installed tarball exercised custom company ownership, event replay, critical-path analytics, and bounded context via @unbrained/pm-cli/sdk
  • telemetry healthy at 0.29% finish-error rate with zero missing error codes; unrelated live Sentry PM-CLI-29 is tracked by pm-7n5a
  • scheduled Auto Release published GitHub/npm 2026.7.14 successfully

Closes #555


Summary by cubic

Adds an append-only relationship event history with replayable snapshots and cursor pagination, plus registry-driven graph analytics and a bounded, explainable agent context in the SDK. Docs clarify legacy precedence/hierarchy defaults, traversal is linear-time via parent-map BFS, and event validation is now indexed for constant-time checks with sequence-consistent snapshots.

  • New Features

    • Immutable relationship event log with optimistic concurrency, snapshot replay, and cursor pagination (relationship-history).
    • Deterministic analytics for execution order, impact, and knowledge graphs (relationship-analytics).
    • Bounded, explainable agent context with evidence, cost/token metadata, and continuation (relationship-context).
    • SDK exports added in index.ts; relationship kinds support optional precedence and explicit hierarchyDirection (defaults remain source_before_target); docs expanded for graph behavior, guarantees, and legacy/JSON-caller fallbacks.
  • Bug Fixes

    • Indexed event identity and cardinality for constant-time validation across add/supersede/remove, with sequence-consistent snapshots for non-monotonic timestamps.
    • Review hardening and performance: linear traversal with parent-map BFS, streaming cardinality checks, removal of redundant boundary adjacency reads, zero-copy incident merges, stable temporal edge keys, cyclic-target guards, browser-safe token sizing, exact evidence accounting, immutable node snapshot caching, indexed incident-edge reasoning, constant-size event normalization, reusable cursor/token encoding, stable custom JSON values, and single-projection evidence budgets.
    • Fix 'Using a spread operator here creates a new array unnecessarily.' issue in tests\unit\sdk\relationships.spec.ts #555: remove unnecessary spread in registry-order assertion without changing behavior.

Written for commit 80ff7b7. Summary will update on new commits.

Review in cubic

Introduce append-only attributable relationship events with replayable snapshots and cursor pagination.

Add registry-driven execution, impact, knowledge, and temporal analytics plus bounded agent context packing with exact cost metadata.

Document and verify the public SDK through full 100% coverage, packed-package dogfood, latest pm-changelog generation, and GH-555 remediation.

@sourcery-ai sourcery-ai 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.

Sorry @unbraind, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai please review the current head.

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@unbraind, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 26 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: b4f8189a-3efa-4142-8c83-80b0a1495c0c

📥 Commits

Reviewing files that changed from the base of the PR and between a6857ac and 80ff7b7.

📒 Files selected for processing (34)
  • .agents/pm/chores/pm-m2il.toon
  • .agents/pm/epics/pm-qwoy.toon
  • .agents/pm/extensions/.managed-extensions.json
  • .agents/pm/features/pm-7ob5.toon
  • .agents/pm/features/pm-ju83.toon
  • .agents/pm/history/pm-7n5a.jsonl
  • .agents/pm/history/pm-7ob5.jsonl
  • .agents/pm/history/pm-7zs0.jsonl
  • .agents/pm/history/pm-8xr8.jsonl
  • .agents/pm/history/pm-b24b.jsonl
  • .agents/pm/history/pm-evav.jsonl
  • .agents/pm/history/pm-ju83.jsonl
  • .agents/pm/history/pm-m2il.jsonl
  • .agents/pm/history/pm-ofgc.jsonl
  • .agents/pm/history/pm-qwoy.jsonl
  • .agents/pm/history/pm-topu.jsonl
  • .agents/pm/history/pm-zt1c.jsonl
  • .agents/pm/issues/pm-7n5a.toon
  • .agents/pm/issues/pm-b24b.toon
  • .agents/pm/issues/pm-evav.toon
  • .agents/pm/issues/pm-ofgc.toon
  • .agents/pm/issues/pm-topu.toon
  • .agents/pm/issues/pm-zt1c.toon
  • .agents/pm/reminders/pm-7zs0.toon
  • .agents/pm/stories/pm-8xr8.toon
  • CHANGELOG.md
  • docs/RELATIONSHIP_GRAPH.md
  • src/sdk/index.ts
  • src/sdk/relationship-analytics.ts
  • src/sdk/relationship-context.ts
  • src/sdk/relationship-history.ts
  • src/sdk/relationships.ts
  • tests/unit/sdk/relationship-history-analytics.spec.ts
  • tests/unit/sdk/relationships.spec.ts
📝 Walkthrough

Walkthrough

Adds immutable relationship event history, deterministic graph analytics, bounded relationship-context generation, graph contract updates, public SDK exports, extensive tests, documentation, and related project-management records.

Changes

Relationship SDK capabilities

Layer / File(s) Summary
Graph contracts and primitives
src/sdk/relationships.ts, tests/unit/sdk/relationships.spec.ts, docs/RELATIONSHIP_GRAPH.md
Adds ordering and hierarchy metadata, registry validation, deterministic node snapshots, and incidentEdges() behavior with expanded validation tests.
Immutable relationship event history
src/sdk/relationship-history.ts, tests/unit/sdk/relationship-history-analytics.spec.ts, docs/RELATIONSHIP_GRAPH.md
Adds validated append-only events, immutable versioned snapshots, cardinality enforcement, and cursor-paged history.
Deterministic graph analytics
src/sdk/relationship-analytics.ts, tests/unit/sdk/relationship-history-analytics.spec.ts, docs/RELATIONSHIP_GRAPH.md
Adds execution, impact, knowledge-graph, and snapshot-comparison analytics with deterministic paths, cycles, components, and truncation metrics.
Bounded relationship context
src/sdk/relationship-context.ts, src/sdk/index.ts, tests/unit/sdk/relationship-history-analytics.spec.ts, docs/RELATIONSHIP_GRAPH.md
Adds token-bounded graph traversal with evidence, semantic reasons, cancellation, omission accounting, and cursor continuation, and exports the new SDK modules.
Project records and release documentation
.agents/pm/**, CHANGELOG.md
Records implementation and verification evidence, issue histories, release-health notes, dependency sweeps, and the GH-555 changelog entry.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant RelationshipEventLog
  participant RelationshipGraph
  participant RelationshipAnalytics
  participant buildRelationshipContext
  Client->>RelationshipEventLog: append or select relationship history
  RelationshipEventLog->>RelationshipGraph: materialize immutable snapshot
  RelationshipGraph->>RelationshipAnalytics: analyze graph or compare snapshots
  RelationshipGraph->>buildRelationshipContext: traverse bounded relationship context
  buildRelationshipContext-->>Client: return explainable, token-bounded context
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Most code changes implement new SDK modules, docs, and tests that are unrelated to the sole linked issue #555. Split the broader SDK work into separately linked issues or a separate PR, and keep this change focused on the spread removal.
Docstring Coverage ⚠️ Warning Docstring coverage is 5.26% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR removes the unnecessary spread in tests/unit/sdk/relationships.spec.ts, satisfying issue #555.
Title check ✅ Passed The title clearly summarizes the main additions: relationship events, graph analytics, and bounded agent context.
Description check ✅ Passed The description is directly related to the code changes and accurately reflects the SDK, docs, and remediation work.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 39 minutes.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements a comprehensive suite of relationship graph capabilities in the SDK, including an append-only event ledger (RelationshipEventLog) with optimistic concurrency, exact deterministic graph analytics (execution layering, impact, and knowledge graph analysis), and explainable, token-bounded context assembly. Feedback on these changes highlights a potential runtime crash in the longest-path calculation when cycles are present, non-deterministic snapshot comparisons due to JSON.stringify key ordering, environment portability limitations from Node-specific Buffer usage, and a performance bottleneck in the nodes() retrieval that can be resolved with caching.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/sdk/relationship-analytics.ts
Comment thread src/sdk/relationship-analytics.ts
Comment thread src/sdk/relationship-context.ts
Comment thread src/sdk/relationships.ts
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request expands the public SDK with robust graph capabilities, introducing append-only immutable relationship event logs with optimistic concurrency, point-in-time snapshots, exact deterministic graph analytics (execution order, impact, and knowledge graph analysis), and explainable, token-bounded relationship context packets. The review feedback highlights two important areas for improvement: first, a potential runtime issue in the longest path calculation where a non-null assertion on a cyclic node's depth could fail; second, the use of Node.js-specific Buffer.byteLength which limits the SDK's portability in browser or edge environments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/sdk/relationship-analytics.ts
Comment thread src/sdk/relationship-context.ts
@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds relationship graph history, analytics, and bounded SDK context. The main changes are:

  • New relationship event log with snapshots and cursor paging.
  • New execution, impact, knowledge-graph, and snapshot comparison analytics.
  • New bounded relationship context builder with evidence and token accounting.
  • Public SDK exports and relationship graph documentation updates.

Confidence Score: 5/5

This looks safe to merge.

No blocking issues found in the changed code.

T-Rex T-Rex Logs

What T-Rex did

  • Built the SDK package by running pnpm build and confirmed the process exited with code 0.
  • Packaged the built SDK into a tarball and verified the tarball contents include the dist SDK/bundle as listed.
  • Installed the tarball, executed the generated script, and validated runtime output showing importPath and the expected JSON replay data for edges, criticalPath, impact, and boundedContext.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/sdk/relationship-context.ts Adds bounded relationship context assembly with hierarchy reasons, evidence projection, cursoring, and token limits.
src/sdk/relationship-analytics.ts Adds graph analytics and stable snapshot comparison for relationship edges.
src/sdk/relationship-history.ts Adds an append-only relationship event log with optimistic concurrency, replay snapshots, and cursor pages.
src/sdk/relationships.ts Extends relationship definitions with precedence and hierarchy direction semantics.
src/sdk/index.ts Exports the new relationship analytics, context, and history SDK modules.

Reviews (12): Last reviewed commit: "perf(sdk): index relationship event vali..." | Re-trigger Greptile

Comment thread src/sdk/relationship-context.ts
Comment thread src/sdk/relationship-context.ts Outdated
Comment thread src/sdk/relationship-analytics.ts
@unbraind

Copy link
Copy Markdown
Owner Author

Review round 1 acknowledgement: every Gemini and Greptile inline finding was accepted, reacted to, answered with verification evidence, and resolved. The fixes add cycle-entry safety, recursively stable snapshot keys, TextEncoder portability, cached immutable node snapshots, explicit hierarchy orientation, and single-charge evidence accounting. Codecov confirmed complete patch coverage. CodeRabbit and Sourcery rate-limit notices were also read, reacted to, and recorded; they contained no code findings. Local verification is now 5,680 tests with exact 100/100/100/100 coverage.

Address the complete first review round with explicit hierarchy orientation, stable temporal edge keys, cyclic-target guards, browser-safe token sizing, exact evidence accounting, and cached immutable node snapshots. Add adversarial regressions and pm evidence while preserving exact repository-wide coverage.
@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai please review the current head fbe8787 after all round-one findings were resolved.

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 11 minutes.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements stable public SDK APIs for relationship registry, immutable event history, explainable graph analytics, and token-bounded agent context. The reviewer identified several performance bottlenecks and a bug: repeatedly filtering all graph edges in directReasons and instantiating TextEncoder on every token estimation in relationship-context.ts can be optimized by pre-filtering root edges and reusing a module-level encoder; instantiating RelationshipGraph with all nodes on every ledger append in relationship-history.ts should be avoided by validating endpoints first; and stableJsonValue in relationship-analytics.ts needs to handle objects with custom toJSON methods (like Date) while preserving the existing serialization contract.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/sdk/relationship-context.ts
Comment thread src/sdk/relationship-context.ts
Comment thread src/sdk/relationship-history.ts
Comment thread src/sdk/relationship-analytics.ts
Comment thread src/sdk/relationship-context.ts
Comment thread src/sdk/relationship-context.ts Outdated
@unbraind

Copy link
Copy Markdown
Owner Author

Review round 2 acknowledgement: all six Gemini and Greptile findings were accepted, reacted to, answered inline with implementation evidence, and resolved. The response adds indexed incident-edge context, constant-size append normalization, reusable TextEncoder allocation, custom toJSON stability, and non-duplicated evidence projection with fail-closed baseline budgeting. The updated Greptile summary reports 5/5 and safe to merge; its separate evidence-budget repro was still addressed. CodeRabbit completed with a rate-limit notice and no code findings. Full local verification remains exact 100/100/100/100 across 5,680 tests.

Address the complete second review round with indexed incident-edge reasoning, constant-size event normalization, reusable token encoding, stable custom JSON values, and single-projection evidence budgets. Add adversarial regressions, retain exact 100% coverage, and release the broader graph items back to open with remaining acceptance preserved.
@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai please review the current head 2f85b5e after all round-two findings were resolved.

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 59 minutes.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces robust graph analytics, an append-only relationship event ledger, and bounded agent context assembly to the SDK. Specifically, it adds relationship-analytics.ts for execution, impact, and knowledge graph analysis, relationship-context.ts for token-bounded context packets, and relationship-history.ts for immutable event logs and snapshots. It also updates the core relationship definitions to support explicit precedence and hierarchy directions. The review feedback suggests adding inline comments to document deliberate defensive guards (nullish coalescing operators) on recently added fields to explain their role in backward compatibility.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/sdk/relationship-analytics.ts
Comment thread src/sdk/relationship-context.ts
Comment thread src/sdk/relationship-context.ts
Document why public relationship definitions retain precedence and hierarchy defaults for legacy and JSON-parsed callers. Record the final review evidence in pm-7ob5 and pm-8xr8, release both items back to open, and refresh the managed pm-changelog metadata at the latest installed version.
@unbraind

Copy link
Copy Markdown
Owner Author

Review round 3 acknowledgement: all three Gemini compatibility-documentation findings were accepted, reacted to, answered inline with verification evidence, and resolved. The SDK now documents why precedence and hierarchy defaults remain deliberate at legacy and JSON-parsed public boundaries. Greptile completed at 5/5 with no blocking issues; CodeRabbit completed with a rate-limit notice and no code findings. Focused SDK tests (23), lint, duplicate detection, CodeFactor rules, and typecheck pass, and the final tracker state has zero in-progress items.

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai please review the current head 63329c0 after all round-three findings were resolved.

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 46 minutes.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request significantly expands the relationship graph SDK by introducing an append-only event ledger (RelationshipEventLog), point-in-time snapshots, deterministic graph analytics (execution, impact, and knowledge analysis), and token-bounded explainable context packets (buildRelationshipContext). It also updates the relationship registry to support explicit precedence and hierarchy directions, accompanied by comprehensive unit tests and documentation. Review feedback focuses on critical performance optimizations to ensure scalability up to one million items, specifically recommending a single-pass BFS for impact analysis, eliminating $O(N^2)$ array allocations and map copies during event ledger validation, bypassing redundant adjacency lookups at the boundary depth of context discovery, and streamlining edge deduplication in incidentEdges.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/sdk/relationship-analytics.ts
Comment thread src/sdk/relationship-history.ts
Comment thread src/sdk/relationship-history.ts Outdated
Comment thread src/sdk/relationship-context.ts
Comment thread src/sdk/relationships.ts
Replace repeated shortest-path impact analysis with one parent-map BFS, stream relationship cardinality checks without map copies, stop redundant boundary adjacency reads, and merge sorted incident indexes without Set or re-sort allocation. Preserve undirected and self-loop correctness, add installed-package scale proof and behavioral regressions, retain exact 100/100/100/100 coverage, and record all review evidence in pm-7ob5, pm-ju83, and pm-8xr8 before releasing them back to open.
@unbraind

Copy link
Copy Markdown
Owner Author

Review round 4 acknowledgement: all five Gemini scalability findings were accepted, reacted to, answered inline with evidence, and resolved. Impact traversal is one BFS; ledger validation allocates neither a full comparable array nor a copied active map; bounded context skips redundant boundary reads; incident-edge lookup linearly merges sorted indexes while retaining undirected/self-loop correctness. Fresh installed-package proof traversed 10,000 affected nodes in 27.28 ms, and the final local gate is exact 100/100/100/100 across 5,681 tests. All active items were returned to open and released; in-progress count is zero.

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai please review the current head c2f21cd after all round-four scalability findings were resolved.

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 21 minutes.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces robust graph capabilities to the SDK, including an append-only relationship event ledger (RelationshipEventLog) with deterministic replay and snapshots, exact execution and impact analytics, and a token-bounded graph-context assembler (buildRelationshipContext). It also extends the relationship registry to support explicit precedence and hierarchy directions. Feedback on these changes highlights two critical areas: first, snapshot({ atTimestamp }) should replay a contiguous prefix up to the target timestamp rather than filtering the entire log to prevent sequential consistency violations from non-monotonic timestamps; second, the linear scan in assertCardinality should be optimized using Map-based indexing to avoid severe performance degradation in large workspaces.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/sdk/relationship-history.ts Outdated
Comment thread src/sdk/relationship-history.ts Outdated
Maintain constant-time relationship identity and cardinality indexes across add, supersede, and remove mutations. Preserve sequence-consistent snapshot semantics for non-monotonic timestamps, add regression and scale coverage, and record complete pm verification evidence.
@unbraind

Copy link
Copy Markdown
Owner Author

Review round 5 complete on prior head c2f21cd: both new Gemini findings were implemented, reacted to, replied to inline with verification evidence, and resolved. Head 80ff7b7 now maintains O(1) relationship validation indexes and sequence-consistent timestamp snapshots. Local proof: 5,683 tests, exact 100/100/100/100 coverage, all static gates, and a fresh packed-package 10,000-append proof in 207 ms. Requesting a complete fresh review of the new head.

@unbraind

Copy link
Copy Markdown
Owner Author

@greptileai please review the current head 80ff7b7 in full and report any remaining actionable findings.

@unbraind

Copy link
Copy Markdown
Owner Author

/gemini review

@unbraind

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 59 minutes.

@unbraind

Copy link
Copy Markdown
Owner Author

Final exact-head review inventory for 80ff7b7: Greptile completed after 18m03s with 5/5 confidence, installed-package execution proof, and no blocking issues. Gemini replied that its daily quota is exhausted; its two prior actionable findings were implemented, evidenced, reacted to, replied to, and resolved on this head. CodeRabbit acknowledged the full-review trigger but reported a 59-minute plan rate limit; after the requested 20-minute maximum wait its status remains in progress with no new inline findings. Both quota/rate-limit replies have been reacted to. All 25 executable hosted checks are green, all review threads are resolved, and the local exact-coverage and installed-package proofs are clean.

@unbraind unbraind merged commit cceb6f5 into main Jul 14, 2026
27 of 28 checks passed
@unbraind unbraind deleted the feat/sdk-relationship-events-analytics-context branch July 14, 2026 12:34
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 29 minutes.

unbraind added a commit that referenced this pull request Jul 14, 2026
…backfill, frontier notes

- file pm-albl for GH-557 (contract layer intercepts -h/--help before variadic-positional handlers) under pm-ugqx
- backfill estimate/risk/confidence on pm-d4ns/pm-evav/pm-topu/pm-zt1c (clears missing_estimate warning)
- frontier notes on pm-usfg (remaining slices 3mna -> oxrw -> oslr) and pm-4k6b (catalog-to-shipped map for PR#546/#549/#554/#556/#559)
- files-missing 162 drift comment on pm-j8z6; pass summary on pm-doxj

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDJ1m5HDPDBVp8BBAixtnP
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.

Fix 'Using a spread operator here creates a new array unnecessarily.' issue in tests\unit\sdk\relationships.spec.ts

1 participant