Skip to content

Commit 6e492ac

Browse files
committed
fix: harden restore cache CI checkpoint
1 parent aa39041 commit 6e492ac

8 files changed

Lines changed: 311 additions & 58 deletions
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
date: 2026-04-20
3+
topic: mainline-checkpoint-ci-hardening-and-post-m8-direction
4+
---
5+
6+
# Mainline Checkpoint: CI Hardening and Post-M8 Direction Requirements
7+
8+
## Problem Frame
9+
10+
`main` is no longer missing evidence.
11+
`main` is missing a clean checkpoint.
12+
13+
Three things drifted at once:
14+
15+
- the newest mainline truth moved from post-M7 closure into `M8.1` through `M8.18` foundation-readiness inspectability work,
16+
- the current EN/ZH progress pages still carry outdated framing in their top-level time window and delivery-focus narrative,
17+
- the most recent `Migration Gates` failure on `main` was not an architecture regression but a Windows timing-sensitive cache-restore test, and that distinction needs to be captured accurately before the next lane choice.
18+
19+
This checkpoint re-baselines current code and docs on 2026-04-20, closes the restore-cache CI timing hole, and makes the next primary direction explicit.
20+
21+
## Verified Mainline Reality (2026-04-20)
22+
23+
- `main` already carries the full bounded notification-threshold governance closure through `M7.29`.
24+
The current route family is coherent and should now be treated as closed unless a materially new operator need appears.
25+
- `main` already carries the full bounded foundation-readiness inspectability chain through `M8.18`:
26+
- readiness bundle/report generation,
27+
- typed readiness route,
28+
- query/vector boundary evidence,
29+
- graph/vector signal semantics,
30+
- provenance,
31+
- promotion criteria and derived ids,
32+
- runtime parity for gates, blockers, recommendations, and the full criterion matrix.
33+
- current foundation status on `main` is still:
34+
- `status = in_progress`
35+
- `decision = no-go`
36+
- `graphBackendIndependent = false`
37+
- `vectorAdapterIndependent = false`
38+
- the latest published `main` CI state is green, not red:
39+
- `Migration Gates` run `24703509626` succeeded,
40+
- `Fixrisk Operational Readiness` run `24703509639` succeeded,
41+
- `Mobile E2E Detox Contracts` run `24703509627` succeeded,
42+
- `Docs Diataxis Site` run `24703509663` succeeded,
43+
- `Docs GitHub Pages Publish` run `24703509632` succeeded.
44+
- the last confirmed `main` CI failure was a transient Windows flake, not a readiness-status change:
45+
- workflow `Migration Gates`, run `24702925778`,
46+
- failing job `desktop-migration-suite`,
47+
- failing test `src/server.migration.test.ts` named-target cache restore coverage,
48+
- failure mode `Exceeded timeout of 20000 ms for a test`.
49+
50+
## Deep Comparison: Prior Requirements vs Current Code
51+
52+
| Prior source | Earlier direction | Current code reality | Judgment | Consequence |
53+
|---|---|---|---|---|
54+
| `docs/brainstorms/2026-04-16-mainline-ci-stabilization-and-m7-direction-requirements.md` | finish bounded M7 work, then shift to foundation readiness | `M7.29` is landed and `M8.1`-`M8.18` already executed on `main` | partially stale | current docs must stop speaking as if the lane switch is still pending |
55+
| `docs/brainstorms/2026-04-19-mainline-progress-reconciliation-and-post-m7-direction-requirements.md` | post-M7 truth pass, recommend M8 readiness execution | recommendation was correct, but execution already advanced far beyond the initial M8 entry slice | needs superseding checkpoint | current checkpoint should record delivered M8 inspectability scope, not re-propose it |
56+
| `docs/diataxis/en/explanation/development-progress-dashboard.md` | delivery focus still framed as staged L4/L5 integration into `main` | current mainline work is now checkpoint hygiene plus CI hardening, not basic integration catch-up | stale framing | top-level dashboard sections should stop narrating old integration anxiety |
57+
| `docs/diataxis/en/explanation/foundation-reentry-readiness-checklist.md` | anti-overclaim gate and readiness contract | still correct, but missing the latest CI timing-failure interpretation and checkpoint date | still valid but incomplete | checklist should distinguish runtime-truth from CI-flake recovery |
58+
| `src/server.migration.test.ts` + `src/server.ts` | restore-cache dedupe implicitly proved by sequential duplicate request | sequential duplicate request depended on the second request landing inside a three-second suppression window after the first restore began | timing-sensitive on slow Windows runners | dedupe proof should become in-flight and deterministic |
59+
60+
## Critical Findings
61+
62+
1. `M8` inspectability work is already beyond “entry” status.
63+
Any document still framing foundation readiness as merely a future bridge is lagging behind code reality.
64+
65+
2. The latest remote `main` CI problem was a flake, not a current outage.
66+
Treating it as an active red-main incident would be factually wrong.
67+
68+
3. The restore-cache flake came from a bad test assumption, not just slow hardware.
69+
The old test assumed a sequential duplicate restore would still hit the three-second suppression window after the first restore path completed.
70+
That assumption is weak on a loaded Windows runner because the first restore can consume enough time to push the second request outside the dedupe window.
71+
72+
4. Another M8 runtime-parity micro-slice is not the highest-leverage next move.
73+
After `M8.18`, continuing inspectability-only increments without a fresh lane decision is local optimization.
74+
75+
## Requirements
76+
77+
**Checkpoint Truth Refresh**
78+
- R1. Add a fresh 2026-04-20 checkpoint requirements document instead of silently rewriting the 2026-04-19 record.
79+
- R2. EN/ZH progress dashboards must update their top-level time window, current delivery focus, and current priority narrative to match the real `main` state after `M8.18`.
80+
- R3. EN/ZH readiness checklist pages must record that the last `main` CI failure was run `24702925778`, while the latest published `main` runs are green.
81+
- R4. The new checkpoint must state clearly that `main` remains `in_progress` / `no-go` for foundation promotion, despite the expanded readiness inspectability surface.
82+
83+
**CI Hardening**
84+
- R5. Named-target cache restore dedupe must no longer depend on a sequential duplicate request arriving inside a narrow timing window after the first restore copy path completes.
85+
- R6. `/api/restore-cache` must suppress in-flight duplicate restore requests for the same target using runtime state, while preserving the existing short post-completion suppression behavior for immediate repeats.
86+
- R7. The migration contract test must assert deterministic in-flight dedupe instead of timing-sensitive sequential dedupe.
87+
- R8. CI hardening must preserve existing endpoint semantics:
88+
- first restore still materializes `data.js` and `graph_data.json`,
89+
- duplicate restore still returns `success: true` with `deduped: true`,
90+
- missing cache behavior must remain unchanged.
91+
92+
**Post-M8 Direction Governance**
93+
- R9. The current primary lane must be described as `checkpoint closure + CI hardening`, not “keep extending M8 runtime parity”.
94+
- R10. After this checkpoint lands, the next planning round should default to foundation backend independence work, not another inspectability-only increment.
95+
- R11. Notification-threshold governance must remain explicitly closed after `M7.29`; no `M7.30+` planning should resume without a new operator requirement.
96+
- R12. Markdown-reader and broader product-surface work remain secondary until the next lane is chosen deliberately against the checkpointed mainline truth.
97+
98+
## Success Criteria
99+
100+
- A new checkpoint document exists and becomes the top current source-of-truth item in `docs/brainstorms/index.md`.
101+
- EN/ZH progress dashboards and EN/ZH readiness checklists are updated section-by-section to reflect current mainline truth and the CI recovery interpretation.
102+
- `src/server.ts` and `src/server.migration.test.ts` no longer rely on timing-sensitive sequential restore dedupe assumptions.
103+
- Local verification passes for migration, runtime contracts, readiness verification, and docs build.
104+
- The branch is pushed to `main`, remote CI is re-triggered from the hardened commit, and the worktree is clean afterward.
105+
106+
## Scope Boundaries
107+
108+
- This checkpoint does not claim graph backend or vector backend independence landed on `main`.
109+
- This checkpoint does not reopen notification-threshold route expansion.
110+
- This checkpoint does not start markdown-reader execution work.
111+
- This checkpoint does not choose or implement a new backend persistence engine.
112+
113+
## Key Decisions
114+
115+
- **Create a new checkpoint doc instead of mutating the 2026-04-19 record**: historical reasoning stays auditable and the new checkpoint can speak plainly about what actually landed after that date.
116+
- **Fix the restore-cache flake at the runtime contract boundary, not by hand-waving CI**: the timing-sensitive test assumption is the weak point, so both runtime dedupe semantics and the test proof should become deterministic.
117+
- **Freeze inspectability-only expansion after `M8.18`/checkpoint hardening**: current marginal value is lower than backend-independence planning or other broader product work.
118+
- **Describe remote CI honestly**: `main` is currently green, and the job here is recurrence hardening plus checkpoint documentation, not incident-response theater.
119+
120+
## Dependencies / Assumptions
121+
122+
- Verification commands remain available and representative:
123+
- `npm run test:migration`
124+
- `npm run test:agent-workspace:contracts`
125+
- `npm run verify:agent-workspace:runtime`
126+
- `npm run verify:foundation:readiness`
127+
- `npm run docs:diataxis:check`
128+
- `npm run docs:site:build`
129+
- Published GitHub Actions history remains available through `gh run view` for run-level evidence.
130+
131+
## Outstanding Questions
132+
133+
### Deferred to Planning
134+
- [Affects R10][Technical] Which concrete backend-independence slice should lead the next foundation round: graph persistence independence, vector independence, or a thinner readiness gate around one of them?
135+
- [Affects R12][Needs research] After backend-independence planning is refreshed, does markdown-reader governance still merit the next user-facing lane, or has agent/product-side value overtaken it?
136+
137+
## Next Steps
138+
139+
-> /ce:plan for post-checkpoint foundation backend independence planning, after this CI hardening and documentation checkpoint lands on `main`.

