Codify central MSBuild config for C# and the workspace-file editing rule - #404
Conversation
Two gaps surfaced by the PhotoCleaner adoption (maintainer feedback): - CODESTYLE.md gains "Central Build and Package Configuration": Directory.Build.props carries the shared build/analyzer properties (the Zero Warnings set, LangVersion, uniform TargetFramework) and Directory.Packages.props enables central package management with versionless per-project PackageReference items. This is already the de-facto standard (PlexCleaner, Utilities, MediaTools, LanguageTags carry both) but was never written down, which is how PhotoCleaner, AudioCleaner, and NxWitness stayed on per-project config. spec/project-types.json gains the matching csharp.centralconfig.props letter check so the audit validates it. - AGENTS.md "Verification Discipline" gains the workspace-file rule: never edit an active .code-workspace file - a rewritten workspace file can make VS Code reload the window and destroy the running agent session's context, and the trigger is not fully characterized (an agent's edit has caused it where a human's identical edit did not). Surface the change for the maintainer instead. The section is verbatim-carried, so the rule propagates mechanically. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Codifies two governance gaps in the template repo: (1) a documented standard for central MSBuild + NuGet package version management in C# repos, and (2) an explicit verification-discipline rule to avoid editing active VS Code workspace files due to session-loss risk.
Changes:
- Adds a new C# policy block describing
Directory.Build.propsandDirectory.Packages.propsas the shared configuration sources. - Adds a new
csharp.centralconfig.propscheck tospec/project-types.jsonto reflect the centralized-config expectation. - Adds a verification-discipline bullet warning agents not to edit active
.code-workspacefiles.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| spec/project-types.json | Adds a new C# check ID documenting centralized MSBuild/package config expectations. |
| CODESTYLE.md | Documents the central Directory.Build.props / Directory.Packages.props policy for .NET repos. |
| AGENTS.md | Adds a verification-discipline rule about avoiding edits to active .code-workspace files. |
Uh oh!
There was an error while loading. Please reload this page.
…workspace rule absolute Maintainer feedback from driving the PhotoCleaner adoption, mechanized: - cspell single source of truth: when cspell.json is carried, a *.code-workspace that still carries a cSpell word list (words/userWords/ignoreWords, matched as quoted keys so a plain cspell.json mention is not a hit) is a LETTER - the exact silent-drift CODESTYLE.md "Markdown and Spelling" already forbids, now checked. An unreadable workspace is a DRIFT to verify by hand. - HISTORY.md mirrors the README opening: spec/readme-structure.md gains the rule (the changelog opens as the README's twin - same H1 title and intro paragraph), and the audit compares them with HTML comments stripped so the README's ToC-omit marker is not a false difference. Title mismatch and intro drift are LETTERs. Verified against the fleet convention (hub and PlexCleaner both conform byte-for-byte). - The AGENTS.md workspace-file rule is now a consistent absolute: never edit an active .code-workspace, surface the change for the maintainer - the last-staged-action escape hatch contradicted the "never" and is gone. Selftest covers both new helpers. Live: the hub self-audit stays clean, and PhotoCleaner surfaces both real findings (a stale workspace word list, a non-mirroring HISTORY intro). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
title_and_intro no longer drops blank lines inside the intro region - the surrounding blanks are trimmed but the interior structure is kept, so a paragraph-boundary difference is a real difference, matching the spec's "copied verbatim". Selftest gains the paragraph-boundary case. Live re-verified: hub self-audit clean, PhotoCleaner still flags its non-mirroring intro. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
AGENTS.md "Repository Details" already fixes the convention - the About description is the README's first line after the H1 as plain text, links stripped, README as source of truth - but nothing checked it. The audit now compares the live description against the link-stripped README intro line (LETTER on mismatch, with both strings quoted and the sharpen-the-README escape from the convention), and separately flags an intro line that carries markdown links - spec/readme-structure.md now requires it link-free, since the unrendered description would carry raw brackets. Selftest covers the link stripping. Live: the hub and PhotoCleaner both conform (their About matches their intro line), so no new fleet findings from this check yet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The contents API returns a list for a directory, so a *.code-workspace path that resolves to one would make ws.get raise and abort the audit. Guard on isinstance dict, degrading to the existing unreadable-workspace DRIFT. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
spec/audit.py:196
- strip_md_links() only strips
[text](url)and[text][ref]forms. Markdown also supports reference-style collapsed/shortcut links ([text][],[text]), which would currently pass the "link-free plain text" check even though they still render as raw brackets in the GitHub About description and can also cause a false README/description mismatch.
Consider stripping these additional link forms (and ![] image variants) so the audit reliably enforces the README intro-line contract.
_HTML_COMMENT = re.compile(r"<!--.*?-->", re.S)
_MD_LINK_INLINE = re.compile(r"\[([^\]]*)\]\([^)]*\)")
_MD_LINK_REF = re.compile(r"\[([^\]]*)\]\[[^\]]*\]")
def strip_md_links(text):
"""Markdown links reduced to their text - `[text](url)` and `[text][ref]` become `text`.
The plain-text form AGENTS.md "Repository Details" says the About description carries.
"""
return _MD_LINK_REF.sub(r"\1", _MD_LINK_INLINE.sub(r"\1", text))
…eses The inline-link pattern now accepts one level of balanced parentheses in the URL (the Wikipedia-style case), so strip_md_links reduces such a link to its text instead of leaving residue. Selftest case updated to a parenthesized URL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
…t a skip spec/readme-structure.md requires the title-then-one-line-description opening, so a README with no intro paragraph now raises a LETTER instead of silently skipping the link-free and About-description checks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
…onical fixes (#407) Merge-commit promotion of #404-#406: central MSBuild config + workspace rule + three repo-hygiene audit checks, the configure.sh stdout-suppression rationale, and the PhotoCleaner round-1 feedback batch. Human merge, no release fires. Makes main's canonicals current for the PhotoCleaner round-2 convergence.
Two gaps surfaced by the PhotoCleaner adoption (maintainer feedback while driving PhotoCleaner#14):
Central build and package configuration (C#)
Directory.Build.propscarries the shared build/analyzer properties (the Zero Warnings set,LangVersion, uniformTargetFramework);Directory.Packages.propsenables central package management (ManagePackageVersionsCentrally) with versionless per-projectPackageReferenceitems.csharp.centralconfig.propsletter check so the audit validates it.Workspace-file editing rule
.code-workspace: a rewritten workspace file can make VS Code reload the window and destroy the running agent session's context, and the trigger isn't fully characterized (an agent's edit has caused it where a human's identical edit did not). Surface the change for the maintainer instead.Verification
validate.pygreen (new check parses), markdownlint clean on both docs, CRLF preserved, no em-dash.Note: this makes the just-carried PhotoCleaner copies one step stale (CODESTYLE + the verbatim Verification Discipline section) — intentional; the planned PhotoCleaner round-2 refresh picks both up, and the burn-down machinery tracks it either way.
🤖 Generated with Claude Code