Skip to content

Feature idea: export a compact run ledger for session gate/retrieval decisions #2

Description

@caioribeiroclw-pixel

I found Writ from the r/ClaudeCode agent-harness thread and read through the README/command surface. The librarian + process keeper shape is strong: it already has retrieval, gates, friction logs, writ analyze-friction, and writ audit-session <session_id>.

One small thing that would make the harness easier to evaluate/debug from the outside: a compact machine-readable run ledger for a session.

What I mean is not another dashboard, just a JSON export/dry-run output that answers, for one session:

{
  "session_id": "...",
  "mode": "work",
  "task_brief_hash": "...",
  "rules_loaded": [
    { "rule_id": "...", "source": "mandatory|retrieved|playbook", "rank": 1, "reason": "..." }
  ],
  "retrieval": {
    "query_hash": "...",
    "budget_tokens": 2000,
    "total_candidates": 42,
    "latency_ms": 0.59
  },
  "gates": [
    { "name": "phase-a", "status": "approved|denied|invalidated", "reason": "..." },
    { "name": "test-skeletons", "status": "approved|denied|invalidated", "reason": "..." }
  ],
  "writes": [
    { "path": "src/foo.py", "decision": "allow|deny", "gate_status": "..." }
  ],
  "verification": [
    { "command": "...", "exit_code": 0, "evidence_path": "..." }
  ],
  "human_approvals": [
    { "gate": "phase-a", "via_token": true }
  ],
  "stop_reason": "completed|blocked|needs_human|context_pressure"
}

Why it seems useful:

  • workflow-friction.log and audit-session are good local observability, but a stable JSON ledger would let users attach a single artifact to bug reports/PR reviews.
  • It would make Writ's “process keeper” claim easier to verify: which rules were actually loaded, which gates were active, which writes were blocked/allowed, and which verification evidence existed.
  • It could also make regression fixtures easier: same task/context map => same decision boundaries, or at least a diffable reason when they change.

A narrow version could be writ audit-session <session_id> --json or writ export-ledger <session_id> backed by the existing friction/session state. Redact command output by default; include hashes/paths/statuses rather than content unless explicitly requested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions