Skip to content

Initialize-DevContainer.ps1's help names .template/Initialize-Nvs.ps1 in projects that don't have it #677

Done

Description

@polewskm

Note

Repositories:

Attach or clone each before working on this issue.

Problem

template/.template/Initialize-DevContainer.ps1.jinja has the same comment-based help in every stack. Its .DESCRIPTION says, unconditionally, that "Node.js comes from .template/Initialize-Nvs.ps1, which installs the .node-version release with nvs and sets up the bash and PowerShell profiles to use it; Bun comes from npm". The script calls ./.template/Initialize-Nvs.ps1 only in the stack == 'node' branch, though, and a project that doesn't use Node.js, such as the .NET library NCodeGroup/Collections.Providers (stack: dotnet, uses_node: false), gets no .template/Initialize-Nvs.ps1 at all. Its rendered Initialize-DevContainer.ps1 therefore names a script the checkout doesn't have, and describes a Node.js setup its dev container never runs.

The file is template-owned, so the project can't correct it: an update would replace the edit.

Change

Render the help's stand-in list from the same conditions as the script's body: name .template/Initialize-Nvs.ps1 (and Bun from npm) only where the script calls it, and the .NET SDK, Python and other stand-ins only for their stacks, or word the sentence so it says each stand-in applies only to the stack that uses it.

Acceptance

  • A dotnet project with uses_node: false renders an Initialize-DevContainer.ps1 whose help names no .template/Initialize-Nvs.ps1.
  • A node project's help still names it.

Activity

  1. polewskm commented on Nov 30, 2026

    @polewskm
    CollaboratorAuthor

    Plan snapshot. The working copy is PLAN.md in the plan's checkout; this comment is not updated as steps run.

    Plan: Six template fixes from the v0.153.0 updates (20 steps)

    Plan: Six template fixes from the v0.153.0 updates

    Issue: #679 #678 #677 #675 #674 #673
    Release: v0.153.3

    Goal

    Fix six gaps that projects updating to v0.153.0 hit in template-owned files they can't change. raise-baseline.yml makes the baseline raise again on the default branch as it is once nuget.org lists the version, so a workflow change merged during the wait no longer gets the push refused (#679). Every comment line in the template's rendered files wraps at 120 columns, and the template's tests fail on one that doesn't (#678). Initialize-DevContainer.ps1's help names only the stand-ins its stack runs (#677). A library's ## Project block links an existing CHANGELOG.md and speaks of a pre-release catalog only while the project is pre-release (#675). docs/best-practices-criteria.md links the project's own files without heading anchors (#674). Test-Readme.ps1 never counts a build's output as a package (#673).

    Context for the executor

    • Build: none (PowerShell and Node.js scripts, no compile step).
    • Test: each step's Done-when runs what it needs. ./tests/Test-Template.ps1 -Only __none__ runs every static check and fixture without rendering (about 35 seconds); -Only <case>, <case> renders only those cases (about 10 seconds each). Copier 9.19.1 (copier on PATH) and tests/node/node_modules are installed in this session; Node.js (node, v26) is on PATH.
    • Conventions:
      • The template's files live under template/. template/.template/Get-PlanState.ps1 and .template/Get-PlanState.ps1 are generated from workflow/Get-PlanState.ps1 by ./tools/Update-Template.ps1: never edit the generated copies.
      • Code comments, decision records and help text wrap at 120 columns. Docs pages under docs/ keep each line at 400 characters or fewer, one fact per bullet.
      • Tests print PASS <name> or FAIL <name> <detail> through their Check function; keep each new check's name exactly as the step gives it, because the Done-when commands match it.
      • Commit each step as Plan step N: <title>, staging only the files the step lists (git add -- <files>); never git add -A, never stage PLAN.md.
    • Gotchas:
      • A script or command never passes a relative path to a .NET method, such as [IO.File]::ReadAllText, [IO.File]::WriteAllText or [IO.Directory]::GetFiles: .NET resolves it against the process's folder, which Set-Location doesn't move and which in a Copilot session is the main checkout, not the plan's worktree. Use Get-Content -LiteralPath, Set-Content -LiteralPath or Get-ChildItem, or make the path absolute first with Join-Path (Get-Location) <path>.
      • Run tests/Test-Template.ps1 with -Only from PowerShell (& ./tests/Test-Template.ps1 -Only a, b), never as pwsh -File ... -Only a, b: -File passes a, and b as separate arguments, and b becomes the work folder, inside the worktree.
      • tests/Test-Template.ps1, tests/Test-Readme.ps1 and tests/Test-UpdateBaseline.ps1 keep their work folder when a check fails; the Done-when commands pass a -Work folder in the temp folder and delete it afterwards.
      • Steps 1, 6, 12, 14, 16 and 18 add tests that must FAIL until a later step fixes the code: their Done-when commands pass only while those tests fail. Don't fix the code in those steps.
      • The word check in the wrap steps' Done-when compares each file with git show HEAD:<file>, so run it before committing the step.

    Decisions

    • Kind: bugfix. Test-Readme.ps1 counts a gitignored build output under artifacts/ as a package #673 is labeled bug; raise-baseline.yml's push is refused when the default branch changes a workflow file while it waits for nuget.org #679, Initialize-DevContainer.ps1's help names .template/Initialize-Nvs.ps1 in projects that don't have it #677, A library's Project block says the first plan creates CHANGELOG.md, also where it already exists #675 and best-practices-criteria.md links SECURITY.md#verify-a-release, which a project-owned SECURITY.md may lack, and Markdown checks fails #674 are template gaps found while updating projects, and Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678 fixes comments a review flags in every updated project. All six are fixes, so the raise is a patch: v0.153.2 → v0.153.3. If another plan lands v0.153.3 or v0.154.0 first (Baseline reads the repository's manifest, needs only its name #682 names v0.154.0), /ship-plan renumbers.
    • raise-baseline.yml's push is refused when the default branch changes a workflow file while it waits for nuget.org #679 root cause: raise-baseline.yml's checkout takes the default branch at the job's start, build/Update-Baseline.ps1 then waits up to 30 minutes for nuget.org, and the issue step runs git switch -c baseline-<version> from that old commit. When a pull request that changes a workflow file merges meanwhile, the branch's tree undoes that change relative to the newest default branch, and GitHub refuses a GITHUB_TOKEN push that changes a workflow file. Evidence: NCodeGroup/Randomness run 46495265465 (checkout 19:28:42Z, Dependabot's codeql.yml change merged 19:31:47Z, push refused 19:34:44Z), and the same in PasswordGenerator v2.1.1 and PropertyBag v2.1.3.
    • raise-baseline.yml's push is refused when the default branch changes a workflow file while it waits for nuget.org #679 fix: in the issue step, before git switch -c, fetch the default branch with the same one-command token header the branch check uses (git fetch --depth=1 origin <default>), git reset --hard FETCH_HEAD, and run ./build/Update-Baseline.ps1 -Version $env:VERSION -SkipNugetCheck again, since nuget.org already lists the version. When it prints nothing, the newest default branch already holds the baseline: the step writes that to the summary and exits 0. Verified in a scratch fixture: after a workflow commit landed on the bare origin, the lines left the clone on the newest commit with the workflow change and the raise. Rejected: rebasing the raise commit onto origin/<default>, which conflicts when the default branch changed the same project file or changelog; the re-raise has no conflict to resolve. A workflow change merged in the seconds between the fetch and the push still makes GitHub refuse the push, so the push's failure message and the workflow's header say that re-running the failed job finishes the work, as the issue asks.
    • Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678: the check and the wrapping come from one Node.js script, tests/node/comment-width.mjs (ADR-0021: Node.js first; it sits with the other Node.js checks tests/Test-Template.ps1 runs). check reports, wrap rewrites, so a later failure names its own fix. Wrapping by hand was rejected: about 215 lines in 27 files, some 900 columns long. A scratch run of the prototype on template/ left no wide comment line, kept every word, kept Get-Help's word count for every wrapped script, and passed every suite of tests/Invoke-AllTests.ps1 -SkipDotnetBuild except the codeql.yml citation check (below) and the suites that need a Git checkout or the .NET SDK, which the scratch copy lacked.
    • Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678 scope: every comment line of every rendered file the check can classify, template-owned or written once, since a project leaves both as rendered (the issue's comment). Markdown is out of scope: Get-WideLine already checks the Markdown pages a project keeps short, and the .md commands are prose the template generates.
    • comment-width.mjs's rules, which steps 4 and 5 implement:
      • Syntax, from the file's base name without a trailing .jinja: powershell for .ps1, .psm1, .psd1; hash for .yml, .yaml, .sh, .toml and the names Dockerfile, .gitignore, .gitattributes, .editorconfig, .csharpierignore, pre-push, pre-commit, commit-msg; slash for .mjs, .cjs, .js, .ts, .cs, .jsonc; xml for .props, .targets, .xml, .csproj, .slnx; any other file is skipped.
      • Line markers: # for powershell and hash, // for slash. Block comments: <# … #> for powershell, /* … */ for slash, <!-- … --> for xml.
      • Each line's kind: inside an open block it is block, and a line holding the closer ends the block; a line whose trimmed text starts with the block opener is open, and the block stays open unless the closer follows the opener on that line; a line whose trimmed text starts with the line marker, and not with #!, is line; any other line is code, never checked or changed.
      • Wide: a comment line (any kind but code) longer than 120 characters whose text, after the trimmed line loses one leading marker (<#, #>, #, //, /**, /*, */, *, <!--, -->) and the spaces after it, still holds whitespace. One long URL or other unbreakable token isn't wide.
      • Wrapping a wide line: its first prefix and text are ^(\s*(?:#|//)\s*)(.*)$ for line; ^(\s*<opener>\**\s*)(.*)$ for open; ^(\s*(?:\*\s+)?)(.*)$ for block. A text ending in the block's closer loses it, and the closer becomes the last word. The continuation prefix is the first prefix for line and block; for open it is the line's indentation plus as many spaces as the rest of the first prefix (so <!-- continues with 7 spaces); a text starting with a list marker (^([-*+]|\d+[.)])\s+) adds that marker's width in spaces.
      • A slash open line, such as /** text */, becomes the opener alone on its line (/** or /*, as written), then the text with prefix <indentation> * , then <indentation> */ when the line held the closer.
      • Words are runs of non-whitespace, with each Jinja tag ({{ … }}, {% … %}, {# … #}) kept whole inside its word: regex /(?:\{\{.*?\}\}|\{%.*?%\}|\{#.*?#\}|\S)+/g.
      • The paragraph goes on into the following lines while the text so far doesn't end a sentence (trimmed, it doesn't match /[.:;!?]['")]]*$/) and the next line has the same kind (lineafterline, blockafteropenorblock), starts with the continuation prefix, and its rest is non-empty, starts with no whitespace, no list marker, no .followed by an uppercase letter (a help keyword such as.PARAMETER), no SPDX-and noCopyright `, and holds the block's closer only at its end and isn't the closer alone. A taken line that ends with the closer ends the paragraph, and the closer becomes its last word. A wide line that held its closer takes no next line.
      • Filling is greedy: each word goes on the current line when the line stays at 120 characters or fewer, else it starts the next line after the continuation prefix; a line's first word always goes on. A next line never starts with a word that starts with . (PowerShell would read it as a help keyword): when it would, the current line's last word moves down with it, unless that word is the line's only word.
      • Line endings stay as they are (\r\n when the text has one, else \n), and so does the final newline; a text with no wide comment line comes back unchanged.
    • Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678: codeql.yml.jinja's comment is wrapped by hand, before the script runs, as scorecard.yml.jinja and dependency-review.yml already are: tests/Test-Template.ps1 checks that each of the three holds (the template's tests/Test-Template.ps1 checks it). on one line, which the script's greedy wrap would split.
    • Initialize-DevContainer.ps1's help names .template/Initialize-Nvs.ps1 in projects that don't have it #677 root cause: template/.template/Initialize-DevContainer.ps1.jinja's .DESCRIPTION lists every stack's stand-ins unconditionally, while its body calls ./build/Install-Dotnet.ps1 only for stack == 'dotnet' and ./.template/Initialize-Nvs.ps1 only for stack == 'node' or uses_node, as copilot-setup-steps.yml.jinja sets up .NET, Python, Node.js and Bun under the same conditions. Evidence: a dotnet render without uses_node has no .template/Initialize-Nvs.ps1 and a python render has no build/Install-Dotnet.ps1, yet both renders' help name both. Fix: one help sentence per stand-in, each under the body's condition.
    • A library's Project block says the first plan creates CHANGELOG.md, also where it already exists #675 root cause: Get-ReadmeProject in template/.template/Test-Readme.ps1 and the library branch of template/README.md.jinja (line 132) write one fixed changelog line, a code span and "The first plan creates it.", whatever the project's state. Fix: the script links [CHANGELOG.md](CHANGELOG.md) and drops "The first plan creates it." when CHANGELOG.md exists at the root, and says "what the product does until its first stable release, and what changed in each release from then on" only while the project is pre-release, else "what changed in each release". Pre-release is read as Get-PlanState.ps1 and Update-Project.ps1's Test-PreReleaseProject read it: the Landing section's last - pre-release: line says untracked and no tag merged into HEAD is a stable version; tags that Git can't list, as in a folder that isn't a Git work tree, count as none, so a new library still gets today's text. The Jinja, which renders a new library with no changelog, follows the pre_release answer, which Update-Project.ps1 and Adopt-Project.ps1 pass.
    • best-practices-criteria.md links SECURITY.md#verify-a-release, which a project-owned SECURITY.md may lack, and Markdown checks fails #674 root cause: template/docs/best-practices-criteria.md.jinja is template-owned and links headings of files copier.yml's _skip_if_exists makes the project's: ../SECURITY.md#verify-a-release, #verify-a-package, ../GOVERNANCE.md#continuity and assurance-case.md#security-reviews. A project whose own file lacks the heading fails check-markdown.mjs. Fix: link those files without the anchor, citing what they say, as the page already cites CONTRIBUTING.md (never by heading). Rejected: having Update-Project.ps1 name a SECURITY.md without the section, which would still fail CI until the project writes it, and leaves the GOVERNANCE.md and assurance-case links exposed the same way. No other template-owned page links a heading of a project-owned file (searched template/ for .md# links).
    • Test-Readme.ps1 counts a gitignored build output under artifacts/ as a package #673 root cause: Get-PackageProject in template/.template/Test-Readme.ps1 walks every folder but dot-folders, bin, obj and node_modules, so a .csproj that a build writes under the gitignored artifacts/ counts as a package. Fix: skip folders named artifacts too, as Update-Project.ps1's and Update-Baseline.ps1's project scans do, and drop each project file git -C <root> check-ignore --stdin reports; outside a Git work tree or without git, nothing more is dropped.

    Out of scope

    • No change to build/Update-Baseline.ps1, publish.yml or the issue-and-link half of raise-baseline.yml's issue step.
    • No wrapping of Markdown files, of this repository's own tools/, tests/ or root scripts, or of code lines; no rewording of a comment beyond what the script or a step gives.
    • No change to copier.yml, to SECURITY.md.jinja, GOVERNANCE.md.jinja or docs/assurance-case.md.jinja, or to Update-Project.ps1's notes.
    • No hand edit of a generated file under .claude/commands/, .github/prompts/, .github/skills/, .github/agents/ or of .template/Get-PlanState.ps1 and template/.template/Get-PlanState.ps1.
    • No new decision record.

    Steps

    [ ] 1. Add failing tests for raise-baseline.yml's raise on the newest default branch

    • Issue: raise-baseline.yml's push is refused when the default branch changes a workflow file while it waits for nuget.org #679
    • Files: tests/Test-UpdateBaseline.ps1 (edit)
    • Change: insert a block right before the $changelog = "$changelogHeadn$changelogTail"line that follows the'raise-baseline.yml: the pull request description names ...'` check:
      • $refreshLines = @(Get-Content -LiteralPath $workflow | ForEach-Object { $_.Trim() }); $from = index of the first line matching '^git -c "http\.https://github\.com/\.extraheader=AUTHORIZATION: basic \$auth" fetch '; $to = index of the first line starting with 'if (-not $set)' (both with [Array]::FindIndex, as tests/Test-PublishRelease.ps1 finds its issue step); $refresh = those lines from $from to $to, or @().
      • Check 'raise-baseline.yml: has the lines that make the raise again on the newest default branch' ($refresh.Count -ge 5) "lines: $($refresh.Count)"
      • A function New-RaiseClone([string]$Name): git init -q --bare -b main <Work>/<Name>-origin.git; New-Case "$Name-seed" with $csproj = Get-Project '5.0.1', CHANGELOG.md = "$changelogHeadn$changelogTail", build/Update-Baseline.ps1= the text of$script, .github/workflows/ci.yml="name: CIn"; in the seed: init -q -b main, remote add origin <origin>, add -A, commit, push -q origin main; then git clone -q --depth 1 ([uri]<origin>).AbsoluteUri <Work>/<Name>-job and, in the job clone, & (Join-Path $job 'build/Update-Baseline.ps1') -Version 5.0.2 -SkipNugetCheck 6>$null | Out-Null. Return Seed and Job. Commit and push with -c user.name=Test -c [email protected] -c commit.gpgsign=false -c core.hooksPath=NUL, as the workflow-body case commits; throw when a git call fails.
      • A function Invoke-Refresh([string]$Job): write a script to $Work holding $auth = 'eA==', the $refresh lines and "set=$set"; set DEFAULT_BRANCH=main, VERSION=5.0.2 and GITHUB_STEP_SUMMARY (an empty file in $Work), restoring them afterwards; run pwsh -NoProfile -File <script> inside Push-Location -LiteralPath $Job; return Code, Output (joined) and Summary (the file's text).
      • Case moved: $c = New-RaiseClone 'refresh-moved'; in the seed, write .github/workflows/ci.yml = "name: CIn# changedn", commit, push; $r = Invoke-Refresh $c.Job. Check 'raise-baseline.yml: a workflow change merged while the raise step waited is in the base of the branch it pushes' with $r.Code -eq 0, $r.Output.Contains('set=5.0.2'), git -C $c.Job rev-parse HEAD equal to git -C $c.Seed rev-parse HEAD, the job's ci.yml containing # changed, and the job's $csproj -ceq (Get-Project '5.0.2').
      • Case raised: $c = New-RaiseClone 'refresh-raised'; in the seed, write $csproj = Get-Project '5.0.2', commit, push; $r = Invoke-Refresh $c.Job. Check 'raise-baseline.yml: a default branch that already has the version leaves nothing to push' with $r.Code -eq 0, $r.Summary.Contains('nothing to push'), not $r.Output.Contains('set=5.0.2'), and git -C $c.Job status --porcelain empty.
      • In .DESCRIPTION, after run in a Git fixture, add the lines of raise-baseline.yml that make the raise again on the newest default branch, run in a clone whose origin moved on, keeping the help wrapped at 120 columns.
    • Pattern: the workflow-body case above it; Invoke-IssueStep in tests/Test-PublishRelease.ps1.
    • Done when: $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-baseline'; $o = @(& ./tests/Test-UpdateBaseline.ps1 -Work $w 2>&1 | ForEach-Object { "$_" }); $code = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; if ($code -and @($o -match '^FAIL raise-baseline\.yml: (has the lines that make|a workflow change merged|a default branch that already)').Count -eq 3 -and -not ($o -match '^FAIL (?!raise-baseline\.yml: (has the lines that make|a workflow change merged|a default branch that already))')) { exit 0 } else { exit 1 }

    [ ] 2. Make the raise again on the newest default branch before the push

    • Issue: raise-baseline.yml's push is refused when the default branch changes a workflow file while it waits for nuget.org #679
    • Files: template/.github/workflows/raise-baseline.yml (edit)
    • Change:
      • Replace the header's first 13 lines (from # Raise the package validation baseline: through # owns this file.) with these 17 lines:

        # Raise the package validation baseline: publish.yml calls this workflow as its baseline job after it publishes a stable
        # release, or a person runs it by hand with a release tag. It runs build/Update-Baseline.ps1, which waits for nuget.org
        # to list the version and raises PackageValidationBaselineVersion to it, removing the baseline suppressions a new major
        # version leaves behind. Then it makes that raise again on the default branch as it is once nuget.org lists the version,
        # so the branch keeps every change merged during the wait, pushes baseline-<version> and opens an issue with a link that
        # opens the pull request, its title and description filled in, `Closes #<issue>` included. A person opens it, which
        # starts CI and NCode Review's review, so the workflow needs no "Allow GitHub Actions to create and approve pull
        # requests", which tools/Set-RepositoryBaseline.ps1 keeps off (ADR-0036). GitHub refuses the push when a change to a
        # workflow file merges into the default branch between that second raise and the push, since the job's token can't
        # change a workflow: re-running the failed job finishes the work. A rerun finds the branch and its open issue, pushes
        # nothing, and writes the issue's link again, so a run that failed after the push is finished by running it again. It
        # is not started by a workflow-run trigger, which GitHub never fires for the run tag-release.yml starts with
        # GITHUB_TOKEN. The template's ADR-0150 and ADR-0151 say why; it changes nothing until the project sets the baseline
        # once (ADR-0147).
        #
        # The checkout keeps no credential; the branch check, the fetch of the default branch and the push each get the token
        # for that one command. The template owns this file.
      • In the issue step, right after if ($LASTEXITCODE) { throw "git config user.email failed with exit code $LASTEXITCODE." } and before git switch -c $branch, insert at the same 10-space indent:

        # nuget.org lists the version now, but the default branch may have moved on while the raise step waited for
        # it, and a branch made from the older commit would undo the newer commits' changes, which GitHub refuses for
        # a workflow file. So the raise is made again on the default branch as it is now.
        git -c "http.https://github.com/.extraheader=AUTHORIZATION: basic $auth" fetch --quiet --depth=1 origin $env:DEFAULT_BRANCH
        if ($LASTEXITCODE) { throw "git fetch failed with exit code $LASTEXITCODE." }
        git reset --quiet --hard FETCH_HEAD
        if ($LASTEXITCODE) { throw "git reset failed with exit code $LASTEXITCODE." }
        $set = ./build/Update-Baseline.ps1 -Version $env:VERSION -SkipNugetCheck
        if (-not $set) { "The default branch already has PackageValidationBaselineVersion $env:VERSION or later: nothing to push." >> $env:GITHUB_STEP_SUMMARY; exit 0 }
      • Replace the push's if ($LASTEXITCODE) { throw "git push failed with exit code $LASTEXITCODE." } with if ($LASTEXITCODE) { throw "git push failed with exit code $LASTEXITCODE. When a workflow change merged into the default branch after this job fetched it, GitHub refuses the push: re-run the failed job, which makes the raise again on the newest default branch." }

    • Done when: $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-baseline'; & ./tests/Test-UpdateBaseline.ps1 -Work $w | Out-Null; $a = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; $w2 = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-publish'; & ./tests/Test-PublishRelease.ps1 -Work $w2 | Out-Null; $b = $LASTEXITCODE; Remove-Item -LiteralPath $w2 -Recurse -Force -ErrorAction SilentlyContinue; $long = @(Get-Content -LiteralPath template/.github/workflows/raise-baseline.yml | Where-Object { $_.TrimStart().StartsWith('#') -and $_.Length -gt 120 }); if (-not $a -and -not $b -and (Select-String -LiteralPath template/.github/workflows/raise-baseline.yml -SimpleMatch -Pattern 're-run the failed job, which makes the raise again' -Quiet) -and $long.Count -le 1) { exit 0 } else { exit 1 }

    [ ] 3. Describe the raise on the newest default branch in the docs

    • Issue: raise-baseline.yml's push is refused when the default branch changes a workflow file while it waits for nuget.org #679
    • Files: docs/files.md (edit), docs/adopt.md (edit), docs/tests.md (edit)
    • Change:
      • docs/files.md, under - .github/workflows/raise-baseline.yml(.NET,nuget_package): ..., right after - It runsbuild/Update-Baseline.ps1``, add - Once nuget.org lists the version, it makes the raise again on the default branch as it is then, so the branch keeps every pull request merged during the wait, then ` - A workflow change merged in the moment before the push makes GitHub refuse it, since the job's token can't change a workflow; re-running the failed job finishes the work`.
      • docs/adopt.md, in the **Goes wrong:** line that ends finds the branch and issue and writes the link again; pre-releases raise nothing., replace that ending with finds the branch and issue and writes the link again; a push GitHub refuses because a workflow change merged into the default branch just before it is finished by re-running the failed job; pre-releases raise nothing.
      • docs/tests.md, under - tests/Test-UpdateBaseline.ps1: build/Update-Baseline.ps1, offline, right after - It runs the lines ofraise-baseline.yml that list the suppression files ..., add - It runs the lines ofraise-baseline.yml that make the raise again on the default branch in a clone whose origin took a workflow change during the wait: the branch starts from the newest commit, with the raise, and a default branch that already has the version leaves nothing to push.
    • Done when: $ok = (Select-String -LiteralPath docs/files.md -SimpleMatch -Pattern 'makes the raise again on the default branch as it is then' -Quiet) -and (Select-String -LiteralPath docs/adopt.md -SimpleMatch -Pattern 'is finished by re-running the failed job; pre-releases raise nothing.' -Quiet) -and (Select-String -LiteralPath docs/tests.md -SimpleMatch -Pattern 'that make the raise again on the default branch in a clone' -Quiet); & ./tests/Test-Markdown.ps1 | Out-Null; if ($ok -and -not $LASTEXITCODE) { exit 0 } else { exit 1 }

    [ ] 4. Add comment-width.mjs's check and its test cases

    • Issue: Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678
    • Files: tests/node/comment-width.mjs (new), tests/node/comment-width.test.mjs (new)
    • Change: write comment-width.mjs as an ES module using only Node.js built-ins, after the shape of tests/node/markdown.mjs: a header comment (what it checks and wraps, the usage lines node tests/node/comment-width.mjs check <path>... and node tests/node/comment-width.mjs wrap <path>..., and that tests/Test-Template.ps1 runs check on each render and comment-width.test.mjs), then exported syntaxOf(path), classify(lines, syntax), findWide(text, path, max = 120) returning [{ line, columns }] (1-based line), and main(argv, { log }), by the rules under Decisions, plus the run-if-main block of markdown.mjs with only log.
      • main(['check', ...paths]): each path is a file, or a folder walked recursively in sorted order, skipping .git and node_modules; files without a syntax are skipped unread. It logs <shown>:<line> (<columns> columns) for each wide line, where <shown> is the file's path relative to the folder argument with / separators, or the file argument as given, then returns 1 when it logged any, else 0. With no path, or another subcommand, it logs the usage lines and returns 2. Leave a wrap subcommand for step 5: until then it is unknown (returns 2).
      • comment-width.test.mjs (node:test, node:assert/strict, after tests/node/markdown.test.mjs), with these tests: syntaxOf gives powershell for a/b.ps1, hash for ci.yml.jinja, Dockerfile.jinja and .githooks/pre-push, slash for check.mjs, xml for ProjectTemplate.props.jinja, null for README.md; findWide on a.ps1 text of three lines, a 134-character code line, # https:// plus 130 u, and # plus 117 w plus a, gives only [{ line: 3, columns: 121 }]; findWide finds a 128-character line inside <# … #>, a 131-character <!-- … --> line in a .props file and a 121-character // line in a .mjs file, and not a 120-character # line; main with check on a temporary folder holding one wide .yml comment and a wide README.md line logs only <name>.yml:1 (<n> columns) and returns 1, on a folder without one returns 0, and with no path returns 2.
    • Done when: $o = node --test --test-reporter=tap tests/node/comment-width.test.mjs 2>&1 | Out-String; if (-not $LASTEXITCODE -and $o -match '(?m)^# pass ([4-9]|\d\d+)\s*$' -and $o -match '(?m)^# fail 0\s*$') { exit 0 } else { exit 1 }

    [ ] 5. Add comment-width.mjs's wrap and its test cases

    • Issue: Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678
    • Files: tests/node/comment-width.mjs (edit), tests/node/comment-width.test.mjs (edit)
    • Change: export wrap(text, path, max = 120) by the wrapping rules under Decisions, and add main(['wrap', ...paths]): the same file collection as check; it writes each file whose wrapped text differs (writeFileSync, which keeps the file's mode), logs its shown path, and returns 0. Add these tests, each also asserting that findWide(result, path) is empty and that the result's words, without the tokens #, //, *, /*, /** and */, equal the input's:
      • a.yml: # + 115 x + end of, # the sentence., # - item, key: value → # + 115 x, # end of the sentence., # - item, key: value.
      • The same first two lines joined with \r\n → the same output joined with \r\n, final \r\n kept.
      • ProjectTemplate.props.jinja: <Project>, <!-- + 110 y + two words -->, </Project> → <Project>, <!-- + 110 y, two words -->, </Project>.
      • check.mjs: /** + 114 z + tail words. */, export function main() {} → /**, * + 114 z, * tail words., */, export function main() {}.
      • Get-Thing.ps1: <#, .DESCRIPTION, four spaces + 114 h + more text, #>, param() → the same with the third line split into four spaces + 114 h and more text.
      • ci.yml.jinja: # + 105 j + {% if x %}kept{% endif %} after → # + 105 j, # {% if x %}kept{% endif %} after.
      • Get-Thing.ps1: <#, four spaces + 110 a + b .devcontainer, #> → four spaces + 110 a, b .devcontainer (no line starts with .).
      • A text with no wide comment line is returned unchanged; main(['wrap', <temp file>]) rewrites a wide file and logs it, and leaves a clean one's text as it was.
    • Done when: $o = node --test --test-reporter=tap tests/node/comment-width.test.mjs 2>&1 | Out-String; if (-not $LASTEXITCODE -and $o -match '(?m)^# pass (1[2-9]|[2-9]\d)\s*$' -and $o -match '(?m)^# fail 0\s*$') { exit 0 } else { exit 1 }

    [ ] 6. Run the comment width check on every render

    • Issue: Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678
    • Files: tests/Test-Template.ps1 (edit), docs/tests.md (edit), docs/layout.md (edit)
    • Change:
      • Test-Template.ps1: right after the Check 'wrap check: it names a long line with spaces ...' line, add $commentOutput = node --test "$repoRoot/tests/node/comment-width.test.mjs" 2>&1 | Out-String and Check 'tests/node/comment-width.mjs: every node --test case passes' ($LASTEXITCODE -eq 0) $commentOutput.Trim(). In the render loop, right after the Check "${name}: CODE_OF_CONDUCT.md, docs/README.md, docs/assurance-case.md and .editorconfig's comments wrap at 120 columns, ..." line, add $commentWide = node "$repoRoot/tests/node/comment-width.mjs" check $dest 2>&1 | Out-String and Check "${name}: no comment line in a rendered file runs past 120 columns, apart from one that is a single unbreakable token (tests/node/comment-width.mjs wrap wraps one in the template's source)" ($LASTEXITCODE -eq 0) $commentWide.Trim(). In .SYNOPSIS, after apart from a line that is one unbreakable token, such as a long link add , and no comment line past 120 columns in any rendered file, which tests/node/comment-width.mjs finds.
      • docs/tests.md: right after the - LF line endings, no leftover Jinja, valid JSON, valid YAML item and its **For:** line, add - No comment line past 120 columns, apart from one that is a single unbreakable token, as tests/node/comment-width.mjsfinds them, after itsnode --test cases pass and - **For:** Every rendered file.
      • docs/layout.md: in the tests/node/ list, after the check-devcontainer.mjs item, add -comment-width.mjs, which finds the comment lines past 120 columns in a render and wraps them in the template's sources, with its node --testcases incomment-width.test.mjs.
    • Done when: $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-template'; $o = @(& ./tests/Test-Template.ps1 -Only dotnet-library -Work $w 2>&1 | ForEach-Object { "$_" }); $code = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; if ($code -and ($o -match '^PASS tests/node/comment-width\.mjs: every node --test case passes') -and ($o -match '^FAIL dotnet-library: no comment line in a rendered file runs past 120 columns') -and -not ($o -match '^FAIL (?!dotnet-library: no comment line in a rendered file)')) { exit 0 } else { exit 1 }

    [ ] 7. Wrap Get-PlanState.ps1's comments and regenerate its copies

    • Issue: Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678
    • Files: workflow/Get-PlanState.ps1 (edit), template/.template/Get-PlanState.ps1 (generated), .template/Get-PlanState.ps1 (generated)
    • Change: run node tests/node/comment-width.mjs wrap workflow/Get-PlanState.ps1, then ./tools/Update-Template.ps1, which writes the two copies and leaves every other generated file as it is. Change nothing else.
    • Done when: $f = 'workflow/Get-PlanState.ps1', 'template/.template/Get-PlanState.ps1', '.template/Get-PlanState.ps1'; node tests/node/comment-width.mjs check @f | Out-Null; $wide = $LASTEXITCODE; $t = { param($s) @($s -split '\s+' | Where-Object { $_ -and $_ -notin '#', '//', '*', '/*', '/**', '*/' }) -join ' ' }; $lost = @($f | Where-Object { (& $t ((git show "HEAD:$_") -join "n")) -cne (& $t (Get-Content -LiteralPath $_ -Raw)) }); $err = $null; [Management.Automation.Language.Parser]::ParseFile((Join-Path (Get-Location) $f[0]), [ref]$null, [ref]$err) | Out-Null; $same = (Get-FileHash $f[0]).Hash -eq (Get-FileHash $f[1]).Hash -and (Get-FileHash $f[0]).Hash -eq (Get-FileHash $f[2]).Hash; $changed = @(git status --porcelain | ForEach-Object { $_.Substring(3) }); $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-template'; & ./tests/Test-Template.ps1 -Only none -Work $w | Out-Null; $code = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; if (-not $wide -and -not $lost -and -not $err -and $same -and $changed.Count -eq 3 -and -not (Compare-Object $changed $f) -and -not $code) { exit 0 } else { exit 1 }`

    [ ] 8. Wrap Update-Project.ps1's comments

    • Issue: Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678
    • Files: template/.template/Update-Project.ps1 (edit)
    • Change: run node tests/node/comment-width.mjs wrap template/.template/Update-Project.ps1. Change nothing else.
    • Done when: $f = @('template/.template/Update-Project.ps1'); node tests/node/comment-width.mjs check @f | Out-Null; $wide = $LASTEXITCODE; $t = { param($s) @($s -split '\s+' | Where-Object { $_ -and $_ -notin '#', '//', '*', '/*', '/**', '*/' }) -join ' ' }; $lost = @($f | Where-Object { (& $t ((git show "HEAD:$_") -join "n")) -cne (& $t (Get-Content -LiteralPath $_ -Raw)) }); $err = $null; [Management.Automation.Language.Parser]::ParseFile((Join-Path (Get-Location) $f[0]), [ref]$null, [ref]$err) | Out-Null; $fail = 0; foreach ($s in 'Test-LibraryRelease', 'Test-NuGetLogistics', 'Test-CSharpierWrapper', 'Test-UpdateNotes') { & "./tests/$s.ps1" | Out-Null; if ($LASTEXITCODE) { $fail++ } }; if (-not $wide -and -not $lost -and -not $err -and -not $fail) { exit 0 } else { exit 1 }`

    [ ] 9. Wrap Publish-Release.ps1's and Get-TemplateUpdate.ps1's comments

    • Issue: Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678
    • Files: template/.template/Publish-Release.ps1 (edit), template/.template/Get-TemplateUpdate.ps1 (edit)
    • Change: run node tests/node/comment-width.mjs wrap template/.template/Publish-Release.ps1 template/.template/Get-TemplateUpdate.ps1. Change nothing else.
    • Done when: $f = @('template/.template/Publish-Release.ps1', 'template/.template/Get-TemplateUpdate.ps1'); node tests/node/comment-width.mjs check @f | Out-Null; $wide = $LASTEXITCODE; $t = { param($s) @($s -split '\s+' | Where-Object { $_ -and $_ -notin '#', '//', '*', '/*', '/**', '*/' }) -join ' ' }; $lost = @($f | Where-Object { (& $t ((git show "HEAD:$_") -join "n")) -cne (& $t (Get-Content -LiteralPath $_ -Raw)) }); $errs = @($f | ForEach-Object { $e = $null; [Management.Automation.Language.Parser]::ParseFile((Join-Path (Get-Location) $_), [ref]$null, [ref]$e) | Out-Null; $e }); $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-publish'; & ./tests/Test-PublishRelease.ps1 -Work $w | Out-Null; $code = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; if (-not $wide -and -not $lost -and -not $errs -and -not $code) { exit 0 } else { exit 1 }`

    [ ] 10. Wrap the other .template scripts' comments

    • Issue: Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678
    • Files: template/.template/Test-AdrIndex.ps1, template/.template/Test-Coverage.ps1, template/.template/Test-MergeGate.ps1, template/.template/Test-Readme.ps1, template/.template/Use-Node.ps1, template/.template/answer-claim.mjs, template/.template/check-markdown.mjs, template/.template/check-sign-off.mjs (all edit, by one command)
    • Change: run node tests/node/comment-width.mjs wrap template/.template, which changes exactly these eight files (the files of steps 7 to 9 are wrapped already). Change nothing else.
    • Done when: $f = @('template/.template/Test-AdrIndex.ps1', 'template/.template/Test-Coverage.ps1', 'template/.template/Test-MergeGate.ps1', 'template/.template/Test-Readme.ps1', 'template/.template/Use-Node.ps1', 'template/.template/answer-claim.mjs', 'template/.template/check-markdown.mjs', 'template/.template/check-sign-off.mjs'); node tests/node/comment-width.mjs check template/.template | Out-Null; $wide = $LASTEXITCODE; $t = { param($s) @($s -split '\s+' | Where-Object { $_ -and $_ -notin '#', '//', '*', '/*', '/**', '*/' }) -join ' ' }; $lost = @($f | Where-Object { (& $t ((git show "HEAD:$_") -join "n")) -cne (& $t (Get-Content -LiteralPath $_ -Raw)) }); $errs = @($f | Where-Object { $.EndsWith('.ps1') } | ForEach-Object { $e = $null; [Management.Automation.Language.Parser]::ParseFile((Join-Path (Get-Location) $), [ref]$null, [ref]$e) | Out-Null; $e }); $bad = @($f | Where-Object { $.EndsWith('.mjs') } | Where-Object { node --check $ 2>&1 | Out-Null; $LASTEXITCODE }); $changed = @(git status --porcelain -- template | ForEach-Object { $_.Substring(3) }); $fail = 0; foreach ($s in 'Test-ClaimReplies', 'Test-SignOff', 'Test-Coverage', 'Test-DecisionIndex', 'Test-NodeSetup') { & "./tests/$s.ps1" | Out-Null; if ($LASTEXITCODE) { $fail++ } }; if (-not $wide -and -not $lost -and -not $errs -and -not $bad -and $changed.Count -eq 8 -and -not $fail) { exit 0 } else { exit 1 }`

    [ ] 11. Wrap the remaining template files' comments, codeql.yml's by hand

    • Issue: Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678
    • Files: template/.github/workflows/codeql.yml.jinja and, by one command, template/.github/dependabot.yml.jinja, template/.github/workflows/{claim-replies.yml, container-image.yml.jinja, helm-chart.yml.jinja, raise-baseline.yml, sign-off.yml, tag-release.yml.jinja}, template/.devcontainer/Dockerfile.jinja, template/.githooks/pre-push, template/.claude/hooks/ensure-nvs.sh, template/build/dod.ps1, template/build/ProjectTemplate.props.jinja, template/Directory.Build.props, template/Directory.Packages.props.jinja (all edit)
    • Change:
      • First, in codeql.yml.jinja, replace the line # The same step is in scorecard.yml and dependency-review.yml; keep the three the same (the template's tests/Test-Template.ps1 checks it). with two lines at the same 6-space indent: # The same step is in scorecard.yml's visibility job and dependency-review.yml; keep the three the same and # (the template's tests/Test-Template.ps1 checks it).
      • Then run node tests/node/comment-width.mjs wrap template, which changes the 14 other files listed. Change nothing else.
    • Done when: $changed = @(git status --porcelain -- template | ForEach-Object { $_.Substring(3) }); node tests/node/comment-width.mjs check template workflow/Get-PlanState.ps1 | Out-Null; $wide = $LASTEXITCODE; $t = { param($s) @($s -split '\s+' | Where-Object { $_ -and $_ -notin '#', '//', '*', '/*', '/**', '*/' }) -join ' ' }; $lost = @($changed | Where-Object { (& $t ((git show "HEAD:$_") -join "n")) -cne (& $t (Get-Content -LiteralPath $_ -Raw)) }); $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-template'; $o = @(& ./tests/Test-Template.ps1 -Only dotnet-library, python-deployable, python-open-claims, node -Work $w 2>&1 | ForEach-Object { "$_" }); $code = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; if ($changed.Count -eq 15 -and -not $wide -and -not $lost -and -not $code) { exit 0 } else { exit 1 }`

    [ ] 12. Add a failing check that the dev container setup's help names only its stand-ins

    • Issue: Initialize-DevContainer.ps1's help names .template/Initialize-Nvs.ps1 in projects that don't have it #677
    • Files: tests/Test-Template.ps1 (edit)
    • Change: in the render loop, right after Check "${name}: .template/Initialize-DevContainer.ps1 parses" ..., add: $devHelp = [IO.File]::ReadAllText((Join-Path $dest '.template/Initialize-DevContainer.ps1')), $devHelp = $devHelp.Substring(0, [Math]::Max(0, $devHelp.IndexOf('#>'))), $standIns = @(foreach ($standIn in '.template/Initialize-Nvs.ps1', 'build/Install-Dotnet.ps1') { if ($devHelp.Contains($standIn) -ne (Test-Path -LiteralPath (Join-Path $dest $standIn))) { $standIn } }) and Check "${name}: .template/Initialize-DevContainer.ps1's help names .template/Initialize-Nvs.ps1 and build/Install-Dotnet.ps1 only where the render has them" (-not $standIns) ($standIns -join ', ').
    • Done when: $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-template'; $o = @(& ./tests/Test-Template.ps1 -Only dotnet, node, python -Work $w 2>&1 | ForEach-Object { "$_" }); $code = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; $n = "\.template/Initialize-DevContainer\.ps1's help names"; if ($code -and @($o -match "^FAIL (dotnet|node|python): $n").Count -eq 3 -and -not ($o -match "^FAIL (?!(dotnet|node|python): $n)")) { exit 0 } else { exit 1 }

    [ ] 13. Name each stand-in in the dev container setup's help only for its stack

    • Issue: Initialize-DevContainer.ps1's help names .template/Initialize-Nvs.ps1 in projects that don't have it #677
    • Files: template/.template/Initialize-DevContainer.ps1.jinja (edit), docs/tests.md (edit)
    • Change:
      • In .DESCRIPTION, replace the four lines from The workflow's actions have stand-ins: the .NET SDK and runtimes come from build/Install-Dotnet.ps1, into ~/.dotnet, through Python comes with the container's image. A step the project adds to copilot-setup-steps.yml doesn't reach this with these lines, exactly as written in the block below (the Jinja tags at column 0, as the body's are, the help lines indented 4 spaces):
    {%- if stack == 'dotnet' %}
        The workflow's .NET setup has a stand-in here: the SDK and runtimes come from build/Install-Dotnet.ps1, into
        ~/.dotnet, which devcontainer.json puts on PATH.
    {%- elif stack == 'python' %}
        The workflow's Python setup has a stand-in here: Python comes with the container's image.
    {%- endif %}
    {%- if stack == 'node' or uses_node %}
        The workflow's Node.js setup has a stand-in here: .template/Initialize-Nvs.ps1 installs the .node-version release
        with nvs and sets up the bash and PowerShell profiles to use it.
    {%- endif %}
    {%- if stack == 'node' %}{% if package_manager == 'bun' %}
        The workflow's Bun setup has one too: Bun comes from npm.
    {%- endif %}{% endif %}
        A step the project adds to copilot-setup-steps.yml doesn't reach this
    
    • The next line, script: add it to devcontainer.json's postCreateCommand, which is the project's., stays.
    • docs/tests.md: replace -devcontainer.jsonpins each Feature to a version and runs.template/Initialize-DevContainer.ps1, which parses with -devcontainer.jsonpins each Feature to a version and runs.template/Initialize-DevContainer.ps1, which parses and whose help names .template/Initialize-Nvs.ps1andbuild/Install-Dotnet.ps1 only where the render has them.
    • Done when: $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-template'; $o = @(& ./tests/Test-Template.ps1 -Only dotnet, node, node-bun, python, dotnet-node, powershell -Work $w 2>&1 | ForEach-Object { "$_" }); $code = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; if (-not $code -and @($o -match "^PASS .*\.template/Initialize-DevContainer\.ps1's help names").Count -eq 6 -and (Select-String -LiteralPath docs/tests.md -SimpleMatch -Pattern 'whose help names .template/Initialize-Nvs.ps1' -Quiet)) { exit 0 } else { exit 1 }

    [ ] 14. Add failing tests for the Project block's changelog line

    • Issue: A library's Project block says the first plan creates CHANGELOG.md, also where it already exists #675
    • Files: tests/Test-Readme.ps1 (edit)
    • Change:
      • Right after $answers = [IO.File]::ReadAllText((Join-Path $full '.copier-answers.yml')), add $agentsText = [IO.File]::ReadAllText((Join-Path $full 'AGENTS.md')). Give New-Fixture a fourth parameter [string]$Agents = $agentsText and write it to the fixture's AGENTS.md when it isn't empty, so every fixture has the render's - pre-release: untracked Landing line.
      • In the render section, after the no-icon checks, add $trackedLibrary = New-Library 'tracked' @('--data', 'pre_release=tracked', '--data', 'repository=NCodeGroup/Demo', '--data', 'license=MIT'), $r = Invoke-Readme $trackedLibrary and Check 'render: a library rendered with pre_release tracked passes the check, and its changelog line names no pre-release catalog' ($r.ExitCode -eq 0 -and (Read-Text $trackedLibrary).Contains('- CHANGELOG.md: in the Keep a Changelog format, what changed in each release. The first plan creates it.')) $r.Output.
      • Before the badges section, add a changelog section (comment: the ## Project block's changelog line links CHANGELOG.md once it exists and speaks of a pre-release catalog only while the project is pre-release, A library's Project block says the first plan creates CHANGELOG.md, also where it already exists #675) with an ordered table of five cases, each Pre (untracked or tracked), File (whether CHANGELOG.md exists), Tag and Line: pre-release without a changelog (untracked, no file, no tag, - `CHANGELOG.md`: in the Keep a Changelog format, what the product does until its first stable release, and what changed in each release from then on. The first plan creates it.); pre-release with a changelog (untracked, file, - [CHANGELOG.md](CHANGELOG.md): in the Keep a Changelog format, what the product does until its first stable release, and what changed in each release from then on.); tracked without a changelog (tracked, no file, - `CHANGELOG.md`: in the Keep a Changelog format, what changed in each release. The first plan creates it.); tracked with a changelog (tracked, file, - [CHANGELOG.md](CHANGELOG.md): in the Keep a Changelog format, what changed in each release.); untracked with a 1.0.0 tag and a changelog (untracked, file, tag v1.0.0, the tracked-with-a-changelog line).
      • For each case: New-Fixture "changelog-<case with non-alphanumerics as ->" $good $answers ($agentsText.Replace('- pre-release: untracked', "- pre-release: <Pre>")); when File, write CHANGELOG.md as "# Changelogn"; when Tag, git -C init -q, an empty commit (-c user.name=Test -c user.email=[email protected] -c commit.gpgsign=false commit -q --allow-empty -m Start) and git -C tag ; run Invoke-Readme @('-Render'), then Invoke-Readme ; Check "changelog: $case renders its line, and the check then passes"when the first exits 0, the README contains"n$Linen"and exactly one line matching(?m)^- (CHANGELOG\.md|[CHANGELOG.md])`, and the second exits 0.
      • In .DESCRIPTION, add a changelog entry in the style of the others saying this, and to render that a library rendered with pre_release tracked passes the check without the pre-release wording.
    • Done when: $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-readme'; $o = @(& ./tests/Test-Readme.ps1 -Work $w 2>&1 | ForEach-Object { "$_" }); $code = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; $want = '^FAIL (render: a library rendered with pre_release tracked|changelog: (pre-release with a changelog|tracked without a changelog|tracked with a changelog|untracked with a 1\.0\.0 tag))'; if ($code -and @($o -match $want).Count -eq 5 -and ($o -match '^PASS changelog: pre-release without a changelog') -and -not ($o -match '^FAIL (?!(render: a library rendered with pre_release tracked|changelog: ))')) { exit 0 } else { exit 1 }

    [ ] 15. Render the changelog line from the project's state

    • Issue: A library's Project block says the first plan creates CHANGELOG.md, also where it already exists #675
    • Files: template/.template/Test-Readme.ps1 (edit), template/README.md.jinja (edit), docs/tests.md (edit)
    • Change:
      • Test-Readme.ps1: add function Test-PreRelease above Get-ReadmeProject, with a comment that it reads pre-release as .template/Get-PlanState.ps1 does (ADR-0015) and counts tags Git can't list, as outside a Git work tree, as none. Its body follows Test-PreReleaseProject in template/.template/Update-Project.ps1, reading Join-Path $Root 'AGENTS.md', and lists tags with @(if (Get-Command git -ErrorAction SilentlyContinue) { git -C $Root tag --list --merged HEAD 2>$null }), then $global:LASTEXITCODE = 0, returning whether none matches '^v?([0-9]+)\.[0-9]+\.[0-9]+\z' with $Matches[1] -notmatch '^0+$'.
      • In Get-ReadmeProject, replace the fixed changelog line with: $changelogFound = Test-Path -LiteralPath (Join-Path $Root 'CHANGELOG.md') -PathType Leaf; $changelogName = if ($changelogFound) { '[CHANGELOG.md](CHANGELOG.md)' } else { 'CHANGELOG.md' }; $changelogWhat = if (Test-PreRelease) { 'what the product does until its first stable release, and what changed in each release from then on' } else { 'what changed in each release' }; "- ${changelogName}: in the Keep a Changelog format, $changelogWhat.$(if (-not $changelogFound) { ' The first plan creates it.' })". In .DESCRIPTION, after a link to each file the template writes, add CHANGELOG.md linked once it exists and described as a catalog of what the product does only while the project is pre-release,, keeping the help wrapped at 120 columns.
      • README.md.jinja line 132: replace {% if library %}- CHANGELOG.md: in the Keep a Changelog format, what the product does until its first stable release, and what changed in each release from then on. The first plan creates it.{% else %} with {% if library and pre_release == 'untracked' %}- CHANGELOG.md: in the Keep a Changelog format, what the product does until its first stable release, and what changed in each release from then on. The first plan creates it.{% elif library %}- CHANGELOG.md: in the Keep a Changelog format, what changed in each release. The first plan creates it.{% else %}; the rest of the line stays.
      • docs/tests.md, under - tests/Test-Readme.ps1: ..., after --Render adds no block, add - The## Projectblock linksCHANGELOG.mdonce it exists, and speaks of what the product does until its first stable release only whileAGENTS.mdsayspre-release: untrackedand no stable version is tagged; a library rendered withpre_release tracked gets the same line from the Jinja.
    • Done when: $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-readme'; & ./tests/Test-Readme.ps1 -Work $w | Out-Null; $code = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; node tests/node/comment-width.mjs check template/.template/Test-Readme.ps1 | Out-Null; if (-not $code -and -not $LASTEXITCODE -and (Select-String -LiteralPath docs/tests.md -SimpleMatch -Pattern 'links CHANGELOG.md once it exists' -Quiet)) { exit 0 } else { exit 1 }

    [ ] 16. Add a failing check that no template-owned page links a project-owned heading

    • Issue: best-practices-criteria.md links SECURITY.md#verify-a-release, which a project-owned SECURITY.md may lack, and Markdown checks fails #674
    • Files: tests/Test-Template.ps1 (edit)
    • Change:
      • Before the render loop (foreach ($case in $cases) {), read copier.yml's _skip_if_exists list: $copierLines = @(Get-Content -LiteralPath (Join-Path $repoRoot 'copier.yml')), $skipAt = [Array]::IndexOf($copierLines, '_skip_if_exists:'), and $skipIfExists = @(for ($i = $skipAt + 1; $i -lt $copierLines.Count -and $copierLines[$i] -match '^ - /(.+)$'; $i++) { $Matches[1] }).
      • In the render loop, right after Check "${name}: every relative link and heading anchor in the render's Markdown resolves, as CI's Markdown checks job checks" ..., add a comment (a template-owned page links a file _skip_if_exists makes the project's by the file alone, since the project may write it without the heading, best-practices-criteria.md links SECURITY.md#verify-a-release, which a project-owned SECURITY.md may lack, and Markdown checks fails #674), then $headingLinks = @(foreach ($page in @($markdownFiles | ForEach-Object { $_.Replace('\', '/') } | Where-Object { $_ -notin $skipIfExists })) { $pageText = [IO.File]::ReadAllText((Join-Path $dest $page)); foreach ($m in [regex]::Matches($pageText, '\]\(([^)\s#]+\.md)#[^)\s]*\)')) { $target = [IO.Path]::GetRelativePath($dest, [IO.Path]::GetFullPath([IO.Path]::Combine($dest, (Split-Path -Parent $page), $m.Groups[1].Value))).Replace('\', '/'); if ($target -in $skipIfExists) { "${page}: $($m.Value)" } } }) (written over several lines) and Check "${name}: no template-owned Markdown page links a heading of a file copier.yml's _skip_if_exists makes the project's" ($skipIfExists.Count -gt 10 -and -not $headingLinks) ($headingLinks -join ', ').
    • Done when: $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-template'; $o = @(& ./tests/Test-Template.ps1 -Only python, dotnet-library -Work $w 2>&1 | ForEach-Object { "$_" }); $code = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; $n = 'no template-owned Markdown page links a heading'; if ($code -and @($o -match "^FAIL (python|dotnet-library): $n.*best-practices-criteria\.md").Count -eq 2 -and -not ($o -match "^FAIL (?!(python|dotnet-library): $n)")) { exit 0 } else { exit 1 }

    [ ] 17. Link the project's own files without heading anchors in best-practices-criteria.md

    • Issue: best-practices-criteria.md links SECURITY.md#verify-a-release, which a project-owned SECURITY.md may lack, and Markdown checks fails #674
    • Files: template/docs/best-practices-criteria.md.jinja (edit), docs/tests.md (edit)
    • Change:
      • best-practices-criteria.md.jinja: replace each ](../SECURITY.md#verify-a-release), Verify a Release, says with ](../SECURITY.md) says (2), each ](../SECURITY.md#verify-a-package) with ](../SECURITY.md) (2), each ](../GOVERNANCE.md#continuity) with ](../GOVERNANCE.md) (2) and each ](assurance-case.md#security-reviews) with ](assurance-case.md) (2). Change nothing else.
      • docs/tests.md: right after the - Every ADR-0NNN a rendered Markdown file cites ... item and its **For:** line, add - No template-owned Markdown page links a heading of a file copier.yml's _skip_if_exists makes the project's, which the project may write without that heading and - **For:** Every render.
    • Done when: $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-template'; $o = @(& ./tests/Test-Template.ps1 -Only python, python-license, dotnet-library, dotnet-library-own-publisher -Work $w 2>&1 | ForEach-Object { "$_" }); $code = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; & ./tests/Test-BestPracticesCriteria.ps1 | Out-Null; $b = $LASTEXITCODE; if (-not $code -and -not $b -and -not (Select-String -LiteralPath template/docs/best-practices-criteria.md.jinja -Pattern '\.md#(verify-a-|continuity|security-reviews)' -Quiet) -and (Select-String -LiteralPath docs/tests.md -SimpleMatch -Pattern 'links a heading of a file copier.yml' -Quiet)) { exit 0 } else { exit 1 }

    [ ] 18. Add a failing test that a build's output is no package

    • Issue: Test-Readme.ps1 counts a gitignored build output under artifacts/ as a package #673
    • Files: tests/Test-Readme.ps1 (edit)
    • Change: after the package: markers inside a fenced sample don't count ... check, add a comment (a project file under artifacts/ or a folder Git ignores is a build's output, never a package, Test-Readme.ps1 counts a gitignored build output under artifacts/ as a package #673), then: $built = New-Fixture 'package-build-output' $good; Write-Fixture (Join-Path $built 'artifacts/xml-examples/Examples.csproj') "<Project Sdk="Microsoft.NET.Sdk" />n"; Write-Fixture (Join-Path $built 'generated/Gen/Gen.csproj') "<Project Sdk="Microsoft.NET.Sdk" />n"; Write-Fixture (Join-Path $built '.gitignore') "generated/n"; git -C $built init -q(throw when it fails);$r = Invoke-Readme $built; Check 'package: a project file under artifacts/ or a folder Git ignores is no package, so the check passes' ($r.ExitCode -eq 0 -and -not $r.Output.Contains('artifacts/') -and -not $r.Output.Contains('generated/')) $r.Output. In .DESCRIPTION's packageentry, add that a project underartifacts/` or a folder Git ignores isn't a package.
    • Done when: $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-readme'; $o = @(& ./tests/Test-Readme.ps1 -Work $w 2>&1 | ForEach-Object { "$_" }); $code = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; if ($code -and ($o -match '^FAIL package: a project file under artifacts/ or a folder Git ignores is no package') -and -not ($o -match '^FAIL (?!package: a project file under artifacts/)')) { exit 0 } else { exit 1 }

    [ ] 19. Leave a build's output out of the packages Test-Readme.ps1 checks

    • Issue: Test-Readme.ps1 counts a gitignored build output under artifacts/ as a package #673
    • Files: template/.template/Test-Readme.ps1 (edit), docs/tests.md (edit)
    • Change:
      • In Get-PackageProject, change $item.Name -notin 'bin', 'obj', 'node_modules' to $item.Name -notin 'bin', 'obj', 'node_modules', 'artifacts'. Replace its last line, $packages | Sort-Object Project, with: a comment (a project file Git ignores is a build's output; outside a Git work tree, or without git, none is left out), $ignored = @(), if ($packages.Count -and (Get-Command git -ErrorAction SilentlyContinue)) { $ignored = @($packages.Project | git -C $Root check-ignore --stdin 2>$null); if ($LASTEXITCODE -notin 0, 1) { $ignored = @() }; $global:LASTEXITCODE = 0 } (over several lines) and $packages | Where-Object { $_.Project -notin $ignored } | Sort-Object Project. Update the function's comment and the .DESCRIPTION sentence A package is a .csproj outside a folder whose name starts with a dot and outside bin, obj and node_modules, to say outside bin, obj, node_modules and artifacts, that Git doesn't ignore,, keeping the help wrapped at 120 columns.
      • docs/tests.md, under - tests/Test-Readme.ps1: ..., after - A package readme's and the## Project block's gaps also exit 1, add - A project file underartifacts/ or a folder Git ignores is no package.
    • Done when: $w = Join-Path ([IO.Path]::GetTempPath()) 'plan-679-readme'; & ./tests/Test-Readme.ps1 -Work $w | Out-Null; $code = $LASTEXITCODE; Remove-Item -LiteralPath $w -Recurse -Force -ErrorAction SilentlyContinue; node tests/node/comment-width.mjs check template/.template/Test-Readme.ps1 | Out-Null; if (-not $code -and -not $LASTEXITCODE -and (Select-String -LiteralPath docs/tests.md -SimpleMatch -Pattern 'under artifacts/ or a folder Git ignores is no package' -Quiet)) { exit 0 } else { exit 1 }

    [ ] 20. Write the v0.153.3 changelog section

    • Issue: raise-baseline.yml's push is refused when the default branch changes a workflow file while it waits for nuget.org #679 Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678 Initialize-DevContainer.ps1's help names .template/Initialize-Nvs.ps1 in projects that don't have it #677 A library's Project block says the first plan creates CHANGELOG.md, also where it already exists #675 best-practices-criteria.md links SECURITY.md#verify-a-release, which a project-owned SECURITY.md may lack, and Markdown checks fails #674 Test-Readme.ps1 counts a gitignored build output under artifacts/ as a package #673
    • Files: CHANGELOG.md (edit)
    • Change: ## [Unreleased] is empty. Insert right below it a blank line and ## [0.153.3] - <date>, <date> from Get-Date -Format yyyy-MM-dd, then a blank line, ### Fixed, a blank line and these six entries, one bullet each, in this order:
      • - `.github/workflows/raise-baseline.yml` makes the baseline raise again on the default branch as it is once nuget.org lists the version, so a pull request merged during the wait, such as Dependabot's change to a workflow file, no longer gets the push of `baseline-<version>` refused; when one merges in the moment before the push, the failure says that re-running the failed job finishes the work ([#679](https://github.com/NCodeGroup/project-template/issues/679)).
      • - The template's files wrap their comment lines at 120 columns, `codeql.yml`'s visibility-step comment among them, so a review no longer flags lines a project can't change, and the template's tests fail on a rendered comment line past 120 columns ([#678](https://github.com/NCodeGroup/project-template/issues/678)).
      • - `.template/Initialize-DevContainer.ps1`'s help names only the stand-ins its stack's setup runs: `.template/Initialize-Nvs.ps1` only where the project uses Node.js, and `build/Install-Dotnet.ps1` only in a .NET project ([#677](https://github.com/NCodeGroup/project-template/issues/677)).
      • - A .NET library's `## Project` block, which `.template/Test-Readme.ps1` and each update render, links `CHANGELOG.md` once it exists, without "The first plan creates it.", and describes the changelog as what the product does until its first stable release only while the project is pre-release ([#675](https://github.com/NCodeGroup/project-template/issues/675), [ADR-0061](template/docs/decisions/project-template/0061-a-librarys-package-readmes-and-project-list-are-template-owned-blocks.md)).
      • - `docs/best-practices-criteria.md` links `SECURITY.md`, `GOVERNANCE.md` and `docs/assurance-case.md`, which are the project's, without a heading anchor, so CI's `Markdown checks` job no longer fails where the project's `SECURITY.md` has no Verify a Release section ([#674](https://github.com/NCodeGroup/project-template/issues/674)).
      • - `.template/Test-Readme.ps1` no longer counts a project file under `artifacts/` or a folder Git ignores as a package, so a build's output, such as a generated XML documentation examples project, no longer fails the README check ([#673](https://github.com/NCodeGroup/project-template/issues/673)).
      • Then a blank line before the existing ## [0.153.2] - 2026-11-30. In the link reference definitions, replace [unreleased]: https://github.com/NCodeGroup/project-template/compare/v0.153.2...HEAD with [unreleased]: https://github.com/NCodeGroup/project-template/compare/v0.153.3...HEAD followed by [0.153.3]: https://github.com/NCodeGroup/project-template/compare/v0.153.2...v0.153.3.
    • Done when: $s = pwsh -NoProfile -File .template/Get-PlanState.ps1 -NoFetch; & ./tests/Test-ChangelogHeadings.ps1 | Out-Null; if (-not $LASTEXITCODE -and ($s -contains 'changelog-version: v0.153.3') -and ($s -contains 'changelog-duplicates: -') -and (Select-String -LiteralPath CHANGELOG.md -SimpleMatch -Pattern '[0.153.3]: https://github.com/NCodeGroup/project-template/compare/v0.153.2...v0.153.3' -Quiet) -and @(Select-String -LiteralPath CHANGELOG.md -Pattern '\(\[#67[3-9]\]\(https://github\.com/NCodeGroup/project-template/issues/67[3-9]\)').Count -eq 6) { exit 0 } else { exit 1 }

    Review checklist

    • raise-baseline.yml's new lines run only in the issue step, after the version is known and the raise step set the baseline, and use the token only in the fetch, the branch check and the push; the checkout still keeps no credential.
    • A rerun after a push ($exists) still pushes nothing and reaches the issue, now from the newest default branch.
    • The wrap steps changed no code line and no word: spot-check git diff --word-diff of Update-Project.ps1, Get-PlanState.ps1 and ProjectTemplate.props.jinja; Get-Help still shows each script's full help.
    • tests/node/comment-width.mjs never wraps a code line, a Markdown file or a single unbreakable token, and its wrap keeps a file's line endings and mode (template/.githooks/pre-push stays executable: git ls-files -s template/.githooks/pre-push shows 100755).
    • A library update with -Render changes only the changelog line of an existing ## Project block, and a new library's README still matches Test-Readme.ps1's rendering.
    • Test-Readme.ps1 still finds every package of a library whose repository has no .gitignore entry for its projects, and runs where git is missing.
    • The suites too slow for a Done-when pass after step 19: ./tests/Test-UpdateReadme.ps1 (about 2 minutes), ./tests/Test-UpdateLibrary.ps1 and ./tests/Test-Adoption.ps1 -SkipDotnetBuild, which run Test-Readme.ps1 inside updated and adopted libraries (this session has no .NET SDK, so pass -SkipDotnetBuild wherever a suite takes it); and the full suite, ./tests/Invoke-AllTests.ps1 -SkipDotnetBuild, passes in CI (about 16 minutes).

    Generated by Claude Code

  2. polewskm commented on Nov 30, 2026

    @polewskm
    CollaboratorAuthor

    Plan update for #679 #678 #677 #675 #674 #673:

    • The release moves to v0.153.4: v0.153.3 landed (Accept repository names that start with a dot #683) while the plan was written, before any step ran, so the plan's branch now starts from that main.
    • Steps 2 and 9 now run tests/Test-PublishRelease.ps1 without -Work, which it doesn't take; with it, the check passed without running the tests.
    • Step 3 puts the re-run note for docs/adopt.md in a sub-bullet under its "Goes wrong" line, which would otherwise pass the 400-character limit.

    Generated by Claude Code

  3. polewskm commented on Nov 30, 2026

    @polewskm
    CollaboratorAuthor

    Plan update for #679 #678 #677 #675 #674 #673:

    • Step 11 (Wrap codeql.yml's 144-column 'same step' comment at 120 columns #678) wraps codeql.yml's "same step" comment by hand, and that edit adds the words "visibility job" on purpose. So its check no longer compares that file's words with the old text: it checks the two new lines exactly instead. The other files the step wraps still keep every word.

    Generated by Claude Code

  4. polewskm commented on Nov 30, 2026

    @polewskm
    CollaboratorAuthor

    Plan update for #679 #678 #677 #675 #674 #673, while fixing NCode Review's first round on #685:

    • Step 30 fills the dev container help's last sentence at 120 columns, since the sentence runs 154 columns on one line. The refilled Test-Readme help keeps each <!-- ... --> marker on one line.
    • Step 31's fixture check expects what the heading-link scan actually returns, docs/page.md: ](../SECURITY.md#verify-a-release). The scan's regex matches from ](, and it stays unchanged.

    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions