Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .clara/plans/b42fb30e-2f22-45f0-9d27-00d9e67a58bf/AMENDMENT_001.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Amendment 001 — post-close evidence recovery route

Date: 2026-09-11 America/Chicago
Change: `b42fb30e-2f22-45f0-9d27-00d9e67a58bf`
Supersedes only the PRE/PLAN assumption that ignored OvernightLab generated evidence still exists in the closed `ff2f318b...` worktree and can be copied from there. All other scope, safety, and results-first constraints remain in force.

## New direct evidence

1. PR #9 merge closed change `ff2f318b-245d-418a-b86f-e07d55b19826`; its worktree is now absent.
2. Bounded searches found no old `overnight-20260910T160337Z-501dd433` directory, `TFTMAC_OVERNIGHT.sqlite`, or `active-campaign.txt` in remaining TFTMAC worktrees, `/Volumes/MAC MINI M4/TFTMAC`, user Trash, Clara durable areas searched, Spotlight results, or local Time Machine snapshots.
3. `tmutil listlocalsnapshots` reports no local snapshots for `/Volumes/MAC MINI M4` or `/`.
4. The authoritative DEV native capture root is `~/Library/Application Support/TFTMAC/Modes/advanced_diagnostics/Captures`, not the generic historical `~/Library/Application Support/TFTMAC/Captures` path used by an earlier bounded check.
5. Twelve Sept. 10 advanced-diagnostics capture directories remain in that native capture root for the relevant campaign window, each with `TFTMAC_NATIVE_RUNTIME.sqlite`. The final saved-run launch maps to capture `2026-09-10T22-43-10.664Z-a5718134-6211-4bcb-8bd6-c17b134e8a6f`, whose native DB remains present at 7,368,704 bytes. A later retained capture `2026-09-10T19-45-09.532Z-9d9d31f1-4359-4b57-bd0b-4ed818d72db8` remains present with a 20,217,856-byte native DB.

## Classification

This is a **BLOCKING DEPENDENCY for the original copy-from-closed-worktree preservation step**, not a reason to stop the project and not a reason to rerun resolved performance candidates. The derived OvernightLab campaign DB/screenshots/reports that lived only as ignored worktree files cannot be truthfully claimed recovered from current local storage. However, the authoritative native session telemetry survives externally, and merged source plus current record books preserve the verified decisions/winner.

## Revised execution contract

1. Keep the minimal wrapper/source repair already defined.
2. Install the small merged OvernightLab source/config/classifier helper into `/Volumes/MAC MINI M4/TFTMAC/OvernightLab` without touching Control/LKG/DEV runtime binaries.
3. Do **not** create a fake replacement for the lost old `TFTMAC_OVERNIGHT.sqlite`, campaign screenshots, or result files. Record their absence explicitly.
4. Inventory and seal the surviving relevant native capture directories/SQLite identities needed for continuity. These remain the primary raw performance evidence.
5. Initialize a fresh OvernightLab database only through normal current controller startup/self-test behavior; historical verified decisions remain sourced from `CHANGELOG.md`/`project.md` and surviving native captures, not synthesized rows.
6. Update `project.md` and `CHANGELOG.md` with the continuity fact: PR #9 merged; derived ignored worktree layer was removed with closed-worktree cleanup and has no local snapshot recovery route; authoritative native captures remain available and are the recovery evidence source.
7. Run installed `verify-static`, `self-test`, and `fault-test`. No gameplay/performance candidate is run in this continuity repair.
8. Preserve the current automatic queue as `control` only. Do not automatically resume the stale historical campaign identity, because its campaign DB/checkpoint no longer exists at the live layer.
9. Source validation/review/CI/merge and local live-install verification remain required.

## Acceptance adjustment

The old requirement "stale old campaign is reconciled in its original OvernightLab DB" is superseded because that DB is no longer locally recoverable. Replacement acceptance is: the loss is truthfully documented; surviving native captures are proven present; the new live OvernightLab starts from current authority without inventing historical rows; and no resolved candidate is replayed merely to reconstruct deleted derived telemetry.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Amendment 002 — incremental-gains optimization doctrine

Date: 2026-09-11 America/Chicago
Change: `b42fb30e-2f22-45f0-9d27-00d9e67a58bf`
Trigger: explicit Flash scope/goal clarification in the current bound TFTMAC conversation.

## User outcome

Continuous useful 60 FPS remains the ultimate product target, but it is **not** the minimum success threshold for each experiment. The active optimization strategy is cumulative: expose and test small existing/research-backed settings one factor at a time, retain every **verified repeatable net improvement**, layer the next candidate on top of the latest winner, and determine empirically whether those small gains compound toward continuous 60 FPS.

