Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

Restructure the configuration agent's knowledge into question-shaped resources

merged#2674CedarCopilot

CedarCopilot wants to merge 7 commits into staging from feat/cedar-configuration-knowledge-resources

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Sep 3, 2026, 1:00 PM
  2. Sep 3, 2026, 8:41 PM
  3. Merged
    Sep 3, 2026, 8:46 PM
  4. Live on staging
    Sep 3, 2026, 8:46 PM
  5. Live on prod
    Sep 3, 2026, 8:46 PM
  6. Observed 0 hours
    Sep 3, 2026, 8:46 PM
  7. Unobserved

    Live on prod, no production signal yet

    Sep 3, 2026, 8:46 PM
  8. Pipelines steady after this deploy
    Sep 3, 2026, 8:46 PM
  9. Pipelines steady after this deploy
    Sep 3, 2026, 8:46 PM

Behaviors Libra is checking

Before arming a recurring rule, the agent queries the matching population and reports expected counts or firing frequency instead of estimating the blast radius.Brokenlow confidence

Verification reached its 130s outer budget before the verifier returned. Libra is keeping this intent verifying until the next check.

staging, checked Sep 6, 2026, 7:47 PM
All Cedar document changes, including playbooks, resources, and subagents, are written through the document tool or structured config tool rather than direct SQL writes.Brokenlow confidence

Verification reached its 120s wall-clock budget before a tied verdict. Libra is keeping this intent verifying until the next check.

staging, checked Sep 6, 2026, 6:50 PM
A newly authored subagent is tested under its real headless runtime and allowlist before its playbook ref is added and the automation is declared active.Inconclusivelow confidence

Verification reached its budget before a verdict.

staging, checked Sep 5, 2026, 5:46 PM
The agent classifies a request as supported, an unsupported feature request, or a CRM-specific defect without inventing an operation, value, or workaround.Inconclusivelow confidence

Verification reached its budget before a verdict.

staging, checked Sep 5, 2026, 6:48 PM
The agent distinguishes hardcoded inline-agent allowlists from playbook-agent connection scopes, treats absent, present, and empty scopes correctly, and offers a custom subagent when only a system agent lacks the required capability.Inconclusivehigh confidence

Since 2026-09-04T03:46:10Z, staging recorded successful subagent activity: 29 execute_tool write-document spans across 10 traces, 7 read-document across 5 traces, 4 find-emails, 2 search-live-emails, and successful custom-agent invocations for Conversation Field Updater (2).

staging, checked Sep 5, 2026, 7:46 PM
Requests referring to a connected CRM, its deals, or its pipeline default to CRM-linked conversations unless the company SOP specifies another scope.Inconclusivelow confidence

Verification reached its 120s wall-clock budget before a tied verdict. Libra is keeping this intent verifying until the next check.

staging, checked Sep 5, 2026, 8:49 PM

Failures attributed to this change

No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 0 hits · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 4, 2026, 12:11 AM
No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 0 hits · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 4, 2026, 12:11 AM
No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 1 hit · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 4, 2026, 12:11 AM
No prod customers are affected while this is only in staging. If promoted, customer impact is not proven from the retained evidence. 1 hit · no retained affected-user count · no retained trace sample.Introducedmedium confidence

single_user

staging, first seen Sep 4, 2026, 1:11 AM
No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 1 hit · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 4, 2026, 3:41 AM
No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 1 hit · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 4, 2026, 6:26 AM
No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 0 hits · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 4, 2026, 7:11 AM
No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 0 hits · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 4, 2026, 7:41 AM
No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 0 hits · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 4, 2026, 7:41 AM
No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 0 hits · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 4, 2026, 7:41 AM

Libra has verdicts on 0 of 19 tracked behaviors on prod; 19 are still being checked. Libra checks hourly for 3 days after each deploy.

Cedar's configuration agent runs on apps/server/.claude/skills/cedar-configuration/. This converts the working knowledge doc (docs/cedar-configuration-knowledge.md) into the live files it actually loads.

The design was validated by running 25 routing cases across 8 agents. It is not redesigned here.

What changed

The on-demand set is now shaped by the question, not the config surface. playbook-design.md and field-management.md asked the agent to know which file a request belonged to before it knew what the request was. Twelve resources replace them, each answering one question:

ResourceThe question
choosing-a-triggerwhen should this run
building-an-agenthow do I write it
agent-capabilitieswhat is this agent allowed to do
external-writeshow do I write into someone else's system
surfaces-and-deliverywhere does the output go
scope-and-sharingwho does this apply to
voice-and-preferenceshow should Cedar write
knowledge-and-collateralwhere does shared content live
fields-and-valueswhich values are legal
limits-and-escalationcan Cedar do this at all
diagnose-and-repairwhat went wrong (kept, retuned)
playbook-anatomywhat is the syntax (kept, narrowed)

draft-analytics and playbook-execution are untouched.

SKILL.md drops from 22.6KB to 12KB and is rebuilt around the nine facts that must hold on every task: the capability protocol (supported / feature request / CRM defect, never a fourth, never invented), the one-pass non-interactive run, that nothing said in chat persists, the three identifiers, resolving a referent before writing, the two unrelated things called a gate, the org-by-nature forced-decision list, that a green tool call is not evidence, and the durability discriminator that decides whether to load a resource at all.

Descriptions are the routing layer. Each leads with its trigger, uses words a user would type, and carries its carve-out on both sides of every seam , an agent that loads the winning resource first never sees an exclusion written only on the loser.

FULL_MODE_RESOURCE_DESCRIPTION_MAX_LENGTH: 240 → 400. At 240 three descriptions were cut mid-sentence and the cut landed on the part that decides routing; field-management's catalog entry never reached the sentence saying when to load it, and it loaded in 0.6% of sessions. This cap applies only to the full-mode catalog, which is the in-app chat prompt. Terse mode , the path measured against the 2KB MCP tool-description budget , lists resource keys with no descriptions at all, so that budget is untouched and its regression guard passes unchanged. Every description is written to fit under 400; the cap is the backstop, not the editor.

Three claims were already false when traced back to source, and are repaired in the last commit:

  • services/auth/org-access.ts / canActOnTarget are deleted. The authority is services/auth/authorize.ts, DEFAULT_POLICY['playbook:user'] = SELF_OR_ORG_ADMIN.
  • Slack groups:write and files:write are granted now. The old list called them deliberately withheld, which would have made the agent refuse a private deal channel it can create. channels:join is the only remaining exclusion.
  • daily-agenda holds eleven tools, not the three the doc recited. Now points at dailyAgendaSkill.tools instead of enumerating.

The routing suite

docs/design/agent-knowledge-routing-suite.md , 25 requests with a known-correct selection, each drawn from a production failure. /refresh-agent-knowledge re-runs it. Advisory, not blocking: the false-failure rate is unmeasured, so on first runs a red case is a question about two descriptions at a seam, not an automatic revert.

Verification

oxlint --deny-warnings clean · pnpm deps:check clean · pnpm --filter @zero/server run types clean · `vitest src/mastra/skills/account-config/tests src/mastra/skills/__test

Show production surfaces and changed-file mapping

Production surfaces

Libra has not measured any production surfaces for this change yet.

Changed files → surfaces

  • .claude/skills/refresh-agent-knowledge/SKILL.mdno production surface mapped
  • README.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/SKILL.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/agent-capabilities.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/building-an-agent.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/cedar-system-knowledge.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/choosing-a-trigger.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/diagnose-and-repair.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/external-writes.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/field-management.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/fields-and-values.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/knowledge-and-collateral.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/limits-and-escalation.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/playbook-anatomy.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/playbook-design.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/scope-and-sharing.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/surfaces-and-delivery.mdno production surface mapped
  • apps/server/.claude/skills/cedar-configuration/voice-and-preferences.mdno production surface mapped
  • apps/server/.claude/skills/email-analysis/SKILL.mdno production surface mapped
  • apps/server/.claude/skills/playbook-authoring/SKILL.mdno production surface mapped
  • apps/server/.claude/skills/playbook-writing/SKILL.mdno production surface mapped
  • apps/server/src/mastra/skills/account-config/__tests__/allowlist-splice.test.tsno production surface mapped
  • apps/server/src/mastra/skills/account-config/__tests__/cedar-configuration-docs.test.tsno production surface mapped
  • apps/server/src/mastra/skills/account-config/__tests__/knowledge-claims-resolve.test.tsno production surface mapped
  • apps/server/src/mastra/skills/account-config/__tests__/trigger-types-splice.test.tsno production surface mapped
  • apps/server/src/mastra/skills/account-config/index.tsno production surface mapped
  • apps/server/src/mastra/skills/index.tsno production surface mapped
  • apps/server/src/mastra/tools/config/config-read-tool.tsno production surface mapped
  • apps/server/src/mastra/tools/config/config-write-tool.tsno production surface mapped
  • apps/server/src/services/playbook/playbook-doc-hooks.tsno production surface mapped
  • apps/server/src/services/playbook/trigger-parser.tsno production surface mapped
  • apps/server/src/services/playbook/trigger-types.tsno production surface mapped
  • docs/design/agent-knowledge-routing-suite.mdno production surface mapped