# QA Review — MC #9697 reviewing MC #8941

# QA Review — MC #9697 (reviewing MC #8941)

**Reviewer:** John / pi-orchestrator (Proveo persona)  
**Reviewed at (UTC):** 2026-07-28T21:27:40Z  
**Source task:** #8941 — ACS Phase 1.3 — Python SDK alai-config-py (Pydantic v2)  
**Source status:** done  
**Source priority:** H  
**Source owner:** codecraft  
**Review task:** #9697 — QA review: #8941

## Tool-verified source task state

`node ~/system/tools/mc.js show 8941` reports:

- Status: `done`
- Priority: `H`
- Owner: `codecraft`
- DoD/agent output: `Python SDK alai-config-py built: 40/40 tests pass, wheel+sdist built, smoke test passes, AppConfig.load() typed model works. Proveo validation pending.`

`node ~/system/tools/mc.js show 9697` reports the QA review task was `blocked` because autowork had 5 failed attempts and needed human review.

The MC tool emitted `[alai/config] Mock mode active` from `/Users/makinja/system/tools/alai-config-mock.json`; this review is therefore anchored in the local/mock MC record plus direct file/test verification below.

## Scope reviewed

Canonical package path reviewed:

- `/Users/makinja/business/ALAI-Holding-AS/internal/packages/alai-config-py`

Files read/reviewed:

- `pyproject.toml`
- `README.md`
- `Makefile`
- `src/alai_config/__init__.py`
- `src/alai_config/client.py`
- `src/alai_config/resolver.py`
- `src/alai_config/models/app_config.py`
- `src/alai_config/cache.py`
- `src/alai_config/mock.py`
- `src/alai_config/errors.py`
- `src/alai_config/aliases.py`
- `tests/conftest.py`
- `tests/test_cache.py`
- `tests/test_mock.py`
- `tests/test_resolver.py`

Lines reviewed by `wc -l`: 1,582 total across the files above.

## Acceptance criteria check

Task 1.3 acceptance from `/Users/makinja/projects/alai-system/specs/alai-config-system-plan.md`:

| Acceptance item | Review result | Evidence |
|---|---:|---|
| Pydantic v2 AppConfig model generated from schema | PASS with implementation note | `pyproject.toml` requires `pydantic>=2.0`; `src/alai_config/models/app_config.py` defines Pydantic v2 models and `AppConfig.load()`. `Makefile codegen` supports regeneration from `~/ALAI/internal/alai-config/schema/app-config.schema.json`; current model file states it is manually authored when the schema file is unavailable. |
| Refuses to start on invalid schema | PASS | `AppConfig.load()` calls `cls.model_validate(raw)` and re-raises validation errors after logging. Smoke verified typed model load; tests cover invalid mock JSON and config init failures. |
| PyPI publish `alai-config` | NOT VERIFIED | Local build produced wheel and sdist. I found no current machine evidence that the package was published to PyPI or a private package index. |

## Commands executed and evidence

| Check | Command | Result | Evidence file |
|---|---|---:|---|
| Unit tests | `python3.12 -m pytest -q` | PASS — `40 passed` | `/Users/makinja/system/evidence/9697/pytest.log` |
| Package build | `python3.12 -m build` | PASS — built `alai_config-1.0.0.tar.gz` and `alai_config-1.0.0-py3-none-any.whl` | `/Users/makinja/system/evidence/9697/build.log` |
| Typed smoke | `ALAI_CONFIG_MOCK_PATH=tests/fixtures/mock.json python3.12 ... AppConfig.load()` | PASS — initialized true, endpoint `http://localhost:3001`, VAT rate `0.20` is `Decimal`, LightRAG URL `http://localhost:9621` | `/Users/makinja/system/evidence/9697/smoke.log` |
| Syntax compile | `python3.12 -m compileall -q src tests` | PASS | `/Users/makinja/system/evidence/9697/static-checks.log` |
| Secret pattern scan | `grep -RInE ... src tests README.md pyproject.toml` | PASS — no matches in the static check log | `/Users/makinja/system/evidence/9697/static-checks.log` |
| QA-19 source gate | `node ~/system/tools/qa-19.js check 8941` | PENDING — score `5/15`; historic `/tmp` GOTCHA/verify markers absent | `/Users/makinja/system/evidence/9697/qa19-8941.log` |

Build artifact hashes:

- `dist/alai_config-1.0.0-py3-none-any.whl` — SHA-256 `69ec5e62fcbd0c87241161eae08e2cf9a362356f7ef38a9e44e1f1f9f4f885cb`
- `dist/alai_config-1.0.0.tar.gz` — SHA-256 `f9f46b830a6c2bbbc02a2cd262ae262ba6792ff64090135061a89fc3887cc9d6`

## Findings

### Blocking defects

None found in the reviewed source and test scope.

### Should-fix / follow-up

1. **Publish evidence missing for the `PyPI publish alai-config` acceptance item.**  
   Local package build is verified, but no durable evidence was found for publish to PyPI or an internal package index. If publish was intentionally deferred, the acceptance item should be updated or a release task should be created.

2. **QA-19 historic gate remains pending for #8941.**  
   Current direct verification passes, but `qa-19.js check 8941` still fails because historic `/tmp/gotcha-task-8941.md`, `/tmp/verify-8941`, and hop-build marker files are absent. This review writes durable evidence under `/Users/makinja/system/evidence/9697/` to close the review task, but it does not mutate the historic source task gate state.

### Optional hardening

- Add explicit tests for `AppConfig.load()` invalid typed values, for example invalid VAT decimal or invalid `Market` enum, to directly prove the fail-fast Pydantic path beyond mock-file parse errors.
- Add a release checklist documenting the exact package index target for proprietary `alai-config` publishing.

## Code review verdict

**Status:** APPROVED_WITH_COMMENTS  
**Security:** PASS  
**Tests:** PASS — 40/40  
**Build:** PASS — wheel and sdist produced  
**Source QA-19:** PENDING due missing historic `/tmp` evidence markers  
**Overall:** The Python SDK implementation is usable and verified locally for tests, build, syntax, and typed `AppConfig.load()` smoke. The only acceptance gap I could not verify is package publication.

## BookStack

Published and verified via BookStack API:

- URL: https://docs.alai.no/books/testing-qa/page/qa-review-mc-9697-reviewing-mc-8941
- Page ID: 3304

## Required artifacts written by this review

- `/Users/makinja/system/evidence/9697/qa-review-8941.md`
- `/Users/makinja/system/evidence/9697/summary.json`
- `/Users/makinja/system/evidence/9697/verification.json`
- `/Users/makinja/system/evidence/9697/pytest.log`
- `/Users/makinja/system/evidence/9697/build.log`
- `/Users/makinja/system/evidence/9697/smoke.log`
- `/Users/makinja/system/evidence/9697/static-checks.log`
- `/Users/makinja/system/evidence/9697/qa19-8941.log`