Skip to content

Add doc-approval.analyze capability contract, WASM agent, and app manifest #556

Description

@enricopiovesan

Summary

Add doc-approval.analyze — the capability all doc-approval reference clients invoke today. Without this, doc-approval apps cannot execute against a real runtime (clients hardcode doc-approval.analyze).

Distinct from doc-approval.extract (#538): analyze produces the flat analysis fields the Phase 1 submitter UI renders.

Why

App-References doc-approval (7 platforms) uses capability ID doc-approval.analyze with input { document }. No Traverse WASM agent exists yet.

Unblocks: reference-apps doc-approval E2E on dev sidecar before pipeline (#111) lands.

Input

{ "document": "string" }

Output (runtime-owned)

{
  "docType": "string",
  "parties": ["string"],
  "amounts": ["string"],
  "confidence": "string",
  "recommendation": "string"
}

Deterministic text extraction — no model dependency. Same input → same output.

Depends on

Blocked by

  • None

Definition of Done

  • Capability contract at contracts/examples/doc-approval/capabilities/analyze/contract.json
  • WASM agent at examples/doc-approval/analyze-agent/ (Rust + compiled .wasm)
  • Agent is deterministic: no network, no model, no randomness
  • Component manifest with wasm digest
  • traverse-cli app validate passes for doc-approval manifest including analyze component
  • POST /v1/workspaces/local-default/execute with capability_id: doc-approval.analyze returns all five output fields
  • Determinism test: same document → identical JSON output

Validation

curl -sf -X POST http://127.0.0.1:8787/v1/workspaces/local-default/execute \
  -H 'Content-Type: application/json' \
  -d '{"capability_id":"doc-approval.analyze","input":{"document":"Invoice from Acme Corp for $500"}}'

Downstream unblocked

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:codexClaimed by CodexenhancementNew feature or requestreadyReady to implement under an approved governing specwasmWebAssembly related

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions