Repository navigation
Add the cpp type and the profile vocabulary to the spec - #438
Merged
Merged
Conversation
Define the cpp lint-only type (clang-format), the build and lint-only profiles on the language types that carry them, and a minProfile on the build-requiring checks (both coverage checks, uvlock, pyright) so the audit can hold them N/A for a lint-only language. Declare the profile in the registry as a parallel profiles map rather than an object-or-string types entry, because audit.py builds a set and dict-indexes the types list and an object would break both. validate.py checks a declared profile against the repo's types and the type's allowed profiles. The audit does not consume the new fields yet, so behavior is unchanged. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the spec’s type system with a new lint-only cpp type and introduces a “profile” vocabulary (lint-only vs build) that can be declared per repo-type, with schema and validation support. It is part of the ongoing lint-only language type work and is scoped to vocabulary + schema + validation (audit behavior unchanged).
Changes:
- Add
cppas a new lint-only project type inspec/project-types.json. - Introduce
profileson types andminProfileon checks in the spec schema and type definitions. - Extend registry schema +
spec/validate.pyto validate declared repo profiles against repo types and allowed profiles.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| spec/validate.py | Validates profiles declarations in registry entries against repo types and type-allowed profiles. |
| spec/project-types.schema.json | Adds schema support for per-type profiles and per-check minProfile. |
| spec/project-types.json | Defines cpp type and adds profile vocabulary to csharp/python plus minProfile on build-only checks. |
| registry/repos.schema.json | Allows an optional profiles map on repo entries with constrained profile values. |
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
spec/validate.py:146
- The new profiles validation assumes
repo["types"]is a list of strings, butvalidate.pyintentionally runs without JSON-schema validation. Iftypesis accidentally set to a string/object, the current logic will iterate characters or do substring membership checks, producing confusing errors and making the profiles cross-check unreliable. Add a small shape guard fortypes, and consider validating each profile value is a string for clearer diagnostics.
# A declared profile must name one of the repo's types and a profile that type allows (spec/type-model.md).
# CI runs no JSON-schema validation, so guard the shape here rather than crash on .items().
profiles_decl = repo.get("profiles", {})
if not isinstance(profiles_decl, dict):
errors.append(f"{name}: profiles must be an object mapping a type to its profile")
Use the declared profile vocabulary (build/lint-only) as the profile names throughout the python type, keeping PROJECT/SCRIPTS only as the structural pyproject shapes they detect. Removes the two-vocabulary ambiguity about what the registry declares, and splits two more pre-existing semicolon splices in the touched asserts. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Say the declared profile corresponds to the pyproject shape and that each check names its minimum profile, rather than claiming the audit validates the profile against pyproject or gates checks by it - that consumption lands in a later slice. Co-Authored-By: Claude Opus 4.8 <[email protected]>
ptr727
added a commit
that referenced
this pull request
Jul 25, 2026
## Promote develop to main The lint-only language type work, slices 1-4 (doc/spec/registry only, no code path changes - no release): - **#437** - `spec/type-model.md`: the durable model doc (declared-primary, detection-as-validator, build/lint-only profiles, the ignore mechanism). - **#438** - the `cpp` type + `build`/`lint-only` profile vocabulary + per-check `minProfile` in `project-types.json`/schemas + `validate.py` enforcement; python profile names aligned to build/lint-only. - **#439** - `audit.py` gates the codecov requirement (CODECOV_TOKEN secret + codecov.yml file) on a build profile, so a lint-only language draws no coverage finding. - **#440** - reclassify ESPHome-Config `source-only + python(lint-only) + cpp(lint-only)`; record the devcontainer-is-optional convention in the section model. ## Verification - `spec/validate.py` OK; `spec/audit.py --selftest` PASS. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ptr727
added a commit
that referenced
this pull request
Oct 27, 2026
The committed hub audit records the maintainer's earlier decision, on HomeAutomation-Config #438, to keep python undeclared. A driftNote now says the maintainer reversed it under #2255, so the registry and that report no longer disagree silently. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ptr727
added a commit
that referenced
this pull request
Oct 27, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ptr727
added a commit
that referenced
this pull request
Oct 27, 2026
## Summary Applies the maintainer's decision on [#2255](#2255): HomeAutomation-Config declares `python`. The issue closes on the promotion pull request. The registry entry now carries: - `types`: `source-only` and `python` - `pythonDirectories`: the eight directories both of the repository's workflows pass to the hub validator's `python-directories` input (CloudInit, Cloudflare, MutationSweep, Notify, Trackers, USBDev, VPS, scripts) - `requiredSecrets`: `CODECOV_TOKEN`, which the repository already stores in both the actions and dependabot stores A new driftNote on the entry records the decision. The committed hub audit `reports/homeautomation-config/audit.md` records the earlier decision on HomeAutomation-Config #438 to keep `python` undeclared, and the maintainer reversed it under #2255. `docs/pre-commit-hooks-rollout.md` now gives HomeAutomation-Config's row the `pre-commit` framework half. Before, it read as a doc-gate-only repository, which a resync would tick as complete. Its box is now checked, because the hub audit in `reports/homeautomation-config/audit.md` graded `parity.hooks` passing with the Python gates included, and the tracker's maintenance rule owes the box once that audit exists. A sweep of every row against the registry found that the hub's own row also omitted its `python` type, and that row is corrected too. It also now names #962, rather than "this PR", as where its ruff/mypy half was added. ## Verification - `spec/validate.py` passes. - `uv run --no-project --script spec/audit.py HomeAutomation-Config`, run against this registry, no longer reports the five findings #2255 tracks: the type, the two `python-directories` findings and the two `CODECOV_TOKEN` secret findings. It raises no new python, profile or secrets finding. ## Pre-existing findings, not filed - `spec/divergences.json:24`, a stale rationale: the `accepted` reason for `.github/actions/validate/action.yml` says HomeAutomation-Config's override runs its CloudInit Python project. The downstream file now says it runs no Python step of its own, because all Python goes through the hub validator's `python-directories` input. The disposition itself still holds, since the override remains for Pester and the shell harnesses. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice 2 of the lint-only language type work (slice 1: the model doc, merged). Vocabulary + schema + validation only - the audit does not consume the new fields yet, so behavior is unchanged.
What
project-types.json: newcpplint-only type (.clang-format, style only - the downstream compile does semantic/static analysis);profilesonpython(build/lint-only) andcsharp(build);minProfile: "build"on the four build-requiring checks (both*.coverage.codecov,python.uvlock.pinned,python.pyright.config). Also splits the pre-existing semicolons in those four asserts (touched lines).project-types.schema.json:minProfileon a check,profileson a type.registry/repos.schema.json: aprofilesmap property.validate.py: a declared profile must name one of the repo's types and a profile that type allows.Design note
Declared profile is a parallel
profilesmap (typesstays a string list), not an object-or-stringtypesentry:audit.pydoesset(entry.get("types"))anddict.get(t), which crash on an unhashable dict.validate.pycross-checks the map againsttypes, so they cannot drift.Verification
spec/validate.pyOK; both validation branches tested (bad type, bad profile value);spec/audit.py --selftestPASS; JSON valid; no semicolon splices in the diff.🤖 Generated with Claude Code