Skip to content

Commit e0a85b8

Browse files
hyperpolymathclaude
andcommitted
feat(operational-layer): wire rgtv CLI to vault-broker + daemon management
- vault-broker: add GET /v1/credentials endpoint (sorted hint names, no values); fix pre-existing Zeroizing clone bug in redeem handler; remove .json() tracing call that required an unset feature flag - svalinn-cli → rgtv: full rewrite wired to vault-broker HTTP API via ureq; commands: get (grant→redeem→sh exec with Zeroizing value), list, status, verify, and daemon start/stop/status (PID-file managed via ~/.local/state/rgtv/); honest stubs for audit/rotate with clear TODO messages - Justfile: replace vex-SATELLITE_NAME placeholders with working targets: build-broker, build-cli, broker-dev, broker-start, broker-stop, broker-status, broker-logs, creds - STATE.a2ml: bump completion 45→55%, record completed milestones Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a9a59a0 commit e0a85b8

7 files changed

Lines changed: 2525 additions & 140 deletions

File tree

.machine_readable/6a2/STATE.a2ml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[metadata]
77
project = "reasonably-good-token-vault"
88
version = "0.2.0"
9-
last-updated = "2026-04-11"
9+
last-updated = "2026-04-12"
1010
status = "active"
1111

1212
[project-context]
@@ -15,7 +15,7 @@ purpose = """Zero-trust LLM credential broker. Issues opaque one-use grants to
1515
authenticated agents; agents redeem grants for raw credential values. Raw values
1616
never appear in agent context, prompts, or logs. Monorepo containing vault-core
1717
(crypto library), vault-broker (axum HTTP server), ada-cli, and FFI bindings."""
18-
completion-percentage = 45
18+
completion-percentage = 55
1919

