Repository navigation
Add fast authored JavaScript analysis with reviewed API summaries - #70029
Conversation
Batch native AST parsing and use reviewed, source-checked runtime API summaries. Cover authored MCP tools, safe-output jobs and handlers, graders, memory validators, and engine script hooks while preserving explicit incomplete-coverage diagnostics and deep mode. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Commit pushed:
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (1,638 new lines under 📄 Draft ADR committed: The draft records the decision to make
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. ❓ Why ADRs Matter
ADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors (and your future self) will thank you. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Blocking issues in the new fast-JavaScript path: it can silently downgrade real leaks to coverage gaps, and it also makes .lock.yml lint fail because an adjacent same-basename Markdown file is ordinary docs.
### Review themes
- Fast mode currently treats any repo module under
actions/setup/js/as a reviewed runtime helper, even when it is just authored repository code. That suppresses real traversal in exactly the namespace this feature is trying to optimize. .lock.ymllint now hard-fails on an unparseable companionbase.md; that turns a best-effort authored-analysis enhancement into a CI-breaking regression for repositories that colocate docs with generated lock files.- I reviewed this statically from the diff and targeted source reads only; I did not run the code or test suite in this review pass.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 129.5 AIC · ⌖ 6.25 AIC · ⊞ 12.7K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and /codebase-design (per pr-triage) to the high-impact files: javascript_native.go, authored_scripts.go, javascript_summaries.go, javascript_batch.go, javascript/summaries.json, lint_workflow.go.
This is a well-engineered PR: the reviewed API summary catalog's sha256 hashes for all 4 cataloged modules (actions_secret_masking.cjs, otlp_header_helpers.cjs, git_auth_env.cjs, error_helpers.cjs) independently verified correct against the real repo sources, the authoredScripts() discovery is deliberately restricted to known executable schema locations (not a recursive scan) with a clear security-conscious comment, and the test suite is comprehensive with descriptive names and clear Arrange/Act/Assert structure.
Two non-blocking findings posted inline:
📋 Key Themes
- CI coverage gap (
/tdd):nativeJavaScriptOptionsskips every native-compiler test unless@typescript/native-previewis pre-installed underpkg/workflow/taint/javascript/node_modules. No CI workflow or Makefile target appears to runnpm ci --prefix pkg/workflow/taint/javascript, so the new fast-mode test suite (batching, caching, summary catalog) may never execute automatically. - Design clarity (
/codebase-design):AnalyzeAuthoredJavaScriptruns a full double analysis (JS-enabled + JS-disabled baseline) and subtracts findings by set difference. This works and is tested, but a short code comment explaining why set-subtraction was chosen over single-pass attribution would help future readers, especially given this executes once per linted file in the batch-priming path.
Positive Highlights
- ✅ sha256-verified reviewed API catalog correctly models non-declassifying effects (masking/escaping don't launder taint; unresolved callbacks are flagged as gaps rather than silently assumed safe)
- ✅ Executable schema discovery is explicit and auditable, not a generic recursive key scan
- ✅ Comprehensive, well-named test coverage across new files
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 193.9 AIC · ⌖ 14.1 AIC · ⊞ 10.1K
Comment /matt to run again
Comments that could not be inline-anchored
pkg/workflow/taint/javascript_test.go:20
[/tdd] nativeJavaScriptOptions silently t.Skip()s every native-compiler test (including TestJavaScriptFastPairedGraph, TestJavaScriptSummary*, TestNativeJavaScriptBatch*) unless node_modules/@typescript/native-preview is pre-installed under pkg/workflow/taint/javascript/. I couldn't find any CI workflow or Makefile target that runs npm ci --prefix pkg/workflow/taint/javascript (checked Makefile and .github/workflows/*.yml), so this entire new fast-mode test suite may nev…
pkg/workflow/taint/authored.go:88
[/codebase-design] AnalyzeAuthoredJavaScript fully re-runs AnalyzeAuthoredDocument twice per document (once with JS enabled, once as a JS-disabled baseline) just to subtract duplicate findings/gaps by set difference. AnalyzeAuthoredDocument itself already calls AnalyzeAuthoredScripts internally, so this is effectively 2x analyzer traversals plus a second AnalyzeAuthoredScripts call per document on every fast-mode lint/analyze.
<details>
<summary>💡 Why this matters / suggested fi…
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved analysis-correctness and lint-reliability issues prevent safe approval.
11 open issues
Make cache priming best-effort and cancellation-aware · New Read the plural engine.behaviors configuration key · New Build each hook's owning environment before dispatch · New Model the shared MCP environment for secret analysis · New Resolve the requested file before selecting its summary · New Avoid retaining all parsed workflows during linting · New Update tests for sanitized companion-parse failures · New Apply the runtime environment allowlist before adding GH_TOKEN · New Skip Actions interpolation for custom driver files · New Model nested coercion in summary value analysis · New Use unshadowed runtime globals for summary analysis · New
What changed in this PR
Adds an opt-in fast path for gh-aw JavaScript secret-flow analysis using authored scripts and reviewed runtime API summaries.
Changes:
- Batch and cache native JavaScript parsing.
- Discover executable script hooks and apply reviewed API transfer models.
- Add mode flags, coverage warnings, regressions, benchmarks, and documentation.
| File | Description |
|---|---|
| pkg/workflow/taint/workflow.go | Selects authored analysis in fast mode. |
| pkg/workflow/taint/taint.go | Tracks literal script handling. |
| pkg/workflow/taint/shell.go | Controls Actions interpolation. |
| pkg/workflow/taint/javascript/summaries.json | Defines reviewed API contracts. |
| pkg/workflow/taint/javascript/native.cjs | Parses bounded source batches. |
| pkg/workflow/taint/javascript.go | Adds analysis modes and batch interfaces. |
| pkg/workflow/taint/javascript_workflow.go | Shares rendering and checks returned outputs. |
| pkg/workflow/taint/javascript_test.go | Warms parser caches for tests. |
| pkg/workflow/taint/javascript_summaries.go | Implements verified transfer summaries. |
| pkg/workflow/taint/javascript_summaries_test.go | Tests summary identity and effects. |
| pkg/workflow/taint/javascript_native.go | Batches, deduplicates, and caches parsing. |
| pkg/workflow/taint/javascript_modules.go | Routes runtime imports through summaries. |
| pkg/workflow/taint/javascript_fast_test.go | Tests fast/deep integration. |
| pkg/workflow/taint/javascript_eval.go | Validates modes and bounds summary recursion. |
| pkg/workflow/taint/javascript_calls.go | Dispatches summarized calls. |
| pkg/workflow/taint/javascript_batch.go | Primes authored source caches. |
| pkg/workflow/taint/javascript_batch_test.go | Tests batching and failure isolation. |
| pkg/workflow/taint/authored.go | Combines authored checks and removes duplicates. |
| pkg/workflow/taint/authored_scripts.go | Discovers and analyzes script hooks. |
| pkg/workflow/taint/authored_scripts_test.go | Tests hook discovery and execution boundaries. |
| pkg/workflow/aw/execution.go | Includes safe-output jobs. |
| pkg/cli/lint_workflow.go | Prepares inputs and exposes coverage warnings. |
| pkg/cli/lint_javascript.go | Adds JavaScript mode configuration. |
| pkg/cli/lint_javascript_test.go | Tests flags and warning visibility. |
| pkg/cli/lint_javascript_batch_test.go | Tests cross-document cache priming. |
| docs/src/content/docs/setup/cli.md | Documents modes, hooks, and limitations. |
| docs/src/content/docs/reference/compilation-process.md | Explains analysis architecture. |
| .changeset/minor-fast-authored-javascript-analysis.md | Records the minor release changes. |
Review effort: Max
…nalysis-summaries Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Review the updated OTLP collector and retain environment-source and warning-callback effects for the new runner-mask API, including its masking-helper re-export. Refresh both verified source identities and add regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: 04b7287
|
Correct runtime summary provenance, module resolution, and runtime-global modeling. Preserve companion parsing and streaming lint behavior, and align authored hook environments with execution contracts. Add regressions, native compiler CI coverage, and finalize the ADR. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
In reply to #70029 (comment): Accepted the review follow-ups: added a CI job that installs the pinned native compiler and runs the JavaScript analysis regressions, and documented why the JS-disabled baseline preserves JavaScript-to-shell flows. |
|
In reply to #70029 (comment): No additional code change is needed for this completion notice. The module-provenance and companion-parsing findings are addressed in their individual review threads with regression coverage. |
|
In reply to #70029 (comment): No code change is requested by this no-action report. The fixes in this batch are validated locally rather than treating the review completion notice as evidence of correctness. |
|
In reply to #70029 (comment): Accepted: finalized the committed ADR, removed its draft placeholders, and linked ADR-70029 in the PR description. |
|
In reply to #70029 (comment): No code change is requested by this no-action report. Added focused regressions for the substantive findings and a CI job that installs the native compiler so those tests execute instead of being skipped. |
|
In reply to #70029 (comment): Accepted: finalized ADR-70029 with the provenance boundary, execution contracts, alternatives, and trade-offs, and linked it in the PR description. Removed the unverified alternative note and draft status. |
|
In reply to #70029 (comment): The recorded module-provenance and companion-parsing themes are addressed in their individual threads with regression coverage. No edit to this generated comment-memory payload is needed. |
The listed fixes landed in 0705b54, and all 13 review threads are answered and resolved. Ran |
|
🎉 This pull request is included in a new release. Release: |


Why
JavaScript secret-flow analysis becomes prohibitively expensive when every lint pass traverses generated workflow runtime code. Analyze user-authored scripts directly and reuse reviewed API transfer summaries instead, without weakening the existing compiled shell/job/output checks or treating incomplete coverage as safety.
Approach
fast. Batch and deduplicate authored entry sources across documents, cache native ASTs and per-source syntax failures, and bound each batch to 64 sources / 2 MiB.script: steps/post-steps, custom jobs,safe-outputs.jobs, safe-output handlers, MCP JavaScript/Bash tools, graders, memory validators, engine drivers, harnesses, log parsers, and MCP configuration adapters. Preserve sandbox, environment, payload-encoding, and return-output contracts, including shared MCP environments and literal file-driver contents.ADR: ADR-70029: Fast Authored JavaScript Analysis with Reviewed, Hash-Verified API Summaries
Behavior and limits
Native JavaScript analysis remains opt-in through
--javascript-module.--javascript-mode deepretains runtime traversal; an unset Go API mode preserves existing deep behavior. Fast mode explicitly reports excluded generated/cross-job JavaScript flows. Unsupported languages, unreviewed or changed runtime APIs, unavailable inputs, and unresolved callback/coercion effects remain visible coverage warnings, not assumed-safe results.Validation
Passed the complete taint, AW, and workflow-lint suites; focused CLI lint, companion parsing, priming, cancellation, streaming, and model-contract regressions; impacted unit tests; build and formatting; custom and standard Go lint; schema checks; Actions workflow purity/actionlint checks; and workflow drift validation. All 345 compiled workflows remained in sync.
The first combined review gate passed its impacted tests but reported two test-assertion style findings and reached the shared host's 5-minute lint timeout. After correcting the assertions, standard Go lint completed with 0 issues using supported longer-budget overrides, and
make agent-report-progress-no-testpassed without repeating the impacted unit suite.