If a candidate does not improve the game, is inconclusive, or regresses it, record the exact failure/result, restore the latest winner, and move on. Do not spend the pass building infrastructure merely to explain a loser.

## Authority correction

Current `facts.md`, `project.md`, `CHANGELOG.md`, and recovery constraints already describe cumulative verified-net-win promotion, but `facts.md`, `benchmark.md`, `dev.md`, the Swift benchmark decision engine, and its tests still contain a legacy **5% weighted-FPS promotion/rejection floor**. That floor conflicts with the clarified user goal because a legitimate 1–4% improvement could be rejected before it can compound.

## Revised decision semantics

1. `HOME_RUN` remains a label for a large/broad win. Its existing strong thresholds may remain as a standout classification.
2. `PROMISING` becomes the bounded-screen classification for an **incremental positive candidate**: there is at least one directly measured improvement signal and no material veto/regression that outweighs it. There is no fixed +5% weighted-FPS minimum.
3. `REJECT` is reserved for correctness/usability failure or material measured regression, not merely for failing to clear an arbitrary positive-gain percentage.
4. `INCONCLUSIVE` remains for invalid/mismatched evidence or a result that does not establish a directional net gain or regression.
5. A `PROMISING`/incremental win is not automatically permanent from one noisy sample. It requires the existing confirmation discipline. Once the improvement is repeatable and net-positive with no correctness/stability/compatibility/severe-tail veto, promote it as the next `DEV-B8-WIN-##` baseline.
6. 60 FPS remains the cumulative destination and full-run success condition. Until achieved, report the remaining deficit; do not reject a smaller verified step merely because it does not independently reach 60.
7. Existing historical decisions are not rewritten solely because the doctrine changed. Rejected candidates remain rejected unless new evidence/mechanism gives a specific reason to reopen them.

## Implementation scope

- Update `facts.md`, `project.md`, `CHANGELOG.md`, `benchmark.md`, and `dev.md` so this cumulative doctrine is explicit and no current authority says sub-5% gain alone is rejection.
- Update `tftmac/Runtime/CombatBenchmarkAnalysis.swift` to remove the legacy `<5% weighted FPS => REJECT` gate and classify small clean directional improvements as `PROMISING` while preserving correctness and material-tail vetoes.
- Update `Tests/TFTMACTests/CombatBenchmarkAnalysisTests.swift` with explicit sub-5% incremental-win coverage, neutral/no-signal inconclusive coverage, correctness rejection, and material-regression rejection.
- Refresh authority-input hashes/STACK lock as required by repository validation.
- Preserve the already-repaired OvernightLab live continuity work in this same change.
- Revalidate, republish PR #10 at the new exact SHA, require fresh exact-SHA CI, merge, and verify the local source-only live layer.

## Simplest correct code rule

Do not introduce a new scoring framework or new decision enum. Reuse the existing `PROMISING` classification.

After validity/correctness and the existing 10% p95/p99 material-regression veto:

- evaluate `HOME_RUN` first;
- classify `PROMISING` when one of these directly measured families improves: weighted FPS; 1% low; both p95 and p99 frame intervals; or smoothness (jank/severe/missed-vsync) without introducing a material conflicting regression;
- classify an exact/no-directional-change result as `INCONCLUSIVE`, not `REJECT`;
- keep `REJECT` for correctness failure or material regression.

This deliberately removes the false 5% floor without constructing a synthetic weighted score whose weights would be arbitrary.

## ZenGate

PASS. The scope is an explicit user-goal correction and removes a contradictory false gate. The smallest viable mechanism is to revise the existing decision semantics and tests; no new service, datastore, framework, candidate matrix, runtime copy, or telemetry architecture is needed.

`ZENMC_NOT_REQUIRED`: this changes deterministic comparison classification only; it does not add asynchronous lifecycle, recovery, concurrency, cutover, or external-effect state.

## Acceptance

- No current authority or executable decision path rejects a valid candidate solely because weighted FPS gain is below 5%.
- A small directly measured clean gain can reach `PROMISING` and, after existing confirmation, become the next working winner.
- Neutral/no-signal evidence remains `INCONCLUSIVE` rather than a fabricated win.
- Correctness failure and material p95/p99 regression still reject.
- Existing `HOME_RUN` large-win semantics remain available.
- Full source validation and fresh PR exact-SHA CI pass.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Implementation Plan — finish the merged OvernightLab live layer and continuity

Supersedes no performance plan and admits no new optimization candidate. It continues the merged Sept-10 results-first obligation only far enough to make the already-approved local control plane truthful, durable, and resumable.

## Execution contract

1. Add a minimal `OvernightLab/install.command` that installs only source/config/controller material plus the existing classifier source/build helper into `/Volumes/MAC MINI M4/TFTMAC`, preserves existing generated evidence, compiles the classifier, and performs static verification. It must not copy or alter Control, DEV app, SDK, emulator, AVD, system image, TFT package, credentials, or unrelated project files.
2. Add a minimal `OvernightLab/run-overnight-campaign.command`: `--self-test` runs controller self-test plus fault-test; ordinary arguments execute the existing `campaign` CLI under `caffeinate`. Do not duplicate campaign state logic in shell.
3. Update `project.md` current state so the active change is `b42fb30e-2f22-45f0-9d27-00d9e67a58bf`, PR #9 merge SHA is recorded, and the old RUNNING campaign is not presented as live after reconciliation.
4. Append `CHANGELOG.md` with the post-merge continuity/live-layer result. Keep `DEV-B8-WIN-01`; no performance version promotion occurs.
5. Validate source locally before live effects.
6. Install the small control plane into the external TFTMAC root.
7. Copy/merge only the ignored historical OvernightLab evidence from the closed `ff2f...` worktree into the live OvernightLab location, preserving source from the new install and preserving generated evidence byte-for-byte. Never delete the source evidence origin until durable preservation is proven.
8. Verify copied evidence identities/counts/hashes at a bounded representative level and preserve the database/campaign directories completely.
9. Reconcile `overnight-20260910T160337Z-501dd433` against actual host state using existing `reconcile_resume` without entering `run_campaign`. Expected result: stale RUNNING becomes recovered/interrupted with baseline restored; no candidate replay.
10. Regenerate the historical report after reconciliation and verify it remains available.
11. Run installed `verify-static`, `self-test`, and `fault-test`. Confirm no TFTMAC DEV/qemu campaign process was started by those validations.
12. Re-read current `facts.md` and `project.md`; resolve any new factual drift before finalization.
13. Run repository validation, review exact diff, checkpoint/publish, deliver PR, require exact-SHA CI green, merge, and reconcile clean source state.
14. Because this repository is SOURCE_ONLY, independently verify the local installed control-plane hashes/acceptance after merge. Do not invent a remote deployment.
15. Stop this repair at the current results-first decision boundary. The existing automatic queue remains `control` only. A future performance test requires one deliberately admitted, evidence-backed hypothesis from the then-current authority; resolved P1/P2/P3 and rejected transport candidates are not rerun automatically.

## Exclusions

No new app/runtime/SDK/AVD copy. No Control/LKG mutation. No storage cleanup. No new VM/builder. No generic telemetry expansion. No unbounded profiling. No gameplay/performance candidate during this repair. No resurrection of PBE, direct Vulkan, buffer-retention, queue-submit-inline, virtual-queue-off, fence-contexts-off, or historical global-sync as a current candidate.

## Acceptance proof

Green source validation + exact source diff/review + live install hash parity + installed static/self/fault tests + preserved historical evidence + non-running reconciled stale campaign + exact-SHA GitHub CI + merge + clean selected worktree/local post-merge live verification.
58 changes: 58 additions & 0 deletions .clara/plans/b42fb30e-2f22-45f0-9d27-00d9e67a58bf/PREFLIGHT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Preflight — post-merge TFTMAC OvernightLab continuity repair

Date: 2026-09-10 America/Chicago
Change: `b42fb30e-2f22-45f0-9d27-00d9e67a58bf`
Completion class: IMPLEMENT_SHIP
Base: merged `master` SHA `bf61c21a723f2f132834acedda860efbb2223d42`

## Controlling authority

Read and adopted in this fresh Zoe session: current `facts.md`, `project.md`, `CHANGELOG.md`, and `.clara/plans/ff2f318b-245d-418a-b86f-e07d55b19826/RECOVERY_CONSTRAINTS_2026-09-10.md`.

Current DEV authority is `DEV-B8-WIN-01`: official TFT `18.1-5423749` / `8423749`, 1920x1080 / 320 DPI / 60 Hz, effective 8 vCPU / 6144 MiB, host GPU/CoreAudio, selected game RHI `OPENGL_ES_ANGLE`, multifile cache ON, `preferSubmitAtFBOBoundary` disabled, and `syncMonolithicPipelinesToBlobCache` removed. Protected Control/LKG remains immutable.

## Saved-point reconciliation

