Skip to content

fix: enable core session identity by default - #10155

Closed
Zedmor wants to merge 1 commit into
mainfrom
fix/core-ledger-default-routing
Closed

Zedmor wants to merge 1 commit into
mainfrom
fix/core-ledger-default-routing

Conversation

@Zedmor

@Zedmor Zedmor commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

On a new installation, a member's session-ledger tool can be present but refuse calls because core has no verified caller. Core bypasses the identity broker by default. Enabling that route manually can still leave a stub looking in the wrong data home, or allow its first request to outrun identity publication. Children sharing a runtime also need their own identity: the parent PID cannot distinguish their calls.

Why it matters

Members need durable session checkpoints without manual routing. Delegated children must use their own checkpoints without gaining access to their parent's ledger.

What changed (motivation → approach → change)

Core uses a broker stub when no current or legacy roster is saved. Explicit rosters, including [], are preserved; backend sharing stays off by default. Stubs receive their owning data home across filtered harness environments.

An unidentified stub resolves late caller identity before forwarding an MCP request, then sends the existing recaller frame first on the same connection. Lookup runs off the event loop with a one-second aggregate deadline. Pending work survives reconnects without duplicate jobs; a completed stale miss gets one fresh lookup within that deadline. Missing identity still produces the strict backend refusal.

Shared-runtime children and TaskRunner steps receive their own session keys. Reusable overlays carry no session keys or backend credentials. Gateway claims preserve explicit child bindings, warm-runtime rekeying and PID-based aborts. Explicitly bound stubs require session_bound_ack; an incompatible initial connection uses verified direct fallback, while an incompatible reconnect stops before replay. An unverified fallback receives no session-key or host-PID authority.

Generated stub commands load the gateway's package tree using -B -E -P, a standard-library bootstrap and a separate trusted-root argument. Workspace packages and Python startup overrides cannot replace the stub. Source-only installs and the gateway's no-user-site policy remain supported. Cached launches regenerate when their schema, package location, owning home or site policy changes.

Case Result
No saved roster Core uses a stub by default
Explicit stub_servers: [] Direct core remains selected
Identity arrives after registration Available caller repair precedes the next request
Child shares its parent's runtime Child carries its own session key
Workspace contains a fake Python package Stub loads the gateway's package tree

Doctor and shipped guides explain the saved-empty-roster upgrade. Diagnostics distinguish missing routing from missing identity. Private V2 and strict ledger authorization keep their existing boundaries.

Maintainer decision requested (not yet approved): whether to accept one broker per data home and one stub per core connection; newly routed core participates if sharing was already enabled. Historical serialized [] cannot be distinguished from an intentional opt-out and requires manual activation. Configuration saves persist the resolved default roster.

This fixes session_ledger_* identity through kirocrew-core, the only new default route. kirocrew-dashboard keeps its existing per-agent opt-in and member-DM session mount. On supported backends with Crew-owned permissions, that member mount carries its session key, bound gateway port and owning home. General dashboard routing remains outside this change. Main's conductor work-item ledger (kirocrew-work, #10265) is a separate existing feature whose default routing is also outside this change. Workflow-ledger support and completion callbacks remain separate work.

Tests

On 5fee6cd8046a, 2,114 tests passed and one failed across 20 complete backend files covering the incoming session-tag changes, cron persistence, runtime identity and both ledgers. The failing TestRuntimeWiring::test_run_chat_passes_memory_store_to_build_message[none] reproduced on untouched base 8b58f72a8677: this host's glibc lacks the atomic no-replace rename symbol. Both runs exited 1. This is a baseline comparison, not a fully passing local suite.

The two complete cron files passed 179 tests in a separate run. The inherited removal test retains the malformed on-disk input and verifies that unrelated removal succeeds, the parent stays removed and the surviving job has the loader's documented empty session key. Its former list-preservation expectation failed on both 7266ece0fc95 and exact base ea9ada27ff97. Product cron behavior is unchanged.

Both session-tag UI test files passed 58 tests. Formatting, import order, subprocess encoding, flake8, mypy, harness parity and docs lint passed. Both focused local review contracts reported no findings on 5fee6cd8046a; they used the inherited agent model, not the CI GPT or Claude models.

