Skip to content

docs(audit): governance anti-pattern sweep across all oddkit tools#105

Merged
klappy merged 3 commits into
mainfrom
audit/governance-anti-pattern-sweep
Apr 19, 2026
Merged

docs(audit): governance anti-pattern sweep across all oddkit tools#105
klappy merged 3 commits into
mainfrom
audit/governance-anti-pattern-sweep

Conversation

@klappy
Copy link
Copy Markdown
Owner

@klappy klappy commented Apr 18, 2026

What this adds

docs/oddkit/audit/governance-anti-pattern-sweep-2026-04-17.md — a complete audit of all 11 oddkit tools against the Vodka anti-pattern (canon defines vocabulary, code hardcodes interpretation).

Why

PR #100 shipped a voice-dump suppression feature that was unreachable from the public MCP API for 1h 39m of prod breakage — schema rejected 6 of 9 modes the calibration canon defined. That bug was not unique to challenge. This audit sweeps all 11 tools for instances of the same shape.

Findings

SEVERE — same anti-pattern class as PR #100:

  • orient — 3 issues including the 70-word "Proactive posture" prose baked as string literal at orchestrate.ts:1528
  • gate — 3 issues (detectTransition regex, hardcoded prereqs, hardcoded evidence patterns)
  • validate — silently broken contract: gates "done" but never reads canon/constraints/definition-of-done.md. That file is referenced by AGENTS.md, docs/MCP.md, docs/QUICKSTART.md, and the preflight fallback text — but does not exist in the repo.

PARTIAL — discovery is canon-driven, interpreter is hardcoded:

  • encodediscoverEncodingTypes reads canon correctly, but scoreArtifactQuality hardcodes English keyword matching to interpret canon-defined criteria. Same bug shape as PR feat(challenge): governance-driven runChallengeAction (E0008) #100.
  • preflight — hardcoded "Before claiming done" tail that duplicates content that should come from the (missing) definition-of-done.md.

CROSS-CUTTING:

CLEAN (verified): challenge (post-refactor, gold standard), search, get, catalog, version, time, cleanup_storage, telemetry_public. (telemetry_policy was re-classified LOW after a closer pass — it has hardcoded header dictionary but the severity is drift, not correctness.)

Refactor priority (ranked)

  1. Canary: telemetry_policy self_report_headers (lowest stakes — prove the template)
  2. validate + preflight bundled (requires writing canon/constraints/definition-of-done.md first)
  3. Mode-enum collapse
  4. orient
  5. gate
  6. encode quality interpreter

Companion PR

klappy/klappy.dev#101canon/constraints/core-governance-baseline.md establishes the three-tier resolution contract every sweep refactor will conform to (live canon → bundled baseline → fail-loud).

Constraints applied to the sweep

  • Each refactor: single feature PR + single promotion PR. No sprawl.
  • Abort trigger: any refactor needing more than 2 PRs pauses the sweep.
  • Rollback trigger: prod smoke fail → git revert within 15 min. No forward-fix in prod.
  • Every refactor must verify the public MCP contract with a canon-change-no-redeploy preview smoke — the step PR feat(challenge): governance-driven runChallengeAction (E0008) #100 didn't have.

Note

Low Risk
Low risk: this PR only adds a documentation/audit markdown file and does not change runtime code paths.

Overview
Adds a new maintainer-facing audit doc, docs/oddkit/audit/governance-anti-pattern-sweep-2026-04-17.md, cataloging where oddkit tools hardcode behavior that should be canon-driven (highlighting severe issues in orient, gate, and validate, plus partial issues in encode and preflight).

The document also flags cross-cutting mode-enum duplication and proposes a refactor priority order and constraints (notably aligning validate/preflight on a canon definition-of-done.md).

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

Catalogs the Vodka anti-pattern — canon defines vocabulary, code hardcodes
interpretation — across all 11 oddkit tools. PR #100's
voice-dump schema bug (1h 39m prod breakage) was one instance of this
class. Audit identifies 5 tools carrying the same shape.

Findings:
  SEVERE: orient, gate, validate
  PARTIAL: encode, preflight
  CROSS-CUTTING: mode enum declared in 4 places
  CLEAN: challenge (post-refactor), search, get, catalog, version,
         time, cleanup_storage, telemetry_public

Refactor priority ranked by impact × tractability. validate named as
the most surprising: it gates 'done' but never reads
canon/constraints/definition-of-done.md — which in fact does not exist
in the repo despite three user-facing docs claiming it does.

Companion PR on klappy/klappy.dev establishes
canon/constraints/core-governance-baseline.md as the contract every
sweep refactor will conform to.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 18, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
oddkit 53dd1eb Commit Preview URL

Branch Preview URL
Apr 19 2026, 12:07 AM

klappy added 2 commits April 19, 2026 00:03
…vise priority

Canary (telemetry_policy self_report_headers reading from canon) shipped
to prod via oddkit#106 + #107 and klappy.dev#102 (canon extension).
Live smoke confirms governance_source: 'canon' with 8/8 canon-sourced
descriptions.

Corrections to the audit:
- telemetry_policy was originally classified CLEAN but carried a
  hardcoded header dictionary next to the canon-fetched policy prose —
  the same anti-pattern class. Reclassified to LOW severity (drift,
  not correctness) and selected as the canary. Now ✅ shipped.
- Refactor priority revised during planning after the canary was
  selected. New order: canary (✅ done) → validate+preflight bundled →
  mode-enum collapse → orient → gate → encode. Lessons-first-smallest
  sequencing rather than raw severity.

Validate+preflight moves up because it's a correctness bug, not drift:
validate gates 'done' but never reads canon/constraints/definition-of-done.md
(which doesn't exist yet). First step is writing that canon doc.
@klappy klappy merged commit 21bea39 into main Apr 19, 2026
5 checks passed
@klappy klappy deleted the audit/governance-anti-pattern-sweep branch April 19, 2026 00:11
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