Skip to content

CODESTYLE.md Mandates Python for Every Program While the Hub Itself Ships Nine PowerShell Ones #1153

Open

Description

@ptr727

Three defects in CODESTYLE.md's language coverage, grouped because settling the first decides the other two. Surfaced by the canonical-content review pass on the PR for #1075/#1120, which reads each unit whole as a carrier does. Deferred out of that PR because the first is a scope decision rather than a text fix.

CODESTYLE.md is carried at intent, whole file.

1. "Everything else is Python" is falsified by the authoring repo

CODESTYLE.md "Shell" states:

Bash, and only where a program cannot be Python: a bootstrap that installs the interpreter cannot be written in it, and a host tool that must run before a development toolchain exists cannot depend on one. Everything else is Python, with a test under the scripts tree's tests/ directory.

The hub tracks nine PowerShell programs, none of them Bash and none of them Python:

$ git ls-files '*.ps1' | head
host-setup/bootstrap.ps1
host-setup/menu.ps1
host-setup/windows/install-tools.ps1
scripts/skills_install.ps1

The fleet lint gate explicitly provides for them: GOVERNANCE.md "Running the Linters Locally" says "for a repo that carries .ps1 files, PSScriptAnalyzer", and PSScriptAnalyzerSettings.psd1 sits at the repo root. CODESTYLE.md has no PowerShell section, so an agent asked to change a Windows host-setup script reads this sentence as forbidding the language the file is already written in, and the doc offers no section to route to instead.

The decision this needs: does CODESTYLE.md grow a PowerShell section (paired with a powershell-codestyle Skill, per the pattern the other three language sections follow), or does the Shell section's sentence narrow to say what it actually means about Bash-versus-Python without claiming to cover every language?

2. "Shell" carries no scope note where ".NET" and "Python" both do

.NET and Python each open with an italic scope note:

This section applies only to the .NET side. A repo with no .NET projects still carries it (the file is carried whole) and ignores it.

Shell has none. A reader who has only that section, in a repo that ships no shell scripts, reads an unscoped fleet mandate about which language every program must be written in, with nothing saying the section is ignorable. Whether it gets the note depends on what item 1 decides the section claims.

3. cspell and CSpell in the same file, against the file's own rule

CODESTYLE.md "General" opens with "Use each tool's official casing in task labels, docs, and prose", then writes the tool two ways:

Location Form
General, the doc-lint set cspell
Markdown and Spelling CSpell

A reader applying the unit's own rule to a new task label has the file itself as evidence for both. Measured across the tree, 75 occurrences are lowercase and 9 capitalized, so most of the lowercase ones are the cspell.json filename and CLI invocations, which are correctly lowercase, and settling the prose form is a sweep rather than a one-line edit. The doc-lint list also reads consistently at present, since markdownlint and editorconfig-checker beside it are lowercase too.

Provenance

Canonical-content review pass against CODESTYLE.md "General" and "Shell", run on the branch for #1075/#1120/#1114/#1119/#1129/#1078. Items 1 and 3 verified against the tree directly.

