Skip to content

feat(lab): CL-10 public evidence trust core - #1705

Merged
lidge-jun merged 122 commits into
devfrom
cl10-public-core
Aug 15, 2026
Merged

feat(lab): CL-10 public evidence trust core#1705
lidge-jun merged 122 commits into
devfrom
cl10-public-core

Conversation

@Wibias

@Wibias Wibias commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Stack

1/2 - trust-core base layer for the CL-10 public evidence stack.

This PR restores the former #1628 branch as the base layer and isolates the public-evidence trust core from the operator/community integration layer.

Scope

  • closed public evidence wire types and identifiers
  • reviewed public route / scenario / assertion authority validation
  • privacy validation and export-specific artifact policy boundary
  • RFC 8785/JCS canonicalization and strict bounded JSON parsing
  • canonical bundle identity/order validation
  • Ed25519 publisher identity, signing, and verification
  • descriptor-bound file safety and crash-aware private-file publication
  • local public bundle storage primitives
  • shared public-evidence filesystem namespaces
  • focused file-safety and durability regressions

Explicit non-scope

This PR does not expose operator CLI/API surfaces and does not implement community import/listing, revocation, provenance, purge integration, or Compatibility Matrix UI. Those remain in stacked PR #1706.

Remote publishing remains out of scope and is not authorized by either PR.

Stack order

  1. This PR - cl10-public-core -> dev
  2. feat(lab): CL-10 public evidence operator and community integration #1706 - feat/cl-10-public-evidence-contract -> cl10-public-core

Restores the branch previously reviewed in #1628 without merging that closed PR.

Summary by CodeRabbit

  • New Features
    • Added creation, signing, verification, storage, import, revocation, and retrieval of privacy-safe public and community evidence.
    • Added strict validation, deterministic identifiers, publisher keys, route registries, secure file handling, and local CLI/API workflows.
    • Added Codex app-server status and restart controls, including stale-model warnings and cross-platform support.
    • Added configurable reasoning-effort settings for custom models and Pi exports.
    • Added static model-discovery safeguards and expanded provider support.
  • Bug Fixes
    • JCS serialization now rejects invalid Unicode, sparse arrays, extra properties, and non-plain objects.
  • Tests
    • Expanded security, durability, recovery, validation, and cross-platform coverage.

@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 24379479-bb5a-4108-8f5a-95c8b1caf549

📥 Commits

Reviewing files that changed from the base of the PR and between 81ada7c and ba20ce1.