The original 44-file ledger patch is byte-identical to the patch on 7266ece0fc95; the cron test is the only added authored file. Its regression tests cover real late PID publication, first-request ordering, missing identity, timeout/reconnect behavior, stale lookup misses, child bindings, hostile workspaces and source-only installs. Historical full-suite evidence remains scoped to e1fbc357ea1f: 99,171 passed, with 548 failed/error identities reproduced on exact base d63917efb29c; both runs exited 1. Final-head GitHub CI remains required.

A fresh production frontend build and wheel build passed on 5fee6cd8046a. The wheel's 1,475 Python files and 2,396 frontend assets were byte-verified against the frozen source and new bundle. Wheel SHA-256: 92f28e28a35a43b383ba6ff1b90e36f1394ae15acfc79b30237266ca43d020c0. The wheel was not installed over a running user backend.

Manual verification

Passed on 7266ece0fc95: a fresh Crew data home with a Global V1 KAS conductor, no saved stub roster and no manual claim completed its first mounted session_ledger_read. The real KAS-owned stub exposed the tool in its catalog. Normal identity publication was followed by an accepted caller-rekey, then allowed ledger authorization and the completed call returning the empty ledger. The verification comment in this PR (ID 5643919604) records the response, ordered audit and source hashes.

This was instrumented transport verification using the normal installed KAS OS home. A stdio interposer kept the generated core command/argv and environment, supplied no caller metadata, and injected exactly one read. No model prompt was forwarded; labeled local instrumentation completed the outer chat. Source bytes stayed unchanged and all owned processes/listeners were cleaned up.

The gateway-set environment marker was absent in the MCP child, while the explicitly declared Crew home survived. The earlier failed harness attempts remain recorded, including isolated-home startup failures and completion-control mistakes. They are not counted as passes.

Every product file changed by this PR is byte-identical to the corresponding file in that live-tested revision. The result remains attributed to 7266ece0fc95; it is not a new live run on the rebased commit.

An ordinary LLM conversation was not tested by this diagnostic. Earlier model-driven probes also exposed initial catalog-readiness and remembered-instruction effects; those are distinct from the now-verified mounted identity path. Existing gateway processes must restart to load this change; a terminal reconnect refusal requires a new session.

Related Issues

Related implementation: #5198 (session ledger), #5720 (identity diagnostic), #8393 (shared strict-identity gate).

no linked issue: this fixes a reproduced installation failure.

Pattern harvest

Rule candidate: review-prompt
Pattern: An identity-bearing transport must load trusted code, carry its owning home, order caller repair before dependent requests, and strip authority before handing control to an unverified backend.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated
  • No secrets, credentials, or internal references in the diff

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 11, 2026
@Zedmor

Zedmor commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Intent: Make session-ledger identity work on fresh installations and keep shared-runtime children bound to their own sessions.
Not a goal: Change ledger storage, add worker completion callbacks, or change Private V2 direct identity.

@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

Design-level review of 5fee6cd8046a26103d54e6ae8a07feb434c52f33 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

A deliberate opt-in pin is reversed to broker-by-default for core, and the PR itself says that topology decision is not yet approved.

Watch

  • The deleted test_nothing_is_routed_by_default pinned "no stub set, no stub, no daemon" as "the whole point of the change"; this PR reverses that pin for kirocrew-core (daemon + one stub per core connection on every default install, and core joins backend sharing wherever enabled: true was already saved). The reversal has a named cause (strict identity fails without the routed path) and is honestly escalated — the description says "Maintainer decision requested (not yet approved)" — but it must not merge on advisory review alone.
    Clears when: a maintainer explicitly approves the broker-per-home / stub-per-core-connection default, including the sharing-already-enabled upgrade case.
  • One-way door: "Configuration saves persist the resolved default roster," so after any save, ["kirocrew-core"] is written as if operator-chosen — a future default revert or roster evolution cannot reach those installs, recreating the exact []-ambiguity the PR admits it cannot distinguish today.
    Clears when: an unset roster is persisted as absent (or a provenance marker distinguishes resolved-default from operator choice), or the maintainer explicitly accepts the frozen-roster ambiguity.

