Skip to content

feat: implement Ace doctrine — core packages, API routes, DB migration, Meridian screens#140

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/define-core-model-primitives
Draft

feat: implement Ace doctrine — core packages, API routes, DB migration, Meridian screens#140
Copilot wants to merge 3 commits into
mainfrom
copilot/define-core-model-primitives

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 6, 2026

Establishes the canonical Ace architecture: intent → policy → recommendation → approval → execution → live recovery. Lays the full structural foundation across packages, API, DB, and mobile surfaces.

New packages (packages/)

  • ace-core — canonical TS types: Principal, Operator, TripIntent, TravelPolicy, ApprovalDecision, JourneySession
  • ace-policy — pure policy evaluators: canOperatorAct, getApprovalRequirement, canAutoBook, evaluateOperatorSpendLimit; implements the approval ladder (auto → human_confirm → escalate)
  • ace-delegation — operator registry: createOperatorRecord, isOperatorActive, revokeOperator, typed AllowedAction enum
  • ace-events — 15 event type literals with payload shapes + AceEmitter interface + makeAceEvent factory
  • ace-runtimeBookingAdapter, PaymentAdapter interfaces + ExecutionRequest/Result, RerouteAction, RollbackAction contracts

DB migration 036 (additive only)

Six new tables: ace_principals, ace_operators, ace_travel_policies, ace_trip_intents, ace_approvals, ace_journey_sessions — all IF NOT EXISTS, all indexed.

API routes at /ace/ (apps/api-edge/src/routes/ace/)

Full intent lifecycle mounted at /ace:

POST   /ace/principals                  → create principal + default policy
GET    /ace/principals/:id/policy       → read travel constitution
PATCH  /ace/principals/:id/policy       → update travel constitution

POST   /ace/operators                   → register delegated operator
DELETE /ace/operators/:id               → revoke

POST   /ace/intents                     → submit intent (human or agent)
POST   /ace/intents/:id/plan            → run policy evaluation → recommendation + approval gate
POST   /ace/intents/:id/approve         → human or agent decision
POST   /ace/intents/:id/execute         → create JourneySession, begin booking
GET    /ace/journeys/:id                → live journey state (polling; SSE in subsequent phase)

Meridian screens (apps/meridian/app/(main)/)

  • converse/ — monolithic converse.tsx (3494 lines) replaced by a directory: index.tsx preserves all existing behaviour; _voice-runtime.tsx (mic state machine hook), _session-orchestrator.tsx (turn history + journey continuity), _recommendation-surface.tsx (plan card + approval badge)
  • approval/[intentId].tsx — three visual states: policy_auto / human_confirm / escalate
  • delegation/index.tsx + delegation/[operatorId].tsx — trusted operator list + per-operator trust config with revoke
  • policy/index.tsx — travel constitution UI: rail auto-book limit, flight confirmation toggle, class preference, max arrival hour, operator permissions link
  • journey/_disruption-card.tsx + journey/_recovery-surface.tsx — live disruption display + reroute options; escalation/support surface

Copilot AI and others added 3 commits April 6, 2026 20:55
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agentpay-dashboard Ready Ready Preview, Comment Apr 6, 2026 9:27pm
agentpay-docs Ready Ready Preview, Comment Apr 6, 2026 9:27pm

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.

2 participants