Commit Graph

45 Commits

Author SHA1 Message Date
Joel Hooks 85fe954c2b cutover daemon wiring (handover composition the live gateway is running — belated to main) + messaging v2 docs: AGENTS/architecture/cli/gateway/sdk updated, canonical skills/messaging added
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 15:44:28 -07:00
shitratgit[bot] 89361a97fb docs(models): describe gpt-5.6-sol pipeline policy 2026-07-13 03:04:43 +00:00
Joel Hooks fc8d8a2644 Persist direct Colima operator access and add portable Typesense export tooling 2026-05-30 15:51:58 -07:00
Joel Hooks d849247c60 Migrate joelclaw model policy to OpenAI Codex defaults
Update the inference-router catalog and default task mappings so pipeline work prefers openai-codex/gpt-5.5 for heavy/default tasks, openai-codex/gpt-5.4-mini for cheap simple/classification/json/rewrite tasks, and openai-codex/gpt-5.4 as stable fallback. Add gateway allowed-model/config tests, move gateway cheap helper defaults from Anthropic aliases to Codex models without breaking slash-command aliases, and refresh gateway/model skills and docs. Keep Anthropic only as compatibility/vision fallback and do not add a nano model.
2026-05-26 08:29:15 -07:00
Joel Hooks d754e99dac docs: capture k8s↔NAS NFS networking lore in k8s skill, system-architecture skill, and architecture docs — route via col0, NFS PVs, access patterns, verification steps (ADR-0088 Phase 2.5) 2026-03-19 20:25:41 -07:00
Joel Hooks 555b20851e Document the k8s Restate runtime, Firecracker path, workload rig DAG flow, and docs-api surfaces across AGENTS, docs, and skills 2026-03-16 21:30:24 -07:00
Joel Hooks cd28964a0c Add the microvm dagWorker handler to Restate, wire @joelclaw/agent-execution into the package and Docker image, and refresh the docs and lockfile. 2026-03-16 16:05:47 -07:00
Joel Hooks d46a46c5b9 Implement ADR-0230 step 7 Firecracker microVM runner helpers, exports, docs, and tests 2026-03-16 15:57:02 -07:00
Joel Hooks 0296337596 Add the ADR-0224 phase-1 ClickHouse k8s manifest with local-path storage, probes, and smoke verification docs 2026-03-10 08:56:07 -07:00
Joel Hooks f8e717970e Surface the latest persisted agent-dispatch canary in joelclaw status and write immediate terminal inbox truth when workload queue admission fails 2026-03-09 22:39:27 -07:00
Joel Hooks 24fc941430 Gate the scheduled agent-dispatch timeout canary behind the existing health pipeline so sandbox proof stays explicit instead of always-on noise 2026-03-09 21:43:35 -07:00
Joel Hooks 5ad0c89ffd Expose the deterministic agent-dispatch timeout canary through joelclaw status so operators can run the proof from the canonical health surface 2026-03-09 21:30:49 -07:00
Joel Hooks 4a67911323 Add a deterministic non-LLM agent-dispatch canary and verifier so the live host worker can force the exact outer-timeout closeout path 2026-03-09 21:20:31 -07:00
Joel Hooks f524cb0747 Replace agent-dispatch pipe-EOF subprocess capture with exit-driven temp-file capture, surface timeout truth, and add regression proof for false running sandbox residues 2026-03-09 20:32:32 -07:00
Joel Hooks c2f2152a9d Install the repo-managed ADR-0221 launchd janitor for local sandboxes and document the bounded stale-residue cleanup pass 2026-03-09 20:05:14 -07:00
Joel Hooks ad56989ea1 Reconcile ADR-0221 sandbox registry truth from sandbox metadata before workload sandboxes list cleanup janitor and prove the guarded full-mode path still closes terminally 2026-03-09 19:20:21 -07:00
Joel Hooks f808d5c8c2 Finish ADR-0221 by adding joelclaw workload sandboxes list cleanup janitor, dogfood the live registry surface, and update docs and skill truth 2026-03-09 18:56:53 -07:00
Joel Hooks 2b72e8a39a Re-run the ADR-0221 guarded full-mode workflow-rig canary, accept proof lines embedded in stage summaries, and record the earned terminal result 2026-03-09 18:37:18 -07:00
Joel Hooks 58b6e9e821 Block nested workflow-rig recursion inside sandboxed stage runs and tighten ADR-0221 full-mode canary guidance 2026-03-09 18:20:38 -07:00
Joel Hooks 85ee76fe38 Update ADR-0221 workload and skill truth so workflow-rig is the canonical front door and full local sandbox mode is documented honestly 2026-03-09 18:06:56 -07:00
Joel Hooks fbededdc78 Update ADR-0221 architecture truth with the fake-running sandbox failure diagnosis and verification probe 2026-03-09 17:15:13 -07:00
Joel Hooks b95563859e Update ADR-0221 architecture docs to record the live sandbox identity collision found and fixed during phase-3 dogfood 2026-03-09 16:51:45 -07:00
Joel Hooks 0479182618 Implement ADR-0221 phase 3 by adding local sandbox retention pruning, copy-first devcontainer helpers, env injection, and concurrency proof 2026-03-09 16:37:37 -07:00
Joel Hooks 2784500d90 Wire ADR-0221 local sandbox identity, env, registry, and inbox metadata into system/agent-dispatch and update architecture truth 2026-03-09 16:20:11 -07:00
Joel Hooks 2bf78e3569 Implement ADR-0221 phase-1 local sandbox primitives in @joelclaw/agent-execution and update architecture truth 2026-03-09 16:09:48 -07:00
Joel Hooks 54942452a4 Document the observer-held backlog resume heuristic and record the first automatic pause-to-resume canary on content updated 2026-03-08 08:59:59 -07:00
Joel Hooks 6ef37fde5b Record the first earned Story 4 observer-applied pause canary, keep the host worker in dry-run outside supervised drills, and document the hardened prompt/parser contract that made the proof honest 2026-03-08 07:53:39 -07:00
Joel Hooks 9741bc1fcb Harden the ADR-0217 Story 4 queue observer contract so Sonnet prefers pause or resume for content/updated and legacy escalate.reason output no longer schema-falls back during live enforce canaries 2026-03-08 07:45:36 -07:00
Joel Hooks 8156a62355 Wire an opt-in ADR-0217 k8s sandbox backend into agent-dispatch and document how external repos should submit work through joelclaw queue emit 2026-03-07 22:24:23 -08:00
Joel Hooks d3570e6958 Build an ADR-0217 runtime monitor CLI and pi TUI so operators can watch Restate Dkron Redis queue and Inngest with async report-back 2026-03-07 20:26:04 -08:00
Joel Hooks aecb4ddab7 Record ADR-0217 Story 4 as implemented dry-run host-worker reality, keep the observer in dry-run after the first enforce noop canary, and document the live rollback rule 2026-03-07 18:44:34 -08:00
Joel Hooks 7d50d389d0 Ship ADR-0217 Phase 3 Story 3 with deterministic queue control state, manual pause/resume CLI surfaces, a pause-aware drainer, and canonical localhost Redis truth for queue operators 2026-03-07 17:21:08 -08:00
Joel Hooks c3a31458dd Ship ADR-0217 Phase 3 Story 2 with a dry-run joelclaw queue observe operator surface, bounded queue-observe history, and an empty-queue deterministic noop fast-path 2026-03-07 16:41:41 -08:00
Joel Hooks c4a9dc8172 Define ADR-0217 Phase 3 Story 1 with canonical queue observation contracts, a bounded Sonnet observer, queue.observe OTEL vocabulary, and focused docs/tests 2026-03-07 16:22:28 -08:00
Joel Hooks 9096baf9e0 Enable ADR-0217 Story 4 bounded triage enforcement for discovery and GitHub behind explicit family flags while keeping queue routing deterministic and fallback immediate 2026-03-07 15:31:29 -08:00
Joel Hooks d393191307 Extend ADR-0217 Story 3 queue stats with live triage operator summaries, fallback and disagreement rollups, and installed CLI verification for the operator surface 2026-03-07 15:21:14 -08:00
Joel Hooks 2f56d84866 Wire ADR-0217 Story 2 through one canonical server-side queue admission surface, keep CLI and SDK emitters thin over /internal/queue/enqueue, and shadow triage the pilot families without changing deterministic queue correctness 2026-03-07 15:10:05 -08:00
Joel Hooks 51255ff57c Define the ADR-0217 Story 1 queue triage contract, add bounded Haiku triage parsing plus queue.triage OTEL vocabulary, and document the model-free queue boundary 2026-03-07 14:46:05 -08:00
Joel Hooks 5b48e6e120 Add a Restate drainer stall watchdog so ADR-0217 queue pilots self-heal instead of silently wedging until a manual restart 2026-03-07 13:32:04 -08:00
Joel Hooks f3ef5fc60f Replace the ad-hoc Restate host worker with a repo-managed launchd service so ADR-0217 soak windows stop getting poisoned by opaque nohup restarts 2026-03-07 11:35:51 -08:00
Joel Hooks 73a51f74ee Remove the queue drainer’s fixed-interval tax so ADR-0217 burst latency stays under the Story 5 gate 2026-03-07 10:28:28 -08:00
Joel Hooks a03f270fbf Start the Restate queue drainer and align sandbox runtime docs with live reality 2026-03-07 07:56:40 -08:00
Joel Hooks 08338a6c9f Add repo materialization and patch artifact export to @joelclaw/agent-execution
Implement sandbox runtime PRD Story 3: clean repo materialization and patch-artifact export so sandbox runs mutate only their own checkout and return auditable output instead of touching the host worktree.

