Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2a709df
feat(lab): CL-10 public evidence operator and community integration
Wibias Aug 14, 2026
6655307
fix(lab): scope public purge test faults
Wibias Aug 14, 2026
5d5a239
test(lab): cover actionable CodeRabbit regressions
Wibias Aug 14, 2026
7a1e066
fix(lab): bound mutation lock PID recovery
Wibias Aug 14, 2026
6c0db16
fix(lab): align public origin quota accounting
Wibias Aug 14, 2026
73d2cc2
fix(lab): report incomplete purge provenance
Wibias Aug 14, 2026
b5d35ab
fix(lab): fail incomplete public purge classification
Wibias Aug 14, 2026
4c2f84f
fix(lab): bound public verdict lookup and canonical ordering
Wibias Aug 14, 2026
cda04fe
fix(lab): make revocation ordering locale independent
Wibias Aug 14, 2026
34d0445
fix(cli): classify public verification failures correctly
Wibias Aug 14, 2026
6206798
test(lab): exercise community revocation conflict path
Wibias Aug 14, 2026
7983c7c
test(lab): make duplicate-key regression effective
Wibias Aug 14, 2026
fe295bc
test(lab): make private-key leak canary effective
Wibias Aug 14, 2026
99faa65
test(lab): describe provenance failure accurately
Wibias Aug 14, 2026
124d1e0
test(lab): remove duplicate source-shape regressions
Wibias Aug 14, 2026
af73ffc
test(lab): harden provenance recovery regressions
Wibias Aug 14, 2026
d5d7e59
test(lab): derive wire fixture key path
Wibias Aug 14, 2026
67ed25e
test(lab): keep temp path helper import
Wibias Aug 14, 2026
25b4c24
test(lab): isolate corrupt-origin purge provenance
Wibias Aug 14, 2026
f887c2a
test(lab): align origin regressions with corrected semantics
Wibias Aug 14, 2026
8e77cd6
test(lab): cover deferred export purge branches
Wibias Aug 14, 2026
d3886c1
refactor(lab): share community bundle filename contract
Wibias Aug 14, 2026
fa7846a
docs(lab): fix sensitive purge heading level
Wibias Aug 14, 2026
6d471f3
test(lab): restore purge fault in finally
Wibias Aug 14, 2026
d5ea3a3
fix(gui): allow HTTP protocol literal in i18n lint
Wibias Aug 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# CL-10 V1 revocation anchor clarification

Status: normative clarification to `010_cl10_public_evidence_export.md` section 17.

`PublicEvidenceRevocationV1` uses exactly one already-verified target bundle as its authority anchor. The revocation may contain between 1 and 256 sorted unique targets, but every target must resolve inside that one anchor bundle:

- a `bundle` target must equal the anchor bundle ID;
- a `record` target must name a record contained by the anchor bundle;
- mixed bundle/record targets are allowed only when they all resolve inside the same anchor bundle;
- multiple distinct bundle IDs in one V1 revocation are not supported and must be rejected;
- targets spread across multiple bundles are not supported even when those bundles use the same publisher key.

The publisher algorithm, key ID and exact public key in the revocation must match the already-verified anchor bundle before the revocation signature is authoritative. V1 therefore has no cross-key, key-rotation or multi-bundle authority bootstrap.

The phrase "one or more bundle/record IDs" in section 17 describes the bounded target list, not multiple independent bundle authority contexts. Where that wording could be read as authorizing a single V1 revocation across multiple bundles, this clarification is authoritative.

Supporting multi-bundle revocation requires a separately reviewed contract/schema revision that defines how all target bundles are supplied, verified, bounded and bound to the signing authority before persistence or application.
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# CL-10 Public Evidence Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Implement CL-10.1 through CL-10.4: deterministic privacy-safe public evidence projection, signed local bundles, explicit local export, and quarantined community import/read surfaces, while keeping remote publishing blocked.

**Architecture:** Add a dedicated `src/lab/public/` boundary with independently versioned public types and strict validators. Public bundles are derived from valid local Lab evidence only after an exact exportability gate, signed with a local Ed25519 publisher key, and stored separately from the canonical ledger. Imported bundles are bounded, signature-checked, and stored only in a non-authoritative community domain that never feeds local verdicts, routing, or CL-08.

**Tech Stack:** TypeScript, Bun tests, Node `crypto` Ed25519, existing Lab JSONL/SQLite/query/digest/path infrastructure, existing `ocx lab` CLI and authenticated management API, existing Compatibility Matrix UI/i18n.

## Global Constraints

- No automatic telemetry or background publishing.
- No remote publishing implementation in this plan; CL-10.5 remains blocked until an exact reviewed service contract exists.
- No local subject/event/artifact/request/decision/Fabric identifier may appear in a public bundle.
- Private/custom route dimensions make evidence `not_exportable`; they are never dropped to broaden a public claim.
- Public schemas are closed and independently versioned; unknown fields fail closed.
- Public route identity uses a repo-reviewed, versioned allowlist authority. Dynamic discovery/configuration cannot extend it.
- Public incident references are closed corpus IDs only; historical URLs/devlog paths are never exported.
- Community evidence is `community_untrusted_v1`, never canonical local evidence, freshness, routing, or CL-08 input.
- Sensitive purge removes affected generated exports and locally-originated community copies; network revocation is never a prerequisite for completing a local purge.
- Publisher signatures prove integrity/continuity only, not evidence truth.

---

### Task 1: Freeze review amendments and implementation authority

**Files:**
- Modify: `devlog/_plan/260807_compatibility_lab/010_cl10_public_evidence_export.md`
- Modify: `docs/superpowers/specs/2026-08-12-cl10-public-evidence-design.md`

**Interfaces:**
- Consumes: CL-00 purge/public-export contracts and merged CL-09 state.
- Produces: final CL-10.1–CL-10.4 runtime contract; CL-10.5 remains explicitly blocked.

- [ ] **Step 1:** Add explicit purge/export/community-copy semantics consistent with CL-00 `purgeActions: export`.
- [ ] **Step 2:** Define `PublicRouteRegistryManifestV1` as the versioned local trust anchor for public provider/model identity.
- [ ] **Step 3:** Define bounded revocation bootstrap: target publisher key must match the original bundle publisher; duplicates are idempotent; conflicting replay fails closed; no V1 key rotation.
- [ ] **Step 4:** Replace arbitrary `incidentRefs` with closed `IC-NNN` references and require `artifactRefs` to resolve only to public artifact IDs in the same bundle.
- [ ] **Step 5:** Replace the route-only record assumption with a closed `PublicEvidenceSubjectV1` union for protocol/route/task evidence and require dedicated runtime validators/types.
- [ ] **Step 6:** Record that independent review accepted the contract and the user authorized CL-10.1–CL-10.4 runtime implementation on this PR; preserve the CL-10.5 transport hard stop.

### Task 2: Public schema, registry authority, and privacy projector

**Files:**
- Create: `src/lab/public/types.ts`
- Create: `src/lab/public/registry.ts`
- Create: `src/lab/public/validate.ts`
- Create: `src/lab/public/project.ts`
- Create: `src/lab/public/index.ts`
- Modify: `src/lab/index.ts`
- Test: `tests/lab-public-evidence.test.ts`

**Interfaces:**
- Produces: `PublicEvidenceBundleUnsignedV1`, `PublicEvidenceRecordV1`, `PublicEvidenceSubjectV1`, `PublicRouteRegistryManifestV1`, `projectPublicEvidence()`, `validatePublicEvidenceBundle()`.

- [ ] **Step 1: Write RED tests** for closed-schema rejection, deterministic public IDs/day buckets, protocol/route/task subject discrimination, exact route allowlist, private-route `not_exportable`, IC-only incident refs, no local ID leakage, and secret/PII canaries.
- [ ] **Step 2: Run focused test and verify expected RED failures.**
Run: `bun test tests/lab-public-evidence.test.ts`
- [ ] **Step 3: Implement minimal closed public types/registry/validator/projector.**
Public identities use domain-separated SHA-256 over JCS public-safe bytes. The registry manifest is repo-owned, versioned, digested, and cannot be supplied by an imported bundle as trust authority.
- [ ] **Step 4: Run focused test and verify GREEN.**

### Task 3: Bundle digest/signature and local storage

**Files:**
- Create: `src/lab/public/signature.ts`
- Create: `src/lab/public/storage.ts`
- Modify: `src/lab/paths.ts`
- Test: `tests/lab-public-evidence.test.ts`

**Interfaces:**
- Produces: `getOrCreatePublicPublisher()`, `signPublicEvidenceBundle()`, `verifyPublicEvidenceBundle()`, `writePublicEvidenceBundle()`, `readPublicEvidenceBundle()`.

