Skip to content

feat(argentd): canary receipt methods over ws — status + generateLocalProof#468

Merged
webdevtodayjason merged 3 commits into
devfrom
feat/argentd-ws-canary
Jul 2, 2026
Merged

feat(argentd): canary receipt methods over ws — status + generateLocalProof#468
webdevtodayjason merged 3 commits into
devfrom
feat/argentd-ws-canary

Conversation

@webdevtodayjason

Copy link
Copy Markdown
Contributor

What

Closes the last gap in the installed-daemon canary contract: argentd now speaks rustGateway.canaryReceipts.status and rustGateway.canaryReceipts.generateLocalProof over its ws JSON-RPC dialect and advertises both in the hello features.methods array.

  • Receipts mirror RustGatewayPromotionReceipt (src/infra/rust-gateway-receipt-store.ts): all three canary surfaces, RUST_CANARY_DENIED + RUST_CANARY_DUPLICATE_PREVENTED codes, tokenMaterialRedacted:true, authoritySwitchAllowed:false.
  • In-memory hub store, capped at 1000 (status reads clamp to 100); proof regenerates after daemon restart via --generate-local-receipts.
  • canaryFlagEnabled reads the same ARGENT_RUST_GATEWAY_CANARY_DENY_RECEIPTS=1 flag the Node gateway uses.

Adversarial review findings fixed (3-lens multi-agent review, 7 confirmed)

  • Control-char-safe JSON escaping in json_string/escape_json + JSON-aware param extraction (find_param_json_string) — a reason with escaped quotes/newlines previously truncated or persisted invalid JSON into the receipt store, breaking every subsequent status response until restart.
  • Reason redaction — port of the redactSensitiveText pattern subset so a pasted secret in --reason can't be persisted under a receipt asserting tokenMaterialRedacted:true.
  • Node-parity: limit clamping (trunc → clamp(1,100), negatives → 1), duplicateKey derivation (idem-/cron-/run- bases), stableReceiptId surface sanitization (chat.sendchat-send), receipt Vec cap.

Verification

  • 56 argentd tests green (4 new canary parity tests incl. redaction/escape round-trip)
  • E2E against a live local daemon:
    • argent gateway authority status-installed --generate-local-receipts --confirm-local-onlyread-only-ready, zero blockers, receiptProofComplete, probe methodAdvertised=true
    • argent gateway authority smoke-local --confirm-local-onlypassed, zero blockers

Non-goals honored: no authority flips (Node stays live authority everywhere), loopback-only, zero TS changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T3dkQzz2mSrSNtGBE9cmXr

…lProof

Adds the two RPC methods the installed-daemon canary contract requires:
rustGateway.canaryReceipts.status and .generateLocalProof, advertised in
the hello features.methods array. Receipts mirror the Node store shape
(RustGatewayPromotionReceipt), cover all three canary surfaces with
RUST_CANARY_DENIED + RUST_CANARY_DUPLICATE_PREVENTED codes, and are held
in a capped in-memory hub store (regenerate proof after daemon restart).

Adversarial-review fixes rolled in: control-char-safe JSON escaping
(json_string/escape_json), JSON-aware param extraction so escaped
reasons round-trip instead of poisoning the persisted receipt JSON,
reason redaction (port of redactSensitiveText subset) so
tokenMaterialRedacted:true is truthful, Node-parity limit clamping,
duplicateKey derivation, and stableReceiptId surface sanitization.

Verified end-to-end: gateway authority status-installed
--generate-local-receipts → read-only-ready, smoke-local → passed,
runtime probe methodAdvertised=true. 56 argentd tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3dkQzz2mSrSNtGBE9cmXr
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c90439fb-87b6-4736-8d52-eb0166587927

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/argentd-ws-canary

Comment @coderabbitai help to get the list of available commands.

webdevtodayjason and others added 2 commits July 2, 2026 18:30
…, first hire, argentd contract)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3dkQzz2mSrSNtGBE9cmXr
… and live-verified

Carries the evening handoff refresh (cherry-picked from
chore/handoff-evening-2026-07-02, which never got a PR) and marks the
in-flight argentd ws canary section SHIPPED with live :18799 evidence.
Promotion checklist remainder item 1 closed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3dkQzz2mSrSNtGBE9cmXr
@webdevtodayjason
webdevtodayjason merged commit 4f774d6 into dev Jul 2, 2026
17 checks passed
@webdevtodayjason
webdevtodayjason deleted the feat/argentd-ws-canary branch July 2, 2026 23:39
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