Commit Graph

57 Commits

Author SHA1 Message Date
jarvis 36833eefae feat(toolbox): publish discoverable agent skills 2026-09-03 18:07:07 -04:00
saltbo df9cb3b3d1 docs(architecture): establish ADR and BDD baseline 2026-09-02 22:23:12 -04:00
jarvis a2fa54a729 feat!: rebuild Agent Kanban for Realmroot Toolbox
Replace the v1 Agent/Machine runtime and CLI architecture with the v2 Resource Server, AMA-backed projections, task lifecycle, session observation, BDD specifications, and a single-package layered codebase.

BREAKING CHANGE: remove the v1 CLI, internal Agent/Machine runtime entities, workspace layout, and legacy runtime coordination APIs.
2026-09-02 00:17:52 -04:00
jarvis 95e4e5a9b3 fix(smoke): make reject resume delivery reliable 2026-08-21 19:28:36 -06:00
saltbo 6239294da0 fix(auth): use Realmroot loopback PKCE 2026-08-21 08:56:40 -06:00
saltbo d2c6c6c5f6 fix(auth)!: restore AK-owned agent sessions
Use Realmroot only for human and machine authentication, authorize AMA through the browser user's multi-resource grant, and restore AK-managed Ed25519 Agent sessions.

Preserve Better Auth source tables while removing the mistaken Realmroot Agent binding and machine M2M paths.

BREAKING CHANGE: AK no longer accepts Realmroot Agent tokens or AMA machine credentials; active browser users must sign in again to authorize the AMA resource.
2026-08-21 01:55:28 -06:00
saltbo 972673aecd feat(auth)!: snapshot Realmroot native cutover
Replace Better Auth user, machine, and agent authentication with Realmroot native flows, migrate tenant ownership, and route AMA access through the cutover adapter. Preserve this deployed migration state as the baseline for the narrower user-auth-only redesign.
2026-08-21 00:44:07 -06:00
saltbo dc9d0a440e feat(maintainers): serialize webhook dispatch 2026-07-20 02:51:33 -04:00
saltbo a989f3625c feat(cli): add Windows runtime support
Bundle a pure C Node-API process ancestry addon, support Windows runner installation and executable discovery, and make runner lifecycle and logs cross-platform.\n\nAdd Windows CI and release packaging for the native addon.\n\nCloses #210
2026-07-17 01:39:16 -04:00
saltbo 8b5bdced83 fix(cli): keep GitHub auth in worker session home 2026-07-02 15:15:22 -04:00
saltbo 62b4d6c2d7 fix(maintainer): keep GitHub subject metadata in labels 2026-07-02 11:49:13 -04:00
saltbo 0e087fbaa3 fix(maintainer): key sessions by trigger label 2026-07-02 04:49:06 -04:00
saltbo 7f9f99bb4e fix(cli): isolate gh credentials for workers 2026-07-01 22:07:37 -04:00
saltbo c19116850e fix(runtime): adapt chat to AMA 0.5 events 2026-07-01 12:20:04 -04:00
saltbo 0db4561482 chore(runtime): bump ama runner to 0.4.3 2026-06-27 11:44:14 -04:00
saltbo 527672f94d refactor(cli)!: remove deprecated github auth command
BREAKING CHANGE: use ak auth git <repo-id> instead of ak github auth <repo-id>.
2026-06-26 14:26:44 -04:00
saltbo 0150de9e1d fix(smoke): check runtime sessions by AMA session id 2026-06-26 14:16:21 -04:00
saltbo 1b74518bc9 feat(maintainers): require maintainer agents 2026-06-26 02:02:10 -04:00
saltbo 3706ddfbd8 fix(maintainers): use GitHub numbers in webhook prompts 2026-06-26 01:47:34 -04:00
saltbo e83bb30549 fix(maintainer): refresh trigger worker credentials 2026-06-25 15:10:14 -04:00
saltbo bf04276397 fix(maintainer): run triggers as worker agent 2026-06-25 14:36:58 -04:00
saltbo b7af1b1155 test(maintainer): keep smoke artifacts on demand 2026-06-25 14:02:09 -04:00
saltbo 5f9909663a test(maintainer): add smoke test script 2026-06-25 13:37:50 -04:00
saltbo 8440a6bceb fix: harden AMA maintainer integration 2026-06-25 02:32:58 -04:00
saltbo 6b8d3d38f2 fix(ama): apply runtime operations before task state 2026-06-24 23:20:46 -04:00
saltbo 8cc2a769e5 test(smoke): dual-version acceptance harness (new + old ak, one server)
The migration's final gate: drive one server with both a new-version ak (AMA
runner) and the last pre-AMA published ak (agent-kanban@1.13.4, legacy daemon)
at the same time, and assert each task renders on its own path — the new ak's
task is AMA-bound (ama.sessionId + AMA session events; ChatPanel AMA path), the
old ak's task has a relay session (active_session_id; ChatPanel legacy tunnel),
and neither blanks the other.

