Skip to content

Assistant: Myra coordinates the bench's agents (CL-7469) - #661

Merged
TheGreatAxios merged 28 commits into
mainfrom
cl-7469-myra-orchestrator
Sep 6, 2026
Merged

TheGreatAxios merged 28 commits into
mainfrom
cl-7469-myra-orchestrator

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Resolves CL-7469

Myra is every tenant's default agent and the coordinator of its
teammates. This adds a coordinator clause to ASSISTANT_SYSTEM_PROMPT
and revises the teammate clause so building a specialist always goes
through the reuse-first, create -> deploy -> grant -> add-to-bench
sequence rather than skipping to the result.

  • Prompt: new "Coordinating the bench" clause; the teammate clause now
    checks list_agents before creating, and names author -> deploy ->
    grant -> add-to-bench explicitly.
  • Pins: @corbits/access-tools (grant surface) added; no
    @intx/tools-posix.
  • Eval: new exa-topic-digest case — "watch our Exa topics and post a
    digest" — follows the shape of the existing interview -> specialist
    -> routine cases.
  • Docs: PRODUCT.md and docs/GLOSSARY.md now describe Myra as the
    default orchestrator.

Depends on #656 and #654; merge those first.

Covers the happy path, a 403 from the hub, and an unknown canonical
name/provider name for create_offering, set_offering_priority, and
disable_offering ahead of the implementation.
…fering

Lets an agent manage the tenant's own inference catalog offerings
through the existing tenant-admin catalog routes, resolving a model's
canonical name and a provider's name against this tenant's own catalog
before writing, and refusing rather than guessing when either name
isn't found. create_offering and disable_offering require approval;
set_offering_priority only reorders an offering already live.

Seeds the model/model-provider/model-offering read, create, and
manage grants these routes require.
Covers the tool bundle's client (auth headers, response parsing, 403/404
mapped to typed errors) and the tool handlers themselves (declarations,
approval gating, invalid input short-circuiting fetch, a forbidden grant
surfacing as a clear tool error, and a successful grant round-tripping
through list_grants).
Lets an agent see who exists in its tenant and, once a human approves,
create or revoke scoped grants for the specialist agents it stands up.
list_principals and list_grants are plain reads; grant_access and
revoke_access declare approval: "ask" so a human signs off on each
grant before it takes effect.

The package's own routes.ts adds a workflow-run-authenticated mirror of
the tenant's principal/grant surface at /api/workflow-access, gated by
Interchange's real grant store and condition registry -- the same
authorization every session-authenticated route runs, not a bundle-local
approximation. Mounted in apps/hub alongside the other workflow-run
surfaces, threaded a hub URL by the sidecar's step-env builder, and
published into the corbits-tools registry.

Extends SEED_GRANTS with the principal/grant reads and grant
create/manage a seeded principal needs to actually use this surface.
One paragraph per tool, plus a pointer to the workflow-run-authenticated
routes they call.
Run scripts/generate-tsconfig-references.ts so the composite build graph
picks up the new package's dependencies -- required for tsc --build and
the tsconfig-references structural check.
Covers the caller-authenticated /principals and /grants routes: 401
without a recognized sidecar bearer token, 403 when the caller lacks
grant:*/create, 403 when a requested (resource, action) pair exceeds
the caller's own authority, 201 within the ceiling, revoke 403 outside
the ceiling, and 404 for an unknown grant.
A caller holding grant:*/create could previously mint any (resource,
action) pair, including ones its own principal was never granted --
self-escalation. POST /grants and DELETE /grants/:grantId now check
each requested pair against the caller's own authority through the
same @intx/authz authorize() call createRequireGrant uses, and refuse
with a 403 naming the first disallowed pair.
The four access-tools grants (principal:*/read, grant:*/read+create+
manage) were landing in SEED_GRANTS, which reconcileSeedGrants plants
on every tenant's shared principal -- letting that principal read and
mint grants for every principal in the tenant, not just the
specialist agents Myra stands up herself.

Plant them instead on the assistant workflow's own run principal,
derived the same deterministic way @intx/hub-api's workflow-run-
trigger mints one on a deployment's first materialized trigger
(deriveRunPrincipalId(tenantId, deploymentId)). That id is stable
across a relaunch because it's keyed to the deployment's own
top-level run id, not to a fresh per-invocation run. Only planted
once confirmDeploymentAnswers has actually triggered the assistant
deployment, since that trigger is what commits the run-principal row
these grants reference.
A workflow child authenticates with its sidecar bearer token and run
address, never a browser session, so it cannot reach the tenant-admin
catalog routes @intx/hub-api mounts for the settings UI. This adds a
mirror at /api/workflow-catalog-admin, gated by the same grant store
and pushing the same source-update refresh on every offering write.
create_offering, set_offering_priority, and disable_offering called
the tenant-session catalog routes directly, so a workflow run's
sidecar bearer and run address 401ed against them. Point the admin
client at the new /api/workflow-catalog-admin mount instead, mounted
in apps/hub beside its own read-only inference-catalog counterpart,
and drop the tenantId the client no longer needs to carry now that
the hub resolves it from the same credential.
The pin was still at 0.0.2 after the package's version moved to 0.0.3,
and this change moves it again to 0.0.4 for the new
workflow-run-authenticated routes.
The offering-management tools' README still described them as writing
through the tenant-admin catalog routes directly; point it at the
package's own workflow-run-authenticated mirror instead.
The merge from main picked up a v2-format lockfile from a newer local
bun than the .bun-version this repo pins (1.3.14) can read, so CI's
frozen-lockfile install failed before any check ran. Regenerating with
1.3.14 restores the v1 format CI expects.
check:structural's db-gate check flagged the hand-rolled describeIfDb;
switched to the shared dbGate helper. That import reaches
scripts/e2e/db-gate.ts, which the tsconfig-references generator treats
as disqualifying for a package's composite src/ project when the
import comes from src/ itself -- moving the DB-gated composition
suite to test/ (where multi-module suites already live per this
repo's convention) keeps access-tools in the composite graph.
…r clause (CL-7469)

Covers the "watch our Exa topics and post a digest" case in the same
interview -> specialist -> routine shape as the existing eval cases,
and updates the assistant definition tests for the new access-tools
pin and the revised teammate-clause wording ahead of the prompt change
itself.
Adds a coordinator clause to the system prompt and revises the
teammate clause so building a specialist always goes through
list_agents (reuse before creating), author, deploy, grant, and
add-to-bench in order rather than skipping straight to the result.
Pins @corbits/access-tools so Myra can grant a new teammate only the
access its job needs, with no @intx/tools-posix.
PRODUCT.md and the glossary now describe Myra as every tenant's
default agent and the coordinator of its other agents, not just the
first-run guide.
@linear-code

linear-code Bot commented Sep 6, 2026

Copy link
Copy Markdown

CL-7469

# Conflicts:
#	apps/hub/src/index.ts
#	packages/catalog-tools/src/routes.ts
#	packages/catalog-tools/src/tool.ts
#	packages/seeding/src/seed.ts
The coordinator clause (CL-7469) repeated the teammate clause's build
sequence almost verbatim. Fold the two into one clause so the build
sequence lives in a single place, keeping only what the coordinator
text added: Myra coordinates the bench's agents, not just serves as
its assistant, and reports back what she built once it's live.

Also trims prompt tests down to behavioral assertions: prompt-sentence
string matches and the tool-package pin list are dropped, since the
former churns on prose edits and the latter is already enforced by the
tool-package-pins structural check.
@TheGreatAxios
TheGreatAxios merged commit 8e398ca into main Sep 6, 2026
13 of 14 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-7469-myra-orchestrator branch September 6, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant