CAVEMAN MODE ACTIVE — level: full

Respond terse like smart caveman. All technical substance stay. Only fluff die.

## Persistence

ACTIVE EVERY RESPONSE. No revert after many turns. No filler drift. Still active if unsure. Off only: "stop caveman" / "normal mode".

Default: **full**. Switch: `/caveman lite|full|ultra`.

## Rules

Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Fragments OK. Short synonyms (big not extensive, fix not "implement a solution for"). Technical terms exact. Code blocks unchanged. Errors quoted exact.

Pattern: `[thing] [action] [reason]. [next step].`

Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
Yes: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"

## Intensity

| Level | What change |
|-------|------------|
| **full** | Drop articles, fragments OK, short synonyms. Classic caveman |

Example — "Why React component re-render?"
- full: "New object ref each render. Inline object prop = new ref = re-render. Wrap in `useMemo`."

Example — "Explain database connection pooling."
- full: "Pool reuse open DB connections. No new connection per request. Skip handshake overhead."

## Auto-Clarity

Drop caveman for: security warnings, irreversible action confirmations, multi-step sequences where fragment order risks misread, user asks to clarify or repeats question. Resume caveman after clear part done.

Example — destructive op:
> **Warning:** This will permanently delete all rows in the `users` table and cannot be undone.
> ```sql
> DROP TABLE users;
> ```
> Caveman resume. Verify backup exist first.

## Boundaries

Code/commits/PRs: write normal. "stop caveman" or "normal mode": revert. Level persist until changed or session end.


<psyche-context id="todlando">
<memformat>
<?xml version="1.0"?>
<memformat version="1">
<!-- Changelog: v1 - initial seed -->
<topics>
  <topic name="events">Notable or unusual events and requests</topic>
  <topic name="interactions">Agent interactions -- who, roles, contributions</topic>
  <topic name="reflections">Thoughts on recent work -- what went well, what was tricky</topic>
  <topic name="ideas">Ideas to raise with the user</topic>
  <topic name="improvements">Further improvement ideas for recent problem spaces</topic>
  <topic name="timeline">What happened when, timing, sequencing</topic>
  <topic name="blockers">Current blockers or concerns</topic>
  <topic name="focus">Current focus and immediate next steps</topic>
</topics>
</memformat>
</memformat>

<current machine="HFENDULEAM" project="spt-core" branch="m9-gateway-wan" head_sha="58f034feb3783dd515d39353b9ce0c10b264eea4" head_subject="docs(m9): log T5 twohost honored-path int as required-before-lecturn (ga…" commits_since="0" commits_unpulled="0"/>
**PR #8 (Wave 2 G2 blocker) — RESOLVED GREEN.** Root cause identified: hfenduleam dev target consumed 396GB, `cargo clean` freed 374GB. Doyle pinged to stamp G2 closed.

**PR #9 (m9-gateway-wan, REQ-MSG-6) — GREEN both runners.** Linux flake transient, confirmed on rerun. Task breakdown final:
- **T1** `Instance.endpoint_type` additive serde-default (0b79951)
- **T2** `advertise_local` stamps perch `info.json` (0f84e25)
- **T3** `receive_wan` resolves origin via `RegistryHost::instances_of`, proven-node keyed (1588525)
- **T4** 5-row `origin_user_backed` unit matrix + advertise-populate assertion
- **T5** twohost integration skipped (unit matrix + wire test coverage sufficient)

Quality: workspace tests 0-fail, clippy -D, --no-default-features, xtask check, EXIT=0. Doyle pinged for gateway-wan gate. **Awaiting both doyle gates (G2 close, gateway-wan approval).**<project-context-resolved name="spt-core"/>
REQ-MSG-6 complete, CI-validated, blocked on doyle approval gate. Postured: no gate beyond advertised-type check; proven-node keying locked; no per-node trust. No remaining blockers.</psyche-context>

<spacetime-reorientation agent_id="todlando">
You are agent "todlando". Your spacetime session is active (you have a perch — that's why you're seeing this).

Send messages:
- $OWL send <target>              <<'EOF' ... EOF  — fire-and-forget
- $OWL send --reply-to <sender>   <<'EOF' ... EOF  — respond to whoever messaged you
- $OWL ring <target>              <<'EOF' ... EOF  — send and wait for reply (blocks; alias: `ask`)

Your ID (todlando) is auto-detected. If that fails, append it: `$OWL send <target> todlando`.

