Skip to content

feat(graph): durable indexes, governance baselines, and mutation advisories - #622

Merged
unbraind merged 12 commits into
mainfrom
feat/durable-graph-index-governance-baselines
Jul 20, 2026
Merged

unbraind merged 12 commits into
mainfrom
feat/durable-graph-index-governance-baselines

Conversation

@unbraind

@unbraind unbraind commented Jul 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

This wide SDK/CLI tranche turns the relationship graph into a durable, governable project-context platform:

  • persist fingerprint-keyed graph query results across CLI processes with atomic writes, bounded retention, invalidation, and pm graph index status/rebuild/clear operations
  • add governance audit baselines with signed drift, raw duplicate-row detection, per-type coverage profiles, isolate exemptions, and remediation planning
  • emit component-scoped ordering-cycle mutation advisories without re-running whole-workspace SCC analysis
  • preserve public SDK, CLI, MCP, completion, generated-contract, documentation, and agent-oriented compact-output parity

pm items

Verification

  • Greptile pre-push review 84ef563e-f412-44be-80e5-462936a5134d: 5/5, no actionable findings after two accepted fixes
  • 318 test files / 5,993 tests; exact 100% statements, branches, functions, and lines
  • all linked tests for the three active items passed
  • ESLint, jscpd (zero clones), CodeFactor rules, 100% docstrings, package-boundary, token-budget, contracts, docs/skills, and secret gates passed
  • 88-command package-first dogfood passed
  • fresh packed-package temp project proved cross-process cache hits, mutation invalidation, saved baseline drift, CLI index rebuild, and custom company/VCS relationship modeling through the public SDK
  • latest pm-changelog 2026.7.18 check reports no changelog drift
  • tracker validation/history/storage integrity passed; health retains only the known five actionable unknown-author history events outside this tranche

Remaining 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

    • Durable graph index persisted under runtime with atomic writes, fingerprint keys (including extension relationship semantics), and cross-process locking for read/merge/write and clear; expose status/rebuild/clear via pm graph index, --rebuild, --clear, and include durable hit/miss/off in results. Malformed result maps are rejected early and maintenance flags are scope-validated.
    • Governance baselines: pm graph audit --save-baseline stores a signed census; audits show change-since-baseline deltas with signed per-type coverage changes; add per-type coverage profiles and --exempt-isolate-type; detect duplicate_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.
    • Incremental mutation advisories: component-scoped ordering-cycle detection without full workspace SCC runs; works directly from normalized dependency rows. Remediation plan honors isolate-type exemptions.
    • CLI/MCP/SDK parity: add index subcommand and new flags in contracts and completion; docs updated; new durable-cache module. Filters resolve via the shared extension-aware relationship registry.
  • Migration

    • Warm or manage the index with pm graph index, pm graph index --rebuild, and pm graph index --clear. Persistence auto-enables above a size threshold; otherwise opt in with --rebuild.
    • Establish an audit baseline once with pm graph audit --save-baseline; future audits will report deltas, including per-type coverage changes. Older baselines are migrated automatically during reads.
    • Use --exempt-isolate-type <Type[,Type…]> to mark isolate types as policy-valid.
    • First run will rebuild caches due to the updated graph fingerprint (now also includes extension relationship semantics).

Written for commit 1e13013. Summary will update on new commits.

Review in cubic

unbraind added 3 commits July 20, 2026 05:45
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.

@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 exact current head.

@coderabbitai full review

@gemini-code-assist review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

@unbraind: Starting a full review of the exact current head for #622.

✅ Action performed

Full review finished.


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

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR expands pm graph with durable indexing, audit baselines, type-aware governance coverage, duplicate dependency findings, expanded CLI/MCP contracts, and incremental ordering-cycle advisories. It adds persistence, invalidation, remediation, documentation, tests, and project-tracking evidence.

Changes

Graph platform enhancements

Layer / File(s) Summary
Graph command contracts and entry points
src/cli/*, src/mcp/*, src/sdk/cli-contracts/*, src/sdk/runtime-input.ts, tests/fixtures/contracts/full.json
Adds the index subcommand and supports isolate-type exemptions, baseline saving, rebuild, and clear options across CLI, MCP, schemas, completions, and runtime normalization.
Assembly and governance reporting
src/sdk/graph/assembly.ts, src/sdk/graph/governance.ts, src/sdk/graph/remediation.ts, src/sdk/graph/index.ts, src/sdk/dependencies.ts
Adds duplicate dependency-row findings, per-type coverage profiles, audit snapshot deltas, registry-aware fingerprints, normalized targets, expanded exports, and remediation mappings.
Durable cache, baselines, and index execution
src/sdk/graph/durable-cache.ts, src/sdk/graph/cache.ts, src/sdk/graph/run.ts
Adds fingerprinted durable query caching, audit baseline persistence, atomic writes, cache status, rebuild/clear operations, flag validation, and baseline deltas in audit results.
Component-scoped ordering advisories
src/sdk/graph/mutation-advisory.ts
Replaces whole-workspace cycle analysis with ordering digraph construction, weak-component scoping, canonical cycle diffing, and defensive path extraction.
Validation, documentation, and project records
tests/unit/sdk/graph/*, tests/unit/cli/*, tests/unit/sdk/runtime-input-graph.spec.ts, docs/*, .agents/pm/*
Adds coverage for governance, persistence, contracts, advisories, documentation, feature state, issue tracking, test runs, and review evidence.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 90.57% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main graph durability, governance, and mutation-advisory changes.
Description check ✅ Passed The description is detailed and directly matches the changeset, verification, and remaining scope.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

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

Comment thread src/sdk/graph/mutation-advisory.ts Resolved
Comment thread src/sdk/graph/assembly.ts Resolved
Comment thread src/sdk/graph/governance.ts Resolved
Comment thread src/sdk/graph/governance.ts Resolved
@greptile-apps

greptile-apps Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR turns the relationship graph into a durable, governable graph platform. The main changes are:

  • Adds a fingerprint-keyed durable graph index with status, rebuild, and clear operations.
  • Adds audit baselines with signed drift, per-type coverage, isolate type exemptions, and duplicate dependency-row detection.
  • Adds component-scoped ordering-cycle mutation advisories without full-workspace SCC analysis.
  • Updates CLI, SDK, MCP, generated contracts, completions, docs, and tests for the new graph features.

Confidence Score: 5/5

This 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.

T-Rex T-Rex Logs

What T-Rex did

  • The T-Rex proof run observed an absent initial index, rebuilt a fresh index with runtime/graph-cache.json persisted, verified a successor query returned pm-child, noted a fresh status in a later CLI process, and then removed the graph-cache.json to clean up.
  • The audit flow persisted the graph-audit-baseline.json after running --save-baseline, establishing a baseline for later comparison.
  • A follow-up audit reported baseline.same_snapshot=false and noted drift for pm-drift, specifically isolated_active_node.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/sdk/graph/run.ts Adds durable index orchestration, audit baseline deltas, scoped flag validation, and extension-aware kind parsing.
src/sdk/graph/durable-cache.ts Introduces atomic durable graph result storage and audit baseline decode/persist helpers.
src/sdk/graph/governance.ts Extends audits with duplicate raw-row findings, per-type coverage profiles, isolate type exemptions, and baseline snapshot diffing.
src/sdk/graph/mutation-advisory.ts Reworks mutation advisories to use component-scoped ordering digraph cycle detection.
src/sdk/graph/assembly.ts Adds extension registry sharing, type projection, and pre-assembly duplicate dependency row collection.
src/sdk/graph/cache.ts Expands graph fingerprints to include item type and relationship-kind semantics.
src/sdk/graph/remediation.ts Adds remediation templates for duplicate dependency row governance and isolate type exemptions.
src/cli/register-list-query.ts Wires new graph index and audit baseline/exemption CLI flags into graph command invocation.
tests/unit/sdk/graph/durable-cache.spec.ts Adds coverage for durable cache decoding, persistence, rebuild, baseline migration, and type-scoped exemptions.
tests/unit/sdk/graph/mutation-advisory.spec.ts Updates mutation advisory tests for scoped ordering-cycle detection.

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
Loading
%%{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
Loading

Reviews (19): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

@codspeed

codspeed Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 4 benchmarks

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 6 improved benchmarks
❌ 4 regressed benchmarks
✅ 1 untouched benchmark

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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)

Open in CodSpeed

@greptile-apps

greptile-apps Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR turns graph queries into a durable and governable workspace surface. The main changes are:

  • Durable graph result indexes with status, rebuild, clear, retention, and cache metadata.
  • Audit baselines with signed drift, duplicate-row detection, per-type coverage, and isolate exemptions.
  • Component-scoped ordering-cycle mutation advisories.
  • CLI, MCP, SDK contract, completion, docs, and test updates for the new graph surfaces.

Confidence Score: 4/5

Safe 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

T-Rex T-Rex Logs

What T-Rex did

  • Executed a focused TypeScript repro that builds identical workspace items with two custom relationship-kind registries whose custom_flow precedence differs.
  • Observed that both assemblies produced the same computeWorkspaceGraphFingerprint value even though fresh assembly semantics differ between source_before_target and target_before_source, and that WorkspaceGraphCache.lookup returned secondLookupAssemblyReused while retaining the first assembly's source_before_target precedence.
  • Found that memoized query results were reused under the unchanged fingerprint, returning stale source_before_target semantics.
  • Tracked graph index state across rebuild, clear, and mutation: before rebuild the index was absent, after rebuild it was fresh with entry_count: 2, subsequent graph analyze --summary calls reported cache.durable: hit, and a clear reset returned the index to absent; after removing a dependency via item metadata mutation the status became stale with a new fingerprint and the next query used cache.durable: miss with updated edge counts.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
src/sdk/graph/run.ts Adds graph index, durable result lookup, audit baseline handling, and new option plumbing; cache fingerprinting misses relationship-kind registry changes.
src/sdk/graph/cache.ts Extends workspace graph fingerprinting for item type coverage but still keys only item fields and terminal status, not extension relationship-kind definitions.
src/sdk/graph/durable-cache.ts Adds atomic durable graph result envelopes and audit baseline persistence with defensive decoding.
src/sdk/graph/governance.ts Adds duplicate dependency-row findings, per-type coverage profiles, isolate type exemptions, and signed audit snapshot deltas.
src/sdk/graph/assembly.ts Adds pre-assembly duplicate dependency-row detection and carries item type/details into graph assembly.
src/sdk/graph/mutation-advisory.ts Reworks mutation cycle advisories to use lightweight component-scoped ordering digraphs.
src/sdk/runtime-input.ts Adds MCP/runtime normalization for graph index, audit baseline, and isolate-type options.
src/cli/register-list-query.ts Updates CLI graph command registration and option forwarding for index and governance flags.
tests/unit/sdk/graph/durable-cache.spec.ts Adds coverage for durable cache primitives, graph index behavior, baselines, and isolate type exemptions.

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
Loading
%%{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
Loading

Comments Outside Diff (1)

  1. src/sdk/graph/run.ts, line 1071-1075 (link)

    P1 Registry changes keep stale indexes
    lookup.fingerprint is computed only from item metadata, but assembleWorkspaceRelationshipGraph also consumes the active extension relationship-kind registry. When an extension changes a relationship kind or precedence while items stay unchanged, the in-process and durable cache keys remain identical, so openDurableGraphCache can return results built under the old registry. Include a stable digest of active relationship-kind definitions in the fingerprint or cache key before using durable results.

    Artifacts

    Repro: focused TypeScript script proving unchanged fingerprint across registry semantic changes and stale cache reuse

    • Contains supporting evidence from the run (text/plain; charset=utf-8).

    Repro: execution log with fingerprint values, registry precedence values, cache hit state, stale result, and exit code

    • Keeps the command output available without making the summary code-heavy.

    View artifacts

    T-Rex Ran code and verified through T-Rex

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/sdk/graph/run.ts
    Line: 1071-1075
    
    Comment:
    **Registry changes keep stale indexes**
    `lookup.fingerprint` is computed only from item metadata, but `assembleWorkspaceRelationshipGraph` also consumes the active extension relationship-kind registry. When an extension changes a relationship kind or precedence while items stay unchanged, the in-process and durable cache keys remain identical, so `openDurableGraphCache` can return results built under the old registry. Include a stable digest of active relationship-kind definitions in the fingerprint or cache key before using durable results.
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
src/sdk/graph/run.ts:1071-1075
**Registry changes keep stale indexes**
`lookup.fingerprint` is computed only from item metadata, but `assembleWorkspaceRelationshipGraph` also consumes the active extension relationship-kind registry. When an extension changes a relationship kind or precedence while items stay unchanged, the in-process and durable cache keys remain identical, so `openDurableGraphCache` can return results built under the old registry. Include a stable digest of active relationship-kind definitions in the fingerprint or cache key before using durable results.

Reviews (2): Last reviewed commit: "pm: record graph platform acceptance evi..." | Re-trigger Greptile

@codecov

codecov Bot commented Jul 20, 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 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.

Comment thread src/sdk/graph/governance.ts Resolved
Comment thread src/sdk/graph/durable-cache.ts Resolved
Comment thread src/sdk/graph/assembly.ts Resolved
Comment thread src/sdk/graph/governance.ts Resolved
Comment thread src/sdk/graph/durable-cache.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 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

📥 Commits

Reviewing files that changed from the base of the PR and between c091a0b and 1e62a60.

📒 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.toon
  • docs/COMMANDS.md
  • docs/RELATIONSHIP_GRAPH.md
  • docs/SDK.md
  • src/cli/commands/completion.ts
  • src/cli/register-list-query.ts
  • src/mcp/tool-definitions.ts
  • src/sdk/cli-contracts/enum-contracts.ts
  • src/sdk/cli-contracts/flag-contracts.ts
  • src/sdk/cli-contracts/tool-option-contracts.ts
  • src/sdk/cli-contracts/tool-parameter-tables.ts
  • src/sdk/cli-contracts/tool-schema.ts
  • src/sdk/graph/assembly.ts
  • src/sdk/graph/cache.ts
  • src/sdk/graph/durable-cache.ts
  • src/sdk/graph/governance.ts
  • src/sdk/graph/index.ts
  • src/sdk/graph/mutation-advisory.ts
  • src/sdk/graph/remediation.ts
  • src/sdk/graph/run.ts
  • src/sdk/runtime-input.ts
  • tests/fixtures/contracts/full.json
  • tests/unit/cli/register-list-query.spec.ts
  • tests/unit/sdk/graph/assembly-governance.spec.ts
  • tests/unit/sdk/graph/durable-cache.spec.ts
  • tests/unit/sdk/graph/mutation-advisory.spec.ts
  • tests/unit/sdk/runtime-input-graph.spec.ts

Comment thread src/sdk/graph/assembly.ts Resolved
Comment thread src/sdk/graph/run.ts Resolved
Comment thread tests/fixtures/contracts/full.json Resolved
@unbraind

Copy link
Copy Markdown
Owner Author

Greptile feedback acknowledgement (comments 5018738381 and 5018745486): both P1 findings are accepted and fixed locally. graph plan now forwards type-scoped isolate exemptions, and the workspace fingerprint now incorporates the complete stable relationship-kind registry definition set so extension precedence/schema changes invalidate both cache tiers. The reported temp create failures were not reproducible: focused durable tests pass, and the final repository run is 318 files / 5,994 tests at exact 100/100/100/100.

@unbraind

Copy link
Copy Markdown
Owner Author

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.

@unbraind

Copy link
Copy Markdown
Owner Author

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.

@unbraind

Copy link
Copy Markdown
Owner Author

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.
@unbraind

Copy link
Copy Markdown
Owner Author

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
@coderabbitai full review
@gemini-code-assist review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

@unbraind: Re-reviewing the complete current head, with focused validation of extension-semantics cache invalidation, neutral rebuild behavior, defensive baseline decoding, deterministic governance ordering, and graph-plan option forwarding.

✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 16 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 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.

Comment thread src/sdk/graph/assembly.ts Resolved
Comment thread src/sdk/graph/governance.ts Resolved
Comment thread src/sdk/graph/run.ts Resolved
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.
@unbraind

Copy link
Copy Markdown
Owner Author

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

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

@unbraind: Re-reviewing the complete current head, including the final fixes in c188af81.

✅ 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 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.

Comment thread src/sdk/graph/durable-cache.ts Resolved
Comment thread src/sdk/graph/governance.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

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

diffRelationshipAuditSnapshots omits coverage_by_type from the profile delta.

Every other RelationshipCoverageProfile field (nodes, edges, active_nodes, missing_nodes, isolated_active_nodes, degree_leq_one_active_nodes, edges_by_kind) is diffed, but the newly added coverage_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

📥 Commits

Reviewing files that changed from the base of the PR and between 1e62a60 and c188af8.

📒 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.jsonl
  • src/sdk/dependencies.ts
  • src/sdk/graph/assembly.ts
  • src/sdk/graph/cache.ts
  • src/sdk/graph/durable-cache.ts
  • src/sdk/graph/governance.ts
  • src/sdk/graph/mutation-advisory.ts
  • src/sdk/graph/run.ts
  • tests/unit/sdk/graph/assembly-governance.spec.ts
  • tests/unit/sdk/graph/cache.spec.ts
  • tests/unit/sdk/graph/durable-cache.spec.ts
  • tests/unit/sdk/graph/run.spec.ts

Comment thread src/sdk/graph/durable-cache.ts Resolved
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.
@unbraind

Copy link
Copy Markdown
Owner Author

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

@unbraind

Copy link
Copy Markdown
Owner Author

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

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

@unbraind: Starting a full review of the latest head (c4141c2d), including the locale-independent case-folded ordering and exact-spelling tie-breaker changes.

✅ 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 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.

Comment thread src/sdk/graph/governance.ts Resolved
Comment thread src/sdk/graph/governance.ts Resolved
Comment thread src/sdk/graph/governance.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

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 win

Rebuild-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/audit calls explicitly pass { summary: true } (matching the warmed summary: true invocation), but there's no assertion for the default, no-flag pm graph analyze/pm graph audit call after --rebuild — which is the scenario flagged in src/sdk/graph/run.ts (runGraphIndex, warmInvocation.summary: true). Adding a case for the plain default call would make the summary mismatch (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 win

Align rebuild warming with the default query key. buildGraphQueryKey includes summary, and runGraph leaves summary at false unless the flag is passed, so index --rebuild currently warms a different durable entry than a plain analyze/audit call. The rebuild test only covers the summary: true follow-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

📥 Commits

Reviewing files that changed from the base of the PR and between c188af8 and c4141c2.

📒 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.jsonl
  • src/sdk/graph/assembly.ts
  • src/sdk/graph/durable-cache.ts
  • src/sdk/graph/governance.ts
  • src/sdk/graph/run.ts
  • tests/unit/sdk/graph/assembly-governance.spec.ts
  • tests/unit/sdk/graph/durable-cache.spec.ts

Comment thread src/sdk/graph/governance.ts Resolved
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.
@unbraind

Copy link
Copy Markdown
Owner Author

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

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

@unbraind: Starting a full review of the latest head (2b885104), including legacy snapshot-delta compatibility and the documented AuditNodeState false positives.

✅ Action performed

Full review finished.


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

Comment thread src/sdk/graph/durable-cache.ts Resolved

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

Comment thread src/sdk/graph/assembly.ts Resolved
Comment thread src/sdk/graph/cache.ts Resolved
@unbraind

Copy link
Copy Markdown
Owner Author

Review round updated at 65ec30d9 with all three late findings fixed, regression-tested, and threads resolved.

@greptileai review
@coderabbitai full review
@gemini-code-assist review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

@unbraind: Starting a full review of the updated head (65ec30d9), including the three late-finding fixes and their regressions.

✅ Action performed

Full review finished.


Your plan includes PR reviews subject to rate limits. More reviews will be available in 30 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 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.

@unbraind

Copy link
Copy Markdown
Owner Author

Final review acknowledgements for exact head 65ec30d9:

  • @coderabbitai: thank you; the full updated-head review completed with no new actionable comments. All prior findings are answered and resolved.
  • @gemini-code-assist: thank you; the final review explicitly reports no feedback. All prior findings are answered and resolved.
  • @greptileai: thank you; the final 5/5 report confirms the legacy-baseline migration and marks the reviewed paths safe to merge.

The exact-head check set is fully green and the final thread inventory has zero unresolved threads.

@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown

Acknowledged. All review passes on exact head 65ec30d9 are confirmed green, zero unresolved threads. This tranche is clear from a review standpoint — safe to merge.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@unbraind Thanks for the thorough final verification. Acknowledged: exact head 65ec30d9 is green, all prior findings are resolved, and the final review inventory is clear.

@unbraind

Copy link
Copy Markdown
Owner Author

Branch protection required the latest main, so head 1e13013f now includes release commit 54e29e50 via the installed field-aware merge path. Build and the 36 focused graph regressions pass after integration.

@greptileai review
@coderabbitai full review
@gemini-code-assist review

@coderabbitai

coderabbitai Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

@unbraind: Starting a full review of the integrated head 1e13013f, including the latest main release integration.

✅ Action performed

Full review finished.


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

@unbraind

Copy link
Copy Markdown
Owner Author

Integrated-head acknowledgements:

  • @coderabbitai: thank you; full review of 1e13013f completed with no new findings.
  • @greptileai: thank you; the final check is green after the latest-main integration.

The integrated head is CLEAN and MERGEABLE, every check is green, and the thread inventory remains empty.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@unbraind Thanks for the confirmation. The integrated head 1e13013f is acknowledged as clean and mergeable, with all checks passing and no remaining review threads.

@unbraind
unbraind merged commit e98282a into main Jul 20, 2026
33 checks passed
@unbraind
unbraind deleted the feat/durable-graph-index-governance-baselines branch July 20, 2026 07:12
@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown

Acknowledged. The integrated head at 1e13013f is confirmed clean — no findings, all checks green, thread inventory empty. This PR is ready to merge.

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

Comment thread src/sdk/graph/mutation-advisory.ts Resolved
@unbraind

unbraind commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

Tracked in PM: pm-6x7o, pm-7ob5, pm-ikv6m0, pm-ju83.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant