Skip to content

canon: graduate cache-fetches-and-parses to tier-2 principle (P1.3.3 Phase 1)#125

Merged
klappy merged 1 commit into
mainfrom
canon/cache-fetches-and-parses
Apr 20, 2026
Merged

canon: graduate cache-fetches-and-parses to tier-2 principle (P1.3.3 Phase 1)#125
klappy merged 1 commit into
mainfrom
canon/cache-fetches-and-parses

Conversation

@klappy
Copy link
Copy Markdown
Owner

@klappy klappy commented Apr 20, 2026

Graduates the "cache fetches and parses, not microsecond derivations" pattern to canon as a tier-2 principle after its third deciding-argument recurrence across the oddkit tool sweep.

Why now

Three recurrences, per the graduation test:

  1. Implicit (0.19.0, P1.3.1) — challenge cachedBasePrerequisites caches parse product. Natural decision, principle not yet named.
  2. Explicit (0.20.0, P1.3.2, D9) — gate rejects the mirror-cache-this-too pattern for the BM25 transition index. Operator names the argument directly. First time the principle is load-bearing for a decision.
  3. Explicit (0.21.0, P1.3.3) — challenge cachedChallengeTypeIndex removal applies D9 to a second tool. Second explicit application; graduation test satisfied.

The graduation test is three decision points where the principle is the reason, not three appearances of the pattern. Appearances are evidence; decisions are graduation.

What the doc says

  • Cache parse products — fetches, table parses, stemmed vocabulary Sets. Four attestation points enumerated (0.18.0 encode types, 0.19.0 base prereqs, 0.20.0 gate stemmedTokens, 0.21.0 challenge stemmedTokens).
  • Don't cache microsecond derivations — BM25 indexes over small parse products, regex compilations from literal lists, Set rebuilds from cached arrays. Two attestation points (gate 0.20.0 D9, challenge 0.21.0).
  • The plumbing tax — four hidden costs avoided by rebuild-per-request: module-level state, URL-keyed invalidation, cleanup_storage wiring, drift risk when source data changes.
  • Trade-off / threshold — rule-of-thumb anchored to current corpus sizes (6-9 types, 4 transitions, 8 prereqs). Global cachedBM25Index over 524+ canon docs sits on the other side of the threshold; out of scope here; revisit if any tool grows past ~50 entries.

Canon-first sequencing

This canon PR ships before the oddkit code PR that removes cachedChallengeTypeIndex. Same pattern as P1.3.2's Phase 1 canon preceding Phase 2 code (#120#118). Merge this; verify retrievable via oddkit_get; then open the code PR.

Writing canon gate

  • Blockquote compressed argument: ✓
  • Summary section: ✓ ("The Principle Has Two Halves")
  • Descriptive headers: ✓ (all seven ## sections tell the story when scanned)

References

  • Handoff: klappy://odd/handoffs/2026-04-20-p1-3-3-challenge-revisit
  • P1.3.2 ledger (D9 origin): klappy://odd/ledger/2026-04-20-p1-3-2-gate-canary-landed
  • P1.3.1 ledger (first recurrence): klappy://odd/ledger/2026-04-20-p1-3-1-challenge-canary-landed

Note

Low Risk
Adds a new canon principle document only; no runtime or behavioral code changes.

Overview
Adds a new tier-2 canon principle, cache-fetches-and-parses.md, formalizing guidance to cache expensive fetch/parse work while rebuilding cheap microsecond derivations (e.g., small BM25 indexes) to avoid invalidation/cleanup “plumbing tax.”

The document also records the principle’s graduation rationale (third deciding-argument recurrence) and sets a rule-of-thumb threshold for when caching derived values should be reconsidered as corpus size grows.

Reviewed by Cursor Bugbot for commit 84651e2. Bugbot is set up for automated code reviews on this repo. Configure here.

Third deciding-argument recurrence satisfies the graduation test:
- 0.19.0 encode/challenge parse-product caching (implicit)
- 0.20.0 gate D9 (first explicit — operator named the argument)
- 0.21.0 challenge cachedChallengeTypeIndex removal (second explicit)

Names the two halves of the principle: cache fetches + parses, don't
cache microsecond derivations. Enumerates the plumbing tax (four hidden
costs avoided by rebuild-per-request). Anchors the threshold to current
corpus sizes (6-9 types, 4 transitions, 8 prereqs) and acknowledges
global cachedBM25Index (524+ docs) as out-of-scope counter-case.

Canon-first for P1.3.3 challenge code refactor (oddkit 0.21.0).
@klappy klappy merged commit 3726073 into main Apr 20, 2026
1 check passed
klappy pushed a commit that referenced this pull request Apr 20, 2026
…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.
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