Repository navigation
feat(graph): durable indexes, governance baselines, and mutation advisories - #622
Conversation
Promote the graph platform with a crash-safe cross-process query cache, index maintenance surface, baseline-aware audit deltas, raw duplicate-row integrity checks, type-scoped coverage policy, and component-scoped cycle advisories. Keep CLI, MCP, contracts, completions, docs, and exact 100% coverage aligned, with tracker evidence for pm-ju83, pm-7ob5, and pm-6x7o plus the discovered recovery UX follow-up.
Reject null audit census maps before temporal diffing and derive durable index byte counts from the same decoded payload to avoid cross-process status races. Add regression coverage and record Greptile review evidence on the active governance items.
Attach exact coverage, linked acceptance, installed-package proof, and both Greptile review rounds to the three actively implemented graph SDK items.
|
@greptileai please review the exact current head. @coderabbitai full review @gemini-code-assist review |
|
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 59 minutes. |
📝 WalkthroughWalkthroughThe PR expands ChangesGraph platform enhancements
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant GraphRunner
participant DurableCache
participant AuditGovernance
CLI->>GraphRunner: run graph audit or index
GraphRunner->>DurableCache: open cache using workspace fingerprint
DurableCache-->>GraphRunner: cached result or empty view
GraphRunner->>AuditGovernance: audit workspace with coverage exemptions
AuditGovernance-->>GraphRunner: audit snapshot and findings
GraphRunner->>DurableCache: save result or baseline
GraphRunner-->>CLI: graph result with cache status and baseline delta
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request significantly enhances the relationship graph platform by introducing a durable, cross-process graph query index, point-in-time audit census baseline tracking with signed drift deltas, storage-integrity checks for duplicate dependency rows, and type-aware coverage profiles with isolate exemptions. It also optimizes mutation cycle detection by scoping checks incrementally to the changed item's weakly connected component. The reviewer feedback focuses on ensuring deterministic behavior across different environments by replacing locale-sensitive localeCompare sorting with locale-independent sorting methods in mutation-advisory.ts, assembly.ts, and governance.ts.
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.
Greptile SummaryThis PR turns the relationship graph into a durable, governable graph platform. The main changes are:
Confidence Score: 5/5This PR appears safe to merge. The reviewed graph paths validate option scope, invalidate durable results by fingerprint and relationship semantics, and defensively decode persisted cache and baseline files. No actionable correctness or security issues were identified. No files require special attention.
What T-Rex did
Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant CLI as pm graph
participant Runner as runGraph
participant Store as Item Store
participant Cache as Workspace/Durable Cache
participant Engine as Graph Engine
participant Baseline as Audit Baseline
CLI->>Runner: subcommand + graph options
Runner->>Store: load item metadata/settings
Runner->>Engine: resolve relationship registry + fingerprint
Runner->>Cache: lookup assembly/result by fingerprint + query key
alt durable result hit
Cache-->>Runner: persisted query result
else miss
Runner->>Engine: assemble graph and execute query/audit/plan
Runner->>Cache: best-effort persist result when enabled
end
alt audit query
Runner->>Baseline: load saved snapshot
Runner->>Engine: diff current census vs baseline
opt --save-baseline
Runner->>Baseline: atomically save current snapshot
end
end
Runner-->>CLI: counts-first result with cache metadata
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant CLI as pm graph
participant Runner as runGraph
participant Store as Item Store
participant Cache as Workspace/Durable Cache
participant Engine as Graph Engine
participant Baseline as Audit Baseline
CLI->>Runner: subcommand + graph options
Runner->>Store: load item metadata/settings
Runner->>Engine: resolve relationship registry + fingerprint
Runner->>Cache: lookup assembly/result by fingerprint + query key
alt durable result hit
Cache-->>Runner: persisted query result
else miss
Runner->>Engine: assemble graph and execute query/audit/plan
Runner->>Cache: best-effort persist result when enabled
end
alt audit query
Runner->>Baseline: load saved snapshot
Runner->>Engine: diff current census vs baseline
opt --save-baseline
Runner->>Baseline: atomically save current snapshot
end
end
Runner-->>CLI: counts-first result with cache metadata
Reviews (19): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile |
Merging this PR will regress 4 benchmarks
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | encodeQueryCursor |
101.1 µs | 101.2 µs | -0.08% |
| ❌ | stableStringify (nested contract) |
161.1 µs | 161.2 µs | -0.06% |
| ❌ | decodeQueryCursor |
116 µs | 116 µs | -0.03% |
| ❌ | jaccardSimilarity |
153.4 µs | 153.4 µs | 0% |
| ⚡ | createQueryFingerprint |
514.5 µs | 513 µs | +0.29% |
| ⚡ | build index (200 docs x 40 words) |
8.4 ms | 8.4 ms | +0.03% |
| ⚡ | tokenizeAlphaNumeric |
367.4 µs | 367.3 µs | +0.01% |
| ⚡ | build index (2000 docs x 80 words) |
161.3 ms | 161.3 ms | 0% |
| ⚡ | tokenize + score query over 2000 docs |
7.5 ms | 7.5 ms | 0% |
| ⚡ | score query over 2000 docs |
5.6 ms | 5.6 ms | 0% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing feat/durable-graph-index-governance-baselines (1e13013) with main (54e29e5)
Greptile SummaryThis PR turns graph queries into a durable and governable workspace surface. The main changes are:
Confidence Score: 4/5Safe to merge after fixing the durable cache invalidation bug. One contained bug can return stale graph results when relationship-kind registry semantics change without item changes. The rest of the graph governance, baseline, advisory, CLI, SDK, and test changes are well-scoped. src/sdk/graph/run.ts; src/sdk/graph/cache.ts
What T-Rex did
Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant CLI as pm graph
participant Runner as runGraph
participant Cache as WorkspaceGraphCache
participant Durable as graph-cache.json
participant Audit as Governance/Audit
participant Baseline as graph-audit-baseline.json
CLI->>Runner: subcommand + options
Runner->>Cache: fingerprint(items) lookup/build assembly
Cache-->>Runner: assembly + memo status
Runner->>Durable: open envelope for fingerprint
alt durable hit
Durable-->>Runner: cached GraphResult
else miss
Runner->>Audit: execute query/audit/plan/analyze
Audit-->>Runner: GraphResult
Runner->>Durable: persist result when enabled
end
opt audit baseline
Runner->>Baseline: load prior snapshot
Runner->>Baseline: save current snapshot if requested
Baseline-->>Runner: signed drift delta
end
Runner-->>CLI: counts-first envelope + cache metadata
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant CLI as pm graph
participant Runner as runGraph
participant Cache as WorkspaceGraphCache
participant Durable as graph-cache.json
participant Audit as Governance/Audit
participant Baseline as graph-audit-baseline.json
CLI->>Runner: subcommand + options
Runner->>Cache: fingerprint(items) lookup/build assembly
Cache-->>Runner: assembly + memo status
Runner->>Durable: open envelope for fingerprint
alt durable hit
Durable-->>Runner: cached GraphResult
else miss
Runner->>Audit: execute query/audit/plan/analyze
Audit-->>Runner: GraphResult
Runner->>Durable: persist result when enabled
end
opt audit baseline
Runner->>Baseline: load prior snapshot
Runner->>Baseline: save current snapshot if requested
Baseline-->>Runner: signed drift delta
end
Runner-->>CLI: counts-first envelope + cache metadata
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Code Review
This pull request introduces a durable cross-process graph index, baseline-aware audit census tracking, type-aware coverage profiles, and incremental mutation advisories. The code reviewer provided valuable feedback to enhance the robustness, determinism, and performance of these additions. Key recommendations include defensively validating nested properties in decodeBaseline to prevent NaN calculations, guarding against undefined inputs in diffCountRecords, replacing localeCompare with default UTF-16 string comparisons to ensure deterministic sorting across platforms, and implementing an in-memory cache in openDurableGraphCache to reduce redundant disk I/O in long-lived processes.
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.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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/sdk/graph/assembly.ts`:
- Around line 80-87: Add a concise JSDoc comment immediately above the public
export normalizeDependencyGraphTarget describing its normalization behavior and
that the no-active-blocker sentinel returns undefined. Keep the function
implementation unchanged.
In `@src/sdk/graph/run.ts`:
- Around line 942-1012: Prevent graph index rebuilds from warming cache entries
with unrelated query options. Update assertGraphFlagScope to reject non-index
maintenance/query flags when subcommand is index, or construct runGraphIndex’s
warmInvocation with neutral/default query values so buildGraphQueryKey matches
subsequent plain analyze and audit requests; preserve valid rebuild/clear
behavior.
In `@tests/fixtures/contracts/full.json`:
- Around line 23400-23403: Regenerate the graph contract snapshot represented by
the strict graph action schema in full.json so it includes rebuild,
saveBaseline, and exemptIsolateType alongside clear. Use the project’s existing
contract-generation workflow rather than editing the fixture manually.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 38c0f280-fd78-4814-bfc4-b4d4441da9ec
📒 Files selected for processing (34)
.agents/pm/features/pm-6x7o.toon.agents/pm/features/pm-7ob5.toon.agents/pm/features/pm-ju83.toon.agents/pm/history/pm-6x7o.jsonl.agents/pm/history/pm-7ob5.jsonl.agents/pm/history/pm-ikv6m0.jsonl.agents/pm/history/pm-ju83.jsonl.agents/pm/issues/pm-ikv6m0.toondocs/COMMANDS.mddocs/RELATIONSHIP_GRAPH.mddocs/SDK.mdsrc/cli/commands/completion.tssrc/cli/register-list-query.tssrc/mcp/tool-definitions.tssrc/sdk/cli-contracts/enum-contracts.tssrc/sdk/cli-contracts/flag-contracts.tssrc/sdk/cli-contracts/tool-option-contracts.tssrc/sdk/cli-contracts/tool-parameter-tables.tssrc/sdk/cli-contracts/tool-schema.tssrc/sdk/graph/assembly.tssrc/sdk/graph/cache.tssrc/sdk/graph/durable-cache.tssrc/sdk/graph/governance.tssrc/sdk/graph/index.tssrc/sdk/graph/mutation-advisory.tssrc/sdk/graph/remediation.tssrc/sdk/graph/run.tssrc/sdk/runtime-input.tstests/fixtures/contracts/full.jsontests/unit/cli/register-list-query.spec.tstests/unit/sdk/graph/assembly-governance.spec.tstests/unit/sdk/graph/durable-cache.spec.tstests/unit/sdk/graph/mutation-advisory.spec.tstests/unit/sdk/runtime-input-graph.spec.ts
|
Greptile feedback acknowledgement (comments 5018738381 and 5018745486): both P1 findings are accepted and fixed locally. |
|
Gemini review acknowledgement (reviews 4732147668 and 4732163291): every inline finding was voted and answered in its thread. Locale-dependent new sorts and malformed baseline handling were fixed; the proposed process-local durable-view shortcut was down-voted with the cross-process clear/rebuild coherence rationale. All nine Gemini threads are resolved. |
|
CodeRabbit review acknowledgement (comment 5018724592 and review 4732196370): all three inline findings were voted, answered, and resolved. The one active correctness issue is fixed by warming canonical default index queries; the JSDoc and generated-contract observations were already satisfied on the reviewed head. Rate-limit status in comment 5018723024 is acknowledged; a new exact-head review will still be requested after the fix push. |
|
Automated report acknowledgement: CodSpeed comment 5018742803 and Codecov comment 5018754745 were reviewed and up-voted. Performance analysis has no blocking regression, and the exact local coverage gate remains 100% statements/branches/functions/lines. |
Forward graph-plan isolate exemptions, rebuild neutral cache views, and make graph governance ordering locale-independent. Validate persisted baselines defensively and include extension relationship semantics in cache fingerprints so registry changes cannot reuse stale assemblies. Add focused regressions and record review evidence on the active pm lineages.
|
Review fixes are now pushed in 97658a6. Please re-review the complete current head, including cache invalidation across extension relationship semantics, neutral cache rebuilds, defensive baseline decoding, deterministic governance ordering, and graph-plan option forwarding. @greptileai |
|
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 16 minutes. |
There was a problem hiding this comment.
Code Review
This pull request enhances the graph platform by introducing a durable, cross-process graph query index, a component-scoped incremental mutation advisory for cycle checks, type-aware coverage profiles, storage-integrity checks for duplicate dependency rows, and baseline-aware audit census tracking. The review feedback highlights two important issues: an inefficient sort comparator in assembly.ts that stringifies objects with JSON.stringify, and a bug risk in governance.ts where .sort() is called on [key, value] entries without an explicit comparator.
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.
Resolve graph and deps filters through the same extension-aware relationship registry used for assembly and cache fingerprints. Replace implicit and serialization-heavy governance ordering with explicit locale-independent field comparisons, add extension-filter and comparator regressions, and preserve exact repository coverage.
|
Final review fixes are pushed in c188af8. All three new findings were accepted, fixed, voted, answered inline, and resolved. The exact current head passes 318 files / 5,995 tests at 100/100/100/100. @greptileai please re-review this exact head. |
|
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 59 minutes. |
There was a problem hiding this comment.
Code Review
This pull request introduces several enhancements to the relationship graph governance and analytics platform. Key changes include the implementation of a durable, rebuildable cross-process graph query index to persist query results across processes, type-aware coverage profiling, storage-integrity checks for duplicate dependency rows, and temporal audit baseline comparison. Additionally, execution-order cycle detection has been optimized to run incrementally on mutation advisories, scoping analysis to the changed item's weakly connected component. Review feedback suggests adding an explicit array check in the isNonnegativeCountRecord helper to prevent arrays from being falsely identified as count records, and adding a defensive guard when iterating over assembly.duplicateRows to ensure backward compatibility with legacy or JSON-parsed payloads.
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.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/sdk/graph/governance.ts (1)
910-940: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
diffRelationshipAuditSnapshotsomitscoverage_by_typefrom the profile delta.Every other
RelationshipCoverageProfilefield (nodes,edges,active_nodes,missing_nodes,isolated_active_nodes,degree_leq_one_active_nodes,edges_by_kind) is diffed, but the newly addedcoverage_by_type(per-type coverage profiles) is not. Baseline drift tracking will silently miss per-type regressions (e.g., one item type's isolate count worsening while another improves, net zero aggregate delta) even though this feature was added specifically to surface per-type coverage.♻️ Proposed fix: diff coverage_by_type per type
edges_by_kind: diffCountRecords( baseline.profile.edges_by_kind, current.profile.edges_by_kind, ), + coverage_by_type: Object.fromEntries( + [ + ...new Set([ + ...Object.keys(baseline.profile.coverage_by_type), + ...Object.keys(current.profile.coverage_by_type), + ]), + ] + .sort() + .map((type) => { + const base = baseline.profile.coverage_by_type[type]; + const curr = current.profile.coverage_by_type[type]; + return [ + type, + { + active: (curr?.active ?? 0) - (base?.active ?? 0), + isolated: (curr?.isolated ?? 0) - (base?.isolated ?? 0), + degree_leq_one: + (curr?.degree_leq_one ?? 0) - (base?.degree_leq_one ?? 0), + }, + ]; + }), + ), },🤖 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/sdk/graph/governance.ts` around lines 910 - 940, Update diffRelationshipAuditSnapshots to include coverage_by_type in the returned profile delta. Diff each per-type coverage profile against its matching baseline entry, preserving all nested coverage metrics and handling the existing type-key set consistently with the surrounding diffCountRecords behavior.
🤖 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/sdk/graph/durable-cache.ts`:
- Around line 195-234: Harden decodeBaseline validation by updating
isNonnegativeCountRecord to reject arrays before checking values, and validate
profile.coverage_by_type as a non-array object whose per-type entries contain
non-negative integer active, isolated, and degree_leq_one fields. Preserve
undefined as the result for any malformed baseline.
---
Outside diff comments:
In `@src/sdk/graph/governance.ts`:
- Around line 910-940: Update diffRelationshipAuditSnapshots to include
coverage_by_type in the returned profile delta. Diff each per-type coverage
profile against its matching baseline entry, preserving all nested coverage
metrics and handling the existing type-key set consistently with the surrounding
diffCountRecords behavior.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: db10e57f-eb1d-4f08-84cc-d197b83333aa
📒 Files selected for processing (17)
.agents/pm/features/pm-6x7o.toon.agents/pm/features/pm-7ob5.toon.agents/pm/features/pm-ju83.toon.agents/pm/history/pm-6x7o.jsonl.agents/pm/history/pm-7ob5.jsonl.agents/pm/history/pm-ju83.jsonlsrc/sdk/dependencies.tssrc/sdk/graph/assembly.tssrc/sdk/graph/cache.tssrc/sdk/graph/durable-cache.tssrc/sdk/graph/governance.tssrc/sdk/graph/mutation-advisory.tssrc/sdk/graph/run.tstests/unit/sdk/graph/assembly-governance.spec.tstests/unit/sdk/graph/cache.spec.tstests/unit/sdk/graph/durable-cache.spec.tstests/unit/sdk/graph/run.spec.ts
Validate nested per-type baseline counts, reject array-shaped count records, and retain compatibility with assemblies created before duplicate-row governance. Include signed per-type coverage changes in audit deltas so aggregate cancellation cannot hide regressions, with exact malformed-input and temporal-diff coverage.
|
Accepted and fixed the final review inventory in 16a2f96. In addition to the three inline findings, CodeRabbit’s outside-diff per-type drift finding is fixed: audit deltas now retain signed active/isolated/degree_leq_one changes per type and drop only wholly unchanged type entries. All new bot reviews/comments were upvoted, answered, and inline threads resolved. Full verification is 318 files / 5,995 tests at exact 100/100/100/100 plus strict static gates. @greptileai please review exact head 16a2f96. |
|
@greptileai please review the latest head c4141c2. @coderabbitai full review @gemini-code-assist please review the latest head. The latest Gemini ordering finding was accepted with locale-independent case-folded comparison and exact-spelling tie-breakers. Full local coverage remains exact 100/100/100/100 across 5,996 tests. |
|
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 59 minutes. |
There was a problem hiding this comment.
Code Review
This pull request introduces durable cross-process graph indexing, type-aware coverage profiling with isolate exemptions, storage-integrity checks for duplicate dependency rows, and temporal baseline drift tracking. It also optimizes mutation advisories to run incrementally on component-scoped ordering digraphs. The review feedback identifies critical issues: a runtime TypeError in tallyActiveCoverageNode due to accessing a non-existent id property on AuditNodeState, and a potential crash when parsing legacy baseline profiles lacking the newly added coverage_by_type field, which requires defensive nullish coalescing guards.
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.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
tests/unit/sdk/graph/durable-cache.spec.ts (1)
366-447: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winRebuild-durability test doesn't cover the truly-plain (no flags) analyze/audit case.
This test proves rebuilt entries are hit when the follow-up
analyze/auditcalls explicitly pass{ summary: true }(matching the warmedsummary: trueinvocation), but there's no assertion for the default, no-flagpm graph analyze/pm graph auditcall after--rebuild— which is the scenario flagged insrc/sdk/graph/run.ts(runGraphIndex,warmInvocation.summary: true). Adding a case for the plain default call would make thesummarymismatch (if real) visible in CI rather than only in manual inspection.🤖 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 `@tests/unit/sdk/graph/durable-cache.spec.ts` around lines 366 - 447, Extend the rebuild durability test around runGraph’s warmed invocation to call analyze and audit with empty option objects after resetting the in-process cache, and assert both use the durable cache hit path. Keep the existing summary=true assertions, and ensure the plain no-flag calls validate that rebuilt summary entries are reused despite the summary-option mismatch.src/sdk/graph/run.ts (1)
981-1021: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winAlign rebuild warming with the default query key.
buildGraphQueryKeyincludessummary, andrunGraphleavessummaryatfalseunless the flag is passed, soindex --rebuildcurrently warms a different durable entry than a plainanalyze/auditcall. The rebuild test only covers thesummary: truefollow-up; add a no-flag regression for the default path.🤖 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/sdk/graph/run.ts` around lines 981 - 1021, The rebuild warming in runGraphIndex must use the default query key matching plain analyze/audit execution, so align the warmInvocation summary value with runGraph’s no-flag default while preserving the existing rebuild behavior. Add a regression in tests/unit/sdk/graph/durable-cache.spec.ts covering index --rebuild followed by analyze/audit without the summary flag, in addition to the existing summary=true coverage.
🤖 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/sdk/graph/governance.ts`:
- Around line 917-935: Update the coverageByType delta computation to safely
handle legacy snapshots where baseline.profile.coverage_by_type is absent, using
optional chaining and nullish coalescing before Object.keys. Preserve the
existing merge, sorting, delta calculation, and filtering behavior when either
snapshot provides coverage data.
---
Outside diff comments:
In `@src/sdk/graph/run.ts`:
- Around line 981-1021: The rebuild warming in runGraphIndex must use the
default query key matching plain analyze/audit execution, so align the
warmInvocation summary value with runGraph’s no-flag default while preserving
the existing rebuild behavior. Add a regression in
tests/unit/sdk/graph/durable-cache.spec.ts covering index --rebuild followed by
analyze/audit without the summary flag, in addition to the existing summary=true
coverage.
In `@tests/unit/sdk/graph/durable-cache.spec.ts`:
- Around line 366-447: Extend the rebuild durability test around runGraph’s
warmed invocation to call analyze and audit with empty option objects after
resetting the in-process cache, and assert both use the durable cache hit path.
Keep the existing summary=true assertions, and ensure the plain no-flag calls
validate that rebuilt summary entries are reused despite the summary-option
mismatch.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 8302ddc2-a0d9-4921-8214-cd6a5bfa4332
📒 Files selected for processing (12)
.agents/pm/features/pm-6x7o.toon.agents/pm/features/pm-7ob5.toon.agents/pm/features/pm-ju83.toon.agents/pm/history/pm-6x7o.jsonl.agents/pm/history/pm-7ob5.jsonl.agents/pm/history/pm-ju83.jsonlsrc/sdk/graph/assembly.tssrc/sdk/graph/durable-cache.tssrc/sdk/graph/governance.tssrc/sdk/graph/run.tstests/unit/sdk/graph/assembly-governance.spec.tstests/unit/sdk/graph/durable-cache.spec.ts
Keep the public snapshot-diff primitive compatible with legacy and JSON-decoded payloads that predate per-type coverage. Add positive and negative zero-based delta regressions and record accepted and rejected review evidence on the active graph platform items.
|
@greptileai please review the latest head 2b88510. @coderabbitai full review @gemini-code-assist please review the latest head. Legacy public snapshot deltas now tolerate missing per-type coverage. The two AuditNodeState findings were source-verified false positives and documented inline. Full local coverage remains exact 100/100/100/100 across 5,996 tests. |
|
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 42 minutes. |
There was a problem hiding this comment.
Code Review
This pull request significantly enhances the relationship graph platform by implementing a durable cross-process graph index, temporal audit census baselines with signed drift tracking, storage-integrity audits for duplicate dependency rows, and type-aware coverage profiles. Additionally, it optimizes mutation advisories to perform incremental, component-scoped cycle checks. The review feedback recommends defensively trimming the item type during both graph assembly and fingerprint generation to ensure robust whitespace handling and prevent unnecessary cache invalidation.
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.
|
Review round updated at @greptileai review |
|
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 30 minutes. |
There was a problem hiding this comment.
Code Review
This pull request introduces a durable, rebuildable cross-process graph query index (runtime/graph-cache.json) and a temporal audit census baseline system (runtime/graph-audit-baseline.json) to optimize graph analysis across processes. It adds a new index subcommand to pm graph to manage this cache, alongside options for type-aware isolate exemptions (--exempt-isolate-type) and baseline saving (--save-baseline). Additionally, it implements storage-integrity checks for duplicated dependency rows (duplicate_dependency_row), per-type connectivity coverage profiles, and replaces full-graph cycle checks during mutations with an incremental, component-scoped advisory mechanism. I have no feedback to provide as there are no review comments to assess.
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.
|
Final review acknowledgements for exact head
The exact-head check set is fully green and the final thread inventory has zero unresolved threads. |
|
Acknowledged. All review passes on exact head |
|
Tip For best results, initiate chat on the files or code changes.
|
…dex-governance-baselines
|
Branch protection required the latest @greptileai review |
|
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 22 minutes. |
|
Integrated-head acknowledgements:
The integrated head is CLEAN and MERGEABLE, every check is green, and the thread inventory remains empty. |
|
Tip For best results, initiate chat on the files or code changes.
|
|
Acknowledged. The integrated head at |
There was a problem hiding this comment.
Code Review
This pull request introduces a durable, rebuildable cross-process graph query index and incremental mutation advisories to optimize workspace relationship-graph queries and cycle detection. It also adds type-aware coverage profiles, isolate-exempt types, and duplicate dependency row integrity checks. The review feedback highlights a potential runtime TypeError crash in Tarjan's algorithm because induceSuccessors omits nodes with no successors from the returned map; the reviewer suggests defensively populating all members in the induced map with empty arrays and updating the corresponding unit tests.
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.
Summary
This wide SDK/CLI tranche turns the relationship graph into a durable, governable project-context platform:
pm graph indexstatus/rebuild/clear operationspm items
Verification
84ef563e-f412-44be-80e5-462936a5134d: 5/5, no actionable findings after two accepted fixespm-changelog2026.7.18 check reports no changelog driftRemaining canonical scope
The three broad features remain open after this tranche for their explicitly recorded longer-horizon work (true delta maintenance, temporal/what-if variants, migration/backfill, and million-item evaluation). They will be released from in-progress after merged-head proof rather than falsely closed.
Summary by cubic
Adds a durable, cross-process graph index, baseline-aware governance audits with typed coverage deltas, and incremental mutation advisories to speed graph queries and strengthen integrity checks. Snapshot diffs now tolerate and migrate legacy baselines with normalized item types.
New Features
pm graph index,--rebuild,--clear, and includedurablehit/miss/off in results. Malformed result maps are rejected early and maintenance flags are scope-validated.pm graph audit --save-baselinestores a signed census; audits show change-since-baseline deltas with signed per-type coverage changes; add per-type coverage profiles and--exempt-isolate-type; detectduplicate_dependency_row(and legacy variant) with remediation; decoding hardened (reject null/array-shaped type counts); duplicate-dependency ordering is deterministic and locale-independent. Legacy baselines are auto-migrated and type names normalized during diffing.planhonors isolate-type exemptions.indexsubcommand and new flags in contracts and completion; docs updated; newdurable-cachemodule. Filters resolve via the shared extension-aware relationship registry.Migration
pm graph index,pm graph index --rebuild, andpm graph index --clear. Persistence auto-enables above a size threshold; otherwise opt in with--rebuild.pm graph audit --save-baseline; future audits will report deltas, including per-type coverage changes. Older baselines are migrated automatically during reads.--exempt-isolate-type <Type[,Type…]>to mark isolate types as policy-valid.Written for commit 1e13013. Summary will update on new commits.