Skip to content

Commit 5cfd1ae

Browse files
committed
fix(ci): stabilize optional dependency resolution
1 parent f11fd59 commit 5cfd1ae

11 files changed

Lines changed: 188 additions & 10 deletions

‎docs/PROJECT_CLOSURE.md‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ rehearsal and third-party penetration test.
5858
## Обязательные внешние closure gates
5959

6060
- closing commits `59fc19c` (Operator/Kafka reproducibility) and `72b9609`
61-
(Python compatibility/core lock remediation) published to `main`; the final
62-
core-only/Ruff/runtime-image hardening commit remains to be published;
61+
(Python compatibility/core lock remediation), plus `f11fd59`
62+
(core-only/Ruff/runtime-image hardening), are published to `main`;
6363
- all required GitHub checks green on the exact closing SHA;
6464
- two open Dependabot PRs receive a final one-by-one disposition;
6565
- the substantial post-v2 changes receive a final release/version decision and
@@ -74,9 +74,19 @@ Push, PR mutations and release actions require explicit owner authorization.
7474
core-only API import without `pyiceberg`) are fixed and locally verified.
7575
- The Security Scan findings were traced to packages vendored by runtime
7676
`pip`; the final image now removes installer tooling after `pip check`.
77+
- CI on `f11fd59` passed every separate workflow and every early main-CI gate,
78+
then exposed two upstream-resolution boundaries: PyIceberg 0.11 writes
79+
without native core and MCP 2.0 breaking the 1.x integration API. The
80+
candidate now resolves `pyiceberg-core==0.7.0` across Python 3.11–3.13 and
81+
constrains MCP to `<2`; `2170` local unit/property tests and all `39`
82+
selected clean-Mac dependency tests pass. See
83+
[dependency-compatibility-2026-07-30.md](dependency-compatibility-2026-07-30.md).
7784
- Independent Mac image validation reports zero HIGH/CRITICAL findings with
7885
Trivy 0.70.0; see
7986
[security-runtime-image-trivy-2026-07-30.md](security-runtime-image-trivy-2026-07-30.md).
87+
- Per owner allocation, Codex performed the dependency remediation,
88+
documentation, Mac verification, and Git closeout; Grok/Grokw remained
89+
paused to preserve its remaining weekly quota.
8090
- Production status remains `candidate`; none of this closes the live Iceberg,
8191
restore/replay, fresh soak/rollback, external pen-test, or npm approval gates.
8292

‎docs/STATUS.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ Closing CI hardening on 2026-07-30 also verified the Python 3.11/3.12/3.13
2626
compatibility lanes, made `pyiceberg` optional for the core-only API path,
2727
aligned SDK examples with Ruff 0.16 Markdown formatting, and removed
2828
`pip`/`setuptools`/`wheel` from the final API image after `pip check`.
29+
A later dependency-resolution gate now keeps the Iceberg write path complete
30+
with Python 3.13-compatible `pyiceberg-core==0.7.0` and holds the optional MCP
31+
integration on its supported 1.x API.
2932
A clean core-only HTTP smoke returned 200 for health, entity, and NL query.
3033
An independent Mac rebuild scanned with Trivy 0.70.0 at zero HIGH/CRITICAL
3134
findings; see
3235
[security-runtime-image-trivy-2026-07-30.md](security-runtime-image-trivy-2026-07-30.md).
36+
The dependency failure, resolution, and clean Mac verification are recorded in
37+
[dependency-compatibility-2026-07-30.md](dependency-compatibility-2026-07-30.md).
3338
The exact post-remediation GitHub SHA must still complete all required checks
3439
before the external closure gate is claimed.
3540

@@ -53,6 +58,7 @@ recorded in [PROJECT_CLOSURE.md](PROJECT_CLOSURE.md).
5358
| Clean-checkout PyFlink OCI build + submission smoke | PASS clean-checkout OCI build + submission smoke on 2026-07-30 — image built, JobID `RUNNING`, not Operator/E2E | [perf/golden-flink-submission-2026-07-30.md](perf/golden-flink-submission-2026-07-30.md) |
5459
| Flink Kubernetes Operator + Helm golden deploy | PASS clean kind Operator/Helm deploy of verified image on exact HEAD `36ed1ec` — CR/job stable, checkpoints `2→23`, leader flaps `0`, not lake E2E | [perf/golden-operator-acceptance-2026-07-30.md](perf/golden-operator-acceptance-2026-07-30.md) |
5560
| Hardened API runtime image (local acceptance) | core-only API import/HTTP smoke PASS; Trivy 0.70.0 reports 0 HIGH/CRITICAL after runtime installer removal | [security-runtime-image-trivy-2026-07-30.md](security-runtime-image-trivy-2026-07-30.md) |
61+
| Python cloud/MCP dependency compatibility (local + isolated Mac) | 2170 unit/property tests PASS; MCP 1.29 + PyIceberg 0.11.1/core 0.7.0 clean environment and 39 focused tests PASS | [dependency-compatibility-2026-07-30.md](dependency-compatibility-2026-07-30.md) |
5662

