@titan-design/decider
v0.3.0
Published
Decision ledger: v2 row schema, outcome classifier, exclusion, append-only store and the AskUserQuestion transcript source
Readme
@titan-design/decider
The owner-decision ledger: the LedgerRow v2 schema, the outcome classifier, the
exclusion check that runs before a row is written, the store, and the transcript and note sources.
Tier 2 of the titan-platform DAG. May import only packages in the same tier or
below; the package-layers rule in .codewatch/check.json enforces this in CI.
LedgerRowSchemaparses v2 rows and active-work's v1PrecedentRow. A v1 row keepsv: 1, itsclassbecomescategory, and itspick_typeyieldsoutcome.classifyOutcomereturnsaccept,amend,other,redirect,none, or null for an unparsed answer that stays out of scoring.isExcluded(subject, policy)takes the human-only initiatives, the project-directory mapping and the personal-data patterns as data. It never reads a charter or a file.- Principles are
@titan-design/memorybullets (category = domain, provenance =ledger:<key>).feedbackForRowmaps a row and the reflector's verdicts to helpful or harmful feedback;applyFeedbackrecords it once per ledger key. writePrincipleDocsrenders one<domain>.mdper domain into a directory the caller passes: rule, cited examples, counter-examples, confidence, last confirmed, version and changelog.condense(store, rows, reflector)is the condensation run. Per domain it feeds the rows inserted since its watermark (LedgerStore.entries(), in insertion order) to an injectedReflector, validates its deltas with zod, records feedback, curates proposals as candidates and runs the maturity pass. Decider answers are never evidence, and a row whose question carries an instruction can neither ground nor confirm a principle.ALWAYS_ASKis the fixed always-ask list;alwaysAskList(hardStops)adds the charter's.route(question, policy, ctx)is the pure routing table:owner-now,owner-queueordecider, with a shadow flag and a reason.parseRoutingPolicyholds one mode row per category and keeps always-ask categoriesoff.checkUnlockis agent-chat's unlock table, parity-tested.LedgerStore(openLedgerStore(path)) is append-only by row key, with a watermark per source cursor on@titan-design/store-sqlite.LedgerSourceis the port{ name, read(since) };extractSourceruns one source, drops excluded rows before anything is written, appends the rest and advances the watermark.transcriptSource()readsAskUserQuestioncalls from Claude Code transcripts through@titan-design/session-read, ported from active-work'ssrc/precedent/transcripts.ts.noteSource({ root })reads decision notes and feedback memory imports under<root>/<initiative>/sources/notes/, ported from active-work'ssrc/precedent/notes.ts.
Status: slices 1, 2, 2b and 6 of TP-695 (TP-696, TP-697, TP-730, TP-701).
