[codex] Build Strand cockpit TUI#5
Draft
TSchonleber wants to merge 8 commits into
Draft
Conversation
Design spec for the cockpit rework. Pivots strand from twitter-engine- monitor to chat-first operator cockpit. Covers: - provider/subagent/skill architectural split (hermes-agent pattern) - auth model: BYOK + PKCE device-code + oauth_external credential reuse with honest billing warnings (anthropic extra_usage routing, etc.) - pinned cockpit event schema for parallel ink + web renderers - subagent spawn with cli-process backend (claude, codex) + budget inheritance + depth/concurrency caps - skill lifecycle (markdown + sqlite) with queued reflexion-driven retirement, integrated as a brainctl memory category - workstream decomposition for codex + 4 devin + 1 claude-code sprint Hard constraints call out the non-negotiables: policy gate preservation, pinned renderer protocol, local-only oauth_external, no implicit env-var activation, queued skill retirement. References hermes-agent (NousResearch) as the primary reference impl. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…iders, flow-gate timeline - elevate "lean by default" as a cross-cutting principle: JIT skill retrieval, --bare default for subagents, summarizing context engine default, cheapest-capable reflexion judge, lean default budgets - add hard constraint #8 pinning lean session budget defaults - prune provider list to anthropic / openai / xai / gemini / openai-compat (the long tail is reachable via openai-compat + baseURL, no new adapters) - remove nous-portal from the v1 registry - replace day-by-day sprint timeline with flow-gated checkpoints — agents move faster than calendar time Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- SQLite skill_records + skill_decisions tables (schema.sql) - SkillRecordStore: upsert, usage metrics, status transitions - SkillDecisionStore: accept/reject with 30-day rejection suppression - Nightly scorer: queued_retire on low hit-rate (<0.15), low success-rate (<0.5 with n>=10), or superseded by higher-scoring skill - brainctl adapter: toBrainctlDecisionEvent for decision event logging - Ink bridge: createInkBridge + createSkillEventBridge for chat-first renderer consuming CockpitEvent streams (preserves classic TUI) - 20 tests: lifecycle store, scorer, accept/reject, suppression, bridge Co-Authored-By: Terrence Schonleber <TVschonleber@gmail.com>
…depth enforcement - cli-process backend with oneshot mode, CockpitEvent normalization - Parsers: claude-code-stream, codex-exec, raw-text fallback - --bare flag contract: never with oauth_external, default with api_key (HC#7) - maxDepth 3, maxConcurrentChildren 3, heartbeat 30s, stale 10min - Seed skills: claude-code.md, codex.md, pr-review.md (frontmatter per §6) - 45 tests covering parsers, --bare logic, budget, depth, concurrency Co-Authored-By: Terrence Schonleber <TVschonleber@gmail.com>
Co-Authored-By: Terrence Schonleber <TVschonleber@gmail.com>
…d device-code scaffolding - Provider registry for anthropic, openai, xai, gemini, openai-compat - CockpitAuthStore (~/.strand/auth.json) with single-writer lock - External credential discovery for Claude Code and gemini-cli - OpenAI oauth_device_code flow with mockable HTTP client - Enforce hard constraints #3 (oauth_external local-only), #4 (billing warning), #5 (no implicit activation) - 39 tests across 4 test files Co-Authored-By: Terrence Schonleber <TVschonleber@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
strand cockpitoperator entrypoint and a width-safe, gamified Ink dashboard with mission/pulse/shield/reach panels.Why
The existing TUI wrapped badly in normal terminal widths and hid the available controls. This makes the cockpit usable as a pinned terminal: clearer controls, responsive rendering, a
?help menu, and tests that enforce 80-column safety.S5 Changes (Devin-4)
Skill storage (
src/db/schema.sql):skill_recordstable: tracks per-skillusage_count,success_count,token_cost_samples_json(for p50/p95),last_used_at,trust_score,triggers,supersedes, andstatus(active | retired | draft | queued_draft | queued_retire).skill_decisionstable: audit trail of accept/reject decisions with 30-day rejection suppression.Skill lifecycle (
src/agent/skills/lifecycle.ts):SkillRecordStore: upsert, usage recording, status transitions, per-status listing.runNightlyScorer(): queues retire proposals when hit-rate < 0.15, success-rate < 0.5 (n >= 10), or superseded. Respects 30-day rejection suppression.acceptProposal()/rejectProposal(): transition skill status and record decisions.Brainctl integration:
toBrainctlDecisionEvent(): maps SkillDecision to brainctl-compatible event shape.SkillDecisionStore.record()auto-computessuppressed_untilon rejection (30 days).Ink renderer bridge (
src/cockpit/ink/bridge.ts):createInkBridge(): subscribes to core EventBus, optional type filtering, destroy() cleanup.createSkillEventBridge(): filtered bridge for skill.proposal + skill.decision events.Validation
pnpm typecheck— cleanpnpm exec vitest run tests/agent/skill-lifecycle.test.ts tests/cockpit/ink-bridge.test.ts— 20 tests passpnpm exec biome check— clean on all touched filesReview & Testing Checklist for Human
skill_records/skill_decisionsschema matches §6 expectationsBrainctlDecisionEvent) — clean adapter path, slots into brainctlskillcategory when it's addedNotes
skill.proposalandskill.decisiontypes were already in S0 scaffoldtriggers_jsonmirrors what S4 skill files declarecockpit/coreevents, maintaining the two-invariant contractLink to Devin session: https://app.devin.ai/sessions/181c7d5b9b714a65af8850685f1556f5
Requested by: @TSchonleber