Suggestions

  • Omitting stub_servers from saved config when it equals the resolved default is the cheapest fix for the persistence door and keeps the default a live knob.

[DESIGN-REVIEWED] 5fee6cd

@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 5fee6cd8046a26103d54e6ae8a07feb434c52f33 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

All evidence is gathered and verified. Producing the review.

First-Principles-Verdict: CONCERNS

The headline item is a changed default the author themself marks "not yet approved" — it rewrites a pinned opt-in decision and needs the maintainer call it requests.

Not justified as shipped

  • Item 1 — changed default, rewritten pin: the deleted pin read "The shipped default costs nothing: no stub set, no stub, no daemon. This is the whole point of the change" (test_mcp_gateway_stub_optin.py), and the design note it edits said "A topology change belongs behind a choice rather than in a default." The PR argues the rewrite (core-only scope, reproduced install failure, live-verification comment 5643919604) and honestly requests the decision — but until a maintainer accepts one broker per data home plus one stub per core connection, the prior decision stands.
  • Item 10 — rides along: cron test pin rewrite; verified derived — the loader coerces non-string session_key to "" (cron.py:1755), so the old assertion contradicts shipping code and fails on base.

What this change ships

Inventory (10 items, capped — baseline regen and test patch-target fixes omitted) — 8 justified

Intent: make core session-ledger tools work on a fresh install (and give shared-runtime children their own identity) without manual routing — a FIX whose central mechanism is a changed default.

  1. Fresh installs and rosterless upgrades now run a broker daemon plus one core stub per connection (stub_servers defaults to ["kirocrew-core"]) — changed default, rewritten pin, maintainer decision pending
  2. An explicit [] roster — including one an older version auto-saved — stays unrouted; doctor prints upgrade guidance on every platform — justified
  3. Unidentified stubs resolve identity before each request and send recaller in order, replacing the deleted background poll — justified
  4. Shared-runtime subagents and task steps carry their own session key in the injected stub env (2 real consumers: session_allocation.py, subagent_manager/run.py) — justified
  5. New session_bound register field + session_bound_ack capability; bound stubs refuse pre-feature daemons (fallback initially, terminal on reconnect) — justified
  6. Stub launches pin the gateway's package tree via -B -E -P bootstrap so a workspace kiro_crew/ cannot shadow it; -P premise verified against requires-python = ">=3.12" — justified
  7. Stub env now carries KIROCREW_HOME only (no credentials travel) — justified
  8. Unverified fallback backends are stripped of KIROCREW_SESSION_KEY/KIROCREW_HOST_PID — justified
  9. Refusal diagnostics distinguish "routed but unidentified" from "unrouted" — justified
  10. Cron removal test now expects "" for a malformed on-disk session key — rides along, red-on-base repair, declared

Watch

  • The default flip is explicitly unapproved: "Maintainer decision requested (not yet approved): whether to accept one broker per data home and one stub per core connection." A rewritten pin stands on the author's reproduction narrative plus PR comment 5643919604, neither verifiable here.
    Clears when: a maintainer accepts the per-install broker/stub cost on the PR, or the default is reverted to opt-in with the race/child-identity fixes kept.
  • Point default: _STRICT_IDENTITY_SERVERS names 3 servers (cli_doctor.py:1494) and the default routes 1; kirocrew-work is declared deferred, kirocrew-dashboard is not mentioned.
    Clears when: the description states which level this fix sits at for kirocrew-dashboard (e.g. covered by the member-session mount) or defers it by name.

[FIRST-PRINCIPLES-REVIEWED] 5fee6cd

@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 5fee6cd8046a26103d54e6ae8a07feb434c52f33 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 5fee6cd

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 5fee6cd8046a26103d54e6ae8a07feb434c52f33: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 11, 2026
@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 5fee6cd8046a26103d54e6ae8a07feb434c52f33 — this comment is updated in place on each push.

Review details

