Skip to content

Add porting-skill contract tests and wire pytest into CI - #95

Draft
nickhuo wants to merge 3 commits into
mainfrom
nickhuo/porting-skill-ci-contract
Draft

nickhuo wants to merge 3 commits into
mainfrom
nickhuo/porting-skill-ci-contract

Conversation

@nickhuo

@nickhuo nickhuo commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Add CI tests that verify the claims in the porting-to-canyonos skill docs, especially manifest.md (configuration) and runtime-contract.md against the actual behavior of canyonos_core.

Run these tests on every PR. If the code changes and no longer matches the docs, CI should fail. The docs must then be updated manually before the PR can be merged.

…nyonos skill

V030/V031 gated on canyonos_core capabilities that never actually vary:
env_file injection is now unconditional in global_controller.py, and
editable_install (_install_step) has never existed in canyonos_core's
history. Treat both as fixed facts instead of probing for them, and
document the otel.destinations key that global_controller.yaml already
supports but the skill never mentioned.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Both are real config keys global_controller.py reads off self.config, found
by a coverage check being added in CAN-282's contract-tests work (#95): every
top-level config key the controller reads must have a row in this table, the
same class of gap that let otel.destinations go undocumented in this PR.

- cleanup_interval: developer-set, defaults to 10 like poll_interval.
- project_id: derived, not developer-set -- the controller generates and
  persists a UUID on first load when absent, so omitting it is not an error.
@nickhuo
nickhuo force-pushed the nickhuo/porting-skill-ci-contract branch from c39e78f to 80d0a37 Compare September 11, 2026 00:02
canyonos_core's runtime contract changes faster than the porting-to-canyonos
skill's docs and validators track it (see 76b5a45, #83). Pin the skill's
factual claims to executable assertions against real canyonos_core source
instead of hand-maintained prose, and run them where they can actually block
a PR:

- tests/test_porting_skill_contract.py: behavior assertions for claims in
  manifest.md/runtime-contract.md, plus a coverage check that diffs every
  top-level config key canyonos_core reads off `self.config` against
  manifest.md's ownership table -- the same class of gap that let
  otel.destinations go undocumented. It found two more real gaps
  (project_id, cleanup_interval); those manifest.md rows are documented in
  #86 rather than here, since that's the PR already carrying this skill's
  doc fixes.
- .github/workflows/ci.yml: actually run `pytest`. It never had before.
- tests/conftest.py: compile the gRPC stubs global_controller.py imports at
  module load time, so importing it from a plain checkout doesn't require a
  prior `canyonos build`. This was blocking collection of 11 existing test
  files, which is almost certainly why pytest was never wired into CI.
- tests/test_cli.py: three deploy tests globally monkeypatched
  `os.path.isfile` truthy, which also fooled resolve_env_file's unrelated
  platform-secrets check. Patch resolve_env_file directly instead.
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.

1 participant