Skip to content

fix(c0): pref-core budget + silent-loss write paths#68

Draft
m3talux wants to merge 4 commits into
mainfrom
fix/c0-correctness
Draft

fix(c0): pref-core budget + silent-loss write paths#68
m3talux wants to merge 4 commits into
mainfrom
fix/c0-correctness

Conversation

@m3talux

@m3talux m3talux commented Jun 6, 2026

Copy link
Copy Markdown
Owner

v1.0.0 Wave C C0 pre-flight. Aligns the preference-core producer/consumer token budgets and closes silent-loss write paths (log fail-open, record dropped writes to the reject queue, atomic archive append). Banked for the June 12 reassessment.

m3talux added 4 commits June 5, 2026 22:36
…JECT_LIMITS.prefCore from 150 to 250 to match the\nPREFERENCES_CORE_MAX_TOKENS producer ceiling so the authored identity\ncore is never silently clipped. Add validateBudgetConsistency() that\nthrows when the consumer slot falls below the producer ceiling; called\nat the top of emitPreferencesCore so drift fails loudly. Add\ncross-module assertions in preferences.test.ts that verify the\nbudgets are aligned and that a ~250-token core is not clipped.\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…17: the structured-project-note catch block already called writeFailure\nbefore the fallback; update the G17 test to trigger the failure via a\nspy on appendDatedSectionWithArchive rather than a read-only directory,\nso the fallback write can succeed and the sentinel-assertion holds.\n\nG19: reorder the archive write sequence so all evicted sections are\ncommitted atomically (read->append->atomicWrite, grouped by archive\nfile, date-ascending) BEFORE the main-note atomicWrite. A crash after\narchive but before main-note commit leaves the un-trimmed main note\nplus safe duplicate archive entries rather than losing evicted content.\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nAfter each writeNote call in distillFromEvents (both the non-create and\ncreate paths), add an else branch that calls recordRejection when\n!res.ok so path-not-allowed and frontmatter-validation failures surface\nin distill-rejects.md instead of being silently dropped. Add\ndistillWriteNoteReject.test.ts with two unit tests that mock writeNote\nto return ok:false and assert the reject-queue entry is present.\n\nCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant