From 4efc0995b0fbfb982cb544f9dd5367eba1412fdb Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sun, 24 May 2026 00:58:52 -0700 Subject: [PATCH] =?UTF-8?q?fix(tests):=20bump=20phase-count=20assertions?= =?UTF-8?q?=20from=2017=E2=86=9219=20(v0.41=20follow-on)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v0.41 added extract_atoms + synthesize_concepts to ALL_PHASES. Three existing tests pinned the count at 17 via load-bearing regression assertions: test/phase-scope-coverage.test.ts:48-49 expect(ALL_PHASES.length).toBe(17) expect(Object.keys(PHASE_SCOPE).length).toBe(17) test/core/cycle.serial.test.ts:393 expect(hookCalls).toBe(17) // yieldBetweenPhases hook fires per phase test/core/cycle.serial.test.ts:406 expect(report.phases.length).toBe(17) test/e2e/cycle.test.ts:110 expect(report.phases.length).toBe(17) These are the correct fix: the assertions exist precisely to catch this case (a PR that adds a phase without updating downstream consumers). The wave's v0.41 commit (T9) updated ALL_PHASES but missed these three sites. Updating them to 19 with comment breadcrumbs preserving the version history (v0.26.5 → 9, v0.29 → 10, v0.31 → 11, v0.32.2 → 12, v0.33.3 → 13, v0.36.1.0 → 16, v0.39.0.0 → 17, v0.41.0.0 → 19). Without this fix: full unit test suite (`bun run test`) shows 3 failures from these assertions. Underlying v0.41 logic was already green; this is pure pin-bumping. After fix: 9059 unit tests pass. 0 actual test failures. (3 shard wedges remain from unrelated long-running parallel-runner tests that exceed the 600s per-shard cap — infra concern, not test logic, pre-dates this wave.) Plan: ~/.claude/plans/system-instruction-you-are-working-toasty-milner.md Wave gate: all 13 plan tasks done; all v0.41 tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) --- test/core/cycle.serial.test.ts | 5 +++-- test/e2e/cycle.test.ts | 2 +- test/phase-scope-coverage.test.ts | 9 +++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/test/core/cycle.serial.test.ts b/test/core/cycle.serial.test.ts index a0cde791d..9c48c8641 100644 --- a/test/core/cycle.serial.test.ts +++ b/test/core/cycle.serial.test.ts @@ -390,7 +390,8 @@ describe('runCycle — yieldBetweenPhases hook', () => { // v0.33.3: 13 phases (added `resolve_symbol_edges` between extract_facts and patterns) → 13 yield calls. // v0.36.1.0: 16 phases (added `propose_takes`, `grade_takes`, `calibration_profile` between consolidate and embed). // v0.39.0.0: 17 phases (added `schema-suggest` between orphans and purge — T12 schema cathedral). - expect(hookCalls).toBe(17); + // v0.41.0.0: 19 phases (added `extract_atoms` after extract_facts + `synthesize_concepts` after patterns). + expect(hookCalls).toBe(19); }); test('hook exceptions do not abort the cycle', async () => { @@ -403,7 +404,7 @@ describe('runCycle — yieldBetweenPhases hook', () => { // v0.33.3: 13 phases (v0.32.2's 12 + resolve_symbol_edges). // v0.36.1.0: 16 phases (Hindsight calibration wave adds propose_takes, grade_takes, calibration_profile). // v0.39.0.0: 17 phases (T12 schema-suggest phase between orphans and purge). - expect(report.phases.length).toBe(17); + expect(report.phases.length).toBe(19); // v0.41: +extract_atoms, +synthesize_concepts }); }); diff --git a/test/e2e/cycle.test.ts b/test/e2e/cycle.test.ts index e033fca16..95b73e4ab 100644 --- a/test/e2e/cycle.test.ts +++ b/test/e2e/cycle.test.ts @@ -107,7 +107,7 @@ describeE2E('E2E: runCycle against real Postgres', () => { // v0.33.3 = 13 (added `resolve_symbol_edges` between extract_facts and patterns) // v0.36.1.0 = 16 (added propose_takes + grade_takes + calibration_profile — hindsight calibration wave) // v0.39.0.0 = 17 (added `schema-suggest` between orphans and purge — T12 schema cathedral) - expect(report.phases.length).toBe(17); + expect(report.phases.length).toBe(19); // v0.41: +extract_atoms, +synthesize_concepts // Nothing got written. const afterPages = await conn.unsafe(`SELECT count(*)::int AS n FROM pages`); diff --git a/test/phase-scope-coverage.test.ts b/test/phase-scope-coverage.test.ts index 9c0f1d58c..1066f24b8 100644 --- a/test/phase-scope-coverage.test.ts +++ b/test/phase-scope-coverage.test.ts @@ -41,12 +41,13 @@ describe('PHASE_SCOPE coverage', () => { expect(invalid).toEqual([]); }); - test('all 17 phases covered (regression on accidental omission)', () => { + test('all 19 phases covered (regression on accidental omission)', () => { // Pin the count so a future PR that adds a phase to ALL_PHASES // without updating PHASE_SCOPE notices here too. The v0.39.1.0 - // master merge brought in the 17th phase (`schema-suggest`). - expect(ALL_PHASES.length).toBe(17); - expect(Object.keys(PHASE_SCOPE).length).toBe(17); + // master merge brought in the 17th phase (`schema-suggest`); v0.41 + // adds 'extract_atoms' + 'synthesize_concepts' for a total of 19. + expect(ALL_PHASES.length).toBe(19); + expect(Object.keys(PHASE_SCOPE).length).toBe(19); }); test('embed remains global (the headline brain-wide phase)', () => {