Skip to content

feat: record app-call interventions and serve them to apps (sdk 0.6.1) - #99

Draft
multi-agency wants to merge 2 commits into
mainfrom
feat/run-report-platform
Draft

multi-agency wants to merge 2 commits into
mainfrom
feat/run-report-platform

Conversation

@multi-agency

Copy link
Copy Markdown
Member

On hold with the Treasury experiment: no release candidate, consumer acceptance or deploy until it is rescheduled.

Review first: src/gateway/app-routes.ts, where an app call is recorded before forwarding, refused with 503 if the record fails, and the new GET sits beside /rpc/.

Why

pnpm run-report judges an unattended autopilot run, including "no operator interventions". On a headless platform host it couldn't: it used the retired dashboard session and /gw/interventions (404 there), and the gateway didn't record app calls as interventions.

What changes

  • The gateway records an app's calls that could act on an agent (the same isIntervention rule as the owner and machine routes) before forwarding them. Reads aren't recorded.
  • Gateway behaviour change: such an app call is refused (503) and not forwarded if its record can't be written, as on the owner and machine routes.
  • New read, GET /apps/v1/o/<organization>/a/<agent>/interventions?since=<ISO time with zone>, with a read consent and the same checks as an agent call. It returns only that agent's calls (time, caller, agent, procedure) and counts unreadable lines. Hosts advertise it as interventions-v1; the SDK adds app.agent(org, agent).interventions(since).
  • pnpm run-report reads a run as an app deployment (PLATFORM_URL, APP_CREDENTIAL_FILE, ORGANIZATION, AGENT).
  • Review fixes (second commit): since, SINCE and UNTIL must be ISO 8601 with a zone and are compared in UTC (a non-ISO time hid calls); a record line without its fields counts as unreadable; the intervention record is written before the access log.

Not covered

The record still leaves out calls made on the host directly, owner signatures submitted on the confirm page and DAO vote relays. For a configured agent several deployments reach, the read shows each one's calls.

Tested

  • Offline: 1,540 of 1,540. Each new test fails without its change.
  • Release candidate 0efa730d (first commit only) passed every gate on Node 26.13.1. A new candidate is needed for the second commit before any release.

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