Skip to content

Orchestration & Routing

Grace operates across 4 workspaces and integrates with multiple external tools. Upon session entry, Grace detects context signals and routes work to the appropriate system.


Grace monitors for 12 canonical trigger words that indicate intent:

TriggerIntentSystemExamples
VALIDATECheck unit conformance to SPEC-01STRATTVALIDATE stratt://dev/task/review-code@1.0.0
FINGERPRINTCompute Blake3 hash (SPEC-02)STRATTFINGERPRINT my-task.yaml
VERIFYCheck fingerprint tamper detection (SPEC-02)STRATTVERIFY my-task.yaml
CIRun full validation pipelineSTRATTCI stratt://dev/chain/code-review@1.0.0
GATEResolve gate checkpoint (SPEC-04)STRATTGATE approve <trace-id>
COUNCILQuery council state or gate authoritySTRATTCOUNCIL pathfinder agents
CAMPAIGNMarketing trail activation or content generationGrace CampaignsCAMPAIGN activate CT-07 MERIDIAN_BUILD
TRACEExecute trace analysis (SPEC-05)Execution TracesTRACE quality-delta stratt://dev/task/*
IMPACTCompute blast radius (SPEC-03)STRATT GraphIMPACT stratt://dev/role/code-reviewer@1.0.0
PRIMERDomain extension pipelinePrimer SystemPRIMER phase-3 finance domain
DOCTRINEQuery or update doctrine definitionsDoctrinesDOCTRINE list methodology
ECOSYSTEMOrganization registry or cross-org patternsEcosystemECOSYSTEM tier active-products

If trigger words are not explicit, Grace detects context via domain-specific signal words:

Signal WordInferred Intent
unit, role, rule, task, chain, supplyUnit authoring
import, dependency, dag, cycleSPEC-03 graph
contract, input, output, requiredSPEC-01 contract
status, draft, review, publishedLifecycle (SPEC-01)
promoted, deprecated, archivedLifecycle transitions
Signal WordInferred Intent
choco://, contract, requirement, domain, namespaceDocumentation engine
neuro, finance, nutrition, legal, filmNon-core domains
Signal WordInferred Intent
stratt-hq, grace-hq, choco-hq, so1-io, iris-hqOrganization context
active-core, active-products, scaffolded, archiveTier classification
integration, pattern, bridge, resolverCross-org patterns
Signal WordInferred Intent
FM-01, FM-02, … FM-09Failure mode detection/handling
tamper, broken, cycle, draft, gateFM-specific context

Grace routes operations to tools based on context:

When: source == GitHub Issue AND signal matches STRATT/council

Terminal window
gh issue comment <issue-id> --body "..."
gh issue create --title "FM-02: Broken import in registry"
gh pr review <pr-id> --approve

Examples:

  • User files GitHub issue: “VALIDATE this chain”
  • Grace routes to: gh + STRATT CLI
  • Posts result as comment

When: source == Linear ticket AND signal matches project task

Terminal window
linear update <issue-id> --status "In Progress"
linear comment <issue-id> "Gate approved"

Examples:

  • User creates Linear ticket: “Gate approval needed for code-reviewer@2.0.0”
  • Grace routes to: Linear API + STRATT CLI
  • Updates ticket status

When: signal matches VALIDATE, FINGERPRINT, VERIFY, CI, GATE, COUNCIL, IMPACT

Terminal window
bun packages/cli/src/index.ts validate stratt://dev/task/review-code@1.0.0
bun packages/cli/src/index.ts fingerprint my-task.yaml
bun packages/cli/src/index.ts gate approve <trace-id>
bun packages/cli/src/index.ts council pathfinder

Working directory: ~/code/workspace/stratt-hq/

When: signal matches CAMPAIGN or signal matches automation

POST /api/v1/workflows/execute
payload: { trigger: "CAMPAIGN", trail: "CT-07" }

Examples:

  • Campaign activation
  • Scheduled trace evaluation
  • Ecosystem sync operations

When: Special protocol operations need external service

ServerProtocolPurpose
n8nHTTPWorkflow automation, campaign execution
iris-hqIrisSprite rendering and web publishing
traceo-aiTraceExecution trace collection and analysis
LinearLinearProject management and issue tracking
GitHubGitRepository operations and PR management
NotionNotionDocumentation and knowledge base
GmailGmailEmail integration
Google CalendarGCalScheduling and work rhythm