docs/brainstorms/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This page tracks active and archived brainstorming outputs used before implement
44

55
## Current
66

7+
- [2026-04-20 Mainline Checkpoint: CI Hardening and Post-M8 Direction Requirements](2026-04-20-mainline-checkpoint-ci-hardening-and-post-m8-direction-requirements.md)
78
- [2026-04-19 Mainline Progress Reconciliation and Post-M7 Direction Requirements](2026-04-19-mainline-progress-reconciliation-and-post-m7-direction-requirements.md)
89
- [2026-04-16 Mainline CI Stabilization and M7 Direction Requirements](2026-04-16-mainline-ci-stabilization-and-m7-direction-requirements.md)
910
- [2026-04-14 Mainline Reality Reconciliation and Next Direction Requirements](2026-04-14-mainline-reality-reconciliation-and-next-direction-requirements.md)

docs/diataxis/en/explanation/development-progress-dashboard.md

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ It explicitly separates branch-level implementation status from mainline integra
66
## Scope
77

88
- Focus area: local-first knowledge mastery platform (ingest, retrieval, learning path, tutor, memory, governance).
9-
- Time window: `v1.7.0` through 2026-04-14 alignment cycle.
9+
- Time window: `v1.7.0` through the 2026-04-20 checkpoint and 2026-04-21 UTC CI review cycle.
1010
- Evidence rule: every progress claim must map to:
1111
- contract layer (`src/learning/api.ts`, `src/learning/types.ts`),
1212
- route/runtime layer (`src/server.ts`),
@@ -15,13 +15,18 @@ It explicitly separates branch-level implementation status from mainline integra
1515
## Current Delivery Focus
1616

