Skip to content

configure.sh model inference on carries; harden ruleset snippets - #334

Merged
ptr727 merged 6 commits into
developfrom
fix-332-carry-ergonomics
Jul 17, 2026
Merged

configure.sh model inference on carries; harden ruleset snippets#334
ptr727 merged 6 commits into
developfrom
fix-332-carry-ergonomics

Conversation

@ptr727

@ptr727 ptr727 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Fixes #332 (core gap + the six bundled nits from the #330 sweep reviews; two of the six live in the blessed downstream reference and propagate via the Vantage-Config carry, not this repo - see below).

configure.sh: model inference on downstream carries

In a carry the registry is absent, so the no-arg form defaulted to release and then hit the intended fail-safe abort on operational carries (missing develop.json) - arg 2 was effectively mandatory there. Now the model is inferred from which develop payload is carried (a carry holds exactly its own model's); ambiguous layouts (both or neither - e.g. a partial copy) abort rather than guess. Also: the model may be passed as the sole argument (configure.sh operational) - previously arg 1 was always parsed as a repo name (bundled nit, Utilities #417).

Matrix-tested with the apply path stubbed: infer release, infer operational, both-present abort (exit 1), neither-present abort (exit 1), explicit arg-2 override, model-as-sole-arg, unknown-model abort. Hub behavior unchanged (registry present -> registry lookup, as before). shellcheck + bash -n clean.

Ruleset snippet hardening (duplicate-name id corruption)

The id=$(gh api ... select(.name==...).id) pattern in the README regen snippet and AUDIT.md section 6 produced a multiline id when duplicate same-name rulesets exist, silently corrupting the follow-up API path (bundled nit, Utilities #417 + LanguageTags #278). Both snippets now fetch the list once and enforce exactly one ruleset per name: the regen snippet fails loudly (never regen from a guess); the audit snippet reports found N (defect/drift) and continues - matching the declared drift semantics. Live-tested read-only against this repo (develop + main in sync; duplicate simulation counts correctly).

README wording

Documents the inference fallback and the model-only argument form (bundled nit, Utilities #417).

Bundled nits NOT in this PR (with rationale)

Propagation caveat

This re-drifts the five existing carries (Vantage-Config + the four #330 sweep repos) until their next conformance touch; Vantage-Config is updated immediately after this merges since it is the blessed reference the queued operational standups (HomeAssistant-Config #16, ESPHome-Config #46, HomeAutomation-Config #21) will adapt from.

🤖 Generated with Claude Code

Fixes the operational-carry gap and the snippet nits bundled into #332
(raised by Copilot on the Vantage-Config carry and the #330 sweep PRs).

1. configure.sh: when the registry is absent (a downstream carry), the
   model is inferred from which develop payload is carried - a carry
   holds exactly its own model's. Ambiguous layouts (both or neither,
   e.g. a partial copy) abort rather than guess. The documented no-arg
   form now works on operational carries. The model may also be passed
   as the sole argument (configure.sh operational); previously arg 1
   was always parsed as a repo name.

2. repo-config/README.md regen snippet + AUDIT.md section 6 ruleset
   snippet: enforce exactly one ruleset per name before using the id -
   a duplicate name previously produced a multiline id that silently
   corrupted the follow-up API path; zero/duplicates is declared drift,
   so fail loudly (regen) or report and continue (audit). Single list
   fetch, jq-selected.

3. repo-config/README.md documents the inference fallback and the
   model-only argument form.

Declined from the bundle with rationale: gh api --input - portability
(fleet standard is current gh; no temp-file churn) - recorded on #332.
The jq-derived secret lists and --paginate hardening apply to the
blessed downstream self-audit reference, which lives in the
Vantage-Config carry - propagated there, not here (the hub's fleet
audit reads spec/secrets.json programmatically already).

Resolution logic matrix-tested (infer release/operational, ambiguous
both/neither abort exit 1, explicit arg override, model-as-sole-arg,
unknown-model abort); hardened snippets live-tested read-only against
this repo (both rulesets in sync; duplicate simulation counts 2).
shellcheck and bash -n clean; markdownlint and editorconfig-checker
clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 00:21

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 improves repo-config portability and reliability by (1) making configure.sh work correctly when carried downstream without the hub registry and (2) hardening the ruleset regen/audit snippets to avoid silently selecting a corrupt/multiline ruleset id when duplicate same-name rulesets exist.

Changes:

  • Infer release vs operational in repo-config/configure.sh when registry/repos.json is absent, and allow passing the model as the sole argument.
  • Update repo-config/README.md to document the new inference and model-only argument form, and harden the ruleset regen snippet to enforce exactly one ruleset per expected name.
  • Harden AUDIT.md ruleset diff snippet to detect and report duplicate/zero same-name rulesets rather than diffing an arbitrary selection.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
repo-config/README.md Documents new configure.sh behavior and hardens the regen snippet to require exactly one ruleset per expected name.
repo-config/configure.sh Adds model inference for downstream carries (no registry) and supports configure.sh operational as a shorthand.
AUDIT.md Updates the ruleset audit snippet to treat duplicate/zero same-name rulesets as an explicit defect/drift signal.

Comment thread repo-config/README.md
Comment thread AUDIT.md
gh api --paginate emits each page as a separate JSON doc; re-assemble
with jq -s so a name match on a later page is never missed - the same
trap configure.sh already guards against. Live-tested read-only against
this repo (both rulesets in sync).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 00:24

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 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread repo-config/README.md Outdated
Comment thread AUDIT.md Outdated
…lot #334)

With --jq '.[]' the paginated fetch emits one JSON object per ruleset
across all pages; jq -s re-assembles them into the single array the
selections expect. The old wording described the un-filtered per-page
behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 00: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 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread AUDIT.md
…334)

An operational repo's develop ruleset diffs against
operational/develop.json - the same registry-workflowModel selection
audit.py makes; the snippet hard-coded repo-config/$b.json and would
false-DRIFT every operational repo. Live-tested read-only against
Vantage-Config (operational: both rulesets in sync via the swapped
payload).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 00:32

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 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread repo-config/README.md Outdated
Comment thread repo-config/configure.sh Outdated
Comment thread repo-config/configure.sh Outdated
The model-only invocation examples now use the repo-root-relative
repo-config/configure.sh form the docs use elsewhere, and the payload
inference tests use -f (regular file), not -e. Inference matrix re-run:
release/operational infer, both/neither abort. shellcheck clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 00:35

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

Comment thread repo-config/README.md Outdated
…#334)

The round-4 patch rewrote repo-config/README.md through a text-mode
round-trip that stripped its CRLF endings - the Lint sources job
correctly failed on it; restored byte-exact CRLF (editorconfig-checker
clean). The regen snippet's develop-payload presence check now uses -f
like the configure.sh inference checks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 00:39

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

@ptr727
ptr727 merged commit ed44cee into develop Jul 17, 2026
7 checks passed
@ptr727
ptr727 deleted the fix-332-carry-ergonomics branch July 17, 2026 00:42
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