Skip to content

ci: add PR-convention checks + build/test workflow - #3

Merged
wine-fall merged 1 commit into
mainfrom
zachg-0702--pr-ci
Jul 2, 2026
Merged

ci: add PR-convention checks + build/test workflow#3
wine-fall merged 1 commit into
mainfrom
zachg-0702--pr-ci

Conversation

@wine-fall

Copy link
Copy Markdown
Owner

What

Adds the repo's first CI, split into two workflows:

ci.yml — build + test (gates merges)

  • On PRs to main (and pushes to main).
  • python -m build (hatchling package build) + pytest (the fast, model-free suite — 75 tests against fakes/stubs, no real TTS model/LLM/network per DESIGN §11.1; integration tests excluded by default).
  • Matrix: Python 3.10 (the requires-python floor) and 3.13.

pr-conventions.yml + .github/scripts/check_pr.py — PR metadata

  1. Conventional Commits title on every PR (feat/fix/chore/docs/style/refactor/perf/test/build/ci/revert, with optional (scope) and !).
  2. Spec tag [spec NN] / [spec 03-01] in the title.
  3. Spec link in the description: a real specs/NN-*.md path that exists in the repo and whose number matches the title tag.

Rules 2–3 apply only to product-behavior PRs (feat/fix/perf/refactor); infra/meta types (ci/chore/docs/build/style/test/revert) are exempt — which is why this ci: PR and the README docs: PR pass. The checker is stdlib-only, mirroring scripts/check_source_language.py.

Verification

  • pytest → 75 passed locally; python -m build → builds sdist+wheel.
  • check_pr.py exercised across valid/invalid title, missing tag, missing/nonexistent spec path, tag↔path mismatch, and the meta-type exemptions.
  • This PR's own pr-conventions + ci checks run from the branch and should be green.

Follow-up (not in this PR)

Branch protection on main is being configured separately to make build-and-test (3.10), build-and-test (3.13), and check required before merge, and to enforce PR-only + squash merges.

AI coding brief

  • Original request: 给 repo 的 PR 写 CI 规则 — (1) Conventional-Commits title, (2) a mandatory [spec NN] tag, later refined to (3) a concrete, existing spec path linked in the PR description; plus build + test before merge.
  • Manual interventions: user asked for the spec to be linked as a real path in the description (added file-existence + tag/path consistency checks); split README and CI onto separate branches/PRs.
  • Retro: the requirement "every PR must tag a spec" needed an exemption for infra/docs PRs (they don't map to a feature spec) — stating that carve-out up front would have saved a refinement pass.

🤖 Generated with Claude Code

- ci.yml: build the package (python -m build) and run the fast, model-free
  test suite (pytest) on PRs to main, across Python 3.10 and 3.13.
- pr-conventions.yml + check_pr.py: enforce Conventional Commits titles on
  every PR; require a [spec NN] tag plus a real, matching specs/NN-*.md path
  in the description for product-behavior PRs (feat/fix/perf/refactor).
  Infra/meta types (ci/chore/docs/build/style/test/revert) are exempt from
  the spec requirement. Stdlib-only, mirroring check_source_language.py.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wine-fall
wine-fall merged commit 87e8edd into main Jul 2, 2026
3 checks passed
@wine-fall
wine-fall deleted the zachg-0702--pr-ci branch July 2, 2026 07:26
wine-fall added a commit that referenced this pull request Jul 14, 2026
Follow-up to the PR review: the specs still described the pre-PR interjection
model. Fix the drift — spec 01 §1 (Delivers #3) reorders to reflect
respond-then-barge-in; spec 03-02 §3.5/§4 drop the deleted `_play_interruptible`
/`_handle_user` names and the "cancel-and-resume" framing, restating the
music-vs-talk fork as one barge-in path with different targets (duck vs cut).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
wine-fall added a commit that referenced this pull request Jul 14, 2026
…24)

* feat(director): Steer + prepare-then-barge-in interjection [spec 01]

Consolidate the scattered `str | None` "interrupting line" into a first-class
`Steer` value object (text + intent), and change interjection timing from
immediate-cancel to prepare-then-barge-in: on a typed line the current audio
keeps playing while the reply is composed + synthesized, and the loop cuts over
only when the reply clip is ready — so an interjection no longer opens a
dead-air gap. A line that lands before the reply clip is ready merges into one
combined reply. All steer handling funnels through one path (`_run_voice` +
`_compose`), collapsing the two duplicated per-segment chaining loops.

Revises spec 01 §3.3 and resolves the §6 open question (was cancel-and-resume).

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

* fix(voice): kill sidecar on cancelled synth to avoid pipe desync [spec 02]

The Director's merge (spec 01 §3.3) can now cancel an in-flight synth when a
fresh line lands before the reply clip is ready. A cancelled synth left the
request written but its response unread — desyncing the stdio pipe exactly like
the existing timeout case, so every later call would read the stale response.
Kill the still-alive sidecar on cancellation (mirroring kill-on-timeout) so the
next call respawns clean. The remote backend is already cancel-safe (the
in-flight HTTP result is simply dropped).

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

* docs(spec): align 01/03-02 with prepare-then-barge-in + Steer

Follow-up to the PR review: the specs still described the pre-PR interjection
model. Fix the drift — spec 01 §1 (Delivers #3) reorders to reflect
respond-then-barge-in; spec 03-02 §3.5/§4 drop the deleted `_play_interruptible`
/`_handle_user` names and the "cancel-and-resume" framing, restating the
music-vs-talk fork as one barge-in path with different targets (duck vs cut).

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

* refactor(director): fold on-quit song stop into _run_voice [spec 01]

The music segment's trailing `if self._quit: await handle.stop()` moves into
`_run_voice`'s exit, so "hold the song" and "stop it on quit" live in one place
and `_play_music_segment` ends cleanly. No behavior change (regression:
test_quit_during_song_stops_the_handle).

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

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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