Repository navigation
Fix nested import resolution in workflow lock hashes - #75226
Conversation
Resolve qualified nested imports from the root workflow directory while preserving importer-relative sibling paths. Cover Go and JavaScript hashing with shared regression fixtures and refresh affected generated hash identities. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Compare actual frontmatter and body hashes plus complete import read sets across nested-import mutations, reader modes, root paths, CRLF and inlined imports. Fail on missing Node or JavaScript runner errors rather than silently skipping cross-language checks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
✅ Ponytail Reviewer completed successfully!
|
|
✅ 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.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
❌ Design Decision Gate 🏗️ failed to deliver outputs during design decision gate check.
|
|
❌ PR Specification Reviewer failed to deliver outputs. Please review the logs for details.
|
There was a problem hiding this comment.
Review summary
No actionable issues found in the changed lines. The specialist pass was unavailable because its file-read tool calls were rejected; I independently reviewed the capped diff and up to five relevant source ranges. Static review only; tests were not run.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
What this change does: It makes nested frontmatter and body hash traversal follow the compiler root-relative import rule, and adds shared regression coverage across the Go and JavaScript implementations. The generated lock updates are excluded from this review.
Should fix:
-
The capture arrays are unnecessary (
pkg/parser/frontmatter_hash.go:L633-L643)- What this is: The new fixed-array conversions exist only to work around
uncheckedsliceindex. - Problem: The
lenguards immediately above already prove these capture indexes are in bounds, so the conversions add ceremony and hide the direct regex access. - Fix: Use
match[1]andrangeMatch[1],[2], and[3]directly with the narrow(nolint/redacted):uncheckedsliceindexcomments already used inpkg/parser/json_path_locator.go. - If we skip it: This small parser remains harder to read for no behavior gain.
- What this is: The new fixed-array conversions exist only to work around
Not checked: generated lock files, correctness, security, and performance issues, per the review scope.
Verdict: fix 1 first.
Lean: -2 lines possible.
Generated by ✂️ Ponytail Reviewer for #75226 · codex · routed: gpt56 max · ~7 AIC · ⌖ ~1 AIC · ⊞ 118
Comment /ponytail to run again
|
Warning The 🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (>100 new lines) but does not have a linked Architecture Decision Record (ADR). 📄 Draft ADR committed:
📋 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. 🔎 Gate evidence
❓ Why ADRs Matter
ADRs create a searchable, permanent record of why the codebase looks the way it does. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
|
There was a problem hiding this comment.
Reviewed captured PR head 7b71af1485908d0aabf4e4e3a4ec2107eb769829 against docs/src/content/docs/specs/frontmatter-hash-specification.md v1.0.0 and the changed Go/JavaScript hash walkers, tests, and import documentation.
Applicable contract: frontmatter-hash specification v1.0.0, BFS/import traversal and cross-language requirements (including R-XLANG-001 through R-XLANG-003). The implementation preserves cycle/deduplication and read-error behavior, and the added fixtures exercise multi-level qualified, bare, and dot-relative imports plus Go/JavaScript parity.
No blocking conformance violation found. The formal specification previously omitted the newly intentional qualified-path resolution rule, so I synchronized it to v1.0.1 with normative root-directory versus importer-relative rules and a change log. The specification-only commit was published to the same PR branch. No tests were run by this static review; PR-reported validation was treated as evidence only. Coverage limit: GitHub base objects were unavailable locally, so the prefetched diff and checked-in contract were used.
Generated by PR Specification Reviewer for #75226 · copilot · gpt50 · ~6 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review-specs to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd. Requesting changes because the PR states it preserves genuine read-error propagation, but the Go hash walkers still drop every reader error.
📋 Key Themes & Highlights
Key Themes
- Error propagation gap:
processImportsTextBasedandcollectImportedBodiesinpkg/parser/frontmatter_hash.goskip allfileReadererrors. The JS side rethrows anything that is not a not-found error. The skip predates this PR, but the PR is meant to guarantee this behavior, and a transient failure can silently produce an incomplete hash. - Test coverage: the Go/JS parity test covers the nested-path cases but not reader failures, so it cannot catch this.
Positive Highlights
- ✅ The qualified-path rule (resolve from root, bare and
./paths relative to the importer) matchesdetermineNestedBaseDir/isFileRelativeImportPathinimport_bfs.go. - ✅ The shared fixture covers cycles, deep chains, sibling imports, and template expressions.
- ✅ Docs and the changeset describe the resolution rules and the upgrade path clearly.
Verification was read-only. I did not run the Go or JS test suites, so the findings come from reading the diff and the base code.
@copilot please address the review comments above.
Comments that could not be inline-anchored
pkg/parser/frontmatter_hash.go:555
**[/diagnosing-bugs]** The body-hash walker has the same issue: every `fileReader` error is skipped with a bare `continue`. The JS counterpart at `actions/setup/js/frontmatter_hash_pure.cjs` (line 691) rethrows non-not-found errors. A failed read here would silently drop the imported body from the body hash. <details> <summary>💡 Suggested fix</summary> Use the same not-found classification as the frontmatter walker and return other errors. Cover this path with a test where the reader fails wi...
pkg/parser/frontmatter_hash_parity_test.go:36
**[/tdd]** Nit: `require.NoError` on the Node lookup fails the whole test when Node is absent. Other Node-dependent tests in `pkg/parser` (for example `runtime_import_test.go`) call `t.Skipf` instead, so this would be the only exception. <details> <summary>💡 Suggested change</summary> ```go node, err := exec.LookPath("node") if err != nil { t.Skipf("Node.js is required for the parity check: %v", err) } ``` </details> @copilot please address this.
pkg/parser/frontmatter_hash.go:493
**[/diagnosing-bugs]** This walker drops every `fileReader` error, not only not-found errors. The JS walker in `actions/setup/js/frontmatter_hash_pure.cjs` (line 251) rethrows anything where `!isFileNotFound(err)`, so Go and JS diverge. The PR body says the change must preserve genuine read-error propagation and must not suppress reader failures, but this path still does. A transient HTTP 500, which is the failure in the linked run, would silently produce a hash that omits imports. This predates...
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~1 AIC · ⊞ 5.4K
Comment /matt to run again
There was a problem hiding this comment.
🟡 Changes recommended
The imports documentation incorrectly implies that nested .github/... and /... imports invalidate the lock, although they resolve from the repository root and remain omitted by hash readers.
1 open issue
What changed in this PR
This PR aligns nested-import hashing with the compiler’s resolution rules, preventing doubled paths and ensuring nested content contributes to workflow lock verification.
Changes:
- Distinguishes workflow-root-qualified imports from file-relative imports during hash traversal.
- Adds shared Go and JavaScript regression fixtures covering nested chains, cycles, and content changes.
- Refreshes affected lock hashes and documents resolution rules and upgrade recompilation.
| File | Description |
|---|---|
pkg/parser/testdata/nested_import_hash.json |
Adds a shared nested-import fixture. |
pkg/parser/import_bfs.go |
Extracts the file-relative path predicate for reuse. |
pkg/parser/frontmatter_hash_nested_test.go |
Adds Go hash and content-change regression tests. |
docs/src/content/docs/reference/imports.md |
Documents nested resolution and hash behavior. |
actions/setup/js/frontmatter_hash_pure.test.cjs |
Tests nested hashes with API and filesystem readers. |
actions/setup/js/frontmatter_hash_pure.cjs |
Retains the workflow root through nested hash traversal. |
.github/workflows/unbloat-docs.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/uk-ai-operational-resilience.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/terminal-stylist.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/smoke-kiro.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/smoke-cursor.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/smoke-crush.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/smoke-agy.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/refiner.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/refactoring-cadence.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/pr-nitpick-reviewer.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/ponytail-reviewer.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/lockfile-stats.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/impeccable-skills-reviewer.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/grumpy-reviewer.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/github-remote-mcp-auth-test.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/github-mcp-tools-report.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/engine-conformance-agy.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/docs-noob-tester.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/daily-team-evolution-insights.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/daily-safe-outputs-conformance.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/daily-multi-device-docs-tester.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/daily-malicious-code-scan.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/daily-elixir-credo-snippet-audit.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/daily-cli-performance.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/copilot-session-insights.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/copilot-pr-merged-report.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/codex-github-remote-mcp-test.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/code-simplifier.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/code-scanning-fixer.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/cli-consistency-checker.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/claude-code-user-docs-review.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/changeset.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/bot-detection.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/avenger.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/auto-triage-issues.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/artifacts-summary.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/architecture-guardian.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/approach-validator.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/agy-conformance-reusable.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/agent-job-health.lock.yml |
Refreshes lock metadata and admission hashes. |
.github/workflows/ace-editor.lock.yml |
Refreshes lock metadata and admission hashes. |
.changeset/fix-nested-import-hashes.md |
Records the patch and recompilation migration. |
Review effort: Max (auto)
|
Copilot assignment requested for the following outstanding work:
Once you start work, post this work summary as a PR comment without the leading Copilot mention, including the Sous-chef head, work, and state lines below, to record that the assignment is running. Apply the necessary fixes on this PR's existing branch, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved; stop when only human review or CI remains. Do not merge or trigger CI. Sous-chef requested-head: 7b71af1
|
…port-verification Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Regenerate workflow lock conflicts from merged sources. Scope nested import hash documentation to relative-form imports and link Path Resolution. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🎉 This pull request is included in a new release. Release: |

Why
AI Moderator run 42080745147 failed activation lock verification after the hash reader requested nonexistent
shared/shared/graders/...paths. A transient HTTP 500 then prevented verification, and the local fallback encountered ENOENT. The later matching debug hash was misleading: both existing hash implementations omitted the same nested grader imports.Approach
Align Go and JavaScript frontmatter/body hash traversal with compiler import resolution: qualified nested paths resolve from the root workflow directory, while bare names and
./paths remain relative to the importing file. Preserve cycle detection and genuine read-error propagation; do not accept legacy hashes or suppress reader failures.Shared regression fixtures cover qualified paths, sibling imports, deeper chains, cycles, nested configuration, template expressions, and body changes. Resolve eight existing slice-index lint findings only in the already-touched hash implementation using semantics-preserving iteration and length-checked capture access. Document the resolution rules and upgrade migration.
Migration and review notes
Regenerated 110 affected locks through
make recompile. Verified that their only changes are frontmatter/body hash metadata and matching admission/harness hash identities; workflow scripts, permissions, dependencies, and credential destinations are unchanged. No authored workflow sources or source-managed workflows changed. Affected workflows must be recompiled when upgrading because previously omitted nested content now contributes to their hashes.This does not change the separately investigated merge-ref lifecycle behavior.
Validation
pkg/parsersuite and 188 JavaScript hash/activation tests passed; typecheck, formatting, lint, and build passed.shared/sharedpath and passes with this fix.make agent-report-progressgate passed. Existing nonblocking warnings remain.No hosted workflow was dispatched or rerun, and no credentials were changed. Live Actions verification remains unperformed.