The candidate discovery pass returned no candidates. My independent review of the functional hunks confirms:

  • Python floor is >=3.12, so -B -E -P and the -s conditional in the stub bootstrap are all valid — the rewriter comment is accurate.
  • _is_first_party_managed_argv(name, command, args, env) is called with matching positional arity in fallback_exec, and the env-stripping branch fails toward stripping identity (safe direction) for any non-verified backend.
  • _StubConn.session_bound is gated on caller is not None and bool(caller.session_key), so a key-less warm stub stays reclaimable; _apply_claim correctly skips only genuinely bound connections while keeping the PID index for aborts.
  • _CallerRepair.before_request is wired only for key-less connections, its wait is bounded by a shared deadline (no doubling), the executor lookup carries no event-loop dependency (no deadlock), and completion never writes to a socket.
  • The config resolver preserves explicit [], legacy poolable_servers, and per-server opt-outs; stub_roster falls back to stub_servers only when unset.

Each of these was a path where a defect could hide; none survives to the (a)/(b)/(c) bar at 80+.

No findings.

[OPUS-REVIEWED] 5fee6cd

Verdict parsed from the review's SHA-scoped output markers for commit 5fee6cd8046a26103d54e6ae8a07feb434c52f33.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 5fee6cd8046a26103d54e6ae8a07feb434c52f33: <one-sentence reason>

@Zedmor Zedmor changed the title fix: enable core session identity on fresh installs fix: enable core session identity by default Sep 11, 2026
@Zedmor
Zedmor force-pushed the fix/core-ledger-default-routing branch from 86df10d to af25ad3 Compare September 11, 2026 18:22
@Zedmor

Zedmor commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • Roster-less enabled=true was not declared accurately (span=0df4ec10a6f7) — fixed in af25ad3b9b0eadcb369f0b8651dd71f62bd0edff.

The sharing flag remains unchanged. An explicit enabled=true applies to the newly default-routed core; sharing is off only when absent or explicitly false. The config spec, architecture note and PR description now state this, and a load/save/reload test pins both values.
Verification: 962 targeted tests passed, four skipped; the independent follow-up review reported no findings.

@Zedmor

Zedmor commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • Upgrade-time topology for unconfigured installations (span=4a4271388d27) — fixed in af25ad3b9b0eadcb369f0b8651dd71f62bd0edff.

Confirmed intended: the default core route applies to fresh installations and upgrades lacking both roster spellings. Both otherwise lack the identity channel on an environment-filtering harness. Explicit rosters (including []), legacy rosters and per-server opt-outs preserve their existing meaning. The owning docs and PR description now explicitly identify the upgrade scope and broker/stub cost.
Verification: 962 targeted tests passed, four skipped; the independent follow-up review reported no findings.

@Zedmor

Zedmor commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • Reachable shared-core configuration needed coverage (span=63ddec485f2a) — fixed in af25ad3b9b0eadcb369f0b8651dd71f62bd0edff.

Added a real loader/serializer/reloader test for configurations containing enabled=true or enabled=false without either roster key. Both gain the default core roster, and each retains its sharing flag after save and reload. The shared-core result for enabled=true is intentional and is now described in the PR.
Verification: 962 targeted tests passed, four skipped; the independent follow-up review reported no findings.

@Zedmor

Zedmor commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: validate the fallback backend with the existing managed-invocation predicate before preserving direct session identity

  • Stub identity leaks into fallback MCP backends (span=b3720184dd28) — fixed in af25ad3b9b0eadcb369f0b8651dd71f62bd0edff.

fallback_exec now removes KIROCREW_SESSION_KEY and KIROCREW_HOST_PID after merging inherited and sidecar env, before either POSIX exec or the Windows child handoff. It retains identity only when the existing managed-invocation verifier accepts the command, arguments and effective declared env, including the wrapper home pin. Managed names alone grant nothing. Customized entries, resolution failures and unsafe python -m targets receive no direct session authority; verified core retains the child key. Backend credentials and PATH are preserved. The handoff regressions reproduced 18 failures before the fix; all now pass, including spoofed names/args/env and both platform branches.
Verification: 962 targeted tests passed, four skipped; the independent follow-up review reported no findings.

@Zedmor

Zedmor commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Acknowledged the Design Review PASS on af25ad3. The core-only default, explicit upgrade/sharing behavior, and fallback identity boundary remain the intended scope. No further design changes are requested by this verdict.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 11, 2026
@Zedmor

Zedmor commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Confirmed the real-install premise requested by First Principles, and repeated the clean-install diagnostic on af25ad3b9b0eadcb369f0b8651dd71f62bd0edff.

The original process inspection found KIROCREW_HOST_PID in the real KAS parent processes and absent from the KAS-launched native core MCP child. That child retained its explicitly configured KIROCREW_HOME. This directly establishes the missing inherited identity hint in the reported installation.

The new verification ran on September 11, 2026, 18:47:04–18:47:50 UTC:

  • Verified that the gateway imported the published commit's source and owned its isolated listener.
  • Started with a new data home and no configured MCP roster. Status reported stub=["kirocrew-core"], a healthy broker, and sharing enabled=false.
  • Opened a real KAS conductor using Global V1 memory, matching the reported member, and requested one mounted @kirocrew-core/session_ledger_read call.
  • The single completed tool call, with no tool arguments, returned: “This session has no work ledger yet. Use session_ledger_record to start one when doing long-horizon work.”
  • No routing edit or manual identity claim was needed. The diagnostic performed no ledger write.
  • Verified cleanup: the temporary gateway stopped, its listener was released, and no processes remained for that isolated data home.

This adds a fresh test of the published commit to the original process reproduction and the earlier clean-home verification. The read exercises the strict identity gate shared with ledger writes; it does not claim to verify write persistence.

@Zedmor
Zedmor marked this pull request as ready for review September 11, 2026 19:28
@Zedmor
Zedmor requested review from a team and chenmingwei23 September 11, 2026 19:28
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 11, 2026
@Zedmor
Zedmor force-pushed the fix/core-ledger-default-routing branch from af25ad3 to e7e25f4 Compare September 11, 2026 20:13
@Zedmor

Zedmor commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Rebased the existing fix onto current main (283e136c0f90); the PR now has one commit, e7e25f43c605. There were no conflicts. git range-diff confirms the authored patch is unchanged from af25ad3b9b0e.

Validation after the rebase:

  • 2,010 targeted integration tests passed; 4 skipped, including the overlapping upstream MCP and session-history cases.
  • All 36 static gates, full type checking across 1,415 source files, and docs lint passed.
  • Independent review of the interaction with the updated base found no new correctness or security issues.
  • A fresh isolated KAS conductor using Global V1 successfully called @kirocrew-core/session_ledger_read with default core routing and sharing disabled. No manual routing update or identity claim was needed; cleanup verified the gateway stopped and released its port. An initial model probe used an unqualified tool name and never reached the ledger; the separate probe with the mounted tool name succeeded.

CI and automated reviews are rerunning for this commit. The earlier green CI and local wheel remain evidence for the previous revision only.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Sep 11, 2026
@Zedmor
Zedmor force-pushed the fix/core-ledger-default-routing branch from e7e25f4 to 07a6029 Compare September 11, 2026 20:57
@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Sep 12, 2026
Route core through the broker on unconfigured installs and preserve the
owning data home when harnesses filter MCP environment. Keep explicit
routing choices and the existing backend-sharing setting.

Bind shared-runtime subagents and task sessions to their own session so
parent claims cannot select the wrong ledger. Keep that authority inside
broker stubs and verified managed fallback backends without dropping
backend credentials.

Load stubs from the running gateway package tree, excluding workspace
and Python startup overrides while preserving source-only installs.
Refresh cached launch commands when their code location or site policy
changes.

Report unidentified broker connections without repeating routing advice.
Explain how upgraded installs with a saved empty roster enable core
routing, both in doctor and the shipped user guides.

Resolve late caller identity before forwarding MCP requests, so the
first ledger call cannot overtake a published mapping. Replace periodic
polling with a bounded request-time check and retain pending work across
reconnects. Keep strict refusal when identity is absent and preserve
gateway rekeys.

Align the inherited cron removal test with the existing loader contract:
malformed session keys become unset while their job survives.
@Zedmor
Zedmor force-pushed the fix/core-ledger-default-routing branch from 7266ece to 5fee6cd Compare September 12, 2026 06:17
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 12, 2026
@Zedmor

Zedmor commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

