Skip to content

Add the cpp type and the profile vocabulary to the spec - #438

Merged
ptr727 merged 4 commits into
developfrom
type-profile-vocab
Jul 25, 2026
Merged

Add the cpp type and the profile vocabulary to the spec#438
ptr727 merged 4 commits into
developfrom
type-profile-vocab

Conversation

@ptr727

@ptr727 ptr727 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

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: new cpp lint-only type (.clang-format, style only - the downstream compile does semantic/static analysis); profiles on python (build/lint-only) and csharp (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: minProfile on a check, profiles on a type.
  • registry/repos.schema.json: a profiles map 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 profiles map (types stays a string list), not an object-or-string types entry: audit.py does set(entry.get("types")) and dict.get(t), which crash on an unhashable dict. validate.py cross-checks the map against types, so they cannot drift.

Verification

spec/validate.py OK; both validation branches tested (bad type, bad profile value); spec/audit.py --selftest PASS; JSON valid; no semicolon splices in the diff.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings July 25, 2026 15:16

Copilot AI 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

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 cpp as a new lint-only project type in spec/project-types.json.
  • Introduce profiles on types and minProfile on checks in the spec schema and type definitions.
  • Extend registry schema + spec/validate.py to 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.

Comment thread spec/validate.py
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 25, 2026 15:19

Copilot AI 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 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, but validate.py intentionally runs without JSON-schema validation. If types is 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 for types, 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")

Comment thread spec/project-types.json Outdated
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>
Copilot AI review requested due to automatic review settings July 25, 2026 15:28

Copilot AI 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 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread spec/project-types.json Outdated
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>
Copilot AI review requested due to automatic review settings July 25, 2026 15:34

Copilot AI 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 4 out of 4 changed files in this pull request and generated no new comments.

@ptr727
ptr727 merged commit 50dd921 into develop Jul 25, 2026
7 checks passed
@ptr727
ptr727 deleted the type-profile-vocab branch July 25, 2026 15:41
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)
Sign up for free to 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