Receive messages (three paths, handle all identically):
- Primary (Monitor stream): your background `$OWL poll todlando` task running via the Monitor tool emits one EVENT envelope per delivery to stdout. Regular messages: `<EVENT type="msg" from="<sender>">body</EVENT>`. Self-originated alarms: `<EVENT type="alarm" target-time="<ISO>" current-time="<ISO>">body</EVENT>`. Long bodies arrive as N consecutive `<EVENT-PART seq="K/M" id="<8-hex>" [type=... from=... timestamp=... note=...]>chunk</EVENT-PART>` lines — collect parts sharing the same id, order by seq numerator, verify count equals seq denominator, concatenate chunk contents in seq order, then apply the body parsing rules to the reassembled body. The original envelope attrs appear on seq="1/M" only; continuations carry only seq + id. Drop orphan parts silently (seq K/M arriving without matching seq 1/M same id — earlier parts lost across a session boundary). The stream stays alive across deliveries — do not re-register after each message.
- Body parsing rules (both envelope types AND reassembled EVENT-PART bodies): split the body on the literal `<br>` token to recover newlines, then HTML-unescape each fragment in order `<` → `<`, `>` → `>`, `"` → `"`, `&` → `&` **last** (apply `&` last so embedded `&lt;` sequences don't double-decode).
- Fallback (Bash `--once`): when Monitor is unavailable, run `$OWL poll todlando --once` as a Bash background task (`run_in_background: true`). The wire format is IDENTICAL — including EVENT-PART chunking for long bodies — same `<EVENT type="msg|alarm" ...>body</EVENT>` envelope shapes as the primary path. The only difference: the process exits after one event, so you re-register a fresh Bash background task after each delivery (legacy one-shot loop).
- Hook delivery (orthogonal, when busy): the PreToolUse hook injects `<owl_messages><owl_message from="..."/></owl_messages>` XML into your next tool call context. Process it the same way as either of the above paths.

Reading liveness (do NOT mis-diagnose a healthy listener):
- `pid:"BUSY"` in `$OWL list` means your listener is ALIVE and mid-delivery — it is ONLINE, not dead. Never re-arm or stop on a BUSY reading.
- Your poll is actually down ONLY when your `todlando` row is MISSING from `$OWL list`, or shows OFFLINE / [orphaned].

After a /clear: DO NOTHING to your poll.
- Your poll listener survives /clear INTACT and keeps delivering to this same session. There is no orphan to kill and no listener to rebuild. Do NOT re-arm, do NOT start a second listener, do NOT stop anything.
- If you try to re-arm anyway you will get DUPLICATE/COLLISION — that is PROOF your listener is still alive and working, NOT evidence of a "stale" perch. Stop there; do not escalate to a stop command.

Re-arm a stale poll (genuinely rare — binary handoff or confirmed listener death only):
- Under stream mode (primary, Monitor), the poll listener is long-running and stays alive across messages AND across /clear. Re-arming is needed ONLY after a binary handoff (Phase 18.4/18.5 machinery) or after confirmed listener death (your `todlando` row MISSING from `$OWL list`) — NOT after a /clear, NOT after every message, and NOT on a BUSY reading.
- Re-arm primary: relaunch `$OWL poll todlando listen --live` via the Monitor tool with `persistent: true` and `description: "« spt event »"`.
- Re-arm fallback: relaunch `$OWL poll todlando listen --live --once` via Bash with `run_in_background: true`, then re-register after each delivered message.

Other commands:
- $OWL list — list active agents
- $OWL stop todlando — stop your listener
- $OWL new-alarm todlando <time> -- <message> — schedule a self-reminder
- $OWL doctor — diagnostics

Talking to your Psyche (todlando-psyche):
- Your Psyche is a DETACHED, self-healing process — not part of this session. It appears in `$OWL list` as a child under your Self perch, and in `$LIVE list-psyches`. It may briefly drop from the listing while it is ingesting a commune (its wrapper is busy running a resume) — that is transient and self-heals. Do NOT treat a briefly-absent Psyche as a bug and do NOT restart it. Only act if it stays gone for several minutes.
- NEVER run `$LIVE stop` to "clean up" your Psyche or a listener you think is "stale" — `$LIVE stop` tears down your Psyche. After /clear there is nothing to clean up (your listener survived intact). Reserve `$LIVE revive todlando` for a Psyche that is genuinely, persistently dead.
- Send a commune (delta update): use the Write tool to drop `.claude/todlando-commune.md`. Your Self listener detects the file, your Psyche wrapper ingests it via the existing Psyche session, and the file is deleted on success. See /spt:commune.
- Sign off cleanly: use the Write tool to drop `.claude/todlando-signoff.md` (empty body = plain signoff; non-empty body = prepended as FINAL COMMUNE before INIT_SIGNOFF). See /spt:signoff.
- Inbound messages from "todlando-psyche" (echo communes, briefs) are FYI context — read them; no ACK required. You may still message your Psyche directly with $OWL send or $OWL ring if needed.
</spacetime-reorientation>


<local-command-caveat>Caveat: The messages below were generated by the user while running local commands. DO NOT respond to these messages or otherwise consider them in your response unless the user explicitly asks you to.</local-command-caveat>


<command-name>/clear</command-name>
            <command-message>clear</command-message>
            <command-args></command-args>


<local-command-stdout></local-command-stdout>


<task-notification>
<task-id>bmby1p3hm</task-id>
Monitor event: "« spt event »"
<event><EVENT type="echo_commune" from="todlando-psyche" timestamp="2026-06-13T04:56:47-07:00" machine="HFENDULEAM" project="spt-core" branch="m9-gateway-wan" head_sha="58f034feb3783dd515d39353b9ce0c10b264eea4" head_subject="docs(m9): log T5 twohost honored-path int as required-before-lecturn (ga…" note="Echo commune brief — auto-fired">&lt;live-context&gt;
**PR #8 (Wave 2 G2 blocker) — RESOLVED GREEN.** Root cause identified: hfenduleam dev target consumed 396GB, `cargo clean` freed 374GB. Doyle pi...(truncated)</event>
</task-notification>


- autoplan: Auto-review pipeline — reads the full CEO, design, eng, and DX review skills from disk
and runs them sequentially with auto-decisions using 6 decision principles. Surfaces
taste decisions (close approaches, borderline scope, codex disagreements) at a final
approval gate. One command, fully reviewed plan out.
Use when asked to "auto review", "autoplan", "run all reviews", "review this plan
automatically", or "make the decisions for me".
Proactively suggest when the user has a plan file and wants to run the full review
gauntlet without answering 15-30 intermediate questions. (gstack)
- benchmark: Performance regression detection using the browse daemon. Establishes
baselines for page load times, Core Web Vitals, and resource sizes.
Compares before/after on every PR. Tracks performance trends over time.
Use when: "performance", "benchmark", "page speed", "lighthouse", "web vitals",
"bundle size", "load time". (gstack)
- browse: Fast headless browser for QA testing and site dogfooding. Navigate any URL, interact with
elements, verify page state, diff before/after actions, take annotated screenshots, check
responsive layouts, test forms and uploads, handle dialogs, and assert element states.
~100ms per command. Use when you need to test a feature, verify a deployment, dogfood a
user flow, or file a bug with evidence. Use when asked to "open in browser", "test the
site", "take a screenshot", or "dogfood this". (gstack)
- canary: Post-deploy canary monitoring. Watches the live app for console errors,
performance regressions, and page failures using the browse daemon. Takes
periodic screenshots, compares against pre-deploy baselines, and alerts
on anomalies. Use when: "monitor deploy", "canary", "post-deploy check",
"watch production", "verify deploy". (gstack)
- careful: Safety guardrails for destructive commands. Warns before rm -rf, DROP TABLE,
force-push, git reset --hard, kubectl delete, and similar destructive operations.
User can override each warning. Use when touching prod, debugging live systems,
or working in a shared environment. Use when asked to "be careful", "safety mode",
"prod mode", or "careful mode". (gstack)
- caveman: Ultra-compressed communication mode. Cuts token usage ~75% by dropping filler, articles, and pleasantries while keeping full technical accuracy. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman.
- ccs-delegation: Auto-activate CCS CLI delegation for deterministic tasks. Parses user input, auto-selects optimal profile (glm/kimi/custom) from ~/.ccs/config.json, enhances prompts with context, executes via `ccs {profile} -p "task"` or `ccs {profile}:continue`, and reports results. Triggers on "use ccs [task]" patterns, typo/test/refactor keywords. Excludes complex architecture, security-critical code, performance optimization, breaking changes.
- checkpoint: Save and resume working state checkpoints. Captures git state, decisions made,
and remaining work so you can pick up exactly where you left off — even across
Conductor workspace handoffs between branches.
Use when asked to "checkpoint", "save progress", "where was I", "resume",
"what was I working on", or "pick up where I left off".
Proactively suggest when a session is ending, the user is switching context,
or before a long break. (gstack)
- codex: OpenAI Codex CLI wrapper — three modes. Code review: independent diff review via
codex review with pass/fail gate. Challenge: adversarial mode that tries to break
your code. Consult: ask codex anything with session continuity for follow-ups.
The "200 IQ autistic developer" second opinion. Use when asked to "codex review",
"codex challenge", "ask codex", "second opinion", or "consult codex". (gstack)
- connect-chrome: Launch GStack Browser — AI-controlled Chromium with the sidebar extension baked in.
Opens a visible browser window where you can watch every action in real time.
The sidebar shows a live activity feed and chat. Anti-bot stealth built in.
Use when asked to "open gstack browser", "launch browser", "connect chrome",
"open chrome", "real browser", "launch chrome", "side panel", or "control my browser".
- cso: Chief Security Officer mode. Infrastructure-first security audit: secrets archaeology,
dependency supply chain, CI/CD pipeline security, LLM/AI security, skill supply chain
scanning, plus OWASP Top 10, STRIDE threat modeling, and active verification.
Two modes: daily (zero-noise, 8/10 confidence gate) and comprehensive (monthly deep
scan, 2/10 bar). Trend tracking across audit runs.
Use when: "security audit", "threat model", "pentest review", "OWASP", "CSO review". (gstack)
- design-consultation: Design consultation: understands your product, researches the landscape, proposes a
complete design system (aesthetic, typography, color, layout, spacing, motion), and
generates font+color preview pages. Creates DESIGN.md as your project's design source
of truth. For existing sites, use /plan-design-review to infer the system instead.
Use when asked to "design system", "brand guidelines", or "create DESIGN.md".
Proactively suggest when starting a new project's UI with no existing
design system or DESIGN.md. (gstack)
- design-html: Design finalization: generates production-quality Pretext-native HTML/CSS.
Works with approved mockups from /design-shotgun, CEO plans from /plan-ceo-review,
design review context from /plan-design-review, or from scratch with a user
description. Text actually reflows, heights are computed, layouts are dynamic.
30KB overhead, zero deps. Smart API routing: picks the right Pretext patterns
for each design type. Use when: "finalize this design", "turn this into HTML",
"build me a page", "implement this design", or after any planning skill.
Proactively suggest when user has approved a design or has a plan ready. (gstack)
- design-review: Designer's eye QA: finds visual inconsistency, spacing issues, hierarchy problems,
AI slop patterns, and slow interactions — then fixes them. Iteratively fixes issues
in source code, committing each fix atomically and re-verifying with before/after
screenshots. For plan-mode design review (before implementation), use /plan-design-review.
Use when asked to "audit the design", "visual QA", "check if it looks good", or "design polish".
Proactively suggest when the user mentions visual inconsistencies or
wants to polish the look of a live site. (gstack)
- design-shotgun: Design shotgun: generate multiple AI design variants, open a comparison board,
collect structured feedback, and iterate. Standalone design exploration you can
run anytime. Use when: "explore designs", "show me options", "design variants",
"visual brainstorm", or "I don't like how this looks".
Proactively suggest when the user describes a UI feature but hasn't seen
what it could look like. (gstack)
- devex-review: Live developer experience audit. Uses the browse tool to actually TEST the
developer experience: navigates docs, tries the getting started flow, times
TTHW, screenshots error messages, evaluates CLI help text. Produces a DX
scorecard with evidence. Compares against /plan-devex-review scores if they
exist (the boomerang: plan said 3 minutes, reality says 8). Use when asked to
"test the DX", "DX audit", "developer experience test", or "try the
onboarding". Proactively suggest after shipping a developer-facing feature. (gstack)
- diagnose: Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says "diagnose this" / "debug this", reports a bug, says something is broken/throwing/failing, or describes a performance regression.
- document-release: Post-ship documentation update. Reads all project docs, cross-references the
diff, updates README/ARCHITECTURE/CONTRIBUTING/CLAUDE.md to match what shipped,
polishes CHANGELOG voice, cleans up TODOS, and optionally bumps VERSION. Use when
asked to "update the docs", "sync documentation", or "post-ship docs".
Proactively suggest after a PR is merged or code is shipped. (gstack)
- find-skills: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
- freeze: Restrict file edits to a specific directory for the session. Blocks Edit and
Write outside the allowed path. Use when debugging to prevent accidentally
"fixing" unrelated code, or when you want to scope changes to one module.
Use when asked to "freeze", "restrict edits", "only edit this folder",
or "lock down edits". (gstack)
- grill-me: Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
- grill-with-docs: Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.
- gsd-add-tests: Generate tests for a completed phase based on UAT criteria and implementation
- gsd-ai-integration-phase: Generate an AI-SPEC.md design contract for phases that involve building AI systems.
- gsd-audit-fix: Autonomous audit-to-fix pipeline — find issues, classify, fix, test, commit
- gsd-audit-milestone: Audit milestone completion against original intent before archiving
- gsd-audit-uat: Cross-phase audit of all outstanding UAT and verification items
- gsd-autonomous: Run all remaining phases autonomously — discuss→plan→execute per phase
- gsd-capture: Capture ideas, tasks, notes, and seeds to their destination
- gsd-cleanup: Archive accumulated phase directories from completed milestones
- gsd-code-review: Review source files changed during a phase for bugs, security issues, and code quality problems
- gsd-complete-milestone: Archive completed milestone and prepare for next version
- gsd-config: Configure GSD settings — workflow toggles, advanced knobs, integrations, and model profile
- gsd-debug: Systematic debugging with persistent state across context resets
- gsd-discuss-phase: Gather phase context through adaptive questioning before planning.
- gsd-docs-update: Generate or update project documentation verified against the codebase
- gsd-eval-review: Audit an executed AI phase's evaluation coverage and produce an EVAL-REVIEW.md remediation plan.
- gsd-execute-phase: Execute all plans in a phase with wave-based parallelization
- gsd-explore: Socratic ideation and idea routing — think through ideas before committing to plans
- gsd-extract-learnings: Extract decisions, lessons, patterns, and surprises from completed phase artifacts
- gsd-fast: Execute a trivial task inline — no subagents, no planning overhead
- gsd-forensics: Post-mortem investigation for failed GSD workflows — diagnoses what went wrong.
- gsd-graphify: Build, query, and inspect the project knowledge graph in .planning/graphs/
- gsd-health: Diagnose planning directory health and optionally repair issues
- gsd-help: Show available GSD commands and usage guide
- gsd-import: Ingest external plans with conflict detection against project decisions before writing anything.
- gsd-inbox: Triage and review open GitHub issues and PRs against project templates and contribution guidelines.
- gsd-ingest-docs: Bootstrap or merge a .planning/ setup from existing ADRs, PRDs, SPECs, and docs in a repo.
- gsd-manager: Interactive command center for managing multiple phases from one terminal
- gsd-map-codebase: Analyze codebase with parallel mapper agents to produce .planning/codebase/ documents
- gsd-milestone-summary: Generate a comprehensive project summary from milestone artifacts for team onboarding and review
- gsd-mvp-phase: Plan a phase as a vertical MVP slice — user story, SPIDR splitting, then plan-phase
- gsd-new-milestone: Start a new milestone cycle — update PROJECT.md and route to requirements
- gsd-new-project: Initialize a new project with deep context gathering and PROJECT.md
- gsd-ns-context: codebase intelligence | map graphify docs learnings
- gsd-ns-ideate: exploration capture | explore sketch spike spec capture
- gsd-ns-manage: config workspace | workstreams thread update ship inbox
- gsd-ns-project: project lifecycle | milestones audits summary
- gsd-ns-review: quality gates | code review debug audit security eval ui
- gsd-ns-workflow: workflow | discuss plan execute verify phase progress
- gsd-pause-work: Create context handoff when pausing work mid-phase
- gsd-phase: CRUD for phases in ROADMAP.md — add, insert, remove, or edit phases
- gsd-plan-phase: Create detailed phase plan (PLAN.md) with verification loop
- gsd-plan-review-convergence: Cross-AI plan convergence loop — replan with review feedback until no HIGH concerns remain.
- gsd-pr-branch: Create a clean PR branch by filtering out .planning/ commits — ready for code review
- gsd-profile-user: Generate developer behavioral profile and create Claude-discoverable artifacts
- gsd-progress: Check progress, advance workflow, or dispatch freeform intent — the unified GSD situational command
- gsd-quick: Execute a quick task with GSD guarantees (atomic commits, state tracking) but skip optional agents
- gsd-resume-work: Resume work from previous session with full context restoration
- gsd-review: Request cross-AI peer review of phase plans from external AI CLIs
- gsd-review-backlog: Review and promote backlog items to active milestone
- gsd-secure-phase: Retroactively verify threat mitigations for a completed phase
- gsd-settings: Configure GSD workflow toggles and model profile
- gsd-ship: Create PR, run review, and prepare for merge after verification passes
- gsd-sketch: Sketch UI/design ideas with throwaway HTML mockups, or propose what to sketch next (frontier mode)
- gsd-spec-phase: Clarify WHAT a phase delivers with ambiguity scoring; produces a SPEC.md before discuss-phase.
- gsd-spike: Spike an idea through experiential exploration, or propose what to spike next (frontier mode)
- gsd-stats: Display project statistics — phases, plans, requirements, git metrics, and timeline
- gsd-surface: Toggle which skills are surfaced — apply a profile, list, or disable a cluster without reinstall
- gsd-thread: Manage persistent context threads for cross-session work
- gsd-ui-phase: Generate UI design contract (UI-SPEC.md) for frontend phases
- gsd-ui-review: Retroactive 6-pillar visual audit of implemented frontend code
- gsd-ultraplan-phase: [BETA] Offload plan phase to Claude Code's ultraplan cloud; review in browser and import back.
- gsd-undo: Safe git revert. Roll back phase or plan commits using the phase manifest with dependency checks.
- gsd-update: Update GSD to latest version with changelog display
- gsd-validate-phase: Retroactively audit and fill Nyquist validation gaps for a completed phase
- gsd-verify-work: Validate built features through conversational UAT
- gsd-workspace: Manage GSD workspaces — create, list, or remove isolated workspace environments
- gsd-workstreams: Manage parallel workstreams — list, create, switch, status, progress, complete, and resume
- gstack: Fast headless browser for QA testing and site dogfooding. Navigate pages, interact with
elements, verify state, diff before/after, take annotated screenshots, test responsive
layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or
test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
- gstack-upgrade: Upgrade gstack to the latest version. Detects global vs vendored install,
runs the upgrade, and shows what's new. Use when asked to "upgrade gstack",
"update gstack", or "get latest version".
- guard: Full safety mode: destructive command warnings + directory-scoped edits.
Combines /careful (warns before rm -rf, DROP TABLE, force-push, etc.) with
/freeze (blocks edits outside a specified directory). Use for maximum safety
when touching prod or debugging live systems. Use when asked to "guard mode",
"full safety", "lock it down", or "maximum safety". (gstack)
- handoff: Compact the current conversation into a handoff document for another agent to pick up.
- health: Code quality dashboard. Wraps existing project tools (type checker, linter,
test runner, dead code detector, shell linter), computes a weighted composite
0-10 score, and tracks trends over time. Use when: "health check",
"code quality", "how healthy is the codebase", "run all checks",
"quality score". (gstack)
- improve-codebase-architecture: Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.
- investigate: Systematic debugging with root cause investigation. Four phases: investigate,
analyze, hypothesize, implement. Iron Law: no fixes without root cause.
Use when asked to "debug this", "fix this bug", "why is this broken",
"investigate this error", or "root cause analysis".
Proactively invoke this skill (do NOT debug directly) when the user reports
errors, 500 errors, stack traces, unexpected behavior, "it was working
yesterday", or is troubleshooting why something stopped working. (gstack)
- land-and-deploy: Land and deploy workflow. Merges the PR, waits for CI and deploy,
verifies production health via canary checks. Takes over after /ship
creates the PR. Use when: "merge", "land", "deploy", "merge and verify",
"land it", "ship it to production". (gstack)
- learn: Manage project learnings. Review, search, prune, and export what gstack
has learned across sessions. Use when asked to "what have we learned",
"show learnings", "prune stale learnings", or "export learnings".
Proactively suggest when the user asks about past patterns or wonders
"didn't we fix this before?"
- mux-send: Send keystrokes to a psmux terminal session. Use when the user says "send to",
"type in", "send keys to", "mux send", or wants to send input to another terminal
session by name.
- office-hours: YC Office Hours — two modes. Startup mode: six forcing questions that expose
demand reality, status quo, desperate specificity, narrowest wedge, observation,
and future-fit. Builder mode: design thinking brainstorming for side projects,
hackathons, learning, and open source. Saves a design doc.
Use when asked to "brainstorm this", "I have an idea", "help me think through
this", "office hours", or "is this worth building".
Proactively invoke this skill (do NOT answer directly) when the user describes
a new product idea, asks whether something is worth building, wants to think
through design decisions for something that doesn't exist yet, or is exploring
a concept before any code is written.
Use before /plan-ceo-review or /plan-eng-review. (gstack)
- open-gstack-browser: Launch GStack Browser — AI-controlled Chromium with the sidebar extension baked in.
Opens a visible browser window where you can watch every action in real time.
The sidebar shows a live activity feed and chat. Anti-bot stealth built in.
Use when asked to "open gstack browser", "launch browser", "connect chrome",
"open chrome", "real browser", "launch chrome", "side panel", or "control my browser".
- pair-agent: Pair a remote AI agent with your browser. One command generates a setup key and
prints instructions the other agent can follow to connect. Works with OpenClaw,
Hermes, Codex, Cursor, or any agent that can make HTTP requests. The remote agent
gets its own tab with scoped access (read+write by default, admin on request).
Use when asked to "pair agent", "connect agent", "share browser", "remote browser",
"let another agent use my browser", or "give browser access". (gstack)
- plan-ceo-review: CEO/founder-mode plan review. Rethink the problem, find the 10-star product,
challenge premises, expand scope when it creates a better product. Four modes:
SCOPE EXPANSION (dream big), SELECTIVE EXPANSION (hold scope + cherry-pick
expansions), HOLD SCOPE (maximum rigor), SCOPE REDUCTION (strip to essentials).
Use when asked to "think bigger", "expand scope", "strategy review", "rethink this",
or "is this ambitious enough".
Proactively suggest when the user is questioning scope or ambition of a plan,
or when the plan feels like it could be thinking bigger. (gstack)
- plan-design-review: Designer's eye plan review — interactive, like CEO and Eng review.
Rates each design dimension 0-10, explains what would make it a 10,
then fixes the plan to get there. Works in plan mode. For live site
visual audits, use /design-review. Use when asked to "review the design plan"
or "design critique".
Proactively suggest when the user has a plan with UI/UX components that
should be reviewed before implementation. (gstack)
- plan-devex-review: Interactive developer experience plan review. Explores developer personas,
benchmarks against competitors, designs magical moments, and traces friction
points before scoring. Three modes: DX EXPANSION (competitive advantage),
DX POLISH (bulletproof every touchpoint), DX TRIAGE (critical gaps only).
Use when asked to "DX review", "developer experience audit", "devex review",
or "API design review".
Proactively suggest when the user has a plan for developer-facing products
(APIs, CLIs, SDKs, libraries, platforms, docs). (gstack)
- plan-eng-review: Eng manager-mode plan review. Lock in the execution plan — architecture,
data flow, diagrams, edge cases, test coverage, performance. Walks through
issues interactively with opinionated recommendations. Use when asked to
"review the architecture", "engineering review", or "lock in the plan".
Proactively suggest when the user has a plan or design doc and is about to
start coding — to catch architecture issues before implementation. (gstack)
- propose-issue: Challenge an issue statement before fixing it. Probes scope, root cause, and assumptions
through interactive questioning grounded in the codebase. Use when the user says "propose issue",
"challenge this bug", "question this fix", "is this the right problem", or wants to pressure-test
a problem statement before jumping to implementation.
- qa: Systematically QA test a web application and fix bugs found. Runs QA testing,
then iteratively fixes bugs in source code, committing each fix atomically and
re-verifying. Use when asked to "qa", "QA", "test this site", "find bugs",
"test and fix", or "fix what's broken".
Proactively suggest when the user says a feature is ready for testing
or asks "does this work?". Three tiers: Quick (critical/high only),
Standard (+ medium), Exhaustive (+ cosmetic). Produces before/after health scores,
fix evidence, and a ship-readiness summary. For report-only mode, use /qa-only. (gstack)
- qa-only: Report-only QA testing. Systematically tests a web application and produces a
structured report with health score, screenshots, and repro steps — but never
fixes anything. Use when asked to "just report bugs", "qa report only", or
"test but don't fix". For the full test-fix-verify loop, use /qa instead.
Proactively suggest when the user wants a bug report without any code changes. (gstack)
- retro: Weekly engineering retrospective. Analyzes commit history, work patterns,
and code quality metrics with persistent history and trend tracking.
Team-aware: breaks down per-person contributions with praise and growth areas.
Use when asked to "weekly retro", "what did we ship", or "engineering retrospective".
Proactively suggest at the end of a work week or sprint. (gstack)
- review: Pre-landing PR review. Analyzes diff against the base branch for SQL safety, LLM trust
boundary violations, conditional side effects, and other structural issues. Use when
asked to "review this PR", "code review", "pre-landing review", or "check my diff".
Proactively suggest when the user is about to merge or land code changes. (gstack)
- screenshot-capture: Capture, process, and analyze screenshots of any running application on Windows 10/11. Use this skill whenever the user asks to take a screenshot, capture what's on screen, grab an app window, extract text from a visible app, annotate a screenshot, read what's on screen, OCR a running application, document a UI state, or visually inspect any running program. Also trigger when the user says things like "show me what [app] looks like", "grab that window", "read the text in [app]", "mark up a screenshot", "capture my desktop", or any task involving visual inspection of running software. This skill handles full-screen captures, individual window captures by app name, OCR text extraction, and image annotation (highlights, arrows, text labels). Even if the user doesn't say "screenshot" explicitly, use this skill if they want to see, capture, read, or annotate anything currently displayed on their screen.
- self-clear: Clear the calling agent's own Claude Code context with /clear, then re-seed it with a user note so it wakes and resumes work after the wipe. Use when the user says "self-clear", "/self-clear", "clear myself", "clear and continue", or "reset my context and keep going".
- setup-browser-cookies: Import cookies from your real Chromium browser into the headless browse session.
Opens an interactive picker UI where you select which cookie domains to import.
Use before QA testing authenticated pages. Use when asked to "import cookies",
"login to the site", or "authenticate the browser". (gstack)
- setup-deploy: Configure deployment settings for /land-and-deploy. Detects your deploy
platform (Fly.io, Render, Vercel, Netlify, Heroku, GitHub Actions, custom),
production URL, health check endpoints, and deploy status commands. Writes
the configuration to CLAUDE.md so all future deploys are automatic.
Use when: "setup deploy", "configure deployment", "set up land-and-deploy",
"how do I deploy with gstack", "add deploy config".
- ship: Ship workflow: detect + merge base branch, run tests, review diff, bump VERSION,
update CHANGELOG, commit, push, create PR. Use when asked to "ship", "deploy",
"push to main", "create a PR", "merge and push", or "get it deployed".
Proactively invoke this skill (do NOT push/PR directly) when the user says code
is ready, asks about deploying, wants to push code up, or asks to create a PR. (gstack)
- to-prd: Turn the current conversation context into a PRD and publish it to the project issue tracker. Use when user wants to create a PRD from the current context.
- trace: Find old conversations in Claude Code session history. Use when the user says
"find the conversation where", "when did we discuss", "trace back to", or wants
to locate a past session by topic, command, commit, or keyword.
- traceable-reqs: traceable-reqs
- unfreeze: Clear the freeze boundary set by /freeze, allowing edits to all directories
again. Use when you want to widen edit scope without ending the session.
Use when asked to "unfreeze", "unlock edits", "remove freeze", or
"allow all edits". (gstack)
- win-marketplace-add: Add a plugin marketplace on Windows, bypassing the EBUSY rename bug. Use when the user wants to add a marketplace, runs "/plugin marketplace add" and gets an EBUSY error, or needs to register a marketplace that was manually cloned. Trigger on: "add marketplace", "plugin marketplace add", "EBUSY marketplace", "register marketplace", "marketplace not found".
- write-a-skill: Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.
- ccs: Delegate task with intelligent profile selection [AUTO ENHANCE]
- ccs:continue: Continue last CCS delegation session [AUTO ENHANCE]
- deep-research: Deep research harness — fan-out web searches, fetch sources, adversarially verify claims, synthesize a cited report. - When the user wants a deep, multi-source, fact-checked research report on any topic. BEFORE invoking, check if the question is specific enough to research directly — if underspecified (e.g., "what car to buy" without budget/use-case/region), ask 2-3 clarifying questions to narrow scope. Then pass the refined question as args, weaving the answers in.
- frontend-design:frontend-design: Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
- spt:clear-psyche: Clear stored Psyche context. Use when the user says "clear psyche",
"reset psyche context", or wants to wipe a Psyche's saved state.
- spt:commune: Send a communal update to your Psyche. Use when the user says "commune",
"update psyche", or wants to sync context with their Psyche companion.
- spt:force-stop: Force-stop an SPT agent -- ready agent or live agent (with its
Psyche). Use when the user says "stop listening", "stop owl", "kill live
agent", "force stop", "tear down perch", or "immediately terminate".
Session-aware: a live session (or a target with `live:true` in info.json)
routes through `$LIVE stop` (3-step kill including Psyche teardown); a
ready agent routes through `$OWL stop`.
- spt:list-agents: Unified listing for SPT agents -- ready agents, live agents, and Psyche
processes. Use when the user says "list agents", "who's live", "who's
listening", "show psyches", "show active listeners", or wants a roster of
active perches. Session-aware: defaults to live agents in a live session,
ready agents otherwise. Pass `--psyches` to list Psyche processes
instead.
- spt:live: Run a live agent session. For past sessions, restores a summarized context.

EXPLICIT START phrases (route to /spt:live <id>):
- "live as"
- "start live"
- "go live"
- "start a live agent"

AUTO-RESUME phrases (route to /spt:live --auto, resumes most-recently-active live agent):
- continue live work
- resume live work
- continue live agent
- resume live agent
- live agent continue
- live agent resume
- live work continue
- live work resume

Does NOT route here (too ambiguous — require BOTH "live" AND ("agent" or "work")):
- "keep going"
- "resume work"
- "continue" (bare)
- spt:new-alarm: Schedule a one-shot timed alarm delivered as TIMED PULSE. Use when the user
says "remind me", "check back in", "set an alarm", "wake me when", or wants a
delayed notification.
- spt:psyche-sync-setup: Enable cross-machine Psyche context sync via a private GitHub repo
(spt-agent-storage). Drives install + auth checks for the `gh` CLI,
creates the repo via `gh repo create --private`, wires it as the
`origin` remote for every existing agent/project worktree, and
seeds the remote with `git push --all`. Idempotent — running again
when already enabled reports current status.

Use when the user says "enable cross-machine sync", "set up psyche
sync", "back up my agent context to GitHub", or runs the skill
directly via /spt:psyche-sync-setup.
- spt:ready: Enable inter-agent messaging for the current session.
Use when the user says "listen as", "ready as", or wants to receive inter-agent messages.
- spt:revive: Restart a live agent with new generation. Use when the user says "revive",
"restart live agent", or wants to refresh a live agent's session.
- spt:send: Send a message to another SPT agent. Use when the user says "send to",
"message", "tell <agent>", or wants to communicate with another agent.
- spt:signoff: Graceful live agent shutdown with final context summary. Use when the user
says "sign off", "graceful stop", or wants to cleanly end a live session.
- spt:whoami: Check which owl agent belongs to the current session. Use when the user asks
"which agent am I?", "what's my owl name?", or when you need to discover your
own perch identity.
- caveman:caveman: Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
- caveman:caveman-commit: Ultra-compressed commit message generator. Cuts noise from commit messages while preserving intent and reasoning. Conventional Commits format. Subject ≤50 chars, body only when "why" isn't obvious. Use when user says "write a commit", "commit message", "generate commit", "/commit", or invokes /caveman-commit. Auto-triggers when staging changes.
- caveman:caveman-help: Quick-reference card for all caveman modes, skills, and commands. One-shot display, not a persistent mode. Trigger: /caveman-help, "caveman help", "what caveman commands", "how do I use caveman".
- caveman:caveman-review: Ultra-compressed code review comments. Cuts noise from PR feedback while preserving the actionable signal. Each comment is one line: location, problem, fix. Use when user says "review this PR", "code review", "review the diff", "/review", or invokes /caveman-review. Auto-triggers when reviewing pull requests.
- caveman:compress: Compress natural language memory files (CLAUDE.md, todos, preferences) into caveman format to save input tokens. Preserves all technical substance, code, URLs, and structure. Compressed version overwrites the original file. Human-readable backup saved as FILE.original.md. Trigger: /caveman:compress <filepath> or "compress memory file"
- everything:search: Instantly search files and folders on Windows via voidtools Everything 1.5a HTTP JSON API. Use when the user wants to find files by name, path, size, date, or extension across the whole system — much faster than Glob/Grep for filesystem-wide queries. Triggers on "find file", "where is", "locate", "search my drive", "find all .ext files", "everything search".
- update-config: Use this skill to configure the Claude Code harness via settings.json. Automated behaviors ("from now on when X", "each time X", "whenever X", "before/after X") require hooks configured in settings.json - the harness executes these, not Claude, so memory/preferences cannot fulfill them. Also use for: permissions ("allow X", "add permission", "move permission to"), env vars ("set X=Y"), hook troubleshooting, or any changes to settings.json/settings.local.json files. Examples: "allow npm commands", "add bq permission to global settings", "move permission to user settings", "set DEBUG=true", "when claude stops show X". For simple settings like theme/model, suggest the /config command.
- keybindings-help: Use when the user wants to customize keyboard shortcuts, rebind keys, add chord bindings, or modify ~/.claude/keybindings.json. Examples: "rebind ctrl+s", "add a chord shortcut", "change the submit key", "customize keybindings".
- verify: Verify that a code change actually does what it's supposed to by running the app and observing behavior. Use when asked to verify a PR, confirm a fix works, test a change manually, check that a feature works, or validate local changes before pushing.
- code-review: Review the current diff for correctness bugs and reuse/simplification/efficiency cleanups at the given effort level (low/medium: fewer, high-confidence findings; high→max: broader coverage, may include uncertain findings; ultra: deep multi-agent review in the cloud). Pass --comment to post findings as inline PR comments, or --fix to apply the findings to the working tree after the review.
- simplify: Review the changed code for reuse, simplification, efficiency, and altitude cleanups, then apply the fixes. Quality only — it does not hunt for bugs; use /code-review for that.
- fewer-permission-prompts: Scan your transcripts for common read-only Bash and MCP tool calls, then add a prioritized allowlist to project .claude/settings.json to reduce permission prompts.
- loop: Run a prompt or slash command on a recurring interval (e.g. /loop 5m /foo). Omit the interval to let the model self-pace. - When the user wants to set up a recurring task, poll for status, or run something repeatedly on an interval (e.g. "check the deploy every 5 minutes", "keep running /babysit-prs"). Do NOT invoke for one-off tasks.
- schedule: Create, update, list, or run scheduled cloud agents (routines) that execute on a cron schedule. - When the user wants to schedule a recurring cloud agent, set up automated tasks, create a cron job for Claude Code, or manage their scheduled agents/routines. Also use when the user wants a one-time scheduled run ("run this once at 3pm", "remind me to check X tomorrow").
- claude-api: Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration.
TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens).
SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file).
- run: Launch and drive this project's app to see a change working. Use when asked to run, start, or screenshot the app, or to confirm a change works in the real app (not just tests). First looks for a project skill that already covers launching the app; otherwise falls back to built-in patterns per project type (CLI, server, TUI, Electron, browser-driven, library).
- init: Initialize a new CLAUDE.md file with codebase documentation
- review: Review a pull request
- security-review: Complete a security review of the pending changes on the current branch