New capabilities:
- materializeRepo(): Clone or checkout repo at exact SHA in sandbox-local workspace. Fresh clone if target doesn't exist, fetch+checkout otherwise. SHA verification with automatic unshallow. Isolated from host worktree.
- generatePatchArtifact(): Export auditable patch from baseSha..headSha with touched-file inventory, verification summary, and log references. Uses git format-patch for commits, git diff for uncommitted changes.
- getTouchedFiles(): Capture modified/untracked files via git status --porcelain.
- verifyRepoState(): Validate repo is at expected SHA.
- writeArtifactBundle()/readArtifactBundle(): Serialize ExecutionArtifacts to/from JSON.

Promotion boundary: Phase 1 output is patch bundle + metadata. Runtime does NOT merge to main or push to remote. Operator reviews patch + verification, then applies to host repo or discards.

Tests: Full coverage for repo materialization, artifact export, touched-file inventory, and bundle serialization. All 84 tests pass.

Docs: Updated deploy.md, architecture.md, and system-architecture skill with new contract details and Phase 1 promotion boundary explanation.

Files:
- packages/agent-execution/src/repo.ts (new)
- packages/agent-execution/src/artifacts.ts (new)
- packages/agent-execution/src/index.ts (exports)
- packages/agent-execution/__tests__/repo.test.ts (new)
- packages/agent-execution/__tests__/artifacts.test.ts (new)
- docs/deploy.md (updated)
- docs/architecture.md (updated)
- skills/system-architecture/SKILL.md (updated)

Verification: bunx tsc --noEmit ✓, pnpm biome check ✓, bun test packages/agent-execution ✓ (84/84 pass)
2026-03-06 17:20:54 -08:00
Joel Hooks 9c8f3fef1f Add cold isolated k8s Job runner for sandboxed story execution
Implement sandbox runtime PRD Story 2: cold-runner Job spec, runtime image contract, deterministic naming, and resource cleanup policy for isolated story runs in k8s Jobs.

Outcomes:
- Deterministic k8s Job spec generation via @joelclaw/agent-execution/job-spec
- Job naming keyed by requestId (DNS-1123 compliant)
- Runtime image contract: Git, Bun, agent tooling, /workspace, env-driven config
- Resource limits: 500m-2 CPU, 1-4Gi memory (configurable)
- TTL cleanup: auto-delete after 5 minutes (default)
- Active deadline: 1 hour max runtime
- Backoff limit: 0 (no retries)
- Security: non-root (UID 1000), no privilege escalation, capabilities dropped
- Cancellation support at Job level (delete Job -> SIGTERM)
- Environment variables: WORKFLOW_ID, REQUEST_ID, STORY_ID, TASK_PROMPT_B64, VERIFICATION_COMMANDS_B64, etc.
- Comprehensive test coverage (37 tests for job-spec, 69 total)

Changes:
- packages/agent-execution/src/job-spec.ts: NEW - Job spec generator
- packages/agent-execution/src/index.ts: export job-spec functions
- packages/agent-execution/__tests__/job-spec.test.ts: NEW - comprehensive tests
- k8s/agent-runner.yaml: NEW - runtime contract documentation
- docs/architecture.md: document cold k8s Jobs and runtime contract
- docs/deploy.md: deployment procedures for agent runner
- skills/k8s/SKILL.md: agent runner operations guide

No live infrastructure deployed - code, manifests, and contracts only.

Verification:
- bunx tsc --noEmit ✓
- pnpm biome check ✓
- bun test packages/agent-execution ✓ (69 passing)

Next stories:
- Story 3: Build runtime image with Git + Bun + codex + pi
- Story 4: Hot-image CronJob for pre-warmed images
- Story 5: Warm-pool scheduler for instant dispatch
- Story 6: Wire Restate DAG orchestrator to launch Jobs
2026-03-06 17:13:21 -08:00
Joel Hooks 29edbdb5e7 Create @joelclaw/agent-execution as canonical sandbox execution contract package
Story 1: Define shared sandbox execution contract

Created new workspace package @joelclaw/agent-execution to unify ad-hoc types between Restate workflows and system-bus Inngest functions.

Contract types defined:
- SandboxExecutionRequest: workflow ID, request ID, story ID, task, agent identity, sandbox profile, base SHA, verification commands
- SandboxExecutionResult: request ID, execution state, timestamps, duration, artifacts, error
- ExecutionArtifacts: head SHA, touched files, patch, verification summary, log references
- AgentIdentity: name, variant, model, program
- StoryPlan, WavePlan, PrdExecutionPlan: PRD structure types
- Lifecycle states: pending, running, completed, failed, cancelled
- Sandbox profiles: workspace-write, danger-full-access
- InboxResult: legacy format for backward compatibility

Runtime validation:
- Type guards for all contract shapes (isSandboxExecutionRequest, etc.)
- JSON serialization round-trip tests
- Schema validators with comprehensive test coverage

Integration:
- Restate prd-types.ts now re-exports from @joelclaw/agent-execution
- system-bus agent-dispatch.ts imports InboxResult from shared package
- system-bus serve.ts annotated with contract location comment
- docs/architecture.md created with full system architecture overview

Verification:
- 31 tests pass (contract invariants, serialization, validation)
- TypeScript compilation: clean
- Biome formatting: applied

This package provides the stable contract foundation for Story 2 (Restate wrapper), Story 3 (k8s Job launcher), and Story 4 (dispatch routing).
2026-03-06 17:06:56 -08:00