⛔ Files ignored due to path filters (1)
  • docs/screenshots/custom-model-reasoning-dialog.png is excluded by !**/*.png
📒 Files selected for processing (168)
  • devlog/_plan/260807_compatibility_lab/010_cl10_public_evidence_export.md
  • devlog/_plan/260807_compatibility_lab/011_cl10_revocation_v1_anchor_clarification.md
  • devlog/_plan/260815_dual_lane_release_train/000_research.md
  • devlog/_plan/260815_dual_lane_release_train/010_stable_lane.md
  • devlog/_plan/260815_dual_lane_release_train/020_preview_lane.md
  • devlog/_plan/260815_dual_lane_release_train/030_convergence.md
  • devlog/_plan/260815_gui_codex_restart/000_research.md
  • devlog/_plan/260815_gui_codex_restart/001_design_alternatives.md
  • devlog/_plan/260815_gui_codex_restart/010_phase1_backend_endpoint.md
  • devlog/_plan/260815_gui_codex_restart/020_phase2_gui_sidebar.md
  • devlog/_plan/260815_gui_codex_restart/030_phase3_models_tab.md
  • devlog/_plan/260815_gui_codex_restart/040_phase4_platform_hardening.md
  • devlog/_plan/260815_open_pr_triage/000_plan.md
  • devlog/_plan/260815_open_pr_triage/010_triage_matrix.md
  • devlog/_plan/260815_open_pr_triage/020_merge_execution.md
  • devlog/_plan/260815_open_pr_triage/030_final_verification.md
  • docs-site/src/content/docs/guides/pi.md
  • docs-site/src/content/docs/reference/management-api.md
  • docs/superpowers/plans/2026-08-12-cl10-public-evidence-implementation.md
  • docs/superpowers/plans/2026-08-13-cl10-deep-review-hardening.md
  • docs/superpowers/plans/2026-08-14-cl10-final-review-closure.md
  • docs/superpowers/specs/2026-08-12-cl10-public-evidence-design.md
  • gui/.eslint/i18n-allowlist.ts
  • gui/src/App.tsx
  • gui/src/codex-app-server-state.ts
  • gui/src/codex-restart.ts
  • gui/src/components/codex-stale-banner.tsx
  • gui/src/components/provider-workspace/ProviderSettings.tsx
  • gui/src/i18n/de.ts
  • gui/src/i18n/en.ts
  • gui/src/i18n/ja.ts
  • gui/src/i18n/ko.ts
  • gui/src/i18n/lab-translations.ts
  • gui/src/i18n/ru.ts
  • gui/src/i18n/tr.ts
  • gui/src/i18n/zh-TW.ts
  • gui/src/i18n/zh.ts
  • gui/src/pages/CompatibilityMatrix.tsx
  • gui/src/pages/Models.tsx
  • gui/src/pages/compatibility-matrix-api.ts
  • gui/src/pages/models-shared.ts
  • gui/src/pages/use-dashboard-data.ts
  • gui/src/provider-workspace/catalog.ts
  • gui/src/styles-models-workspace.css
  • gui/src/styles.css
  • gui/src/use-codex-restart.ts
  • gui/tests/app-sidebar-actions.test.ts
  • gui/tests/codex-restart.test.ts
  • gui/tests/codex-stale-banner-dom.test.tsx
  • gui/tests/codex-stale-banner.test.ts
  • gui/tests/compatibility-community-evidence.test.ts
  • gui/tests/compatibility-lab-followup.test.tsx
  • gui/tests/provider-settings-live-models-provenance.test.tsx
  • src/adapters/mimo-free.ts
  • src/adapters/openai-chat.ts
  • src/adapters/registry.ts
  • src/cli/lab.ts
  • src/cli/models-runtime.ts
  • src/cli/models.ts
  • src/clients/config-export.ts
  • src/codex/app-server-processes.ts
  • src/codex/app-server-restart-service.ts
  • src/codex/catalog/effort.ts
  • src/codex/catalog/provider-fetch.ts
  • src/lab/conformance/jcs.ts
  • src/lab/conformance/negative-controls.ts
  • src/lab/conformance/runner.ts
  • src/lab/fabric/observe.ts
  • src/lab/index.ts
  • src/lab/ledger/purge.ts
  • src/lab/ledger/store.ts
  • src/lab/observe/from-conformance.ts
  • src/lab/observe/from-live.ts
  • src/lab/paths.ts
  • src/lab/public/bundle.ts
  • src/lab/public/community-authority.ts
  • src/lab/public/community-files.ts
  • src/lab/public/community.ts
  • src/lab/public/file-safety.ts
  • src/lab/public/ids.ts
  • src/lab/public/index.ts
  • src/lab/public/mutation-lock.ts
  • src/lab/public/operator.ts
  • src/lab/public/origin-purge.ts
  • src/lab/public/origin.ts
  • src/lab/public/privacy.ts
  • src/lab/public/private-file.ts
  • src/lab/public/project.ts
  • src/lab/public/purge-test-fault.ts
  • src/lab/public/purge.ts
  • src/lab/public/registry.ts
  • src/lab/public/revocation.ts
  • src/lab/public/signature.ts
  • src/lab/public/storage.ts
  • src/lab/public/strict-json.ts
  • src/lab/public/time.ts
  • src/lab/public/types.ts
  • src/lab/public/validate.ts
  • src/lib/codex-restart-contract.ts
  • src/lib/lab-activation.ts
  • src/lib/lab-live-pinned-sender.ts
  • src/lib/pinned-http.ts
  • src/lib/windows-elevation.ts
  • src/providers/derive.ts
  • src/providers/registry.ts
  • src/providers/static-model-discovery.ts
  • src/reasoning-effort.ts
  • src/router.ts
  • src/server/adapter-resolve.ts
  • src/server/management/config-routes.ts
  • src/server/management/context.ts
  • src/server/management/lab-routes.ts
  • src/server/management/model-routes.ts
  • src/server/management/model-rows.ts
  • src/server/management/system-routes.ts
  • src/types.ts
  • structure/10_adapter-registry.md
  • tests/adapter-buffered-tool-conformance.test.ts
  • tests/adapter-registry-authority.test.ts
  • tests/adapter-tool-conformance.test.ts
  • tests/catalog-input-modality-enum.test.ts
  • tests/cli-models-reasoning.test.ts
  • tests/client-config-export.test.ts
  • tests/cline-pass-provider.test.ts
  • tests/codex-app-server-processes.test.ts
  • tests/codex-app-server-restart-service.test.ts
  • tests/codex-catalog-sync-hardening.test.ts
  • tests/codex-catalog.test.ts
  • tests/codex-restart-contract-parity.test.ts
  • tests/codex-restart-route.test.ts
  • tests/helpers/adapter-conformance/wire-drivers.ts
  • tests/helpers/startup-health.ts
  • tests/lab-activation.test.ts
  • tests/lab-community-evidence.test.ts
  • tests/lab-community-filename-contract.test.ts
  • tests/lab-community-mutation-lock.test.ts
  • tests/lab-community-publisher-continuity.test.ts
  • tests/lab-conformance-runner-failures.test.ts
  • tests/lab-fabric-outcome-validation.test.ts
  • tests/lab-ledger-mutation-lock.test.ts
  • tests/lab-live-pinned-timeouts.test.ts
  • tests/lab-passive-production-surfaces.test.ts
  • tests/lab-private-file-consumer-recovery.test.ts
  • tests/lab-private-file-durability.test.ts
  • tests/lab-public-api-json.test.ts
  • tests/lab-public-artifact-policy.test.ts
  • tests/lab-public-coderabbit-regressions.test.ts
  • tests/lab-public-core-contract.test.ts
  • tests/lab-public-deep-review-regressions.test.ts
  • tests/lab-public-evidence.test.ts
  • tests/lab-public-export-transaction.test.ts
  • tests/lab-public-file-safety.test.ts
  • tests/lab-public-final-review-regressions.test.ts
  • tests/lab-public-lifecycle-hardening.test.ts
  • tests/lab-public-privacy-ipv6.test.ts
  • tests/lab-public-provenance-recovery.test.ts
  • tests/lab-public-review-fixes.test.ts
  • tests/lab-public-route-registry.test.ts
  • tests/lab-public-security-regressions.test.ts
  • tests/lab-public-surfaces.test.ts
  • tests/lab-public-wire-contract.test.ts
  • tests/lab-read-filter-validation.test.ts
  • tests/mimo-free-provider.test.ts
  • tests/provider-static-model-discovery.test.ts
  • tests/server-management-auth.test.ts
  • tests/settings-startup-health-seam.test.ts
  • tests/settings-stream-mode.test.ts
  • tests/xai-transport.test.ts

📝 Walkthrough

Walkthrough

This change adds a large set of features across public evidence export, Codex restart controls, reasoning-effort configuration, adapter and provider handling, ledger durability, and pinned transport timeout classification.

Changes

Public evidence system

Layer / File(s) Summary
Evidence contracts and validation
src/lab/public/types.ts, src/lab/public/validate.ts, src/lab/public/strict-json.ts, src/lab/public/privacy.ts, src/lab/public/registry.ts, src/lab/conformance/jcs.ts
Adds bounded public schemas, strict JSON parsing, canonical identifiers, privacy scanning, route authority checks, and Unicode-safe canonical serialization.
Projection, signing, and storage
src/lab/public/project.ts, src/lab/public/bundle.ts, src/lab/public/signature.ts, src/lab/public/storage.ts, src/lab/public/private-file.ts
Projects eligible observations into deterministic records and bundles, signs them with Ed25519 keys, and stores them through atomic private-file publication.
Community isolation and purge
src/lab/public/community.ts, src/lab/public/revocation.ts, src/lab/public/origin.ts, src/lab/public/purge.ts, src/lab/public/mutation-lock.ts, src/server/management/lab-routes.ts
Adds verified community import, publisher-scoped revocation, local-origin tracking, locked mutation, purge recovery, and management API surfaces.
Public evidence validation
tests/lab-public-*, tests/lab-community-*, tests/lab-private-file-*
Adds coverage for canonical wire data, privacy rejection, authority enforcement, signing, file safety, provenance recovery, idempotency, revocation, and durability failures.

Codex restart controls

Layer / File(s) Summary
Restart contract and service
src/lib/codex-restart-contract.ts, src/codex/app-server-restart-service.ts, src/server/management/system-routes.ts, src/server/management/context.ts
Adds validated state and restart responses, catalog synchronization, PID identity checks, single-flight execution, and partial-stop results.
GUI restart flow
gui/src/codex-restart.ts, gui/src/use-codex-restart.ts, gui/src/App.tsx, gui/src/pages/Models.tsx, gui/src/components/codex-stale-banner.tsx
Adds confirmed restart actions, shared pending state, stale-state refresh, sidebar and mobile controls, and localized status handling.
Platform termination
src/codex/app-server-processes.ts, src/lib/windows-elevation.ts
Uses trusted recursive taskkill on Windows and preserves signal-based termination on Unix, with fallback behavior when Windows execution fails.

Reasoning and provider behavior

Layer / File(s) Summary
Reasoning-effort configuration
src/reasoning-effort.ts, src/server/management/model-routes.ts, src/cli/models.ts, src/cli/models-runtime.ts, src/codex/catalog/*, src/clients/config-export.ts, gui/src/pages/Models.tsx
Adds reasoning-effort sentinels, canonical ordering, explicit empty overrides, default validation, persistence, catalog inheritance rules, and Pi metadata export.
Provider discovery and adapter authority
src/providers/static-model-discovery.ts, src/providers/derive.ts, src/router.ts, src/adapters/registry.ts, src/adapters/openai-chat.ts, src/adapters/mimo-free.ts
Adds guarded static-catalog matching, canonical MiMo endpoint validation, centralized adapter construction, and safe xAI schema composition.
Provider and adapter tests
tests/provider-static-model-discovery.test.ts, tests/adapter-*.test.ts, tests/xai-transport.test.ts
Adds registry-wide adapter conformance and provider discovery coverage.

Ledger and transport hardening

Layer / File(s) Summary
Ledger mutation and purge coordination
src/lab/ledger/store.ts, src/lab/ledger/purge.ts, src/lab/observe/*
Adds synchronous mutation transactions, safer stale-lock recovery, atomic event checks, and purge operations under one ledger lock.
Pinned transport timeouts
src/lib/pinned-http.ts, src/lib/lab-live-pinned-sender.ts, tests/lab-live-pinned-timeouts.test.ts
Separates connection, first-byte, inactivity, and output-byte-limit failures and maps them to typed transport errors.
Lab runtime ownership and validation
src/lib/lab-activation.ts, src/lab/fabric/observe.ts, src/lab/conformance/runner.ts
Separates static and runtime activation ownership, validates Fabric outcomes, and distinguishes deterministic protocol failures from harness failures.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Dashboard
  participant ManagementAPI
  participant RestartService
  participant ProcessTable
  participant ModelsPage
  Dashboard->>ManagementAPI: request Codex state or restart
  ManagementAPI->>RestartService: read state or perform restart
  RestartService->>ProcessTable: enumerate and verify process identity
  ProcessTable-->>RestartService: validated process results
  RestartService-->>ManagementAPI: restart response
  ManagementAPI-->>Dashboard: state or outcome
  Dashboard->>ModelsPage: increment restart epoch
  ModelsPage->>ManagementAPI: refresh app-server state
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.13% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding the CL-10 public evidence trust core for the lab.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cl10-public-core

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Wibias
Wibias marked this pull request as draft August 14, 2026 18:16
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@Wibias
Wibias marked this pull request as ready for review August 14, 2026 19:19
Follow-up review of bc767a03d found three loose ends.

The HTTP failure string still said "Failed to restart Codex" in all eight locales
after the action was renamed, so the one message a user sees when it breaks used
the vocabulary the rename removed.

CodexRestartOutcome and CodexRestartOptions were declared twice in the transport.
Declaration merging kept the build green, which is precisely why this is worth
removing: the first copy had already drifted, missing formatTimeout.

The body-read timeout branch had no test. It is the half of the timeout fix that
is easiest to regress — headers arrive, the body stalls, and blaming the payload
would send the user looking for a proxy bug that is not there.
The sidebar button is the fix; the models tab is where the belief that something
is wrong actually forms. Someone comparing the picker against this list is
already looking at this page, so the recovery belongs here too.

A banner appears only when the proxy reports a running app-server older than the
catalog. Every other verdict renders nothing: telling a user "we could not tell"
on a page about models is noise, and a locked-down host where enumeration fails
would otherwise show a permanent warning.

The reading is fetched once on mount and on invalidation, never on a timer.
Enumeration shells out to ps, procfs, or PowerShell CIM, and this workspace
already gates its own catalog poll on tab activity for that reason.

Cross-surface invalidation is an epoch rather than a shared controller: App bumps
a counter when a restart settles anywhere, Models takes it as a prop and re-reads.
The backend is already single-flight, so what was missing was invalidation, not
mutual exclusion — without it a restart from the sidebar left the banner on screen.

Two defects the earlier string-matching tests could not see are now covered by
real DOM tests: a page-head restart did not refresh staleness at all, and the
settled callback fired after unmount. The hook also lost its timeout translation
in a rewrite, so a timeout showed the transport's hardcoded English.

Naming note: this file already binds catalogState to the /api/catalog resource,
so the new value is appServerState.

Verification: gui bun test 846 pass / 0 fail; lint, lint:i18n, build green; root
typecheck and privacy:scan green. Live proxy on a fresh build returned
{"state":"fresh","runningCount":4} for the authenticated GET, 401 unauthenticated,
and 403 for an admin token from a foreign origin.
restartCodexAppServers sent process.kill(pid, "SIGTERM") on every platform. On
Windows that is not a graceful signal — it is an unconditional terminate of one
process, and it leaves the process tree behind. The repository already knew this
and already had the right ladder for the proxy in process-control.ts; app-servers
never got it.

That gap matters most exactly where this feature is most needed. Windows has no
Ctrl+Q, so users close the Codex window and the app-server keeps running in the
background holding a catalog snapshot — the stale picker this whole unit exists
to fix.

Windows now uses taskkill /PID <pid> /T /F, resolved from a trusted system
directory rather than PATH, with a fallback to the old process.kill so the new
path can never be worse than the one it replaces. Unix keeps SIGTERM only: there
the signal really is graceful, and following it with SIGKILL would ask a harsher
consent than a restart click gives. Survivors are reported instead.

The asymmetry is recorded in the function comment and the phase doc so a later
reader does not "fix" it into symmetry.

Tests drive each branch through injected io: Windows exec receives /PID /T /F and
no signal follows, a throwing taskkill falls back to SIGTERM, and Linux and macOS
stay SIGTERM-only with no exec and no SIGKILL.
The CLI parity sweep reads GUI sources for /api paths, so naming the catalog
route inside a comment made it look like an endpoint the GUI calls with no CLI
mirror. The comment only needed to explain why the new value is appServerState
rather than catalogState; it did not need to spell the route.
Resolve purge.ts: re-express #1706 export-purge deferral inside #1709 withLedgerMutation
Resolve i18n-allowlist: take #1714 case-insensitive HTTP match (superset of #1715)
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • UI screenshot required.

What to do

  • Add a screenshot of the UI change to the PR description.

This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as draft August 15, 2026 05:29
@lidge-jun
lidge-jun merged commit 88463de into dev Aug 15, 2026
51 of 54 checks passed
@lidge-jun
lidge-jun deleted the cl10-public-core branch August 15, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants