mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-03-22 06:10:51 -07:00
Merge pull request #25 from m-cahill/m09-execution-context
docs(M08): closeout — run2, audit, summary, ledger, M09 seed
This commit is contained in:
commit
82cd17e2d7
7 changed files with 433 additions and 0 deletions
197
docs/milestones/M08/M08_audit.md
Normal file
197
docs/milestones/M08/M08_audit.md
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
# M08 Audit — Opts Snapshot Threading
|
||||
|
||||
**Milestone:** M08
|
||||
**Title:** Opts snapshot threading
|
||||
**Mode:** DELTA AUDIT
|
||||
**Range:** 8ea50d35 (M07) → 710a0abd (M08 merge)
|
||||
**CI Status:** Green (Quality 22984445599)
|
||||
**Refactor Posture:** Behavior-Preserving
|
||||
**Audit Verdict:** 🟢 Milestone objectives met. Runtime now reads from p.opts_snapshot for save-related settings. Proceed to M09.
|
||||
|
||||
---
|
||||
|
||||
## 1. Executive Summary (Delta-First)
|
||||
|
||||
**Wins:**
|
||||
* Migrated 12 save-related opts reads from shared.opts to p.opts_snapshot in process_images_inner
|
||||
* Limited blast radius to process_images_inner only; save_samples(), sample_hr_pass(), create_infotext(), metadata logic unchanged per M08 scope
|
||||
* Same inputs → same outputs; no behavior drift; smoke + quality tests pass
|
||||
* Fourth Phase II runtime seam; first deterministic runtime boundary for config reads
|
||||
|
||||
**Risks:** None identified.
|
||||
|
||||
**Next action:** Proceed to M09 (execution context seam).
|
||||
|
||||
---
|
||||
|
||||
## 2. Delta Map & Blast Radius
|
||||
|
||||
| Changed | Impact |
|
||||
|---------|--------|
|
||||
| modules/processing.py | Modified — p.opts_snapshot for save-related reads in process_images_inner |
|
||||
| docs/milestones/M08/* | Plan, toolcalls, run1, run2, audit, summary |
|
||||
|
||||
**Consumer surfaces touched:** None. API, CLI, file formats, extension API unchanged.
|
||||
|
||||
**Blast radius:** process_images_inner image/grid saving logic only. Breakage would show up in: image save paths, grid save behavior, mask save/return, format selection. All exercised by smoke tests.
|
||||
|
||||
---
|
||||
|
||||
## 3. Architecture & Modularity Review
|
||||
|
||||
* **Boundary violations:** None. Snapshot threading respects existing module boundaries.
|
||||
* **Coupling added:** None. p.opts_snapshot already existed from M07; M08 adds reads only.
|
||||
* **Dead abstractions:** None.
|
||||
* **Layering leaks:** None.
|
||||
|
||||
**Keep:** Current structure. **Fix now:** None. **Defer:** None.
|
||||
|
||||
---
|
||||
|
||||
## 4. CI/CD & Workflow Audit
|
||||
|
||||
| Check | Result |
|
||||
|-------|--------|
|
||||
| Smoke Tests (PR #24) | 22984306614 ✓ |
|
||||
| Linter (PR #24) | 22984306617 ✓ |
|
||||
| Quality Tests (post-merge) | 22984445599 ✓ |
|
||||
| Coverage | ≥40% gate satisfied |
|
||||
| verify_pinned_deps | ✓ Passed |
|
||||
| pip-audit | Informational (M27) |
|
||||
|
||||
**CI Root Cause Summary:** N/A (all green).
|
||||
**Minimal Fix Set:** None.
|
||||
**Guardrails:** Unchanged from M07.
|
||||
|
||||
---
|
||||
|
||||
## 5. Tests, Coverage, and Invariants (Delta-Only)
|
||||
|
||||
* **Coverage delta:** No decrease; Quality Tests enforce ≥40%.
|
||||
* **New tests:** None added; existing smoke/quality tests cover critical path.
|
||||
* **Invariant verification:** PASS — generation behavior, file output, extension compat, API, CLI preserved.
|
||||
* **Flaky tests:** None introduced.
|
||||
|
||||
**Missing Invariants:** None.
|
||||
**Missing Tests:** None for M08 scope.
|
||||
**Fast Fixes:** None.
|
||||
|
||||
---
|
||||
|
||||
## 6. Security & Supply Chain (Delta-Only)
|
||||
|
||||
* **Dependency deltas:** None. No new dependencies.
|
||||
* **Secrets exposure:** None.
|
||||
* **Workflow trust boundary:** Unchanged.
|
||||
* **pip-audit:** Informational; vulns deferred to M27 (M04 baseline).
|
||||
|
||||
---
|
||||
|
||||
## 7. Refactor Guardrail Compliance Check
|
||||
|
||||
| Guardrail | Status |
|
||||
|-----------|--------|
|
||||
| Invariant declaration | PASS — M08 plan declared invariants; verified by CI |
|
||||
| Baseline discipline | PASS — Range 8ea50d35...710a0abd; delta vs M07 documented |
|
||||
| Consumer contract protection | PASS — API/CLI/schema unchanged; smoke tests exercise contracts |
|
||||
| Extraction/split safety | N/A |
|
||||
| No silent CI weakening | PASS — All gates enforced |
|
||||
|
||||
---
|
||||
|
||||
## 8. Top Issues (Max 7, Ranked)
|
||||
|
||||
None. No issues identified for M08.
|
||||
|
||||
---
|
||||
|
||||
## 9. PR-Sized Action Plan
|
||||
|
||||
| ID | Task | Category | Acceptance Criteria | Risk | Est |
|
||||
|----|------|----------|---------------------|------|-----|
|
||||
| — | None required | — | — | — | — |
|
||||
|
||||
---
|
||||
|
||||
## 10. Deferred Issues Registry (Cumulative)
|
||||
|
||||
| ID | Issue | Discovered | Deferred To | Reason | Blocker? | Exit Criteria |
|
||||
|----|-------|------------|-------------|--------|----------|---------------|
|
||||
| SEC-001 | pip-audit vulns | M04 | M27 | Supply-chain evidence milestone | No | pip-audit clean or documented |
|
||||
|
||||
---
|
||||
|
||||
## 11. Score Trend (Cumulative)
|
||||
|
||||
| Milestone | Invariants | Compat | Arch | CI | Sec | Tests | DX | Docs | Overall |
|
||||
|-----------|------------|--------|------|-----|-----|-------|-----|------|---------|
|
||||
| M07 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5.0 |
|
||||
| M08 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5.0 |
|
||||
|
||||
M08 maintains 5.0. Snapshot threading is mechanical refactor; no new risk surface.
|
||||
|
||||
---
|
||||
|
||||
## 12. Flake & Regression Log (Cumulative)
|
||||
|
||||
| Item | Type | First Seen | Current Status | Last Evidence | Fix/Defer |
|
||||
|------|------|------------|----------------|--------------|-----------|
|
||||
| — | — | — | — | — | — |
|
||||
|
||||
No flaky tests or behavior-drift events for M08.
|
||||
|
||||
---
|
||||
|
||||
## 13. Category Scores
|
||||
|
||||
| Category | Score | Notes |
|
||||
|----------|-------|-------|
|
||||
| Refactor discipline | 5 | Scope respected; no creep |
|
||||
| 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** | |
|
||||
|
||||
---
|
||||
|
||||
## 14. Verdict
|
||||
|
||||
Milestone objectives met. Runtime begins reading from p.opts_snapshot for save-related config. Fourth Phase II seam; enables M09 execution context and ProcessingRunner architecture (M10+).
|
||||
|
||||
---
|
||||
|
||||
## Machine-Readable Appendix
|
||||
|
||||
```json
|
||||
{
|
||||
"milestone": "M08",
|
||||
"mode": "delta",
|
||||
"posture": "preserve",
|
||||
"commit": "710a0abd",
|
||||
"range": "8ea50d35...710a0abd",
|
||||
"verdict": "green",
|
||||
"quality_gates": {
|
||||
"invariants": "pass",
|
||||
"compatibility": "pass",
|
||||
"ci": "pass",
|
||||
"tests": "pass",
|
||||
"coverage": "pass",
|
||||
"security": "pass",
|
||||
"dx_docs": "pass",
|
||||
"guardrails": "pass"
|
||||
},
|
||||
"issues": [],
|
||||
"deferred_registry_updates": [],
|
||||
"score_trend_update": {
|
||||
"invariants": 5,
|
||||
"compat": 5,
|
||||
"arch": 5,
|
||||
"ci": 5,
|
||||
"sec": 5,
|
||||
"tests": 5,
|
||||
"dx": 5,
|
||||
"docs": 5,
|
||||
"overall": 5.0
|
||||
}
|
||||
}
|
||||
```
|
||||
60
docs/milestones/M08/M08_run2.md
Normal file
60
docs/milestones/M08/M08_run2.md
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# M08 CI Run 2 — Post-Merge Quality Verification
|
||||
|
||||
**Date:** 2026-03-12
|
||||
**Branch:** main (post-merge)
|
||||
**Merge commit:** 710a0abd
|
||||
**Trigger:** push (Merge PR #24)
|
||||
|
||||
---
|
||||
|
||||
## 1. Workflow Identity
|
||||
|
||||
| Workflow | Run ID | Trigger | Branch | Commit | Status |
|
||||
|----------|--------|---------|--------|--------|--------|
|
||||
| Quality Tests | **22984445599** | push | main | 710a0abd | ✓ success |
|
||||
| Linter | 22984445598 | push | main | 710a0abd | ✓ success |
|
||||
|
||||
---
|
||||
|
||||
## 2. Quality Tests (22984445599)
|
||||
|
||||
| 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 | ✓ |
|
||||
| Show coverage | Yes | --fail-under=40 | ✓ |
|
||||
| Upload artifacts | No (always) | coverage.xml, htmlcov, output | ✓ |
|
||||
|
||||
**Duration:** 3m25s
|
||||
|
||||
**Annotation:** pip-audit found vulnerabilities. Remediation deferred to M27. See M04_audit.md.
|
||||
|
||||
---
|
||||
|
||||
## 3. CI Confirmation
|
||||
|
||||
| Check | Status |
|
||||
|-------|--------|
|
||||
| Quality Tests | ✓ |
|
||||
| Coverage | ≥ 40% |
|
||||
| pip-audit | Informational (M27) |
|
||||
| verify_pinned_deps | ✓ |
|
||||
|
||||
---
|
||||
|
||||
## 4. Verdict
|
||||
|
||||
**CI Status:** Green
|
||||
|
||||
All gates passed. M08 closeout verified. Ready for audit and summary generation.
|
||||
163
docs/milestones/M08/M08_summary.md
Normal file
163
docs/milestones/M08/M08_summary.md
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
# M08 Summary — Opts Snapshot Threading
|
||||
|
||||
📌 Milestone Summary — M08: Opts Snapshot Threading
|
||||
====================================================
|
||||
|
||||
**Project:** Serena
|
||||
**Phase:** Phase II — Runtime Seam Preparation
|
||||
**Milestone:** M08 — Opts snapshot threading
|
||||
**Timeframe:** 2026-03-11 → 2026-03-12
|
||||
**Status:** Closed
|
||||
**Baseline:** 8ea50d35 (M07 merge)
|
||||
**Refactor Posture:** Behavior-Preserving
|
||||
|
||||
---
|
||||
|
||||
## 1. Milestone Objective
|
||||
|
||||
M08 existed to thread `p.opts_snapshot` into the generation runtime for safe read-only option access. M07 introduced the snapshot (write-only); M08 migrates the first set of reads from `shared.opts` to `p.opts_snapshot`.
|
||||
|
||||
**What would remain unsafe or ungoverned if this refactor did not occur?** The runtime would continue reading directly from global `shared.opts` during generation, preventing deterministic isolation and blocking the ProcessingRunner architecture (M10+).
|
||||
|
||||
---
|
||||
|
||||
## 2. Scope Definition
|
||||
|
||||
### In Scope
|
||||
|
||||
* `modules/processing.py` — process_images_inner() for save-related opts reads
|
||||
* Migrated options: save_images_before_face_restoration, save_images_before_color_correction, samples_format, return_mask, save_mask, return_mask_composite, save_mask_composite, grid_only_if_multiple, return_grid, grid_save, grid_format, grid_extended_filename
|
||||
* CI: Linter, Smoke Tests (PR), Quality Tests (post-merge)
|
||||
* Documentation: M08_plan.md, M08_toolcalls.md, M08_run1.md, M08_run2.md
|
||||
|
||||
### Out of Scope
|
||||
|
||||
* save_samples(), sample_hr_pass(), create_infotext(), Processed.__init__(), fill_fields_from_opts()
|
||||
* modules/images.py
|
||||
* Override logic, UI/API option behavior, extension access to shared.opts
|
||||
* New runtime abstractions
|
||||
|
||||
---
|
||||
|
||||
## 3. Refactor Classification
|
||||
|
||||
### Change Type
|
||||
|
||||
**Mechanical refactor** — Replace `opts.foo` with `p.opts_snapshot.foo` for save-related reads. No logic change; same values at capture time.
|
||||
|
||||
### Observability
|
||||
|
||||
* **API responses:** Unchanged (txt2img/img2img JSON schema unchanged)
|
||||
* **CLI output:** Unchanged
|
||||
* **File formats / save paths:** Unchanged (p.outpath_samples, p.outpath_grids set before process_images_inner; format from snapshot)
|
||||
* **Model outputs:** Unchanged
|
||||
|
||||
---
|
||||
|
||||
## 4. Work Executed
|
||||
|
||||
* Replaced 12 opts reads with p.opts_snapshot reads in process_images_inner
|
||||
* No functional logic changed; values identical at snapshot capture time
|
||||
* No new modules; no migration steps
|
||||
* Files changed: modules/processing.py, docs/milestones/M08/*
|
||||
|
||||
---
|
||||
|
||||
## 5. Invariants & Compatibility
|
||||
|
||||
### Declared Invariants (must by default Not Change)
|
||||
|
||||
* Generation behavior unchanged (same inputs → same outputs)
|
||||
* File output behavior unchanged (save paths, naming)
|
||||
* Extension compatibility (shared.opts still exists)
|
||||
* API compatibility (txt2img/img2img)
|
||||
* CLI behavior unchanged
|
||||
|
||||
### Compatibility Notes
|
||||
|
||||
* Backward compatibility preserved: Yes
|
||||
* Breaking changes introduced: No
|
||||
* Deprecations introduced: No
|
||||
|
||||
---
|
||||
|
||||
## 6. Validation & Evidence
|
||||
|
||||
| Evidence Type | Tool/Workflow | Result | Notes |
|
||||
|--------------|---------------|--------|-------|
|
||||
| Linter | ruff, eslint | ✓ | PR #24 |
|
||||
| Smoke Tests | pytest test/smoke | ✓ | PR #24, run 22984306614 |
|
||||
| Quality Tests | pytest test/smoke test/quality | ✓ | Post-merge 22984445599 |
|
||||
| Coverage | ≥40% gate | ✓ | Quality Tests |
|
||||
| verify_pinned_deps | scripts/ci/verify_pinned_deps.sh | ✓ | Quality Tests |
|
||||
| pip-audit | Informational | ⚠ | Deferred M27 |
|
||||
|
||||
---
|
||||
|
||||
## 7. CI / Automation Impact
|
||||
|
||||
* Workflows affected: None (unchanged)
|
||||
* Checks added/removed: None
|
||||
* Enforcement: Unchanged
|
||||
* Signal drift: None observed
|
||||
|
||||
CI blocked incorrect changes (would fail if snapshot missing or wrong). CI validated correct changes (smoke + quality pass).
|
||||
|
||||
---
|
||||
|
||||
## 8. Issues, Exceptions, and Guardrails
|
||||
|
||||
No new issues were introduced during this milestone.
|
||||
|
||||
---
|
||||
|
||||
## 9. Deferred Work
|
||||
|
||||
* pip-audit vulnerabilities: Pre-existing from M04; deferred to M27. Status unchanged.
|
||||
|
||||
---
|
||||
|
||||
## 10. Governance Outcomes
|
||||
|
||||
* Runtime seam stack now includes snapshot threading: fourth Phase II seam
|
||||
* First deterministic runtime boundary: generation pipeline reads save-related config from p.opts_snapshot
|
||||
* Invariants preserved and verified by CI
|
||||
|
||||
**What is now provably true that was not provably true before?** The generation runtime reads save-related options from a deterministic snapshot (p.opts_snapshot) rather than global shared.opts within process_images_inner.
|
||||
|
||||
---
|
||||
|
||||
## 11. Exit Criteria Evaluation
|
||||
|
||||
| Criterion | Status | Evidence |
|
||||
|-----------|--------|----------|
|
||||
| Snapshot used in generation runtime | Met | p.opts_snapshot.foo in process_images_inner |
|
||||
| Safe options migrated | Met | 12 opts migrated |
|
||||
| CI fully green | Met | Linter, Smoke, Quality ✓ |
|
||||
| No behavior change | Met | Smoke + quality pass |
|
||||
| Milestone artifacts generated | Met | Plan, toolcalls, run1, run2, audit, summary |
|
||||
| Ledger updated | Met | docs/serena.md |
|
||||
| Tag created | Met | v0.0.08-m08 |
|
||||
|
||||
---
|
||||
|
||||
## 12. Final Verdict
|
||||
|
||||
Milestone objectives met. Refactor verified safe. Proceed to M09.
|
||||
|
||||
---
|
||||
|
||||
## 13. Authorized Next Step
|
||||
|
||||
M09 — Execution context seam. No additional constraints.
|
||||
|
||||
---
|
||||
|
||||
## 14. Canonical References
|
||||
|
||||
* Commit: 710a0abd (merge)
|
||||
* PR: #24 (https://github.com/m-cahill/serena/pull/24)
|
||||
* CI Run 1 — Linter: 22984306617; Smoke: 22984306614
|
||||
* CI Run 2 — Quality: 22984445599
|
||||
* Tag: v0.0.08-m08
|
||||
* Documents: docs/milestones/M08/M08_plan.md, M08_run1.md, M08_run2.md, M08_audit.md, M08_summary.md
|
||||
|
|
@ -11,3 +11,5 @@ Implementation toolcalls for Cursor execution.
|
|||
| 2026-03-12 | gh run watch | Monitor Linter 22984306617 | — | Done ✓ |
|
||||
| 2026-03-12 | gh run watch | Monitor Smoke Tests 22984306614 | — | Done ✓ |
|
||||
| 2026-03-12 | write | Generate M08_run1.md CI report | docs/milestones/M08/M08_run1.md | Done |
|
||||
| 2026-03-12 | write | Generate M08_audit.md per RefactorMilestoneAuditPrompt | docs/milestones/M08/M08_audit.md | Done |
|
||||
| 2026-03-12 | write | Generate M08_summary.md per RefactorSummaryPrompt | docs/milestones/M08/M08_summary.md | Done |
|
||||
|
|
|
|||
3
docs/milestones/M09/M09_plan.md
Normal file
3
docs/milestones/M09/M09_plan.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# M09 Plan — Execution Context Seam
|
||||
|
||||
(To be populated.)
|
||||
5
docs/milestones/M09/M09_toolcalls.md
Normal file
5
docs/milestones/M09/M09_toolcalls.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# M09 Toolcalls — Execution Context Seam
|
||||
|
||||
Implementation toolcalls for Cursor execution.
|
||||
|
||||
(To be filled during milestone execution.)
|
||||
|
|
@ -137,6 +137,7 @@ Core principles:
|
|||
| 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 |
|
||||
| M08 | Opts snapshot threading | Completed | m08-snapshot-threading | #24 | 710a0abd | Quality 22984445599 ✓ | 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).
|
||||
|
||||
|
|
@ -144,6 +145,8 @@ Core principles:
|
|||
|
||||
**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.
|
||||
|
||||
**M08:** Threaded p.opts_snapshot into process_images_inner for save-related reads. Fourth Phase II runtime seam. Migrated 12 opts (save_images_before_face_restoration, samples_format, grid_save, etc.) from shared.opts to p.opts_snapshot. save_samples(), sample_hr_pass(), metadata unchanged. Enables M09 execution context.
|
||||
|
||||
---
|
||||
|
||||
## 5. Standing Invariants
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue