TUI: unify asynchronous completion identity gates#652
Draft
TZZheng wants to merge 8 commits into
Draft
Conversation
This was referenced Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is the PR 4 milestone from #645: replace path-specific asynchronous identity checks with one fail-closed envelope and acceptance predicate, while preserving visible behavior.
MainAggregateWriter, and makes no resource-cancellation claim.Dependency and stacked review base
Depends on #648 and #649.
Both prerequisite PR heads live in the contributor fork rather than as branches in the upstream repository. GitHub therefore cannot use their local composition as this upstream PR's base without creating a temporary upstream branch. This PR is opened as a draft against
mainwhile those prerequisites remain open; GitHub's current rendered diff consequently includes their changes.The independently reviewed PR-4-only range begins after synthetic composition commit
717e9d800a2a3038a1eed6826a0fe156e43caf7f, whose exact parents are:05e73f17477f830b93af2033046ee19902dd3fcb76ab358434ada1f15ee43dfb2acd4816a3026c5aPR-4-only binary patch SHA-256 (
717e9d80..aaf1021c):561766105f1d72abfafd06b33ff38c7a69c25c8cefc8f972939057bb75cc8a4fDo not treat the combined
main..HEADview as PR4 attribution. After #648 and #649 land, the draft can be refreshed against canonicalmain; any changed source bytes require fresh exact-HEAD validation and both independent reviews again.Contract and implementation
The shared predicate fails closed on unknown kinds, missing or extra identity-mask fields, invalid ownership/target binding, changed inventory address, stale generation/cache/version/epoch, and captured work that attempts to weaken current inventory policy.
Every producer captures identity at the substantive launch boundary, and every consumer runs the same acceptance predicate before publication.
projectMailRefreshRequestMsgremains coordination rather than a ninth completion family; delayed human-location work re-enters the predicate immediately before its side effect. The oldacceptRefresh,acceptsTick,projectMailRuntimeGate, message-local identity checks, and generation-only editor gate are removed rather than bridged.The Nirvana sequence is now:
Test-first evidence
The committed sequence preserves the intended RED boundaries:
083ff62c: source/symbol inventory contract RED before implementation.8ec1870c: direct predicate matrix RED with 55 intended assertion failures, not syntax/import/environment noise.79c808b8: minimum shared envelope/predicate; focused normal and race green while runtime installation remained red.ba01e821: nine producer/consumer installation contracts RED before installation.aaf1021c: installation plus both post-review corrections.Two additional review-driven contracts were also captured before their fixes:
An earlier test-authoring attempt that compared a non-comparable struct was rejected and is not counted as RED evidence.
Validation
Validated at exact clean HEAD
aaf1021c0cd25eda70f4f89b1b48def6336ec307:gofmtandgit diff --check;-racesuites, including the destructive-window and replay/state contracts;internal/tuinormal and race suites excluding the known unrelated portal case;go vet ./...;After both reviewers completed, the parent reran the exact focused normal and race suites with isolated temporary caches: both passed and the worktree remained clean.
Known unrelated caveat:
TestPortalURLTimeoutKillsChildcan fail because its fake portal never writes a PID. The file is untouched by this PR and the same failure was reproduced independently; it is not hidden as a candidate pass.Independent exact-HEAD reviews
Both reviews used fresh detached worktrees and re-adjudicated the earlier destructive-lifetime BLOCK; every changed byte invalidated the old verdicts.
gpt-5.6-sol/ high / real read-only sandbox:VERDICT: PASS, no BLOCKER/HIGH/MEDIUM/LOW findings. Report SHA-256:147c9d6e990a3da1cac5fb6fdb74d75d7567916aeebb0a91d8cdd6d8a3637365.sonnet/ high / mutation tools disabled:VERDICT: PASS, no BLOCKER/HIGH/MEDIUM findings. Report SHA-256:143af57058b4732dbbf3d40ca4f7d1a627c1650b5f54d314feaf6957afceba99.Claude recorded three non-blocking LOW notes for transparency: a historical local evidence-log naming ambiguity, the external semantic-ANATOMY validator's lack of explicit
async_envelope.goentries (the file is structurally covered by permanent source-inventory tests and was manually inspected), and functionally redundant older-page envelope capture from the same frozen value snapshot. None changes the accepted runtime identity or visible behavior.Same-PR cleanup, bridge, and rollback
ProjectMailStoreownership.Part of #645.