Add the cpp type and the profile vocabulary to the spec - #438
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 <noreply@anthropic.com>
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. |
Uh oh!
There was an error while loading. Please reload this page.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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")
Uh oh!
There was an error while loading. Please reload this page.
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 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
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 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
## 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)
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