Skip to main content

Repository source G1b compatibility and caller inventory

G1b of #4162 follows merged G1a PR #4166 at a0c7ac01d4cfa371e663dbee5e368c54b6517be7. This inventory was rerun against that base plus this implementation. It establishes code paths, not deployed versions, refreshed credentials or source activation. The approved foundation is c6de4792676e23d3603a0c5d9f9a696452387230; the merged LLD is 301938b3489f53b9ffa67c0492f82e9f59d9630c.

Caller → identity → destination ledger​

Paths are relative to this repository. Searches covered non-test Go, Python and shell code, generic MCP dispatch, AgentTokenClaims literals, Remember calls, PushContext callers and SQL inserts/updates of agent_memory.

Path / callerIdentity and destinationG1b disposition / later obligation
internal/runtime/server/lifecycle_server.go: relay and autonomous SendMessageValidated execution session; signed team MCP token → workerMint runtime_session_id from the actual execution ID and delegation_purpose=runtime_session. Preserve distinct Quad session_id. A stored snapshot may carry a stale nonempty ID: real relay, autonomous and child tests retain that adversarial fixture.
internal/runtime/server/child_dispatch.goChild execution's SendMessage → same lifecycle signerChild receives its own ID, never its parent's. Source-marker inheritance remains G3. Resume retains its existing execution ID and remints.
internal/auth/oauth/token_endpoint.goExternal client credentials; signed runtime=external, shared azp=agent-runtime → team MCPPreserve external provenance and sessionless ordinary memory. Never infer external from azp or absent session. Contradictory external/session purpose refuses. Deployed external consumers cannot be enumerated from source alone.
internal/runtime/gatewayroute/route.go, internal/repomapgen/generation_model.goModel Gateway audience onlyNeither mints runtime-session delegation nor exchanges for source. Lifecycle's separate CE token remains a distinct audience. modelgateway/agentauth has a separate identity DTO, not another OAuth mint.
internal/auth/oauth/terminator.go, first_party.goValidated exact team audience → protected memory/Knowledge audienceLive protected mapping + approved binding/team + fixed configured endpoint precede mint; no generic/anonymous fallback on lookup failure or denial. Preserve signed runtime/provenance and subject lifetime. Existing proxy consent/tool policy/allowlist checks remain.
internal/gateway/mcpproxy/{mcpproxy,dispatch}.goSingle-resource / aggregate forwarding → captured protected endpointBoth paths previously forwarded the mutable resolver URL. Both now carry the endpoint captured by the protected mint, so a URL edit cannot redirect its bearer. A later mint rereads the registry and refuses mismatch/revocation. Ordinary upstreams retain their existing destination. Initialization carries no minted bearer.
internal/reposource/{transport,session_authority}.goKnowledge certificate + signed Knowledge subject → source token → internal source RPCTLS 1.3, dedicated CA, explicit EKU, exact single URI SAN, exact issuer/audience, active session → configuration → public agent and live team; shared scope resolver on the same transaction. Each source RPC revalidates active authority. All source operations still refuse pending G1c/G3.
services/agent-worker/src/agent_worker/graph/nodes.py:1288, mcp/client.py:273,427Generic LangGraph tool dispatch with signed gateway token → result text and isErrorTyped refusal is encoded in JSON text as well as structured content, because this parser retains text. Actual marked-session enforcement and both-runtime end-to-end delivery remain G3.
services/agent-worker/src/agent_worker/executor/claude_sdk_executor.py:501,725,839SDK team gateway configuration and post-tool hook → SDK/tool-result eventsSame signed gateway bearer; independent SDK-shape proof is required in G3, not inferred from the LangGraph parser.
internal/context/memory/mcpsrv/server.go → pgbackend.go:420Sole production .Remember(...) caller; authenticated HTTP/generic tool → explicit memory insertG1b adds the closed typed refusal wire contract only. Missing-binding/source-bearing fake errors produce MCP isError=true with matching text/structured {code,message,correlation_id} and no reviewer/audit success effect. Real write/embed prevention and enforcement cutover remain G3.
internal/context/memory/extraction/persist.go:128Automatic extraction → separate insertNot sessionless Remember. G3 owns enqueue, claimRun, claimReplay and final persistence gates.
internal/context/server/{handler,connect_adapter}.go → memory/service.go:77,190,395,437Scope-authorized PushContext → insert, optimistic update and blob-path updateSeparate API; no new blanket session requirement. No non-generated internal production PushContext invocation found; worker context client uses AssembleContext/IngestEvent. Before activation G3 must trace any source-capable path into this API and gate actual source-derived writes.
internal/context/memory/review/reviewer.go:360,457,539Human review/correction → status updates and superseding insertPreserve prior-memory/operator workflow; trace any source input separately.
internal/context/memory/{neardup.go:377,recall/bump.go:108,embed_worker.go:692}Existing committed memory → dedup/recall metadata and embedding rowsFollow-on consumers, not alternate Remember callers. Denial must precede creation of a new row and scheduling. G3 proves this with actual transaction enforcement.

