Repository navigation
CONTRACT: feat(ui-server): bind managed source to turn authority - #4002
Conversation
7463e17 to
1b1d7bb
Compare
1b1d7bb to
0b9d600
Compare
Independent reviewReviewed head 24d4553 against base df1e105. Reviewer: agent. 2 findings: 2 fixed, 0 filed, 0 rejected, 0 without a disposition. {
"version": 1,
"kind": "brain-review-receipt",
"pr": 4002,
"head": "24d45535828144d44fa397d009f863b40c72a21b",
"base": "df1e10569f561af8d8545fe9b768470a89146fb2",
"reviewer": "agent",
"outcome": "findings",
"findings": [
{
"summary": "packages/ui-server/src/brain/reference-source.ts:573: Concurrent managed publications can roll back newer source. Reproduced: pause request A after fetching commit A, let request B publish commit C, then resume A. A overwrites the catalog and view with commit A and reports it fresh; invalidation fences never changed.",
"disposition": "fixed",
"commit": "1170652f2c67200d60de13e9c0861ad77749573e"
},
{
"summary": "packages/ui-server/src/brain/reference-source.ts:765: Reconstructing a stored repository key appends .git when its source catalog row is absent. Reproduced: allocate a private worktree from an unsuffixed legacy HTTP endpoint, revoke and recreate its grant, then access it. Revalidation requests /ithaca.git instead of the original /ithaca and incorrectly refuses the authorized worktree.",
"disposition": "fixed",
"commit": "1170652f2c67200d60de13e9c0861ad77749573e"
}
]
} |
Independent reviewReviewed head 352f711 against base df1e105. Reviewer: agent. 1 finding: 0 fixed, 0 filed, 0 rejected, 1 without a disposition. {
"version": 1,
"kind": "brain-review-receipt",
"pr": 4002,
"head": "352f711ee89378dc00b177f7d9bce369d3134cb0",
"base": "df1e10569f561af8d8545fe9b768470a89146fb2",
"reviewer": "agent",
"outcome": "findings",
"findings": [
{
"summary": "packages/ui-server/src/brain/reference-source.ts:855: Suspension is tracked only by source key. If service A suspends an expired root and service B publishes a fresh replacement, A retains suspended.has(key). Its settleView/admissible checks then skip the replacement even after validation expires, allowing a new bind with expired source still readable. Reproduced with two database connections."
}
]
} |
Independent reviewReviewed head 352f711 against base df1e105. Reviewer: agent. 1 finding: 1 fixed, 0 filed, 0 rejected, 0 without a disposition. {
"version": 1,
"kind": "brain-review-receipt",
"pr": 4002,
"head": "352f711ee89378dc00b177f7d9bce369d3134cb0",
"base": "df1e10569f561af8d8545fe9b768470a89146fb2",
"reviewer": "agent",
"outcome": "findings",
"findings": [
{
"summary": "packages/ui-server/src/brain/reference-source.ts:855: Suspension is tracked only by source key. If service A suspends an expired root and service B publishes a fresh replacement, A retains suspended.has(key). Its settleView/admissible checks then skip the replacement even after validation expires, allowing a new bind with expired source still readable. Reproduced with two database connections.",
"disposition": "fixed",
"commit": "5ddadd45ed147a722d7cd3c7483cbee47ff3f31d"
}
]
} |
Independent reviewReviewed head a31bcd7 against base 94f5580. Reviewer: agent. 1 finding: 0 fixed, 0 filed, 0 rejected, 1 without a disposition. {
"version": 1,
"kind": "brain-review-receipt",
"pr": 4002,
"head": "a31bcd76a73706dd59ee9466d468afd6e58f7890",
"base": "94f55806c3fe2686c5e026d368fbe0683fac265a",
"reviewer": "agent",
"outcome": "findings",
"findings": [
{
"summary": "packages/ui-server/src/brain/reference-source.ts:239: hiddenRoots confirms only a root ID. After another owner renews and republishes a previously hidden legacy root, a failed withdrawal write installs a matching validation stamp without clearing that old confirmation. bindable() then exposes revoked, expired files without retrying native hiding. Reproduced with two database connections; the underlying legacy hole also appears present on the base."
}
]
} |
Independent reviewReviewed head a31bcd7 against base 94f5580. Reviewer: agent. 1 finding: 1 fixed, 0 filed, 0 rejected, 0 without a disposition. {
"version": 1,
"kind": "brain-review-receipt",
"pr": 4002,
"head": "a31bcd76a73706dd59ee9466d468afd6e58f7890",
"base": "94f55806c3fe2686c5e026d368fbe0683fac265a",
"reviewer": "agent",
"outcome": "findings",
"findings": [
{
"summary": "packages/ui-server/src/brain/reference-source.ts:239: hiddenRoots confirms only a root ID. After another owner renews and republishes a previously hidden legacy root, a failed withdrawal write installs a matching validation stamp without clearing that old confirmation. bindable() then exposes revoked, expired files without retrying native hiding. Reproduced with two database connections; the underlying legacy hole also appears present on the base.",
"disposition": "fixed",
"commit": "8bf9a7bd092b73e03ca2ac6daf6ec7007c282338"
}
]
} |
Independent reviewReviewed head 8bf9a7b against base 94f5580. Reviewer: agent. 1 finding: 0 fixed, 0 filed, 0 rejected, 1 without a disposition. {
"version": 1,
"kind": "brain-review-receipt",
"pr": 4002,
"head": "8bf9a7bd092b73e03ca2ac6daf6ec7007c282338",
"base": "94f55806c3fe2686c5e026d368fbe0683fac265a",
"reviewer": "agent",
"outcome": "findings",
"findings": [
{
"summary": "packages/ui-server/src/brain/reference-source.ts:997: bindable() treats a first acquisition's still-writing staging root as an orphan and calls hideRoot(). Managed withdrawal is now permanent, so starting another turn while fetch is pending sets publicationRevoked=true and makes the valid acquisition fail at publication. The same acquisition succeeds without the concurrent bind."
}
]
} |
Independent reviewReviewed head 8bf9a7b against base 94f5580. Reviewer: agent. 1 finding: 1 fixed, 0 filed, 0 rejected, 0 without a disposition. {
"version": 1,
"kind": "brain-review-receipt",
"pr": 4002,
"head": "8bf9a7bd092b73e03ca2ac6daf6ec7007c282338",
"base": "94f55806c3fe2686c5e026d368fbe0683fac265a",
"reviewer": "agent",
"outcome": "findings",
"findings": [
{
"summary": "packages/ui-server/src/brain/reference-source.ts:997: bindable() treats a first acquisition's still-writing staging root as an orphan and calls hideRoot(). Managed withdrawal is now permanent, so starting another turn while fetch is pending sets publicationRevoked=true and makes the valid acquisition fail at publication. The same acquisition succeeds without the concurrent bind.",
"disposition": "fixed",
"commit": "55143cbe21dddb212f734cf89e0e5f469a00a44e"
}
]
} |
Independent reviewReviewed head 55143cb against base 94f5580. Reviewer: agent. 1 finding: 0 fixed, 0 filed, 0 rejected, 1 without a disposition. {
"version": 1,
"kind": "brain-review-receipt",
"pr": 4002,
"head": "55143cbe21dddb212f734cf89e0e5f469a00a44e",
"base": "94f55806c3fe2686c5e026d368fbe0683fac265a",
"reviewer": "agent",
"outcome": "findings",
"findings": [
{
"summary": "packages/ui-server/src/brain/reference-source.ts:881: Bind expiry fences the current publication from an earlier lapsed snapshot without comparing root/validated_at or rechecking freshness. Another owner can renew the root before suspension, yet this transaction resets validation to 0 and permanently withdraws it, invalidating the renewed source. Reproduced with separate database connections."
}
]
} |
Independent reviewReviewed head 55143cb against base 94f5580. Reviewer: agent. 1 finding: 1 fixed, 0 filed, 0 rejected, 0 without a disposition. {
"version": 1,
"kind": "brain-review-receipt",
"pr": 4002,
"head": "55143cbe21dddb212f734cf89e0e5f469a00a44e",
"base": "94f55806c3fe2686c5e026d368fbe0683fac265a",
"reviewer": "agent",
"outcome": "findings",
"findings": [
{
"summary": "packages/ui-server/src/brain/reference-source.ts:881: Bind expiry fences the current publication from an earlier lapsed snapshot without comparing root/validated_at or rechecking freshness. Another owner can renew the root before suspension, yet this transaction resets validation to 0 and permanently withdraws it, invalidating the renewed source. Reproduced with separate database connections.",
"disposition": "fixed",
"commit": "ea8f20b7bf7529e34edd6ee31a2de8d749841925"
}
]
} |
Independent reviewReviewed head 77ab703 against base 146dfb4. Reviewer: agent. No findings. {
"version": 1,
"kind": "brain-review-receipt",
"pr": 4002,
"head": "77ab703ab7e556479d3756c82718620d35c43cf5",
"base": "146dfb4b398c5c8d313a48dbd9e745327ba5c51f",
"reviewer": "agent",
"outcome": "no-findings",
"findings": []
} |
|
Post-merge qualification — 2026-11-17. #4002 is merged as Candidate run 44131301010 passed all thirteen selected jobs. Automatic main run 44134586911, attempt 1, passed all seventeen selected jobs, and every successful job's actual checkout is the squash above. The complete inventory matches the aggregate's nine fresh categories. Main's two determinism jobs were intentionally unselected; candidate determinism ran and passed. Downloaded artifacts confirm all four healthy native backend/UID cells and cleanup, the separate expected index-failure/recovery control, complete separate-UID worker qualification, and the actual managed-source maintenance worker with sealed This is a partial |
Refs #3613
What changed
Production GitHub reference acquisition now uses the admitted turn's bounded host wire for metadata, branch/tag discovery, fetches and cache validation. Each turn pays for its own checks and retains its own live principal, repository grant and separate API credential-recipient permission. Public acquisition stays anonymous.
The source catalog records the acquiring brain/principal/turn, stable repository and owner IDs, full ref, commit/tree, native sealed-root identity and charged wire bytes. Recovery refuses contradictory retained roots. Retained source/worktree guards recheck authority after waits and wire shutdown.
Publication and revocation now coordinate through shared repository/revision invalidation versions in the UI database. Requests and validation/publication transactions reject changed versions. Other app/cron owners can discover pending staging roots before the first source catalog receipt; sealed invalidated identities are retired so delayed native publication cannot expose them. Managed roots opt into permanent native publication withdrawal. Once hidden, that identity cannot be published again, even after restart or by a delayed RPC. Fresh authorized acquisition gets a new sealed root; live published roots still use the cache. Shared invalidation atomically expires catalog validation and captures the roots to hide, preserving newer authorized publications. Recovery keeps invalidated roots masked without unbound metadata requests. Failed-attempt cleanup affects its own root. Worktree cleanup conditions native parking on its own generation, preserving a foreign holder and still withdrawing an own grant whose reply was lost.
Stored grant and worktree repository keys retain literal suffixes, and raw clone locations stay distinct from canonical identity when wiring metadata, Git requests, revocation and worktree revalidation. A grant for a double-suffix location cannot dispatch metadata credentials to its neighboring repository. Worktrees durably retain the actual source URL, validate its canonical-key binding before dispatch, and keep it after grant revocation removes the source catalog row. Historical legacy records without any retained endpoint refuse an unknown URL instead of guessing a clone suffix.
Native publication conditionally compares the previous alias target under the keeper mutation lock, and the catalog transaction compares the previous root again. An older concurrent fetch cannot replace a newer commit. Concurrent acquisition of the exact same independently resolved commit can validate the new cache on its own turn budget. Failed staging cleanup never suppresses a later authority refusal.
Bind preparation associates suspension and withdrawal with the exact root and validation timestamp whose native hiding was confirmed. Other owners' replacements and renewals expire independently. Failed writes and uncertain native hiding are retried before binding. Startup recovery rereads the catalog and conditions suspension on the observed root and validation timestamp. Native hiding confirmation survives another bind only for permanently withdrawn or released roots. Reversible roots and catalog orphans need fresh hiding confirmation for each bind, because another owner may republish them. Bind preparation checks native state before treating staging as an exposed orphan: a root still outside publication views can finish its valid fetch/seal/publication. Already-exposed staging still requires settlement or hiding. Expiry compares the root, validation timestamp and freshness in one catalog transaction. It retires that managed publication without invalidating another turn's independently authorized staging. Retired roots cannot renew cache validation, including after recovery. Exposed staging is retired atomically before native hiding, and only staging identities can commit publication; a delayed reply cannot create a fresh lease for withdrawn bytes.
Why this shape
This is the managed-only acquisition slice selected by #3613 and the fixed private-metadata ruling. Acquisition facts enable no source trust, actual-read provenance or approved-owner capability. Existing source/worktree tools keep their schemas and ordinary workspace restrictions. The optional conditional native parking and permanent source-withdrawal controls are recorded in the native contract/API report; SDK/server minor changesets cover it.
All five original #3613 acceptance criteria remain open. Immutable returned range/digest evidence, both backend/read entry points, honest capabilities and stable approved-owner/rename/transfer/name-reuse matching remain. #3622 still depends on the complete resolver and independent Settings publication authority.
Proof
Candidate
7d8f8387b3acee5fa32690ce6a51af2c6de3ae3b, clean-merged based2b0a814bb0a9750fc76c7602c1a41df58579284. Fixea8f20b7bf7529e34edd6ee31a2de8d749841925contains the reviewed changes. The latest independent renewal-race finding is reproduced and fixed by that commit; the original finding remains unchanged in the review record. Independent review of77ab703ab7e556479d3756c82718620d35c43cf5returned no findings. The subsequent merges of main are clean; the recorded review covers this refreshed candidate.bdd8093610c9ef4891d4957e4c16158fcb0c4ff8259ea72a08406283f707c0beand existing isolated frozen installations remain applicable. SDK/server minor changesets cover the changes.All five contribution preflight gates passed on the refreshed candidate.
{"version":1,"kind":"brain-check-pr-receipt","head":"7d8f8387b3acee5fa32690ce6a51af2c6de3ae3b","base":"origin/main","mode":"focused","startedAt":"2026-11-17T16:44:09.025Z","finishedAt":"2026-11-17T16:47:02.027Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":16125.900838000001},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":142.78792600000088},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":103.92800100000022},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":30.000545000002603},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":156581.51679}]}Native managed-source, permanent-withdrawal/restart, conditional Btrfs holder, installed-provider-history and managed-worker proof remain unqualified locally because permitted loop-control is unavailable. The earlier native run failed before acquisition because its image omitted OpenSSL; the image now includes OpenSSL/CA certificates. No runtime prerequisite or guard was disabled.
Under the approved hybrid route, ordinary exact-candidate confirmation must pass all selected fast categories before merge. The actual squash's automatic main run must provide all selected heavy/native/provider-history proof, with independent checkout/parent/tree/result reconciliation.
Integration state
The independent review is complete and covers the clean refresh. Declared fix #4187 merged as
e982c1c0d998dced8dfaeb7f82ea02002f0edad6; its automatic main run 44107659969 passed and incident #4186 has cleared. The branch includes the fix and is ready for ordinary exact-candidate confirmation through the shared integration lease. PR and advanced issue #3613 retain release milestone 0.45.0; the registry currently publishes 0.44.0. This session owns no integration reservation. Other sessions continue using the shared lease.Guard scope and recovery
publicationRevokedfield; the requesting tool reports its authority/metadata refusal. Recovery never clears invalidation merely by starting a service.Checklist
Anything left open
All five #3613 criteria, remaining native/installed-backend qualification, #3622's resolver/publication dependencies and the two separately reserved final combined-epic reviews remain open. Acquisition mapping alone grants none of those capabilities.