Pins + launches both ak versions against one local AK (ak用本地环境) talking to
the online AMA (AMA_ORIGIN). Documents the live prerequisites (local AK dev
server, ak auth, runtime creds) the acceptance run needs on the operator's host.
2026-06-20 04:35:21 -04:00
saltbo d1ee9d371e refactor(cloud): fetch the cloud model catalog from AMA, drop the AK hardcode
The cloud model list was duplicated: AMA's RUNTIME_CATALOG.ama and AK's own
CLOUD_RUNTIME_MODELS. Make AMA the single source of truth — AK's
listRuntimeModels now fetches GET /api/v1/runtimes/{runtime}/models (new SDK op
listRuntimeModels, SDK pin 9a918c8->5d2d602). A non-empty result is a cloud
runtime; self-hosted runtimes return [] and fall through to runner-capability
discovery. The smoke's ama default model is likewise dynamic now
(ak get model --runtime ama -> data[0] = kimi-k2.7-code), so a catalog change
applies everywhere from one place. Verified end-to-end against the live AMA.
2026-06-15 14:47:00 -04:00
saltbo 34d9908dcd fix(cloud): default to kimi-k2.7-code, add gpt-oss-120b fallback
kimi-k2.6's Workers AI upstream went into a sustained degradation (every
cloud session stopped with 'Provider request failed'), which broke cloud +
mixed smoke at the reject-resume step (a dead session can't resume in place).
The AK/AMA code path is correct — verified by real PRs once a healthy model
runs. Switch the cloud model catalog + smoke default to kimi-k2.7-code (same
moonshot family, healthy backend, code-focused) and list gpt-oss-120b as a
cross-vendor fallback. Cloud smoke now 10/10 incl. reject-resume (slink#103).
llama-3.3-70b was evaluated and rejected upstream (no tool_calls in the
runtime-core harness). Tests updated to the new catalog.
2026-06-15 13:35:27 -04:00
saltbo 16867035c2 feat(ama): migrate AK to AMA's /api/v1 control-plane rewrite
AMA rewrote its control plane as a strict RESTful /api/v1 API (#60) and
hardened its v1 schema (resetting data). Adapt AK to the new contract and
re-verify the full self-hosted + cloud task lifecycle.

- Bump @any-managed-agents/sdk pin to the refactored main (9a918c8).
- Rewrite amaRuntime.ts to /api/v1 operations and shapes:
  createSessionCommand->createSessionMessage (message->content),
  stopSession->updateSession{state:stopped},
  createExternalProjectBinding->createFederatedTenant (+session:poll/claim
  caps, 409-idempotent), scheduled-trigger ops->trigger ops,
  readUsageSummary->listUsageRecords (summed, cursor-paginated, limit 100).
  Field renames: runtimeEnv->env, secretEnv credentialRef{credentialId,
  versionId}, provider->providerId, session status->state, runner
  state->status.
- taskDispatch/routes updated for the new secret-env, session.state and
  federated-tenant call sites.
- Pin ama-runner v0.3.1 (/api/v1 self-hosted runner protocol + 404 re-register
  self-heal).
- Smoke: mixed scenario now runs claude locally (+ ama cloud).
- Update AMA-contract unit/integration tests to the new shapes.

Verified locally: daemon smoke claude 11/11, ama 10/10, mixed 11/11;
build + typecheck + 1768 unit/integration tests green.

Server-side AMA fixes pushed to main + deployed separately: AMA_VAULT_
ENCRYPTION_KEY secret, runner 404 self-heal (v0.3.1), idle-session resume
via work item, live-prompt turn-end fix, sandbox.exec AbortSignal-over-RPC fix.
2026-06-15 06:07:39 -04:00
saltbo 63dbed79b8 fix(smoke): pick the first runner-declared model for codex agents
Runners enumerate real host models now; pinning the retired
gpt-5.3-codex id selected a model no runner declares and precise lease
matching correctly refused the work.
2026-06-12 00:55:21 -04:00
saltbo 3804f8524b fix(smoke): accept tasks that already passed in_progress in parallel checks
The mixed scenario checks tasks sequentially; a fast cloud task can be
in_review before its in_progress wait starts.
2026-06-11 16:25:16 -04:00
saltbo 4f95c5461f fix(smoke): pin the codex smoke model to the runner-declared gpt-5.3-codex
AMA validates the session model against the runtime catalog and the
runner only declares gpt-5.3-codex; the previous spark pick fell back to
gpt-5.5 and session creation 409'd.
2026-06-11 16:14:59 -04:00
saltbo bbb0b17e43 fix(smoke): don't let failed lifecycle commands abort the run under set -e
The status assertions decide pass/fail; a rejected ak command (e.g.
complete on a task stuck in_progress) should produce a FAIL line, not
kill the remaining tests.
2026-06-11 15:36:58 -04:00
saltbo 32a3716215 fix(smoke): drop npm-install bait from smoke task descriptions
Cloud sandboxes don't need dependency installs for the marker-file task,
and kimi yak-shaves full reinstalls past the in_review deadline.
2026-06-11 15:17:31 -04:00
saltbo 076d438327 feat(cli): ship a standalone single-file ak bundle for cloud sandboxes
npm is unusable inside AMA sandboxes (npm worker processes orphan the
exec pipe and the install never returns), so cloud sessions can't
npm-install the CLI. Build a fully-bundled dist/standalone.js (provider
runtime SDKs stubbed out — cloud agents only use the API-client
commands), serve it from the web app at /cli/ak-standalone.mjs with a
one-line /cli/install.sh bootstrap, and point the cloud initial prompt
at it.
2026-06-11 15:11:11 -04:00
saltbo 1b30d34c91 feat(server): dispatch cloud-runtime tasks to AMA sandbox environments
New agent runtime "ama" runs tasks on AMA's Cloudflare Sandbox plane:
per-owner cloud environment, capacity-gate-free dispatch, self-contained
cloud initial prompt (install ak CLI, claim, branch, push, PR via GitHub
API), GH_TOKEN delivery from GITHUB_AGENT_TOKEN via an owner-scoped AMA
vault credential.

Atomic dispatch claim (ama.dispatch.result=dispatching) closes the
create/assign vs cron-sweep race that double-created sessions and tore
the first one down mid-run; assigns claim with takeover so a deliberate
re-assign still kicks a bound task; stale claims are released by the
sweep. Cancel now also works on todo tasks so swept tasks can be
stopped.

Smoke covers ama + mixed placements with a dev sweep loop and
deterministic subagent evidence.
2026-06-11 13:52:40 -04:00
saltbo d0d7bfa79c feat(cli): harden runner onboarding and reap dead leader sessions
- Install the server-pinned runner version when machine registration
  provides one; extract inside BIN_DIR (tmpfs rename breaks cross-device);
  fail fast when onboarding credentials are missing instead of silently
  spawning a runner with no token; use one trimmed origin for --api-server
  and the config file so the runner adopts its saved token.
- ak stop deletes the token-bearing runner config; status shows real
  detected providers and live runner health; dead --poll-interval/
  --task-timeout flags and the never-firing shutdown prompt are gone.
- The CLI reaps leader sessions whose runtime process died (close + usage
  report), replacing the old daemon heartbeat cleanup.
- Smoke script asserts server-side binding teardown instead of local
  session files, and no longer trips EPIPE on ak status.
2026-06-11 12:06:41 -04:00
saltbo e9a15c9431 test(maintainer): add board maintainer acceptance script
Maintainers are board-level and scheduled (AMA ~5m cron), so they do not fit the
per-task daemon smoke. Layer A checks the CLI/API contract; --live waits for the
cron to dispatch a real heartbeat run.
2026-06-08 23:24:42 -04:00
saltbo 9166e07d9d fix(ama): sync agent capabilities cleanly 2026-06-08 13:24:28 -04:00
saltbo 55c587dc18 feat(ama): integrate runner-backed task execution 2026-06-08 12:20:29 -04:00
saltbo 3bd8ad366e feat(runtime): dispatch AK tasks through AMA 2026-06-07 17:13:42 -04:00
saltbo c566a17bec docs(skills): share wait monitoring policy 2026-05-18 01:06:09 -04:00
saltbo c543461e5e test(daemon): update smoke subagent setup 2026-05-18 00:50:37 -04:00
saltbo 459d6a77cd chore(skills): sync shared leader references 2026-05-05 10:05:21 -04:00
saltbo 957327e924 fix(smoke): clean runtime test agents 2026-05-03 23:42:57 -04:00
saltbo 452fed431b feat(skill): verify agent soul proposal workflow 2026-05-03 22:53:33 -04:00
saltbo abd872615a fix: make gemini smoke subagents runnable 2026-05-03 11:31:56 -04:00
saltbo 7fbbbfe2eb feat: add registered worker subagents 2026-05-03 10:55:55 -04:00
saltbo 50810779a6 revert(ops): remove killswitch in favor of account-level monitor
Moved to saltbo/saltbo repo where it now watches the whole CF account
(agent-kanban + other workers) and attributes trips to a specific
scriptName / databaseId. Keeping a duplicate here would double-alert.
2026-04-19 16:05:29 -04:00
saltbo da43f67522 fix(ops): fall back on empty-string env vars in killswitch
GitHub Actions passes unset repo variables as "" rather than undefined,
so `??` would not fall through to defaults. `Number("")` is 0, which
caused every metric to trip on the first manual run. Switch to `||`
so both undefined and "" drop to the built-in defaults.
2026-04-19 15:43:04 -04:00