fix(memory): route consolidation through dreams, drop broken CRIX publisher#79
Merged
Conversation
Contract ExecutorRouteShapeSchema declared isDefault as a valid field but the ExecutorRoute interface omitted it, causing TS2353 on the workers_ai route. Aligns interface with contract. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CF Workers AI's Ai.run() overload union is too wide for direct casts. Wrap the call via an explicit function signature cast so TypeScript resolves a single unambiguous overload, then cast the return to AiChatResponse. Removes the previous as-Record<string,unknown> hack that still leaked the intersection mismatch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The UPDATE had no status check, allowing done/dismissed items to be re-resolved or re-dismissed. Contract declares both as terminal with no outgoing transitions. Add AND status='active' to the WHERE clause and throw when 0 rows are affected (item missing or already terminal). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, authority 48 tests derived from agenda-item.contract.ts. Covers all schema field constraints, all operation input schemas, valid/invalid state machine transitions (done/dismissed as terminals), the resolved_has_timestamp invariant, and authority rules per operation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s, authority 53 tests derived from cc-task.contract.ts. Covers all schema constraints, operation inputs, multi-source cancel transition (pending|running→cancelled), proposed_task_needs_approval and completed_has_timestamp invariants, and authority rules. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…authority 65 tests derived from goal.contract.ts. Covers schema constraints, all valid transitions including multi-source (active|paused→completed/failed), terminal state enforcement, the completed_has_timestamp invariant, and authority rules (terminal ops and recordRun are system-only). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 tests filling the only gaps in executor-router-semantic.test.ts: the negative cases for I1 (anthropic routes must have a fallback) and I2 (free-tier routes are terminal). I3–I6 violation paths were already covered. All six invariants now have both happy and violation coverage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
33 tests derived from memory-entry.contract.ts. Covers CRIX validation pipeline transitions (candidate→validated→expert→canonical), refute terminal edges, refuted_entry_not_canonical and high_confidence_for_canonical invariants (including 0.9 boundary), terminal stage enforcement, and authority rules. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Appends the audit telemetry entry from the OTDD baseline governance check. Trailer coverage at 0% is the primary drag; pattern definitions and policy docs are at full score. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- CHANGELOG.md: add Unreleased entry for OTDD test suites and three bug fixes (executor-router interface, workers-ai cast, agenda terminal guard) - docs/architecture.md: add Contract Ontology section documenting all six .contract.ts files, their invariants, and the OTDD approach; notes #75 for runtime enforcement wiring - CONTRIBUTING.md: add OTDD section explaining how to write contract tests (schema, state machine, invariants, authority — no mocks) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t dedup - Remove undeclared groq → workers_ai fallback from EXECUTOR_ROUTES (dispatch never reads route.fallback; false resilience signal removed; wiring tracked in #75) - Guard placeholder routes in dispatch default branch before EXECUTOR_FNS lookup so cerebras_mid/reasoning produce a clear error rather than 'Unknown executor' - Catch resolveAgendaItem throw in handleInProcessTool's resolve_agenda_item branch so an already-resolved item returns an error string to the model instead of killing the tool-call loop - Isolate resolveAgendaItem in agenda-triage into its own try/catch so a DB failure after a successful createIssue doesn't leave the item active and trigger duplicate issue creation on the next cycle - Add two missing tests for resolveAgendaItem: AND status='active' SQL guard and throw-on-changes=0 coverage - Extract duplicated Ai.run() overload cast into callAiRun() helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
agenda-triage: inner catch now attempts dismiss as a fallback sentinel
when resolveAgendaItem('done') fails after a successful createIssue,
preventing the item from staying active and generating a duplicate
GitHub issue on the next cron cycle.
dispatch: hoist placeholder guard before the switch so any future named
case for a placeholder executor cannot silently bypass the check.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the monolithic daily email with a focused co-founder brief: - Add lead signal banner (single highest-priority item: critical alerts, payment failures, high alerts, fail rate, deadlines, revenue) - Drop: Cognitive Scorecard, Operator's Log, ARGUS Events, Developer Activity, Memory Reflection, canned Co-Founder's Take - Filter service alerts to high/critical only (remove medium telemetry) - Filter health checks to high/critical only - Strip auto-generated analytics commentary (data tables stay) - Awaiting Action: collapse skill-evolution proposals to one row, cap other proposed tasks at 3, cap agenda items at 3, move sentinel alarms to a dimmed "Chronic" footnote - Reorder: Lead → Work Shipped → Alerts → Health → Traffic → Actions - Bump version to 0.8.5 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ion (v0.8.6) @stackbilt/wasm-core calls wasm.__wbindgen_start() at module init time. CF Workers validation runs before WASM instantiation, so the call fails with 'wasm.__wbindgen_start is not a function'. Moved WasmGraph import inside getWasmGraph() so the wasm-bindgen init defers until activateGraph() is actually called under the live CF runtime. aegis-core@0.8.5 was never deployable; 0.8.6 supersedes it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lisher (aegis-oss#78, v0.8.7) consolidateEpisodicToSemantic wrote raw fragments straight into the memory-worker store, bypassing the wiki SoT the #457 unification established - the original decision doc explicitly deferred this as needing design work, which never happened until now. It now writes through writeDreamFact() into scope:dreams pages, matching the pattern the daemon's synthesis.ts (PRISM) already proves in production. Dropped the ADD/UPDATE/DELETE-by-fragment-id model in favor of pure additive writes - dream pages don't support patch-by-id, and the dreams lifecycle (promote on corroboration, archive if stale) is the intended mechanism for handling staleness under the unified model. Also removed publishInsightsFromMemory() from the consolidation scheduled task: it called publishInsight()/validateInsight() against a D1 table named `memory` that no migration in this repo (or aegis-daemon) ever creates. Every invocation was silently failing every cycle, caught and logged as a warning. insights.ts's public API is untouched - only this broken internal call site is gone. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
consolidateEpisodicToSemanticto write through the wiki (dreams-scoped) instead of raw memory-worker fragments, closing the unmigrated gap flagged in aegis-oss#78.Closes aegis-oss#78.
🤖 Generated with Claude Code