Conversation
- Add ManifestFiles []string to Runtime struct in runtime_definitions.go - Populate manifest files for all known runtimes (bun, deno, dotnet, elixir, go, haskell, java, node, python, ruby, uv) - Add getAllManifestFiles() helper to compute deduplicated union of all manifest files - Add AllowManifestFiles *bool field to CreatePullRequestsConfig and PushToPullRequestBranchConfig - Pass manifest_files list and allow_manifest_files to handler configs in compiler - Add allow-manifest-files to JSON schema for create-pull-request and push-to-pull-request-branch - Create manifest_file_helpers.cjs with extractFilenamesFromPatch and checkForManifestFiles helpers - Add manifest file checks to create_pull_request.cjs and push_to_pull_request_branch.cjs - Add comprehensive tests for manifest_file_helpers Co-authored-by: pelikhan <[email protected]>
|
@copilot add documentation , use technical-doc-writer agent |
…to-pull-request-branch Add allow-manifest-files boolean option documentation to both safe output types. The default (false) refuses patches that modify package manifest files as a supply chain attack mitigation. Setting true opts in to allowing manifest modifications. Co-authored-by: Copilot <[email protected]>
Added documentation in
|
|
@copilot when a PR is refused because a forbidden manifest file, the error should be surfaced in the agent failure issue/comment in the conclusion job. |
…agent failure issue When a PR is refused due to manifest file protection, the agent failure issue/comment now shows a dedicated '🛡️ Manifest File Protection Triggered' section with the blocked files, PR link, and a YAML remediation snippet instead of the generic 'Code Push Failed' banner. Also exports buildCodePushFailureContext for testability and adds unit tests covering manifest-only, generic, and mixed failure scenarios. Co-authored-by: pelikhan <[email protected]>
Done in dbcc31e. When a manifest file protection check blocks a PR, the agent failure issue/comment now shows a dedicated 🛡️ Manifest File Protection Triggered section (separate from the generic "Code Push Failed" section) that includes:
|
There was a problem hiding this comment.
Pull request overview
Adds per-runtime manifest file definitions and enforces a new “manifest file protection” policy in safe outputs so patches modifying dependency/package manifests are refused by default (with an explicit opt-out).
Changes:
- Extend runtime definitions with
ManifestFilesand addgetAllManifestFiles()to provide the union list. - Enforce manifest-file modification blocking in
create-pull-requestandpush-to-pull-request-branchhandlers, gated byallow-manifest-files. - Update schema/docs and regenerate workflow lock configs to include compiler-injected
manifest_filesin handler configs.
Reviewed changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/runtime_definitions.go | Adds per-runtime ManifestFiles and union helper used for compiler injection. |
| pkg/workflow/create_pull_request.go | Adds allow-manifest-files config field for create PR safe output. |
| pkg/workflow/push_to_pull_request_branch.go | Adds allow-manifest-files config field for push-to-PR-branch safe output. |
| pkg/workflow/compiler_safe_outputs_config.go | Injects manifest_files union list and allow_manifest_files into handler configs. |
| pkg/parser/schemas/main_workflow_schema.json | Adds allow-manifest-files to safe outputs JSON schema for both handlers. |
| docs/src/content/docs/reference/safe-outputs.md | Documents manifest protection behavior and allow-manifest-files override. |
| actions/setup/js/manifest_file_helpers.cjs | New helper to extract filenames from patch headers and detect manifest file touches. |
| actions/setup/js/manifest_file_helpers.test.cjs | Unit tests for manifest-file patch parsing and detection. |
| actions/setup/js/create_pull_request.cjs | Blocks PR creation when patch modifies manifest files unless explicitly allowed. |
| actions/setup/js/push_to_pull_request_branch.cjs | Blocks PR-branch pushes when patch modifies manifest files unless explicitly allowed. |
| actions/setup/js/handle_agent_failure.cjs | Adds dedicated “Manifest File Protection Triggered” failure section; exports context builder. |
| actions/setup/js/handle_agent_failure.test.cjs | Unit tests for manifest-only vs generic vs mixed code-push failure rendering. |
| .github/workflows/weekly-safe-outputs-spec-review.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/weekly-editors-health-check.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/unbloat-docs.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/ubuntu-image-analyzer.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/tidy.lock.yml | Regenerated compiled handler config to include injected manifest_files (create + push). |
| .github/workflows/test-create-pr-error-handling.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/technical-doc-writer.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/smoke-update-cross-repo-pr.lock.yml | Regenerated compiled handler config to include injected manifest_files (push). |
| .github/workflows/smoke-project.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/smoke-multi-pr.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/smoke-create-cross-repo-pr.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/smoke-claude.lock.yml | Regenerated compiled handler config to include injected manifest_files (push). |
| .github/workflows/slide-deck-maintainer.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/refiner.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/q.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/poem-bot.lock.yml | Regenerated compiled handler config to include injected manifest_files (create + push). |
| .github/workflows/mergefest.lock.yml | Regenerated compiled handler config to include injected manifest_files (push). |
| .github/workflows/layout-spec-maintainer.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/jsweep.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/instructions-janitor.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/hourly-ci-cleaner.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/go-logger.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/glossary-maintainer.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/github-mcp-tools-report.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/functional-pragmatist.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/dictation-prompt.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/developer-docs-consolidator.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/dead-code-remover.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/daily-workflow-updater.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/daily-rendering-scripts-verifier.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/daily-doc-updater.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/daily-doc-healer.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/daily-architecture-diagram.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/craft.lock.yml | Regenerated compiled handler config to include injected manifest_files (push). |
| .github/workflows/code-simplifier.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/code-scanning-fixer.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/cloclo.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/ci-coach.lock.yml | Regenerated compiled handler config to include injected manifest_files. |
| .github/workflows/changeset.lock.yml | Regenerated compiled handler config to include injected manifest_files (push). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| context += "\n**Blocked Operations:**\n"; | ||
| for (const { type, error } of manifestErrors) { | ||
| context += `- \`${type}\`: ${error}\n`; | ||
| } | ||
| context += "\nTo allow manifest file modifications, add `allow-manifest-files: true` to the safe output configuration:\n"; | ||
| context += "```yaml\nsafe-outputs:\n create-pull-request:\n allow-manifest-files: true\n```\n"; | ||
| } |
There was a problem hiding this comment.
The manifest-protection remediation snippet is hard-coded to safe-outputs.create-pull-request, even when the blocked operation is push_to_pull_request_branch (or multiple operations are blocked). Generate the YAML snippet based on the blocked safe-output type(s) so the suggested config matches what actually failed (e.g., push-to-pull-request-branch: when that handler is blocked, or include both when mixed).
There was a problem hiding this comment.
The dynamic YAML snippet was already fixed in a prior commit. In 2859700 the snippet now shows manifest-files: fallback-to-issue (per the updated guidance) and the accompanying text directs users to human review rather than opting out entirely.
|
@copilot review comments |
…ion snippet 1. extractFilenamesFromPatch now captures both a/ and b/ sides of diff headers so renames/copies are detected (e.g., renaming package.json away still triggers manifest protection). dev/null sentinels are ignored. 2. The YAML remediation snippet in buildCodePushFailureContext is now generated dynamically from the actual blocked safe-output type(s) rather than always showing create-pull-request. push_to_pull_request_branch errors now show push-to-pull-request-branch: in the snippet; mixed errors show both keys. Adds 4 new tests for rename/dev-null handling in manifest_file_helpers, and 2 new tests for push-type and mixed-type YAML snippets in handle_agent_failure. Co-authored-by: pelikhan <[email protected]>
Both review comments addressed in 5d1469e:
|
Co-authored-by: pelikhan <[email protected]>
Fixed in d69e90c. Two inconsistencies between docs and code:
|
|
@copilot rename field to "protected-files" to reflect the set of files |
Rename the user-facing `manifest-files` frontmatter field to `protected-files` to better reflect the broader set of files it protects (package manifests, agent instruction files, and repository security configuration under .github/ and .agents/). - Go struct yaml tags: manifest-files → protected-files - JSON schema property names: manifest-files → protected-files - Internal config JSON keys: manifest_files → protected_files, manifest_files_policy → protected_files_policy - JS handlers: updated config key reads and error messages - MD fallback templates: updated header and guidance text - Docs: updated all manifest-files: examples to protected-files: - Tests: updated output assertions - Recompiled 166 lock files with new key names Co-authored-by: pelikhan <[email protected]>
Done in 3629fc2. The field is now
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot review docs for correct protected files terminology |
… terminology throughout Co-authored-by: pelikhan <[email protected]>
Fixed in 59a00de. Updated all "Manifest File Protection" terminology to "Protected File Protection" across docs and code:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot rename "Protected File Protection" to "Protected Files" |
Co-authored-by: pelikhan <[email protected]>
Done in da56627. All occurrences of "Protected File Protection" renamed to "Protected Files":
|
…e-pull-request Co-authored-by: pelikhan <[email protected]>
Fixed in 1b95060. The |
ManifestFiles []stringfield toRuntimestruct and populate per runtimegetAllManifestFiles()helpercreate-pull-requestandpush-to-pull-request-branchprotected-filesproperty to JSON schemamanifest_file_helpers.cjswith shared helper functionsextractFilenamesFromPatchfor rename/copy detectionfallback-to-issueoption with issue creation behaviorAGENTS.mdand.github/path-prefix protectionprotected-filesfield with enumblocked/allowed/fallback-to-issueAgentFileProviderinterface for per-engine protected files (CLAUDE.md, .claude/, AGENTS.md)AgentFileProviderfor Copilot, Claude, Codex enginesthreat-detection.md)protected-files: allowedhandle_agent_failure.cjsto suggestfallback-to-issueinstead ofallowed.agents/as global protected path prefix (supply-chain protection for agentic files)manifest_protection_create_pr_fallback.md,manifest_protection_push_to_pr_fallback.md)protected_files,protected_files_policy,protected_path_prefixeshandle_agent_failure.cjsdescription: "package manifest files" → "protected files (package manifests, agent instruction files, or repository security configuration)"protected-files: fallback-to-issuemanifest-files→protected-filesto reflect the broader set of protected files#close-pull-request-close-pull-requestanchor to be unreachableOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.