Skip to content

promote: main → prod (consumer identification nudge)#97

Merged
klappy merged 2 commits into
prodfrom
main
Apr 16, 2026
Merged

promote: main → prod (consumer identification nudge)#97
klappy merged 2 commits into
prodfrom
main

Conversation

@klappy
Copy link
Copy Markdown
Owner

@klappy klappy commented Apr 16, 2026

Promotes the consumer identification nudge to production.

What ships

PR #95 (merged): adds a polite one-liner to oddkit responses when the consumer is unidentified. The nudge leads with privacy assurance (oddkit tracks tool usage, never prompts/searches/responses) before suggesting ?consumer=yourname.

What this looks like

Unidentified consumers (curl, anonymous Cursor, etc.) see this appended to tool responses:

Tip: oddkit tracks tool usage (which tools, how often) but never your prompts, searches, or responses. Add ?consumer=yourname to your oddkit URL to appear on the public transparency leaderboard. See telemetry_policy for details.

Identified consumers (anyone with ?consumer=, x-oddkit-client header, or MCP clientInfo.name) see nothing extra.

Verified on main preview

  • curl against main-oddkit.klappy.workers.dev/mcp → nudge appears
  • Same call with ?consumer=testuser → nudge correctly suppressed

Design notes

This is the lean +30/-2 version. Bugbot attempted to add session-based caching to remember identification across requests; that was reverted because (1) it violates Vodka Architecture statelessness, (2) Cloudflare Workers' distributed isolates make module-level Maps unreliable anyway, and (3) the query param solves it cleaner. An inline DO NOT add session caching comment prevents future regression.


Note

Medium Risk
Changes the encode response shape/semantics and adds per-response text injection for some clients, which could break consumers that assume the previous single-artifact format or exact assistant_text content.

Overview
Unidentified MCP consumers now get a short privacy/telemetry disclosure + ?consumer=yourname prompt appended to assistant_text in tool responses; identification is determined per-request via parseConsumerLabel and intentionally avoids any session/state caching.

The encode action is reworked to be governance-driven: it discovers encoding types and quality criteria from canon docs (with OLDC+H fallback), supports both TSV-structured and freeform inputs (including multi-typing a paragraph), returns a list of scored artifacts + governance metadata, and resets the new caches on cleanup_storage.

Bumps package version to 0.16.0.

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

klappy and others added 2 commits April 15, 2026 22:14
* feat: governance-driven encode architecture

E0008: Replace hardcoded detectEncodeType with governance-driven encoding.
Server discovers encoding-type docs from canon via tag search,
extracts field schemas/trigger words/quality criteria,
parses structured (TSV) and unstructured input,
scores per-type, teaches model via response.

* fix: duplicate artifacts, stale cache, dead code, quality scoring in encode action

- Add break after first type match in parseUnstructuredInput to prevent
  duplicate artifacts when a paragraph matches multiple encoding types
- Key cachedEncodingTypes by canonUrl so different canon sources get
  separate cached encoding types within the same isolate
- Remove unused detectEncodeTypeFromGovernance function (dead code)
- Fix scoreArtifactQuality: require score >= mx (not mx-1) for strong
  so a 0/1 score no longer rates as strong
- Fix misleading DOLCHE comment to OLDC+H (matches actual 5-type system)

* fix: restore multi-type paragraph matching (intentional design)

Reverts bugbot's break; addition in parseUnstructuredInput.
Multiple type matches per paragraph is an intentional design decision:
a paragraph can be both Decision and Constraint simultaneously.
This mirrors what the model would do with separate TSV rows.

Added inline comment to prevent automated regression.

* Fix three governance-driven encode bugs: fallback type, context artifacts, cache cleanup

- Use first discovered governance type as fallback instead of hardcoded D/Decision
  for unmatched paragraphs in parseUnstructuredInput
- Pass only input (not fullInput) to parseUnstructuredInput so context paragraphs
  are not encoded as standalone artifacts
- Clear cachedEncodingTypes and cachedEncodingTypesCanonUrl in runCleanupStorage
  so governance doc updates take effect without worker isolate recycle

* fix: merge context into fullInput in runEncodeAction to match runGateAction pattern

The context parameter was accepted but never used in runEncodeAction,
silently discarding supplementary context provided by callers. This
restores the fullInput merging pattern used by runGateAction so that
context is included in type detection, artifact parsing, and quality
scoring.

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Claude (oddkit project) <chris@klapp.dev>
* feat: add consumer identification nudge for unidentified consumers

* fix: add privacy assurance to consumer nudge text

Nudge now leads with what oddkit does NOT track (prompts, searches,
responses) before asking the consumer to self-identify.

* docs: add inline comment explaining no-cache design

Reverts bugbot's session cache additions. The server is stateless by
design — caching consumer identification across requests violates Vodka
Architecture and doesn't even work reliably on Cloudflare Workers'
distributed isolates. The query param is the stateless solution.

Inline comment prevents future regression.

---------

Co-authored-by: Klappy <klappy@klappy.dev>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

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 4b95fbe Commit Preview URL

Branch Preview URL
Apr 16 2026, 02:33 AM

@klappy klappy merged commit bbcfc23 into prod Apr 16, 2026
5 checks passed
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