Repository navigation
feat(harmony): disclose unclassified inventory files - #4968
Conversation
[Medium impact] The PR appears safe to merge; the earlier test issue is fixed and no new blocking issue was found. SummaryAdds
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A["Authenticated file/slice occurrences"] --> B{"Already classified or an App Pack child?"}
B -->|Yes| C["Existing component and child lists"]
B -->|No| D["unclassified_components"]
E["Unavailable content"] --> F["unavailable_components"]
Reviews (4) · Last reviewed commit: "docs(harmony): name the disclosure locat..." · Reviewed by Greptile |
|
TL;DR: It covers the unclassified-entry half of #4489 on the real HAP from that issue. Thanks, z2Ace0107. Build: this PR's head Target:
Both digests match my |
Codex Review SummaryThis 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. |
|
Heads-up: the head of this PR moved from The change was a baseline refresh only. Current The PR-owned diff is unchanged: still the same six files, 191 insertions and 9 What changed in the resolution: upstream had refactored manifest classification Verification after the refresh: the Harmony filesystem boundary file passes 35 |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
The partial-inventory control froze the sentence "Source inventory coverage is partial; absence is unknown." verbatim. docs/testing.md asserts structured limit facts instead of freezing explanatory sentences and puts documentation wording in review, so the sentence is no longer substring-matched. `coverage.status` is a disjunction of independent causes in this projection: incomplete inventory scope, unavailable content, and an exceeded bridge budget. Asserting only `status: "partial"` left that attribution unstated, so the two other causes are now pinned as well. `unavailable_components` being empty and `bridge_candidate_coverage` being complete with zero candidates make the partial result attributable to the missing occurrence alone. Also drops an `artifact_id` comparison that could not fail: the fixture's four files carry the same bytes, the preceding assertion already pins that shared digest, and `artifact_id` is derived from the digest. Distinct paths sharing content stay covered by the path array and the independent digest expectations. Narrows a comment that claimed exact-case matching for every name in the control; only the manifest names are case-sensitive, because the App Pack child suffix match is case-insensitive.
The unclassified-disclosure paragraph used "there" to refer back to a clause that had just named `app_pack_children`, so a reader could take a nested `.hap` or `.hsp` member of a HAP or HSP root to be reported as an App Pack child. It is reported in `unclassified_components`: the child list is populated only for an App Pack root. Names the location explicitly.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
feat(harmony): disclose unclassified inventory files
Summary
Report authenticated HarmonyOS files that have no component classification in
unclassified_components. Related to #4489; this addresses its unclassified-entry request only.Problem and expected behavior
Files such as
pkgContextInfo.jsonwere present in the inventory but absent from every component category. A complete-inventory result did not disclose those unclassified files. The projection now lists them without interpreting their contents or implying incomplete traversal.Change and scope
Compute the complement at the existing Harmony projection owner, reusing its classified component objects and child-package list. Keep unavailable content separate. This does not parse N-API declarations or resolve the rest of #4489.
2026-10-29 baseline refresh: merged current main (163 commits since the previous refresh) into this branch so the change sits on the upstream projection owner as it now stands. The PR-owned diff is still the same six files.
Upstream changes this branch now adopts rather than fights:
classifyManifests()(7d6bccb86, fix(harmony): classify exact manifest names once #7206) owns manifest classification, recognisespack.info, and skips manifests on classified resource paths.pack.infotherefore no longer appears inunclassified_components, and the packaging-model hint comes frommanifests.packagingModel.#7886changedunavailablefromentries.flatMaptofileEntries.flatMap, so an unavailable child package no longer surfaces as an unavailable component.harmonyFixture(), which returns{ bytes, javascriptPaths }and adds anets/currentsymlink entry. The resolution keeps both fixtures this PR adds (pkgContextInfo.json,.pages.info) and assertsunclassified_componentsandunavailable_componentstogether. The symlink does not reach the new array, becauseprojectedFileComponentsemits onlyfile/sliceoccurrences that carry a projected component.The projection assertion was extracted into
expectHarmonyProjectionbecause upstream's refactor pushed the test function to 155 lines, past the 150-line limit; the helper keeps it under the limit without dropping any assertion.Contract and boundary impact
unclassified_componentsusing the existing component row schema. Projection/Evidence IDs include the changed result; consumers pinned to the old strict output schema need the updated contract.Expected product effect:
Evidence
2c4338db1because the two fixture metadata files had nounclassified_componentsoutput.928a4c6718125328695d2c32297ef5dfba2e06d16fd501d507d4aa32423cbad6reportsets/sourceMaps.mapandpkgContextInfo.jsonas unclassified while keeping complete inventory coverage. Its package digest is unchanged.EvidenceIntegrityErrorfor tampered Evidence, matching upstream's current classification of that failure instead of the olderAnalysisInputError.Validation performed
Local validation executed on 2026-10-18, Windows x64, Node 24.18.0/npm 11.16.0 (historical execution; not rerun on 2026-10-23):
npm run test:focused -- tests/boundary/filesystem/harmony/application.test.ts tests/acceptance/harmonyArtifactJourney.test.ts tests/acceptance/applications/mobileDirectoryComponents.test.ts tests/boundary/mcp/mobileApplicationGraphMcp.test.ts— 36 tests pass across 4 files.npm run check— pass (typecheck, lint with 0 errors, format, knip, metadata, module boundaries and architecture guards).npm run docs:check— pass, including 5 README conformance checks.npm run verify:test-discovery— all 1,578 files discovered exactly once.npm run fixtures:harmonythenREA_HARMONY_TEST_HAP=<pinned-hap> npm run verify:harmony— real static HAP CLI/MCP verification passes. The environment assignment is shown in portable notation; executed with process-scoped PowerShell environment variables.git diff --check— pass. Independent Standards and Spec source reviews: no actionable findings.Baseline-refresh validation executed on 2026-10-25, Windows x64, Node 24.22.1/npm 11.19.1, against merged main
113679c9a:vitest run tests/boundary/filesystem/harmony/application.test.ts— 29 passed (27 upstream controls plus this PR's unclassified-inventory control).vitest run tests/acceptance/harmonyArtifactJourney.test.ts— 1 passed.vitest run tests/acceptance/applications/mobileDirectoryComponents.test.ts— 9 passed.npm run verify:test-discovery— 2,483 files discovered exactly once.npm run verify:module-boundaries— 3,059 source files checked.oxfmt --check .— all matched files use the correct format.oxlintover the six changed files — no new findings; the one reported warning is pre-existing on unmodified main.git merge-tree --write-tree origin/main HEAD— merges cleanly, so this branch has no conflict with current main.git diffagainst the merge base — still exactly the six files this PR owns; the merged upstream history is not part of this PR's diff.Remote status rechecked on 2026-10-23: CI run
39099107665completed successfully for the previously published head921707a7cbe9e8cd2013c37ac5db97bdd2e2141don 2026-10-18. Across reported checks, 16 succeeded and 16 unselected lanes were skipped. That run predates the baseline refresh above; remote CI for the refreshed head has not been executed yet.Second baseline-refresh validation executed on 2026-10-29, Windows x64, Node 24.22.1/npm 11.19.1, against merged main
d157560d4:vitest run tests/boundary/filesystem/harmony/application.test.ts tests/acceptance/harmonyArtifactJourney.test.ts— 36 passed (35 boundary controls including the six upstream added in7d6bccb86, plus the public CLI/MCP lifecycle).vitest run tests/acceptance/applications/mobileDirectoryComponents.test.ts— 9 passed.vitest run tests/boundary/mcp/contractPresentation.test.ts tests/boundary/mcp/toolSchemaValidity.test.ts tests/boundary/mcp/mcpDoctor.test.ts— 49 passed.contractPresentationis the byte-for-byte gate on the advertisedoutputSchemathis PR changes;mcpDoctorconfirms the recorded catalog digests still agree.vitest run src/contracts/toolEffects.test.ts tests/boundary/mcp/deferredRuntime.test.ts— 38 passed.vitest run tests/boundary/mcp/mobileApplicationGraphMcp.test.ts tests/acceptance/tools/mobileGraphExamples.test.ts— 16 passed. These are the other two live consumers of the Harmony tool and prove the new field survives the MCP delivery envelope.npm run typecheck— clean.compileusestsconfig.build.json, which excludestests, sotypecheckis the only command that covers the three edited test files.npm run verify:test-discovery— 2,802 files discovered exactly once.npm run verify:module-boundaries— 3,348 source files checked.oxfmt --check .andoxlinton the six changed files — clean.partial inventory — killed; reporting the inventory as complete while it is
not — killed; reporting the bridge projection as partial — killed; stopping
manifest classification — killed; dropping the "Source inventory coverage is
partial; absence is unknown." limitation — survives.
npm run typecheck— clean.Note on the surviving mutation. An earlier revision of the partial-inventory
control asserted that limitation sentence verbatim. That assertion was removed:
docs/testing.mdasserts structured limit facts instead of freezingexplanatory sentences, and the same section puts documentation wording in
review. The structured replacement is the pair of assertions added alongside
coverage, which pin the two independent causes of a partial projection(
unavailable_componentsis empty,bridge_candidate_coverageis complete withzero candidates) so that
status: "partial"is attributable to the missingoccurrence alone rather than to some other cause. The prose limitation is
therefore no longer covered by a substring assertion; that is a deliberate
trade under the rule above, not a lost regression.
One assertion was also removed from the unclassified-paths control: the
artifact_idcomparison was tautological, because that fixture's four files allcarry the same bytes, the preceding assertion already pins the shared digest,
and
artifact_idis derived from the digest. Distinct paths sharing contentremain covered by the path array and the independent digest expectations.
The documentation sentence about where a nested
.hap/.hspmember of a HAP orHSP root is disclosed now names
unclassified_componentsexplicitly instead ofusing a back-reference to the preceding
app_pack_childrenmention.Note on
deferredRuntime: running all five flagged files in one process makes its 8-second catalog test time out under load. Run separately it passes. That is a local concurrency artifact, not a defect in this change.Compatibility, safety, and release
The baseline's matching 6.6.0 Windows controls were restored from official CI run 39094414381 at the exact base SHA, with manifest/PE/SHA-256 validation; the files remain ignored. The npm 6.6.0 tarball was unavailable at verification time. No version/digest checks were relaxed.
This is static archive inspection, not device/runtime execution. Local Linux/macOS execution, actual duplicate same-path ZIPs and a new symlink-specific control were not verified. Remote selected CI lanes passed as recorded above; this does not mean every optional provider lane executed. Additional rows cost output bytes; no token, elapsed-time, CPU or memory improvement is claimed, and whole-task resource costs are unmeasured. Real Ghidra, IDA and Hopper lanes were not executed on this host; the projection itself performs no target execution. Windows native controls are absent here (
native/windows/build/manifest.jsonENOENT), which is unrelated to this change.Merge Danger
Door: two-way. Revert the result field and classification complement together.
Blast Radius: Harmony projection output and its schema identity.
Author readiness
Human owner: @z2Ace0107
Before merge