1. Saved change `ff2f318b-245d-418a-b86f-e07d55b19826` published exact SHA `9674294dd557a8ed7250c34deb6e9ca3f8d05f86`.
2. Exact GitHub check `Validate TFTMAC` run `34559035858`, job `103137754606`, completed SUCCESS on that SHA.
3. PR #9 was then squash-merged as `bf61c21a723f2f132834acedda860efbb2223d42`; the prior managed change is correctly closed.
4. The ignored historical OvernightLab evidence still exists in the closed worktree, including the campaign/database data recorded by the saved checkpoint. It must not be lost merely because the source change merged.
5. The old campaign `overnight-20260910T160337Z-501dd433` has a stale `RUNNING` checkpoint, but current host reconciliation found no OvernightLab controller, TFTMAC DEV core, or owned qemu/5586 process. Its last run reached Tocker stage 1-5 but has no `result.json`; it is interrupted historical evidence, not a current promotion result.
6. `/Volumes/MAC MINI M4/TFTMAC/OvernightLab` does not currently exist. Therefore the plan's required local live layer is not actually installed despite README claims.
7. Merged source contains `OvernightLab/overnight_lab.py`, `README.md`, schema, authority, and manifest, but README references `install.command` and `run-overnight-campaign.command` that are absent.
8. `overnight_lab.py` derives `PROJECT_ROOT` as its parent and requires `tools/tft-screen-classifier.swift` plus `scripts/build-tft-screen-classifier.command`; a naive copy of only the OvernightLab directory would fail static acceptance.
9. Current manifest automatic queue is only `control`; all previously admitted fast-pass optimization families are already resolved in the current record books. This repair must not silently add or rerun a performance candidate.

## Simplest correct mechanism

Add only the missing source-controlled install and campaign wrapper seams. The installer copies the small OvernightLab source/config plus exactly the classifier source/build helper needed by the existing code into `/Volumes/MAC MINI M4/TFTMAC`, compiles the classifier, and runs static verification. It never copies an app, SDK, emulator, AVD, system image, game package, or credentials.

Separately, before the closed worktree can be reclaimed, preserve its ignored runtime evidence into the new live OvernightLab location without deleting or rewriting it. Reconcile the stale campaign checkpoint against actual host state using the already-implemented `reconcile_resume` behavior, but do not run or resume a candidate as part of reconciliation.

## Required source/document corrections

- Add `OvernightLab/install.command`.
- Add `OvernightLab/run-overnight-campaign.command`.
- Correct `project.md` current-state text that still names the now-merged/closed `ff2f...` change as active; name this continuation change and record PR #9 merge/live-layer recovery state.
- Append a continuity entry to `CHANGELOG.md` for this tooling/live-layer repair. Do not create a new `DEV-B8-WIN-##` because no performance candidate is being tested.
- Update README command semantics only if required by the implemented wrapper behavior.
- `facts.md` changes only if a newly verified hard project fact requires it; current performance/runtime authority remains unchanged.

## Acceptance

- Protected Control and frozen LKG are never mutated.
- Closed-worktree ignored telemetry is durably preserved before any possible worktree cleanup.
- Live install exists at `/Volumes/MAC MINI M4/TFTMAC/OvernightLab` and contains no forbidden runtime/app copies.
- Installed source/config hashes match the selected managed source.
- Classifier builds and self-tests at the installed location.
- `verify-static`, `self-test`, and `fault-test` pass from the installed location.
- Stale old campaign is reconciled to a non-running interrupted/recovered historical state without replaying it; its evidence remains readable/reportable.
- No new gameplay/performance candidate runs during this repair.
- Source validator passes, diff/review is clean, and the selected worktree finishes clean.
- Source is delivered through PR/CI/merge. Project deployment profile is SOURCE_ONLY; the requested live layer for this change is the verified local install.

## ZenGate / ZenMC qualification

ZenGate basis: the missing live-install seam is a proven blocker to the already-approved live layer, and the proposed additions survive the removal test. No new architecture, service, scheduler, store, runtime clone, or experimental family is introduced.

`ZENMC_NOT_REQUIRED` for the new source delta: the wrappers add no new lifecycle/state semantics. Campaign recovery, locking, rollback, quarantine, and resume behavior remain owned by the existing previously-tested Python controller. This change validates those existing recovery paths rather than redesigning them.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ assert(tests.includes('testRuntimeModeRegistrySelectsReceiptedDiagnosticsAndReje
const testCount = fs.readdirSync(absolute('Tests/TFTMACTests'))
.filter((name) => name.endsWith('.swift'))
.reduce((total, name) => total + (readText(`Tests/TFTMACTests/${name}`).match(/^ func test/gm) ?? []).length, 0);
assert(testCount === 110, `expected 110 native tests, found ${testCount}`);
assert(testCount === 112, `expected 112 native tests, found ${testCount}`);

console.log(JSON.stringify({
state: 'DIAGNOSTIC_FIRST_BOOT_SOURCE_PASS',
Expand Down
Loading
Loading