Skip to content

Community Markdown validation works without PR-template files - #86

Open
Marius Storhaug (MariusStorhaug) wants to merge 10 commits into
mainfrom
pr-validation-gate
Open

Marius Storhaug (MariusStorhaug) wants to merge 10 commits into
mainfrom
pr-validation-gate

Conversation

@MariusStorhaug

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

PSModule's central community-source validation accepts the intentional absence of PR-template files without weakening real Markdown or candidate-head checks. Use the declared Node.js LTS, Git and PowerShell 7 (pwsh), then run npm ci --ignore-scripts and npm run validate. Optional Markdown can be deleted before staging; the remaining central contribution source, nonempty scan and content/identity/boundary checks still must pass.

The user selected removing central PR templates too and using canonical PR-format guidance only. This PR removes validation's template prerequisite and copied-template fixtures; PSModule/.github#82 owns the actual deletion and authoring guidance. No replacement/distributed template or consumer validator rollout is introduced. Ordinary repositories gain no local CONTRIBUTING.md mandate.

New: Central source validation supports repositories without PR-template files

The read-only Community file validation job checks actual PR heads, including drafts, with locked shared Markdown rules. Valid fixture roots contain ordinary authored Markdown and the remaining .github/CONTRIBUTING.md source, without copying a PR template. Template presence is not required, and zero checked files is failure.

Git-reported working-tree deletions exclude absent optional Markdown even before staging. Existing tracked/nonignored .md and .markdown content remains validated. Missing or blank contribution sources, malformed content, direct/Git symlinks, outside-root paths, missing tools and absent/mismatched head identity still fail. Fixture index/environment isolation and Git-template-copy suppression are unchanged. Resolve merge conflicts before obtaining a fresh PR event, not an elevated or manually dispatched substitute.

The contribution-source requirement applies only to PSModule's special defaults repository. Local checks examine working-tree inputs; they do not certify a staged index or replace the required check on the pushed candidate. Other community files, hooks, forms, dependencies, workflow permissions and governance are unchanged. This is file validation, not a template distributor or semantic release-format validator.


Technical details

Verified current head: 26463d1ea1dac50773156abe9c490a574c1985c6. PR-event run 41243807604 and check 124662982620 pass on that exact head, with 25 passing cases and 10 actual current-branch Markdown files. Metadata retrigger 41243925683 also passes. The required context/source remains Community file validation/GitHub Actions integration 15368; current main is included with behind_by: 0. Final metadata and ready-event checks are verified before handoff.

Regression first: removing copied-template fixtures before code reproduced the old presence guard: 6 passed/16 failed over 22 cases, specifically rejecting a valid no-template root. Removing only that requirement made all 22 pass. Full summary review 5724988150 then identified unstaged optional tracked-file deletion. Anonymous generic-Markdown cases reproduced 22 passed/3 failed for optional deletion, removed required contribution source, and no remaining scan. Discovery now excludes only git ls-files --deleted paths, without broad catches or success-shaped defaults. All 25 cases pass; missing required sources and zero scans remain failures.

Exact deletion-candidate distinction: the unchanged legacy-base template is still present on this code branch as ordinary Markdown; the 10-file scan does not claim completed template removal. Actual deletion is independently owned.

PSModule/.github#82 at 0f0cef0c1fbb582bf7bf29c26ad96fee0d6d0bc4 has a complete recursive inventory with zero PR-template variants and nine Markdown files. The final helper passes a data-only local scan of those public candidate inputs with 9 checked files; an MD025 mutation and missing contribution source both exit 1. This is local compatibility, not PR 82's own PR-event result. Safe ordering is revised validation's normal integration first, then the independent deletion candidate refreshes and obtains its actual-head event. No workflow is copied between branches or merged here.

Canonical authority: the user-directed no-file policy supersedes earlier two-required-files and frozen complete-scaffold correspondence. The observed MSXOrg/docs#209 candidate bc03a5992615f65d1d5346dc48e7506e80b8b6ca is ready but unmerged. Its No PR-template files rule explicitly covers central sources and multiple-template directories, while CONTRIBUTING points authors to canonical PR Format and its complete description example. Documentation examples are not distributed PR-template files. Old template equality is historical, not current acceptance evidence or a production dependency.

Locked markdownlint-cli2@0.24.0 and the executable shared rules remain unchanged from merged MSXOrg/docs@36da9154aa55d2052345fb2f28b812b29daf8bc9, blob 4c0f98ccfb5050b2af5c6ad6e9389c55385a3103.

Command or input Result
npm exec --yes --package=node@26.13.0 -- npm test, before template-guard removal Expected failure: 6 passed/16 failed
The same test command, before deletion-aware discovery Expected failure: 22 passed/3 failed
npm exec --yes --package=node@26.13.0 -- npm run validate, after both fixes Passed: 25 cases, 10 real branch files
Exact PR 82 candidate inventory Complete: 0 PR templates, 9 Markdown files
Data-only local candidate scan using the final helper Passed: 9 files; MD025 and missing contribution source exit 1
Anonymous working-tree versus materialized staged-data experiment Valid working tree passes; malformed staged input fails MD001 with exit 1
Working, staged and git diff origin/main...HEAD --check Passed
Actual candidate PR-event check Completed success on exact current head; not dispatch, empty scan or diff review

Complete current-head review: explicitly requested review 5725027180 reports No open issues, no changes-requested state, zero new inline comments and all six earlier threads resolved. Its full Needs a closer look summary calls for human assessment of staging-state interactions. That qualifier is recorded, not treated as approval. An anonymous input-view experiment confirms local working-tree success is not staged-content certification: malformed staged data still fails under the same helper. Required CI validates the pushed PR checkout, so local/hook success is never substituted for the actual-head result. No real index, hook or merge experiment is claimed. Earlier-head reviews are not reused for this behavior change.

Unchanged enforcement: active rule 26275706 still requires exact context/app Community file validation/15368 on main only, strict freshness and no bypass. Inherited organization rules and the non-target control are unchanged. Workflow permissions remain default-deny plus contents: read, no persisted credentials, elevated trigger or publisher. This child changes no policy or operational audit; Task 85 remains separately owned.

Standards and convergence:

Surface Standards checked Domain/framework contract Result
Helper/fixtures Functions, Error Handling, Testing, Security; small .mjs tooling None (no framework-specific docs); real Git/Markdown/identity boundaries Fixed in this PR: absent templates/deleted optional inputs pass, meaningful failures retained
Validation-only README Documentation, Markdown, Natural Language User-directed no-file/central-only source policy Fixed in this PR; authoring overview and CONTRIBUTING stay independently owned
Unchanged legacy-base template Known pending deletion, not introduced by this PR Canonical no-file policy Exception - #81, delivered separately by PR 82
Workflow/rules/dependencies/hooks/forms No revision Existing check/source/strictness contract Unchanged; broader YAML remains #87

The revised Task plan and scoped convergence sweep cover the parent, operational sibling, independent deletion Task and broader YAML/feature work. Only the code leaf is served here. Ready state is not human approval, merge, completed deletion or aggregate closure. Operational Task 85 and PBI 83 remain open for their own criteria and the deletion candidate's later native check.

No merge, auto-merge, release publication, tag/label/history edit, consumer rollout, access or policy mutation is performed. No release-managed producer route exists here, so no Release decisions block or release label applies.

Relevant issues (or links)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The validator can fail on ignored editor history while missing .markdown files, Markdown symlinks, and absent required community files.

4 open issues
What changed in this PR

Adds reproducible Markdown validation for PSModule’s organization-default community files, without changing their content or consumer behavior. The diff also implements the PR-event workflow; required-check enforcement remains separate work.

Changes:

  • Adds locked tooling, shared MSX rules, and a validator that rejects lint errors, blank files, and empty scans.
  • Adds isolated fixtures, local setup instructions, and an optional pre-commit hook.
  • Adds the read-only Community file validation job for PRs targeting main, plus dependency update automation.
File Description
README.md Documents setup, validation scope, and enforcement boundaries.
package.json Defines validation commands and pins the linter.
package-lock.json Locks validation dependencies.
.pre-commit-config.yaml Runs validation before local commits when enabled.
.node-version Pins the Node.js runtime.
.gitignore Excludes installed validation dependencies.
.github/​workflows/​Validate-Community-Files.yml Validates actual PR heads with read-only permissions.
.github/​tests/​validate-markdown.test.mjs Adds nine fixtures covering valid and failing inputs.
.github/​scripts/​validate-markdown.mjs Discovers Markdown, checks content, and reports lint results.
.github/​linters/​.markdown-lint.yml Supplies the shared MSX Markdown rules.
.github/​dependabot.yml Schedules npm and GitHub Actions dependency updates.

Review effort: Balanced

Comment thread .github/scripts/validate-markdown.mjs Resolved
Comment thread .github/scripts/validate-markdown.mjs Resolved
Comment thread .github/scripts/validate-markdown.mjs Resolved
Comment thread .github/scripts/validate-markdown.mjs Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The Markdown scanner can pass while required files, symlinks, or alternate extensions go unchecked, and can fail on ignored editor files.

4 open issues
2 previously missed issues

In code that hasn't changed since last review

Low severity Update the PR description to reflect the added workflow

.github/​workflows/​Validate-Community-Files.yml:5

The PR description says the hosted Community file validation job is the next implementation step, but this file already adds and enables that PR-event job. Please update the description to disclose the workflow addition while keeping the current-head hosted evidence marked as outstanding.

Low severity Document that conflicting PRs do not run the workflow

README.md:35

GitHub does not start pull_request workflows while a PR has merge conflicts, even when checkout is configured to use its head SHA. Those PRs therefore do not run this job until the conflicts are resolved. Please document that exception; if validation of conflicting PRs is required, the workflow design needs a separately approved alternative.

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Fixture subprocesses can modify the caller’s Git index, while inherited Git templates can hide Markdown inputs and cause validation failures.

2 open issues
4 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Fixture Git commands and validator subprocesses inherit the hook’s repository environment, so they can read or modify the contributor’s real index instead of the disposable fixture index.

2 open issues

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human review is needed to assess Markdown discovery and test isolation under varying Git environments.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The validator’s handling of symlinked parent directories raises a repository-boundary concern that warrants human assessment.

No open issues 🎉

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The interaction between symlink resolution and dependency exclusions warrants human assessment.

No open issues 🎉

Review effort: Balanced

@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title Community Markdown receives reproducible file validation Community Markdown validation works without PR-template files Oct 31, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed to evaluate a validation failure when an optional tracked Markdown file is deleted but the deletion is unstaged.

No open issues 🎉

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The pre-commit validation’s interaction with Git’s staging state warrants human assessment because a passing hook may not reflect the committed content.

No open issues 🎉

Review effort: Balanced

@MariusStorhaug
Marius Storhaug (MariusStorhaug) marked this pull request as ready for review October 31, 2026 21:44
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.

Add read-only PR validation for PSModule community Markdown

2 participants