Skip to content

Codify central MSBuild config for C# and the workspace-file editing rule - #404

Merged
ptr727 merged 7 commits into
developfrom
central-config-and-workspace-rule
Jul 23, 2026
Merged

Codify central MSBuild config for C# and the workspace-file editing rule#404
ptr727 merged 7 commits into
developfrom
central-config-and-workspace-rule

Conversation

@ptr727

Copy link
Copy Markdown
Owner

Two gaps surfaced by the PhotoCleaner adoption (maintainer feedback while driving PhotoCleaner#14):

Central build and package configuration (C#)

  • CODESTYLE.md — new "Central Build and Package Configuration" block under Build Requirements: Directory.Build.props carries the shared build/analyzer properties (the Zero Warnings set, LangVersion, uniform TargetFramework); Directory.Packages.props enables central package management (ManagePackageVersionsCentrally) with versionless per-project PackageReference items.
  • spec/project-types.json — matching csharp.centralconfig.props letter check so the audit validates it.
  • Fleet reality check: PlexCleaner, Utilities, MediaTools, LanguageTags already carry both files; PhotoCleaner, AudioCleaner, NxWitness are on per-project config — the standard existed in practice but was never codified, which is exactly how the stragglers stayed behind.

Workspace-file editing rule

  • AGENTS.md "Verification Discipline" (verbatim-carried, so it propagates mechanically) — never edit an active .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.py green (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

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>
CopilotAI review requested due to automatic review settings July 23, 2026 15:11

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.props and Directory.Packages.props as the shared configuration sources.
  • Adds a new csharp.centralconfig.props check to spec/project-types.json to reflect the centralized-config expectation.
  • Adds a verification-discipline bullet warning agents not to edit active .code-workspace files.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

FileDescription
spec/project-types.jsonAdds a new C# check ID documenting centralized MSBuild/package config expectations.
CODESTYLE.mdDocuments the central Directory.Build.props / Directory.Packages.props policy for .NET repos.
AGENTS.mdAdds a verification-discipline rule about avoiding edits to active .code-workspace files.

Comment threadAGENTS.md Outdated
…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>
CopilotAI review requested due to automatic review settings July 23, 2026 15:18

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment threadspec/audit.py Outdated
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>
CopilotAI review requested due to automatic review settings July 23, 2026 15:23

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment threadspec/audit.py Outdated
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>
CopilotAI review requested due to automatic review settings July 23, 2026 15:27
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>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment threadspec/audit.py
CopilotAI review requested due to automatic review settings July 23, 2026 15:31

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>
CopilotAI review requested due to automatic review settings July 23, 2026 15:36

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment threadspec/audit.py
…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>
CopilotAI review requested due to automatic review settings July 23, 2026 15:39

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@ptr727
ptr727 merged commit 7679d26 into developJul 23, 2026
7 checks passed
@ptr727
ptr727 deleted the central-config-and-workspace-rule branch July 23, 2026 16:06
ptr727 added a commit that referenced this pull request Jul 23, 2026
…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.
Sign up for freeto 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.

2 participants

@ptr727