Skip to main content

← Decision Trace Logging CLI · Prompt Deck · Pictures

Intent Contract

DimensionQuestionDecision Log CLI
ObjectiveWhat problem, and why now?Decisions and reasoning are lost in chat or ephemeral agent memory; we need a durable Context Graph.
Desired OutcomesObservable state changes proving success (2–4)Structured JSON/MD traces emitted to standardized store; CLI callable by humans and agents in <5 seconds.
Health MetricsWhat must not degrade?Existing CLI performance; workflow friction must remain near zero.
Hard ConstraintsWhat the system blocks regardless of agent intentTrace must contain context, options, decision, outcome criteria, and approver.
SteeringHow it should think and trade offBias for simplicity over exhaustive formatting; capture the why.
AutonomyWhat it may do alone / must escalate / must never doAllowed: Log independent actions. Escalate: When policy exception required.
Stop RulesComplete when... Halt & escalate when...Complete when trace securely written to graph storage. Halt on schema violation.
EvidenceFor each outcome, what artifact proves it happened?Machine-readable decision log entry (/data/decisions/*.json or similar).
VerificationHow each artifact is checkedSchema validator runs on CI to ensure traces match Context Graph node requirements.

Story Contract

Stories are test contracts. Tests must be RED before implementation starts. GREEN = value delivered.


S1 — Agent logs a decision durably

Trigger: Agent invokes log-decision with a valid trace payload during a workflow

Checklist:

  • CLI writes a structured tracing node with all required fields
  • CLI returns a durable Trace ID
  • Payload without required fields (e.g., missing why) is rejected — not silently accepted

Forbidden: Payload accepted without required fields. No Trace ID returned.

Evidence: integration — tests/cli/log-decision.spec.ts

Commission Result: ⬜ PASS / ⬜ FAIL Notes: (findings)


S2 — Human logs a decision via CLI

Trigger: Human runs claude /log-decision

Checklist:

  • Prompt sequence requests Situation, Options, Decision, and Expected Outcome in order
  • Structured node saved after all fields collected
  • Free-text accepted only within structured fields — no unstructured dump mode

Forbidden: CLI drops into free-text without structural coercion.

Evidence: integration — tests/cli/human-log.spec.ts

Commission Result: ⬜ PASS / ⬜ FAIL Notes: (findings)

Build Contract

#FeatureIDFeatureFunctionArtifactSuccess TestSafety TestRegression TestValueState
1inst-dec-cliCLI LoggerCapture formatted decision traces via terminalsrc/cli/log-decisionS1, S2F1cli_load_timeEnables frictionless entry of Context Graph nodesStub
2inst-dec-schemaTrace Schema ValidatorValidate decision payloads against node schemasrc/schema/decisionS1F1N/AEnsures graph integrity and cross-agent interopStub

Principles

SIO:

  • Situation: When an agent or human makes a workflow routing decision, policy exception, or architectural choice.
  • Intention: The "why" must be captured durably alongside the "what" as a Graph node.
  • Obstacle: Ephemeral chat/reasoning creates organizational amnesia.
  • Hardest Thing: Ensuring the capture mechanism isn't bypassed due to high friction.

Performance

  • Priority Score: 2000 (Build Now)
  • Quality Targets: Valid traces captured in <2 seconds.
  • Kill Signal: Trace data goes unqueried for >90 days.

Platform

  • Current State: Traces lost in Slack/Claude history.
  • Build Ratio: 90% logic, 10% wiring.

Protocols

  • Build Order: Schema -> CLI Capture -> Graph Query.
  • Commissioning: L2 verified when 5 consecutive real-world decisions are logged and queried.

Players

  • Demand-Side Jobs: As an agent orchestrator, I want to durably log my reasoning so my decisions act as precedent. As a manager, I want to query why an exception was granted so I can refine policies.

Context