|
2 | 2 |
|
3 | 3 | ## 0) Last Updated + Changelog |
4 | 4 |
|
5 | | -**Last updated:** 2026-05-23 |
| 5 | +**Last updated:** 2026-05-25 |
| 6 | + |
| 7 | +### 2026-05-25 (Convex Phase Schema Hardening + Agent Contract Alignment) |
| 8 | +**Summary:** Tightened the remaining loose Convex phase-result contracts, aligned the agent’s persisted result types to the real bridge payloads, and fixed a phase 6 report schema mismatch that previously made Convex less compatible than the runtime bridges. |
| 9 | + |
| 10 | +**What changed:** |
| 11 | +1. **Shared Convex phase validators (`convex/phaseValidators.ts`, `convex/schema.ts`, `convex/integrations-mutations.ts`):** |
| 12 | + - Extracted shared phase validators so the table schema and `savePhaseResult` mutation validate against the same payload definitions. |
| 13 | + - Replaced the remaining loose `v.any()` phase surfaces with structured validators for repo dependencies/components, transformation change lists, validation comparison payloads, and report subtrees. |
| 14 | + - Updated `savePhaseResult` to take a typed `{ payload: { field, result } }` object so field/result pairs are validated together instead of accepting any blob. |
| 15 | +2. **Agent payload normalization and typing (`agent/src/bridges/python-subprocess.ts`, `agent/src/api/convex.ts`, `agent/src/orchestrator.ts`):** |
| 16 | + - Added structured TypeScript result types for persisted phase payloads and removed `unknown` from the Convex wrapper’s phase result API. |
| 17 | + - Normalized subprocess mapping outputs to preserve target context, confidence breakdowns, and canonical research-spec payloads instead of leaving snake_case/raw extractor objects to drift into persistence. |
| 18 | + - Normalized patch validation metadata (`schemaVersion`, `payloadType`) and tightened the orchestrator’s Convex handoff to use typed persisted phase results. |
| 19 | +3. **Phase 6 report contract fix (`agent/src/phases/phase6-report.ts`, `agent/src/phases/types.ts`):** |
| 20 | + - Exported a concrete `Phase6Report` type and aligned `Phase6Context.report` to it. |
| 21 | + - Fixed the persisted report contract to use the actual `diffPreview` field and full report structure (`whatChanged`, `why`, `observedImpact`, `testResults`, `recommendation`) instead of the stale `{ summary, diff, metadata }` schema. |
| 22 | +4. **Regression coverage (`agent/src/api/convex.test.ts`, `agent/src/bridges/python-subprocess.test.ts`):** |
| 23 | + - Added a Convex client regression test covering the new nested phase result payload contract. |
| 24 | + - Added subprocess bridge coverage for normalized mapping context, confidence breakdowns, canonicalized research specs, and validation metadata passthrough. |
| 25 | + |
| 26 | +**Verification:** |
| 27 | +- `cd agent && bun test src/api/convex.test.ts src/bridges/python-subprocess.test.ts src/phases/phase6-report.test.ts` |
| 28 | +- `cd agent && bun run build` |
| 29 | + |
| 30 | +**Notes:** |
| 31 | +- A standalone TypeScript check for `convex/*.ts` was not runnable in this checkout because `convex/_generated/server` is absent, so Convex’s generated type bindings are not available locally. |
6 | 32 |
|
7 | 33 | ### 2026-05-23 (Paper-to-Code PDF Upload Flow) |
8 | 34 | **Summary:** Finished the missing PDF upload transport for the Paper-to-Code page and aligned the UI with the backend’s actual patch-generation response. |
|
52 | 78 | - `cd agent && bun test src/bridges/python-subprocess.test.ts` |
53 | 79 | - `cd agent && bun run build` |
54 | 80 |
|
55 | | -### 2026-05-23 (CI Failure Fixes — Ruff Format, Test Mock, Benchmark AST Revert) |
56 | | -**Summary:** Fixed three CI failures: ruff formatting in test files, a test that failed due to incomplete mocking of the validation runner, and a benchmark regression caused by AST-affecting changes to expected benchmark files. |
| 81 | +### 2026-05-23 (CI Failure Fixes — Ruff Format, Test Mock, Benchmark AST Revert, python-multipart Dep) |
| 82 | +**Summary:** Fixed four CI/suite failures: ruff formatting in test files, a test that failed due to incomplete mocking of the validation runner, a benchmark regression caused by AST-affecting changes to expected benchmark files, and a missing `python-multipart` dependency for FastAPI file uploads. |
57 | 83 |
|
58 | 84 | **What changed:** |
59 | 85 | 1. **Ruff formatting (`core/tests/unit/test_patch_generator.py`, `core/tests/unit/test_cli.py`):** |
|
62 | 88 | - `test_run_accepts_camel_case_patch_payload` now properly mocks `_check_torch_available`, `_run_training_test`, `_run_numerical_correctness`, `_run_regression_snapshot`, and `_score_diff_readability` — preventing the test from running real benchmark subprocesses and failing when torch is unavailable. |
63 | 89 | 3. **Benchmark AST revert (`core/benchmarks/expected/*.py`, `core/benchmarks/papers/*.py`):** |
64 | 90 | - Reverted N806 variable renames (`B,T,C` -> `b,t,c`) and F401 import removals from benchmark expected/papers files that changed the AST and caused benchmark AST matching failures (score dropped from 1.0 → 0.75 for 5 of 10 cases). |
| 91 | +4. **Missing dependency (`core/pyproject.toml`):** |
| 92 | + - Added `python-multipart>=0.0.9` to the `product` extras — required by the new PDF upload endpoint (`UploadFile = File(...)`). Without it, importing the server module (and any test importing it) raises a `RuntimeError` at route definition time. |
65 | 93 |
|
66 | 94 | **Verification:** |
67 | 95 | - `cd core && ruff check src/ tests/ && ruff format --check src/ tests/` |
68 | | -- `cd core && python -m pytest tests/unit/test_validation_runner.py tests/unit/test_cli.py tests/unit/test_patch_generator.py -q` |
| 96 | +- `cd core && python -m pytest tests/ -x -q --tb=short` |
69 | 97 |
|
70 | 98 | ### 2026-05-22 (Benchmark Regression + LoRA Smoke Fix) |
71 | 99 | **Summary:** Restored benchmark parity after the new smoke-test scaffolding and fixed the generated LoRA runtime contract. |
|
0 commit comments