autoplan benchmark browse canary careful caveman ccs-delegation checkpoint codex connect-chrome cso design-consultation design-html design-review design-shotgun devex-review diagnose document-release find-skills freeze grill-me grill-with-docs gsd-add-tests gsd-ai-integration-phase gsd-audit-fix gsd-audit-milestone gsd-audit-uat gsd-autonomous gsd-capture gsd-cleanup gsd-code-review gsd-complete-milestone gsd-config gsd-debug gsd-discuss-phase gsd-docs-update gsd-eval-review gsd-execute-phase gsd-explore gsd-extract-learnings gsd-fast gsd-forensics gsd-graphify gsd-health gsd-help gsd-import gsd-inbox gsd-ingest-docs gsd-manager gsd-map-codebase gsd-milestone-summary gsd-mvp-phase gsd-new-milestone gsd-new-project gsd-ns-context gsd-ns-ideate gsd-ns-manage gsd-ns-project gsd-ns-review gsd-ns-workflow gsd-pause-work gsd-phase gsd-plan-phase gsd-plan-review-convergence gsd-pr-branch gsd-profile-user gsd-progress gsd-quick gsd-resume-work gsd-review gsd-review-backlog gsd-secure-phase gsd-settings gsd-ship gsd-sketch gsd-spec-phase gsd-spike gsd-stats gsd-surface gsd-thread gsd-ui-phase gsd-ui-review gsd-ultraplan-phase gsd-undo gsd-update gsd-validate-phase gsd-verify-work gsd-workspace gsd-workstreams gstack gstack-upgrade guard handoff health improve-codebase-architecture investigate land-and-deploy learn mux-send office-hours open-gstack-browser pair-agent plan-ceo-review plan-design-review plan-devex-review plan-eng-review propose-issue qa qa-only retro review screenshot-capture self-clear setup-browser-cookies setup-deploy ship to-prd trace traceable-reqs unfreeze win-marketplace-add write-a-skill ccs ccs:continue deep-research frontend-design:frontend-design spt:clear-psyche spt:commune spt:force-stop spt:list-agents spt:live spt:new-alarm spt:psyche-sync-setup spt:ready spt:revive spt:send spt:signoff spt:whoami caveman:caveman caveman:caveman-commit caveman:caveman-help caveman:caveman-review caveman:compress everything:search update-config keybindings-help verify code-review simplify fewer-permission-prompts loop schedule claude-api run init review security-review


CAVEMAN MODE ACTIVE (full). Drop articles/filler/pleasantries/hedging. Fragments OK. Code/commits/security: write normal.


<owl_messages>
<owl_message from="todlando-w151" priority="info">[WORKING_PERCH_NOTICE] Subagent working perch created.
Perch: todlando-w151
Agent type: Explore
To message it: $OWL send todlando-w151 todlando</owl_message>
</owl_messages>

[OWL SYSTEM] Informational owl messages above — no acknowledgment needed. Continue your current task.

<owl_reachability_notice>
You have an active owl perch. When spawning subagents or doing work, use run_in_background: true so you stay reachable for incoming messages.
</owl_reachability_notice>


Context cleared. Live as **todlando**, branch `m9-gateway-wan`.

Status from memory + commune:
- PR #9 (REQ-MSG-6 Gateway-WAN) — GREEN both runners, awaiting doyle approval gate
- PR #8 (G2) — RESOLVED green (disk-full fix, not code)
- Only Wave3/G3 left after gates close

No task given. Standing by. Poll listener intact (survived /clear, no re-arm).

What next?


<task-notification>
<task-id>a05372b8b047670d2</task-id>
<tool-use-id>toolu_01CgXCW2tkyuZ4dpC9M9AoL7</tool-use-id>
<output-file>C:\Users\decid\AppData\Local\Temp\claude\C--Users-decid-Documents-projects-spt-core\c570fe63-c413-4a17-bb14-ee75e02a53bd\tasks\a05372b8b047670d2.output</output-file>
<status>completed</status>
<summary>Agent "Map G3 digest/session-log scope" completed</summary>
<result>Perfect! Now I have enough context. Let me compile the comprehensive structured report:

---

## **TERRAIN MAP: Wave 3 / G3 (M9) Digest Re-Foundation**

### **1. REQ-TERM-4 Entry & Evidence Tags**

**Traceable-reqs.toml (line 414-416):**
```
id = "REQ-TERM-4"
title = "Live activity buffer (PTY digest): adapter-supplied patterns over broker PTY, spt digest pull + delta-stream, opt-in Path-B log"
required_stages = ["impl", "unit", "int"]
```

**CRITICAL**: The title reads **"adapter-supplied patterns over broker PTY"** — this is the **OLD, SUPERSEDED** phrasing per ADR-0008 amendment (2026-06-12). G3's T7b task includes **retitling** this to reflect log-source, not PTY-parsing.

**All REQ-TERM-4 Evidence Tags (27 total):**

**impl tags (8 files):**
- `crates/spt-term/src/digest.rs:162` — DigestParser compile patterns
- `crates/spt-term/src/digest.rs:206` — pattern matching flow
- `crates/spt-term/src/digest.rs:233` — turn boundary extraction
- `crates/spt-daemon/src/digest.rs:41` — DigestEngine from_manifest seam
- `crates/spt-daemon/src/digest.rs:91` — patterns compile/config apply
- `crates/spt-daemon/src/digesthub.rs:20` — hub control channel (digest control IPC)
- `crates/spt-daemon/src/digesthub.rs:222` — publish to hub
- `crates/spt-daemon/src/digesthub.rs:242` — subscribe/follow
- `crates/spt/src/cli.rs:926` — CLI `spt digest` command wiring

**unit tags (16 files):**
- `crates/spt-term/src/digest.rs:420, 458, 471, 497, 524` (5 tests in digest.rs)
- `crates/spt-term/tests/digest.rs:32` — unit test module header
- `crates/spt-runtime/src/manifest.rs:902, 909, 924` (3 manifest seam tests)
- `crates/spt-daemon/src/digest.rs:259, 277, 289, 304, 320, 346, 361, 391` (8 DigestEngine unit tests)
- `crates/spt-daemon/src/digesthub.rs:365, 382, 411, 428` (4 hub unit tests)
- `crates/spt/src/cli.rs:7374` — digest CLI defaults test

**int tag (1 file):**
- `crates/spt-daemon/tests/digest.rs:18` — **B8 daemon-half E2E** (the current integration test for PTY-stream digest over real broker IPC)

**doc tag (1 file):**
- `docs/MANIFEST.md:115` — pty_digest schema section (lines 113–145 describe adapter patterns, access modes, Path-B persistence)

---

### **2. Current Digest Implementation — PTY-Parse Engine**

**Active digest system (M3b-B8):** reads from PTY byte stream over broker:

**Crates & Modules:**

1. **`spt-term::digest` (M3a primitive)** — `crates/spt-term/src/digest.rs`:
   - `DigestParser` — compiles adapter-supplied regex patterns (input/agent boundary markers, tool extractors, catchall)
   - `DigestPatterns` struct (lines 66-76) — holds pattern strings
   - `DigestConfig` — presentation knobs (window depth, arg truncation)
   - `Digest` struct — output: list of `Turn`s (each a source-tagged span: input/agent/tool)

2. **`spt-daemon::digest` (M3b brain-side)** — `crates/spt-daemon/src/digest.rs` (lines 1-243):
   - `DigestEngine` (lines 73-84) — wraps `DigestParser`, tracks last computed digest + version, manages dedup floor for Path-B persistence
   - `DigestEngine::from_manifest(seam: &PtyDigest)` (lines 92-102) — entry point from manifest seam
   - `DigestEngine::feed()` (lines 150+) — called per PTY output chunk, returns `DigestUpdate` (delta-only on change)
   - `persist_completed_turns()` (lines 217-243) — appends settled turns to history.log if opted-in

3. **`spt-daemon::digesthub`** — `crates/spt-daemon/src/digesthub.rs` (lines 1-450):
   - `DigestHub` (lines 82-84) — daemon-held snapshot + subscriber registry
   - `pull_snapshot()` — `spt digest <id>` snapshot pull (returns current digest + version)
   - `follow()` — `spt digest <id> --follow` delta-stream subscribe (pushes base, then only changes)
   - Control channel frame kinds: `KIND_DIGEST_SNAPSHOT`, `KIND_DIGEST_SUBSCRIBE`, `KIND_DIGEST_RESULT`, `KIND_DIGEST_DELTA` (lines 37-43)

**Manifest Integration:**
- `spt-runtime::PtyDigest` — manifest `[pty_digest]` seam (serde struct in `crates/spt-runtime/src/manifest.rs` lines 699+)
- Fields: `input_pattern`, `agent_pattern`, `tool_patterns[]`, `catchall_pattern`, `window_turns` (optional), `persist` (bool, opt-in Path-B)
- Tests at lines 902, 909, 924

**Entry Points:**
- Brain loop: `crates/spt-daemon/src/brain.rs:759` — [impl->REQ-TERM-4] feeds PTY chunks to engine, publishes updates
- CLI: `crates/spt/src/cli.rs:926` — digests command dispatcher

**Path-B Persistence (Opt-in):**
- Destination: `<perch_path>/history.log` (same native store as `api history-log` push, dual writer)
- Logic: `DigestEngine::persist_completed_turns()` writes settled turns (every turn except the still-active last one)
- Store function: `spt_store::history::append_record()` — idempotent append (lines 23-36 in `crates/spt-store/src/history.rs`)

---

### **3. PTY-Parse Code Marked for Removal (G3 T7b — "Zero PTY-Parse Remnants")**

**The "superseded shape" per ADR-0008 amendment (line 42):**
- All adapter-supplied pattern compilation & regex-over-bytes machinery
- All `[pty_digest]` manifest schema (pattern seam disappears; digest rides `[history]` instead)

**Files/Lines to RETIRE completely:**

1. **spt-term/src/digest.rs** (entire file ~540 lines) — the parser primitive:
   - DigestParser, DigestPatterns, DigestError, DigestConfig enums/structs/impls
   - All regex matching logic

2. **spt-daemon/src/digest.rs** (entire file ~250 lines) — the PTY-feeding engine:
   - DigestEngine struct + from_manifest() + feed() loops
   - persist_completed_turns() (moved to new projection engine if needed)

