Skip to content

ui-server: record every taint exposure with lifecycle and detector coverage #3600

Closed

Description

@schlessera

Out of scope

No source-specific transport, Settings UI, policy writer duplication or global-clear endpoint.

Context

Part of #3596.

The recorder foundation now lives in beginSafetyCollection (packages/ui-server/src/governance/safety-store.ts:69), bindSafetyCollection (packages/ui-server/src/governance/safety-store.ts:130), createGovernanceWrites (packages/ui-server/src/governance/event-writes.ts:86) and createTurnRecorder (packages/ui-server/src/activity/recorder.ts:134). Final Pi tool delivery uses installPiToolSafety (packages/ui-backend-pi/src/tool-safety.ts:27). These anchors were reverified in the delivered source at da1f3abd1a81f74dc8118fa0f0fa2df279966e44. The original first-source-only limitation is the motivation for this change, not the current implementation.

Read the reviewed implementation design and requested gpt-6-astra review/disposition. The repository plan docs/plans/reviewable-session-safety.md and ADR docs/decisions/session-safety-reviews.md landed through #3599 at main 19eb38f9096c2c9b1d344326593d7c076d13aa12. Read them alongside the complete public design/review; their DTOs remain prospective until implemented. Historical design pointers refer to that delivered base; the current anchors above were reverified at the new candidate. ROADMAP.md “What binds future work”, the provider-history decision, G6 and the protected policy-writer boundary apply.

Scope

  • Record every input/output/proxy signal independently with host occurrence identity, trusted-at-admission provenance and open/finalized/interrupted-or-unknown exposure state.
  • Define coverage relative to the pinned versioned detector inventory and known exclusions; migrate every pre-upgrade session and bind unbound first-turn evidence.
  • Apply bounded queues/rows/bytes and preserve unresolved evidence through pruning; capacity failure restricts/stops ingestion rather than silently dropping triggers.

Acceptance criteria

  • A later trigger is recorded even while already tainted; duplicate delivery of the same occurrence does not duplicate it.
  • Multi-file/mixed-result/redirect fixtures retain all required detector signals; a trusted input cannot suppress an unrelated untrusted result. Proxied shell local-read exclusions remain explicit.
  • A stream/tunnel stays open until input exposure is proven finalized. Host loss/unknown completion remains restrictive, and new post-boundary input gets a distinct occurrence.
  • All pre-upgrade, resumed/imported/forked and backend-changed sessions have explicit epoch/coverage facts, including old sessions with no first-taint row.
  • Unbound retention, capacity exhaustion and detail pruning never discard unresolved state or claim normal; deleted sessions cannot be recreated by late callbacks.

Verification

Real SQLite/write-worker, restart/failure and concurrent-admission fixtures; a mutation dropping a later occurrence must fail on the remaining-restriction assertion.

Every behavioral implementation needs meaningful failing-first/mutation receipts and the relevant real runtime/browser proof. Run contribution preflight before opening a PR; missing/cancelled selected hosted proof is not green. No tests may require an API key or external network.

Contract impact

Implement the reviewed optional schema/API/history additions and the relevant effective-taint behavior. Update integration contracts and API reports in the same implementing commit with CONTRACT metadata and a minor changeset. The G6 default/coverage and effective-state semantic break follows the recorded breaking-before-1.0 ruling and breaking label; preserve mixed-version fallback.

Blocked by #3599

Delivered implementation and remaining reconciliation — 2026-11-05

PR #3621 merged as da1f3abd1a81f74dc8118fa0f0fa2df279966e44. Its actual parent is 2a8f7e0035110de54c8b3071a0c53f458e92454a; its tree b5d12564313cde43f9d7fbcd4eaa5d72f0283551 exactly matches the tested candidate. Issue closure and both release milestones were read back: closed, 0.45.0.

Exact-candidate confirmation 42101024855, attempt 1, passed all nine selected categories: verify, pack, four unit shards, three browser shards, two layout shards, captures, runtime, runtime_host and endurance. All seventeen actual execution checkouts were independently verified as 3d183858cc19ddcb35f8e96fbc7067a108506249, with the recorded base/head parents and delivered tree. No selected proof was retained, cancelled, missing or skipped. Actual native startup/refusal passed in job 127504138129; both provider-history suites passed (including sixteen Claude and thirteen Pi literal tests); the corrected native policy/parent-state refusal passed in job 127504138307. Earlier local namespace/EDQUOT limitations remain historical failures; successful supported-host execution supplies the required native qualification.

