Conversation
jhrozek
force-pushed
the
plan/workspace-enrollment-authority
branch
from
September 23, 2026 15:11
bd51e49 to
9bacc04
Compare
jhrozek
force-pushed
the
impl/workspace-enrollment-authority
branch
from
September 23, 2026 15:11
c56d0ee to
9e31ab8
Compare
jhrozek
force-pushed
the
plan/workspace-enrollment-authority
branch
from
September 23, 2026 20:43
9bacc04 to
943bc9a
Compare
jhrozek
force-pushed
the
impl/workspace-enrollment-authority
branch
from
September 23, 2026 20:43
9e31ab8 to
4a4c628
Compare
jhrozek
force-pushed
the
plan/workspace-enrollment-authority
branch
from
September 24, 2026 10:05
943bc9a to
4e7142f
Compare
jhrozek
force-pushed
the
impl/workspace-enrollment-authority
branch
from
September 24, 2026 10:05
4a4c628 to
b0f6c75
Compare
jhrozek
force-pushed
the
plan/workspace-enrollment-authority
branch
from
September 24, 2026 11:16
4e7142f to
68be96d
Compare
jhrozek
force-pushed
the
impl/workspace-enrollment-authority
branch
from
September 24, 2026 11:16
b0f6c75 to
92f3add
Compare
Base automatically changed from
plan/workspace-enrollment-authority
to
main
September 24, 2026 11:29
jhrozek
force-pushed
the
impl/workspace-enrollment-authority
branch
from
September 24, 2026 11:31
92f3add to
234f679
Compare
jhrozek
marked this pull request as ready for review
September 24, 2026 11:31
Workspace enrollment replaced the session's whole tool capability set with the latest broker catalogue, discarding unrelated authority. Restart and successor paths had no durable way to tell stale broker keys from deliberately retained capabilities, and a cross-source registration collision could make a durable key resolve to a different implementation. Persist a bounded broker-key ledger with a presence bit on the Session aggregate, through sessnap and eventsource. The server sets authority and ledger together on every root-creation and authority-carrying path (clear, fork, and CreateSession with a source session); session.New starts with absent provenance, so a path that forgets the ledger refuses enrollment. Completion replaces only the prior broker bundle and keeps excluded keys in the ledger, so an exclusion survives a refresh that omits the key. Composition registers broker tools last against frozen registration keys and reports a collision as a typed, presentation-safe error that unwraps to failed precondition. A recorded broker key still held in authority and now owned by a non-broker tool fails every engine build. An enrollment-time collision or ledger overflow clears the pending enrollment; mecatui shows it as a terminal failure without sending a retained prompt. Offline tests cover every acceptance criterion in docs/acceptance/workspace-enrollment-authority.md: aggregate, persistence, restart, successors, composition (the real Build with a configured deny), server end to end, and TUI. Implements the plan in #1741. Relates to #1740. Co-Authored-By: mecatl <noreply@mecatl.dev>
jhrozek
force-pushed
the
impl/workspace-enrollment-authority
branch
from
September 25, 2026 11:36
234f679 to
75230db
Compare
This branch was successfully deployed
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
Sessionaggregate (throughsessnapandeventsource). A completed enrollment now replaces only the prior broker bundle.CreateSessionwith a source session).session.Newstarts with absent provenance, so a path that forgets the ledger refuses enrollment instead of keeping stale keys.FailedPreconditionnaming only the key, clears the pending enrollment, and leaves prior authority and ledger unchanged. A recorded key still held in authority that a non-broker tool later takes fails every engine build for that session until the operator corrects the configuration.Development stage
and the in-PR plan declares
**Expected tasks:** 1, a non-placeholder**Combined rationale:**, and no runtime/public/operator/persistence/trust-boundaryinterface change (
None — rationale; workflow-only meta-changes may review processdocs/skills here)
Contract linkage
docs/acceptance/workspace-enrollment-authority.md(in docs: plan workspace enrollment authority repair #1741)3e80d41cf20c6060f4f683a3c5ba513db752cc96(docs: plan workspace enrollment authority repair #1741 squash merge)Interface conformance
3e80d41cf): the two addedSessionaccessors, the changedCompleteWorkspaceEnrollmentsemantics, thesessnap.Snapshot/eventsource.SessionMetafields, no proto/RPC/config changes. Adds the AC1.5 proof that direct MCP refresh (feat(mcp): reconcile sources and refresh session tools #1673) refuses broker-bound sessions.Issue relationship
Relates to #1740
Type of change
Test plan
Baseline checks
task lint)task test)task test:race)go run ./cmd/mecademo)task docs)task site:build)task api:check)task api:update+engine/CHANGELOG.mdtask ac-trace-strict)/panel-reviewRun on this branch before the final rebases, which changed only docs (the tree is otherwise identical); CI re-runs everything:
task lint: 0 issues in the root, engine,authn/oidc, and four provider modules (run with--timeout 20m; the default timeout was too short on a cold cache).task test,task api:check,task docs,task site:build, and the offline demo passed.TestADR_NNNN_*/TestInvariant_*.task test:race(run module by module with-p 4): all seven modules passed with no data races, except three subprocess-timing tests incmd/mecatui/agenthookthat hit 10-second waits under full-suite load. That package is untouched by this PR; rerun alone with-race, it passes.task ac-trace-strict(applies once the plan is landed), and/panel-review.Changes
engine/sessionengine/adapter/sessnap,eventsourceinternal/adapter/servercarriedAuthoritycarries authority + ledger together; creation records broker registration keys; typed collision error; collision/overflow clears pendinginternal/appSpec()callscmd/mecatui/ui/tools-connectretry offeredUser-facing change
/tools-connectno longer strips tools unrelated to the broker from the session.Special notes for reviewers
CompleteWorkspaceEnrollment's semantics are classified Changed (breaking, pre-v1 minor) inengine/CHANGELOG.md.