[PR #7044] test(javascript): cover the inline-HTML unavailable scope through the public CLI #7601

Open
opened 2026-11-03 13:39:02 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7044
Author: @Lopesnextgen
Created: 10/24/2026
Status: 🔄 Open

Base: main ← Head: test/javascript-inline-html-unavailable-scope-cli


📝 Commits (2)

  • 732751b test(javascript): cover the inline-HTML unavailable scope through the public CLI
  • 57c848f test(javascript): pin the external-script loads edge to its HTML source

📊 Changes

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

View changed files

📝 tests/acceptance/applications/javascriptUnavailableHtmlCli.test.ts (+123 -0)

📄 Description

Summary

Valid HTML containing inline <script> bodies is reported through an explicit
parse-html-inline-scripts unavailable scope, so an application whose
endpoints, storage, or imports live in inline scripts is surfaced as
not-analyzed rather than silently empty. That contract was asserted only at the
filesystem boundary; the public CLI acceptance surface had no scenario proving
it survives transport. This adds the missing acceptance coverage. Tests-only; no
source change.

Problem and expected behavior

Trigger: analyze-javascript-application on an app whose index.html has inline
scripts (inline fetch/localStorage, a module import) alongside an external
<script src>. Expected contract on the public JSON result: an unknown node
with operation: "parse-html-inline-scripts" (evidence.state: "unavailable",
confidence: "unknown", the HTML byte sha256, partial coverage); the top-level
limitations names the unanalyzed inline bodies; the external script still yields
its loads edge and recovered endpoint; and the inline-only endpoint/storage
facts are absent. Before this change, a regression weakening that scope on the
public surface was caught by no acceptance/MCP test.

Change and scope

Adds one acceptance case to
tests/acceptance/applications/javascriptUnavailableHtmlCli.test.ts, reusing the
file's existing cliTest + schema-parse helpers. It mirrors the existing
filesystem-boundary oracle (tests/boundary/filesystem/javascriptHtmlEntrypoints.test.ts)
at the public CLI surface. No production/source change and no new capability.

Contribution scope: not applicable — tests-only, within existing boundaries, no
target execution, injection, mutation, or protection recovery.

Contract and boundary impact

  • Semantic owner and earliest changed stage: none changed; exercises the
    src/application/javascript graph projection through the public CLI.
  • Contribution scope fit and linked maintainer decision: tests-only within
    existing boundaries; not applicable.
  • CLI and MCP/tool-catalog contract: unchanged (asserts the existing
    analyze-javascript-application --format json output).
  • Provider, bridge, target-format, or platform compatibility: unchanged.
  • Evidence, artifact, provenance, or reconstruction contract: asserts the
    existing unavailable-scope provenance (state/confidence/sha256/coverage);
    no change.
  • Target selection, authority, upstream behavior, and cleanup: not applicable
    (synthetic local fixtures in a temp directory).
  • Generated metadata, 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: tests/acceptance/applications/javascriptUnavailableHtmlCli.test.ts
    — one new acceptance case.

  • Base reproduction or other evidence: the contract is covered only at the
    filesystem boundary (javascriptHtmlEntrypoints.test.ts); no acceptance/MCP
    test hits parse-html-inline-scripts. The new case fails if production stops
    emitting the scope, mislabels its evidence state/confidence, drops the
    limitations string, or leaks the inline-only endpoint/storage facts.

  • User-visible CLI/MCP output: unchanged.

  • Remaining proof gaps: MCP-adapter parity not added (CLI only), matching this
    file's existing surface.

  • 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

  • npm run test:focused -- tests/acceptance/applications/javascriptUnavailableHtmlCli.test.ts
    — Test Files 1 passed (1); Tests 5 passed (5) (4 pre-existing + the new case),
    against unmodified source.
  • Pre-push check:fast (turbo typecheck + lint) — 2 tasks successful.
  • Run on Windows x64 after restoring the published prebuilt native addon per
    native/windows/README.md; Windows native controls are bring-your-own, so CI
    (Linux) remains the authoritative lane.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable (synthetic static
    fixtures; no real browser execution).
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none — tests-only, reserved
    example.test URLs, no network.

Author readiness

Human owner: @Lopesnextgen

  • 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/7044 **Author:** [@Lopesnextgen](https://github.com/Lopesnextgen) **Created:** 10/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/javascript-inline-html-unavailable-scope-cli` --- ### 📝 Commits (2) - [`732751b`](https://github.com/morluto/rea/commit/732751b2a0df763340fb4b30543bd85a53f34a43) test(javascript): cover the inline-HTML unavailable scope through the public CLI - [`57c848f`](https://github.com/morluto/rea/commit/57c848f794adc3fffb8526b6ebd287957d1f006f) test(javascript): pin the external-script loads edge to its HTML source ### 📊 Changes **1 file changed** (+123 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tests/acceptance/applications/javascriptUnavailableHtmlCli.test.ts` (+123 -0) </details> ### 📄 Description ## Summary Valid HTML containing inline `<script>` bodies is reported through an explicit `parse-html-inline-scripts` *unavailable* scope, so an application whose endpoints, storage, or imports live in inline scripts is surfaced as not-analyzed rather than silently empty. That contract was asserted only at the filesystem boundary; the public CLI acceptance surface had no scenario proving it survives transport. This adds the missing acceptance coverage. Tests-only; no source change. ## Problem and expected behavior Trigger: `analyze-javascript-application` on an app whose `index.html` has inline scripts (inline `fetch`/`localStorage`, a module import) alongside an external `<script src>`. Expected contract on the public JSON result: an `unknown` node with `operation: "parse-html-inline-scripts"` (`evidence.state: "unavailable"`, `confidence: "unknown"`, the HTML byte `sha256`, partial coverage); the top-level `limitations` names the unanalyzed inline bodies; the external script still yields its `loads` edge and recovered endpoint; and the inline-only endpoint/storage facts are absent. Before this change, a regression weakening that scope on the public surface was caught by no acceptance/MCP test. ## Change and scope Adds one acceptance case to `tests/acceptance/applications/javascriptUnavailableHtmlCli.test.ts`, reusing the file's existing `cliTest` + schema-parse helpers. It mirrors the existing filesystem-boundary oracle (`tests/boundary/filesystem/javascriptHtmlEntrypoints.test.ts`) at the public CLI surface. No production/source change and no new capability. Contribution scope: not applicable — tests-only, within existing boundaries, no target execution, injection, mutation, or protection recovery. ## Contract and boundary impact - Semantic owner and earliest changed stage: none changed; exercises the `src/application/javascript` graph projection through the public CLI. - Contribution scope fit and linked maintainer decision: tests-only within existing boundaries; not applicable. - CLI and MCP/tool-catalog contract: unchanged (asserts the existing `analyze-javascript-application --format json` output). - Provider, bridge, target-format, or platform compatibility: unchanged. - Evidence, artifact, provenance, or reconstruction contract: asserts the existing unavailable-scope provenance (`state`/`confidence`/`sha256`/coverage); no change. - Target selection, authority, upstream behavior, and cleanup: not applicable (synthetic local fixtures in a temp directory). - Generated metadata, 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: `tests/acceptance/applications/javascriptUnavailableHtmlCli.test.ts` — one new acceptance case. - Base reproduction or other evidence: the contract is covered only at the filesystem boundary (`javascriptHtmlEntrypoints.test.ts`); no acceptance/MCP test hits `parse-html-inline-scripts`. The new case fails if production stops emitting the scope, mislabels its evidence state/confidence, drops the limitations string, or leaks the inline-only endpoint/storage facts. - User-visible CLI/MCP output: unchanged. - Remaining proof gaps: MCP-adapter parity not added (CLI only), matching this file's existing surface. - [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 - `npm run test:focused -- tests/acceptance/applications/javascriptUnavailableHtmlCli.test.ts` — Test Files 1 passed (1); Tests 5 passed (5) (4 pre-existing + the new case), against unmodified source. - Pre-push `check:fast` (turbo `typecheck` + `lint`) — 2 tasks successful. - Run on Windows x64 after restoring the published prebuilt native addon per `native/windows/README.md`; Windows native controls are bring-your-own, so CI (Linux) remains the authoritative lane. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable (synthetic static fixtures; no real browser execution). - Package or release metadata impact: none. - Security, privacy, process, or containment review: none — tests-only, reserved `example.test` URLs, no network. ## Author readiness Human owner: @Lopesnextgen - [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. <!-- none: coverage gap found during a test-suite audit; no tracking issue --> - [ ] Tests cover changed observable behavior and meaningful failure paths. - [ ] Owning docs, contracts, and generated metadata are updated where needed. <!-- none needed --> - [ ] User-visible CLI/MCP changes include representative output. <!-- not applicable: output unchanged --> - [ ] 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#7601
No description provided.