Skip to content

CONTRACT: feat(ui-server): add durable owner trust Settings publication - #3622

Merged
schlessera merged 16 commits into
mainfrom
feat/3608-durable-trust-settings
Nov 20, 2026
Merged

schlessera merged 16 commits into
mainfrom
feat/3608-durable-trust-settings

Conversation

@schlessera

@schlessera schlessera commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Closes #3608

What changed

Password-mode human owners can review and publish origin, tunnel, GitHub repository and GitHub owner trust rules through exact-base Settings operations without an agent turn. Repository IDs from the browser must match fresh host metadata at review and again inside the commit journal window. Private metadata keeps its selected live grant and API credential-recipient authority through the final synchronous publication fence.

The shared descriptor-bound publisher retains exact reviewed bytes, file topology, bounded operation identities and durable staged receipts. Publication proof and the approved GitHub owner boundary commit together after file sync; boundary evidence survives operation pruning and retires on removal or selector change. Crash recovery never infers publication from equal bytes or blindly retries an unknown write. The journal awaits asynchronous publication and the HTTP boundary bounds concurrent lock waiters.

Only the trust revision refreshes. Ordinary governance snapshots stay turn-bound. Saved rules report runtime enforcement as unavailable; historical triggers are unchanged. Runtime admission/removal fencing belongs to #3609, Settings UI to #3610, and rule-plus-verdict review to #3611.

Validation

  • bun run check:pr --base origin/main: all five gates pass; 842 tests / 6261 assertions.
  • Build, typecheck (NODE_OPTIONS=--max-old-space-size=6144), API report regeneration and diff checks pass.
  • Current real descriptor, HTTP/TLS metadata, journal/write-worker and child-process crash Settings suite: 42 tests / 199 assertions pass. Companion journal/policy-proposal proof passed with the attribution fix (114 tests / 795 assertions across all three files before adding the two concurrent-read cases).
  • Independent review found false user/policy attribution during failed asynchronous metadata. Fixed in 84fb7722fac887722aa86329f52bc34e62274493: the journal observes intervening edits normally and attributes only synchronous approved publication. Original-code mutation fails the named attribution assertion; all three new cases pass after restoration. Ordinary governance edits remain agent/content under the existing policy-surface exclusion. Fresh independent review of final head 76325e4383602a6af1fb49ca0ec8827f0f86e3f6 returned no findings; its recorded review gate passes.
  • Metadata mutation: removing the fresh/reviewed identity comparison fails a reviewed repository cannot publish after owner_id metadata changes at its publication assertion.
  • Callback mutation: removing missing-callback/publication guards fails SETTINGS_MISSING_PUBLICATION_CALLBACK_IS_NOT_PROOF (expected not_published, received proved). Both guards restored.
  • Affected app/journal citations repaired and verified. Repository-wide citation scan still reports unrelated pre-existing drift; no passing global citation claim is made.
  • Minor changeset, CONTRACT metadata and authoritative HTTP/package/wire records included.
{
  "version": 1,
  "kind": "brain-check-pr-receipt",
  "head": "76325e4383602a6af1fb49ca0ec8827f0f86e3f6",
  "base": "origin/main",
  "mode": "focused",
  "startedAt": "2026-11-20T13:51:48.127Z",
  "finishedAt": "2026-11-20T13:54:02.059Z",
  "checks": [
    {
      "name": "all lint and leakage gates",
      "categories": [
        "changeset"
      ],
      "outcome": "passed",
      "elapsedMs": 21243.443666000003
    },
    {
      "name": "environment documentation",
      "categories": [
        "changeset"
      ],
      "outcome": "passed",
      "elapsedMs": 147.5273240000024
    },
    {
      "name": "pending changeset package names",
      "categories": [
        "changeset"
      ],
      "outcome": "passed",
      "elapsedMs": 143.40950899999734
    },
    {
      "name": "contribution changeset",
      "categories": [
        "changeset"
      ],
      "outcome": "passed",
      "elapsedMs": 51.68496600000071
    },
    {
      "name": "affected fast invariants",
      "categories": [
        "verify",
        "unit"
      ],
      "outcome": "passed",
      "elapsedMs": 112325.350954
    }
  ]
}
  • Re-review found stale receipt readback across a publication lock wait. Fixed in 0e987664acb14ca5c3e831b371605d2b19d936a9: operation/receipt and refreshed projection now load together under the lock. Both writing/file-published tests fail on original code at SETTINGS_READ_AFTER_LOCK_USES_COMPLETED_DURABLE_RECEIPT and pass after the fix.

Anything left open

Implementation and independent review are complete; exact-candidate hosted confirmation remains before merge. Delivered #4255/#3613 squash d88c227c66f374224e35a245dc1c8ef8ba2fbe26 merged cleanly into current head 76325e4383602a6af1fb49ca0ec8827f0f86e3f6; the refresh tree equals its first parent, with no duplicated resolver or changeset blocks. Existing older draft feedback retains its original head/base and is not proof for this candidate. Migration 094 is free on inspected main d88c227c66f374224e35a245dc1c8ef8ba2fbe26. No source-trust runtime capability, historical clearing or generic metadata relay is enabled here.

