Skip to content

CONTRACT: feat: measure a hosted turn's host overhead span by span and cut what its guarantees don't need (#4278) - #4444

Merged
schlessera merged 20 commits into
mainfrom
epic/4278-host-overhead
Nov 23, 2026
Merged

schlessera merged 20 commits into
mainfrom
epic/4278-host-overhead

Conversation

@schlessera

@schlessera schlessera commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Closes #4283
Closes #4285
Closes #4289
Closes #4298
Closes #4307
Closes #4367
Refs #4278 #4279 #4280 #4281 #4282 #4284 #4286 #4287 #4290 #4291 #4294 #4295 #4297 #4302 #4304 #4305 #4306 #4308 #4310 #4300 #4301

These six issues close because the combined review found every criterion met. Native-measurement criteria moved to #4420 by maintainer decision. Each issue under Refs stays open for a named, non-native gap; every gap is tracked by a follow-up under #4278 or #4426.

What changed

A hosted turn's host overhead is now measured span by span, and the parts its guarantees don't need are cut. This lands 18 PRs from integration branch epic/4278-host-overhead, each reviewed and triaged on its own.

Why this shape

One integration branch and one lease instead of 13 separate landings on main. Two pieces were taken out by maintainer decision after their review rounds kept finding sandbox or gate-bypass defects:

Both PRs stay open as drafts, to be redesigned against main. Today's stdio brain entry and immediate observation hold are unchanged.

Off-main qualification

The integrated branch changes test timeouts in scripts/native-proof/hosted-app.test.ts, the client turn receipt browser spec and the journal purge test, so it is a proof-system candidate.

Proof

Each sub-PR has its own independent review records (gpt-6.2-astra), Fable triage, and failing-first and mutation receipts in its body. This branch:

{"version":1,"kind":"brain-check-pr-receipt","head":"cdaf077375ad4a5b72e817992949bd590783b169","base":"origin/main","mode":"focused","startedAt":"2026-11-22T16:07:57.124Z","finishedAt":"2026-11-22T16:09:34.319Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":13949.857913000002},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":137.74278799999956},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":86.94006099999751},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":23.999750000002678},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":82975.37556700001}]}

Checklist

Anything left open

schlessera and others added 15 commits November 21, 2026 01:30
…ion (#4318)

* CONTRACT: feat(ui-server): prove state boundaries and pin host module generations

* docs: align boundary citations with host generation changes

* fix(ui-sdk): retain activated module generation on directory sync failure

* fix(ui-sdk): recognize the pinned module CLI in worker guidance

* test(ui-server): supply the complete maintenance worker result

* CONTRACT: chore(ui-sdk): refresh the state boundary API report

* CONTRACT: fix(ui-server): contain state exposure and keep module storage inactive

* fix(ui-server): preserve masked state aliases and existing refusal diagnoses

* CONTRACT: fix(ui-server): withdraw unqualified state boundary proof
)

* CONTRACT: feat(backends): persist observed backend startup phases

* test(ui-server): verify parsed backend timing fields

* CONTRACT: fix(backends): preserve clients and qualify startup evidence

* CONTRACT: fix(startup): contain diagnostics and validate native timing

* CONTRACT: fix(startup): contain async diagnostics and qualify native intervals

* CONTRACT: fix(startup): use observed fixture bounds and missing evidence
…4321)

* CONTRACT: feat(ui): retain owner-bound client turn arrival receipts

* fix(ui): contain client timing report transport failures

* CONTRACT: docs(ui): clarify client clock observation bounds

* CONTRACT: chore(ui): refresh client receipt API reports

* test(ui): preserve previous activity wire schema compatibility

* CONTRACT: fix(ui): negotiate client turn receipt support

* CONTRACT: fix(ui): isolate client timing receipts through host completion

* test(ui-sdk): preserve receipt fixture literal types

* test(ui): defer serialization assertions to query integration

* CONTRACT: fix(ui): preserve Send boundaries and receipt integrity

* docs: refresh draft client citations after receipt timing changes

* chore: record loose server timing schema API

* test(ui-server): preserve Activity frame discriminant literals

* CONTRACT: fix(ui): omit timing when a snapshot loses its Send boundary

* test(ui-server): keep client receipts out of Activity tool results