- [ ] **Step 1: Write RED tests** for Ed25519 signing/verification, key-file permissions where enforceable, tamper rejection, deterministic bundle digest, bounded storage paths, and no private-key serialization.
- [ ] **Step 2: Verify RED.**
- [ ] **Step 3: Implement minimal key lifecycle, signing, verification, and safe local bundle storage.**
- [ ] **Step 4: Verify GREEN.**

### Task 4: Revocation and community quarantine

**Files:**
- Create: `src/lab/public/revocation.ts`
- Create: `src/lab/public/community.ts`
- Test: `tests/lab-public-evidence.test.ts`

**Interfaces:**
- Produces: `PublicEvidenceRevocationV1`, `verifyPublicEvidenceRevocation()`, `importCommunityBundle()`, `listCommunityBundles()`.

- [ ] **Step 1: Write RED tests** proving revocation accepts only the original bundle publisher key, duplicate identical revocations are idempotent, conflicting replay rejects, malformed/oversized bundles reject before persistence, and community import leaves canonical JSONL/SQLite verdict state unchanged.
- [ ] **Step 2: Verify RED.**
- [ ] **Step 3: Implement bounded revocation verification and separate community storage.**
- [ ] **Step 4: Verify GREEN.**

### Task 5: Sensitive purge integration

**Files:**
- Modify: `src/lab/ledger/purge.ts`
- Modify: `src/lab/paths.ts`
- Test: `tests/lab-public-evidence.test.ts`
- Test: `tests/lab-evidence-ledger.test.ts`

**Interfaces:**
- Consumes: existing `purgeSensitiveEvidence()` and `purgeActions: export`.
- Produces: fail-closed removal of generated exports and locally-originated community copies affected by local sensitive evidence.

- [ ] **Step 1: Write RED purge regression** showing an `export` purge removes CL-10 exports and local-origin community copies without requiring network access.
- [ ] **Step 2: Verify RED.**
- [ ] **Step 3: Extend purge-owned local directories/metadata minimally.**
- [ ] **Step 4: Run CL-10 and existing ledger purge tests.**

### Task 6: Explicit CLI and management surfaces

**Files:**
- Modify: `src/cli/lab.ts`
- Modify: `src/server/management/lab-routes.ts`
- Test: `tests/lab-public-evidence.test.ts`
- Test: relevant Lab CLI/management tests discovered in repository.

**Interfaces:**
- CLI: local preview/export, bundle verify, community import/list. No publish command.
- API: authenticated preview/export/verify/community endpoints only. No remote transport.

- [ ] **Step 1: Write RED CLI/API tests** for network-free preview, explicit export, verification, bounded community import, and absence of any publish endpoint/command.
- [ ] **Step 2: Verify RED.**
- [ ] **Step 3: Implement minimal surfaces using the public module APIs.**
- [ ] **Step 4: Verify focused CLI/API tests GREEN.**

### Task 7: Compatibility Matrix community context

**Files:**
- Modify: `gui/src/pages/compatibility-matrix-api.ts`
- Modify: `gui/src/pages/CompatibilityMatrix.tsx`
- Modify: locale catalog files under `gui/src/i18n/` as required by existing i18n rules.
- Test: existing Compatibility Lab GUI/i18n tests plus focused CL-10 additions.

**Interfaces:**
- Produces: clearly labelled, read-only community context separate from canonical local verdict UI.

- [ ] **Step 1: Write RED parser/render/i18n tests** proving community state is labelled non-authoritative and cannot replace the local verdict.
- [ ] **Step 2: Verify RED.**
- [ ] **Step 3: Implement the compact existing-detail-pane integration with no new product area.**
- [ ] **Step 4: Run GUI tests/lint/build GREEN.**

### Task 8: Closure validation

**Files:**
- Modify docs only if validation findings require factual updates.

- [ ] **Step 1:** Run `bun test tests/lab-public-evidence.test.ts tests/lab-evidence-ledger.test.ts`.
- [ ] **Step 2:** Run `bun x tsc --noEmit`.
- [ ] **Step 3:** Run `bun run privacy:scan`.
- [ ] **Step 4:** Run relevant Lab query/ledger/CLI/GUI tests.
- [ ] **Step 5:** Run GUI lint/build and React Doctor.
- [ ] **Step 6:** Run full Cross-platform CI on the exact final PR head.
- [ ] **Step 7:** Confirm no remote publishing code, arbitrary URL transport, routing feedback, local-verdict feedback, or CL-08 feedback was introduced.
Loading
Loading