Grace coordinates across 4 local workspaces. File paths follow a consistent pattern:

Base: ~/code/workspace/stratt-hq/

ResourcePath
Unit registrypackages/units/ (organized by domain/type)
Schema validationpackages/schema/src/
Fingerprintingpackages/fingerprint/src/
Graph/DAGpackages/graph/src/
CLIpackages/cli/src/ (21 commands)
Council configscouncils/{name}/council.yaml (7 councils)
SpecificationCANONICAL-SERIALISATION-SPEC.md (1,215 lines)

Base: ~/code/workspace/choco-hq/

ResourcePath
Requirementscontracts/ (organized by domain)
Specificationsdocs/specs/
Namespacesnamespaces.yaml
Servicesservices/ (integration points)

Base: ~/code/workspace/grace-hq/

ResourcePath
Agent contextagent/ (8 markdown files)
Architecture docsarchitecture/ (protocol specs, gap analysis)
Automationautomation/ (campaigns, traces, scripts)
Configconfig/ (ecosystem registry, gate rules, namespaces)
Memorymemory/ (session-specific, daily)
Learnings.learnings/ (improvement capture)

Base: ~/code/workspace/cho-co/

ResourcePath
Web frontendapps/web/
Documentation renderingapps/docs/
APIapps/api/

Grace uses explicit decision tables for complex routing decisions.

Question: User is asking about a unit. What should Grace do?

StatusQuestionActionNext
GivenIs unit in STRATT registry?Query packages/units/Validate
GivenIs fingerprint stored?Load from YAMLVerify
ValidationDoes unit pass Zod schema?Run validate CLIContract check
ValidationDo imports resolve?Run DAG checkLifecycle check
ValidationIs draft isolation respected?Check FM-07 ruleGate check
GateDoes unit require gate approval?Query council gate authorityPublish
PublishIs transition frozen?Check 4 gate-required transitionsGate approval
PublishAll checks pass?Publish to R2 registryReport success

Question: User is requesting marketing content. What should Grace do?

InputQuestionActionNext
Campaign trail nameDoes trail exist in campaign-engine.md?Lookup trail definitionAudience
Audience registerWho is the target audience? (open source, enterprise, internal)Load tone/style rulesContent
Content typeHeading, body, call-to-action, code example?Load content templatesGeneration
GenerationCan content be generated from templates?Use n8n workflowReview
ReviewDoes content align with brand?Compare to guidelinesPublish

Question: User is assigning a unit to an agent. Is the agent protected?

AgentCouncilProtected?Bypass RuleResult
BECK-02PathfinderYESCannot bypassEnforce gate if assignment valid
LEWIS-06PathfinderNOCan bypass with gateAllow with gate approval
EECOM-02HermesYESCannot bypassEnforce gate if assignment valid

Question: Grace detects a failure mode. What is the handler?

FM CodeNameHandlerEscalation
FM-01Fingerprint TamperReject execution, alert opsIf critical, escalate to Veritas
FM-02Broken ImportsValidation error, block publishRequest unit repair
FM-03DAG CyclesValidation error, block publishRequest refactor
FM-04Protected Agent MissingValidation error, block stepRequest different agent
FM-05Gate RemovalValidation error, block transitionRequest gate approval
FM-06Contract Breaking ChangeValidation error, block publishRecommend major version bump
FM-07Draft IsolationValidation error, block importPromote both units to review
FM-08R2 Infrastructure FailurePublish fails, rollbackCheck infrastructure, retry
FM-09Capability CheckValidation error, block assignmentRequest agent with capability

Grace watches for conditions that require proactive action (outside normal request/response):

  • STRATT health check (FM-01, FM-02, FM-04, FM-09, gate queue, council state)
  • MERIDIAN build verification
  • Session memory backup to long-term memory
  • Primer & Neuro domain health
  • Choco HQ contract validation
  • Integration pattern updates
  • Marketing KPI review (HB-01, HB-02, HB-03)
  • Cross-org integration scan
  • n8n workflow audit
  • .learnings/ pipeline review
  • FM violations detected
  • Gate timeouts approaching (24h deadline)
  • Campaign milestone reached