CI correction and verification — 5fee6cd8046a

The failed Windows assertion contradicted the existing cron loader contract. The correction keeps the malformed fixture and proves unrelated removal succeeds while the normalized job survives. No cron product behavior changed.

The original ledger patch is unchanged, and the branch is rebased onto 8b58f72a8677. The local backend result retains its exact-base failure; it is not a fully passing suite.

{
  "head": "5fee6cd8046a26103d54e6ae8a07feb434c52f33",
  "base": "8b58f72a8677c649cefe6cb5582d7c70f56ea5ea",
  "authored_delta_since_7266ece0": "Test-only correction: retain malformed job and expect its normalized empty session_key. Original 44-file patch unchanged.",
  "cron_failure_comparison": {
    "node": "test/test_remove_slot_for_history_key.py::TestAFailedRemovalDoesNotLeakIntoTheNextSave::test_malformed_persisted_owner_does_not_poison_unrelated_removal",
    "exact_base": "ea9ada27ff97a2c81426496dbd2420bd919dfec9",
    "exact_candidate": "7266ece0fc95c9f40c88f0cf1b54c53fd1956cc4",
    "original_result": "Same assertion failure on both; imported source and conftests verified; bytes stable.",
    "cause": "Existing _guard_str normalizes a malformed session_key; later upstream test expected the corrupt list to survive.",
    "corrected_whole_cron_files": "179 passed"
  },
  "current_head_tests": {
    "backend": "2114 passed, 1 failed across 20 whole files; exit 1.",
    "failed_node": "test/test_dashboard_chat.py::TestRuntimeWiring::test_run_chat_passes_memory_store_to_build_message[none]",
    "failure": "NotImplementedError: atomic no-replace rename is unavailable",
    "exact_base_comparison": "Same node, exception and source frames on untouched 8b58f72a8677; host glibc lacks renameat2 symbol. Both exit 1.",
    "frontend": "58 passed in both complete SlotTagPopover test files.",
    "static": "Formatting, import order, subprocess encoding, flake8, mypy, harness parity, docs lint: passed."
  },
  "build": {
    "fresh_frontend": "passed",
    "wheel": "passed",
    "sha256": "92f28e28a35a43b383ba6ff1b90e36f1394ae15acfc79b30237266ca43d020c0",
    "python_files_identical": 1475,
    "frontend_assets_identical": 2396,
    "installed": false
  },
  "local_reviews": "Both focused contracts: no findings on this SHA, using inherited model. These are not CI GPT/Claude results.",
  "live_proof": "Successful KAS mounted session_ledger_read remains attributed to 7266ece0; comment 5643919604. Every product file authored by this PR is byte-identical. No new live run claimed.",
  "prior_ci": "Windows shard 3 failed the inherited cron expectation. Remaining run canceled before editing. Linux shard logs contained no additional failure/error before cancellation; canceled shards are not passes.",
  "fresh_ci": "Required on current published head; not yet complete.",
  "retrospective": "13 grouped mechanisms kept; no required removal. Schema bump has an optional smaller alternative. Retaining this existing correct cache marker for the CI-only correction; no new runtime mechanism.",
  "maintainer_decisions": "Default route topology, saved-empty-roster handling and future save provenance remain unapproved."
}

The required retrospective found no mandatory subtraction. Its optional fingerprint-schema simplification is deferred: the retained schema marker is correct, while removing it would not address this CI failure. The four existing maintainer choices remain open; no approval is inferred.

@Zedmor

Zedmor commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: Default core routing.

  • span=068a14bd82da — core default topology — needs-a-decision

The topology reversal is intentional in this proposal and remains unapproved. Fresh unconfigured installs would run one broker per data home and one stub per core connection; an installation that already enabled sharing would include newly routed core in that existing sharing policy.
The fresh-install ledger goal motivates the proposal, but author reproduction and advisory review do not grant maintainer acceptance. The description explicitly requests that decision. No merge or auto-merge is requested; the prior opt-in tradeoff is not claimed to have been approved away.

@Zedmor

Zedmor commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: Saved roster provenance.

  • span=c808af8e8300 — resolved-default persistence — needs-a-decision