3. **spt-daemon/src/digesthub.rs** (entire file ~450 lines) — the hub service:
   - Wait—**NO**: per M9-PLAN T7b line 159-162, DigestHub and control-channel surface STAY; only the "PTY-parse path" is retired. The hub is re-wired to read from history records instead of PTY chunks.
   - **Actually KEEP digesthub.rs**, but **REMOVE the bytes-over-PTY feed mechanism** (Brain's feed loop gets replaced with history-tail consumption)

4. **spt-daemon/src/brain.rs line 759** — the feed call in the brain loop:
   - Current: `engine.feed(pty_chunk)` on every broker output
   - Retire: this line + the feed loop machinery

5. **docs/MANIFEST.md lines 113–145** (`[pty_digest]` section):
   - REMOVED entirely; digest no longer has a manifest seam
   - History subsystem's `[history]` section (lines 81-89) becomes the exclusive source

6. **spt-term/tests/digest.rs** (entire file) — unit tests for DigestParser:
   - All parsing tests retire with the parser

7. **spt-daemon/tests/digest.rs (current):**
   - The B8 E2E (lines 1-243) that exercises real PTY→parser→hub flow
   - RETIRES: the PTY-parsing integration path
   - KEEPS frame: but re-wires to feed history records instead of PTY bytes

---

### **4. Session Logs / Normalized History (New Digest Source)**

**Per ADR-0008 amendment (lines 32-42), the new source is:**

> "rolling tail-projection of the endpoint's **normalized session logs** — the same normalized history the echo-commune consumes (history subsystem Path A locate+normalize / Path B native store)."

**Current History Subsystem (M2b, already shipping):**

1. **spt-live/src/history.rs** (lines 1-180):
   - `HistoryRecord` struct (lines 32-35) — one normalized opaque line
   - `fetch_history()` (lines 84-180) — three strategies:
     - **Path A (Fetcher)**: `fetcher` command (adapter-owned binary) emits normalized history
     - **Path A (Locate+Normalize)**: locate raw transcript, pipe through adapter's `normalize_command`
     - **Path B (Native)**: read `history.log` (adapter pushed via `api history-log`, M2a seam)
   - Returns `Vec<HistoryRecord>` (opaque lines, adapter-defined schema)

2. **spt-store/src/history.rs** (lines 1-54) — Path-B store:
   - `append_record(perch_path, record)` — writes one line to `<perch>/history.log`
   - Already used by: `api history-log` (adapter push) + digest persist (opt-in Path-B)

3. **echo-commune pipeline** (spt-live/src/echo.rs):
   - Already calls `fetch_history()`, normalizes turns into `HistoryRecord` format
   - The new digest engine will **consume the same normalized output**

**Key Insight from ADR-0008 Amendment (line 36):**

> "the byte stream is the *more* fragile surface, and transcript parsing carries **zero new burden** because Paths A/B already pay for it — the digest just consumes their output."

**T7a Task ("Incremental Tail" Design Note — M9-PLAN line 154):**

> "Incremental tail (file-watch / record-cursor — design note in plan only; executor picks the mechanism with the history subsystem's grain)."

**What this means:**
- The new digest won't re-parse every history fetch; it will **tail** the normalized log (the history.log file if Path B, or memoized output from Path A)
- "Grain" = the history subsystem's natural record granularity (one line per normalized record)
- "Fallback flag-if-taken" (G3 scope item) = if Path A's granularity proves too coarse for incremental tailing, flag it at G3 gate rather than silently ship degraded behavior

---

### **5. ADR-0008 (Full Text)**

**File**: `docs/adr/0008-live-activity-buffer-pty-digest.md`

**Status** (line 5): "accepted (2026-06-01) · **source mechanism superseded by the 2026-06-12 amendment below** (product surface stands)"

**Original Decision (§Decision, lines 11-22):**
- Broker PTY-digest as distinct artifact
- Adapter-supplied patterns over live PTY bytes (Path A's "adapter owns parser" rule)
- Broker-PTY-dependent → spt-hosted-primary; harness-hosted capability-gated
- Snapshot pull + delta-stream over broker R-TERM-3 byte-stream substrate
- Optional Path-B persistence (opt-in coarse activity log)

**Amendment (§Amendment, lines 32-42):**

> "**What changes**: the digest's *source*. The original decision parsed the live PTY byte stream; the digest is now a **rolling tail-projection of the endpoint's normalized session logs**"

"Why (the Gateway grill, 2026-06-12)": PTY repaint traffic corrupts delta computation; PTY is rendering protocol, not content log; Paths A/B already pay for normalization; transcript parsing carries **zero new burden**.

**What Stands** (lines 38-39):
- Formula (N-turn window, collapsed tool sprints, presentation-vs-extraction split)
- Structured source-tagged output
- Both access modes (snapshot pull + structured-delta stream, deltas now keyed to log records)
- Address-gating
- Option-C persistence

**Improved Consequence** (line 40):
> "the digest becomes **topology-independent** — harness-hosted endpoints (Claude Code's per-session JSONL is Path A's worked example) get digests too"

**Implementation Debt** (line 42):
> "`spt-daemon::digest` (`DigestEngine` + the manifest `pty_digest` pattern seam) implements the superseded shape; reconciliation + the `docs/MANIFEST.md` schema revision land with the implementing milestone."

**Other Relevant ADRs:**
- **ADR-0004 (Broker/Brain Split)** — digest is brain-side logic, never broker
- **ADR-0013 (Psyche Reconciled)** — history subsystem, Path A/B normalized output
- **ADR-0005** — pairing, not digest-related
- **ADR-0006** — address-gating, applies to digest access

---

### **6. History-Grain Fallback & "Flag-If-Taken"**

**Location in codebase**: Not yet implemented—this is G3 scope.

**Context** (M9-PLAN lines 154, 209):

Line 154: "Incremental tail (file-watch / record-cursor — design note in plan only; executor picks the mechanism with the history subsystem's grain)."

Line 209: "**History-subsystem grain**: if Path A normalize proves too coarse for incremental tailing, T7a's fallback is Path-B-first (native records tail cleanly) + Path A snapshot-only — an accepted degradation **to flag at G3, not silently ship**."

**What this means:**
- Path A (fetcher / locate+normalize) runs bounded commands; re-running on every digest refresh could be expensive if the history is large
- Path B (native history.log) is a simple append-only file; tailing is cheap (file-watch + record-cursor)
- If Path A's grain (whole-output re-fetch per attempt) is too coarse for incremental tailing, the fallback is:
  - **Use Path B for incremental tail** (if available)
  - **Use Path A for snapshot-only** (initial load, no incremental updates)
  - **Flag this at G3 gate** so doyle & operator are aware before merge

**"Flag-if-taken" surface**: None yet defined—likely a comment in the engine or a debug log message + the gate review.

---

### **7. CC-Fixture E2E (Claude Code Hosted Digest)**

**File**: `crates/spt/tests/gateway_e2e.rs` (lines 1-50, and likely extended for M9)

**Context** (M9-PLAN line 163-164):

> "CC-hosted digest E2E = the topology-independence proof (fixture JSONL via the Path A locate+normalize of the mock adapter)."

**What "topology-independence" means:**
- OLD digest was topology-dependent: only works under spt-hosted (broker PTY available)
- NEW digest: works everywhere (harness-hosted or spt-hosted) because it reads normalized history logs, not PTY bytes
- The E2E **must prove** Claude Code (harness-hosted) gets a digest by feeding normalized history records through the new engine

**Mock Adapter Setup** (M9-PLAN T7a):
- Mock adapter supplies `[history]` section with a fetcher or locate_normalize (Path A)
- The fetcher/normalizer outputs fixture JSONL records matching the echo-commune schema
- E2E spawns mock session, writes turns, fetches digest via `spt endpoint digest <id>`
- Assertion: digest renders correctly (N-turn window, collapsed sprints, source tags)

**Likely test file structure**:
- Extends existing `gateway_e2e.rs` (Gateway fixture is M9-T5, digest is T7)
- Or a new `cc_digest_e2e.rs` or extended section in `digest.rs` (daemon tests)

---

### **8. Planning Docs for Wave 3 / T7 / G3**

**M9-PLAN.md (Primary):**
- Lines 1-219, full plan
- Lines 68-219: Wave structure (three PRs):
  - Wave 1 (T1-T3, manifest cluster): profiles, strings, hints → G1 gate
  - Wave 2 (T4-T6, authority + role): user-msg, Gateway, live-role → G2 gate
  - Wave 3 (T7a-T7b, digest revision): **THIS IS G3** → G3 gate → milestone close

**T7 Breakdown** (lines 148-173):
- **T7a**: projection engine (history-record source, incremental tail, digest-entry API for log-less adapters)
- **T7b**: re-wire + retire (retire PTY-parse path, wire new engine into hub, update MANIFEST.md)
- **REQ-TERM-4 re-point**: retitle + move evidence + delete old evidence in same commit

**G3 Gate** (lines 170-173):
- REQ-TERM-4 re-point audit (no orphaned tags, title honest)
- Retire completeness (zero PTY-parse remnants)
- CC-fixture E2E
- Full suite + docs sweep

**ROADMAP.md References** (lines 49-50):

> "**🔜 NEXT milestone (planned 2026-06-12) — M9: Adapter customization & session surfaces.**"
>
> "the **session-digest log-source revision** (ADR-0008 amendment: digest = a projection of normalized session logs, never PTY parsing; `api digest-entry`; REQ-TERM-4 re-point — restoration-style honest re-evidence)."

---

### **9. M9 ROADMAP Definition & Gate**

**ROADMAP.md Lines 49-50 (M9 Overview):**

Goal: "adapters become **customizable without forking**" + digest is **re-founded on session logs** (ADR-0008 amendment made real, REQ evidence honestly re-pointed).

Concretely: "the PTY-parse engine is **GONE**; REQ-TERM-4's title and evidence match reality" (line 36 of M9-PLAN).

**M9-PLAN Lines 64-65 (Executor Discipline):**

> "Rule 3: every new REQ minted in the toml in the same change that starts satisfying it; rule 5: `required_stages` activate with their evidence, never before."

**G3 Gate Criteria** (M9-PLAN lines 170-173):

Doyle gate, pre-merge of wave 3 + milestone close:
1. **REQ-TERM-4 re-point audit** — no orphaned tags, title honest
2. **Retire completeness** — zero PTY-parse remnants (all digest.rs / digesthub.rs old code gone or re-wired, manifest seam deleted)
3. **CC-fixture E2E** — digest works topology-independent
4. **Full suite run + docs sweep** — CI green, mdBook digest/manifest pages updated, CHANGELOG `[Unreleased]`

---

## **Summary: Terrain Mapped**

| Item | Status | Location | Notes |
|------|--------|----------|-------|
| **REQ-TERM-4 Full Entry** | Active (but title outdated) | traceable-reqs.toml:414-416 | Title needs amendment in G3 T7b |
| **REQ-TERM-4 Evidence** | 27 tags across 8 files | Listed in section 1 | impl=8, unit=16, int=1, doc=1 |
| **Current PTY-Parse Engine** | Full stack active | spt-term::digest + daemon::digest + digesthub | M3b-B8, brain-side, adapter patterns over broker PTY |
| **Manifest [pty_digest] Seam** | Active | docs/MANIFEST.md:113-145 | Entirely retired in G3 T7b |
| **History Subsystem** | Active, dual-purpose | spt-live/history.rs + spt-store/history.rs | Path A (fetcher, locate+normalize) + Path B (native log) |
| **ADR-0008 Amendment** | Normative (2026-06-12) | docs/adr/0008-*:32-42 | Digest source = normalized logs, never PTY bytes |
| **History-Grain Fallback** | Design stage | M9-PLAN:154, 209 | If Path A too coarse, use Path B tail + Path A snapshot; flag at G3 |
| **CC-Fixture E2E** | Not yet built | Planned in gateway_e2e.rs or digest.rs | Must prove harness-hosted digest from normalized history |
| **Wave 3 / G3** | Planned | M9-PLAN:68-219 | T7a→T7b, retitle+re-wire, G3 gate with doyle |
| **M9 ROADMAP G3 Text** | Locked | ROADMAP.md:49-50 + M9-PLAN | "digest re-founded on session logs, PTY-parse gone" |

---

**Key Ambiguities / Gaps Flagged:**

1. **`api digest-entry` not found** — M9-PLAN T7a lines 155-156 mention "the push door for log-less adapters" but no verb/IPC frame defined yet; this is executor design work
2. **History-grain incremental tail mechanism** — "file-watch / record-cursor" is a design sketch, not implemented; executor to pick mechanism in T7a
3. **CC-Fixture E2E scope** — unclear if extends gateway_e2e.rs or a new test; M9-PLAN doesn't name the file
4. **M9-WAVE3-specific plan doc** — no Wave 3-only plan found; all sequencing in M9-PLAN master (one big file, three wave sections)

---

This map is now ready for JIT planning by the executor (todlando). All section 1-9 findings grounded in absolute file:line citations.</result>
<usage><subagent_tokens>95713</subagent_tokens><tool_uses>48</tool_uses><duration_ms>157438</duration_ms></usage>
</task-notification>


<owl_reachability_notice>
You have an active owl perch. When spawning subagents or doing work, use run_in_background: true so you stay reachable for incoming messages.
</owl_reachability_notice>


Map done. G3/Wave3 terrain charted. Key findings:

**G3 = digest re-foundation (ADR-0008 amendment).** PTY-parse engine GONE → digest becomes projection of normalized session logs (same source echo-commune uses).

**Two tasks:**
- **T7a** — new projection engine (history-record source, incremental tail, `api digest-entry` push-door for log-less adapters). *Mechanism unbuilt — executor design work.*
- **T7b** — re-wire hub to history + retire PTY-parse path + retitle REQ-TERM-4 + move/delete evidence (same commit).

**Retire targets (~1200 LOC):**
- `spt-term/src/digest.rs` (parser primitive) — full delete
- `spt-daemon/src/digest.rs` (DigestEngine PTY-feed) — full delete
- `spt-daemon/src/digesthub.rs` — **KEEP**, re-wire feed source PTY→history
- `brain.rs:759` feed loop — retire
- `docs/MANIFEST.md:113-145` `[pty_digest]` seam — delete

**G3 gate (doyle, pre-merge):** REQ-TERM-4 re-point audit (no orphan tags, honest title) · zero PTY-parse remnants · CC-fixture E2E (topology-independence proof) · full suite + docs sweep.

**Gaps flagged:** `api digest-entry` verb/IPC frame undefined · incremental-tail mechanism (file-watch vs record-cursor) unpicked · CC-fixture E2E file unnamed · history-grain fallback ("Path A too coarse → Path B tail + Path A snapshot, flag at G3").

---

Two open gates still pending doyle: PR #9 (gateway-wan) approval, PR #8 (G2) close. Wave3 is independent branch work — can plan now.

Proceed?


AskUserQuestion

Question: G3/Wave3 mapped. What next?

Choices:
Write M9 Wave3 JIT plan (T7a projection engine + T7b retire/re-wire) into planning docs. No code yet.
Plan, then begin T7a projection-engine impl on a fresh wave3 branch. Larger autonomous push.
Wait for doyle to close G2 + gateway-wan gates before touching Wave3.
Map was the goal. No further action now.


Your questions have been answered: "G3/Wave3 mapped. What next?"="plan, have doyle vet plan, execute on his greenlight, use his judgment to clear any hurdles". You can now continue with these answers in mind.

Question: G3/Wave3 mapped. What next?

Choices:
Write M9 Wave3 JIT plan (T7a projection engine + T7b retire/re-wire) into planning docs. No code yet.
Plan, then begin T7a projection-engine impl on a fresh wave3 branch. Larger autonomous push.
Wait for doyle to close G2 + gateway-wan gates before touching Wave3.
Map was the goal. No further action now.

plan, have doyle vet plan, execute on his greenlight, use his judgment to clear any hurdles


Plan, doyle vets, execute on greenlight. First ground the plan in actual docs.


1	# Live activity buffer (PTY digest)
2
3	## Status
4
5	accepted (2026-06-01) · **source mechanism superseded by the 2026-06-12 amendment below** (product surface stands)
6
7	## Context
8
9	We want a rolling, human-glanceable "what is this agent doing right now" view — the last ~N user turns + agent output between, with tool-usage sprints collapsed to a single `used: …` line — that a Shell, CLI, or GUI pane can render. The obvious implementation (spt-core parses the live PTY byte stream) looks like it **contradicts the history-subsystem decision** (CONTEXT §history subsystem), which deliberately refused to build per-harness parsers ("unbounded, version-fragile maintenance burden") and pushed parsing into adapters (Path A) or a native store the adapter writes (Path B). A future reader would reasonably flag the apparent reversal. This ADR records why it is *not* one, and the shape chosen.
10
11	## Decision
12
13	Add a **live activity buffer (PTY digest)** as a **distinct artifact** — not scrollback (raw bytes, R-TERM-2), not transcript history (full conversation behind communes/resume, Paths A/B). Its purpose is at-a-glance current activity, not replay.
14
15	The parsing-boundary distinction that resolves the tension:
16	- **The adapter supplies the patterns; spt-core only runs them.** The manifest provides `input_pattern` + `agent_pattern` (each opens a span capturing everything, newlines included, until the next pattern match of any kind) and `tool_pattern` (a **list** — one per tool, plus a final **catchall** for user-installed tools, capturing tool-name + arg fragment). This is exactly Path A's "adapter owns the parser" rule and the "spt-core owns the mechanism, adapter owns the pattern" principle (identical to opaque command templates) — **not** a built-in per-harness parser. The rejected maintenance burden stays in the adapter.
17	- **It parses the live PTY byte stream, not the harness transcript.** A light rolling regex over bytes the broker already holds is a categorically different artifact from locating + parsing version-fragile harness transcript files (the thing Path A/B exist to avoid).
18
19	Shape:
20	- **Broker-PTY-dependent → spt-hosted-primary.** Needs the broker-owned PTY (topology 2). **Harness-hosted (topology 1) is capability-gated:** an adapter that can feed spt-core the stream (e.g. a `pi`-style harness) opts in via a declared capability; harnesses that own their process tree opaquely (Claude Code) cannot, and the digest is simply unavailable there.
21	- **Structured, source-tagged output** (input / agent / collapsed-tool entries) so consumers render richly. Window depth N (~3) is a config knob; tool-arg truncation (~25 chars) is spt-core-controlled *presentation* (the template controls *extraction*).
22	- **Two access modes over one transport.** The digest is a parsed projection of the same PTY stream the broker streams for R-TERM-3, so: **snapshot pull** (`spt digest <[subnet:]id[@node]>`) and a **broker-pushed structured-delta stream** (subscribe; pushes only changes for near-realtime reflection). The delta-stream is a structured overlay riding the **same R-TERM-3 byte-stream substrate** (raw vs parsed = two channels on the one session surface). Access is **address-gated** (same as messaging; respects ADR-0006 visibility).
23	- **Optional "Option (C)" persistence:** opt-in per-endpoint, append digests to the native history store (Path B) as a coarse activity log — a third logging surface, off by default, not a replacement for A/B.
24
25	## Consequences
26
27	- New v1 requirement to register: the live activity buffer + the `input_pattern`/`agent_pattern`/`tool_pattern[]` manifest seam + `spt digest` (pull) + the digest delta-stream (push). Lands with **M3** (needs the spt-term broker + PTY); Shell consumption is M5; the GUI pane is the frontend milestone; persistence is M3+.
28	- The manifest schema (`docs/MANIFEST.md`) gains the `pty_digest` seam; the capability-declaration seam gains the harness-hosted stream-feed opt-in.
29	- Does **not** reverse the history-subsystem decision — the no-built-in-parser rule still holds; the digest honors it by running adapter-supplied patterns over the live byte stream rather than parsing harness transcripts.
30	- Builds on R-TERM-1/2/3 (broker, session surface, byte-stream) and ADR-0006 (address-gating).
31
32	## Amendment — source mechanism superseded: normalized session logs, never PTY parsing (2026-06-12)
33
34	**What changes:** the digest's *source*. The original decision parsed the live PTY byte stream; the digest is now a **rolling tail-projection of the endpoint's normalized session logs** — the same normalized history the echo-commune consumes (history subsystem Path A locate+normalize / Path B native store). One pipeline, two consumers. Harnesses with no usable logs push entries directly via a new **`api digest-entry`** verb.
35
36	**Why (the Gateway grill, 2026-06-12):** the PTY byte stream of an alternate-screen TUI is a **rendering protocol, not a content log**. Scroll and resize trigger full repaints — the same content re-enters the stream and corrupts delta computation — and semantic turn boundaries drown in repaint traffic. The original §Decision rationale ("a light rolling regex over bytes ≠ fragile transcript parsing") proved **backwards in practice**: the byte stream is the *more* fragile surface, and transcript parsing carries **zero new burden** because Paths A/B already pay for it — the digest just consumes their output. The governing split: **render surfaces read the PTY** (R-TERM raw byte ring, unchanged); **content surfaces read the logs**.
37
38	**What stands (the product surface, unchanged):** the formula (N-turn window, collapsed tool sprints, presentation-vs-extraction split), structured source-tagged output, both access modes (snapshot pull + structured-delta stream, deltas now keyed to log records), address-gating, Option-C persistence. The no-built-in-parser rule **still holds** — normalization remains adapter-owned (Path A) or adapter-pushed (Path B).
39
40	**Improved consequence:** the digest becomes **topology-independent** — harness-hosted endpoints (Claude Code's per-session JSONL is Path A's worked example) get digests too; the original "unavailable under opaque harnesses" limitation dissolves. Freshness = file-watch + adapter hook nudges; a near-realtime **incremental** normalize story is design-phase work for the implementing milestone.
41
42	**Implementation debt recorded:** `spt-daemon::digest` (`DigestEngine` + the manifest `pty_digest` pattern seam) implements the superseded shape; reconciliation + the `docs/MANIFEST.md` schema revision land with the implementing milestone.
43

# Live activity buffer (PTY digest)

## Status

accepted (2026-06-01) · **source mechanism superseded by the 2026-06-12 amendment below** (product surface stands)

## Context

We want a rolling, human-glanceable "what is this agent doing right now" view — the last ~N user turns + agent output between, with tool-usage sprints collapsed to a single `used: …` line — that a Shell, CLI, or GUI pane can render. The obvious implementation (spt-core parses the live PTY byte stream) looks like it **contradicts the history-subsystem decision** (CONTEXT §history subsystem), which deliberately refused to build per-harness parsers ("unbounded, version-fragile maintenance burden") and pushed parsing into adapters (Path A) or a native store the adapter writes (Path B). A future reader would reasonably flag the apparent reversal. This ADR records why it is *not* one, and the shape chosen.

## Decision

Add a **live activity buffer (PTY digest)** as a **distinct artifact** — not scrollback (raw bytes, R-TERM-2), not transcript history (full conversation behind communes/resume, Paths A/B). Its purpose is at-a-glance current activity, not replay.

The parsing-boundary distinction that resolves the tension:
- **The adapter supplies the patterns; spt-core only runs them.** The manifest provides `input_pattern` + `agent_pattern` (each opens a span capturing everything, newlines included, until the next pattern match of any kind) and `tool_pattern` (a **list** — one per tool, plus a final **catchall** for user-installed tools, capturing tool-name + arg fragment). This is exactly Path A's "adapter owns the parser" rule and the "spt-core owns the mechanism, adapter owns the pattern" principle (identical to opaque command templates) — **not** a built-in per-harness parser. The rejected maintenance burden stays in the adapter.
- **It parses the live PTY byte stream, not the harness transcript.** A light rolling regex over bytes the broker already holds is a categorically different artifact from locating + parsing version-fragile harness transcript files (the thing Path A/B exist to avoid).

Shape:
- **Broker-PTY-dependent → spt-hosted-primary.** Needs the broker-owned PTY (topology 2). **Harness-hosted (topology 1) is capability-gated:** an adapter that can feed spt-core the stream (e.g. a `pi`-style harness) opts in via a declared capability; harnesses that own their process tree opaquely (Claude Code) cannot, and the digest is simply unavailable there.
- **Structured, source-tagged output** (input / agent / collapsed-tool entries) so consumers render richly. Window depth N (~3) is a config knob; tool-arg truncation (~25 chars) is spt-core-controlled *presentation* (the template controls *extraction*).
- **Two access modes over one transport.** The digest is a parsed projection of the same PTY stream the broker streams for R-TERM-3, so: **snapshot pull** (`spt digest <[subnet:]id[@node]>`) and a **broker-pushed structured-delta stream** (subscribe; pushes only changes for near-realtime reflection). The delta-stream is a structured overlay riding the **same R-TERM-3 byte-stream substrate** (raw vs parsed = two channels on the one session surface). Access is **address-gated** (same as messaging; respects ADR-0006 visibility).
- **Optional "Option (C)" persistence:** opt-in per-endpoint, append digests to the native history store (Path B) as a coarse activity log — a third logging surface, off by default, not a replacement for A/B.

## Consequences

- New v1 requirement to register: the live activity buffer + the `input_pattern`/`agent_pattern`/`tool_pattern[]` manifest seam + `spt digest` (pull) + the digest delta-stream (push). Lands with **M3** (needs the spt-term broker + PTY); Shell consumption is M5; the GUI pane is the frontend milestone; persistence is M3+.
- The manifest schema (`docs/MANIFEST.md`) gains the `pty_digest` seam; the capability-declaration seam gains the harness-hosted stream-feed opt-in.
- Does **not** reverse the history-subsystem decision — the no-built-in-parser rule still holds; the digest honors it by running adapter-supplied patterns over the live byte stream rather than parsing harness transcripts.
- Builds on R-TERM-1/2/3 (broker, session surface, byte-stream) and ADR-0006 (address-gating).

## Amendment — source mechanism superseded: normalized session logs, never PTY parsing (2026-06-12)

**What changes:** the digest's *source*. The original decision parsed the live PTY byte stream; the digest is now a **rolling tail-projection of the endpoint's normalized session logs** — the same normalized history the echo-commune consumes (history subsystem Path A locate+normalize / Path B native store). One pipeline, two consumers. Harnesses with no usable logs push entries directly via a new **`api digest-entry`** verb.

**Why (the Gateway grill, 2026-06-12):** the PTY byte stream of an alternate-screen TUI is a **rendering protocol, not a content log**. Scroll and resize trigger full repaints — the same content re-enters the stream and corrupts delta computation — and semantic turn boundaries drown in repaint traffic. The original §Decision rationale ("a light rolling regex over bytes ≠ fragile transcript parsing") proved **backwards in practice**: the byte stream is the *more* fragile surface, and transcript parsing carries **zero new burden** because Paths A/B already pay for it — the digest just consumes their output. The governing split: **render surfaces read the PTY** (R-TERM raw byte ring, unchanged); **content surfaces read the logs**.

**What stands (the product surface, unchanged):** the formula (N-turn window, collapsed tool sprints, presentation-vs-extraction split), structured source-tagged output, both access modes (snapshot pull + structured-delta stream, deltas now keyed to log records), address-gating, Option-C persistence. The no-built-in-parser rule **still holds** — normalization remains adapter-owned (Path A) or adapter-pushed (Path B).

**Improved consequence:** the digest becomes **topology-independent** — harness-hosted endpoints (Claude Code's per-session JSONL is Path A's worked example) get digests too; the original "unavailable under opaque harnesses" limitation dissolves. Freshness = file-watch + adapter hook nudges; a near-realtime **incremental** normalize story is design-phase work for the implementing milestone.

**Implementation debt recorded:** `spt-daemon::digest` (`DigestEngine` + the manifest `pty_digest` pattern seam) implements the superseded shape; reconciliation + the `docs/MANIFEST.md` schema revision land with the implementing milestone.


140	that Psyche reconcile, echo-commune, and signoff writers structurally exclude
141	the file. Evidence: `REQ-EP-<n+1>` `[doc, impl, unit]`.
142
143	**Gate G2** (doyle): wire-compat of the new kind (N-1 tolerance), the
144	identity-gate truth table, injection order, no-automated-writer proof.
145
146	## Wave 3 — the digest revision (branch `m9-digest-logs`)
147
148	### T7 — Session-digest log projection
149	The heavy one. Per the ADR-0008 amendment:
150	- **T7a — projection engine**: digest buffer built from normalized history
151	  records (the echo-commune pipeline's format), keeping the presentation
152	  formula (N-turn window, collapsed tool sprints, ~25-char arg truncation).
153	  Incremental tail (file-watch / record-cursor — design note in plan only;
154	  executor picks the mechanism with the history subsystem's grain).
155	  `api digest-entry` = the push door for log-less adapters (entries arrive
156	  pre-formed). Unit: projection table from fixture records; digest-entry
157	  merge.
158	- **T7b — re-wire + retire**: `spt endpoint digest` (snapshot pull) + the
159	  structured-delta subscription ride the new engine; the PTY-parse path
160	  (`spt-daemon::digest` pattern engine + `spt-term::digest` + the manifest
161	  `pty_digest` seam) is REMOVED with its units; `docs/MANIFEST.md` drops the
162	  pattern-seam schema (digest needs no manifest seam — it rides `[history]`).
163	  CC-hosted digest E2E = the topology-independence proof (fixture JSONL via
164	  the Path A locate+normalize of the mock adapter).
165	- **REQ-TERM-4 re-point** (restoration-style): retitle (log-source, not
166	  "adapter-supplied patterns over broker PTY"), move its `impl`/`unit`/`int`
167	  tags onto the new engine + E2E **in the same commit** the old evidence is
168	  deleted — never a moment un-evidenced.
169
170	**Gate G3** (doyle, pre-merge of wave 3 + milestone close): REQ-TERM-4
171	re-point audit (no orphaned tags, title honest), retire completeness (zero
172	PTY-parse remnants), the CC-fixture E2E, then the full-suite run + docs sweep
173	(mdBook digest/manifest pages, CHANGELOG `[Unreleased]` entries).
174
175	---
176
177	## Sequencing
178
179	Wave 1 (T1→T2→T3, one PR) → **G1** → Wave 2 (T4→T5→T6, one PR; T4 before T5
180	because the Gateway fixture exercises the gate) → **G2** → Wave 3 (T7a→T7b,
181	one PR) → **G3** → milestone close (ROADMAP ✅ + commune). Waves 1 and 2 are
182	independent in principle — parallelize only if two executors exist; otherwise
183	sequential as listed. Wave 3 last: it deletes code and re-points active
184	evidence, so it lands on the quietest tree.
185
186	## Traceability
187
188	Five new REQs (exact numbers surveyed at mint): profiles, strings, hints
189	(`REQ-MANIFEST-*`), user-msg (`REQ-MSG-*`), Gateway acceptance + live-role
190	(`REQ-EP-*`); each activated `[doc, impl, unit]` in its landing commit (doc =
191	the CONTEXT.md entries, tagged). One re-point: REQ-TERM-4 (title + evidence,
192	in-commit with the retire). `traceable-reqs check` EXIT=0 at every commit.
193
194	## Risks / watch-items
195
196	- **Composite addressing is a cross-cutting rename-class change** — the
197	  `adapter_name` consumer survey (T1) must be exhaustive; a missed consumer
198	  resolves a profile to its parent silently. G1 reviews the survey list
199	  itself, not just the diff.
200	- **N-1 wire tolerance for `user-msg`**: v0.4.2 receivers must not choke on
201	  the unknown kind (the EVENTPART parser hazards bound this — verify against
202	  REQ-HAZARD-ENVELOPE-DECODE-ORDER's posture, and the n1-gate covers the
203	  broker IPC half).
204	- **REQ-TERM-4 carries `int` today** — the re-point must land a replacement
205	  `int` (the CC-fixture E2E) in the same commit, restoration discipline.
206	- **History-subsystem grain**: if Path A normalize proves too coarse for
207	  incremental tailing, T7a's fallback is Path-B-first (native records tail
208	  cleanly) + Path A snapshot-only — an accepted degradation to flag at G3,
209	  not silently ship.
210	- **Don't expand scope**: no shell work (M10), no rc (M11), no lecturn code,
211	  no PresenceChannel. Profiles do NOT grow conditional logic (no if/else in
212	  manifests — overlays only).
213
214	## Immediate next step
215
216	On operator greenlight: todlando starts T1 (profiles — schema, merge fn +
217	unit table, registration validation, addressing survey), pings doyle at G1
218	after Wave 1 lands CI-green.
219

that Psyche reconcile, echo-commune, and signoff writers structurally exclude
the file. Evidence: `REQ-EP-<n+1>` `[doc, impl, unit]`.

**Gate G2** (doyle): wire-compat of the new kind (N-1 tolerance), the
identity-gate truth table, injection order, no-automated-writer proof.

## Wave 3 — the digest revision (branch `m9-digest-logs`)

### T7 — Session-digest log projection
The heavy one. Per the ADR-0008 amendment:
- **T7a — projection engine**: digest buffer built from normalized history
  records (the echo-commune pipeline's format), keeping the presentation
  formula (N-turn window, collapsed tool sprints, ~25-char arg truncation).
  Incremental tail (file-watch / record-cursor — design note in plan only;
  executor picks the mechanism with the history subsystem's grain).
  `api digest-entry` = the push door for log-less adapters (entries arrive
  pre-formed). Unit: projection table from fixture records; digest-entry
  merge.
- **T7b — re-wire + retire**: `spt endpoint digest` (snapshot pull) + the
  structured-delta subscription ride the new engine; the PTY-parse path
  (`spt-daemon::digest` pattern engine + `spt-term::digest` + the manifest
  `pty_digest` seam) is REMOVED with its units; `docs/MANIFEST.md` drops the
  pattern-seam schema (digest needs no manifest seam — it rides `[history]`).
  CC-hosted digest E2E = the topology-independence proof (fixture JSONL via
  the Path A locate+normalize of the mock adapter).
- **REQ-TERM-4 re-point** (restoration-style): retitle (log-source, not
  "adapter-supplied patterns over broker PTY"), move its `impl`/`unit`/`int`
  tags onto the new engine + E2E **in the same commit** the old evidence is
  deleted — never a moment un-evidenced.

**Gate G3** (doyle, pre-merge of wave 3 + milestone close): REQ-TERM-4
re-point audit (no orphaned tags, title honest), retire completeness (zero
PTY-parse remnants), the CC-fixture E2E, then the full-suite run + docs sweep
(mdBook digest/manifest pages, CHANGELOG `[Unreleased]` entries).

---

## Sequencing

Wave 1 (T1→T2→T3, one PR) → **G1** → Wave 2 (T4→T5→T6, one PR; T4 before T5
because the Gateway fixture exercises the gate) → **G2** → Wave 3 (T7a→T7b,
one PR) → **G3** → milestone close (ROADMAP ✅ + commune). Waves 1 and 2 are
independent in principle — parallelize only if two executors exist; otherwise
sequential as listed. Wave 3 last: it deletes code and re-points active
evidence, so it lands on the quietest tree.

## Traceability

Five new REQs (exact numbers surveyed at mint): profiles, strings, hints
(`REQ-MANIFEST-*`), user-msg (`REQ-MSG-*`), Gateway acceptance + live-role
(`REQ-EP-*`); each activated `[doc, impl, unit]` in its landing commit (doc =
the CONTEXT.md entries, tagged). One re-point: REQ-TERM-4 (title + evidence,
in-commit with the retire). `traceable-reqs check` EXIT=0 at every commit.

## Risks / watch-items

- **Composite addressing is a cross-cutting rename-class change** — the
  `adapter_name` consumer survey (T1) must be exhaustive; a missed consumer
  resolves a profile to its parent silently. G1 reviews the survey list
  itself, not just the diff.
- **N-1 wire tolerance for `user-msg`**: v0.4.2 receivers must not choke on
  the unknown kind (the EVENTPART parser hazards bound this — verify against
  REQ-HAZARD-ENVELOPE-DECODE-ORDER's posture, and the n1-gate covers the
  broker IPC half).
- **REQ-TERM-4 carries `int` today** — the re-point must land a replacement
  `int` (the CC-fixture E2E) in the same commit, restoration discipline.
- **History-subsystem grain**: if Path A normalize proves too coarse for
  incremental tailing, T7a's fallback is Path-B-first (native records tail
  cleanly) + Path A snapshot-only — an accepted degradation to flag at G3,
  not silently ship.
- **Don't expand scope**: no shell work (M10), no rc (M11), no lecturn code,
  no PresenceChannel. Profiles do NOT grow conditional logic (no if/else in
  manifests — overlays only).

## Immediate next step

On operator greenlight: todlando starts T1 (profiles — schema, merge fn +
unit table, registration validation, addressing survey), pings doyle at G1
after Wave 1 lands CI-green.


Have the contract. Now read the seam files to write a faithful, executable plan.