redact-counterparty-payloads-completely

Strips internal fields from counterparty-visible event payloads and API responses.

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/shuddl/shuddl-os --skill redact-counterparty-payloads-completely-shuddl
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: redact-counterparty-payloads-completely
Source: https://github.com/shuddl/shuddl-os/tree/main/.claude/skills/redact-counterparty-payloads-completely
Command: npx skills add https://github.com/shuddl/shuddl-os --skill redact-counterparty-payloads-completely-shuddl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Internal-only fields like gl_map, division, floors, and cost amounts leak to counterparties when redaction only deletes top-level payload keys, leaving fields nested inside arrays (such as lines[].gl_map) exposed on event reads and synchronous API responses. ## Core Features & Use Cases - Nested redaction helper: Provides stripInternalInPlace.ts, a structural recursion that deletes configured internal keys at any depth, mirroring coarsenGeoInPlace. - Completeness CI guard: Supplies a vitest matrix asserting every counterparty/public EventKind strips every internal field, including fields planted inside array elements. - Route-level lens branching: Extends the invariant to authed route responses, requiring per-role response shapes (e.g. portalPricedResponse) with exact-key-set allowlist assertions. - Use Case: When adding invoice.issued as a counterparty-visible event, use this Skill to catch that lines[].gl_map survives a flat REDACTIONS entry and fix it before the chart of accounts ships to customers. ## Quick Start Ask the AI to review the new counterparty-visible event kind for internal-field leaks and apply the nested redaction pattern from this skill.

Frequently Asked Questions about redact-counterparty-payloads-completely

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I redact fields nested inside arrays in an event payload?▼

Use a structural recursion like stripKeyInPlace that walks arrays and objects and deletes the key at every depth, since a flat delete payload[path] only strips top-level keys. The provided stripInternalInPlace.ts mirrors the existing coarsenGeoInPlace geo-redaction pattern.

Why does a REDACTIONS entry not remove gl_map from invoice.issued?▼

redactEvent deletes only top-level payload keys, but gl_map lives inside lines[] array elements, so a flat entry like ["gl_map"] is a no-op. You need both a top-level entry for division and a nested walk for gl_map.

Does redaction apply to synchronous API route responses?▼

Yes. Any authed route a counterparty role can reach must branch its response by session lens, returning a re-mapped shape like portalPricedResponse that keeps only gate results and never internal economics such as floors or versions.

How do I test that no internal field leaks to a party lens?▼

Build a maximal payload per counterparty/public kind planting each internal field top-level and inside every array, run redactEvent with scope party, and assert the serialized payload contains none of the internal field names. Call redactEvent directly so empty party_refs cannot make the test vacuous.

When is redaction not required for an event kind?▼

Kinds whose default visibility is internal, such as credit.checked, split.computed, or agent.acted, never leave the tenant lens, so redaction is moot for them. The completeness matrix only covers kinds resolving to counterparty or public.