[PR #7305] test(devicetree): cover summary counts, node paging, and property selection in devicetree views #7811

Open
opened 2026-11-05 01:47:50 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7305
Author: @saiyam-jain-dev
Created: 10/26/2026
Status: 🔄 Open

Base: main ← Head: test/devicetree-view-coverage


📝 Commits (2)

  • 971d4d6 test(devicetree): cover summary counts, node paging, and property selection in devicetree views
  • 0b7f6f5 test(devicetree): cover subsequent page and assert structured errors

📊 Changes

1 file changed (+415 additions, -0 deletions)

View changed files

➕ src/domain/analysisView/devicetreeView.test.ts (+415 -0)

📄 Description

Summary

Adds comprehensive unit tests in src/domain/analysisView/devicetreeView.test.ts covering Devicetree analysis view projections, including summary count/reference calculations, node paging, property selection by node path, collection validation rules, and error handling for unsupported view kinds and missing node paths.

Problem and expected behavior

While projectDevicetreeView implements summary and paging views for Flattened Devicetree (.dtb) inspection evidence, it previously lacked a dedicated unit test suite covering its projection logic, collection validation rules (e.g. requiring path for properties, rejecting path for reservations/references, and handling nonexistent nodes), and calculated summary counters.

Change and scope

  • Created src/domain/analysisView/devicetreeView.test.ts verifying:
    • Summary view calculation of reservation_count, reference_count, and unresolved_reference_count.
    • Node collection paging with omission of nested properties, calculation of property_count, and assignment of source_index.
    • Node selection by exact path preserving original node index.
    • Property paging for a selected node path.
    • Refusal of property queries without a path or with an absent node path.
    • Reservation and reference collection paging with source_index.
    • Refusal of path on collections that do not support path selection.
    • Rejection of unsupported view kinds with AnalysisInputError.

Contribution scope fit: test-only coverage improvement within existing boundaries (not applicable).

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/domain/analysisView/devicetreeView.test.ts.
  • Contribution scope fit and linked maintainer decision: not applicable.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: platform-independent.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): none.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: src/domain/analysisView/devicetreeView.test.ts
  • Base reproduction or other evidence: previously unexercised projection code.
  • User-visible CLI/MCP output: none.
  • Remaining proof gaps: none.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npx vitest run src/domain/analysisView/devicetreeView.test.ts — passed (9 passed in 35ms)
  • npm run check:fast (turbo run typecheck lint) — passed cleanly (2/2 tasks successful in 50s)

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner: @saiyam-jain-dev

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/7305 **Author:** [@saiyam-jain-dev](https://github.com/saiyam-jain-dev) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/devicetree-view-coverage` --- ### 📝 Commits (2) - [`971d4d6`](https://github.com/morluto/rea/commit/971d4d6a7eb44a2550e1e59bb63705a4e00dc921) test(devicetree): cover summary counts, node paging, and property selection in devicetree views - [`0b7f6f5`](https://github.com/morluto/rea/commit/0b7f6f5b2bed5d02b7b4100f46c9c129c41b7689) test(devicetree): cover subsequent page and assert structured errors ### 📊 Changes **1 file changed** (+415 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `src/domain/analysisView/devicetreeView.test.ts` (+415 -0) </details> ### 📄 Description ## Summary Adds comprehensive unit tests in `src/domain/analysisView/devicetreeView.test.ts` covering Devicetree analysis view projections, including summary count/reference calculations, node paging, property selection by node path, collection validation rules, and error handling for unsupported view kinds and missing node paths. ## Problem and expected behavior While `projectDevicetreeView` implements summary and paging views for Flattened Devicetree (`.dtb`) inspection evidence, it previously lacked a dedicated unit test suite covering its projection logic, collection validation rules (e.g. requiring `path` for properties, rejecting `path` for reservations/references, and handling nonexistent nodes), and calculated summary counters. ## Change and scope - Created `src/domain/analysisView/devicetreeView.test.ts` verifying: - Summary view calculation of `reservation_count`, `reference_count`, and `unresolved_reference_count`. - Node collection paging with omission of nested properties, calculation of `property_count`, and assignment of `source_index`. - Node selection by exact `path` preserving original node index. - Property paging for a selected node path. - Refusal of property queries without a `path` or with an absent node `path`. - Reservation and reference collection paging with `source_index`. - Refusal of `path` on collections that do not support path selection. - Rejection of unsupported view kinds with `AnalysisInputError`. Contribution scope fit: test-only coverage improvement within existing boundaries (not applicable). ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/domain/analysisView/devicetreeView.test.ts`. - Contribution scope fit and linked maintainer decision: not applicable. - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: platform-independent. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): none. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none. Expected effects: - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: `src/domain/analysisView/devicetreeView.test.ts` - Base reproduction or other evidence: previously unexercised projection code. - User-visible CLI/MCP output: none. - Remaining proof gaps: none. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npx vitest run src/domain/analysisView/devicetreeView.test.ts` — passed (9 passed in 35ms) - `npm run check:fast` (`turbo run typecheck lint`) — passed cleanly (2/2 tasks successful in 50s) ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none. ## Author readiness Human owner: @saiyam-jain-dev - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7811
No description provided.