5763
## 2026-07-23 audit closure
5864

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Dependency compatibility remediation — 2026-07-30
2+
3+
## Scope
4+
5+
This record covers the Python cloud/Iceberg and optional MCP dependency
6+
boundaries discovered by the final CI run. It does not claim production
7+
acceptance or replace the remaining live golden-topology gates.
8+
9+
After the owner asked to preserve the remaining Grok/Grokw weekly quota, Codex
10+
performed all diagnosis, remediation, Mac verification, documentation, and Git
11+
closeout work described here. Grok was not invoked for this remediation.
12+
13+
## Trigger
14+
15+
GitHub Actions CI run
16+
[`30573486366`](https://github.com/brownjuly2003-code/agentflow/actions/runs/30573486366)
17+
tested commit `f11fd59fea61fc7bf29d3fa8f8c41139c236cfb4`. Its lint,
18+
lock, SDK, Terraform, schema, Helm, and Python 3.11/3.12/3.13 compatibility
19+
gates passed. Separate Contract, E2E, Flink Smoke, Load, Security Scan,
20+
Scorecard, and Staging Deploy workflows also passed.
21+
22+
Two dependency boundaries still failed:
23+
24+
- the integration job resolved `pyiceberg==0.11.1` without
25+
`pyiceberg-core`; five Iceberg write/materialization tests raised
26+
`NotInstalledError`;
27+
- `integrations[mcp]` allowed an unbounded major upgrade, so the unit job
28+
resolved `mcp==2.0.0`; that release removed the MCP 1.x `Tool.inputSchema`
29+
model field and low-level `Server.list_tools()` decorator used by the
30+
integration.
31+
32+
## Remediation
33+
34+
The cloud extra now installs:
35+
36+
```toml
37+
"pyiceberg>=0.7,<1",
38+
"pyiceberg-core>=0.7,<0.8",
39+
```
40+
41+
PyIceberg 0.11 uses the native package for partition transforms and table
42+
appends. The previously selected core 0.8 distribution excludes Python 3.13;
43+
core 0.7 provides a stable-ABI wheel across the supported Python 3.11–3.13
44+
matrix. `uv.lock` and the hash-locked Docker export both resolve
45+
`pyiceberg-core==0.7.0`.
46+
47+
The MCP extra now declares `mcp>=1.0,<2`. This preserves the integration's
48+
documented MCP 1.x API instead of silently accepting a breaking major release.
49+
A unit dependency contract pins both boundaries so future configuration or
50+
lock drift fails before the runtime jobs.
51+
52+
## Verification
53+
54+
- RED contract stage: two new dependency contracts failed against the old
55+
declarations.
56+
- GREEN targeted stage: `38 passed` locally across dependency contracts, MCP,
57+
and non-Docker Iceberg scenarios.
58+
- Full Windows Python 3.13 unit/property suite: `2170 passed, 1 warning`.
59+
- `uv 0.8.23`: `uv lock --check` passed; the generated lock/export diff adds
60+
only `pyiceberg-core==0.7.0`.
61+
- Isolated Mac clone:
62+
`/tmp/agentflow-ci-f11-codex-deps-01`, based on exact `f11fd59` plus the
63+
five candidate dependency files.
64+
- Clean Mac Python 3.13 environment:
65+
`mcp==1.29.0`, `pyiceberg==0.11.1`,
66+
`pyiceberg-core==0.7.0`, and `pip check` passed.
67+
- Mac contract/MCP/Iceberg selection: all `39` tests passed, including the
68+
Docker REST-catalog materialization case.
69+
- Direct OSV queries for the three resolved packages returned no vulnerability
70+
records.
71+
72+
The changed Docker lock was also rebuilt through `Dockerfile.api` on Mac:
73+
74+
```text
75+
agentflow-api:security-codex-f11deps-01
76+
manifest list sha256:95254620bf98e73ce89feae28e0b178a3cf00956c7e63eedd40f8958705645d1
77+
```
78+
79+
The build installed `pyiceberg-core==0.7.0`, completed `pip check`, and then
80+
removed `pip`, `setuptools`, and `wheel`. Runtime API import returned
81+
`AgentFlow Query API`; `python -m pip` remained absent. Trivy `0.70.0` with
82+
`HIGH,CRITICAL`, `--ignore-unfixed`, and `--exit-code 1` exited `0`; every
83+
reported OS and Python package row was clean.
84+
85+
## Evidence boundary
86+
87+
This is local and isolated-Mac acceptance of the dependency candidate. The
88+
exact pushed source state must still complete the repository's GitHub CI and
89+
Security Scan. Published-image signing, external penetration testing, live
90+
lake-to-serving materialization, restore/replay, and soak/rollback remain
91+
separate gates.

‎docs/release-readiness.md‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,16 @@ The 2026-07-30 closing remediation additionally covers two clean-install
8787
boundaries: the core-only API imports and serves health/entity/query without
8888
the optional `pyiceberg` package, and the final API image removes
8989
`pip`/`setuptools`/`wheel` after its hash-locked install and `pip check`.
90+
The cloud profile separately includes `pyiceberg-core==0.7.0`, whose
91+
stable-ABI build supports the full Python matrix and restores PyIceberg 0.11
92+
write transforms; the optional MCP integration is capped below the breaking
93+
2.0 API. Clean Mac Python 3.13 verification passed with MCP 1.29 and all 39
94+
selected contract/MCP/Iceberg tests.
9095
Independent Mac validation with Trivy 0.70.0 reported zero HIGH/CRITICAL
9196
findings; details and evidence limits are in
92-
[security-runtime-image-trivy-2026-07-30.md](security-runtime-image-trivy-2026-07-30.md).
97+
[security-runtime-image-trivy-2026-07-30.md](security-runtime-image-trivy-2026-07-30.md)
98+
and
99+
[dependency-compatibility-2026-07-30.md](dependency-compatibility-2026-07-30.md).
93100
All required GitHub checks must still be green on the exact final pushed SHA.
94101

95102
## Scope

‎docs/security-audit.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ reported zero HIGH/CRITICAL findings while the API import remained healthy.
162162
See
163163
[security-runtime-image-trivy-2026-07-30.md](security-runtime-image-trivy-2026-07-30.md).
164164

165+
The same closeout also converted two implicit dependency assumptions into
166+
tested supply-chain boundaries: MCP is constrained to its supported 1.x major
167+
API, and PyIceberg's write-time native core is explicitly locked to the
168+
Python 3.11–3.13-compatible 0.7 line. The regenerated hash lock, clean Mac
169+
environment, rebuilt image, OSV queries, and Trivy result are recorded in
170+
[dependency-compatibility-2026-07-30.md](dependency-compatibility-2026-07-30.md).
171+
165172
The Bandit baseline currently records a historical `B310` finding in `src/serving/backends/clickhouse_backend.py`. SQL construction findings are not globally suppressed; reviewed identifier construction is handled through narrow suppressions and tests.
166173

167174
Helm defaults no longer embed production-shaped API-key verifier hashes. Operators can render a chart-managed Secret for local use or mount an existing Kubernetes Secret, which is friendlier to External Secrets Operator, Sealed Secrets, or equivalent workflows.

‎docs/security-runtime-image-trivy-2026-07-30.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,26 @@ Runtime checks:
6666
- Trivy summary: Debian `13.5` vulnerabilities `0`; every detected Python
6767
package vulnerabilities `0`.
6868

69+
## Dependency-lock revalidation
70+
71+
Final CI dependency diagnosis added `pyiceberg-core==0.7.0` to the cloud
72+
profile and hash lock. Codex rebuilt the image from isolated Mac clone
73+
`/tmp/agentflow-ci-f11-codex-deps-01`, based on exact `f11fd59` plus the five
74+
candidate dependency files:
75+
76+
```text
77+
agentflow-api:security-codex-f11deps-01
78+
manifest list sha256:95254620bf98e73ce89feae28e0b178a3cf00956c7e63eedd40f8958705645d1
79+
```
80+
81+
The rebuilt Python 3.11 image installed core 0.7.0 through
82+
`requirements-docker.lock`, passed `pip check`, removed installer tooling,
83+
and preserved the API import. A fresh official Trivy `0.70.0` container scan
84+
with the same HIGH/CRITICAL failure policy exited `0`; every reported OS and
85+
Python package row was clean. Dependency root-cause and Python 3.13/MCP
86+
verification are in
87+
[dependency-compatibility-2026-07-30.md](dependency-compatibility-2026-07-30.md).
88+
6989
## Evidence boundary
7090

7191
This is content-level local acceptance of the candidate runtime image. The

‎integrations/pyproject.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ dependencies = [
1717

1818
[project.optional-dependencies]
1919
mcp = [
20-
"mcp>=1.0",
20+
# MCP 2 removes the low-level Server decorators used by this integration.
21+
"mcp>=1.0,<2",
2122
]
2223

2324
[project.scripts]

‎pyproject.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ dependencies = [
4040
cloud = [
4141
"boto3>=1.35,<2",
4242
"pyiceberg>=0.7,<1",
43+
# PyIceberg 0.11 write paths require native transforms. Core 0.8 excludes
44+
# Python 3.13, while 0.7 provides a stable-ABI wheel across Python 3.11-3.13.
45+
"pyiceberg-core>=0.7,<0.8",
4346
]
4447
postgres = [
4548
# ADR 0010 slice 5: PostgresControlPlaneStore (scale profile). Optional

‎requirements-docker.lock‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,14 @@ pyiceberg==0.11.1 ; python_full_version < '3.14' \
11481148
--hash=sha256:e273242cdca56029af694d7ce18075d47a74d034326d663ff6dd2655a6f44825 \
11491149
--hash=sha256:eb3a0a3e630ee89758eb96b39b456f4697732351fb0c080e9498ea578f9b71f9
11501150
# via agentflow-runtime
1151+
pyiceberg-core==0.7.0 ; python_full_version < '3.14' \
1152+
--hash=sha256:2303276b0d8b57b8ce4a3ef9e5050ffdefd9561684728cd0a9a72a9ad0a6a74d \
1153+
--hash=sha256:64dd3c3c7af6d39097e1d070161e98118e5dd423392992a9074e1ab813fd467b \
1154+
--hash=sha256:74543885cc97e8d976707f97dd01e8f03dce8a5d3a01e41ada0aaefa13c742f9 \
1155+
--hash=sha256:8166883ace30a388d2f659634bec87731cad7bc52341c997fcdd4e13780e4345 \
1156+
--hash=sha256:94fe0281f09c84cdd4e56d217865ef1d81e0cb0b708ba6eb2f4c5ae8bf86f0ba \
1157+
--hash=sha256:99e23463c30c4180329719fe1f120e779b20616a36bbdd42042b70063a13bd39
1158+
# via agentflow-runtime
11511159
pyparsing==3.3.2 ; python_full_version < '3.14' \
11521160
--hash=sha256:850ba148bd908d7e2411587e247a1e4f0327839c40e2e5e6d05a007ecc69911d \
11531161
--hash=sha256:c777f4d763f140633dcb6d8a3eda953bf7a214dc4eff598413c070bcdc117cbc

‎tests/unit/test_contract_dependencies.py‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,12 @@ def test_runtime_and_docker_image_include_redis_client():
8585
assert "redis==" in docker_lock
8686

8787

88-
def test_cloud_extra_uses_pure_python_pyiceberg_without_native_core():
89-
"""Cloud must ship pure-Python pyiceberg; pyiceberg-core has no cp313 wheels.
88+
def test_cloud_extra_uses_python_313_compatible_pyiceberg_core():
89+
"""Iceberg writes need native transforms without reintroducing the cp313 break.
9090
91-
The native extra is an optimization unused by project code. Pinning it via
92-
``pyiceberg[pyiceberg-core]`` blocks Python 3.13 lock/install on CI.
91+
PyIceberg 0.11 requires ``pyiceberg-core`` for partition transforms and
92+
table appends. Core 0.8 excludes Python 3.13, while 0.7 ships a compatible
93+
stable-ABI wheel for every supported interpreter.
9394
"""
9495
pyproject = _load_pyproject()
9596
cloud = pyproject["project"]["optional-dependencies"]["cloud"]
@@ -100,9 +101,18 @@ def test_cloud_extra_uses_pure_python_pyiceberg_without_native_core():
100101
for dependency in cloud
101102
), cloud
102103
assert not any("[pyiceberg-core]" in dependency for dependency in cloud), cloud
103-
assert not any(dependency.startswith("pyiceberg-core") for dependency in cloud), cloud
104+
assert "pyiceberg-core>=0.7,<0.8" in cloud
104105
assert "pyiceberg==" in docker_lock
105-
assert "pyiceberg-core==" not in docker_lock
106+
assert "pyiceberg-core==0.7.0" in docker_lock
107+
108+
109+
def test_mcp_integration_rejects_breaking_major_versions():
110+
integrations = tomllib.loads(
111+
(PROJECT_ROOT / "integrations" / "pyproject.toml").read_text(encoding="utf-8")
112+
)
113+
mcp_dependencies = integrations["project"]["optional-dependencies"]["mcp"]
114+
115+
assert "mcp>=1.0,<2" in mcp_dependencies
106116

107117

108118
def test_contract_workflow_uses_contract_extra():

0 commit comments

Comments
 (0)