Skip to content

refactor: remove kataka aliases, injectable registry, wire bridge-run-store#402

Merged
cmbays merged 1 commit intomainfrom
wave-3b-cleanup-fixes
Mar 22, 2026
Merged

refactor: remove kataka aliases, injectable registry, wire bridge-run-store#402
cmbays merged 1 commit intomainfrom
wave-3b-cleanup-fixes

Conversation

@cmbays
Copy link
Owner

@cmbays cmbays commented Mar 22, 2026

Summary

Wave 3B cleanup fixes for the CooldownSession decomposition (#375):

  • Fix 1: Remove deprecated katakaConfidenceCalculator and katakaDir from CooldownBeltDeps and CooldownSessionDeps — no public API consumers exist
  • Fix 2: Add injectable agentRegistry to CooldownBeltDeps — eliminates concrete infra dependency (new KataAgentRegistry) inside a features-layer class
  • Fix 3: Wire BridgeRunSyncer to bridge-run-store adapter — replaces raw readFileSync + JSON.parse with Zod-validated readBridgeRunMeta() and listBridgeRunsForCycle(), eliminating ~26 lines of duplicate fs code

Closes #395

Impact

  • 11 files changed, +60 / -165 lines (net -105)
  • BridgeRunSyncer: 195 → 169 lines
  • CooldownBeltComputer: 89 → 82 lines
  • All quality gates pass: verify, acceptance (112), e2e

Test plan

  • npm run verify passes (lint + typecheck + unit + integration + e2e + build)
  • npm run test:acceptance passes (112 scenarios)
  • BridgeRunSyncer tests updated for Zod-validated bridge-run metadata
  • Kataka legacy test scenarios removed from feature files and step definitions

Summary by CodeRabbit

  • Bug Fixes

    • Fixed bridge-run metadata schema compliance by ensuring deterministic base objects are always written.
    • Improved handling of incomplete or malformed metadata files with stricter validation.
  • Refactor

    • Removed legacy "kataka" compatibility configuration in favor of standardized agent registry approach.
    • Simplified agent confidence computation by consolidating to a single registry interface.
    • Refactored internal metadata discovery to use persistence-layer helpers for improved maintainability.

…-store (#395)

Three cleanup fixes for the CooldownSession decomposition:

1. Remove deprecated kataka fields (katakaConfidenceCalculator, katakaDir)
   from CooldownBeltDeps and CooldownSessionDeps — no public API consumers.

2. Add injectable agentRegistry to CooldownBeltDeps so computeAgentConfidence
   no longer constructs KataAgentRegistry (infra) inside a features-layer class.

3. Wire BridgeRunSyncer to bridge-run-store adapter — replaces raw readFileSync
   and JSON.parse with Zod-validated readBridgeRunMeta and listBridgeRunsForCycle.
   Eliminates ~26 lines of duplicate fs code. Closes #395.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@cmbays cmbays merged commit 8b81c57 into main Mar 22, 2026
1 of 3 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Mar 22, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6b58780c-4448-48a8-88fb-e20c0d2b3229

📥 Commits

Reviewing files that changed from the base of the PR and between 5a4c546 and d62cfbb.

📒 Files selected for processing (11)
  • src/features/cycle-management/bridge-run-syncer.steps.ts
  • src/features/cycle-management/bridge-run-syncer.test.ts
  • src/features/cycle-management/bridge-run-syncer.ts
  • src/features/cycle-management/cooldown-belt-computer.feature
  • src/features/cycle-management/cooldown-belt-computer.steps.ts
  • src/features/cycle-management/cooldown-belt-computer.test.ts
  • src/features/cycle-management/cooldown-belt-computer.ts
  • src/features/cycle-management/cooldown-session-prepare.test.ts
  • src/features/cycle-management/cooldown-session.test.ts
  • src/features/cycle-management/cooldown-session.ts
  • src/features/cycle-management/cooldown-session.unit.test.ts

📝 Walkthrough

Walkthrough

Formalizes bridge-run metadata writing by introducing a deterministic "base" JSON structure with required fields. Switches BridgeRunSyncer from raw filesystem operations to persistence-layer helpers (listBridgeRunsForCycle, readBridgeRunMeta). Removes deprecated "kataka" configuration support from cooldown-belt and cooldown-session dependencies. Updates test fixtures to write schema-compliant bridge-run metadata including betName.

Changes

Cohort / File(s) Summary
Bridge-run metadata I/O
src/features/cycle-management/bridge-run-syncer.ts, src/features/cycle-management/bridge-run-syncer.steps.ts, src/features/cycle-management/bridge-run-syncer.test.ts
Refactored writeBridgeRunFile to emit deterministic base bridge-run JSON with required fields (runId, betId/cycleId, betName/cycleName, stages, isolation, startedAt, status), then merge caller-provided meta. Replaced local filesystem scanning in BridgeRunSyncer.loadBridgeRunIdsByBetId with persistence helper listBridgeRunsForCycle. Updated readBridgeRunMeta calls to use the persistence-layer signature. Added test validation for incomplete JSON rejection.
Cooldown belt legacy deprecation
src/features/cycle-management/cooldown-belt-computer.ts, src/features/cycle-management/cooldown-belt-computer.steps.ts, src/features/cycle-management/cooldown-belt-computer.test.ts, src/features/cycle-management/cooldown-belt-computer.feature
Removed katakaConfidenceCalculator and katakaDir from CooldownBeltDeps. Added agentRegistry optional field. Simplified computeAgentConfidence to use injected registry or construct from agentDir, eliminating fallback to legacy kataka paths. Removed all legacy kataka test setup, scenarios, and assertions.
Cooldown session legacy deprecation & wiring
src/features/cycle-management/cooldown-session.ts, src/features/cycle-management/cooldown-session.steps.ts, src/features/cycle-management/cooldown-session.test.ts
Removed katakaConfidenceCalculator and katakaDir from CooldownSessionDeps and stopped passing them to CooldownBeltComputer initialization. Deleted test case validating kataka compatibility aliases. Updated bridge-run fixture JSON to include betName fields.
Test fixture updates
src/features/cycle-management/cooldown-session-prepare.test.ts, src/features/cycle-management/cooldown-session.unit.test.ts
Updated writeBridgeRun helper functions to emit complete bridge-run metadata: added betName, cycleName, stages, isolation, startedAt alongside existing runId/cycleId/betId/status fields, allowing caller overrides via spread.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Hops hop-hop through the schema so neat,
Bridge-runs now write with a deterministic beat!
Old kataka ghosts have left the coop,
Persistence helpers guide the whole loop.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wave-3b-cleanup-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cmbays cmbays deleted the wave-3b-cleanup-fixes branch March 22, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Formalize BridgeRunMeta schema and extract bridge-run-store adapter

1 participant