@schlessera schlessera added this to the 0.45.0 milestone Nov 5, 2026
@schlessera schlessera added type: feat A new capability or a change in user-visible behaviour. area: ui-server Hono app factory: turn coordinator, auth, session catalog, routes, cron. contract Touches the integration contract: CONTRACT: commit, contract doc updated in the same commit. security Auth, isolation, egress, secrets, or anything in the threat model. labels Nov 5, 2026
@schlessera

Copy link
Copy Markdown
Owner Author

Parent continuation at 4f3fb6951f57cbbbb9b02fb98184cca645ead824: fixed trust-revision exhaustion before review/publication, with same-commit contract/changeset updates. Two meaningful failing-first assertions proved the original bug; restored Settings/publisher suites pass 40 tests / 310 assertions under owned temporary storage, and typecheck passes. Fresh local preflight retains 814 pass / four EDQUOT startup-view fixture failures with the fixed /tmp security boundary unchanged. Repository CRUD still awaits #3613 and the PR remains draft. Hosted heavy feedback will qualify this current publication implementation as feedback only, not merge proof.

@schlessera

Copy link
Copy Markdown
Owner Author

Status at head 4f3fb6951f57cbbbb9b02fb98184cca645ead824: automatic draft checks passed. The explicitly requested heavy feedback run 42037743674, attempt 1, is still running: verify and pack passed, while unit/native/runtime/browser/layout/capture/endurance jobs remain in progress. The workflow-dispatch event is associated with main, while its jobs explicitly check out the requested head; event head metadata alone is not a checkout receipt. No completed heavy-feedback or candidate-proof claim is made. #3608 remains blocked by #3613 for repository identity and this PR remains draft; passing draft gates cannot close that acceptance gap.

@schlessera

Copy link
Copy Markdown
Owner Author

Resolved the main conflict by preserving both appended API contracts and incorporating #3627 from main 33eff275315a94156bfd6122b35cc75e549cac04. New head 1f5c0df15285c54dfdd57859e8a97b1efba0ac73 also fixes the diagnosed old-head heavy-feedback failure: all four trust-settings routes and their middleware are classified in the HTTP inventory. The real mounted inventory/publisher/Settings selection passes 45 tests / 603 assertions; typecheck and current-head preflight pass (818 tests / 5542 assertions). The PR stays draft behind #3613. Requesting fresh heavy feedback for this changed tree; the prior failed run is retained and is not retried as if unchanged.

Copy link
Copy Markdown
Owner Author

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head b841e59 against base bd751d4. Reviewer: agent. 1 finding: 0 fixed, 0 filed, 0 rejected, 1 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 3622,
  "head": "b841e598a25dc1044924c1f38f9cf104c4529306",
  "base": "bd751d43435bbffa919d987323d17098eb5f7166",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "packages/ui-server/src/brain/turn-journal.ts:679: The Settings window awaits GitHub metadata, then unconditionally calls observe(true), even when lookup/publication fails. A concurrent governance.md edit during that wait is consequently classified as user/policy instead of agent/steering, suppressing steering-change and taint attribution. Reproduced with an active journal turn and a rejecting async callback: the unapproved edit was recorded with actor=user and class=policy."
    }
  ]
}

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head b841e59 against base bd751d4. Reviewer: agent. 1 finding: 1 fixed, 0 filed, 0 rejected, 0 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 3622,
  "head": "b841e598a25dc1044924c1f38f9cf104c4529306",
  "base": "bd751d43435bbffa919d987323d17098eb5f7166",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "packages/ui-server/src/brain/turn-journal.ts:679: The Settings window awaits GitHub metadata, then unconditionally calls observe(true), even when lookup/publication fails. A concurrent governance.md edit during that wait is consequently classified as user/policy instead of agent/steering, suppressing steering-change and taint attribution. Reproduced with an active journal turn and a rejecting async callback: the unapproved edit was recorded with actor=user and class=policy.",
      "disposition": "fixed",
      "commit": "84fb7722fac887722aa86329f52bc34e62274493"
    }
  ]
}

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head 84fb772 against base bd751d4. Reviewer: agent. 1 finding: 0 fixed, 0 filed, 0 rejected, 1 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 3622,
  "head": "84fb7722fac887722aa86329f52bc34e62274493",
  "base": "bd751d43435bbffa919d987323d17098eb5f7166",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "packages/ui-server/src/brain/trust-settings.ts:136: read() loads the operation and receipt before waiting for BRAIN_LOCK_KEY, then discards the refreshed row after acquiring it. A read during commit can capture stage=writing, wait until publication and durable proof complete, and still return publication=unknown. Reload and interpret the operation under the lock so concurrent readback reflects the completed outcome."
    }
  ]
}

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head 84fb772 against base bd751d4. Reviewer: agent. 1 finding: 1 fixed, 0 filed, 0 rejected, 0 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 3622,
  "head": "84fb7722fac887722aa86329f52bc34e62274493",
  "base": "bd751d43435bbffa919d987323d17098eb5f7166",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "packages/ui-server/src/brain/trust-settings.ts:136: read() loads the operation and receipt before waiting for BRAIN_LOCK_KEY, then discards the refreshed row after acquiring it. A read during commit can capture stage=writing, wait until publication and durable proof complete, and still return publication=unknown. Reload and interpret the operation under the lock so concurrent readback reflects the completed outcome.",
      "disposition": "fixed",
      "commit": "0e987664acb14ca5c3e831b371605d2b19d936a9"
    }
  ]
}

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head 76325e4 against base d88c227. Reviewer: agent. No findings.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 3622,
  "head": "76325e4383602a6af1fb49ca0ec8827f0f86e3f6",
  "base": "d88c227c66f374224e35a245dc1c8ef8ba2fbe26",
  "reviewer": "agent",
  "outcome": "no-findings",
  "findings": []
}