1717
Current top priority is not feature-count expansion.
18-
Current top priority is **clean staged integration** of major L4/L5 progress into `main`.
18+
Current top priority is **checkpoint closure**:
19+
20+
- truth-refresh the EN/ZH progress narrative against the real `main` state after `M8.18`,
21+
- harden the Windows restore-cache migration path so `main` CI does not depend on a timing-sensitive duplicate-request assumption,
22+
- keep the next lane choice disciplined instead of drifting into more inspectability-only micro-slices.
1923

2024
Execution anchor:
2125

26+
- [Mainline Checkpoint: CI Hardening and Post-M8 Direction Requirements (2026-04-20)](../../../brainstorms/2026-04-20-mainline-checkpoint-ci-hardening-and-post-m8-direction-requirements.md)
27+
- [Mainline Progress Reconciliation and Post-M7 Direction Requirements (2026-04-19)](../../../brainstorms/2026-04-19-mainline-progress-reconciliation-and-post-m7-direction-requirements.md)
2228
- [Mainline CI Stabilization and M7 Direction Requirements (2026-04-16)](../../../brainstorms/2026-04-16-mainline-ci-stabilization-and-m7-direction-requirements.md)
2329
- [Mainline Reality Reconciliation and Next Direction Requirements (2026-04-14)](../../../brainstorms/2026-04-14-mainline-reality-reconciliation-and-next-direction-requirements.md)
24-
- [Mainline Integration Progress Gap Closure Requirements (2026-04-14)](../../../brainstorms/2026-04-14-mainline-integration-progress-gap-requirements.md)
2530

