Skip to content

Consumer entry: its protected_paths in the hooks' syntax, held by consumer/1 and read by the one matcher (#141) - #738

Merged
don-petry merged 9 commits into
mainfrom
claude/consumer-paths-141
Nov 12, 2026
Merged

don-petry merged 9 commits into
mainfrom
claude/consumer-paths-141

Conversation

@don-petry

@don-petry don-petry commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

User description

Closes #141, "Consumer entry: its protected_paths in the hooks' syntax". It applies decision 0020; no new decision (the Factory Builder, 2026-11-11).

What changes

Part Change
schemas/consumer.schema.json consumer/1, the entry of design §3.12, as a data file. Each verify.protected_paths item is hooks.schema.json#/$defs/path, the very path config/hooks.json holds: a final / for a directory and all below it, * within one name, ** as a whole name, case ignored. setup and test are literal paths, never patterns. Every other field is held in its shape and type
tools/check_examples.py consumer is a data file in ENVELOPE. _unprotected: an entry's setup and test scripts must each be named by one of its protected paths, by the Kernel's own derive.matches, in an example as in a counter-example, so that an author cannot weaken the tests it is judged by
examples/consumer.json The §3.12 entry, with a ** and a * pattern beside the scripts
examples/invalid/consumer.*.json A path from the root, a glob of another syntax (?), a path that climbs out, a script left unprotected, and a script named by a pattern
Design §3.12 The example's .github/** becomes .github/, a syntax correction kept as ruled. One paragraph on the syntax, with its two pitfalls (.github/*; CODEOWNERS without .github/CODEOWNERS). §5.3's line says a setup and a test script, which the protected paths name

The test is tests/test_tools.py::Apps::test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher. It asserts four things:

  • Every counter-example is refused.
  • Each wrong protected-path list is refused: empty, doubled, from the root, ?, .., //, ./, braces, a backslash, or missing.
  • Each other field is refused when wrong, of the wrong type, missing, or extra.
  • Every pattern the schema lets through is one kernel readable_pattern reads, and kernel derive.matches and the session hooks' protected.entries find the same patterns for each path, in any case.

21 mutants under "Issue 141", all killed. The matcher does not move; no model Lens input is touched (schemas/, examples/, tools/ and tests/ are the verify Lens's inputs). Nothing reads an entry until slice 3's readiness check and apply.

Verify

make checks passes at 1491421, and tests.test_tools passes. Full verify is CI's.

Reviews

Read Head State
Claude + security 855930e Nothing blocking. A fuzz of 60,000 patterns against 480,000 paths found the two matchers never disagreeing. Its major (an entry could leave its own scripts unprotected), the untested $defs/file, a claim no code held, owner_role's pattern, and the wording on two matchers are fixed in 9804b52. Left alone: the ring enum's tie to release/rings.json, which fixes the same two Channels; and schemas/acceptance.schema.json's protected_paths, still any string, which is outside this change
Carbon (gemini-4-carbon-high) 855930e One major (the other fields untested): fixed in 4cc4801
Muse (Wonder Full) 855930e A clean read
Astra (gpt-6-astra) 4cc4801 Two majors (an empty workflow name; the test script's pattern held only through setup): fixed in 6844128
Astra, re-read 6844128 Two majors (field types; a setup script alone left unprotected): fixed in 1491421

🤖 Generated with Claude Code

View guided diff Turn on auto-fix


CodeAnt-AI Description

Validate Consumer repository protection paths and verification scripts

What Changed

  • Consumer entries now use the same protected-path rules as hooks, including directory paths, wildcards, and case-insensitive matching.
  • Each entry must protect both its setup and test scripts; those scripts must be literal repository paths.
  • Entries with invalid paths, unsupported patterns, or uncovered scripts are rejected.

Impact

✅ Consumer setup and test scripts stay protected
✅ Invalid protection paths rejected
✅ Consistent path matching across checks and hooks

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

don-petry and others added 5 commits November 11, 2026 07:25
…sumer/1 and read by the one matcher (#141)

schemas/consumer.schema.json gives the entry of design section 3.12 a schema, its protected paths each
config/hooks.json's own path. An example, three counter-examples, a test that the Kernel's matcher and the
session hooks' read each pattern alike, and five mutants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mong its protected paths, a script is a path not a pattern, and the words say two matchers read alike

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…utant, not its protected paths alone

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d by a pattern, each refused, with a mutant

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…left unprotected, each refused, with a mutant

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@don-petry
don-petry requested a review from a team as a code owner November 11, 2026 13:56
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-11T13:56:15.786952Z
We couldn’t complete this review. Comment @codex review to try again.
1491421 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codeant-ai

codeant-ai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #be624 Incremental review completed b0ea9b4 Nov 11, 2026 · 22:59 23:00
✅  #fb01c Reviewed your PR 1491421 Nov 11, 2026 · 13:56 14:00

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@codeant-ai

codeant-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Nov 11, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the JSON schema for consumer configurations (consumer/1), along with valid and invalid examples to demonstrate and test the configuration rules. It also updates the software factory design documentation to detail the protected_paths syntax and adds validation logic in tools/check_examples.py to ensure setup and test scripts are properly protected. Feedback on the changes suggests improving the grammar of the error message in tools/check_examples.py when only one script is unprotected, and correcting an incomplete sentence in the design documentation.

Comment thread tools/check_examples.py Resolved
@codeant-ai

codeant-ai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: b0ea9b4c79a5

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 11 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/architecture/software-factory-design.md">

<violation number="1" location="docs/architecture/software-factory-design.md:1071">
P3: This says `**` is part of the one syntax of `config/hooks.json`, but `tools/hooks/protected.py` `load()` rejects any `**` in that file. Either state that the hooks reader does not yet accept `**`, or drop the claim that the session hooks read it alike.</violation>
</file>

<file name="schemas/consumer.schema.json">

<violation number="1" location="schemas/consumer.schema.json:38">
P2: The schema accepts a Consumer with no Advisory reviewers. Require at least one reviewer so an entry cannot silently opt out of the review configuration described in §3.12.</violation>
</file>

Comment thread examples/consumer.json Resolved
Comment thread schemas/consumer.schema.json Resolved
don-petry and others added 2 commits November 11, 2026 08:14
…he example protects docs/CODEOWNERS and lock files at any depth, an entry names a reviewer, and ** is said to be read by both matchers though config/hooks.json names none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@combsmith-sf-pr-review combsmith-sf-pr-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings: the Consumer schema, its counter-examples and the shared-matcher check do what issue 141 asks.

# Conflicts:
#	tools/check_examples.py
@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Contributor Author

Factory Builder: renewing this item's Run ceiling. Its ten Runs since a writer last acted all ended in the runner outage of 2026-11-11 (14:00Z to 22:24Z, before the v0.1.8 cut), as environment faults that reviewed nothing. #757 tracks counting such Runs out of the ceiling. A push is no writer's action, so the new head did not renew the count; this comment does.

@combsmith-sf-pr-review combsmith-sf-pr-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No gating findings: the Consumer schema, its counter-examples and its check match issue 141 and are tested.

@don-petry
don-petry added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 91e62a4 Nov 12, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consumer entry: its protected_paths in the hooks' syntax

2 participants