* CONTRACT: fix(ui): keep receipt timing nonblocking and snapshot consistent

* chore: record optional lifecycle snapshot API

* docs: distinguish lexical probe bounds from receipt byte validation

* CONTRACT: fix(ui): decouple client receipts from terminal persistence

* docs: align governed refresh citation after receipt changes

* test(ui-server): scope idle probe to publisher input

* fix(ui-server): read Activity snapshots without waiting for writes
…4317)

* CONTRACT: feat(ui-server): inspect workspaces read-only unless a session enables code changes

* CONTRACT: fix(ui-server): enforce workspace ownership and isolation

* CONTRACT: fix(ui-sdk): preserve governed writes and skip sealed workspace traversal

* CONTRACT: fix(ui-sdk): close workspace attribution and admission gaps

* CONTRACT: fix(ui-server): preserve inspection across host and tool paths

* CONTRACT: fix(ui-server): enforce workspace boundaries across read aliases and per-turn policy

* CONTRACT: fix(ui-sdk): mask staged areas and give conditional workspace remedies

* CONTRACT: fix(ui-sdk): separate native request and control response bounds
…ations (#4320)

* CONTRACT: fix(ui-server): batch journal observations and release unused startup views

* test(ui-server): pin startup backlog mutation and drain native output

* CONTRACT: docs(ui-server): record index refresh attribution signature

* test(ui-server): complete failed cleanup startup view fixture

* test(ui-server): measure native observations after ten thousand retained versions

* test(ui-server): verify journal activity with previous SDK schemas

* CONTRACT: fix(ui-server): close journal observation review gaps

* CONTRACT: fix(ui-server): keep maintenance receipt spans out of model context

* test(ui-server): type the owner receipt span assertion

* CONTRACT: fix(ui-server): preserve bounded observation and receipt ownership

* CONTRACT: test(ui-server): omit journal timing from model activity

* test(ui-server): return the verified private-reader identity

* CONTRACT: docs(ui-server): refresh journal code citations

* fix(ui-server): enforce independent pauses in both grant orders

* docs(ui-server): align the scope observation citation

* fix(ui-server): release admission ownership on early policy failure

* CONTRACT: fix(ui-server): resolve admission ownership and bound conflicts

* CONTRACT: fix(ui-server): validate unknown measurements and metadata admission

* docs(ui-server): document unknown scope event measurements

* CONTRACT: fix(ui-server): preserve admitted conflict state in backups

* docs(ui-server): repair citations after conflict backup integration

* test(ui-server): use a literal hardlink suffix predicate

* CONTRACT: fix(ui-server): retain batch versions and bound checkpoint ownership

* test(native-proof): remove the unused tool trace type

* CONTRACT: fix(ui): recover copy intents and preserve released history

* docs(ui-server): refresh merged journal source citations
* CONTRACT: preserve hosted session requests and qualify native relay modes

* test(backends): qualify the exact host inference placeholders

* test(backends): isolate managed policy on fresh runners

* fix(backends): refuse dangling session selection aliases

* test(backends): retain fixture storage and prove previous MCP parsing

* fix(backends): qualify referenced discovery and retain validated session inputs

* fix(backends): hold unqualified discovery and preserve session inputs

* CONTRACT: fix(backends): enforce retained policy before prompt release

* docs: record sandboxed MCP bridge follow-up

* CONTRACT: fix(backends): withhold prompt state until settings admission

* CONTRACT: docs(sdk): refresh settings-conflict API report

* CONTRACT: fix(backends): preserve roster and snapshot provenance on resume

* CONTRACT: docs(sdk): record shared prompt-context storage bound
…ing (#4322)

* CONTRACT: feat(ui-server): record host turn timing boundaries

* test(native-proof): add large observation timing scenario

* docs(ui-server): regenerate build revision environment table

* test(ui-server): verify selected runtime on lifecycle records

* chore: refresh host timing API reports

* test(ui-server): retain hold evidence through lifecycle terminals

* CONTRACT: fix(ui-sdk): keep new timing phases compatible with published clients

* CONTRACT: fix(ui-server): route future timer phases through open timing evidence

* CONTRACT: fix host clock accuracy and report per-request cache usage

* CONTRACT: fix completed clock evidence across turn cleanup

* CONTRACT: keep clock evidence independent from worker control

* test(ui-sdk): initialize worker evidence assertion results

* CONTRACT: define hold clocks by worker control acknowledgements

* CONTRACT: refresh worker control acknowledgement API report

* fix(ui-sdk): remove obsolete worker probe from startup type

* CONTRACT: isolate inference relay diagnostic failures

* CONTRACT: retain first-read failures and self-contained identity fixtures

* CONTRACT: refresh merged lifecycle and catalog API report

* test(ui-server): preserve owner receipts across host timing enrichment

* fix(ui-server): complete client receipt and callback type integration

* fix(ui-server): adapt hold diagnostics to journal change batches

* CONTRACT: refresh merged lifecycle and catalog API report

* test(ui-server): include workspace areas in lifecycle dispatch fixtures
* fix(ui-sdk): export inference timing types for declaration emit

prepareTurnEgress's inferred return type names InferenceTimingMark and
InferenceUsage, which the internal barrel did not export, so declaration
emit failed with TS2883 after #4322 (typecheck alone does not catch it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: add changeset for inference timing type exports

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ve proof (#4393)

* test(ui-server): preserve throwaway admission spike measurements

* docs(native-proof): distinguish admission component timings from native proof
…l cleanup (#4323)

* fix(ui-server): compute retained finish references once

* fix(core): prune excluded directories during file discovery

* fix(ui-server): quarantine orphan journal objects during maintenance

* test(core): prove excluded discovery never opens unreadable trees

* CONTRACT: fix(core,ui-server): reserve hosted packing and discard failed Git output

* fix(ui-server): discard Git scaffolding from the ordinary maintenance pass

* test(core): prove failed packing removes only its temporary outputs

* test(native): run packing proof after timing samples

* fix(storage): distinguish preflight skips from unknown packing failures

* CONTRACT: fix(core): include packed-ref text in packing headroom

* fix(ui-server): report unresolved quarantine charges in maintenance

* test(ui-server): prove finish reference cleanup shares its terminal transaction

* test(core): make the discovery negative control explicit

* fix(ui-server): qualify dedicated packing no-space results

* fix(ui-sdk): preserve memory headroom for dedicated packing stages

* test(native): refuse packing before a stage exhausts memory

* test(native): acquire the memory-control checkpoint before overriding its observation

* CONTRACT: fix(storage): preserve legacy enums and put packing skips in optional metadata

* test(ui-server): account for the maintenance system principal

* test(storage): cover legacy Activity parsing for scrub failures

* CONTRACT: docs(ui-server): record optional native packing API metadata

* test(core): retain the complete statfs shape in the compatibility fixture

* fix(core): restrict temporary-pack cleanup to declared private stages

* CONTRACT: fix(storage): address maintenance review and reserve disk packing

* test(ui-sdk): preserve disk packing with no memory headroom

* fix(ui-server): share the scrub work bound fairly with retries

* test(ui-server): prove the combined scrub batch bound

* fix(ui-sdk): attest usable capacity of disk packing stages

* fix(ui-sdk): clean up staging configuration admission failures

* test(core): validate headroom types and tracked asset pruning

* style(ui-sdk): use suffix predicates for pack publication

* fix(ui-server): charge recreated orphans beside corrupt quarantine

* fix(ui-server): reserve packing filesystem metadata headroom

* CONTRACT: fix(storage): split dedicated packing and address cleanup review

* fix(ui-server): replay scrub phases under the database writer lock

* fix(core): clean failed incremental MIDX temporary companions

* fix(storage): publish pack metadata after its complete indexed set

* fix: make maintenance publication crash-safe and retry durable cleanup

* fix: require reflinks for existing pack publication generations

* fix: contain malformed scrub reservation sizes per entry

* test: update native output doubles for Git step receipts

* fix: preserve existing pack ages across atomic publication

* CONTRACT: fix(storage): narrow Git publication and contain cleanup failures

* fix: retain selected Git runtime inputs and stage setup cleanup

* CONTRACT: fix(storage): bound scrub enumeration and Git ignore batches

* test(storage): enable default publication in hosted pack proof

* fix(core): reuse shared containment for Git candidate paths

* fix(host): scope failed Git publication to maintenance

* CONTRACT: docs: describe idle journal recovery refresh and temporary reservations

* CONTRACT: fix(host): collect completed maintenance results before publication

* CONTRACT: docs: align maintenance publication with completed report capture

* fix(core): skip discovery names that cannot round-trip through UTF-8

* CONTRACT: fix(journal): admit optional scrub schema within quota

* fix(core): refuse incomplete media-reference discovery
#4327)

* CONTRACT: fix(activity): preserve snapshots and monotonic startup timing

* CONTRACT: fix(activity): keep snapshot evidence and sequence floors consistent

* CONTRACT: fix(activity): bound backend evidence and preserve legacy snapshot coverage

* CONTRACT: fix(activity): preserve reconnect floors and isolate lifecycle repair

* fix(activity): restore scoped atomic lifecycle snapshots

* test(activity): align dispatch fixtures with workspace admission

* CONTRACT: fix(activity): preserve legacy REST lifecycle sequence

* test(native): retain admission bounds in merged timing fixture
* CONTRACT: feat(ui-server): retain Git checkout change receipts

* test(ui-server): verify filter refusal without executing canaries

* CONTRACT: fix(ui-server): respect pool allowances and preserve final note capture

* fix(ui-server): contain receipt failures and restore checkout refactors

* fix(ui-server): enforce live receipt scope and capture boundaries

* docs: record managed receipt scope and retained owner history rulings

* CONTRACT: fix(ui-server): qualify receipt inputs and enforce checkout ceilings

* fix(ui-server): restrict code preview to owner principals

* fix(ui-server): boot past malformed checkout receipts

* fix(ui-server): quarantine unusable checkout receipts
* CONTRACT: feat(ui-server): enforce prospective exact-origin trust (#4270)

* CONTRACT: feat(ui-server): enforce prospective exact-origin trust (#3609)

* CONTRACT: fix(safety): fence reviewed origin admissions across publication and connect waits

* CONTRACT: fix(safety): bind shared cards to context and preserve trusted fork admissions

* CONTRACT: fix(ui-react): distinguish mixed source trust and human safety verdicts

* CONTRACT: fix(safety): separate transport approvals and hash verified policy bytes

* test(ui-sdk): type transport approval evidence explicitly

* CONTRACT: fix(safety): enforce IPv6 tunnels and retain last-valid trust on read failures

* test(ui-server): preserve selector scheme literal type

* CONTRACT: fix(safety): unify live trust observation and cache stable generations

* CONTRACT: fix(egress): canonicalize hosts and fence every send independently

* fix(egress): reject unmatched brackets in policy host patterns

* CONTRACT: docs(api): record independent recipient approval evidence

* CONTRACT: fix(safety): validate admission evidence and cache only verified live state

* test(ui-react): keep admission fixture discriminants literal

* CONTRACT: fix(safety): bind unmatched evidence to live snapshot and render IPv6 authorities

* test(ui-react): use supported polling assertion options

* CONTRACT: fix(egress): preserve DNS dial authority and version-one detector IDs

* test(ui-sdk): preserve legacy history fixture literals

* CONTRACT: fix(egress): cancel queued refresh and discriminate charge refusals

* CONTRACT: fix(trust): scope revocation to source rule and validate byte charges

* CONTRACT: fix(trust): retire source instances and unify send decisions

* CONTRACT: fix(egress): allow safe completion at exact byte cap

* CONTRACT: fix(egress): publish recipient grants only at dispatch

* CONTRACT: fix(egress): retain one typed refusal across all callers

* CONTRACT: fix(egress): guard the complete operation lifecycle

* CONTRACT: fix(egress): validate provenance and cancel every dispatch

* CONTRACT: preserve relay failure causes and own terminal cleanup

* CONTRACT: fence provider sends and preserve cancellation evidence

* CONTRACT: preserve upstream status and fence buffered provider responses

* CONTRACT: share relay response accounting and terminal fences

* CONTRACT: publish dispatch facts after transport starts and fence delivery

* CONTRACT: fence HTTP connection construction and prove selector retirement

* CONTRACT: preserve route allowance and debit all received overflow

* CONTRACT: classify synchronous transport failures before terminal cleanup

* CONTRACT: meter received HTTP headers before forwarding filters

* CONTRACT: publish egress exposure only after transport construction succeeds

* CONTRACT: bind recipient receipts to dispatch and share admission validation

* CONTRACT: meter relay request heads before filtering

* CONTRACT: preserve legacy egress routes and meter interim HTTP heads

* CONTRACT: require durable occurrence confirmation before trusted dispatch

* CONTRACT: preserve own-input approvals and classify peer recorder changes

* CONTRACT: retain dispatched session grants and preserve outward callback inputs

* CONTRACT: preserve shared-card approvals and inference refusal compatibility

* test: preserve compatible inference text at relay boundaries

* CONTRACT: exclude exact shared-card peer write reservations

* CONTRACT: preserve refusal causes through session binding

* CONTRACT: avoid unchanged trust refresh waiting behind indexing (#4405)

* CONTRACT: isolate HTTP proxy upstream connections per operation (#4409)

* feat(ui-server): bind immutable reads to approved owner evidence (#4273)

* feat(ui-server): bind immutable reads to approved owner evidence

* fix(ui-server): retain publication root identity across restarts

* fix(ui-server): require live host continuity for owner qualification

* fix(ui-server): close owner continuity during normal shutdown

* fix(ui-server): attest owner approval against pinned native brain identity

* fix(ui-server): wire native owner identity into host publication

* chore(ui-server): keep native root helper types private

* fix(ui-server): resolve owner evidence through live Settings policy

* test(ui-server): adapt trust refresh fixtures to journal areas

* fix(ui-server): boot past the receipt recovery update on a full journal
The epic's tree already contains main up to b7202e6 through #4435, whose
squash dropped the merge parent. This merge records that ancestry without
changing the tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in #4425, #4441 and #4428. Two conflicts were independent additions
and keep both sides: an import block in packages/ui-server/src/app.ts and
adjacent sections in docs/http-api.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schlessera schlessera added this to the 0.45.0 milestone Nov 21, 2026
@schlessera schlessera added type: feat A new capability or a change in user-visible behaviour. area: core packages/core: the brain CLI, indexer, hybrid search, config, taxonomy, skills. area: ui-sdk Wire protocol, runtime schemas, the server and client SDK surfaces. area: ui-server Hono app factory: turn coordinator, auth, session catalog, routes, cron. area: ui-react React chat/files/voice components, stores, WebSocket transport. area: backends AgentBackend implementations and the seam they share. contract Touches the integration contract: CONTRACT: commit, contract doc updated in the same commit. labels Nov 21, 2026
@uploads-sh

uploads-sh Bot commented Nov 21, 2026

Copy link
Copy Markdown

No uploads on this PR yet

This PR changes UI files (packages/ui-react/src/components/chat/code-changes.tsx, packages/ui-react/src/components/chat/composer.tsx, packages/ui-react/src/components/chat/scope-cap-card.tsx and 3 more). Screenshots help reviewers see what changed.

  • From the CLI: uploads put before.png after.png --pr 4444
  • From an agent: ask it to attach screenshots with uploads.sh
  • By hand: drag images into the PR description and they're imported automatically
Tips for agents

Label each shot so reviewers know what they're seeing. Labels apply to every file in a call, so run one put per shot:

uploads put after.png --pr 4444 --meta path=/settings --state after --caption "Saved settings toast"
uploads put chat.png --pr 4444 --app ios --screen "Chat" --state after

No CLI? With the Uploads MCP, call sign_upload_url for files on disk (or put) with repo, pr: 4444 and the same screen, state and caption fields.

This comment updates with each upload, so you don't need to post the images yourself. A shot or two in the PR description is still welcome. Check what's attached with uploads list --pr 4444. More in the github-screenshots skill or the agent docs.

Workspace admins can turn this comment off in Settings → GitHub · docs

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head b658d40 against base 7e861bd. Reviewer: agent. 6 findings: 0 fixed, 0 filed, 0 rejected, 6 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4444,
  "head": "b658d40663f58803002fe3f4d2c6d83fa7e8a294",
  "base": "7e861bdb3ba0729e217f2980063e18f3dd0172df",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "F1 packages/ui-server/src/brain/turn-journal.ts:1025 — finish awaits an accounted receipt UPDATE before removing the ended turn from active, even for a turn with no checkout. I injected one capacity refusal on the final finish call. The next turn's note was journaled against both turns, and the ended turn still read as recording. Idle scrub also sees the stale participant as busy."
    },
    {
      "summary": "F2 packages/ui-server/migrations/096_code_change_receipts.journal.sql:2 — Upgrade creates three journal tables before capacity admission. With 4 KiB of headroom, I measured growth from 39 to 45 pages. An ordinary accounted write passed before upgrade and failed with JournalCapacityError afterward, before any checkout receipt existed. The near-cap upgrade fixture already contains these tables."
    },
    {
      "summary": "F3 packages/ui-server/migrations/096_code_change_receipts.journal.sql:6 — The pack_hash foreign key lacks a child index. During finish, every unused-object DELETE scans every checkout receipt while workers are held. SQLite confirmed SCAN turn_journal_code_receipts. With 5,000 receipts, deleting 2,000 unrelated objects took 243 ms versus 2.8 ms with a pack_hash index."
    },
    {
      "summary": "F4 packages/ui-server/src/brain/turn-journal.ts:747 — Every observation sums all previously seen checkout sizes, copies all previously changed paths and decodes every receipt path list, even when this observation changed one unrelated note. This restores history-sized work on the main thread while all participating workers are stopped. The 10,000-row counter test exercises file rows only."
    },
    {
      "summary": "F5 docs/http-api.md:2471 — The session switch still promises a per-file journal for writable workspaces. Covered Git checkouts now retain one endpoint receipt and discard intermediate versions. The same obsolete promise appears in docs/hosting/agent-workers.md:474, docs/decisions/worker-writable-areas.md:447 and the quiet-workspace-inspection changeset."
    },
    {
      "summary": "F6 .changeset/git-checkout-receipts.md:7 — The combined PR ships the ruled breaking narrowing of checkout history. PR #4362 and issue #4297 carry the breaking label, but the landing PR #4444 carries only contract. The pre-1.0 classification requires breaking on the change that lands."
    }
  ]
}

… journal (#4447)

* fix(ui-server): keep journal finish and receipt tables safe on a full journal

* docs: distinguish workspace file history from checkout receipts

* fix(ui-server): leave receipt schema admission refusals unclassified

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head bf75d3d against base 7e861bd. Reviewer: agent. No findings.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4444,
  "head": "bf75d3d9060434c94ed3ed97de9dd5711fb9d02d",
  "base": "7e861bdb3ba0729e217f2980063e18f3dd0172df",
  "reviewer": "agent",
  "outcome": "no-findings",
  "findings": []
}

@schlessera
schlessera marked this pull request as ready for review November 22, 2026 10:19
@schlessera
schlessera marked this pull request as draft November 22, 2026 10:48
* fix(ui-server): preserve journal capture deduplication and purge counts

* CONTRACT: fix(ui-sdk): register malformed checkout receipt diagnostics

* CONTRACT: test: align exhaustive fixtures with epic behavior

* test(native): evaluate checkpoint reader exports in hosted controls

* test(native): isolate provider proof admission lifetimes

* test(ui-server): force reversed retention completion in inspection proof

* fix(ui-server): prepare Git mask targets before maintenance checkpoints

* fix(ui-server): scope Git target preparation to maintenance operations

* test(ui-server): own the complete wiring database family

* test(ui-server): type the asynchronous maintenance probe double

* test(ui-sdk): supply owned-prune target preparation and force cleanup ordering

* test(ui-server): bound purge pin work independently of wall clock

* test(ui-server): retain a load-scaled purge complexity proxy

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head cdaf077 against base 7e861bd. Reviewer: agent. 3 findings: 0 fixed, 0 filed, 0 rejected, 3 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4444,
  "head": "cdaf077375ad4a5b72e817992949bd590783b169",
  "base": "7e861bdb3ba0729e217f2980063e18f3dd0172df",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "F60 packages/ui-server/src/brain/host-boundary.ts:687 — A storage-removal review sets publish:false, but target preparation creates missing hooks, info, and modules in the live .git before taking the checkpoint. Those directories survive even if the review fails. This bypasses the installer’s live-absence check and contradicts the stage-only rule in docs/decisions/governed-writable-workers.md:2853."
    },
    {
      "summary": "F61 packages/ui-server/src/brain/maintenance-git.ts:138 — A server-owned, read-only .git directory with no config now blocks maintenance before checkpoint acquisition. On the reviewed head, the Git source collector returned repository:false for that fixture, then target preparation failed with EACCES on mkdir. The new fixture supplies an installer manifest by hand for a checkout where production would skip the adapter."
    },
    {
      "summary": "F62 .changeset/quiet-owls-prepare.md:5 — The release note promises that host boot remains available after target preparation fails. With versionRequirements.brainCli set, the startup version probe uses boundary.run, and a target refusal makes the unknown CLI version fatal before the database opens. The PR records this exception in #4466, but the consumer-facing changeset omits it."
    }
  ]
}

…usal (#4468)

The release note promised host boot stays available after a Git mask
target refusal. With versionRequirements.brainCli set, the startup
version probe is a maintenance operation, so a refused probe leaves the
CLI version unknown and stops boot (tracked in #4466).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head cdaf077 against base 7e861bd. Reviewer: agent. 3 findings: 1 fixed, 2 filed, 0 rejected, 0 without a disposition.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4444,
  "head": "cdaf077375ad4a5b72e817992949bd590783b169",
  "base": "7e861bdb3ba0729e217f2980063e18f3dd0172df",
  "reviewer": "agent",
  "outcome": "findings",
  "findings": [
    {
      "summary": "F60 packages/ui-server/src/brain/host-boundary.ts:687 — A storage-removal review sets publish:false, but target preparation creates missing hooks, info, and modules in the live .git before taking the checkpoint. Those directories survive even if the review fails. This bypasses the installer’s live-absence check and contradicts the stage-only rule in docs/decisions/governed-writable-workers.md:2853.",
      "disposition": "filed",
      "issue": "schlessera/brain-kit#4470"
    },
    {
      "summary": "F61 packages/ui-server/src/brain/maintenance-git.ts:138 — A server-owned, read-only .git directory with no config now blocks maintenance before checkpoint acquisition. On the reviewed head, the Git source collector returned repository:false for that fixture, then target preparation failed with EACCES on mkdir. The new fixture supplies an installer manifest by hand for a checkout where production would skip the adapter.",
      "disposition": "filed",
      "issue": "schlessera/brain-kit#4469"
    },
    {
      "summary": "F62 .changeset/quiet-owls-prepare.md:5 — The release note promises that host boot remains available after target preparation fails. With versionRequirements.brainCli set, the startup version probe uses boundary.run, and a target refusal makes the unknown CLI version fatal before the database opens. The PR records this exception in #4466, but the consumer-facing changeset omits it.",
      "disposition": "fixed",
      "commit": "827d1688e609d85e71c291cee73880d35984865d"
    }
  ]
}

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head 827d168 against base 7e861bd. Reviewer: agent. No findings.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4444,
  "head": "827d1688e609d85e71c291cee73880d35984865d",
  "base": "7e861bdb3ba0729e217f2980063e18f3dd0172df",
  "reviewer": "agent",
  "outcome": "no-findings",
  "findings": []
}

@schlessera
schlessera marked this pull request as ready for review November 22, 2026 16:31
@schlessera
schlessera marked this pull request as draft November 22, 2026 16:31
@schlessera
schlessera marked this pull request as ready for review November 22, 2026 16:31
@schlessera
schlessera marked this pull request as draft November 22, 2026 16:54

Copy link
Copy Markdown
Owner Author

Independent review

Reviewed head 5b8c474 against base 7e861bd. Reviewer: agent. No findings.

{
  "version": 1,
  "kind": "brain-review-receipt",
  "pr": 4444,
  "head": "5b8c474874405f40afcd80d2c29a9d34bbd2aac8",
  "base": "7e861bdb3ba0729e217f2980063e18f3dd0172df",
  "reviewer": "agent",
  "outcome": "no-findings",
  "findings": []
}

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

Labels

area: backends AgentBackend implementations and the seam they share. area: core packages/core: the brain CLI, indexer, hybrid search, config, taxonomy, skills. area: ui-react React chat/files/voice components, stores, WebSocket transport. area: ui-sdk Wire protocol, runtime schemas, the server and client SDK surfaces. area: ui-server Hono app factory: turn coordinator, auth, session catalog, routes, cron. breaking Breaks a published API or documented behaviour. Needs a maintainer ruling before code. contract Touches the integration contract: CONTRACT: commit, contract doc updated in the same commit. type: feat A new capability or a change in user-visible behaviour.

Projects

None yet

1 participant