No additional sessionless internal Remember automation was found. New such callers must gain trusted execution identity or remain refused after cutover; they cannot be relabeled external. An unrelated automation exception requires its own concrete ruling on #3680.

Configuration and operator conversion boundary​

REPO_MAP_SOURCE_TOOLS_ENABLED defaults OFF in both binaries. OFF constructs neither internal listener nor source client and does not read source certificate files. ON requires all of REPO_SOURCE_CA_FILE, REPO_SOURCE_CERT_FILE, REPO_SOURCE_KEY_FILE, with REPO_SOURCE_SERVER_NAME default context-engine. The server listens on internal 9444; the Knowledge client defaults REPO_SOURCE_ADDRESS=context-engine:9444. Missing/invalid enabled material refuses boot. There is no source registration on the public Connect or legacy listener. Certificate mounts, service networking, resource ceilings and live provisioning remain G2b work.

Trusted gateway/onboarding configuration maps memory to MCP_BUILTIN_MEMORY_ENDPOINT (default http://upsquad-memory-mcp:9100/) and knowledge to MCP_BUILTIN_KNOWLEDGE_ENDPOINT (default http://upsquad-knowledge-mcp:9101/). These values must match the registry and later deployment configuration. Audiences derive from the platform base, never from these service hostnames. Source audience is urn:upsquad:repository-source:v1 and tokens expire within both 30 seconds and the subject's remaining lifetime. Source tokens are exchanged per call.

The existing operator-only cmd/tools/memory-onboard owns new atomic registry, binding and protected mapping creation, and explicit -convert-server inventory conversion. Both require org/team/actor/target/change reference and a verified configured endpoint; new rows retain pinned-CIDR, approval and egress controls. -dry-run writes nothing. Reapplying the same target is idempotent; conflicting, foreign, missing, deleted, unapproved and mismatched candidates refuse. The inert old flag is neither promotion nor a bulk-conversion selector. Runtime receives no protected-table write capability. G1a's restricted-role proofs remain required. No live inventory or conversion was performed by G1b.

Acceptance limits and operational handoff​

The G1b manifest is a distinct implemented subset. Full G1, G1c, G2, G3 and G4 remain unavailable to the proof checker. CI has literal package/parent producers for OAuth, actual runtime mint, both forwarding paths, memory refusal, conversion and the real internal authority hop. The independent test roster rejects joint deletion of a Go witness and its manifest entry. Semantic mutants run only in an owned source copy and disposable synthetic DBs; expected named assertions, not build failures or timeouts, establish discrimination.

Before enforcement/activation, operators must record actual orchestrator, gateway, memory, Knowledge and worker versions; provision exact service certs; verify the actual role topology; enumerate and explicitly convert approved registrations; refresh active executions and drain the ten-minute gateway token TTL. The source issuer signs in context-engine with the existing platform key; Knowledge receives neither that key nor SCM credentials. G3 must prove memory/marker/export restrictions and both runtime refusal shapes before release. G4/composed acceptance and G2b measured rollback remain outstanding. Static inventory and synthetic tests do not satisfy those deployment obligations. G1b changes no schema/proto and requires no schema rollback; leave the source flag OFF during binary rollback and preserve G1a state and all prior conversation/checkpoint/audit history.