Repository navigation
feat(harmony): project HarmonyOS package inventory evidence - #1447
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Review to help land this. I tested it locally merged with current 1. Conflict with
Results on the merged tree:
2. The real-HAP lane is unreproducible: the pinned fixture is gone. On that replacement,
So the projection itself behaves as described. But the lane needs a stable fixture. #1431's acceptance asks for source-generated public fixtures packaged by a pinned toolchain; failing that, at least a licensed artifact with a durable URL. A days-old, unlicensed release repository has already rotated once. 3.
4. Unrelated commit. 5. Minor (signing). If useful, I can push the conflict resolution (item 1) to your branch, since maintainer edits are enabled. Let me know. |
First HarmonyOS increment from morluto#1431: HAP, HSP, and App Pack roots are classified through the hardened ZIP reader and projected into an execution-free application graph with packaging-model hints, exact component paths and hashes, App Pack children by path, runtime-family hints, and path-based N-API bridge hypotheses. HarmonyOS .har stays unclassified by suffix because .har also names HTTP Archive JSON. Adds the project_harmony_application_graph tool (CLI and MCP), synthetic composition coverage, a pinned real-package verify lane, and docs.
The HarmonyOS projection mirrors the Android and Apple projections by design, which pushed jscpd duplication over its 2.5 percent budget. Extract the identical pieces (inventory input schema, projected component schema and occurrence flattening, bridge candidate schema factory, coverage assembly, comparator, canonical digest) into domain/mobileApplicationGraphProjection.ts and route all three projections plus the composition fixtures through it. Duplication drops from 2.52 to 2.49 percent with no behavior change: projection ids, classifications, and limitations are byte-identical.
- rebased onto main; the shared projection scaffolding now keeps main's nativeRuntimeConvention loop and the harmony runtime families adopt the same react-native/flutter/unity path conventions - the .app App Pack suffix is now a root-input rule only (verified ZIP magic in classifyRootFormat and BinaryTargetResolver); nested .app ZIP members inside other packages keep the generic zip classification, with a regression test, so existing inventories do not change - the signing limitation now states that an empty signing list does not mean unsigned because packaging-tool signatures live in the ZIP signing block, and the app-pack root rule is disclosed as suffix-based - repinned the real-package fixture to the current VHome 2.6.14-beta asset after the upstream deleted v5.0.111-beta and replaced the v2.6.14-beta asset within hours; the pin records both observed digests
33e8163 to
e5dbdeb
Compare
|
Thank you for a genuinely useful review. All five items are addressed in e5dbdeb (force-pushed, rebased onto current main): 1. Conflict. Resolved exactly as you specified: shared scaffolding imports plus 2. Fixture. The instability is even worse than your run showed: the v2.6.14-beta asset you pinned this morning (d19c8dcd\u2026) was itself replaced within hours; my download today hashes 06cccd1c\u2026 (20,722,910 vs your 20,729,946 bytes). I repinned to the current asset, and the pin record now documents both observed digests and the deletion of v5.0.111-beta, so the next mismatch reads as an upstream rotation rather than a mystery. Layout is unchanged (238 entries, same manifests/bytecode/libs), the lane is green against the new pin (inspect_artifact, projection, determinism, CLI/MCP parity), and docs/testing.md now states the rotation caveat. I agree this upstream is not a durable home: my preference for the follow-up is building the fixture from source with a pinned ohos-sdk command-line toolchain, which is what #1431's acceptance asks for anyway, and I am happy to do that as the next increment unless a better-licensed stable artifact turns up first. 3. .app scoping. Adopted your second suggestion: the App Pack suffix is now a root-input rule only, applied after ZIP magic verification in 4. Unrelated commit. Dropped; the branch now contains only the two Harmony commits on top of main, and #1432 carries the keyring change alone. 5. Signing. The projection limitations and docs now state explicitly that the signing component lists META-INF certificate-entry suffixes only and that an empty list does not mean unsigned, since packaging-tool signatures live in the ZIP signing block rather than archive entries. Checks on the updated branch: typecheck, lint, jscpd (2.48%), docs:check, and the harmony/android/contracts/catalog suites all pass, and the real-package lane is green on Linux. |
|
TL;DR: I tested e5dbdeb on Linux with six real open-source HarmonyOS packages. Its tests, lint and type check pass on Node 22 and Node 24, and the file lists match the ZIP contents. Two small gaps remain: HAP results lack the ZIP tail note, and FA resource folders are not counted. The branch also conflicts with current main in three files. Results
Not run
Thanks, kaoru0822-kitauji, for the review that you did on the Mac. On Linux, your item 3 (the IPA graph hash) and item 5 (the signing note) hold up. The packages and their licencesI downloaded each one from its public release page. The licence of each repository is linked beside the name. It covers the source. I did not audit what each file bundles.
SHA-256 of each file, in the same order: What the projection found in each packageEvery package: coverage
Two smaller notes. The tool pairs every bytecode file with every native library. So How it compares with the OpenHarmony docsThe docs are openharmony/docs at f41b9345, under
Nothing in #1447 claims anything about what is inside a Hand-built edge cases, 23 filesThe fixtures and the build script are in my notes. Layouts follow the docs pages above.
Test setup
🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
Unify ZIP package ownership, archive identity, and inventory limitations. Preserve unavailable encrypted component paths and partial coverage; include FA resource directories. Repair the documented CLI input and verifier cleanup, and replace the rotating VHome fixture with a hash-pinned Harmony pipeline release.
|
Thank you @BaaRai for the HarmonyOS package inventory PR! Reusing the hardened archive reader and shared CLI/MCP Evidence workflows gives this first increment a useful foundation. I appreciate the component inventory, explicit limits on what the path-based hints establish, and the verification work. I’ve reviewed it and pushed the remaining fixes and merge-conflict resolution. Thanks for contributing this to REA! |
Implements the package-identification and inventory increment of #1431. This is static, provider-free inspection; manifest semantics, Ark decoding, resource resolution, signature verification, and runtime analysis remain deferred.
Behavior
.appclassification requires ZIP magic and applies only to root inputs; nested.appZIP members retain their existing format. HTTP Archive.harhandling is unchanged.project_harmony_application_graphthrough CLI and MCP. Authenticated inventory Evidence produces deterministic component paths, IDs and hashes, packaging-model path hints, App Pack children, runtime hints, and explicitly hypothetical native bridge candidates.unavailable_components, and mark projection coverage partial instead of claiming absence.Verification
Verified on macOS arm64 with Node 24.18.0 and npm 11.16.0:
npm run check:fast,npm run docs:check, and architecture guards passed.The fixture is the SHA-256-pinned harmony-next-pipeline 1.0.1 release, from an MIT-licensed source repository. Its pin records source revision, asset ID, byte size and digest; downloaded bytes are not committed or redistributed. This replaces the repeatedly rotated VHome asset. The fixture's compiler/SDK versions and reproducible source-to-artifact build have not been independently established, so the full pinned-toolchain acceptance in #1431 remains open. Bundled component licenses, Ark contents, and signature validity were not independently audited.
The guide now supplies the required
inventory_evidencewrapper and documents unavailable coverage and verification boundaries. The verifier removes its workspace on success and failure and bounds downloads to the pinned size.