2020
[position]
2121
phase = "implementation"
@@ -30,6 +30,9 @@ milestones = [
3030
{ name = "deploy-fly.sh: rgtv phase with token persistence", completion = 100 },
3131
{ name = "Multi-consumer support (multiple hints per broker instance)", completion = 100 },
3232
{ name = "Grant TTL enforcement and expired-grant auto-purge", completion = 100 },
33+
{ name = "vault-broker GET /v1/credentials endpoint (list hints, no values)", completion = 100 },
34+
{ name = "rgtv CLI wired to vault-broker HTTP API (get/list/status/verify/daemon)", completion = 100 },
35+
{ name = "rgtv daemon start/stop/status (PID-file-managed vault-broker process)", completion = 100 },
3336
{ name = "Honeypot endpoint (canary for credential sniffing)", completion = 20 },
3437
{ name = "RGTV Idris2 ABI formal proofs (grant lifecycle invariants)", completion = 0 },
3538
{ name = "Zig FFI layer (C-compatible vault_grant / vault_redeem)", completion = 0 },
@@ -45,6 +48,7 @@ issues = [
4548
"Containerfile uses debian:bookworm-slim — should migrate to Chainguard base per container policy",
4649
"RGTV_AGENT_TOKEN in nesy-solver-api is staged but not yet applied (requires deploy)",
4750
"No audit log yet — grant/redeem events not persisted anywhere",
51+
"rgtv audit/rotate subcommands are honest stubs — backend endpoints not yet implemented",
4852
]
4953

5054
[critical-next-actions]
@@ -58,6 +62,9 @@ actions = [
5862

5963
[completed-work]
6064
entries = [
65+
{ date = "2026-04-12", description = "vault-broker: added GET /v1/credentials endpoint returning sorted hint names with no credential values. Fixed two pre-existing bugs: Zeroizing<String> clone in redeem handler, .json() tracing_subscriber call removed (feature not enabled)." },
66+
{ date = "2026-04-12", description = "rgtv CLI (svalinn-cli crate renamed): full rewrite wired to vault-broker HTTP API. Commands: get (grant→redeem→exec with Zeroizing value), list (/v1/credentials), status (/health), verify (functional round-trip), daemon start/stop/status (PID-file managed). Binary renamed from svalinn_cli to rgtv. Added ureq+zeroize deps." },
67+
{ date = "2026-04-12", description = "Justfile: replaced placeholder template targets with working broker/CLI targets (build-broker, build-cli, broker-dev, broker-start, broker-stop, broker-status, broker-logs, creds)." },
6168
{ date = "2026-04-11", description = "vault-broker crate: axum 0.7 HTTP server with /health, POST /v1/grants, POST /v1/grants/:id/redeem. Zeroizing<String> for all credential storage. IPv6 dual-stack bind. UUID v4 grants. Auto-purge of expired grants on each create call." },
6269
{ date = "2026-04-11", description = "vault-broker fly.toml and Containerfile: multi-stage Rust build on debian:bookworm-slim, non-root rgtv user, curl HEALTHCHECK, TCP service on :9100 with /health check and 15s grace period." },
6370
{ date = "2026-04-11", description = "nesy-solver-api RGTV client (rgtv_client.v): two-step grant→redeem protocol, 10s read timeout, falls back to NESY_INGEST_TOKEN env if RGTV_URL unset." },

Justfile

Lines changed: 65 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,84 @@
11
# SPDX-License-Identifier: PMPL-1.0-or-later
2-
# justfile for vex-SATELLITE_NAME
2+
# justfile for reasonably-good-token-vault
33

44
set shell := ["bash", "-uc"]
55

66
default:
77
@just --list
88

9-
# Build the project
9+
# Build vault-broker and rgtv CLI
1010
build:
11-
cargo build --release
11+
cargo build --manifest-path vault-broker/Cargo.toml --release
12+
cargo build --manifest-path svalinn-cli/Cargo.toml --release
1213

13-
# Run tests
14+
# Build vault-broker only
15+
build-broker:
16+
cargo build --manifest-path vault-broker/Cargo.toml --release
17+
18+
# Build rgtv CLI only
19+
build-cli:
20+
cargo build --manifest-path svalinn-cli/Cargo.toml --release
21+
22+
# Build vault-core crypto library
23+
build-core:
24+
cargo build --manifest-path vault-core/Cargo.toml --release
25+
26+
# Run tests for all Rust crates
1427
test:
15-
cargo test
28+
cargo test --manifest-path vault-broker/Cargo.toml
29+
cargo test --manifest-path svalinn-cli/Cargo.toml
30+
cargo test --manifest-path vault-core/Cargo.toml
1631

17-
# Run checks (clippy + fmt)
32+
# Run clippy + fmt check for all Rust crates
1833
check:
19-
cargo fmt --check
20-
cargo clippy -- -D warnings
34+
cargo fmt --manifest-path vault-broker/Cargo.toml --check
35+
cargo clippy --manifest-path vault-broker/Cargo.toml -- -D warnings
36+
cargo fmt --manifest-path svalinn-cli/Cargo.toml --check
37+
cargo clippy --manifest-path svalinn-cli/Cargo.toml -- -D warnings
2138

22-
# Format code
39+
# Format all Rust source
2340
fmt:
24-
cargo fmt
41+
cargo fmt --manifest-path vault-broker/Cargo.toml
42+
cargo fmt --manifest-path svalinn-cli/Cargo.toml
2543

26-
# Clean build artifacts
44+
# Clean all build artefacts
2745
clean:
28-
cargo clean
46+
cargo clean --manifest-path vault-broker/Cargo.toml
47+
cargo clean --manifest-path svalinn-cli/Cargo.toml
48+
cargo clean --manifest-path vault-core/Cargo.toml
49+
50+
# ---------------------------------------------------------------------------
51+
# Operational: daemon + CLI
52+
# ---------------------------------------------------------------------------
53+
54+
# Start vault-broker daemon in the background (requires RGTV_AGENT_TOKEN +
55+
# RGTV_CRED_* env vars to be set in the calling shell).
56+
broker-start:
57+
@echo "Starting vault-broker daemon..."
58+
@rgtv daemon start
59+
60+
# Stop the running vault-broker daemon.
61+
broker-stop:
62+
@rgtv daemon stop
63+
64+
# Report daemon health.
65+
broker-status:
66+
@rgtv daemon status
67+
68+
# Tail the daemon log (follow mode).
69+
broker-logs:
70+
@tail -f ~/.local/state/rgtv/vault-broker.log
71+
72+
# List the credential hints registered with the running broker.
73+
creds:
74+
@rgtv list
75+
76+
# Run vault-broker in the foreground (dev mode, logs to stdout).
77+
# Requires: RGTV_AGENT_TOKEN + one or more RGTV_CRED_<HINT> vars.
78+
broker-dev:
79+
@echo "Starting vault-broker in foreground (dev mode)..."
80+
@echo "Required: RGTV_AGENT_TOKEN, RGTV_CRED_<HINT>=<value>"
81+
cargo run --manifest-path vault-broker/Cargo.toml
2982

3083
# Generate vexometer traces
3184
trace input:

0 commit comments

Comments
 (0)