Fix/update rpg graph stats#83
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the RPG encoder CLI’s reporting so run_update_rpg() and check_encode.py surface statistics that reflect the graph data users actually inspect in rpg.json, including newly exposed dependency-graph counts and deltas.
Changes:
- Compute
edge_count/edges_deltainrun_update_rpg()from the serialized RPG JSON payload written to disk, and add dependency-graph stats (dep_nodes,dep_edges, deltas, anddep_to_rpg_map_size). - Extend
check_encode.pystats to include embedded dependency-graph counts. - Update
/cmind.update_rpgtemplate output text and extend tests to cover the new stats.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| CoderMind/scripts/rpg_encoder/run_update_rpg.py | Computes update stats from serialized output and adds dep-graph stat fields. |
| CoderMind/scripts/rpg_encoder/check_encode.py | Adds embedded dep-graph node/edge counts to returned stats. |
| CoderMind/templates/commands/update_rpg.md | Splits feature-graph vs dependency-graph counts in user-facing instructions/output. |
| CoderMind/tests/test_step4_integration.py | Adds assertions to validate serialized edge counts and dep-graph stats in update output. |
| CoderMind/tests/test_encode_commands.py | Adds dep-graph stats coverage for check_encode() and template text assertions. |
| CoderMind/pyproject.toml | Bumps package version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Bonytu
approved these changes
Jun 29, 2026
…lat-format RPG JSON, the edges list includes hierarchy edges like contains/composes that are not emitted by RPG.to_dict() (which run_update_rpg writes back to disk). This makes edges_delta compare two different edge definitions (pre includes hierarchy edges, post does not), producing misleading deltas on repos that still have flat-format rpg.json. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run_update_rpg()statistics soedge_count/edges_deltaare computed from the serialized RPG JSON that is actually written to disk, rather than fromupdated_rpg.edges.dep_nodesdep_edgesdep_nodes_deltadep_edges_deltadep_to_rpg_map_size/cmind.update_rpginstructions to display feature graph and dependency graph counts separately.Why
RPG.to_dict()merges dep-graph-derived semantic edges into the serializedrpg.json. The previousupdate_rpgresult usedlen(updated_rpg.edges), so it could reportedges_delta: 0even when thepersisted RPG edge set changed substantially.
This makes the command output match the graph data users actually inspect via
rpg.jsonandcheck_encode.py.Test plan
Targeted pytest:
5 passed, 39 deselected
{
"node_count": 7425,
"edge_count": 37004,
"dep_nodes": 2661,
"dep_edges": 5394
}
Notes
The full default smoke test still fails on existing unrelated repository-wide issues:
Those failures are not introduced by this PR; the scoped scripts import smoke passes.