Final committed-head local preflight passed all five gates, 1262 tests / 8512 assertions; typecheck, API reports and minor changeset validation passed. Independent source review and restored behavioral mutations are recorded in the PR with their original identities.

The delivered foundation preserves every occurrence, finalized/unknown exposure lifecycle, canonical identity and coverage, bounded pending/capacity reservations, restart/recovery, pruning and retirement fences. Managed Pi refuses loaded external extensions/loading errors with no identity exemption, checks live configuration on continuation/resume, and disables cache warming. Curated tools remain supported. Owner verdicts, owner review/clearing, Settings publication and runtime source trust remain the planned later slices; no original criterion moved to a follow-up.

Automatic main push CI 42104907944, attempt 1, passed all nine selected categories with fresh execution and no retained or skipped selected proof. All seventeen actual job checkouts, including the aggregate, independently match squash da1f3abd1a81f74dc8118fa0f0fa2df279966e44. Both provider-history suites passed again on main (Claude unit job127517533359; Pi unit job127517533197). The original five criteria are now checked, closure and both 0.45.0 milestones are read back, and parent claim safety-3600-parent-recheck-20261105 is released. The merged branch receives no further pushes. #3601 is implemented in draft #3633 and undergoing independent source review; combined gpt-6-astra epic reviews remain after the complete epic implementations.

Completion 2026-11-05: all original criteria, actual squash identity, complete candidate and automatic-main proof, closure and release milestones are reconciled.

