Files
canina/specs/corporate-runtime/README.md

5.1 KiB

Manual Hermes terminal adapter (dormant)

Python 3.9+ stdlib; no install or runtime configuration. Run explicitly from Hermes's terminal tool or an operator terminal:

python3 scripts/corporate_runtime.py --store /private/corporate-artifacts status
python3 scripts/corporate_runtime.py --store /private/corporate-artifacts --key research-unique ingest research.json --hosts hermes-agent.nousresearch.com
python3 scripts/corporate_runtime.py --store /private/corporate-artifacts --key research-unique replay-ingest REQUEST_DIGEST
python3 scripts/corporate_runtime.py --store /private/corporate-artifacts --key roadmap-unique roadmap roadmap.json
python3 scripts/corporate_runtime.py --store /private/corporate-artifacts --key fanout-unique fanout ROADMAP_UUID
python3 scripts/corporate_runtime.py --store /private/corporate-artifacts --key execution-unique execute --department CONTENT_SEO
python3 scripts/corporate_runtime.py --store /private/corporate-artifacts --key unused-required replay-evidence CHECKPOINT_DIGEST
python3 scripts/corporate_runtime.py --store /private/corporate-artifacts --key review-unique qa TASK_UUID EVIDENCE_UUID
python3 scripts/corporate_runtime.py --store /private/corporate-artifacts --key effect-unique effect TASK_UUID effect.json
python3 scripts/corporate_runtime.py --store /private/corporate-artifacts --key report-unique report report.json

Credentials must already be provisioned securely in environment: CORPORATE_API_KEY for execution/operator; CORPORATE_QA_API_KEY for QA under a distinct authenticated subject. Do not paste secrets into chat, command arguments, manifests or source. QA command reads only QA env. Backend rejects self-review. Private store (directory 0700/files 0600) includes lease-bearing replay checkpoint; transfer only source/artifact bytes required by a reviewer securely. Avoid shared writable or symlinked stores. No credentials are stored in the artifact store.

Default API http://127.0.0.1:3000/api/admin/hermes. An authorized stage endpoint requires both --api https://STAGE/api/admin/hermes and explicit --allow-stage-https; this is not a production-target detector or authorization to use production. No gateway/config/cron/plugin modifications. Do not schedule this adapter. No automatic retries.

Research JSON: API market-insights fields except sources, replaced by fetchSources [ {"url":"https://...","title":"..."} ]; provenance and interpretation are attributed operator text, not automatically validated scientific claims. Hash/excerpt/retrievedAt are obtained from actual fetched bytes. Source text is untrusted inert data. Only public allowlisted HTTPS hosts, pinned IP/TLS hostname verification, no redirect/proxy, port443, 2MB cap, bounded timeouts. Downloaded excerpt may be raw HTML/index text; adapter does not invent research conclusions. Keep source set small (API 1..30).

Roadmap JSON follows API contract, must set isActive:false; goals should target source_inventory_v1 research acceptance. Fanout creates one deterministic goal-linked RESEARCH task per goal, description exactly {"operation":"source_inventory_v1","researchId":"UUID"}. No other operation, prompt execution or arbitrary commands supported. Dedicated department/queue recommended: claim API cannot filter actionType/goal, so unsupported claimed task is rejected locally and remains leased until 300s expiry; adapter never marks it successful. Never re-use a claim operation key for a new execution attempt.

Retain mutation keys. On ingest network uncertainty, replay exact saved request via emitted request digest with original key (do not refetch/re-ingest with same key: retrieval timestamp changes). On evidence uncertainty replay emitted checkpoint; it carries original claim/evidence key, bytes and timing, so no fabricated new receipt. Re-running execute with same claim key after submission is NOT recovery; use replay-evidence. Roadmap/effect/report require unchanged manifests for retry. Fanout uses stable goal keys, safely resumes partial fanout. API conflict fails closed.

QA reopens exact original source bytes and content-addressed artifact, recomputes inventory using persisted API provenance, then posts verification for exact evidence ID/digest/URI. Does not prove clinical validity, network source immutability or independent human review. Tampered/missing bytes fail without QA submission; backend permits manual explicit rejection via contract, adapter has no automatic rejection command. Effects follow API availability semantics; do not use zero as unavailable. Report summary is attributed operator text; snapshot is server-built from persisted records.

See scripts/corporate_pilot.py for executable manifest examples and disposable test-auth Nest host. Pilot requires local private backend node_modules with ts-node/Prisma generated from current schema, migrated corporate_test on loopback :55441, and CORPORATE_PILOT_DIR under scratch; it spawns/stops its own feature host on :55442, never the full production app. Run once per empty disposable DB (daily report day is unique). Unit checks: python3 scripts/corporate_runtime_test.py. No cron or Hermes CLI installed/configured by these scripts.