Skip to content

fix(ci): count only published-file commits in the unreleased-changes check - #425

Merged
jpr5 merged 2 commits into
mainfrom
fix/unreleased-check-published-paths
Sep 10, 2026
Merged

jpr5 merged 2 commits into
mainfrom
fix/unreleased-check-published-paths

Conversation

@jpr5

@jpr5 jpr5 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

The defect

.github/workflows/unreleased-check.yml warns when there are commits on main
since the last release tag that changed "source", counted as
git log v<ver>..HEAD -- 'src/'.

src/__tests__/ lives under src/, so test-only and drift-harness-only work
counted as unreleased source changes. On main @ 8b0485b it warned about 2
"source commits" (from #422 and #423) that touch only src/__tests__/drift/*,
drift-proposals/* and scripts/drift-sync*.ts — none of which is in the
published tarball (files is ["dist","fixtures",".claude-plugin","skills","CHANGELOG.md"],
and tsconfig.json excludes src/__tests__).

It is ::warning:: with no exit 1, so it blocked nothing — but a check that
fires for work that cannot be released is a check people learn to ignore.

The approach

The pathspec is now derived from package.json "files" rather than
hard-coded, so it cannot drift again when the published set changes:

  • dist is a build artifact and is not in git, so it is substituted with its
    git preimage — tsconfig.json's include roots minus its exclude entries.
    That is what drops src/__tests__/, and it follows the tsconfig rather than
    restating it.
  • every other files entry is a real tracked path and is used as-is.

Deriving from files alone was not possible (dist is not in git); deriving
src/ alone would have re-encoded the same thing that drifted. The pair —
files for the literal paths, tsconfig for dist's preimage — is the only
formulation where both halves are read from the declarations that actually
govern the tarball.

This also widens the check: fixtures/, skills/, .claude-plugin/ and
CHANGELOG.md all ship and were invisible to the old src/-only pathspec.

An empty derived pathspec is now a hard ::error:: + exit 1, because
git log -- with no paths silently matches every path.

Red / green

RED — old command, current tree:

::warning::2 source commits on main since v1.40.0 — version has not been bumped.

Unreleased commits:
c23c4f9 feat(drift-sync): close the classification loop — re-pin on apply, and add the exclude path
68e9253 fix(drift): classify gpt-image-2.5-flare/sunburst as excludeFamilies (image modality)

GREEN — new step body, same tree:

Published-file pathspec:
  src/
  :(exclude)node_modules/
  :(exclude)dist/
  :(exclude)src/__tests__/
  fixtures
  .claude-plugin
  skills
  CHANGELOG.md

No unreleased published-file changes since v1.40.0.

POSITIVE CONTROL — three throwaway commits on top of the fix (a real
src/logger.ts change, a skills/write-fixtures/SKILL.md change, and one
touching only scripts/drift-sync.ts + src/__tests__/drift/model-registry.ts):

::warning::2 published-file commits on main since v1.40.0 — version has not been bumped.

Unreleased commits:
1902279 test(control): skills change
f6f310a test(control): real src change

It still barks at the two real ones and ignores the tests+scripts one. Run
again with only the tests+scripts commit present, it reports clean.

What would still trip it

Any commit since the tag touching src/** other than src/__tests__/,
fixtures/, skills/, .claude-plugin/, or CHANGELOG.md.

Deliberately still does not trip it: package.json itself. A runtime
dependency bump does change the published package, but git cannot distinguish
it from a devDependency bump, and including package.json would fire on every
Renovate PR. This is unchanged from the old behaviour, not a new blind spot.

Tests

src/__tests__/unreleased-check-workflow.test.ts executes the step's own
run: body under bash against synthetic git repos — 11 guards, including the
positive controls above and the empty-pathspec refusal. Mutation-tested:
reverting the workflow to -- 'src/' turns 7 of the 11 red.

Gates

actionlint (this file) 0 · prettier --check . 0 · eslint . 0 ·
pnpm typecheck 0 · vitest run 0 (183 files, 5686 tests) ·
commitlint --from origin/main --to HEAD 0.

Repo-wide actionlint exits 1 on 8 pre-existing info-level SC2086 findings in
other workflows — byte-identical at 8b0485b, none in this file.

…check

`src/__tests__/` lives under `src/`, so the check's `git log v<ver>..HEAD --
'src/'` counted test-only and drift-harness-only commits as unreleased source
changes. On `main` @ 8b0485b it warned about 2 "source commits" that touch only
`src/__tests__/drift/*`, `drift-proposals/*` and `scripts/drift-sync*.ts` —
none of which is in the published tarball. A warning that fires for work that
cannot be released is a warning people learn to ignore.

The pathspec is now derived from `package.json` "files" instead of being
hard-coded, so it cannot drift again when the published set changes. `dist` is
a build artifact and is not in git, so it is substituted with its git preimage
— tsconfig's `include` roots minus its `exclude` entries — which is what drops
`src/__tests__/`. Every other "files" entry is a tracked path and is used
as-is, which also widens the check to `fixtures/`, `skills/`, `.claude-plugin/`
and `CHANGELOG.md`: those ship, and the old `src/`-only pathspec missed them.

An empty derived pathspec is now a hard error, because `git log -- ` with no
paths silently matches every path.
Executes the workflow step's own `run:` body under bash against synthetic git
repositories, so the guards are behavioural rather than text-shape: a test-only
commit under `src/__tests__/` must not count, and — the half that matters more
— a real `src/*.ts`, `skills/`, `fixtures/` or `CHANGELOG.md` commit still
must. A check that stopped crying wolf by no longer barking at all would be a
worse bug than the one being fixed.

Also pins that an underivable published-file set is a hard error rather than an
empty pathspec (which `git log` reads as "every path"), and that the extracted
body is a literal substring of the committed workflow, so an extractor that
paraphrases cannot make these vacuous.

Mutation-tested: reverting the workflow to the `-- 'src/'` pathspec turns 7 of
the 11 guards red.
@pkg-pr-new

pkg-pr-new Bot commented Sep 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@copilotkit/aimock@425

commit: 812e2f7

@jpr5
jpr5 merged commit 0297934 into main Sep 10, 2026
32 checks passed
@jpr5
jpr5 deleted the fix/unreleased-check-published-paths branch September 10, 2026 22:39
@jpr5 jpr5 mentioned this pull request Sep 11, 2026
jpr5 added a commit that referenced this pull request Sep 11, 2026
Cuts the accumulated `[Unreleased]` work. **MINOR** — a new provider
surface (BytePlus Ark video) and new endpoints, no breaking changes.

**Prepared, not merged.** `publish-release.yml` fires on push-to-main,
so merging this publishes to npm, tags `v1.41.0`, cuts the GitHub
Release, dispatches the Docker build, and posts to Slack. Merge when you
want it live.

## What ships

Only **#424** (plus its follow-up **#429**, which fixes the same
never-released BytePlus code) touches the published package. Verified
against `package.json` `files` + `tsconfig` include/exclude:

```
git log v1.40.0..origin/main --oneline -- src/ ':(exclude)src/__tests__/' fixtures/ .claude-plugin/ skills/ CHANGELOG.md
```

…returns byteplus commits only. #422, #423, #425, #426, #427, #428 touch
scripts/, .github/ and docs/ exclusively and are deliberately **not** in
the CHANGELOG.

### Added
- BytePlus Ark (Seedance) video record/replay — submit, poll and
retrieve, stored as the raw Ark task envelope
- `--provider-byteplus` flag

### Changed
- `/api/v3` chat and image requests are attributed to the `byteplus`
provider
- `aimock-pytest` pin moves to 1.41.0

### Fixed
- Startup error when a BytePlus provider base already ends in `/api/v3`

## Version surfaces — seven, all bumped

Found by grepping the tree for `1.40.0`, not from a checklist. **Zero
occurrences of the old string remain** (excluding `CHANGELOG.md`
history, `fixtures/` and `pnpm-lock.yaml`):

| File | Field | 1.40.0 → 1.41.0 |
| --- | --- | --- |
| `package.json` | `version` | ✔ |
| `charts/aimock/Chart.yaml` | `appVersion` (chart `version` stays
`0.1.0`) | ✔ |
| `.claude-plugin/plugin.json` | `version` | ✔ |
| `.claude-plugin/marketplace.json` | `plugins[0].source.version`
(`^1.41.0`) | ✔ |
| `docs/index.html` | demo banner `aimock v…` | ✔ |
| `packages/aimock-pytest/src/aimock_pytest/_version.py` |
`AIMOCK_VERSION` npm pin | ✔ |
| `packages/aimock-pytest/README.md` | `--aimock-version` default | ✔ |

`AIMOCK_VERSION` **must** move this release:
`/api/v3/contents/generations/tasks` is a new server route, so a
default-download pytest user on the 1.40.0 pin would run a server
without it. `packages/aimock-pytest/pyproject.toml` is deliberately
untouched — that package versions on its own PyPI cadence.

There is **no version constant in `src/cli.ts`** and **no
`metadata.version` in `marketplace.json`** in this tree; both surfaces
exist only in the release checklist, not in the repo.

## Drive-by: the npm description has been `<div align="center">` since
the README got a centered header

`npm view @copilotkit/[email protected] description` returns the literal
string `<div align="center">`.

Both README-subtitle extractors — the inline `node -e` in
`publish-release.yml` and `syncDescriptionFromReadme()` in
`scripts/drift-sync.ts` — skip `#`, `[`, `![` and `http` lines but not
raw HTML, so they latch onto the README's opening `<div>` wrapper
instead of the bold subtitle two lines below. Both now also skip `<`,
and `package.json.description` is synced to what the fixed extractor
yields:

> Mock infrastructure for AI application testing — point your SDK at one
local port and every provider, protocol, and service answers
deterministically.

Without this the v1.41.0 npm page ships the same broken description.

## Gates (raw exit codes, local)

| Gate | Exit |
| --- | --- |
| `prettier --check .` | 0 |
| `npx eslint .` | 0 |
| `pnpm typecheck` | 0 |
| `npx vitest run` (5794 passed, 46 skipped, 189 files) | 0 |
| `pnpm build` | 0 |
| `npx commitlint --from origin/main --to HEAD` | 0 |

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01AvkmhXVLqSSEW6FvPQHSu5
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