diff --git a/.socraticodecontextartifacts.json b/.socraticodecontextartifacts.json index 0424de9..1d96d52 100644 --- a/.socraticodecontextartifacts.json +++ b/.socraticodecontextartifacts.json @@ -163,7 +163,7 @@ { "name": "dependency-contract", "path": "./pyproject.toml", - "description": "Project and tooling contract. The co-core / co-core-aio / co-core-sync pins (>=0.50.0,<0.51 since #211's two-minor catch-up, locked at 0.50.0; 0.48.0 was #206's catch-up; 0.46.0 was #199's catch-up; 0.45.0 was #192's catch-up; 0.44.0 was #184's three-minor catch-up, the first on the co-pypi index; 0.41.0 was #179's catch-up; 0.40.1 was #177's, for #63's render field; 0.40.0 was #172's catch-up; 0.39 was #153's, ahead of #138's capture consumer; 0.37 was #136's, for FetchPolicyState.generation and fetch_policy_supersedes; 0.36 was #140's catch-up; each raise's wheel diff covers the whole import closure; 0.19.6 brought the content.persist contract, cannobserv#493, and 0.19.3 the shared content-addressed BlobStore, cannobserv#475) with no extra on co-core (its [extract] parsers were unused, dropped by #142) and [bus,gcs] / [gcs] on the other two, the floor history that explains each raise, the explicit co-pypi [[tool.uv.index]] with a [tool.uv.sources] entry per co-core package (#183), the ruff rule set and its skills-vendor exclusion, the ty exclusion, the replicator-worker console script, pytest configuration (asyncio auto mode, the integration and gcs markers both deselected by default, timeout) and the 80% coverage gate. The [build-system] uv_build bound is one minor (>=0.13.0,<0.14 since #195), mirrored by ci.yml's setup-uv version: inputs." + "description": "Project and tooling contract. The co-core / co-core-aio / co-core-sync pins (>=0.51.1,<0.52 since #216, for cannobserv#577's fetch credential references, locked at 0.51.1; 0.50.0 was #211's catch-up; 0.48.0 was #206's catch-up; 0.46.0 was #199's catch-up; 0.45.0 was #192's catch-up; 0.44.0 was #184's three-minor catch-up, the first on the co-pypi index; 0.41.0 was #179's catch-up; 0.40.1 was #177's, for #63's render field; 0.40.0 was #172's catch-up; 0.39 was #153's, ahead of #138's capture consumer; 0.37 was #136's, for FetchPolicyState.generation and fetch_policy_supersedes; 0.36 was #140's catch-up; each raise's wheel diff covers the whole import closure; 0.19.6 brought the content.persist contract, cannobserv#493, and 0.19.3 the shared content-addressed BlobStore, cannobserv#475) with no extra on co-core (its [extract] parsers were unused, dropped by #142) and [bus,gcs] / [gcs] on the other two, the floor history that explains each raise, the explicit co-pypi [[tool.uv.index]] with a [tool.uv.sources] entry per co-core package (#183), the ruff rule set and its skills-vendor exclusion, the ty exclusion, the replicator-worker console script, pytest configuration (asyncio auto mode, the integration and gcs markers both deselected by default, timeout) and the 80% coverage gate. The [build-system] uv_build bound is one minor (>=0.13.0,<0.14 since #195), mirrored by ci.yml's setup-uv version: inputs." }, { "name": "release-deploy-hooks", diff --git a/AGENTS.md b/AGENTS.md index a80f266..c37d94c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,7 +26,7 @@ Override vendored `brainstorming`'s defaults: Python ≥3.12, uv, pytest, ruff. `ty` (`uv run ty check`) is a **non-gating** type checker — no pre-commit or CI gate. -**co-core comes from the private co-pypi index, not PyPI.** `uv lock` and a cold `uv sync` need its token: `bash scripts/co-pypi.sh uv …`, never the writer's ADC. Pin the current minor — `>=0.50.0,<0.51` — and raise the **patch** floor with every co-core feature the code starts depending on. Both, and each skew so far: [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md). +**co-core comes from the private co-pypi index, not PyPI.** `uv lock` and a cold `uv sync` need its token: `bash scripts/co-pypi.sh uv …`, never the writer's ADC. Pin the current minor — `>=0.51.1,<0.52` — and raise the **patch** floor with every co-core feature the code starts depending on. Both, and each skew so far: [docs/DEPENDENCIES.md](docs/DEPENDENCIES.md). ## Code Exploration Policy diff --git a/docs/DEPENDENCIES.md b/docs/DEPENDENCIES.md index a1c6494..a528e6b 100644 --- a/docs/DEPENDENCIES.md +++ b/docs/DEPENDENCIES.md @@ -93,11 +93,11 @@ fetcher or `uv lock` asks the index. ## The co-core pin, and why the patch floor is load-bearing -Pin the current minor — `>=0.50.0,<0.51`, on all three. The **patch** floor is load-bearing, not tidiness: the change-bus payloads are `extra="ignore"`, so on an older wheel a model constructed with fields it does not have yet succeeds and silently discards them. Raise the floor with every co-core feature the code starts depending on, or a version skew publishes facts that look right and carry nothing (#10). Both floors since fail *loudly* instead — a ValidationError at construction (0.8.0 requires `info_source_id` on all three fetch payloads, #19/#28) or an ImportError at load, never reaching a running worker (0.9.4 cuts the replicate contracts, #29; 0.19.3 ships the shared `BlobStore`, #114; 0.19.6 cuts the persist contract, #114 step 6). +Pin the current minor — `>=0.51.1,<0.52`, on all three. The **patch** floor is load-bearing, not tidiness: the change-bus payloads are `extra="ignore"`, so on an older wheel a model constructed with fields it does not have yet succeeds and silently discards them. Raise the floor with every co-core feature the code starts depending on, or a version skew publishes facts that look right and carry nothing (#10). Both floors since fail *loudly* instead — a ValidationError at construction (0.8.0 requires `info_source_id` on all three fetch payloads, #19/#28) or an ImportError at load, never reaching a running worker (0.9.4 cuts the replicate contracts, #29; 0.19.3 ships the shared `BlobStore`, #114; 0.19.6 cuts the persist contract, #114 step 6). **The 0.10 → 0.13 jump (#77) was the first departure from "pin the current minor", and what justified it is evidence rather than judgement.** The hazard that rule guards is payload fields moving under `extra="ignore"`; every module this service imports proved byte-identical between the two wheels — `pure/models/changes.py`, `pure/adapters/bus/{envelope,exceptions}.py`, `effects/{bus,fetch,gcs}.py`, `pure/util/{hashing,gcs}.py`, and all of `co_core_aio` bar its `__version__`. Only `streams.py` gained anything (`group_name`, `stream_kind` — cannobserv#384), and Replicator imports no `co_v1` adapter, which is where 0.13.2's other changes landed. That `diff -rq` of both wheels from the then-wheelhouse took a minute and turned a deferred change into a safe one. -**Diff the import closure before every pin move**, a single minor included: #136 needed it for one. The version distance is not the risk, the moved surface is, and the import lines are not the surface. At 0.19 → 0.36 (#140), `changes.py`'s import of `extract.canonical` brought in the `pure/extract` package, which had changed (cannobserv#523), and no import line in Replicator names it. `scripts/co_core_closure_diff.py OLD NEW` (#145) walks the closure from `src/` and `scripts/` through all three wheels at each version, fetched first ([Moving the pin](#moving-the-pin)). It prints the counts, a verdict per file that isn't identical, the Requires-Dist delta and the closure's third-party imports, and `--diff` adds each changed file's code diff. Paste the report into the pin comment and write the reasons around it by hand. `version-only` and `docstrings-only` need no reading. `changed` does, a model under `extra="ignore"` above all. `added` and `removed` are modules joining or leaving the closure. An **Unresolved imports** line names a module that is imported but isn't in the wheel, which fails at import. A **Not parsed** line names a file whose imports the walk couldn't follow. Each prints only when there's something to list. The walk follows `TYPE_CHECKING` imports and lists dynamic ones without following them. At 0.50.0 that's co-core-sync's two lazy `__getattr__` sites in `drivers/` and `drivers/blobstore/`. Both are expected, because each target is named again under `TYPE_CHECKING`. A new site whose targets aren't named there is a gap to read by hand. Flags: `--root`, `--package`, `--wheels` (required); the defaults are this repo's. +**Diff the import closure before every pin move**, a single minor included: #136 needed it for one. The version distance is not the risk, the moved surface is, and the import lines are not the surface. At 0.19 → 0.36 (#140), `changes.py`'s import of `extract.canonical` brought in the `pure/extract` package, which had changed (cannobserv#523), and no import line in Replicator names it. `scripts/co_core_closure_diff.py OLD NEW` (#145) walks the closure from `src/` and `scripts/` through all three wheels at each version, fetched first ([Moving the pin](#moving-the-pin)). It prints the counts, a verdict per file that isn't identical, the Requires-Dist delta and the closure's third-party imports, and `--diff` adds each changed file's code diff. Paste the report into the pin comment and write the reasons around it by hand. `version-only` and `docstrings-only` need no reading. `changed` does, a model under `extra="ignore"` above all. `added` and `removed` are modules joining or leaving the closure. An **Unresolved imports** line names a module that is imported but isn't in the wheel, which fails at import. A **Not parsed** line names a file whose imports the walk couldn't follow. Each prints only when there's something to list. The walk follows `TYPE_CHECKING` imports and lists dynamic ones without following them. At 0.51.1 that's co-core-sync's two lazy `__getattr__` sites in `drivers/` and `drivers/blobstore/`. Both are expected, because each target is named again under `TYPE_CHECKING`. A new site whose targets aren't named there is a gap to read by hand. Flags: `--root`, `--package`, `--wheels` (required); the defaults are this repo's. ## The build backend's bound, and CI's uv diff --git a/pyproject.toml b/pyproject.toml index db91d26..15bfef2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,78 @@ license = "MIT" license-files = ["LICENSE"] requires-python = ">=3.12" dependencies = [ - # Floor is 0.50.0, and it carries no new feature: a two-minor catch-up + # Floor is 0.51.1, for cannobserv#577's fetch credential references (#216): + # `ContentFetchCommand.credential_headers` and `validate_fetch_credential`. + # The lock takes 0.51.1, the index's newest with the bound opened to `<1` + # [measured 2026-11-23]. `co-core-aio` and `co-core-sync` 0.51.1 require + # `co-core>=0.51.1,<0.52`, so the three move together. Nothing reads the + # field until #216's build lands: the canonical class is `extra="ignore"`, + # so on this pin a credentialed frame decodes and is fetched without its + # credential, as on 0.50.0. + # + # **`scripts/co_core_closure_diff.py 0.50.0 0.51.1`** (#145), verbatim, from + # the wheels this lock pins (their sha256 matched against `uv.lock`): + # + # ## Import closure, 0.50.0 → 0.51.1 + # + # Roots `src`, `scripts`; packages `co_core`, `co_core_aio`, `co_core_sync`. + # + # 58 files at 0.50.0, 58 at 0.51.1. 8 not identical: + # + # - `version-only` co_core/__init__.py + # - `docstrings-only` co_core/pure/extract/__init__.py + # - `changed` co_core/pure/extract/errors.py + # - `changed` co_core/pure/extract/extraction_defaults.py + # - `changed` co_core/pure/models/changes.py + # - `changed` co_core/pure/util/aliases.py + # - `version-only` co_core_aio/__init__.py + # - `version-only` co_core_sync/__init__.py + # + # **Requires-Dist:** + # + # - co_core: unchanged + # - co_core_aio: removed `co-core<0.51,>=0.50`; added `co-core<0.52,>=0.51.1` + # - co_core_sync: removed `co-core<0.51,>=0.50`; added `co-core<0.52,>=0.51.1` + # + # **Third-party imports** (at 0.51.1): `google`, `google_auth_oauthlib`, `googleapiclient`, `httpx`, `pydantic`, `redis`, `requests`, `urllib3`. + # + # **Dynamic imports, not followed:** + # + # - co_core_sync/drivers/__init__.py:89 `import_module(f"{__name__}.{module}")` + # - co_core_sync/drivers/blobstore/__init__.py:32 `import_module(f"{__name__}.{module}")` + # + # Read by hand (`--diff`; per-step diffs place each change): + # + # - `pure/models/changes.py` (0.51.1) is additive. + # `ContentFetchCommand.credential_headers: dict[str, str] | None = None`; + # `ContentFetchCommandEmit` gains `hide_input_in_errors` and E1-E5's + # refusals (a credential under `render="browser"`, a reference off + # `fetch-`, one name twice, `user-agent` or a conditional validator, + # a name also in `headers`); two `FetchFailedEvent.reason` registry + # docstrings (`credential_unknown`, `credential_refused`). The canonical + # class refuses none of these, so a malformed map reaches the consumer. + # - `pure/util/aliases.py` (0.51.1) is additive: `CredentialKind`, + # `credential_kind`, `FETCH_CREDENTIAL_PATTERN`/`_RE`, + # `validate_fetch_credential`. `CREDENTIALS_ALIAS_PATTERN` keeps its text, + # so `ALIAS_NAME_PATTERN`'s pin (`src/worker/aliases.py`) still holds + # [measured: equal strings]. + # - `pure/extract/errors.py` and `extraction_defaults.py` (0.51.0) add + # `include_description` (cannobserv#559): `refuse_unhonoured` takes a new + # required keyword. Loaded only through `changes.py`'s import of + # `extract.canonical`; nothing in `src/`, `scripts/` or `tests/` calls into + # `co_core.pure.extract` [grep]. + # + # Outside the closure, by whole-wheel diff [measured; the CHANGELOG is not + # the source]: 0.51.0 and 0.51.1 change nine co/v1 adapters, + # `adapters/wordpress/transcript.py`, five `extract` parsers, + # `models/assignment.py`, `workflows/legislative_session.py` and eleven + # co-core-sync `services/`; nothing is added or removed. Nothing in `src/`, + # `scripts/` or `tests/` reaches any of them; the closure is the same with + # `tests/` as a root. + # + # Previously: + # + # Floor was 0.50.0, and it carried no new feature: a two-minor catch-up # (#211), in #206's shape. The lock takes 0.50.0, the index's newest with the # bound opened to `<1` [measured 2026-11-18]. `co-core-aio` and `co-core-sync` # 0.50.0 require `co-core>=0.50,<0.51`, so the three move together. Both @@ -504,9 +575,9 @@ dependencies = [ # at module load, so a skew cannot reach a running worker at all. Additive over # 0.8.0 for everything the fetch path uses — no field on ContentFetchCommand, # BlobAvailableEvent or FetchFailedEvent moved between the two. - "co-core>=0.50.0,<0.51", - "co-core-aio[bus,gcs]>=0.50.0,<0.51", - "co-core-sync[gcs]>=0.50.0,<0.51", + "co-core>=0.51.1,<0.52", + "co-core-aio[bus,gcs]>=0.51.1,<0.52", + "co-core-sync[gcs]>=0.51.1,<0.52", "fastapi>=0.165.0,<1", "pydantic>=2.14.4,<3", "pydantic-settings>=2.16.3,<3", diff --git a/tests/test_dependency_index.py b/tests/test_dependency_index.py index bcb030b..d4222e4 100644 --- a/tests/test_dependency_index.py +++ b/tests/test_dependency_index.py @@ -60,7 +60,7 @@ def test_every_file_from_the_index_is_hashed_and_there_is_a_wheel(): def test_the_locked_versions_sit_inside_the_pin(): - """The index lists nothing past 0.50.0 [measured 2026-11-18, #211]; the pin's + """The index lists nothing past 0.51.1 [measured 2026-11-23, #216]; the pin's upper bound keeps the next minor out until the change that moves it.""" pins = { (r := Requirement(spec)).name: r.specifier @@ -69,7 +69,7 @@ def test_the_locked_versions_sit_inside_the_pin(): } for package in _from_index(): assert package["version"] in pins[package["name"]], package - assert package["version"] not in SpecifierSet(">=0.51"), package + assert package["version"] not in SpecifierSet(">=0.52"), package def test_no_other_source_kind_names_a_wheelhouse(): diff --git a/uv.lock b/uv.lock index 142747a..3c0e924 100644 --- a/uv.lock +++ b/uv.lock @@ -285,28 +285,28 @@ wheels = [ [[package]] name = "co-core" -version = "0.50.0" +version = "0.51.1" source = { registry = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/simple/" } dependencies = [ { name = "dateparser" }, { name = "pydantic" }, ] -sdist = { url = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/co-core/co_core-0.50.0.tar.gz", hash = "sha256:4951a9b29c42491eaf7179715a79ebd26e15202ee866889cc75f36c0e979a369" } +sdist = { url = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/co-core/co_core-0.51.1.tar.gz", hash = "sha256:0ea6e42d708d458eb7fdcca4494f132f5451a843d25a806b36d96f649e78764d" } wheels = [ - { url = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/co-core/co_core-0.50.0-py3-none-any.whl", hash = "sha256:1a4f763e9809b07f439864f818adc9105384d588f365865c2d8d6a632fb1f97e" }, + { url = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/co-core/co_core-0.51.1-py3-none-any.whl", hash = "sha256:cad8632b11ecfd8810cfaafd1f2041934d17edbc30d3ccc08c24f5a40a4bd087" }, ] [[package]] name = "co-core-aio" -version = "0.50.0" +version = "0.51.1" source = { registry = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/simple/" } dependencies = [ { name = "co-core" }, { name = "httpx" }, ] -sdist = { url = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/co-core-aio/co_core_aio-0.50.0.tar.gz", hash = "sha256:17b862c22cebb95ecd2ad43de5bd5b521ef3c352521ed1fda5f1b417a3df82cf" } +sdist = { url = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/co-core-aio/co_core_aio-0.51.1.tar.gz", hash = "sha256:881fce7ea6e5648a4092f3732776f147ca0abfe51bdd4ab47a5e97bb08ac4554" } wheels = [ - { url = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/co-core-aio/co_core_aio-0.50.0-py3-none-any.whl", hash = "sha256:8b09dca9816a93b11212919d773f6657c3b45ab920b036000e43cbeaf91ac135" }, + { url = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/co-core-aio/co_core_aio-0.51.1-py3-none-any.whl", hash = "sha256:4835d85f72659cfda2e603de88ad4035875473d09b0afccb9ad386e7da23ce12" }, ] [package.optional-dependencies] @@ -320,16 +320,16 @@ gcs = [ [[package]] name = "co-core-sync" -version = "0.50.0" +version = "0.51.1" source = { registry = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/simple/" } dependencies = [ { name = "co-core" }, { name = "requests" }, { name = "urllib3" }, ] -sdist = { url = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/co-core-sync/co_core_sync-0.50.0.tar.gz", hash = "sha256:024fa15b493b5a42e720131be9d31957a803908cbbb733801f0aae8ffd83b66a" } +sdist = { url = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/co-core-sync/co_core_sync-0.51.1.tar.gz", hash = "sha256:1485be9960fc9940d2a8f455a9fde5761d24d51a15cc1b598886780706d4b8fc" } wheels = [ - { url = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/co-core-sync/co_core_sync-0.50.0-py3-none-any.whl", hash = "sha256:4e7802e461657c2b19d9c753a43be6d171dabc47ec19090ac87cf4a60c0b1613" }, + { url = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/co-core-sync/co_core_sync-0.51.1-py3-none-any.whl", hash = "sha256:a93fcc9c76b5dddf6adca5f59ba15de08a93c66c3e909a8c3e62b8518c288019" }, ] [package.optional-dependencies] @@ -1403,9 +1403,9 @@ dev = [ [package.metadata] requires-dist = [ - { name = "co-core", specifier = ">=0.50.0,<0.51", index = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/simple/" }, - { name = "co-core-aio", extras = ["bus", "gcs"], specifier = ">=0.50.0,<0.51", index = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/simple/" }, - { name = "co-core-sync", extras = ["gcs"], specifier = ">=0.50.0,<0.51", index = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/simple/" }, + { name = "co-core", specifier = ">=0.51.1,<0.52", index = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/simple/" }, + { name = "co-core-aio", extras = ["bus", "gcs"], specifier = ">=0.51.1,<0.52", index = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/simple/" }, + { name = "co-core-sync", extras = ["gcs"], specifier = ">=0.51.1,<0.52", index = "https://us-west1-python.pkg.dev/co-gcs/co-pypi/simple/" }, { name = "fastapi", specifier = ">=0.165.0,<1" }, { name = "playwright", specifier = "==1.64.1" }, { name = "pydantic", specifier = ">=2.14.4,<3" },