Activity

  1. added
    type: feat
    area: ui-sdk
    area: ui-server
    blocked
    contract
    breaking
    on Nov 5, 2026
  2. added
    security
    agent-ready
    priority: p2
    on Nov 5, 2026
  3. schlessera commented on Nov 5, 2026

    @schlessera
    OwnerAuthor

    Unblocked: #3599 is closed, so scripts/sync-project.ts is removing the blocked label.

  4. removed
    blocked
    on Nov 5, 2026
  5. self-assigned this
    on Nov 5, 2026
  6. schlessera commented on Nov 5, 2026

    @schlessera
    OwnerAuthor

    Claiming only #3600 for implementation on feat/session-safety-3600. Claim token: safety-3600-20261105-b068b857. Delivered prerequisite verified at 19eb38f9096c2c9b1d344326593d7c076d13aa12. Live issue/comments and open PR check found no competing claim or implementation PR. Collision inspection reports shared import-closure overlap with open PRs (including #3056, #3458, #3590 and #3594); these are not ownership transfers. The canonical trust-policy schema owned by #3607 is excluded. This invocation will deliver a draft PR and proof/handoff; parent coordinates candidate confirmation and merge.

  7. added this to the 0.45.0 milestone on Nov 5, 2026
  8. 2 remaining items

  9. self-assigned this
    on Nov 5, 2026
  10. schlessera commented on Nov 5, 2026

    @schlessera
    OwnerAuthor

    Resuming implementation of the same #3600 on draft PR #3621 and branch feat/session-safety-3600. New claim token: safety-3600-20261105-resume-b068b857. This replaces only this invocation's previously released claim. All remaining acceptance criteria stay on #3600. Parent retains CI reservation/confirmation/merge coordination; #3607 policy-schema files remain outside this branch's ownership.

  11. schlessera commented on Nov 5, 2026

    @schlessera
    OwnerAuthor

    Implementation handoff for claim safety-3600-20261105-resume-b068b857: completed candidate is preserved on feat/session-safety-3600 in draft PR #3621, head 2f883ece0390ba910f6438ec2873b8fa2a2bb976, including delivered main 4e6a2d8c840bcf2c74e20641d4603968b7b77476. All #3600 implementation criteria remain owned here and are implemented; exact-candidate hosted proof remains unqualified as detailed in the updated issue/PR. Parent coordinates that proof, whole-epic review and merge. Releasing only this invocation's open-issue assignment; the existing PR and checkout remain preserved. No confirmation, reservation, watch or next issue was started.

  12. schlessera commented on Nov 5, 2026

    @schlessera
    OwnerAuthor

    Continuing only #3600 in existing draft PR #3621 under the explicit branch handoff, starting at 2f883ece0390ba910f6438ec2873b8fa2a2bb976 on delivered base 4e6a2d8c840bcf2c74e20641d4603968b7b77476. Claim token: safety-3600-review-c6374dd5. All five reported review findings remain in this PR, with all five original acceptance criteria and milestone 0.45.0 retained. Parent owns reservations, hosted confirmation, re-review and merge. No other issue, checkout or branch is being taken over.

  13. removed their assignment
    on Nov 5, 2026
  14. schlessera commented on Nov 5, 2026

    @schlessera
    OwnerAuthor

    2026-11-05 review-fix handoff: all five concrete findings are repaired inside draft PR #3621, head 1ba3d47583828bacd880028fe793875bad35d556, tree fe912dbb6abde77d19446194ef4cef7172b9f736, base 4e6a2d8c840bcf2c74e20641d4603968b7b77476. The issue and PR bodies now replace the earlier “hosted proof only” conclusion with the review findings, corrections, exact proof identities and remaining qualification.

    Current focused proof: 171 tests / 1403 assertions pass, including real curated Pi grep, installed SDK extension execution and captured provider requests, actual host adoption ordering, independent SQLite capacity races, and genuine deferred-FK failure at COMMIT/recovery COMMIT. All six final-head negative mutations fail on their intended assertions and are restored. Typecheck, lint/leakage, API-report regeneration and the complete changeset plan pass.

    Final preflight is 996 pass / 4 fixture-copy EDQUOT failures; both provider-history guards and app composition remain unqualified for the same local setup reason. Old run 42040629988 is cancelled, and its passing verify/pack/runtime jobs belong to the old executed candidate 2f883ece0390ba910f6438ec2873b8fa2a2bb976. No old result is relabeled final proof.

    All five original acceptance criteria remain on this open issue; none moved to a follow-up. The issue and PR retain milestone 0.45.0. Parent owns selected exact-candidate hosted qualification, reservation, re-review, combined-epic gpt-6-astra reviews and merge. This worker started no confirmation, watch, merge or next issue. Claim safety-3600-review-c6374dd5 is released; readback confirms the assignment is removed. The existing branch and clean dedicated checkout remain preserved.

  15. self-assigned this
    on Nov 5, 2026
  16. schlessera commented on Nov 5, 2026

    @schlessera
    OwnerAuthor

    Parent continuation claim safety-3600-parent-recheck-20261105 on the existing feat/session-safety-3600 / PR #3621. The previous worker released its assignment. Re-review found three remaining collection-foundation defects: late Pi provider-input transformations, merged per-session pending limits, and existing-session availability after explicit recording recovery. These stay in #3600 with all five original acceptance criteria; the PR remains draft. Existing documented overlap with #3622 and shared documentation/import closures remains parent-coordinated. This continuation owns implementation, proof and merge coordination; no completion or passing hosted proof is claimed here.

  17. schlessera commented on Nov 5, 2026

    @schlessera
    OwnerAuthor

    Independent source acceptance — 2026-11-05: PR #3621 head ddb8e5107f9929570422e6b2d344993af67380f9, base 4e6a2d8c840bcf2c74e20641d4603968b7b77476, has no blocking source findings across all five criteria. The reviewer independently reproduced 196 tests / 1147 assertions and verified restored mutation source hashes. Complete selected hosted proof, native startup and both provider-history guards still precede merge/closure.

    PR #3627 currently holds the live exact-candidate integration reservation. This is coordination, not an implementation dependency or authority to bypass its lease. Parent will wait for that run to settle, assess any resulting main changes, refresh the candidate if needed, then acquire the reservation and request full confirmation. PR #3621 remains draft; no hosted confirmation has been requested yet. Parent retains its claim.

  18. removed their assignment
    on Nov 5, 2026
  19. schlessera commented on Nov 5, 2026

    @schlessera
    OwnerAuthor

    Completed #3600 through merged PR #3621 at da1f3abd1a81f74dc8118fa0f0fa2df279966e44. Its actual parent 2a8f7e0035110de54c8b3071a0c53f458e92454a and tree b5d12564313cde43f9d7fbcd4eaa5d72f0283551 exactly match the tested candidate. Candidate run42101024855 and automatic main run42104907944, both attempt1, each passed every selected category; all actual execution checkout identities were independently verified, including native startup and both provider-history guards. The five original criteria are complete; issue closure and issue/PR0.45.0 milestones were read back. Releasing only parent claim safety-3600-parent-recheck-20261105. Managed Pi external-extension refusal and disabled warming remain the documented compatibility limits; verdict/admission/owner-review/history/UI work remains in its existing children.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyarea: ui-sdkarea: ui-serverbreakingcontractpriority: p2securitytype: feat

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions