[PR #4026] [MERGED] fix(contracts): complete canonical mobile graph inventory examples #5999

Closed
opened 2026-10-31 01:11:04 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4026
Author: @z2Ace0107
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @morluto

Base: main ← Head: fix/3951-canonical-graph-examples


📝 Commits (3)

  • 796fa49 fix(contracts): complete canonical mobile graph inventory examples
  • 41ae0cb test(contracts): place canonical graph CLI regression in acceptance
  • fc3e28f refactor(contracts): reuse artifact identity owners in mobile examples

📊 Changes

2 files changed (+134 additions, -26 deletions)

View changed files

📝 src/contracts/mobileApplicationGraphExamples.ts (+29 -26)
➕ tests/acceptance/tools/mobileGraphExamples.test.ts (+105 -0)

📄 Description

Summary

Fixes #3951. All four canonical mobile graph examples failed when their nested inventory Evidence was validated during execution.

 inventory example
+ integrity_contradictions: []
+ coverage: { scope: "root", status: "complete" }
- validate as arbitrary JSON
+ validate with the inventory result schema

Problem and expected behavior

The Android, IPA, macOS and Harmony examples omitted required inventory fields. The outer request schema accepted them, but each public CLI operation returned invalid_request. Canonical examples should execute while retaining their root-only projection limits.

Change and scope

Keep the compiled CLI regression in the acceptance test layer. Complete the shared inventory example builder and validate it with artifactInventoryResultSchema so future required-field drift fails at the owning boundary. Existing createEvidence calls regenerate the enclosing Evidence. Artifact, occurrence, graph and manifest identities now use their existing artifactIdentity.ts owner functions instead of duplicating their formulas. The four graph digests and manifest IDs are unchanged; runtime validation is unchanged. This ordinary example correction requires no advance provider/authority decision.

Contract and boundary impact

  • Semantic owner: canonical inventory examples in mobileApplicationGraphExamples.ts.
  • Scope: existing offline application graph projection; scope decision not applicable.
  • CLI/MCP schemas/tool catalog: no schema or tool inventory changes. Examples now provide valid nested Evidence; these inline Evidence examples are not advertised as MCP input examples.
  • Provider/bridge/platform: no provider or bridge changes; tests run offline on Windows.
  • Evidence: explicit integrity facts and root coverage, with authenticated enclosing Evidence; output remains partial.
  • Target selection/authority/cleanup: projection consumes supplied Evidence; no fixture target files, live devices or engines needed.
  • Generated metadata/package/install: regenerated ignored artifacts are excluded; no package changes.

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

  • Before: all four new public CLI example regressions failed with exit1 and missing integrity_contradictions / coverage diagnostics.
  • After: all four examples execute as both inline JSON and file inputs in empty temporary directories, return authenticated projection Evidence, and preserve coverage: {status: "partial", inventory_complete: true}.
  • Review follow-up: all four compiled examples preserve their pre-refactor graph digests and manifest IDs after switching to the shared identity functions.
  • A validly authenticated input with an unsupported coverage status still fails with invalid_request and a coverage-status diagnostic.

Validation performed

Windows x64, pinned Node24.18.0/npm11.16.0:

  • npm run test:focused -- tests/acceptance/tools/mobileGraphExamples.test.ts tests/boundary/mcp/mobileApplicationGraphMcp.test.ts — 7 passed, zero skipped (5 new CLI cases and2 existing MCP cases).
  • npm run check — passed; lint0 errors,1448 repository warnings.
  • npm run verify:test-discovery — all1322 test files discovered exactly once.
  • npm run docs:check — passed; generated-document checks and5 README consistency tests.
  • git diff --check — passed.

Compatibility, safety, and release

No API/schema migration or package/install change. Live Android/Apple/Harmony devices and native engines were not used or claimed; these are Evidence-only projections. No macOS/Linux or full-suite run. Canonical envelopes change because their inventory payloads are completed.

Merge Danger

Door: two-way — revert the example builder and regression test.

Blast Radius: examples — canonical mobile graph inputs; runtime projection and validation remain unchanged.

Author readiness

Human owner: @z2Ace0107

  • 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/4026 **Author:** [@z2Ace0107](https://github.com/z2Ace0107) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/3951-canonical-graph-examples` --- ### 📝 Commits (3) - [`796fa49`](https://github.com/morluto/rea/commit/796fa49c701bd4b81407af080bc50d720b78f1a6) fix(contracts): complete canonical mobile graph inventory examples - [`41ae0cb`](https://github.com/morluto/rea/commit/41ae0cb378fd853d45c62c6bf39e194288337750) test(contracts): place canonical graph CLI regression in acceptance - [`fc3e28f`](https://github.com/morluto/rea/commit/fc3e28f1542141bf2570efe68bfb7d215f915c23) refactor(contracts): reuse artifact identity owners in mobile examples ### 📊 Changes **2 files changed** (+134 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `src/contracts/mobileApplicationGraphExamples.ts` (+29 -26) ➕ `tests/acceptance/tools/mobileGraphExamples.test.ts` (+105 -0) </details> ### 📄 Description ## Summary Fixes #3951. All four canonical mobile graph examples failed when their nested inventory Evidence was validated during execution. ```diff inventory example + integrity_contradictions: [] + coverage: { scope: "root", status: "complete" } - validate as arbitrary JSON + validate with the inventory result schema ``` ## Problem and expected behavior The Android, IPA, macOS and Harmony examples omitted required inventory fields. The outer request schema accepted them, but each public CLI operation returned `invalid_request`. Canonical examples should execute while retaining their root-only projection limits. ## Change and scope Keep the compiled CLI regression in the acceptance test layer. Complete the shared inventory example builder and validate it with `artifactInventoryResultSchema` so future required-field drift fails at the owning boundary. Existing `createEvidence` calls regenerate the enclosing Evidence. Artifact, occurrence, graph and manifest identities now use their existing `artifactIdentity.ts` owner functions instead of duplicating their formulas. The four graph digests and manifest IDs are unchanged; runtime validation is unchanged. This ordinary example correction requires no advance provider/authority decision. ## Contract and boundary impact - Semantic owner: canonical inventory examples in `mobileApplicationGraphExamples.ts`. - Scope: existing offline application graph projection; scope decision not applicable. - CLI/MCP schemas/tool catalog: no schema or tool inventory changes. Examples now provide valid nested Evidence; these inline Evidence examples are not advertised as MCP input examples. - Provider/bridge/platform: no provider or bridge changes; tests run offline on Windows. - Evidence: explicit integrity facts and root coverage, with authenticated enclosing Evidence; output remains partial. - Target selection/authority/cleanup: projection consumes supplied Evidence; no fixture target files, live devices or engines needed. - Generated metadata/package/install: regenerated ignored artifacts are excluded; no package changes. 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 - **Before:** all four new public CLI example regressions failed with exit1 and missing `integrity_contradictions` / `coverage` diagnostics. - **After:** all four examples execute as both inline JSON and file inputs in empty temporary directories, return authenticated projection Evidence, and preserve `coverage: {status: "partial", inventory_complete: true}`. - Review follow-up: all four compiled examples preserve their pre-refactor graph digests and manifest IDs after switching to the shared identity functions. - A validly authenticated input with an unsupported coverage status still fails with `invalid_request` and a coverage-status diagnostic. ## Validation performed Windows x64, pinned Node24.18.0/npm11.16.0: - `npm run test:focused -- tests/acceptance/tools/mobileGraphExamples.test.ts tests/boundary/mcp/mobileApplicationGraphMcp.test.ts` — 7 passed, zero skipped (5 new CLI cases and2 existing MCP cases). - `npm run check` — passed; lint0 errors,1448 repository warnings. - `npm run verify:test-discovery` — all1322 test files discovered exactly once. - `npm run docs:check` — passed; generated-document checks and5 README consistency tests. - `git diff --check` — passed. ## Compatibility, safety, and release No API/schema migration or package/install change. Live Android/Apple/Harmony devices and native engines were not used or claimed; these are Evidence-only projections. No macOS/Linux or full-suite run. Canonical envelopes change because their inventory payloads are completed. ## Merge Danger **Door:** two-way — revert the example builder and regression test. **Blast Radius:** examples — canonical mobile graph inputs; runtime projection and validation remain unchanged. ## Author readiness Human owner: @z2Ace0107 - [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 - [ ] 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:11:04 +00:00
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#5999
No description provided.