Skip to content

Feat/task chain v1 merge - #15

Merged
BSVanon merged 8 commits into
mainfrom
feat/task-chain-v1-merge
Mar 7, 2026
Merged

Feat/task chain v1 merge#15
BSVanon merged 8 commits into
mainfrom
feat/task-chain-v1-merge

Conversation

@BSVanon

@BSVanon BSVanon commented Mar 7, 2026

Copy link
Copy Markdown
Owner

No description provided.

BSVanon and others added 8 commits March 6, 2026 11:29
Programmable Work Orders — Scout→Worker→Verifier→Archivist chain.

- Define 8 TaskChain types (TaskChainInput, TaskChainResult, TaskChainError, etc.)
- Add TaskChainRunner orchestrator (calls hireClaw, verifyReceipt, writeMemory)
- Add POST /api/task-chain/run route with input validation + Bearer auth
- Discriminated TaskChainOutcome: 200=TaskChainResult, 422=TaskChainError
- Verification failure when required now correctly produces error + 422
- Receipt uses runtime shape (opaque Record), not stale Receipt type
- storageBackend derived from indelibleEnabled config
- OpenAPI: path + 8 schemas + 401/400/422/500 responses + securityScheme
- 12 unit tests covering all 4 steps, failure modes, template mapping
- 3 frozen v1 templates: verified_research, check_and_archive, monitor_and_escalate

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add task-chain.html — one-page work-order UI with:
- Template picker (3 templates), task input, budget + toggles
- Four role cards (Scout/Worker/Verifier/Archivist) with live state transitions
- Outcome panel: result text, total sats, verification, receipt, memory ref
- Error banner with step-specific failure display
- Duplicate-click protection, no protocol jargon in UI copy
- GET /task-chain route to serve the page

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reads API token from input field, sends Authorization header on fetch,
persists token to localStorage for cross-session convenience.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
20 route-level tests covering auth, input validation, response shape,
and error code specificity. Test plan updated with sections 1.13-1.14
and test count bumped to 154.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Route and tests now use the same validateTaskChainInput() from
TaskChainRunner.ts. Removes duplicated validation logic that could
drift between production and test code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- CAPABILITY_PARAM_KEY maps each template's capability to the correct
  handler param name (bsv_mentor→question, hash_commit→payload,
  peer_health_check→endpoint) so hireClaw sends the right field.
- CLAWSATS_ALLOW_LOCALHOST=1 env var bypasses SSRF localhost block
  in isValidPeerEndpoint, enabling local multi-Claw testing.

Validated end-to-end: two local Claws, Task Chain Scout→Worker→Verifier→Archivist
all complete successfully via free trial path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Boots an actual Express server on an ephemeral port and exercises
POST /api/task-chain/run through real HTTP: 401 auth rejection,
400 validation errors, 200 successful run with full response shape,
and Content-Type verification. Addresses Codex review gap.

15 suites, 159 tests passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Task Chain V1 — 4-step orchestration (Scout→Worker→Verifier→Archivist)
composing existing primitives (hireClaw, verifyReceipt, writeMemory).

- 3 templates: verified_research, check_and_archive, monitor_and_escalate
- Single front door: POST /api/task-chain/run
- Shared validateTaskChainInput used by route and tests (no drift)
- Capability param mapping (bsv_mentor→question, hash_commit→payload, etc.)
- Single-page UI at /task-chain with 4-role card animation
- OpenAPI spec for the endpoint
- 159 tests across 15 suites (unit + HTTP integration)
- CLAWSATS_ALLOW_LOCALHOST env var for local multi-Claw testing
- Live-tested end-to-end with 2 local Claws via free trial path
@BSVanon
BSVanon merged commit 036b423 into main Mar 7, 2026
5 checks passed
@BSVanon
BSVanon deleted the feat/task-chain-v1-merge branch March 7, 2026 14:06
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.

1 participant