Skip to content

Fix stale skill docs and repo-path guard for the action-based JS architecture - #57579

Merged
pelikhan merged 4 commits into
mainfrom
copilot/deep-report-fix-stale-js-embedding-refs
Sep 1, 2026
Merged

Fix stale skill docs and repo-path guard for the action-based JS architecture#57579
pelikhan merged 4 commits into
mainfrom
copilot/deep-report-fix-stale-js-embedding-refs

Conversation

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The repo still documented a dead JavaScript embedding/bundling architecture in a few high-traffic skills, and some references pointed at renamed validation files and stale paths. That drift could steer contributors toward edits in the wrong runtime layer, where they would never affect shipped assets.

  • What changed

    • Rewrote the JavaScript refactoring and message-authoring skills to match the current action-centric workflow: source under actions/ and pkg/workflow/js/, generated bundles rebuilt through the action build pipeline, and no guidance that suggests //go:embed-style runtime shipping.
    • Corrected the smaller stale references in the internals and error-pattern-safety skills so they point at the live validation files (strict_mode_*.go, expression_safety_validation.go, expression_safety_test.go).
    • Added a lightweight guard that scans SKILL.md files for backticked repo-like paths and fails when they resolve to missing files, while ignoring package names and placeholder examples.
    • Hardened the guard’s test coverage for valid paths, invalid stale paths, and missing skill directories.
  • Why it matters

    • These skills are operational guidance for contributors and agents. Aligning them with the real build pipeline keeps future changes on the path that actually ships JavaScript instead of the historical dead architecture.
  • Example

bash scripts/check-skill-file-paths.sh

Copilot AI and others added 3 commits September 1, 2026 02:10
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix stale JavaScript-embedding architecture references in skills Fix stale skill docs and repo-path guard for the action-based JS architecture Sep 1, 2026
Copilot AI requested a review from pelikhan September 1, 2026 02:20
@pelikhan
pelikhan marked this pull request as ready for review September 1, 2026 02:59
Copilot AI balanced review requested due to automatic review settings September 1, 2026 02:59
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ Security scanning failed for Ponytail Reviewer. Review the logs for details.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • ab.chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by Ponytail Reviewer for #57579

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed: PR does not have the implementation label and has <=100 new lines of code in business logic directories.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped: No test files were added or modified in this PR. Changes are limited to skills documentation (.md), Makefile, and shell scripts (not in analyzed scope). Scope: Go (_test.go), JavaScript (*.test.cjs, *.test.js), Python, and Rust.

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-09-01T03:03:19.864+00:00
review_event: REQUEST_CHANGES
top_themes:
  - guard misses placeholder-style stale repo paths
files_reviewed:
  - .github/skills/developer-internals/SKILL.md
  - .github/skills/error-pattern-safety/SKILL.md
  - .github/skills/javascript-refactoring/SKILL.md
  - .github/skills/messages/SKILL.md
  - .github/skills/temporary-id-safe-output/SKILL.md
  - Makefile
  - scripts/check-skill-file-paths.sh
  - scripts/check-skill-file-paths_test.sh
comment_count: 1

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 34.4 AIC · ⌖ 7.43 AIC · ⊞ 23.5K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes

The new skill-path guard does not actually cover all of the stale path shapes this PR introduces, so the repo can still merge invalid skill guidance while the new lint target reports success.

Blocking theme

The guard skips placeholder-style backticked paths instead of treating them as invalid or forcing a different notation, and this PR still adds one of those skipped pseudo-paths in temporary-id-safe-output/SKILL.md. That undercuts the main value of the change: catching stale documentation before it drifts further.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 34.4 AIC · ⌖ 7.43 AIC · ⊞ 23.5K
Comment /review to run again

Comments that could not be inline-anchored

.github/skills/temporary-id-safe-output/SKILL.md:101

This guard is too narrow to catch the stale placeholder path this PR still adds, so it creates a false sense of coverage while letting invalid skill guidance merge.

<details><summary>💡 Why this blocks the change</summary>

scripts/check-skill-file-paths.sh only validates a small allowlist of prefixes (pkg/, scripts/, internal/, cmd/, .github/skills/, actions/...) and silently skips everything else. But this PR still adds pkg/workflow/js/&lt;job_name&gt;.cjs in `.github/skills/tempor…

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One simplification is worth making in the new skill-path guard; it can be made smaller without changing behavior. net: -20 lines possible.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • ab.chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by ✂️ Ponytail Reviewer for #57579 · codex · mai10 · 5.89 AIC · ⌖ 0.322 AIC · ⊞ 12.8K
Comment /ponytail to run again

exit 1
fi

# Extract backtick-delimited strings from SKILL.md files and validate the ones that

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scripts/check-skill-file-paths.sh:L26-L84: shrink: the guard splits token extraction, path filtering, and existence checks across Bash, embedded Python, and a long whitelist. One smaller parser that emits the candidate paths and checks them directly would cut the duplicated logic and make the guard easier to follow.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Fix stale skill docs and repo-path guard

The changes are well-targeted and correct.

What was reviewed

  • Skill doc updates (developer-internals, error-pattern-safety, javascript-refactoring, messages, temporary-id-safe-output) replacing stale (go/redacted):embed-based patterns with current action-generation/build pipeline references
  • New scripts/check-skill-file-paths.sh guard + scripts/check-skill-file-paths_test.sh + Makefile wiring

Findings

No blocking issues.

Minor: mixed indentation in JSON example (messages/SKILL.md)

The JSON schema example uses a mix of tabs and two-space indentation inconsistent with the surrounding file style. Low priority — JSON parsers are indifferent, but it may confuse readers.

Observation: Python subprocess per file in check-skill-file-paths.sh

The guard spawns a python3 subprocess per SKILL.md file for backtick extraction. With ~50 skill files this is fine today; a grep -oP or awk alternative would avoid overhead at scale. Not a blocker.

The guard script logic is sound: the bash and Python filters are slightly redundant but consistently correct. The three test scenarios (valid, invalid, missing directory) give solid baseline coverage.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet46 · 41 AIC · ⌖ 14.7 AIC · ⊞ 6.2K

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Markdown fences bypass the new guard, and several rewritten skills still describe nonexistent paths or incorrect build behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates contributor skills for the action-based JavaScript architecture and adds validation for stale repository paths.

Changes:

  • Revises JavaScript, message, validation, and temporary-ID skill guidance.
  • Adds a skill-path checker with shell tests.
  • Integrates the checker into linting and script tests.
File summaries
File Description
scripts/check-skill-file-paths.sh Adds the path validation guard.
scripts/check-skill-file-paths_test.sh Tests guard behavior and errors.
Makefile Integrates the guard into lint and tests.
.github/skills/temporary-id-safe-output/SKILL.md Corrects setup JavaScript paths.
.github/skills/messages/SKILL.md Reworks message-authoring guidance.
.github/skills/javascript-refactoring/SKILL.md Reframes JavaScript architecture guidance.
.github/skills/error-pattern-safety/SKILL.md Updates validation guidance.
.github/skills/developer-internals/SKILL.md Corrects validation file references.
Review details

Suppressed comments (7)

.github/skills/messages/SKILL.md:68

  • This parser guidance is inaccurate: parseMessagesConfig lives in pkg/workflow/safe_outputs_messages_config.go and explicitly assigns every string field with extractStringFromMap; it is not reflection-wired. Following this instruction would leave a new field unset at runtime.
If the message needs custom parsing logic, update the workflow parser in `pkg/workflow/safe_outputs.go` or the relevant config block. Most simple string fields will be wired automatically by the existing reflection-based parser.

.github/skills/messages/SKILL.md:72

  • Safe-output message modules are sourced from actions/setup/js/; pkg/workflow/js/ contains neither the current message modules nor their tests. This still directs the contributor into the dead source tree the PR is intended to remove.
Create the new module in the current shared JS location, typically `pkg/workflow/js/`:

.github/skills/messages/SKILL.md:142

  • Both referenced files are actually under actions/setup/js/; the pkg/workflow/js/ versions do not exist. Update these exact paths so the core type and export steps are actionable.
Update the `SafeOutputMessages` typedef and the return object in `pkg/workflow/js/messages_core.cjs`, and re-export the message helper from `pkg/workflow/js/messages.cjs`.

.github/skills/messages/SKILL.md:152

  • actions/setup/js/ is explicitly source-of-truth content copied by setup.sh; buildSetupAction only checks/counts these files and does not rebuild a bundle. Requiring make actions-build here misstates how message changes ship and may make contributors think generated output was refreshed when none exists.
- keep the JS module in `pkg/workflow/js/` or the relevant action folder,
- update the action dependency map or action source if needed,
- rebuild the action bundle with `make actions-build`.

.github/skills/error-pattern-safety/SKILL.md:110

  • No current validation helper implements these three protections: the repository has no lastIndex === lastIndex guard or iteration warning/limit, and current agent-error detection uses non-global RegExp.test() checks. Presenting the sample as an existing safety mechanism gives contributors a false guarantee.
The repo’s validation helpers include built-in protections for dangerous regex patterns:

1. **Zero-width detection**: Checks whether a regex stops advancing across iterations
2. **Iteration warning**: Warns when repeated runs approach a hang threshold
3. **Hard limit**: Stops execution before runaway loops can lock the process

.github/skills/messages/SKILL.md:109

  • The matching tests are also under actions/setup/js/; this example path does not exist under pkg/workflow/js/. Keeping it here would recreate the same dead-layer mistake for test placement.
Create a matching test file, for example `pkg/workflow/js/messages_my_new.test.cjs`:

.github/skills/messages/SKILL.md:185

  • These references preserve the stale source paths, and actions/README.md describes conventional generated actions rather than the setup action's directly copied scripts. Point this guide at the setup-specific source-of-truth documentation and files.
- `actions/README.md` - current action-generation/build workflow
- `pkg/workflow/js/messages_core.cjs` - shared safe-output message helpers
- `pkg/workflow/js/messages.cjs` - message exports
  • Files reviewed: 8/8 changed files
  • Comments generated: 5
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +67 to +82
import pathlib, re, sys
path = pathlib.Path(sys.argv[1])
text = path.read_text(encoding='utf-8', errors='ignore')
for match in re.findall(r'`([^`]+)`', text):
if not match or '://' in match:
continue
if any(ch.isspace() for ch in match):
continue
if any(ch in match for ch in "()[]{}'\"<>*?"):
continue
if '...' in match:
continue
if match.startswith('@'):
match = match[1:]
if '/' in match or match.startswith('.'):
print(match)
Comment on lines +44 to +56
if [[ "$candidate" == pkg/* ]]; then
:
elif [[ "$candidate" == scripts/* ]]; then
:
elif [[ "$candidate" == internal/* || "$candidate" == cmd/* || "$candidate" == eslint-factory/* ]]; then
:
elif [[ "$candidate" == .github/skills/* ]]; then
:
elif [[ "$candidate" =~ ^actions/.+\.(cjs|js|mjs|ts|md|yaml|yml)$ || "$candidate" =~ ^actions/.+/src/.+ || "$candidate" =~ ^actions/.+/index\.(cjs|js|mjs)$ ]]; then
:
else
continue
fi
## Step 2: Update Go Struct

Add the new field to `SafeOutputMessagesConfig` in `pkg/workflow/compiler.go`:
Add the field to `SafeOutputMessagesConfig` in `pkg/workflow/compiler.go`:
Comment on lines +15 to +18
- Shared JS modules live under `pkg/workflow/js/*.cjs` and `actions/setup/js/*.cjs`
- Action source files live under `actions/<action-name>/src/`
- Generated action bundles are committed under `actions/<action-name>/index.js`
- Shipping is driven by the action build pipeline (`make actions-build`, `gh aw actions-build`) and dependency maps such as `pkg/cli/actions_build_command.go`
## Validation Tests

All error patterns must pass these tests:
All error patterns must pass the same safety checks used by the repo’s unit suite:

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs, /tdd, and /codebase-design — requesting minor changes on test accuracy and a maintenance risk in the guard script.

📋 Key Themes & Highlights

Key Themes

  • Test fixture accuracy: The valid-paths test includes a ./README.md line that the guard never validates (it falls through the allowlist), creating false confidence in the coverage.
  • Dual filter duplication: The bash loop and the Python subprocess both implement the same exclusion rules independently — a future rule change needs to be applied in two places.
  • Directory vs file semantics: The guard uses -e (exists) not -f (regular file); no test documents whether directory references are intentionally allowed.

Positive Highlights

  • ✅ Excellent motivation: deleting 323 lines of dead (go/redacted):embed guidance and replacing it with 76 lines of accurate action-centric guidance is a net win for contributors.
  • ✅ The guard is narrow by design — the allowlist-prefix approach avoids false positives from package names and example snippets.
  • ✅ The test script uses isolated mktemp -d fixture roots, which is the right pattern for bash integration tests.
  • ✅ Adding the guard to lint and test-scripts means it runs in CI without requiring a separate opt-in step.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet46 · 70.8 AIC · ⌖ 15.3 AIC · ⊞ 7.6K
Comment /matt to run again

Comments that could not be inline-anchored

scripts/check-skill-file-paths_test.sh:18

[/diagnosing-bugs] The ./README.md fixture in the valid-paths test creates false confidence: the bash allowlist only validates paths starting with pkg/, scripts/, internal/, cmd/, eslint-factory/, .github/skills/, or the actions/ pattern. A ./-relative path silently falls through to the continue branch and is never checked, so the test passes for the wrong reason.

<details>
<summary>💡 Suggestion</summary>

Remove ./README.md from the valid fixture or add a comment cl…

scripts/check-skill-file-paths.sh:58

[/diagnosing-bugs] The guard's Python extraction and the bash filter apply the same exclusion rules twice but in slightly different ways — the Python script strips @ prefixes and also skips &#39;&quot;&lt;&gt;*? characters, whereas the bash loop above duplicates most of those same checks. This dual-filter approach creates a maintenance hazard: future rule changes must be applied to both layers to stay in sync.

<details>
<summary>💡 Suggestion</summary>

Consider making the Python script the single so…

scripts/check-skill-file-paths.sh:83

[/tdd] The test suite covers valid, invalid, and missing-directory scenarios but has no test for a path that names a directory rather than a file within an allowlisted prefix (e.g. pkg/workflow/js with no filename). The guard uses -e (exists), not -f (regular file), so a directory reference silently passes; it is worth verifying that is intentional and adding a test that documents the behaviour.

@copilot please address this.

Makefile:4

[/codebase-design] The check-skill-file-paths Makefile target is wired into lint but is not included in agent-report-progress-no-test, which is the fast pre-push target contributors use most often. A stale skill path will only be caught at full lint time, not on every intermediate save. If the script is fast enough (it is a grep + python pass over .github/skills/), consider adding it to the fast target.

@copilot please address this.

@pelikhan
pelikhan merged commit 4a88fd9 into main Sep 1, 2026
98 of 118 checks passed
@pelikhan
pelikhan deleted the copilot/deep-report-fix-stale-js-embedding-refs branch September 1, 2026 03:21
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.88.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[deep-report] Fix stale JavaScript-embedding architecture references in javascript-refactoring and messages skills

3 participants