|
1 | 1 | # BUILD_REPORT |
2 | 2 |
|
3 | 3 | ## sprint objective |
4 | | -Implement `P11-S6` by adding tier-2 model packs (DeepSeek, Kimi, Mistral) on the shipped model-pack abstraction, plus compatibility/setup clarity assets for local, self-hosted, enterprise, and external-agent paths, without reopening `P11-S1` through `P11-S5` architecture. |
| 4 | +Implement `P11-R1` provider-runtime security hardening to close the release-blocking findings: SSRF via provider `base_url`, upstream error-detail reflection/persistence, and URL userinfo credential exposure. |
5 | 5 |
|
6 | 6 | ## completed work |
7 | | -- Added tier-2 built-in pack specs in `model_packs.py`: |
8 | | - - `deepseek@1.0.0` |
9 | | - - `kimi@1.0.0` |
10 | | - - `mistral@1.0.0` |
11 | | -- Preserved shipped pack API behavior and selection semantics: |
12 | | - - seeded catalog still resolves through existing `/v1/model-packs` flow |
13 | | - - workspace binding and request override precedence are unchanged |
14 | | - - no new runtime/provider paths were introduced |
15 | | -- Extended family contract/type support for tier-2 families: |
16 | | - - `deepseek`, `kimi`, `mistral` |
17 | | -- Added additive migration `20260412_0056_phase11_model_packs_tier2_families.py` to widen `model_packs_family_check` without schema redesign. |
18 | | -- Updated catalog reservation conflict text to cover built-in catalog entries (tier-1 + tier-2). |
19 | | -- Added/updated sprint docs: |
20 | | - - `docs/integrations/phase11-model-pack-compatibility.md` with provider/pack compatibility matrices |
21 | | - - `docs/integrations/phase11-setup-paths.md` with operator setup paths for local, self-hosted, enterprise, and external-agent use |
22 | | - - `docs/integrations/phase11-azure-autogen.md` guardrails/references refreshed for P11-S6 |
23 | | -- Updated sprint-owned tests for tier-2 catalog presence, runtime override behavior, and migration coverage. |
24 | | -- Updated control-doc truth checker markers to active `P11-S6` packet/state markers. |
25 | | -- Updated `REVIEW_REPORT.md` for `P11-S6`. |
| 7 | +- Added centralized provider URL security policy: |
| 8 | + - allowed schemes restricted to `http`/`https` |
| 9 | + - rejects userinfo in `base_url` |
| 10 | + - blocks loopback, link-local/metadata, RFC1918/private, and other non-global IP literal targets |
| 11 | +- Enforced URL policy before persistence and before outbound execution: |
| 12 | + - registration paths validate `base_url` before provider row creation |
| 13 | + - runtime adapter outbound paths validate `base_url` before helper/network calls |
| 14 | + - runtime/test flows hard-reject disallowed stored provider targets |
| 15 | +- Sanitized upstream provider error handling: |
| 16 | + - provider test/discovery/invoke errors now map to bounded safe messages for API and persistence |
| 17 | + - persisted `provider_capabilities.discovery_error` now stores sanitized values |
| 18 | + - runtime failure traces store sanitized provider failure messages |
| 19 | +- Added serialization hygiene: |
| 20 | + - provider serialization now redacts userinfo from `base_url` (defense in depth for legacy rows) |
| 21 | +- Added/updated sprint verification coverage: |
| 22 | + - blocked target registration cases (`169.254.169.254`, loopback, RFC1918 ranges) |
| 23 | + - blocked target runtime/test rejection with no outbound attempt |
| 24 | + - userinfo rejection and legacy serialization redaction |
| 25 | + - raw upstream detail not reflected or persisted |
| 26 | +- Updated control-doc truth rules and roadmap marker to align with active `P11-R1`. |
| 27 | +- Updated `REVIEW_REPORT.md` to grade `P11-R1` and explicitly close each in-scope finding. |
26 | 28 |
|
27 | 29 | ## incomplete work |
28 | | -- None within the sprint packet scope. |
| 30 | +- None within the `P11-R1` sprint packet scope. |
29 | 31 |
|
30 | 32 | ## files changed |
31 | | -- `apps/api/src/alicebot_api/model_packs.py` |
32 | | -- `apps/api/src/alicebot_api/contracts.py` |
| 33 | +- `apps/api/src/alicebot_api/provider_security.py` (new) |
33 | 34 | - `apps/api/src/alicebot_api/main.py` |
34 | | -- `apps/api/alembic/versions/20260412_0056_phase11_model_packs_tier2_families.py` (new) |
35 | | -- `tests/unit/test_model_packs.py` |
36 | | -- `tests/integration/test_phase11_model_packs_api.py` |
37 | | -- `tests/unit/test_20260412_0056_phase11_model_packs_tier2_families.py` (new) |
38 | | -- `docs/integrations/phase11-model-pack-compatibility.md` |
39 | | -- `docs/integrations/phase11-setup-paths.md` (new) |
40 | | -- `docs/integrations/phase11-azure-autogen.md` |
| 35 | +- `apps/api/src/alicebot_api/provider_runtime.py` |
| 36 | +- `apps/api/src/alicebot_api/local_provider_helpers.py` |
| 37 | +- `apps/api/src/alicebot_api/azure_provider_helpers.py` |
| 38 | +- `tests/unit/test_provider_security.py` (new) |
| 39 | +- `tests/unit/test_provider_runtime.py` |
| 40 | +- `tests/integration/test_phase11_provider_runtime_api.py` |
| 41 | +- `ROADMAP.md` |
41 | 42 | - `scripts/check_control_doc_truth.py` |
42 | 43 | - `REVIEW_REPORT.md` |
43 | 44 | - `BUILD_REPORT.md` |
44 | 45 |
|
45 | 46 | ## tests run |
46 | 47 | 1. `python3 scripts/check_control_doc_truth.py` |
47 | | -- Result: PASS |
| 48 | + - Result: PASS |
| 49 | + - Output: `Control-doc truth check: PASS` |
48 | 50 |
|
49 | 51 | 2. `./.venv/bin/python -m pytest tests/unit tests/integration -q` |
50 | | -- Result: PASS (`1145 passed in 185.18s (0:03:05)`) |
| 52 | + - Result: PASS |
| 53 | + - Output: `1169 passed in 185.41s (0:03:05)` |
51 | 54 |
|
52 | | -3. `pnpm --dir apps/web test` |
53 | | -- Result: PASS (`62 files`, `199 tests passed`, duration `5.49s`) |
54 | | - |
55 | | -4. Focused sprint tests during implementation: |
56 | | -- `./.venv/bin/python -m pytest tests/unit/test_model_packs.py tests/integration/test_phase11_model_packs_api.py tests/unit/test_20260412_0056_phase11_model_packs_tier2_families.py -q` |
57 | | -- Result: PASS (`14 passed in 1.62s`) |
| 55 | +3. `./.venv/bin/bandit -r apps/api/src/alicebot_api/provider_runtime.py apps/api/src/alicebot_api/local_provider_helpers.py apps/api/src/alicebot_api/azure_provider_helpers.py apps/api/src/alicebot_api/main.py` |
| 56 | + - Result: PASS |
| 57 | + - Output: `No issues identified` |
58 | 58 |
|
59 | 59 | ## blockers/issues |
60 | | -- No functional blockers for sprint scope implementation. |
61 | | -- Pre-existing dirty file not modified as sprint work and excluded from sprint merge scope: |
| 60 | +- No implementation blockers in sprint scope. |
| 61 | +- Workspace contains a pre-existing unrelated dirty file not modified by this sprint: |
62 | 62 | - `README.md` |
63 | 63 |
|
64 | 64 | ## recommended next step |
65 | | -Proceed to merge review for `P11-S6`, then run staging smoke checks for one local provider, one self-hosted OpenAI-compatible provider, and one Azure provider with tier-2 and custom pack coverage. |
| 65 | +Proceed to security review sign-off for `P11-R1`, then merge once the release hold is formally cleared against the three closed findings. |
0 commit comments