From 3e59f6636b5adda075e656f68588ecfae285cd65 Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Wed, 11 Mar 2026 19:21:30 -0700 Subject: [PATCH] =?UTF-8?q?docs(M07):=20closeout=20=E2=80=94=20run2,=20aud?= =?UTF-8?q?it,=20summary,=20ledger,=20M08=20seed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Made-with: Cursor --- docs/milestones/M07/M07_audit.md | 73 ++++++++++++++++++++++++++++ docs/milestones/M07/M07_run2.md | 48 ++++++++++++++++++ docs/milestones/M07/M07_summary.md | 59 ++++++++++++++++++++++ docs/milestones/M08/M08_plan.md | 3 ++ docs/milestones/M08/M08_toolcalls.md | 5 ++ docs/serena.md | 3 ++ 6 files changed, 191 insertions(+) create mode 100644 docs/milestones/M07/M07_audit.md create mode 100644 docs/milestones/M07/M07_run2.md create mode 100644 docs/milestones/M07/M07_summary.md create mode 100644 docs/milestones/M08/M08_plan.md create mode 100644 docs/milestones/M08/M08_toolcalls.md diff --git a/docs/milestones/M07/M07_audit.md b/docs/milestones/M07/M07_audit.md new file mode 100644 index 000000000..9154985f0 --- /dev/null +++ b/docs/milestones/M07/M07_audit.md @@ -0,0 +1,73 @@ +# M07 Audit — Opts Snapshot Introduction + +**Milestone:** M07 +**Title:** Opts snapshot introduction +**Branch:** m07-opts-snapshot +**Audit date:** 2026-03-12 +**Mode:** DELTA AUDIT +**Range:** 6744152a (M06) → 8ea50d35 (M07 merge) +**CI Status:** Green (Quality 22983583947) +**Refactor Posture:** Behavior-Preserving +**Audit Verdict:** 🟢 Milestone objectives met. Infrastructure preparation; no runtime behavior change. Proceed to M08. + +--- + +## 1. Executive Summary + +M07 successfully introduced the opts snapshot mechanism for generation runs, establishing the third Phase II runtime seam. + +**Wins:** +* `create_opts_snapshot(opts)` returns a deterministic snapshot of opts.data +* Snapshot captured in `process_images_inner` after `prepare_prompt_seed_state(p)` — post-override, post-prep +* Full shallow copy of opts.data; no filtering (avoids omission risk) +* Snapshot stored on `p.opts_snapshot`; write-only in M07 (no reads replaced) +* Minimal blast radius: only `modules/opts_snapshot.py` (new) and `modules/processing.py` (modified) +* txt2img and img2img smoke tests exercise the critical path + +**Risks:** None identified. + +**Next action:** Proceed to M08 (snapshot threading into process_images_inner). + +--- + +## 2. CI Evidence + +| Check | Result | +|-------|--------| +| Smoke Tests (PR #22) | 22920401686 ✓ | +| Linter (PR #22) | 22920401661 ✓ | +| Quality Tests (post-merge) | 22983583947 ✓ | +| Coverage | ≥40% gate satisfied | +| verify_pinned_deps | ✓ Passed | +| pip-audit | Informational (M27) | +| Artifacts | coverage.xml ✓, ci_environment ✓ | + +--- + +## 3. Delta Map & Blast Radius + +| Changed | Impact | +|---------|--------| +| modules/opts_snapshot.py | New — create_opts_snapshot(opts) | +| modules/processing.py | Modified — capture snapshot after prepare_prompt_seed_state | +| docs/milestones/M07/* | Plan, toolcalls, run reports | + +**Blast radius:** Snapshot capture path only. No API/CLI/schema changes. Extensions and runtime continue reading shared.opts; p.opts_snapshot not yet consumed. + +--- + +## 4. Category Scores + +| Category | Score | Notes | +|----------|-------|-------| +| Refactor discipline | 5 | Infrastructure-only; boundaries respected | +| Behavior preservation | 5 | No runtime drift; smoke + quality pass | +| Test coverage | 5 | Existing smoke tests cover critical path | +| CI integrity | 5 | All gates green | +| **Overall** | **5.0** | | + +--- + +## 5. Verdict + +Milestone objectives met. Opts snapshot captured for generation runs. Third Phase II seam; enables M08 snapshot threading and removal of shared.opts dependency from the generation pipeline. diff --git a/docs/milestones/M07/M07_run2.md b/docs/milestones/M07/M07_run2.md new file mode 100644 index 000000000..ed7f415c5 --- /dev/null +++ b/docs/milestones/M07/M07_run2.md @@ -0,0 +1,48 @@ +# M07 CI Run 2 — Post-Merge Quality Verification + +**Date:** 2026-03-12 +**Branch:** main (post-merge) +**Merge commit:** 8ea50d35 +**Trigger:** push (Merge PR #22) + +--- + +## 1. Workflow Identity + +| Workflow | Run ID | Trigger | Branch | Commit | Status | +|----------|--------|---------|--------|--------|--------| +| Quality Tests | **22983583947** | push | main | 8ea50d35 | ✓ success | +| Linter | (push) | push | main | 8ea50d35 | ✓ success | + +--- + +## 2. Quality Tests (22983583947) + +| Job / Step | Required? | Purpose | Pass/Fail | +|------------|-----------|---------|-----------| +| Verify repository | Yes | Guardrail: m-cahill/serena only | ✓ | +| Verify ref | Yes | Guardrail: push to main | ✓ | +| Checkout Code | Yes | Fetch merge commit | ✓ | +| Set up Python 3.10 | Yes | Runtime | ✓ | +| Cache models | Yes | Deterministic model path | ✓ | +| Install dependencies | Yes | torch, CLIP, requirements_versions | ✓ | +| pip-audit | Informational | Dependency vuln scan | ⚠ (deferred M27) | +| verify_pinned_deps | Yes | Pinned deps enforcement | ✓ | +| Create stub repositories | Yes | CI fake inference | ✓ | +| Setup environment | Yes | launch.py --exit | ✓ | +| Start test server | Yes | Live server for API tests | ✓ | +| **Run quality tests** | **Yes** | **pytest test** (coverage ≥40%) | **✓** | +| Kill test server | Yes | Cleanup | ✓ | +| Upload artifacts | No (always) | coverage.xml, htmlcov, output | ✓ | + +**Duration:** ~4m + +**Annotation:** pip-audit found vulnerabilities. Remediation deferred to M27. See M04_audit.md. + +--- + +## 3. Verdict + +**CI Status:** Green + +All gates passed. M07 closeout verified. Ready for audit and summary generation. diff --git a/docs/milestones/M07/M07_summary.md b/docs/milestones/M07/M07_summary.md new file mode 100644 index 000000000..fae9588ec --- /dev/null +++ b/docs/milestones/M07/M07_summary.md @@ -0,0 +1,59 @@ +# M07 Summary — Opts Snapshot Introduction + +**Project:** Serena +**Phase:** Phase II — Runtime Seam Preparation +**Milestone:** M07 — Opts snapshot introduction +**Status:** Closed +**Branch:** m07-opts-snapshot +**PR:** #22 +**Commit:** 8ea50d35 (merge) +**Quality Run:** 22983583947 ✓ + +--- + +## Accomplished + +| Item | Status | +|------|--------| +| Created `modules/opts_snapshot.py` | ✓ | +| Added `create_opts_snapshot(opts)` | ✓ | +| Snapshot capture in process_images_inner after prepare_prompt_seed_state | ✓ | +| Full shallow copy of opts.data via SimpleNamespace | ✓ | +| Snapshot attached to `p.opts_snapshot` | ✓ | +| No runtime reads replaced (write-only for M07) | ✓ | +| Preserved behavior (override logic, extension compatibility) | ✓ | + +--- + +## CI Layout After M07 + +| Workflow | Trigger | Coverage | Security | +|----------|---------|----------|----------| +| Smoke Tests | pull_request (main) | No gate | None | +| Linter | pull_request | — | — | +| Quality Tests | push to main | ≥40% | pip-audit (informational) | + +--- + +## Invariants Preserved + +- Generation behavior unchanged +- Override logic unchanged +- Extension compatibility (shared.opts reads unchanged) +- API compatibility (txt2img/img2img) +- No opts reads replaced (M08 will thread snapshot) + +--- + +## Blast Radius + +| File | Change | +|------|--------| +| modules/opts_snapshot.py | New | +| modules/processing.py | Modified | + +--- + +## Refactor Result + +Deterministic opts snapshot captured for generation runs. Third Phase II runtime seam; prepares for M08 snapshot threading into process_images_inner and M09 execution context. diff --git a/docs/milestones/M08/M08_plan.md b/docs/milestones/M08/M08_plan.md new file mode 100644 index 000000000..1013621cb --- /dev/null +++ b/docs/milestones/M08/M08_plan.md @@ -0,0 +1,3 @@ +# M08 Plan — Snapshot Threading into process_images_inner + +(To be populated.) diff --git a/docs/milestones/M08/M08_toolcalls.md b/docs/milestones/M08/M08_toolcalls.md new file mode 100644 index 000000000..95ff12a83 --- /dev/null +++ b/docs/milestones/M08/M08_toolcalls.md @@ -0,0 +1,5 @@ +# M08 Toolcalls — Snapshot Threading into process_images_inner + +Implementation toolcalls for Cursor execution. + +(To be filled during milestone execution.) diff --git a/docs/serena.md b/docs/serena.md index ffdf8c39e..a571f8d10 100644 --- a/docs/serena.md +++ b/docs/serena.md @@ -136,11 +136,14 @@ Core principles: | M04 | Coverage/security/reproducibility guardrails | Completed | m04-coverage-guardrails | #4 | 47439cac | Quality 22871471473 ✓ (coverage 40%, pip-audit, verify_pinned_deps) | 5.0 / 5 | 2026-03-09 | | M05 | Override isolation / temporary opts seam | Completed | m05-override-isolation | #18 (+ #19 fix) | ae161cbb | Quality 22888808682 ✓ | 5.0 / 5 | 2026-03-10 | | M06 | Prompt/seed prep extraction | Completed | m06-prompt-seed-prep | #20 | 6744152a | Quality 22890285319 ✓ | 5.0 / 5 | 2026-03-10 | +| M07 | Opts snapshot introduction | Completed | m07-opts-snapshot | #22 | 8ea50d35 | Quality 22983583947 ✓ | 5.0 / 5 | 2026-03-12 | **M05:** Introduced `temporary_opts()` context manager — first Phase II runtime seam. Isolates override_settings mutation from global `shared.opts`; preserves behavior (opts.set, setattr restore, k in opts.data). Model/VAE reload and token merging remain in process_images. Enables future opts snapshot injection (M07). **M06:** Extracted `prepare_prompt_seed_state(p)` into `modules/prompt_seed_prep.py`. Second Phase II runtime seam. Populates p.all_seeds and p.all_subseeds; setup_prompts and fill_fields_from_opts unchanged. Enables M07 opts snapshot and M09 execution context. +**M07:** Introduced `create_opts_snapshot(opts)` in `modules/opts_snapshot.py`. Third Phase II runtime seam. Captures deterministic snapshot of opts.data in process_images_inner after prepare_prompt_seed_state; stored on p.opts_snapshot. Write-only in M07; enables M08 snapshot threading. + --- ## 5. Standing Invariants