The persistence concern is valid. The inherited serializer writes the resolved roster, so an unconfigured install that saves can later resemble an explicit operator roster. This proposal preserves existing save semantics and explicitly names the frozen-roster ambiguity.
A provenance-aware save change or acceptance of this persistence behavior is a maintainer decision that remains open. No approval is inferred, and the current implementation is not claimed to preserve absence through a save.

@Zedmor

Zedmor commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: Saved roster provenance.

  • span=e4fbe7623cd5 — omit roster when value equals default — rebutted as proposed

Equality with the current default does not distinguish an omitted roster from an explicit operator choice. Omitting both would discard the meaning of the explicit key, which this change promises to preserve.
Executed counterexample against the real _resolve_stub_servers on 5fee6cd: explicit {stub_servers: [kirocrew-core]} remains [kirocrew-core] when a hypothetical future default adds future-mcp. Applying the suggested omit-if-equal transform first produces {}, then resolves to [kirocrew-core, future-mcp]; the explicit-choice assertion fails. The future default was mocked only in the analysis process; no product/config files changed.
A save format that retains absence or provenance could address the genuine persistence concern without this loss of explicit choice. That design decision remains open in the separate persistence disposition.

@Zedmor

Zedmor commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: Default core routing.

  • span=8261a9fd3ddd — reversal of the opt-in pin — needs-a-decision

The removed pin represented a real product tradeoff, not an accidental assertion. This PR proposes reversing it only for core so an unconfigured install can use strict session-ledger identity; the successful mounted read is evidence for the mechanism, not permission to change that tradeoff.
The description continues to request explicit maintainer acceptance of the broker/stub cost and the sharing-already-enabled case. That acceptance has not been supplied or inferred.

@Zedmor

Zedmor commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: Align the cron regression with its existing loader contract.

  • span=af5d7690a28a — inherited cron assertion correction — justified

This is a test-only integration correction required by a real red CI job while keeping this PR mergeable. Windows job 103504474132 failed the list-preservation assertion. The same node failed on exact untouched ea9ada2 and isolated prior candidate 7266ece because the existing loader already coerces the malformed key to an empty string.
The correction retains the corrupt on-disk fixture, successful unrelated removal and persisted parent absence, and explicitly asserts that the surviving job remains with an empty key. It does not change cron production behavior. Both whole cron files passed 179 tests; the cases also passed in the current 20-file integration run. Verification comment 5644142285 records the exact-base comparison and its limits.

@Zedmor

Zedmor commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: Default core routing.

  • span=3afd584f0497 — maintainer approval of core default — needs-a-decision

The requested maintainer call remains outstanding. The PR author has not treated runtime evidence, a green model review or this disposition as approval of the topology change.
The instrumented KAS proof is published in comment 5643919604 and stays attributed to 7266ece. Current authored product files match that revision. It demonstrates the identity path under the stated setup; it does not decide the per-install process-cost tradeoff. The PR remains unmerged with auto-merge disabled.

@Zedmor

Zedmor commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: Clarify the existing member dashboard mount.

  • span=b00b29deabad — scope of the dashboard identity server — fixed in description

The description now names all three strict-identity servers: only kirocrew-core gains default stub routing. kirocrew-work and general kirocrew-dashboard routing remain outside this change.
Existing member-DM support is a separate path: acp/client.py::_append_member_dispatch_server checks a supported member-dispatch backend, member session key and Crew-owned permission surface before appending members.py::member_dispatch_session_server. That entry carries KIROCREW_SESSION_KEY, KIROCREW_BOUND_PORT and the managed owning-home environment. acp/kas_agents.py::to_client_custom_agent grants its session-level dashboard mount when member_dispatch is true.
This is a description clarification based on existing source. It adds no default dashboard route and claims no new live dashboard verification.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Sep 12, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Not approving for now: the branch has merge conflicts with main; please rebase and we'll take another look.

@dwu96 dwu96 added needs-pr-triage PR scanner: awaiting automated triage and removed needs-pr-triage PR scanner: awaiting automated triage labels Sep 16, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

A maintainer attempted a conflict-only rebase of this PR onto main cff7de54 (2026-09-19) but did not push, because the conflict is semantic rather than textual and resolving it needs changes outside the conflict hunks -- which is the author's call. Nothing on this branch was changed.

What blocks a mechanical rebase:

Once rebased onto current main with the above reconciled, readiness should re-evaluate on the new head.

@NicholasRBowers NicholasRBowers added the needs-pr-triage PR scanner: awaiting automated triage label Sep 22, 2026
@dwu96 dwu96 removed the needs-pr-triage PR scanner: awaiting automated triage label Sep 22, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

@Zedmor Maintainer sweep (2026-09-24, on behalf of @bolichen97): this PR carries readiness: passed and its required PR Readiness check is green, so it is on the merge list — the only thing holding it is the branch state below. Once you rebase onto current main (git rebase origin/main, resolve, force-push to your branch), CI will re-run and a fresh approval will be given; note that dismiss stale reviews on push is on, so any existing approval is expected to drop and will be re-issued after the rebase.

State: mergeable_state=dirty, 1379 commits behind main. The conflict is semantic, not textual: main has since shipped #11383 (signed per-session identity) and #11901 (token-aware resolvers) in the same area, which is why the maintainer's conflict-only rebase attempt on 09-19 was not pushed. This one needs the author to reconcile the broker-by-default topology against that code; a plain rebase will not be enough. If you would rather split the still-valid parts into a smaller PR, that is also welcome.

@iamwhatever

Copy link
Copy Markdown
Contributor

Thanks for this, @Zedmor. While reviewing for a rebase onto current main, I found that main has since implemented core session identity through a different mechanism: broker stubs are bound to their session via a bearer token (stub_session_token / attach_stub_session_token in mcp_gateway/gatewayd.py and session_servers.py), with the stub launched through platform_compat.isolated_python_argv under fingerprint schema 9. That covers the identity-binding intent of this PR (a subagent sharing its parent's process can no longer inherit the parent's ledger identity), so most of this diff is now superseded and the two mechanisms don't compose cleanly on a rebase.

Two intents from this PR that main does not yet have:

  1. Default stub roster of ["kirocrew-core"] so core tools get per-call identity on an unconfigured install (main still defaults the roster to empty).
  2. KIROCREW_HOME carried in the stub's env so late identity lookup uses the right data home when a harness filters inherited environment (main currently emits env: {}), plus the doctor "empty routing list" upgrade hint.

Both are arguably a product/direction call rather than a mechanical change. Would the maintainers prefer these landed as a small follow-up PR on top of main's current mechanism, or to close this one out? Happy to help either way.

@bolichen97

Copy link
Copy Markdown
Contributor

Readiness sweep 2026-09-29 — evidence for @iamwhatever's close-or-re-land question (not closing from the sweep, since that question is live).

The conflict is semantic, not textual: this PR's 45-file diff implements stub-side session identity (recaller frame, late off-loop PID lookup under the stub's data home, session_bound guard, stub-launch hardening) that main replaced with gateway-side identity in #10324 (55434303ed), #11383 (87920ab2c1) and #11901 (248df7f4b0), on the roster framework from #8333 (7528abf958). What remains of the PR's stated goal — core stubbed by default — is a <10-line roster default in _resolve_stub_roster plus a doctor hint, and that default is exactly the decision the PR body flags as unapproved. Recommendation: close, and land the default (if wanted) as a fresh small PR after that decision.

@iamwhatever

Copy link
Copy Markdown
Contributor

Thank you so much for this, @Zedmor — the session-identity problem you tackled here was a real one, and your diagnosis and the stub-side approach were genuinely valuable in surfacing it.

Since this PR was opened, main ended up solving the same identity-binding intent through a gateway-side mechanism rather than the stub-side one here, across:

on the roster framework from #8333. Big thanks to @bolichen97 for the careful analysis tracing exactly how those landed and where they overlap with this diff.

What remains of your original goal — core stubbed by default — comes down to a small (<10-line) roster default in _resolve_stub_roster plus a doctor hint, and that piece is a product decision the maintainers still need to make. I'm going to close this one out as superseded, but if the maintainers decide they want the stub-by-default roster default, a fresh small PR on top of current main would be very welcome — and thank you again for pushing on this.

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

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants