Repository navigation
fix: build the review diff from Core's parsed analysis, not the document - #174
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
CodeBoarding reviewStatus: 2 changed components See the full change in CodeBoarding. graph LR
n_Repository_Analysis_and_Authentication_Tools["Repository Analysis and Authentication Tools"]
n_Remote_Review_and_Briefing_Sync["Remote Review and Briefing Sync"]
del_Action_Analysis_and_Authentication_Tools["Action Analysis and Authentication Tools"]
n_Remote_Review_and_Briefing_Sync -- "authenticates requests via" --> del_Action_Analysis_and_Authentication_Tools
classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
class n_Repository_Analysis_and_Authentication_Tools added;
class del_Action_Analysis_and_Authentication_Tools deleted;
linkStyle 0 stroke:#82071e,stroke-width:2px,stroke-dasharray:5 3;
|
ivanmilevtues
left a comment
There was a problem hiding this comment.
it seems funcitonal but the versioning is not generalizable, can we fix that before merging.
| content_hash: str | ||
|
|
||
|
|
||
| def is_v1(data: dict) -> bool: |
There was a problem hiding this comment.
this i don't like in particular.
There was a problem hiding this comment.
Agreed, it's gone.
- The version: it's named once, in
CURRENT_FORMAT_VERSION. - The classification:
read(document)classifies once, where the analysis is loaded:- no
format_versionis legacy; - the constant is current;
- any other version raises. A higher
vNsays a newer CodeBoarding wrote the file and the Action needs updating; anything else is unsupported.
- no
- After loading: each format has one reader (
_read_legacy,_read_current), and everything afterreadworks on the result. No function checks a version any more. - Adding v2: one new reader plus moving the constant.
The v1 analysis was hand-written and broke the format Core writes: one-character ids, a raw-key member, all_edges on a nested relation, a top-level relation between parents and an edges table missing an edge. Its expected extra edge came only from that nested all_edges, and #174's reader, which now reads the single v1 form, fails on it. The pair is now one analysis written by Core's two writers, both after align_relation_edges at 3adb6969: legacy at main 53f0bb8e, v1 at 3adb6969. Each method sits in one leaf, top-level relations join leaves, and ids are Core's 12-character ones. The test still asserts both give the same side document, and which edges stay extra once the calls are left to the graph. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The v1 analysis was hand-written and broke the format Core writes: one-character ids, a raw-key member, all_edges on a nested relation, a top-level relation between parents and an edges table missing an edge. Its expected extra edge came only from that nested all_edges, and #174's reader, which now reads the single v1 form, fails on it. The pair is now one analysis written by Core's two writers, both after align_relation_edges at 3adb6969: legacy at main 53f0bb8e, v1 at 3adb6969. Each method sits in one leaf, top-level relations join leaves, and ids are Core's 12-character ones. The test still asserts both give the same side document, and which edges stay extra once the calls are left to the graph. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@ivanmilevtues on the review ("the versioning is not generalizable"): Fixed before merge, along with the two minor review points.
The same change is in vscode#245, evals#38 and wrapper#111, and in Core#571's tests. graph-viewer#99 and webview#312 are handled separately. |
load_analysis already parsed both sides with the pinned release's
parse_unified_analysis and rolled relations up with its
project_relations_to_level, but the diff then read members, file hashes and
method hashes from the raw document: file_methods as {file_path, methods}
groups and methods_index. Core #571's "v1" document has neither, so once the
Action pins a release with it, the review diff fails with "'str' object has
no attribute 'get'".
The diff now reads only what Core parsed: each component's file_methods,
the root's file index and Core's projected relations at every level. The
review analyses both commits with the pinned release, so both sides are
always in the format it reads, and a format change in Core needs no change
here.
The core-compatibility job rendered the committed .codeboarding/analysis.json,
which after a pin moves can still be in the format of the release before,
which the new one refuses. It now runs InstalledCoreTests: tests/fixtures/
analysis holds one analysis as Core 0.15.5 and Core main (9cf50fb9) wrote it,
each release reads only its own, and every fixture the pinned one reads must
give the same view.
Checked on CodeBoarding's own analysis (two baseline syncs, 22 components,
depth 1 and 2) and this repo's: output and summary are byte-identical to
main's script on the legacy documents with 0.15.5, and to that again on
their v1 rewrites with Core main, where main's script fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b026ec5 to
140f605
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 140f60599c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @@ -101,8 +126,7 @@ def load_analysis(path: Path) -> dict: | |||
| root_analysis, sub_analyses = parse_unified_analysis(data) | |||
There was a problem hiding this comment.
Parse each stored analysis format independently
When the engine pin moves to the v1-writing release, a review can still use a legacy committed or stored baseline while producing a v1 head analysis. Both files are passed through the newly installed release's parse_unified_analysis, but that parser rejects the other release's format, so rendering exits before computing the diff. The compatibility test masks this by accepting success on any one fixture rather than requiring legacy/v1 mixtures; the action needs its own dual-format reader or another normalization path that can read both sides independently.
Useful? React with 👍 / 👎.
|
/codeboarding |
CodeBoarding reviewStatus: 2 changed components See the full change in CodeBoarding. graph LR
n_Repository_Analysis_and_Authentication_Tools["Repository Analysis and Authentication Tools"]
n_Remote_Review_and_Briefing_Sync["Remote Review and Briefing Sync"]
del_Action_Analysis_and_Authentication_Tools["Action Analysis and Authentication Tools"]
n_Remote_Review_and_Briefing_Sync -- "authenticates requests via" --> del_Action_Analysis_and_Authentication_Tools
classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
class n_Repository_Analysis_and_Authentication_Tools added;
class del_Action_Analysis_and_Authentication_Tools deleted;
linkStyle 0 stroke:#82071e,stroke-width:2px,stroke-dasharray:5 3;
|
It was squashed, so main holds its change but not its commits.
CodeBoarding/CodeBoarding#571 (merged) changes how Core writes
analysis.json: format"v1". It dropsmethods_index, and a leaf'sfile_methodslists method ids instead of{file_path, methods}groups. This PR makes the review diff work with whichever format the pinned release writes, so the next re-pin onto a release with #571 doesn't break it.Why it breaks today
load_analysisalready parses both sides with the pinned release'sparse_unified_analysisand rolls relations up with itsproject_relations_to_level. But the diff then read members, file hashes and method hashes from the raw document (file_methodsgroups,methods_index). On a v1 document that fails with'str' object has no attribute 'get'. I reproduced this with main's script on Core main.What changes
diff_to_mermaid.pyreads only what Core parsed: each component'sfile_methods, the root's file index, and Core's projected relations at every level. The diff and the renderer are unchanged.analysis_reader.pyand_project_relations. Both are gone.requiresFullAnalysis) andanalyze.shruns it. So base and head are always in the format the pinned release reads.core-compatibilityCI: the job rendered the committed.codeboarding/analysis.json. After a pin moves, that file can still be in the previous release's format, which the new one refuses. It now runsInstalledCoreTestsinstead:tests/fixtures/analysisholds one analysis as Core 0.15.5 and Core main (9cf50fb9) wrote it;AnalysisFormatErroron legacy;Checked
On CodeBoarding's own analysis (two consecutive baseline syncs, 22 components, depth 1 and 2) and this repo's, the diagram and summary are byte-identical in three cases:
Tests
python -m unittest discover -s testswithout Core: 344 OK, 8 skippedcodeboarding==0.15.5installed:InstalledCoreTestsand the provider drift test.InstalledCoreTestsalso passes with Core main installed.Release order
🤖 Generated with Claude Code