2631
## Latest Mainline Increment (2026-04-14 M1 Baseline)
2732

@@ -366,6 +371,23 @@ Execution anchor:
366371
- decision stays `no-go`,
367372
- criterion-matrix parity improves inspectability only; it does not relax graph/vector independence requirements.
368373

374+
## Latest Mainline Increment (2026-04-20 M8.19 Windows Restore-Cache CI Hardening)
375+
376+
- Root-caused the last transient `main` CI failure as a timing-sensitive restore-dedupe contract, not a readiness-status regression:
377+
- failing workflow run: `Migration Gates` `24702925778`,
378+
- failing job: `desktop-migration-suite`,
379+
- failing test: named-target cache restore coverage in `src/server.migration.test.ts`.
380+
- Hardened runtime dedupe semantics in `src/server.ts`:
381+
- `/api/restore-cache` now suppresses in-flight duplicate restore requests for the same target with active runtime state,
382+
- the original short post-completion dedupe window remains in place for immediate repeat requests,
383+
- named-target asset resolution/copy now runs through the same bounded restore helper instead of a serial, inline branch.
384+
- Rewrote the migration proof so it is deterministic on slower Windows runners:
385+
- `src/server.migration.test.ts` now asserts named-target stats separately,
386+
- duplicate restore coverage now sends the second restore request while the first is in flight, so the test no longer depends on the first copy finishing inside a three-second suppression window.
387+
- Published-mainline interpretation remains honest:
388+
- latest published `main` runs are already green (`24703509626`, `24703509639`, `24703509627`, `24703509663`, `24703509632`),
389+
- this slice is recurrence hardening, not red-main incident response.
390+
369391
## Latest Mainline Increment (2026-04-20 M8.13 Foundation Readiness Provenance Evidence)
370392

371393
- Added machine-readable provenance so operator tooling can tell whether readiness is reading the runtime project root or falling back to real repo evidence:
@@ -945,11 +967,11 @@ This dashboard aligns against the following requirement chain:
945967
- [2026-04-13 Markdown Reader Upgrade Alignment](../../../brainstorms/2026-04-13-markdown-reader-upgrade-alignment-requirements.md)
946968
- [2026-04-14 Agent Workspace Contract Closure Next Direction](../../../brainstorms/2026-04-14-agent-workspace-contract-closure-next-direction-requirements.md)
947969
- [2026-04-14 Mainline Integration Gap Closure](../../../brainstorms/2026-04-14-mainline-integration-progress-gap-requirements.md)
948-
- [2026-04-14 Mainline Reality Reconciliation and Next Direction](../../../brainstorms/2026-04-14-mainline-reality-reconciliation-and-next-direction-requirements.md)
970+
- [2026-04-20 Mainline Checkpoint: CI Hardening and Post-M8 Direction](../../../brainstorms/2026-04-20-mainline-checkpoint-ci-hardening-and-post-m8-direction-requirements.md)
949971
- [2026-04-16 Mainline CI Stabilization and M7 Direction](../../../brainstorms/2026-04-16-mainline-ci-stabilization-and-m7-direction-requirements.md)
950972
- [2026-04-19 Mainline Progress Reconciliation and Post-M7 Direction](../../../brainstorms/2026-04-19-mainline-progress-reconciliation-and-post-m7-direction-requirements.md)
951973

952-
## Phase Snapshot (2026-04-19)
974+
## Phase Snapshot (2026-04-20)
953975

954976
| Phase | Plan Target | Branch Progress | Mainline Status |
955977
|---|---|---|---|
@@ -1004,15 +1026,15 @@ Note: do not list foundation-lane gates as baseline until the corresponding modu
10041026

10051027
## Next Direction (Current Priority)
10061028

1007-
1. Treat notification-threshold governance as closed after `M7.29`; do not plan `M7.30+` unless a materially new operator requirement appears.
1008-
2. Keep `M8 foundation re-entry readiness execution` on the current path: evidence bundle and anti-overclaim guardrails landed first, vector/query boundaries now exist, but no document or route should claim independent ANN readiness until stronger evidence lands.
1009-
3. Preserve CI and contract fail-fast guarantees for every lane change by keeping docs, agent-workspace, and learning-core gates green.
1010-
4. Re-baseline progress docs before every major lane switch so stale branch-gap language does not leak into mainline status claims.
1011-
5. Keep markdown reader governance bounded and secondary until the post-M7 lane switch is explicitly planned.
1029+
1. Close the checkpoint cleanly: keep EN/ZH docs aligned with the actual `main` state and keep the Windows restore-cache migration path non-flaky.
1030+
2. Treat notification-threshold governance as closed after `M7.29`; do not plan `M7.30+` unless a materially new operator requirement appears.
1031+
3. Treat the current foundation lane as checkpointed at `M8.18/M8.19`: inspectability is strong enough for now, but no document or route may claim independent graph or ANN readiness until stronger backend evidence lands.
1032+
4. Make the next planning round about backend independence, not more runtime inspectability parity.
1033+
5. Keep markdown-reader governance bounded and secondary until the post-checkpoint lane switch is explicitly chosen.
10121034

10131035
## Critical Constraints
10141036

1015-
- Do not merge the entire dirty working tree into mainline in one step.
1037+
- Keep checkpoint slices small enough that CI interpretation stays attributable.
10161038
- Do not claim completion based on branch-only features.
10171039
- Do not let documentation drift from executable gate outcomes.
10181040

docs/diataxis/en/explanation/foundation-reentry-readiness-checklist.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This page defines the **Go/No-Go contract** for re-entering the foundation lane
77
Prevent branch-only assumptions from being promoted to mainline facts.
88
Foundation work may proceed only when code, tests, CI, and docs all satisfy the same evidence threshold.
99

10-
## Mainline Baseline (2026-04-16)
10+
## Mainline Baseline (2026-04-20)
1111

1212
- Mainline persistence baseline remains file-backed snapshot storage:
1313
- `src/learning/store.ts`
@@ -26,6 +26,18 @@ Implication:
2626
- foundation re-entry is allowed,
2727
- foundation overclaim is not allowed.
2828

29+
CI drift note:
30+
31+
- latest published `main` runs are green:
32+
- `Migration Gates` `24703509626`
33+
- `Fixrisk Operational Readiness` `24703509639`
34+
- `Mobile E2E Detox Contracts` `24703509627`
35+
- `Docs Diataxis Site` `24703509663`
36+
- `Docs GitHub Pages Publish` `24703509632`
37+
- the last confirmed `main` CI failure was `Migration Gates` run `24702925778` on 2026-04-21 UTC.
38+
- that failure was a Windows timing-sensitive named-target restore-cache timeout in `src/server.migration.test.ts`, not a change in foundation readiness verdict.
39+
- the cache-restore path is now hardened around in-flight duplicate suppression so CI no longer depends on a sequential duplicate request landing inside the short post-completion dedupe window.
40+
2941
## Re-entry Gate Matrix
3042

3143
All gates below must pass before calling foundation lane "active on mainline".

0 commit comments

Comments
 (0)