Activity

  1. ptr727 commented on Sep 1, 2026

    @ptr727
    OwnerAuthor

    Three more in the same file from the second canonical-review round, all in CODESTYLE.md "General" and all needing the same kind of decision as the items above.

    4. "The concrete names live in each language section below" is false

    General states:

    It is exposed as one or more named VS Code tasks (or, where a language ships no tasks, documented commands), and those definitions are the same across the fleet. The concrete names live in each language section below.

    No language section names a task. .NET says only "its three-task clean-compile chain", and Python and Shell name none at all; all three defer to a Skill under .agents/skills/, which the same file states is hub-local and not carried.

    Two bullets later the reader is told "The named task definition is the canonical spec - its exact command sequence, arguments, and strictness", so they go to the language section for that name, find none, and either invent an invocation or cannot run a gate the rule makes mandatory before committing.

    5. "strongly suggested, not the repo's free choice to skip" states both obligations at once

    The two halves say opposite things, and the unit resolves it by deferring to the hub-only linters section. A maintainer of a carrier repo with no hook cannot tell from the rule whether the repo is out of conformance, and has to fetch the hub to answer a question the sentence appears to answer.

    This is the same wording problem the carried Skills have, where dotnet-codestyle said "not optional" and python-codestyle said "not opt-in" for the identical rule. Those two are fixed in the PR for #1075/#1120 to match GOVERNANCE.md's "strongly suggested fleet-wide, and its absence is a measured audit finding". CODESTYLE.md's own sentence is left here because it is the one the other two were paraphrasing, and settling it is the same decision as items 1 and 2 above.

    6. "Keeping a working gate is not drift" rules on a case nobody meets

    As written it asserts the trivial. The case a conformance sweep actually meets is a repo carrying a Husky.Net or pre-commit config the hub does not specify, and the sentence gives no ruling on it, so one auditor flags that config as unvendored drift while another cites this sentence to pass it.

  2. ptr727 commented on Sep 1, 2026

    @ptr727
    OwnerAuthor

    Five more from the third canonical-review round, in CODESTYLE.md and in the two language Skills that paraphrase it. Grouped here because they are the same "the doc states a rule its own examples or its own toolchain do not obey" shape as the items above.

    7. The brownfield allowance points at two documents that do not describe it

    CODESTYLE.md "General" and dotnet-codestyle "Build requirements" both say:

    (The only brownfield allowance in the fleet is the one-time git-signing / line-ending migration described in GOVERNANCE.md and README.md, which has nothing to do with code analysis.)

    Neither file describes such a migration. grep -i 'brownfield\|one-time\|migration' returns nothing in either. GOVERNANCE.md "Git and Commit Rules" is a summary plus a pointer to the git-commit-conventions Skill and states no allowance.

    A carrier porting a brownfield .NET repo goes to both files to learn the allowance's scope and end date, finds nothing, and either invents a scope or concludes the whole zero-warnings exemption clause is stale. The reference is worse in a carrier than in the hub, since a carrier's README.md is its own repo-specific file and was never going to describe a fleet migration.

    8. The title-case rule is falsified by its own example block

    The rule names one exemption, lowercase short bind words, and Dependabot's Bump X from Y to Z titles. But the block below it carries three titles with lowercase words that are neither:

    Pin softprops/action-gh-release to Commit SHA
    Drop net8.0 Multi-Targeting from Console Project
    Bump xunit.v3 from 3.2.2 to 3.3.0
    

    Identifiers, package names, TFMs and repository slugs keep their own casing, and the unit never says so. A reader applying the rule as written produces Pin Softprops/Action-Gh-Release to Commit SHA or Drop Net8.0 Multi-Targeting, titles that no longer name the real action or TFM, and a reviewer correcting it back has nothing in the unit to cite.

    This is the same shape as #1078, which fixed one example to match the rule. This one wants the rule to state the exemption its examples already rely on.

    9. python-codestyle points at a "Type checking" section that does not exist

    the repo's type checker: uv run pyright, or uv run mypy src where mypy is the CI checker, or both where the repo runs both (see Type checking above).

    The file's headings are Why this exists, Two profiles, Toolchain, Local development loop, Layout, Code style, Tests, Versioning, Linter cleanliness. The material meant is an unnumbered bolded lead-in inside "Toolchain". A reader deciding pyright versus mypy greps for the named section, finds no heading, and either concludes the pointer is to a deleted section or goes looking in another file. The same unit's "the Two Profiles section" and "per Two Profiles above" likewise name a heading that reads ## Two profiles.

    10. python-codestyle's "no such command" has no antecedent

    A lint-only profile's clean-compile substitutes its uvx and unittest equivalents, per Two Profiles above, and has no such command to run before committing beyond those.

    No command was named as "such" a command. The reader it is aimed at, someone on the lint-only profile working out what to run before committing, cannot tell whether it excuses them from the uv sync/uv build lines of the code block above, from the type checker, or from nothing, which is the one question the sentence exists to answer.

    11. comment-and-doc-style's Codex bullet has an inverting pronoun

    No-prompt operation is supported only inside an external sandbox because it removes command-wide protection.

    The nearest noun to "it" is "an external sandbox", so the sentence parses as the sandbox being what removes protection. A reader configuring Codex on that reading concludes the sandbox weakens protection and runs no-prompt operation outside one, which is the state the sentence exists to forbid.

  3. ptr727 commented on Sep 1, 2026

    @ptr727
    OwnerAuthor

    Two more from the final confirmation pass, the same "the doc routes a reader to content that is not there" shape as items 4 and 9 above.

    12. "The per-language mechanics ... are in each language section" is false

    CODESTYLE.md "General", on analyzer suppressions:

    The per-language mechanics (which attribute, which config key) are in each language section.

    No attribute name and no config key appears in any language section. .NET is a scope sentence plus "This is packaged as the dotnet-codestyle Skill at .agents/skills/dotnet-codestyle/SKILL.md in the hub ... Read the skill for the full rules, code examples, and mechanics", and Python and Shell have the identical shape.

    A carrier told to suppress a diagnostic at the narrowest scope reads its language section for the attribute form, finds only a pointer to a hub-local file it does not carry, and either guesses the annotation or blanket-relaxes the rule in root config, which the bullet directly above forbids.

    This is the same defect as item 4 ("The concrete names live in each language section below") and settling one should settle both: either the language sections regain the concrete mechanics, or the General section stops promising they hold them and routes to the Skills directly.

    13. add-host-tool is the one hub-context skill in AGENTS.md carrying no qualifier

    AGENTS.md "Where the Rules Live" marks every other hub-context skill: standup-a-repo/resync-a-repo/audit-a-repo are "all hub-context only", and skill-lifecycle is "hub-context only, since .agents/skills/ exists only in the hub". The add-host-tool paragraph carries none, and its whole surface is hub-local, since the skill directs edits to spec/host-tools.json, the host-setup/ installers, docs/host-setup.md, and the host-gate tests.

    A carrier asked to add a host tool invokes the skill, finds no host-setup/ or spec/host-tools.json in its tree, and either stalls or vendors hub machinery into a repo that is not supposed to carry it.

    Filed rather than fixed in the PR for #1075/#1120 because that PR had reached a converged state on AGENTS.md and another edit would have restarted its review cycle for a one-clause addition.

  4. ptr727 commented on Sep 1, 2026

    @ptr727
    OwnerAuthor

    One more in python-codestyle "Local development loop", same doc-versus-CI shape as item 9's uv run mypy src mismatch.

    14. "CI runs the same clean-compile commands as the authoritative backstop" is false when a repo runs both type checkers

    The unit says, two sentences apart:

    the repo's type checker: uv run pyright, or uv run mypy src where mypy is the CI checker, or both where the repo runs both

    CI runs the same clean-compile commands as the authoritative backstop.

    .github/workflows/validate-task.yml's "Type check Python step" runs mypy XOR pyright:

              if grep -Eq '^[[:space:]]*\[tool\.mypy\]' pyproject.toml; then

    with the file's own comment recording that "Mypy takes precedence where a pyproject declares both sections".

    So a repo the unit's own Toolchain guidance sanctions, pyright strict plus mypy for a plugin ecosystem, runs both locally, believes CI backstops both because this sentence says so, and merges a pyright-strict violation the validator never ran pyright to catch, because [tool.mypy] took precedence.

    Settling it needs a decision rather than a reword: either the validator runs both where both are declared, or the skill says plainly that CI backstops only the precedence-winning checker and the other is local-only.

    Found by the canonical-content pass on the fix round of PR #1157.

  5. ptr727 commented on Sep 1, 2026

    @ptr727
    OwnerAuthor

    Scope note on item 1: "Everything else is Python" is carried in two units, not one.

    CODESTYLE.md "Shell" and .agents/skills/shell-codestyle/SKILL.md "When shell, not Python" carry the sentence byte-parallel, and CODESTYLE.md routes the reader to that skill for the full rules. Both are falsified the same way by the nine tracked .ps1 programs the hub itself ships.

    PR #1157 aligned the two wordings, so they now state the same rule identically, but neither is fixed: whichever way this issue is settled has to land in both, or the pair diverges again on the next edit.

  6. added
    decision
    on Sep 5, 2026
  7. ptr727 commented on Sep 7, 2026

    @ptr727
    OwnerAuthor

    Maintainer decision, 2026-09-07. The rule was never about Bash versus Python. It is about two
    separate things the current sentence conflates.

    1. Platform-native shell is the bootstrap language, by platform. The native shell on Windows is
      PowerShell and the native shell on Linux is Bash, and that native shell is what a bootstrap or an
      installer for another tool, git or Python among them, is written in. PowerShell is therefore not
      an exception to a Python mandate, it is the correct language for that job on that platform,
      exactly as Bash is on Linux.
    2. Non-trivial logic is Python, on every platform. Shell, Bash and PowerShell alike, gets hard to
      test and hard to reason about as soon as the logic is not trivial, so any non-trivial workflow
      belongs in Python whether the host is Linux or Windows.

    So the Shell section's sentence narrows to state those two rules, rather than claiming to rank every
    language. Item 2 of this issue follows from it: the section gets the scope note its siblings carry.
    Item 3, the cspell and CSpell split, is an unrelated sweep and stays open here.

    The section heading and the doc's language coverage should reflect that PowerShell is a first-class
    platform-native shell here rather than an unmentioned one, which is what made this read as a
    contradiction in the first place.

  8. ptr727 commented on Sep 7, 2026

    @ptr727
    OwnerAuthor

    Maintainer rationale for the second half of the decision above, 2026-09-07. Recording it because
    it changes what the reworded sentence has to say, not just how it is justified.

    The reason non-trivial logic is Python is testability, and specifically the negative case. Python
    here gets unit tests, which makes it possible to assert both that a thing works and that it fails
    when it should. Bash and PowerShell do not readily support that, so logic written in them is asserted
    by being run rather than by being tested.

    The tree already reflects this, and the current sentence half-states it without giving the reason:

    • CODESTYLE.md "Shell" already says "Everything else is Python, with a test under its own scripts
      tree's tests/ directory". The test obligation is attached to Python and to no other language in
      the file.
    • scripts/tests/ holds 15 test modules. A search of the whole tree for a shell or Pester test file
      returns nothing, so Python is not merely the preferred language for logic here, it is the only one
      with a test surface at all.
    • The negative half is live practice rather than aspiration. Proving a Guard by Removing It Is Practiced Every Time and Written Down Nowhere #1429 records that proving a guard by
      removing it is done every time and written down nowhere, and that technique needs a test harness,
      which is why it only ever happens on the Python side.

    So the reworded Shell section states the reason rather than only the rule. "Non-trivial logic is
    Python" invites an argument about what counts as non-trivial. "Logic that needs its failure cases
    asserted is Python, because that is the only language here that can assert them" does not, and it
    gives an author a test they can apply to their own script.

    This does not change the first half of the decision. A platform-native bootstrap is still written in
    the platform's native shell, and it is exempt because it runs before the interpreter exists rather
    than because its logic is simple.

  9. ptr727 commented on Sep 7, 2026

    @ptr727
    OwnerAuthor

    Third maintainer rationale, 2026-09-07: one implementation covers both platforms. The same logic
    runs on Linux and Windows from a single source, where shell means writing and maintaining it twice,
    in two languages, with nothing able to compare the two.

    The repository is already split exactly along this line, which is the clearest argument for stating
    the rule this way:

    Layer Shape Cost
    host-setup/ Seven near-matched pairs: bootstrap, menu, install-skills, install-tools, setup-github, upgrade-host, and the agent-safety installer, each existing as both .sh and .ps1 The same intent expressed twice, and no test compares the two
    scripts/ 25 Python programs against 2 shell files, and those two are skills_install.sh and skills_install.ps1, thin wrappers over skills_install.py Written once, fixed once

    That wrapper pair is the pattern the reworded section should name outright: a platform-native entry
    point over shared Python logic
    . It gets the native launch a bootstrap needs without duplicating the
    logic behind it, and it is what the fleet already does where it had the choice.

    One caveat worth writing down so the rule is not oversold. Python does not make platform differences
    disappear: #1419 is a Windows pathspec defect in a Python function, still unverified because it needs
    a Windows host. What one implementation buys is that such a defect is one defect in one place, with
    one test suite that can be run on both platforms
    , rather than two implementations that can drift
    apart silently and where a fix has to be applied twice and remembered twice. The pairs in
    host-setup/ are exactly where that drift is currently unmeasurable.

    Taken with the two rationales above, the Shell section now has three independent reasons and they
    point at one sentence rather than three: platform-native shell is for what must run before the
    interpreter exists, and everything else is Python because only Python here can assert its own failure
    cases and only Python here is written once for both platforms.

  10. ptr727 commented on Sep 11, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer, 2026-09-11, for item 1: narrow the CODESTYLE.md "Shell" sentence to say what it means about Bash versus Python, without claiming to cover every language, rather than adding a PowerShell section and Skill. Items 2 and 3 follow from that per the issue. Removing decision; the issue stays open for the change.

  11. removed
    decision
    on Sep 11, 2026
  12. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Decision triage split the undecided item out of this issue into #3748, which carries the decision label. Everything else here stays as ordinary work an agent can do without the maintainer.

  13. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer to the split decision #3748 (decision triage, 2026-11-01): Item 7, option 1: delete the brownfield-allowance parenthetical from CODESTYLE.md and dotnet-codestyle SKILL.md.

  14. ptr727 commented on Nov 10, 2026

    @ptr727
    OwnerAuthor

    Overlap noted (open-issue sweep, 2026-11-10).

    Item 1 here, the Python-for-every-program mandate against the hub's own PowerShell scripts, is built under #1748, which decided a PowerShell section for CODESTYLE.md. The other items stay open here and are grouped with #1748, #3787, #3536, and #4015 as one code-style change.

  15. ptr727 commented on Nov 24, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-24): PR #4404 merged to develop at c7f3a4c; branch and worktree cleaned up, so this claim holds no files. #1153 stays open for its other items.

    Backlog burndown claim (away-mode run, round 2, scope develop)

    Group: #1748, with #1153 items 1 and 2 only. Branch: burndown/codestyle-powershell-section.

    Predicted files:

    • CODESTYLE.md
    • AGENTS.md
    • .agents/skills/shell-codestyle/SKILL.md, plus the generated copies scripts/build_dist.py writes from it

    Scope: the PowerShell section and batch sentence #1748's 2026-11-01 answer decided. The narrowed Shell sentence #1153's 2026-09-07 and 2026-09-11 answers decided, kept byte-parallel in shell-codestyle "When shell, not Python". The Shell scope note, #1153 item 2. The AGENTS.md sentence naming the language sections and their Skills. The remaining #1153 items stay open and unclaimed. Whether the new section gets a powershell-codestyle Skill is split out to #4403, and this group adds no Skill.

  16. ptr727 commented on Nov 24, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-24): PR #4405 merged to develop at 94d6149; branch and worktree cleaned up, so this claim holds no files.

    Backlog burndown claim (away run 2026-11-24, round 2, group 8): branch burndown/audit-converge-and-skill-pointers, issue #1607, with #1153 items 9, 10 and 11 only.

    Predicted files:

    The generated copies scripts/build_dist.py writes under .github/skills/ and .claude-plugin/ follow the two Skill edits.

    #1153's other open items stay unclaimed here. Items 1 and 2 belong to burndown/codestyle-powershell-section.

    • .agents/skills/audit-a-repo/SKILL.md line ~46 "After the Report" and its generated copies (granted 2026-11-24: the change makes its fixes-ship-as-pull-requests sentence false).

    Any other group needing one of these files waits for this branch to merge.

  17. ptr727 commented on Nov 24, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-24): PR #4409 merged to develop at 988b6ef; branch and worktree cleaned up, so this claim holds no files. #1153 stays open (item 6 still open on develop, items 3, 8, 14 outstanding).

    Backlog burndown claim (away run 2026-11-24, round 3, group 1): branch burndown/codestyle-general-routing, issue #1153 items 4, 5, 7, 12 and 13 only.

    Predicted files:

    Not in this claim. Item 3, the CSpell casing sweep, reaches past these files. Item 6's quoted sentence is no longer on develop, so this group only confirms that. Item 8, the title-case exemption, would put the summary in GOVERNANCE.md "Pull Request Title and Commit Message Conventions" in disagreement, and GOVERNANCE.md is held by burndown/docker-lint-digest-pins. Item 14 is split out to decision #4407.

    Any other group needing one of these files waits for this branch to merge.

  18. ptr727 commented on Nov 24, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-24): PR #4411 merged to develop at a117294; branch and worktree cleaned up, so this claim holds no files. #1153 stays open for items 3, 8 and 14.

    Backlog burndown claim (away run 2026-11-24, round 3, refill): branch burndown/codestyle-working-gate-sentence, issue #1153 item 6 only.

    Predicted file set:

    • CODESTYLE.md. In "General" > "Clean-Compile Verification", the sentence "Keeping a working gate is not drift." that ends the local commit/pre-commit gate bullet (item 6).

    Scope: item 6 is ordinary work per the 2026-11-01 decision-triage comment on this issue, which split only item 7 out as undecided. The fix deletes the sentence rather than qualifying it. The case it fails to rule on, a repository carrying a Husky.Net or pre-commit config the hub does not specify, is already ruled by the spec: parity.hooks in spec/project-types.json judges the hook config by what it invokes, and spec/divergences.json accepts .husky/pre-commit as a path collision rather than a carry. This group adds no new ruling. No other tracked file restates the sentence.

    Not in this claim: item 3 (the CSpell casing sweep reaches GOVERNANCE.md, held by burndown/docker-lint-digest-pins), item 8 (GOVERNANCE.md, same holder), and item 14 (decision #4407).

  19. ptr727 commented on Nov 25, 2026

    @ptr727
    OwnerAuthor

    Decision #4407 settles item 14 (2026-11-25): the python-codestyle text is aligned to the one-checker Toolchain contract, and the validator is unchanged. The work is tracked on #4407.

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