Skip to content

Refuse unknown code_cycle keys and document calibration (#29) - #38

Merged
datacas merged 1 commit into
mainfrom
issue-29-calibration-config
Sep 23, 2026
Merged

datacas merged 1 commit into
mainfrom
issue-29-calibration-config

Conversation

@datacas

@datacas datacas commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Closes #29 — #29

What changed

  • run_cycle.load_config now carries an allow-list of keys under code_cycle and refuses any unknown key by name, suggesting the nearest known key ('profles' (did you mean 'profiles'?)), before anything is dispatched.
  • The driver reads repository, profiles, routing. It recognises without interpreting the keys owned elsewhere: issue_provider, code_host, issue, verification (provider bootstrap), review (review skills), security_review (security_gate.py), orchestration (cc-orchestrator), calibration (cc-orca-orchestrator paired review). run_cycle does not become a consumer of any of them.
  • code_cycle.calibration is shape-checked as a mapping.

Decision: calibration is consumed (by paired review), not refused

The issue allowed either. The block is already read by cc-orca-orchestrator with paired_review=true (skills/cc-orca-orchestrator/SKILL.md, Paired review) and documented in cc-provider-bootstrap, so refusing it would break that skill and this repository's own .code-cycle.yml. It is now recognised as a skill-consumed key; run_cycle --mode calibration still takes its arms from the ordinary profiles, and this is written down in README.md and docs/instrumentation.md.

The absence of calibration.enabled is documented as a decision: a calibration is entered only by explicit --mode calibration (or explicit paired_review=true), never by configuration alone.

Tests

New in tests/test_run_cycle.py:

  • unknown key raises and names it;
  • profles typo raises with a suggestion instead of routing on defaults;
  • every skill-consumed key is accepted;
  • this repository's .code-cycle.yml loads;
  • main() with this repository's config (calibration block present) runs in RoutingMode.PRODUCTION; only --mode calibration yields CALIBRATION;
  • calibration: nope is refused as not a mapping.

Existing no-silent-fallback and PROVEN-readiness calibration tests are unchanged and pass.

Verification

  • python3 scripts/validate-package.py → VALID: 12 skills (6 cycle, 6 supporting), shared sections in sync, cross-agent manifests aligned
  • python3 -m unittest discover -s tests → Ran 486 tests … OK

run_cycle's loader now knows every legitimate key under code_cycle and
refuses any other by name, with the nearest known key, before a stage is
dispatched. A typo such as `profles` no longer runs the built-in profiles
while the file declares others.

Keys that belong to skills or other modules (provider bootstrap, review,
security_review, orchestration, calibration) are recognised and left
uninterpreted. `calibration` is consumed by cc-orca-orchestrator's paired
review only; it must be a mapping, and it never changes the routing mode.

The absence of a calibration.enabled flag is documented as a decision: a
calibration is entered only by the explicit --mode calibration argument,
and a test asserts that a production run under a calibration block stays
in production.
@datacas

datacas commented Sep 23, 2026

Copy link
Copy Markdown
Owner Author

Review summary

Reviewed the full accumulated diff from 63f6c86dbeff0b6627be95ecdf4dee3f7581a471 to PR head be0674faaa31bf5f2a201d3bbc5950d129b6dde5 across CHANGELOG.md, README.md, docs/instrumentation.md, scripts/run_cycle.py, and tests/test_run_cycle.py. The change meets the linked issue's acceptance criteria for ordinary string keys and explicit calibration mode.

[REV-001] · low · open · blocks:no — Mixed YAML key types bypass the unknown-key diagnostic

File: scripts/run_cycle.py:197
When code_cycle has unknown keys of incomparable types, sorting the set raises TypeError before the loader can report the unknown key. Reproduced with:

code_cycle:
  1: true
  typo: true

Observed: TypeError: '<' not supported between instances of 'int' and 'str'. This is invalid configuration, so the run still stops before dispatch, but the exception bypasses the promised named configuration error and produces a traceback. Validate that keys are strings or sort by a stable string representation before formatting the refusal.

Security triage

This change adds validation for configuration input, so the security audit ran. No security vulnerabilities were found in the changed surface.

Verification

  • python3 scripts/validate-package.py — passed.
  • python3 -m unittest discover -s tests — 486 tests passed.
  • Mixed-key reproduction above — confirmed the raw TypeError.
  • No database or application service is needed by these checks.

CI

All current PR checks pass: Skills, manifests, and Bash installer (2 runs) and PowerShell installer (2 runs). No pending, failed, cancelled, skipped, or missing expected checks were observed.

Residual risk and verdict

The mixed-key diagnostic edge case remains nonblocking. APPROVED for reviewed head be0674faaa31bf5f2a201d3bbc5950d129b6dde5; no open finding blocks approval.

@datacas
datacas merged commit 94c0ae5 into main Sep 23, 2026
4 checks passed
@datacas
datacas deleted the issue-29-calibration-config branch September 24, 2026 09:21
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.

Refuse or consume the calibration configuration block

1 participant