refactor(intelligence): bound architecture snapshot reads (#133)#150
refactor(intelligence): bound architecture snapshot reads (#133)#150hardikuppal04 wants to merge 2 commits into
Conversation
parthrohit22
left a comment
There was a problem hiding this comment.
Thanks for the focused change and the strong test/CI coverage. I’m requesting changes because the implementation does not yet fully satisfy #133’s bounded-read contract.
-
Diagnostics are still unbounded.
architecture_facts()loads every diagnostic in the sealed snapshot, although Architecture only rendersRI-RES-UNRESOLVEDandRI-RES-AMBIGUOUS. Large parse-diagnostic inventories therefore remain fully hydrated. Please filter the query to the codes Architecture actually consumes. -
Evidence loading is not batched.
_evidence_for()sends every endpoint-node or relationship-edge ID through oneIN (...)query. A large repository can exceed backend parameter limits. The current large-snapshot test creates many irrelevant records but only one relationship, so it does not exercise this failure mode.
Please batch or relationship-scope the evidence query and add regression coverage with enough relevant edges/endpoints to validate the bound.
b2829d2 to
5e7a9de
Compare
Summary
Bounds Architecture's sealed-snapshot reads so a large repository does not hydrate unrelated snapshot facts or exceed database parameter limits while loading relationship evidence.
Linked issue
Closes #133
What changed
Acceptance criteria completed
test_architecture_fact_query_batches_relevant_evidence_idscreates 501 relevant edges and 502 endpoint nodes, asserts complete results, and proves all node/edge evidence queries stay within the 500-ID bound.test_architecture_fact_query_excludes_irrelevant_large_snapshot_recordspersists 64 irrelevant parser diagnostics and verifies they are absent from both the query facts and the Architecture response.REPOSITORY_INTELLIGENCE.md.Testing performed
Screenshots
Not applicable; this is an internal backend read-bound and architecture documentation change.
Security and data considerations
Owner scoping and sealed-snapshot semantics are preserved. No authentication boundary, public API schema, migration, secret, logging, or untrusted-input behavior changes.
Dependencies and blocked work
None.
Scope changes or remaining work
None.
Contributor checklist
devupstream/devupstream/devCloses) is used only because the issue is fully resolved