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

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 <[email protected]>
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 Resolved
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 Resolved
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]>
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 Resolved
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]>
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)
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
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]>
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