Copy link
Copy Markdown
Owner Author

Collision scan for head 76325e4383602a6af1fb49ca0ec8827f0f86e3f6 (same graph commit), refreshed base d88c227c66f374224e35a245dc1c8ef8ba2fbe26:

@schlessera
schlessera marked this pull request as ready for review November 20, 2026 13:57
@schlessera
schlessera merged commit 65883f2 into main Nov 20, 2026
61 of 63 checks passed

Copy link
Copy Markdown
Owner Author

Merged as 65883f2d5332220db8a17fd1ddba0f926a1888be. Its actual parent d88c227c66f374224e35a245dc1c8ef8ba2fbe26 and tree 9566a616111d157060346602577f793e0beaaa43 match exact-candidate run 44748884654, attempt 1. All 13 selected successful job checkouts and all 16 isolated unit-worker receipts identify synthetic checkout 716f2714408572d0357fe876d5b3bcf73ceabf7d with the verified base/head parents. The shared helper verified proof, review and milestones before squash and released its reservation.

Downloaded candidate artifacts show 16,444 passing cases across 1,269 selected files, zero failures, and 12 existing optional zsh/sqlite-vec skips. Both installed provider-history suites execute all 37 cases successfully; Settings 42 and journal 34 cases also pass without skips. All three changed Bun test files pass two requested/observed repetitions under four CPU burners. Fresh independent review of the final head returned no findings; both earlier findings have fixed dispositions and meaningful failing-first/restored receipts.

Automatic main run 44751827563 is still running. Its heavy proof is not yet qualified. PR and closed #3608 retain milestone 0.45.0; no full main-completion claim is made yet.

Copy link
Copy Markdown
Owner Author

Automatic main qualification is complete. Run 44751827563, attempt 1, passed all 17 executed jobs on squash 65883f2d5332220db8a17fd1ddba0f926a1888be. Every actual successful checkout log and all eight isolated unit-worker receipts identify that exact squash, tree 9566a616111d157060346602577f793e0beaaa43, and parent d88c227c66f374224e35a245dc1c8ef8ba2fbe26. The aggregate confirms all nine selected categories passed; determinism categories are intentionally unselected on main and retain their fresh candidate receipt.

Downloaded artifacts verify 16,444 unit passes across 1,269 selected files, zero failures, and the same 12 optional zsh/sqlite-vec skips. Both installed provider-history guards execute all 37 cases; Settings 42 and journal 34 cases pass without skips. Browser artifacts show 9,762 passes across 427 modules; five intentional fine-pointer skips have matching passing cases. Layout has 1,707 passes across 92 modules. The actual ten-minute endurance case, capture provenance/reproducibility, and native runtime/host proof pass.

Native artifacts identify this squash and confirm all four Claude/Pi × UID 0/1000 first/warm cells complete with clean shutdown, plus the complete separate-worker identity proof with no skipped phases/categories. The independent expected recovery control also ends with clean shutdown. Automatic website run 44751827506 passes and its actual artifact checkout is the same squash.

#3608 is closed and retains 0.45.0. #3609 has all prerequisites satisfied and is unblocked; #3610/#3611 retain blocked for open #3609. Unrelated pre-existing citation release-check failures are tracked separately in #4263; affected citations in this PR were repaired. No runtime source-trust enforcement or historical clearing is enabled by this publication slice.

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

Labels

area: ui-server Hono app factory: turn coordinator, auth, session catalog, routes, cron. contract Touches the integration contract: CONTRACT: commit, contract doc updated in the same commit. security Auth, isolation, egress, secrets, or anything in the threat model. type: feat A new capability or a change in user-visible behaviour.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui-server: reuse protected policy publication for durable human Settings operations

1 participant