Skip to content

Port host-side threat detection conclusion to JavaScript #79608

Done

Description

@davidslater

Move the host-side conclusion step into a JavaScript entry point shipped by the gh-aw setup action. Keep the v0.5.3 detector producing the verdict for this PR so changes in downstream gating can be attributed to the reader.

Implementation

  • Replace the binary invocation in conclude_threat_detection.sh with the bundled JS entry point. Carry over host-wrapper handling for skipped execution, quota failures, and strict/warn policy.
  • Treat detection_result.json as authoritative. Use the companion full result only for compatible diagnostic details. Preserve legacy in-file reasons, structured warnings, status-reason mapping, safe Actions annotations and redaction boundaries.
  • Preserve the detector’s eligibility decision. A rejected/ineligible report that exhausts retries is a tooling/parse failure, never a clean verdict or a confirmed threat. Conclude consumes the recorded verdict; it must not infer eligibility from stdout.

Acceptance

  • Exercise the real JS subprocess with temporary GITHUB_OUTPUT and GITHUB_ENV. Compare exit status, conclusion, reason, success, exported variables and downstream gating against v0.5.3 plus the current gh-aw wrapper.
  • Cover clean, each confirmed category, skipped, malformed/missing result, mismatched companion, invalid_report_exhausted, and engine failure in strict and warn modes. Pair a real threat with a tooling failure in warn mode and prove only the latter may continue under that policy.
  • Verify the existing Go producer and JS reader round-trip using the actual result filenames. Keep untrusted multiline reasons and engine-authored log markers from changing the verdict or emitting workflow commands.

Reference suites: v0.5.3 conclude tests and gh-aw host-wrapper tests.

Metadata

Metadata

Labels

backlog:securitythreat-detection

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions