oracle: golden arch-graph fixture — run arch/ on real oracle-shaped data - #20
Conversation
The in-scope half of слой 2: validate the architecture pass on a real, faithful graph of the LeakyOracle app (8 internal types + the framework types they touch) instead of synthetic fixtures, and pin the graph.json contract the Own.NET-side Roslyn extractor must emit for the oracle. - oracle/fixtures/graph.json — faithful arch-graph of the oracle (ownAudit/arch-graph/v1). - oracle/fixtures/rules.json — an MVVM layering profile (Views -> ViewModels -> Services; reverse forbidden), showing the rules engine is configurable per codebase, not STS-hardcoded. - test_oracle_arch.py: clean faithful graph -> 0 findings (arch/ doesn't cry wolf on well-layered MVVM; the oracle's smells are lifetime/heap, not architecture). One planted MVVM inversion (WatchlistViewModel -> MainWindow) -> exactly ARCH-MVVM-VM-VIEW + ARCH-CYCLE-TYPE + ARCH-CYCLE-NS. Also guards the graph against drift (every internal node must point at a real file under oracle/). Wired into CI (normal + -O). All suites green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LLHz4cevQyXHKZnjzCqhoa
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds Oracle architecture fixtures, a dedicated golden test module, documentation for the fixture contract and usage, and CI steps that run the new test script in normal and optimized Python mode. ChangesOracle arch fixtures and CI
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f388d2137
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { "from": "T:LeakyOracle.Views.MainWindow", "to": "T:LeakyOracle.ViewModels.QuoteRow", "kind": "depends" }, | ||
| { "from": "T:LeakyOracle.Views.MainWindow", "to": "T:Avalonia.Controls.Window", "kind": "depends" }, | ||
|
|
||
| { "from": "T:LeakyOracle.Services.MarketDataService", "to": "T:System.EventHandler`1", "kind": "depends" }, |
There was a problem hiding this comment.
Add the missing System.String dependencies
Under the current extractor contract this fixture is not reproducible: docs/arch-graph.md:134-136 says method parameter/return types and generic type arguments are dependencies, but MarketDataService records only EventHandler<T> here while the real source has EventHandler<string> and Tick(string symbol). A Roslyn extractor that follows the documented contract will emit a T:System.String external node/edge, so this “exact” golden graph will immediately drift or force the extractor to drop valid dependencies.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fair and correct — fixed in 0955244. You caught a framing bug: I called this an "exact" golden while hand-authoring can't be byte-exact on BCL leaves, and I'd inconsistently kept EventHandler<T> but dropped its <string> arg. Two-part fix: (1) added System.String (external node) + edges from the six types that reference it via EventHandler<string>/Tick(string)/QuoteRow(string)/string[] — and String earns its place since string duplication is one of the oracle's own smells; (2) reframed the contract — the internal type graph is what the extractor must reproduce; external nodes list the meaningful framework types, and pure-infrastructure leaves (Int32/Console/GC/attributes/arrays) are elided, so a faithful extractor emits a superset. The test already pins only the internal subgraph, not external completeness. Still 0 findings on the clean graph; 4/4 normal + -O.
Generated by Claude Code
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@oracle/fixtures/graph.json`:
- Line 2: The fixture comment in the graph JSON references a non-existent
graph.degraded.json, which conflicts with the documented in-memory degraded
variant. Update the _comment text to remove that file reference and instead
point readers to the in-memory regression variant described in the repo docs,
keeping the wording aligned with the intent of Oracle/LeakyOracle and the Roslyn
extractor contract.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 912eff5e-6590-4c47-9aa0-2c52bd6cafc8
📒 Files selected for processing (5)
.github/workflows/ci.ymloracle/fixtures/README.mdoracle/fixtures/graph.jsonoracle/fixtures/rules.jsonoracle/fixtures/test_oracle_arch.py
… P2, CodeRabbit) Codex: the documented extractor contract (docs/arch-graph.md) counts param/return types and generic args as dependencies, so a faithful extractor emits System.String edges for EventHandler<string>/Tick(string)/QuoteRow(string)/string[] — which the golden omitted. Add System.String (an external node) + its edges from the six types that reference it. String earns its place: string duplication is one of the oracle's own smells. Reframe to match reality: hand-authoring can't be byte-exact on BCL leaves, so the INTERNAL type graph is the contract the extractor must reproduce; external nodes list the meaningful framework types, and pure-infrastructure leaves (Int32, Console, GC, attributes, arrays) are elided — a faithful extractor emits a superset. The test already pins only the internal subgraph, not external completeness. CodeRabbit: the _comment's stale reference to a non-existent graph.degraded.json is removed by the same reframe (the regression variant is in-memory in the test). Still 0 findings on the clean graph; test 4/4 normal + -O. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LLHz4cevQyXHKZnjzCqhoa
What
The in-scope half of слой 2: validate the architecture pass (
arch/) on a real, faithful graph of the LeakyOracle app instead of synthetic fixtures, and pin the exactgraph.jsoncontract the Own.NET-side Roslyn extractor (слой 2 proper) must emit for it.Files (
oracle/fixtures/)graph.json— faithful arch-graph of the oracle: 8 internal types + the framework types they touch, real dependency edges (ownAudit/arch-graph/v1). This is the extractor contract.rules.json— an MVVM layering profile (the defaultarch/rules.jsonis STS-specific). Allowed:Views → ViewModels → Services; reverse forbidden. Shows the rules engine is configurable per codebase, not STS-hardcoded.test_oracle_arch.py— wired into CI (normal +-O).What it proves
arch/correctly stays silent — its real smells are lifetime/heap (OWN001, string-dup, XAML107), not architecture. Guards against false positives on clean code.WatchlistViewModel → MainWindow) → 3 rules fire:ARCH-MVVM-VM-VIEW(forbidden direction) +ARCH-CYCLE-TYPE({MainWindow, WatchlistViewModel}) +ARCH-CYCLE-NS({ViewModels, Views}). One edge, three distinct rule classes.oracle/, so the golden can't silently diverge from the app it describes.The degraded graph is kept in-memory (clean graph + one documented edge) — single source of truth, no duplicated fixture to drift.
Scope
Pure Python + fixtures, fully in-scope. When слой 2 lands in Own.NET, its extractor over LeakyOracle should reproduce
graph.json(up to ids/loc), and this same pass runs on extracted data — the contract makes that swap mechanical.🤖 Generated with Claude Code
Generated by Claude Code
Summary by CodeRabbit
New Features
Tests
-O) modes.