handoff: P1.3.4 encode canon-parity refactor (D5 + D9) — closes the sweep#128
Conversation
…gex matcher in the sweep) Writes the forward handoff for the next session to pick up P1.3.4 — the LAST regex-matcher ship in the canon-parity sweep. Same D5 + D9 pattern that P1.3.2 applied to gate and P1.3.3 applied to challenge, now for encode's triggerRegex classifier and the cachedEncodingTypes module-level cache. Key substantive points: - Confirms the premise: encode's vocabulary is already governance-driven (reads ## Trigger Words from odd/encoding-types/*.md at runtime), but the matcher is literal regex alternation with no stemming. Input 'deciding' does not match canon vocab 'decided'. Same bug class challenge had pre-0.21.0. - Calls out the load-bearing multi-type design at orchestrate.ts L1161: 'no break' comment is canon-by-convention and the refactor must preserve both semantics (batch-untagged first-match and parseUnstructuredInput multi-match). Handoff explicitly names it so the next session does not accidentally collapse it into single-match. - Carries forward the P1.3.3 Bug #1 stop-word lesson: pass new Set() as second arg to tokenize() on both sides. Canon trigger vocab includes stop-word phrases ('going with', 'committed to', 'turns out', 'must not', etc.) — filtering them would recreate the strictly-additive invariant break. - Validation plan is SINGLE-PATH and binding per release-validation-gate. No Option A vs Option B. The P1.3.3 handoff's optionality section produced the P1.3.3 incident; this handoff does not repeat that mistake. 'Before merging the main → prod promotion PR' explicitly requires Sonnet 4.6 validator dispatch with the 5-corroboration pattern adapted for encode. - Attestation mapping table ties each constraint (release-validation-gate Rules 1/2/3, cache-fetches-and-parses, vodka-architecture, contract-governs-handoff-drift) to the specific gate that satisfies it. - Carry-forward O-opens updated: P11 (mechanical gate enforcement of release-validation-gate) flagged as the natural follow-up after the sweep closes — a capability add, not a parity ship, so candidate for epoch transition rather than P1.3.5. - Thin prompt at the bottom for fast next-session context load. Target: 45-75 min to prod, ~40-line code delta, ship as oddkit 0.22.0. Closes the canon-parity sweep.
Release Validation Gate — DispositionRule 1 (active reviews): Cursor Bugbot completed/success on Rule 2 (independent validator for load-bearing surface): This PR is doc-only — adds Rule 3 (canon outranks session artifacts): This PR's content is itself a session artifact. Its validation plan section is written in single-path form specifically because the P1.3.3 handoff's optionality produced the P1.3.3 incident. If the next session reads anything in this handoff that contradicts canon, canon wins per Merging. |
…elease-validation-gate Closeout ledger for the oddkit 0.22.0 ship cycle (PRs #124, #125, #127, #128, #129). First post-canon application of release-validation-gate (tier 1, landed earlier today in P1.3.3). Documents the retroactive-closure pattern used to heal PR #127's validation gap without reverting, and names the four criteria that make retroactive closure legitimate. Key contents: - Summary of what shipped (two envelope-conformance fixes into 0.22.0) - D3 names the retroactive-closure pattern and its four legitimacy criteria - Timeline of all agent/validator sessions with evidence trail - L2 distinguishes feature-branch validators from promotion-PR validators under canon's strict reading - L3 captures the Managed-Agent-bypass workaround for orchestrator-IP rate limits - H2 carries forward P11 (oddkit_gate mechanical enforcement of release-validation-gate) Writing canon gate satisfied: blockquote with compressed argument, Summary section, descriptive headers. Encoded via oddkit_encode (governance_source: knowledge_base) — 18 DOLCHE artifacts folded into D/O/L/C/H sections.
Forward handoff for the next session: P1.3.4 — migrate
oddkit_encode's trigger-word classifier from regex alternation to stemmed set intersection (D5) and remove the module-levelcachedEncodingTypescache (D9). This closes the canon-parity sweep.Why this is next
Encode is the only tool in the sweep whose matcher still uses literal regex alternation:
The trigger vocabulary itself is already governance-driven —
runEncodeAction's parse loop reads## Trigger Wordsfrom eachodd/encoding-types/*.mdat runtime. What's NOT governance-driven and NOT stemmed is the matcher. Input"deciding"does not match canon vocabdecidedbecause\b(decided|decision|chose|...)is literal word-boundary alternation. Input"realizing"does not matchrealized. Same bug class challenge had pre-0.21.0.Gate (P1.3.2) and challenge (P1.3.3) both closed their vodka anti-pattern remnants. Encode is the last holdout.
What's in the handoff
oddkit_time,oddkit_getonklappy://canon/bootstrap/model-operating-contract, read the "Before Shipping Code" section, follow the pointers torelease-validation-gateandcontract-governs-handoff-drift.d17bc0c, canon atbc6bfb1/ee9aee4. No pending canon-first prereqs.EncodingTypeDef.triggerRegex → stemmedTokens, and D9 removal ofcachedEncodingTypes/ siblings at L506–508.no breakcomment atorchestrate.tsL1161 is canon-by-convention —parseUnstructuredInputemits one artifact per matching type intentionally ("We must never deploy without tests" is both Decision AND Constraint). The refactor preserves both the first-match path (L1123, batch-untagged) and the multi-match path (L1165,parseUnstructuredInput) with their existing contracts.new Set()totokenize()on both sides. Canon trigger vocab includesgoing with,committed to,turns out,next step,blocked by,must not,haven't decided— all contain stop-words. P1.3.3 Bug feat(website): implement public website for PRD v1.0 #1 is the concrete precedent.Provenance notes
The handoff is explicit about its own authoring context: it's written immediately after P1.3.3 — the session that demonstrated why
release-validation-gateneeded to exist. The validation plan is single-path on purpose. If the next session reads anything in this handoff that conflicts with canon, canon wins percontract-governs-handoff-drift.Writing-canon gate satisfied
What closing the sweep unlocks
release-validation-gate+contract-governs-handoff-drift(shipped ee9aee4)Next move after the sweep closes: P11 — mechanical enforcement of
release-validation-gateinoddkit_gateat execution → completion transitions. That's a capability add, not a parity ship — candidate for an epoch transition (E0008.4 or E0009), not P1.3.5.Refs
Note
Low Risk
Adds a new handoff markdown document only; no production code or configuration changes are included.
Overview
Adds a new
odd/handoffs/2026-04-20-p1-3-4-encode-canon-parity.mdhandoff describing the next session’s plannedoddkit_encodecanon-parity refactor: switch the trigger-word matcher from regex alternation to stemmed token set intersection (while preserving first-match vs multi-match semantics) and remove the in-processcachedEncodingTypescache percache-fetches-and-parses.Includes an updated, single-path validation plan aligned to
release-validation-gate, plus concrete smoke-test assertions and a 0.22.0 changelog sketch to guide the implementation and release.Reviewed by Cursor Bugbot for commit c090381. Bugbot is set up for automated code reviews on this repo. Configure here.