ultimate-pi 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/ck-search/SKILL.md +99 -0
- package/.agents/skills/defuddle/SKILL.md +90 -0
- package/.agents/skills/find-skills/SKILL.md +142 -0
- package/.agents/skills/firecrawl/SKILL.md +150 -0
- package/.agents/skills/firecrawl/rules/install.md +82 -0
- package/.agents/skills/firecrawl/rules/security.md +26 -0
- package/.agents/skills/firecrawl-agent/SKILL.md +57 -0
- package/.agents/skills/firecrawl-build-interact/SKILL.md +67 -0
- package/.agents/skills/firecrawl-build-onboarding/SKILL.md +102 -0
- package/.agents/skills/firecrawl-build-onboarding/references/auth-flow.md +39 -0
- package/.agents/skills/firecrawl-build-onboarding/references/project-setup.md +20 -0
- package/.agents/skills/firecrawl-build-onboarding/references/sdk-installation.md +17 -0
- package/.agents/skills/firecrawl-build-scrape/SKILL.md +68 -0
- package/.agents/skills/firecrawl-build-search/SKILL.md +68 -0
- package/.agents/skills/firecrawl-crawl/SKILL.md +58 -0
- package/.agents/skills/firecrawl-download/SKILL.md +69 -0
- package/.agents/skills/firecrawl-interact/SKILL.md +83 -0
- package/.agents/skills/firecrawl-map/SKILL.md +50 -0
- package/.agents/skills/firecrawl-parse/SKILL.md +61 -0
- package/.agents/skills/firecrawl-scrape/SKILL.md +68 -0
- package/.agents/skills/firecrawl-search/SKILL.md +59 -0
- package/.agents/skills/obsidian-bases/SKILL.md +299 -0
- package/.agents/skills/obsidian-markdown/SKILL.md +237 -0
- package/.agents/skills/posthog-analyst/SKILL.md +306 -0
- package/.agents/skills/posthog-analyst/evals/evals.json +23 -0
- package/.agents/skills/wiki/SKILL.md +215 -0
- package/.agents/skills/wiki/references/css-snippets.md +122 -0
- package/.agents/skills/wiki/references/frontmatter.md +107 -0
- package/.agents/skills/wiki/references/git-setup.md +58 -0
- package/.agents/skills/wiki/references/mcp-setup.md +149 -0
- package/.agents/skills/wiki/references/modes.md +259 -0
- package/.agents/skills/wiki/references/plugins.md +96 -0
- package/.agents/skills/wiki/references/rest-api.md +124 -0
- package/.agents/skills/wiki-autoresearch/SKILL.md +211 -0
- package/.agents/skills/wiki-autoresearch/references/program.md +75 -0
- package/.agents/skills/wiki-fold/SKILL.md +204 -0
- package/.agents/skills/wiki-fold/references/fold-template.md +133 -0
- package/.agents/skills/wiki-ingest/SKILL.md +288 -0
- package/.agents/skills/wiki-lint/SKILL.md +183 -0
- package/.agents/skills/wiki-query/SKILL.md +176 -0
- package/.agents/skills/wiki-save/SKILL.md +128 -0
- package/.ckignore +41 -0
- package/.env.example +9 -0
- package/.github/workflows/lint.yml +33 -0
- package/.github/workflows/publish-github-packages.yml +35 -0
- package/.github/workflows/publish-npm.yml +1 -1
- package/.pi/SYSTEM.md +107 -40
- package/.pi/agents/pi-pi/agent-expert.md +205 -0
- package/.pi/agents/pi-pi/cli-expert.md +47 -0
- package/.pi/agents/pi-pi/config-expert.md +67 -0
- package/.pi/agents/pi-pi/ext-expert.md +53 -0
- package/.pi/agents/pi-pi/keybinding-expert.md +123 -0
- package/.pi/agents/pi-pi/pi-orchestrator.md +103 -0
- package/.pi/agents/pi-pi/prompt-expert.md +83 -0
- package/.pi/agents/pi-pi/skill-expert.md +52 -0
- package/.pi/agents/pi-pi/theme-expert.md +46 -0
- package/.pi/agents/pi-pi/tui-expert.md +100 -0
- package/.pi/agents/rethink.md +140 -0
- package/.pi/agents/wiki-ingest.md +67 -0
- package/.pi/agents/wiki-lint.md +75 -0
- package/.pi/auto-commit.json +20 -0
- package/.pi/extensions/banner.png +0 -0
- package/.pi/extensions/ck-enforce.ts +216 -0
- package/.pi/extensions/custom-footer.ts +308 -0
- package/.pi/extensions/custom-header.ts +116 -0
- package/.pi/extensions/dotenv-loader.ts +170 -0
- package/.pi/internal/cursor-sdk-transcript-parser.ts +59 -0
- package/.pi/model-router.json +95 -0
- package/.pi/npm/.gitignore +2 -0
- package/.pi/prompts/git-sync.md +124 -0
- package/.pi/prompts/harness-setup.md +509 -0
- package/.pi/prompts/save.md +16 -0
- package/.pi/prompts/wiki-autoresearch.md +19 -0
- package/.pi/prompts/wiki.md +23 -0
- package/.pi/providers/cursor-sdk-provider.test.mjs +476 -0
- package/.pi/providers/cursor-sdk-provider.ts +1085 -0
- package/.pi/settings.json +14 -4
- package/.pi/skills/agent-router/SKILL.md +174 -0
- package/.pi/sounds/alert/1-kaching-track.mp3 +0 -0
- package/.pi/sounds/error/1-ksi-wth-track.mp3 +0 -0
- package/.pi/sounds/error/2-smash-track.mp3 +0 -0
- package/.pi/sounds/error/3-buzzer-track.mp3 +0 -0
- package/.pi/sounds/notification/1-soft-notification-track.mp3 +0 -0
- package/.pi/sounds/project-sounds.json +25 -0
- package/.pi/sounds/reminder/1-soft-notification-track.mp3 +0 -0
- package/.pi/sounds/success/1-tada-track.mp3 +0 -0
- package/.pi/sounds/success/2-jobs-done-track.mp3 +0 -0
- package/.pi/sounds/success/3-yay-track.mp3 +0 -0
- package/CONTRIBUTING.md +116 -0
- package/README.md +32 -39
- package/biome.json +34 -0
- package/firecrawl/.env.template +58 -0
- package/firecrawl/README.md +49 -0
- package/firecrawl/docker-compose.yaml +201 -0
- package/firecrawl/searxng/searxng.env +3 -0
- package/firecrawl/searxng/settings.yml +85 -0
- package/lefthook.yml +8 -0
- package/package.json +55 -24
- package/vault/AGENTS.md +37 -0
- package/vault/wiki/_templates/comparison.md +39 -0
- package/vault/wiki/_templates/concept.md +40 -0
- package/vault/wiki/_templates/decision.md +21 -0
- package/vault/wiki/_templates/entity.md +32 -0
- package/vault/wiki/_templates/flow.md +14 -0
- package/vault/wiki/_templates/module.md +18 -0
- package/vault/wiki/_templates/question.md +31 -0
- package/vault/wiki/_templates/source.md +39 -0
- package/vault/wiki/concepts/AST-Aware Code Chunking.md +44 -0
- package/vault/wiki/concepts/Build-Time Prompt Compilation.md +107 -0
- package/vault/wiki/concepts/Context Engine (AI Coding).md +47 -0
- package/vault/wiki/concepts/Context-Aware System Reminders.md +61 -0
- package/vault/wiki/concepts/Contextualized Text Embedding.md +42 -0
- package/vault/wiki/concepts/Contractor vs Employee AI Model.md +55 -0
- package/vault/wiki/concepts/Dual-Model Agent Architecture.md +65 -0
- package/vault/wiki/concepts/Late Chunking vs Early Chunking.md +43 -0
- package/vault/wiki/concepts/Majority Vote Ensembling.md +68 -0
- package/vault/wiki/concepts/Meta-Harness.md +16 -0
- package/vault/wiki/concepts/Multi-Agent AI Coding Architecture.md +75 -0
- package/vault/wiki/concepts/Prompt Enhancement.md +90 -0
- package/vault/wiki/concepts/Prompt Renderer.md +89 -0
- package/vault/wiki/concepts/Semantic Codebase Indexing.md +67 -0
- package/vault/wiki/concepts/additive-config-hierarchy.md +16 -0
- package/vault/wiki/concepts/agent-artifacts-verifiable-deliverables.md +71 -0
- package/vault/wiki/concepts/agent-browser-browser-automation.md +99 -0
- package/vault/wiki/concepts/agent-codebase-interface.md +43 -0
- package/vault/wiki/concepts/agent-harness-architecture.md +67 -0
- package/vault/wiki/concepts/agent-loop-detection-patterns.md +133 -0
- package/vault/wiki/concepts/agent-search-enforcement.md +126 -0
- package/vault/wiki/concepts/agent-skills-ecosystem.md +74 -0
- package/vault/wiki/concepts/agent-skills-pattern.md +68 -0
- package/vault/wiki/concepts/agentic-harness-context-enforcement.md +91 -0
- package/vault/wiki/concepts/agentic-harness.md +34 -0
- package/vault/wiki/concepts/agentic-orchestration-pipeline.md +56 -0
- package/vault/wiki/concepts/agentic-search-no-embeddings.md +18 -0
- package/vault/wiki/concepts/anthropic-context-engineering.md +13 -0
- package/vault/wiki/concepts/antigravity-agent-first-architecture.md +61 -0
- package/vault/wiki/concepts/ast-compression.md +19 -0
- package/vault/wiki/concepts/ast-truncation.md +66 -0
- package/vault/wiki/concepts/barrel-files.md +37 -0
- package/vault/wiki/concepts/browser-harness-agent.md +41 -0
- package/vault/wiki/concepts/browser-subagent-visual-verification.md +82 -0
- package/vault/wiki/concepts/codebase-intelligence-ecosystem-comparison.md +192 -0
- package/vault/wiki/concepts/codebase-intelligence-harness-integration.md +161 -0
- package/vault/wiki/concepts/codebase-to-context-ingestion.md +46 -0
- package/vault/wiki/concepts/codex-harness-innovations.md +147 -0
- package/vault/wiki/concepts/consensus-debate-flow.md +17 -0
- package/vault/wiki/concepts/consensus-debate.md +206 -0
- package/vault/wiki/concepts/content-addressed-spec-identity.md +166 -0
- package/vault/wiki/concepts/context-anxiety.md +57 -0
- package/vault/wiki/concepts/context-compression-techniques.md +19 -0
- package/vault/wiki/concepts/context-continuity.md +22 -0
- package/vault/wiki/concepts/context-drift-in-agents.md +106 -0
- package/vault/wiki/concepts/context-engineering.md +62 -0
- package/vault/wiki/concepts/context-folding.md +67 -0
- package/vault/wiki/concepts/context-mode.md +38 -0
- package/vault/wiki/concepts/cursor-harness-innovations.md +107 -0
- package/vault/wiki/concepts/deterministic-session-compaction.md +79 -0
- package/vault/wiki/concepts/drift-detection-unified.md +296 -0
- package/vault/wiki/concepts/execution-feedback-loop.md +46 -0
- package/vault/wiki/concepts/feedforward-feedback-harness.md +60 -0
- package/vault/wiki/concepts/five-root-cause-metrics-sentrux.md +40 -0
- package/vault/wiki/concepts/fork-safe-spec-storage.md +89 -0
- package/vault/wiki/concepts/fts5-sandbox.md +19 -0
- package/vault/wiki/concepts/fuzzy-edit-matching.md +71 -0
- package/vault/wiki/concepts/gemini-cli-architecture.md +104 -0
- package/vault/wiki/concepts/generator-evaluator-architecture.md +64 -0
- package/vault/wiki/concepts/guardian-agent-pattern.md +67 -0
- package/vault/wiki/concepts/harness-configuration-layers.md +89 -0
- package/vault/wiki/concepts/harness-control-frameworks.md +155 -0
- package/vault/wiki/concepts/harness-engineering-first-principles.md +90 -0
- package/vault/wiki/concepts/harness-h-formalism.md +53 -0
- package/vault/wiki/concepts/hybrid-code-search.md +61 -0
- package/vault/wiki/concepts/inline-post-edit-validation.md +112 -0
- package/vault/wiki/concepts/legendary-engineering-patterns-harness.md +110 -0
- package/vault/wiki/concepts/lifecycle-hooks.md +94 -0
- package/vault/wiki/concepts/mcp-tool-routing.md +102 -0
- package/vault/wiki/concepts/memory-system-of-record-vs-ephemeral-cache.md +47 -0
- package/vault/wiki/concepts/meta-agent-context-pruning.md +151 -0
- package/vault/wiki/concepts/model-adaptive-harness.md +122 -0
- package/vault/wiki/concepts/model-routing-agents.md +101 -0
- package/vault/wiki/concepts/monorepo-architecture.md +45 -0
- package/vault/wiki/concepts/multi-agent-specialization.md +61 -0
- package/vault/wiki/concepts/permission-subsystem.md +16 -0
- package/vault/wiki/concepts/pi-messenger-analysis.md +243 -0
- package/vault/wiki/concepts/pi-vscode-extension-landscape.md +37 -0
- package/vault/wiki/concepts/policy-engine-pattern.md +78 -0
- package/vault/wiki/concepts/progressive-disclosure-agents.md +53 -0
- package/vault/wiki/concepts/progressive-skill-disclosure.md +17 -0
- package/vault/wiki/concepts/provider-native-prompting.md +203 -0
- package/vault/wiki/concepts/quality-signal-sentrux.md +37 -0
- package/vault/wiki/concepts/repo-map-ranking.md +42 -0
- package/vault/wiki/concepts/result-monad-error-handling.md +47 -0
- package/vault/wiki/concepts/safety-defense-in-depth.md +83 -0
- package/vault/wiki/concepts/sandbox-os-enforcement.md +18 -0
- package/vault/wiki/concepts/selective-debate-routing.md +70 -0
- package/vault/wiki/concepts/self-evolving-harness.md +60 -0
- package/vault/wiki/concepts/sentrux-mcp-integration.md +36 -0
- package/vault/wiki/concepts/sentrux-rules-engine.md +49 -0
- package/vault/wiki/concepts/shell-pattern-compression.md +24 -0
- package/vault/wiki/concepts/skill-first-architecture.md +166 -0
- package/vault/wiki/concepts/structured-compaction.md +78 -0
- package/vault/wiki/concepts/subagent-orchestration.md +17 -0
- package/vault/wiki/concepts/subagent-worktree-isolation.md +68 -0
- package/vault/wiki/concepts/superpowers-methodology.md +78 -0
- package/vault/wiki/concepts/think-in-code.md +73 -0
- package/vault/wiki/concepts/ts-execution-layer.md +100 -0
- package/vault/wiki/concepts/typescript-strict-mode.md +37 -0
- package/vault/wiki/concepts/vcc-conversation-compaction-for-pi.md +51 -0
- package/vault/wiki/concepts/verification-drift-detection.md +19 -0
- package/vault/wiki/consensus/consensus-records.md +58 -0
- package/vault/wiki/decisions/2026-04-30-pi-lean-ctx-native.md +122 -0
- package/vault/wiki/decisions/adr-008.md +40 -0
- package/vault/wiki/decisions/adr-009.md +46 -0
- package/vault/wiki/decisions/adr-010.md +55 -0
- package/vault/wiki/decisions/adr-011.md +165 -0
- package/vault/wiki/decisions/adr-012.md +102 -0
- package/vault/wiki/decisions/adr-013.md +59 -0
- package/vault/wiki/decisions/adr-014.md +73 -0
- package/vault/wiki/decisions/adr-015.md +81 -0
- package/vault/wiki/decisions/adr-016.md +91 -0
- package/vault/wiki/decisions/adr-017.md +79 -0
- package/vault/wiki/decisions/adr-018.md +100 -0
- package/vault/wiki/decisions/adr-019.md +75 -0
- package/vault/wiki/decisions/adr-020.md +106 -0
- package/vault/wiki/decisions/adr-021.md +86 -0
- package/vault/wiki/decisions/adr-022.md +113 -0
- package/vault/wiki/decisions/adr-023.md +113 -0
- package/vault/wiki/decisions/adr-024.md +73 -0
- package/vault/wiki/decisions/adr-025.md +130 -0
- package/vault/wiki/decisions/adr-026.md +56 -0
- package/vault/wiki/decisions/colocate-wiki.md +34 -0
- package/vault/wiki/entities/Anders Hejlsberg.md +29 -0
- package/vault/wiki/entities/Anthropic.md +17 -0
- package/vault/wiki/entities/Augment Code.md +49 -0
- package/vault/wiki/entities/Bjarne Stroustrup.md +26 -0
- package/vault/wiki/entities/Bolt.new (StackBlitz).md +39 -0
- package/vault/wiki/entities/Boris Cherny.md +11 -0
- package/vault/wiki/entities/Claude Code.md +19 -0
- package/vault/wiki/entities/Dennis Ritchie.md +26 -0
- package/vault/wiki/entities/Emergent Labs.md +32 -0
- package/vault/wiki/entities/Google Cloud.md +16 -0
- package/vault/wiki/entities/Guido van Rossum.md +28 -0
- package/vault/wiki/entities/Ken Thompson.md +28 -0
- package/vault/wiki/entities/Lee et al.md +16 -0
- package/vault/wiki/entities/Linus Torvalds.md +28 -0
- package/vault/wiki/entities/Lovable (company).md +40 -0
- package/vault/wiki/entities/Martin Fowler.md +16 -0
- package/vault/wiki/entities/Meng et al.md +16 -0
- package/vault/wiki/entities/OpenAI.md +16 -0
- package/vault/wiki/entities/Rocket.new.md +38 -0
- package/vault/wiki/entities/VILA-Lab.md +15 -0
- package/vault/wiki/entities/autodev-codebase.md +18 -0
- package/vault/wiki/entities/ck-tool.md +59 -0
- package/vault/wiki/entities/codesearch.md +18 -0
- package/vault/wiki/entities/disler-indydevdan.md +33 -0
- package/vault/wiki/entities/gsd-get-shit-done.md +56 -0
- package/vault/wiki/entities/javascript-runtimes.md +48 -0
- package/vault/wiki/entities/jesse-vincent.md +38 -0
- package/vault/wiki/entities/lean-ctx.md +32 -0
- package/vault/wiki/entities/opendev.md +41 -0
- package/vault/wiki/entities/ops-codegraph-tool.md +18 -0
- package/vault/wiki/entities/pi-coding-agent.md +53 -0
- package/vault/wiki/entities/sentrux.md +54 -0
- package/vault/wiki/entities/vgrep-tool.md +57 -0
- package/vault/wiki/entities/vitest.md +41 -0
- package/vault/wiki/flows/harness-wiki-pipeline.md +204 -0
- package/vault/wiki/hot.md +932 -0
- package/vault/wiki/index.md +437 -0
- package/vault/wiki/log.md +418 -0
- package/vault/wiki/meta/dashboard.md +30 -0
- package/vault/wiki/meta/lint-report-2026-04-30.md +86 -0
- package/vault/wiki/meta/lint-report-2026-05-02.md +251 -0
- package/vault/wiki/meta/overview.canvas +43 -0
- package/vault/wiki/modules/adversarial-verification.md +57 -0
- package/vault/wiki/modules/automated-observability.md +54 -0
- package/vault/wiki/modules/bench.md +20 -0
- package/vault/wiki/modules/extensions.md +23 -0
- package/vault/wiki/modules/grounding-checkpoints.md +62 -0
- package/vault/wiki/modules/harness-implementation-plan.md +345 -0
- package/vault/wiki/modules/harness-wiki-skill-mapping.md +135 -0
- package/vault/wiki/modules/harness.md +86 -0
- package/vault/wiki/modules/persistent-memory.md +85 -0
- package/vault/wiki/modules/schema-orchestration.md +68 -0
- package/vault/wiki/modules/skills.md +27 -0
- package/vault/wiki/modules/spec-hardening.md +58 -0
- package/vault/wiki/modules/structured-planning.md +53 -0
- package/vault/wiki/modules/think-in-code-enforcement.md +153 -0
- package/vault/wiki/modules/wiki-query-interface.md +64 -0
- package/vault/wiki/overview.md +51 -0
- package/vault/wiki/questions/Research-pi-vs-claude-code-agentic-orchestration-pipeline.md +87 -0
- package/vault/wiki/questions/Research-sentrux-dev.md +123 -0
- package/vault/wiki/questions/Research-superpowers-skill-for-agentic-coding-agents.md +164 -0
- package/vault/wiki/questions/Research: Augment Code Context Engine.md +244 -0
- package/vault/wiki/questions/Research: Automating Software Engineering - Lovable, Bolt, Emergent, Rocket.md +112 -0
- package/vault/wiki/questions/Research: Claude Code State-of-the-Art Harness Improvements.md +209 -0
- package/vault/wiki/questions/Research: Codex State-of-the-Art Harness Improvements.md +99 -0
- package/vault/wiki/questions/Research: Engineering Workflows of Legendary Programmers and AI Harness Mapping.md +107 -0
- package/vault/wiki/questions/Research: Fallow Codebase Intelligence Harness Integration.md +72 -0
- package/vault/wiki/questions/Research: Gemini CLI SOTA Harness Integration.md +166 -0
- package/vault/wiki/questions/Research: GitHub Issues as Harness Spec Storage.md +188 -0
- package/vault/wiki/questions/Research: Google Antigravity Harness Integration.md +120 -0
- package/vault/wiki/questions/Research: Meta-Agent Context Drift Detection.md +236 -0
- package/vault/wiki/questions/Research: Model-Adaptive Agent Harness Design.md +95 -0
- package/vault/wiki/questions/Research: Model-Specific Prompting Guides.md +165 -0
- package/vault/wiki/questions/Research: Prompt Renderer for Multi-Model Agent Harness.md +216 -0
- package/vault/wiki/questions/Research: Skill-First Harness Architecture.md +91 -0
- package/vault/wiki/questions/Research: TypeScript Best Practices and Codebase Structure.md +88 -0
- package/vault/wiki/questions/Research: TypeScript Execution Layer for Agent Tool Calling.md +81 -0
- package/vault/wiki/questions/Research: claude-mem over Obsidian for Harness Layer.md +71 -0
- package/vault/wiki/questions/Research: claude-mem over obsidian wiki as the knowledge base for our agentic harness pipeline. think from first principles. does this replace or complement our current setup? no hard feelings about previous decisions. gimme accurate points.md +80 -0
- package/vault/wiki/questions/Research: context-mode vs lean-ctx.md +72 -0
- package/vault/wiki/questions/Research: cursor.sh Harness Innovations.md +92 -0
- package/vault/wiki/questions/Research: executor.sh Harness Integration.md +170 -0
- package/vault/wiki/questions/Research: how GSD fits into our coding harness setup.md +97 -0
- package/vault/wiki/questions/Research: how claude-mem fits into our workflow. and whether it should replace obsidian in the codebase. no hard feelings about previous actions, rethink from first principles always.md +80 -0
- package/vault/wiki/questions/Research: pi-vcc.md +113 -0
- package/vault/wiki/questions/Research: semantic code search tools.md +69 -0
- package/vault/wiki/questions/Research: vcc extension for pi coding agent.md +73 -0
- package/vault/wiki/questions/how-to-enable-semantic-code-search-now.md +111 -0
- package/vault/wiki/questions/mvp-implementation-blueprint.md +552 -0
- package/vault/wiki/questions/research-agent-first-codebase-exploration.md +199 -0
- package/vault/wiki/questions/research-agentic-coding-harness-latest-papers.md +142 -0
- package/vault/wiki/questions/research-gitingest-gitreverse-integration.md +100 -0
- package/vault/wiki/questions/research-wozcode-token-reduction.md +67 -0
- package/vault/wiki/questions/resolved-context-pruning-inplace-vs-restart.md +95 -0
- package/vault/wiki/questions/resolved-context-window-economics.md +167 -0
- package/vault/wiki/questions/resolved-imad-debate-gating-transfer.md +126 -0
- package/vault/wiki/questions/resolved-mcp-tool-preference.md +112 -0
- package/vault/wiki/questions/resolved-small-model-meta-agents.md +107 -0
- package/vault/wiki/questions/resolved-treesitter-dynamic-languages.md +95 -0
- package/vault/wiki/sources/Auggie Context MCP Server.md +63 -0
- package/vault/wiki/sources/Augment Code Codacy AI Giants.md +61 -0
- package/vault/wiki/sources/Augment Code MCP SiliconAngle.md +49 -0
- package/vault/wiki/sources/Augment Code WorkOS ERC 2025.md +55 -0
- package/vault/wiki/sources/Augment Context Engine Official.md +71 -0
- package/vault/wiki/sources/Augment SWE-bench Agent GitHub.md +74 -0
- package/vault/wiki/sources/Augment SWE-bench Pro Blog.md +58 -0
- package/vault/wiki/sources/Source: AgentBus Jinja2 Prompt Pipelines.md +75 -0
- package/vault/wiki/sources/Source: Arxiv /342/200/224 Don't Break the Cache.md" +85 -0
- package/vault/wiki/sources/Source: Augment - Harness Engineering for AI Coding Agents.md +58 -0
- package/vault/wiki/sources/Source: Blake Crosley Agent Architecture Guide.md +100 -0
- package/vault/wiki/sources/Source: Bolt.new Architecture & Case Study.md +75 -0
- package/vault/wiki/sources/Source: Build-Time Prompt Compilation Architecture.md +107 -0
- package/vault/wiki/sources/Source: Claude API Agent Skills Overview.md +70 -0
- package/vault/wiki/sources/Source: Gemini CLI Changelogs.md +88 -0
- package/vault/wiki/sources/Source: Google Blog - Gemini CLI Announcement.md +57 -0
- package/vault/wiki/sources/Source: Google Gemini CLI Architecture Docs.md +53 -0
- package/vault/wiki/sources/Source: LangChain - Anatomy of Agent Harness.md +65 -0
- package/vault/wiki/sources/Source: Lovable Architecture & Clone Analysis.md +83 -0
- package/vault/wiki/sources/Source: Martin Fowler - Harness Engineering.md +70 -0
- package/vault/wiki/sources/Source: OpenAI Harness Engineering Five Principles.md +58 -0
- package/vault/wiki/sources/Source: OpenAI Harness Engineering /342/200/224 0 Lines of Human Code.md" +101 -0
- package/vault/wiki/sources/Source: OpenDev /342/200/224 Building AI Coding Agents for the Terminal.md" +100 -0
- package/vault/wiki/sources/Source: Render AI Coding Agents Benchmark 2025.md +53 -0
- package/vault/wiki/sources/Source: Rocket.new /342/200/224 Vibe Solutioning Platform.md" +70 -0
- package/vault/wiki/sources/Source: SwirlAI Agent Skills Progressive Disclosure.md +71 -0
- package/vault/wiki/sources/Source: TianPan Prompt Caching Architecture.md +89 -0
- package/vault/wiki/sources/Source: Vercel Labs agent-browser.md +155 -0
- package/vault/wiki/sources/Source: browser-harness CDP Harness.md +126 -0
- package/vault/wiki/sources/agent-drift-academic-paper.md +79 -0
- package/vault/wiki/sources/aider-repomap-tree-sitter.md +42 -0
- package/vault/wiki/sources/anthropic-compaction-api.md +58 -0
- package/vault/wiki/sources/anthropic-effective-harnesses.md +42 -0
- package/vault/wiki/sources/anthropic-prompt-best-practices.md +100 -0
- package/vault/wiki/sources/anthropic2026-harness-design.md +63 -0
- package/vault/wiki/sources/barrel-files-tkdodo.md +38 -0
- package/vault/wiki/sources/birth-of-unix-kernighan-interview.md +57 -0
- package/vault/wiki/sources/bockeler2026-harness-engineering.md +69 -0
- package/vault/wiki/sources/cast-code-chunking-paper.md +50 -0
- package/vault/wiki/sources/ck-semantic-search.md +78 -0
- package/vault/wiki/sources/claude-code-architecture-karaxai-2026.md +71 -0
- package/vault/wiki/sources/claude-code-architecture-qubytes-2026.md +50 -0
- package/vault/wiki/sources/claude-code-architecture-vila-lab-2026.md +64 -0
- package/vault/wiki/sources/claude-code-security-architecture-penligent-2026.md +70 -0
- package/vault/wiki/sources/claude-context-editing-docs.md +13 -0
- package/vault/wiki/sources/cloudflare-codemode.md +63 -0
- package/vault/wiki/sources/code-chunk-library-supermemory.md +63 -0
- package/vault/wiki/sources/codeact-apple-2024.md +62 -0
- package/vault/wiki/sources/codex-dsc-rfc-8573.md +41 -0
- package/vault/wiki/sources/codex-open-source-agent-2026.md +110 -0
- package/vault/wiki/sources/coir-code-retrieval-benchmark.md +51 -0
- package/vault/wiki/sources/colinmcnamara-context-optimization-codemode.md +48 -0
- package/vault/wiki/sources/context-folding-paper.md +61 -0
- package/vault/wiki/sources/context-mode-website.md +63 -0
- package/vault/wiki/sources/cursor-agent-best-practices-2026.md +62 -0
- package/vault/wiki/sources/cursor-fork-29b-2025.md +50 -0
- package/vault/wiki/sources/cursor-harness-april-2026.md +76 -0
- package/vault/wiki/sources/cursor-instant-apply-2024.md +45 -0
- package/vault/wiki/sources/cursor-shadow-workspace-2024.md +52 -0
- package/vault/wiki/sources/cursor-shipped-coding-agent-2026.md +53 -0
- package/vault/wiki/sources/cursor-vs-antigravity-2026.md +51 -0
- package/vault/wiki/sources/disler-pi-vs-claude-code.md +69 -0
- package/vault/wiki/sources/distill-deterministic-context-compression.md +53 -0
- package/vault/wiki/sources/embedding-models-benchmark-supermemory-2025.md +48 -0
- package/vault/wiki/sources/executor-rhyssullivan.md +122 -0
- package/vault/wiki/sources/fallow-rs-codebase-intelligence.md +125 -0
- package/vault/wiki/sources/fan2025-imad.md +60 -0
- package/vault/wiki/sources/forgecode-gpt5-agent-improvements.md +63 -0
- package/vault/wiki/sources/gemini-3-prompting-guide.md +78 -0
- package/vault/wiki/sources/gh-cli-sub-issue-rfc.md +50 -0
- package/vault/wiki/sources/gh-sub-issue-extension.md +72 -0
- package/vault/wiki/sources/github-fork-issues-discussion.md +44 -0
- package/vault/wiki/sources/github-issue-dependencies-docs.md +49 -0
- package/vault/wiki/sources/github-sub-issues-docs.md +51 -0
- package/vault/wiki/sources/gitingest.md +91 -0
- package/vault/wiki/sources/gitreverse.md +63 -0
- package/vault/wiki/sources/google-antigravity-official-blog.md +47 -0
- package/vault/wiki/sources/google-antigravity-wikipedia.md +53 -0
- package/vault/wiki/sources/gsd-codecentric-deep-dive.md +57 -0
- package/vault/wiki/sources/gsd-github-repo.md +51 -0
- package/vault/wiki/sources/gsd-hn-discussion.md +59 -0
- package/vault/wiki/sources/guido-python-design-philosophy.md +56 -0
- package/vault/wiki/sources/hejlsberg-7-learnings.md +48 -0
- package/vault/wiki/sources/ironclaw-drift-monitor.md +80 -0
- package/vault/wiki/sources/langsight-loop-detection.md +80 -0
- package/vault/wiki/sources/leanctx-website.md +69 -0
- package/vault/wiki/sources/lee2026-meta-harness.md +59 -0
- package/vault/wiki/sources/linux-kernel-coding-workflow.md +50 -0
- package/vault/wiki/sources/lou2026-autoharness.md +53 -0
- package/vault/wiki/sources/martin-fowler-harness-engineering.md +73 -0
- package/vault/wiki/sources/mcp-architecture-docs.md +13 -0
- package/vault/wiki/sources/meng2026-agent-harness-survey.md +79 -0
- package/vault/wiki/sources/mindstudio-four-agent-types.md +68 -0
- package/vault/wiki/sources/ms-chat-history-management.md +13 -0
- package/vault/wiki/sources/openai-prompt-guidance.md +104 -0
- package/vault/wiki/sources/openclaw-session-pruning.md +13 -0
- package/vault/wiki/sources/opencode-dcp.md +13 -0
- package/vault/wiki/sources/opendev-arxiv-2603.05344v1.md +79 -0
- package/vault/wiki/sources/openhands-platform.md +39 -0
- package/vault/wiki/sources/oss-guide-codebase-exploration.md +53 -0
- package/vault/wiki/sources/pi-compaction-extensions-ecosystem.md +102 -0
- package/vault/wiki/sources/pi-context-prune-github-repo.md +38 -0
- package/vault/wiki/sources/pi-mono-compaction-docs.md +38 -0
- package/vault/wiki/sources/pi-omni-compact-github-repo.md +50 -0
- package/vault/wiki/sources/pi-rtk-optimizer-github-repo.md +45 -0
- package/vault/wiki/sources/pi-vcc-github-repo.md +69 -0
- package/vault/wiki/sources/pi-vscode-marketplace.md +41 -0
- package/vault/wiki/sources/pi-vscode-model-provider-marketplace.md +39 -0
- package/vault/wiki/sources/py-tree-sitter.md +13 -0
- package/vault/wiki/sources/sentrux-dev-landing.md +40 -0
- package/vault/wiki/sources/sentrux-docs-pro-architecture.md +75 -0
- package/vault/wiki/sources/sentrux-docs-quality-signal.md +46 -0
- package/vault/wiki/sources/sentrux-docs-root-cause-metrics.md +57 -0
- package/vault/wiki/sources/sentrux-docs-rules-engine.md +58 -0
- package/vault/wiki/sources/sentrux-github-repo.md +56 -0
- package/vault/wiki/sources/superpowers-github-repo.md +56 -0
- package/vault/wiki/sources/superpowers-release-blog.md +54 -0
- package/vault/wiki/sources/superpowers-termdock-analysis.md +45 -0
- package/vault/wiki/sources/swe-agent-aci.md +42 -0
- package/vault/wiki/sources/swe-bench.md +45 -0
- package/vault/wiki/sources/swe-pruner-context-pruning.md +13 -0
- package/vault/wiki/sources/think-in-code-blog.md +48 -0
- package/vault/wiki/sources/tree-sitter-docs.md +13 -0
- package/vault/wiki/sources/ts-best-practices-2025-devto.md +42 -0
- package/vault/wiki/sources/ts-folder-structure-mingyang.md +58 -0
- package/vault/wiki/sources/ts-monorepo-koerselman.md +44 -0
- package/vault/wiki/sources/ts-result-error-handling-kkalamarski.md +52 -0
- package/vault/wiki/sources/ts-runtimes-comparison-betterstack.md +42 -0
- package/vault/wiki/sources/ts-strict-mode-rishikc.md +43 -0
- package/vault/wiki/sources/unix-philosophy.md +48 -0
- package/vault/wiki/sources/vectara-chunking-vs-embedding-naacl2025.md +39 -0
- package/vault/wiki/sources/vectara-guardian-agents.md +79 -0
- package/vault/wiki/sources/vgrep-semantic-search.md +76 -0
- package/vault/wiki/sources/vitest-official.md +41 -0
- package/vault/wiki/sources/vscode-pi-community-extension.md +40 -0
- package/vault/wiki/sources/wozcode.md +79 -0
- package/.agents/skills/compress/SKILL.md +0 -111
- package/.agents/skills/compress/scripts/__init__.py +0 -9
- package/.agents/skills/compress/scripts/__main__.py +0 -3
- package/.agents/skills/compress/scripts/benchmark.py +0 -78
- package/.agents/skills/compress/scripts/cli.py +0 -73
- package/.agents/skills/compress/scripts/compress.py +0 -227
- package/.agents/skills/compress/scripts/detect.py +0 -121
- package/.agents/skills/compress/scripts/validate.py +0 -189
- package/.agents/skills/emil-design-eng/SKILL.md +0 -679
- package/.agents/skills/lean-ctx/SKILL.md +0 -149
- package/.agents/skills/lean-ctx/scripts/install.sh +0 -95
- package/.agents/skills/scrapling-official/LICENSE.txt +0 -28
- package/.agents/skills/scrapling-official/SKILL.md +0 -390
- package/.agents/skills/scrapling-official/examples/01_fetcher_session.py +0 -26
- package/.agents/skills/scrapling-official/examples/02_dynamic_session.py +0 -26
- package/.agents/skills/scrapling-official/examples/03_stealthy_session.py +0 -26
- package/.agents/skills/scrapling-official/examples/04_spider.py +0 -58
- package/.agents/skills/scrapling-official/examples/README.md +0 -45
- package/.agents/skills/scrapling-official/references/fetching/choosing.md +0 -78
- package/.agents/skills/scrapling-official/references/fetching/dynamic.md +0 -352
- package/.agents/skills/scrapling-official/references/fetching/static.md +0 -432
- package/.agents/skills/scrapling-official/references/fetching/stealthy.md +0 -255
- package/.agents/skills/scrapling-official/references/mcp-server.md +0 -214
- package/.agents/skills/scrapling-official/references/migrating_from_beautifulsoup.md +0 -86
- package/.agents/skills/scrapling-official/references/parsing/adaptive.md +0 -212
- package/.agents/skills/scrapling-official/references/parsing/main_classes.md +0 -586
- package/.agents/skills/scrapling-official/references/parsing/selection.md +0 -494
- package/.agents/skills/scrapling-official/references/spiders/advanced.md +0 -344
- package/.agents/skills/scrapling-official/references/spiders/architecture.md +0 -94
- package/.agents/skills/scrapling-official/references/spiders/getting-started.md +0 -164
- package/.agents/skills/scrapling-official/references/spiders/proxy-blocking.md +0 -235
- package/.agents/skills/scrapling-official/references/spiders/requests-responses.md +0 -196
- package/.agents/skills/scrapling-official/references/spiders/sessions.md +0 -205
- package/PLAN.md +0 -11
- package/extensions/lean-ctx-enforce.ts +0 -166
- package/skills-lock.json +0 -35
- package/wiki/README.md +0 -19
- package/wiki/decisions/0001-establish-project-wiki-and-decision-record-format.md +0 -25
- package/wiki/decisions/0002-add-project-banner-to-readme.md +0 -26
- package/wiki/decisions/0003-remove-redundant-readme-title-heading.md +0 -26
- package/wiki/decisions/0004-publish-package-to-npm-as-ultimate-pi.md +0 -26
- package/wiki/decisions/0005-automate-npm-publish-with-github-actions.md +0 -27
- package/wiki/decisions/0006-switch-to-npm-trusted-publishing.md +0 -26
- package/wiki/decisions/0007-use-absolute-banner-url-for-npm-readme-rendering.md +0 -26
- package/wiki/decisions/0008-rename-banner-asset-for-cache-busting.md +0 -26
- package/wiki/decisions/0009-force-oidc-path-by-clearing-node-auth-token-in-publish-step.md +0 -25
- package/wiki/decisions/0010-simplify-setup-node-for-npm-trusted-publishing.md +0 -26
- package/wiki/decisions/0011-add-noop-workflow-change-to-force-fresh-publish-run.md +0 -25
- package/wiki/decisions/0012-align-workflow-runtime-with-npm-trusted-publishing-requirements.md +0 -26
- package/wiki/decisions/0013-add-package-repository-url-for-provenance-validation.md +0 -25
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: concept
|
|
3
|
+
title: "Skill-First Harness Architecture"
|
|
4
|
+
created: 2026-05-03
|
|
5
|
+
updated: 2026-05-03
|
|
6
|
+
tags: [concept, harness, skills, architecture, first-principles]
|
|
7
|
+
related:
|
|
8
|
+
- "[[Research: Skill-First Harness Architecture]]"
|
|
9
|
+
- "[[harness-implementation-plan]]"
|
|
10
|
+
- "[[mvp-implementation-blueprint]]"
|
|
11
|
+
- "[[agent-skills-pattern]]"
|
|
12
|
+
- "[[harness-engineering-first-principles]]"
|
|
13
|
+
- "[[progressive-disclosure-agents]]"
|
|
14
|
+
- "[[drift-detection-unified]]"
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Skill-First Harness Architecture
|
|
18
|
+
|
|
19
|
+
## Definition
|
|
20
|
+
|
|
21
|
+
A harness architecture where pipeline layers are implemented as **markdown-based skills** (`.pi/skills/harness-*/SKILL.md`) rather than TypeScript code modules. Only deterministic infrastructure — the drift monitor, shared types, and config — remains as code. Event routing is handled by pi's built-in event bus. Skills are progressively loaded on-demand via the three-tier disclosure pattern: Discovery → Activation → Execution.
|
|
22
|
+
|
|
23
|
+
## First Principles
|
|
24
|
+
|
|
25
|
+
1. **Skill is the atomic unit of harness behavior.** Not a code file, not a function. A skill is a self-contained markdown directory with frontmatter metadata, a body of instructions, and optional supporting files. It activates when the LLM determines it's relevant.
|
|
26
|
+
|
|
27
|
+
2. **Code is for determinism, not logic.** If a behavior must fire on every matching event with zero exceptions — it's code (hooks, drift monitor). If it's probabilistic evaluation (spec quality, plan correctness, code review) — it's a skill. The model is better at evaluation than imperative code.
|
|
28
|
+
|
|
29
|
+
3. **Markdown skills ARE the specification.** No separate spec file per harness layer. The `SKILL.md` body is simultaneously the spec, the implementation instructions, and the documentation. Supporting files (`reference.md`, `scripts/`) provide execution-layer resources loaded on demand.
|
|
30
|
+
|
|
31
|
+
4. **Pi's built-in event bus handles routing.** No custom event bus needed — pi's native event system wires events to skill invocations. Pipeline ordering is enforced by skill activation sequence — pi fires `harness-l1-activated` → L1 skill runs → returns → pi fires `harness-l2-activated` → L2 skill runs → etc.
|
|
32
|
+
|
|
33
|
+
5. **Progressive disclosure is the memory model.** Skills load in three tiers: Discovery (metadata only, ~80 tokens/skill, always loaded), Activation (full SKILL.md body, ~2,000 tokens, loaded when relevant), Execution (supporting files, unlimited, loaded on demand). This keeps context lean while enabling unlimited bundled knowledge.
|
|
34
|
+
|
|
35
|
+
6. **Zero-compile iteration.** Changing a skill is editing markdown. No TypeScript compilation, no npm build step, no restart. Agent picks up changes on next activation. This collapses the edit→build→test cycle for harness behavior.
|
|
36
|
+
|
|
37
|
+
## Architecture Diagram
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
41
|
+
│ THE SKILL-FIRST HARNESS │
|
|
42
|
+
├─────────────────────────────────────────────────────────────┤
|
|
43
|
+
│ CODE LAYER (TypeScript — deterministic, always-on) │
|
|
44
|
+
│ ┌──────────────┐ ┌───────────────────┐ │
|
|
45
|
+
│ │Drift Monitor │ │ Types + Config │ │
|
|
46
|
+
│ │(pattern match│ │ (shared infra) │ │
|
|
47
|
+
│ │ every tool_ │ │ │ │
|
|
48
|
+
│ │ result event)│ │ │ │
|
|
49
|
+
│ └──────────────┘ └───────────────────┘ │
|
|
50
|
+
│ EVENT BUS: pi's built-in native event system │
|
|
51
|
+
│ │
|
|
52
|
+
│ SKILL LAYER (Markdown — probabilistic, on-demand) │
|
|
53
|
+
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
|
54
|
+
│ │ L1 Spec │ │ L2 Plan │ │ L4 Critic│ │ L5 Obsrv │ │
|
|
55
|
+
│ │ Hardening│ │(DAG gen) │ │(advers.) │ │(metrics) │ │
|
|
56
|
+
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
|
|
57
|
+
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
|
58
|
+
│ │ P20 Gate │ │ L6 Memory│ │ L7 Orch. │ L8 already │
|
|
59
|
+
│ │(biome+ │ │(wiki wr. │ │(Archon │ wiki-based │
|
|
60
|
+
│ │ tsc+fal) │ │ contract)│ │ YAML) │ skills │
|
|
61
|
+
│ └──────────┘ └──────────┘ └──────────┘ │
|
|
62
|
+
│ │
|
|
63
|
+
│ WIKI LAYER (Obsidian — persistent, cross-session) │
|
|
64
|
+
│ ┌──────────────────────────────────────────────────────┐ │
|
|
65
|
+
│ │ ADRs, specs, plans, consensus, hot cache, index │ │
|
|
66
|
+
│ └──────────────────────────────────────────────────────┘ │
|
|
67
|
+
└─────────────────────────────────────────────────────────────┘
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## What Becomes Skills (and Why)
|
|
71
|
+
|
|
72
|
+
| Harness Layer | Old: TypeScript | New: Skill | Reason |
|
|
73
|
+
|---------------|----------------|------------|--------|
|
|
74
|
+
| L1 Spec Hardening | `l1-spec.ts` (~300 lines) | `harness-spec/SKILL.md` | LLM evaluates ambiguity — probabilistic by nature |
|
|
75
|
+
| L2 Planning | `l2-planner.ts` (~400 lines) | `harness-plan/SKILL.md` | LLM generates task DAG — probabilistic by nature |
|
|
76
|
+
| L4 Adversarial | `l4-critics.ts` (~300 lines) | `harness-critic/SKILL.md` + `.pi/agents/critic.md` | LLM attacks code — probabilistic by nature |
|
|
77
|
+
| P20 Gate | `p20-gate.ts` (~100 lines) | `harness-gate/SKILL.md` | Bash commands — skill provides instructions, bash executes |
|
|
78
|
+
| L5 Observability | `l5-observability.ts` (~200 lines) | `harness-observe/SKILL.md` | LLM evaluates quality — probabilistic by nature |
|
|
79
|
+
| L6 Memory | `l6-memory.ts` (~150 lines) | Already wiki-based skills | No change needed |
|
|
80
|
+
|
|
81
|
+
## What Stays Code (and Why)
|
|
82
|
+
|
|
83
|
+
| Component | File | Reason |
|
|
84
|
+
|-----------|------|--------|
|
|
85
|
+
| Drift Monitor | `drift-monitor.ts` (~500 lines) | Real-time pattern matching with sliding windows on every `tool_result` event. Sub-millisecond latency required. LLM evaluation every 8 turns is the PRIMARY detection, but the rule-based pre-filter and escalation ladder are deterministic code. |
|
|
86
|
+
| Shared Types | `types.ts` (~200 lines) | TypeScript interfaces for Spec, Plan, DriftEvent, CriticVerdict, Config. Needed by drift monitor and config. |
|
|
87
|
+
| Config Loader | `config.ts` (~100 lines) | Loads `.pi/harness/config.json`, merges with code defaults. Deterministic — no LLM involvement. |
|
|
88
|
+
|
|
89
|
+
> [!note] Event Bus Removed (2026-05-04)
|
|
90
|
+
> Pi's latest version ships a built-in event bus. The custom `events.ts` (~200 lines) and `.pi/extensions/harness-event-bus.ts` are no longer needed. Skills register directly with pi's native event system.
|
|
91
|
+
|
|
92
|
+
## Skill Directory Structure
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
.pi/skills/
|
|
96
|
+
├── harness-spec/
|
|
97
|
+
│ ├── SKILL.md # L1: Ambiguity detection, spec hardening, harness_ask tool usage
|
|
98
|
+
│ └── reference.md # Spec hardening patterns, ambiguity categories
|
|
99
|
+
├── harness-plan/
|
|
100
|
+
│ ├── SKILL.md # L2: YAML task DAG generation, sprint contracts, plan summary
|
|
101
|
+
│ └── reference.md # Plan templates, DAG patterns, sprint contract examples
|
|
102
|
+
├── harness-critic/
|
|
103
|
+
│ ├── SKILL.md # L4: Adversarial attack patterns, hard-threshold criteria, debate protocol
|
|
104
|
+
│ └── reference.md # Attack angle catalog, failure pattern taxonomy
|
|
105
|
+
├── harness-observe/
|
|
106
|
+
│ ├── SKILL.md # L5: Keep Rate tracking, LLM-as-Judge, satisfaction metrics
|
|
107
|
+
│ └── reference.md # Metric definitions, sampling strategies
|
|
108
|
+
├── harness-gate/
|
|
109
|
+
│ ├── SKILL.md # P20: Deterministic gate instructions (biome, tsc, fallow)
|
|
110
|
+
│ └── reference.md # Gate configuration, baseline management
|
|
111
|
+
└── harness-memory/
|
|
112
|
+
├── SKILL.md # L6: Read-first/write-after wiki contract, hot cache rules
|
|
113
|
+
└── reference.md # Wiki page templates, staleness rules
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## File Count Comparison
|
|
117
|
+
|
|
118
|
+
| Metric | Old (Code-First) | New (Skill-First) | Reduction |
|
|
119
|
+
|--------|-----------------|-------------------|-----------|
|
|
120
|
+
| TypeScript source files | 15 | 3 | -80% |
|
|
121
|
+
| TypeScript lines | ~2,500 | ~600 | -76% |
|
|
122
|
+
| Markdown skill files | 0 | 6 SKILL.md + 6 reference.md | New |
|
|
123
|
+
| Markdown skill lines | 0 | ~1,200 (instructions) | New |
|
|
124
|
+
| Compilation required | Yes (all 15 files) | Yes (3 files only) | -80% |
|
|
125
|
+
| Iteration cycle | Edit TS → compile → restart | Edit MD → agent picks up next activation | Seconds vs minutes |
|
|
126
|
+
|
|
127
|
+
## Why Skills Over Code for Harness Layers
|
|
128
|
+
|
|
129
|
+
### 1. The Model Is Better at Evaluation Than Imperative Code
|
|
130
|
+
L1 spec hardening: "Is this specification ambiguous?" — this is a natural language evaluation task. Writing regex patterns and AST analysis to detect ambiguity is fragile. Asking an LLM "does this spec have unresolved decisions?" is robust. The LLM already runs in the pipeline. Use it.
|
|
131
|
+
|
|
132
|
+
### 2. Progressive Disclosure Prevents Context Bloat
|
|
133
|
+
15 TypeScript files loaded into the agent's context as tool definitions consume tokens permanently. Skills load only when relevant. The discovery layer costs ~80 tokens per skill. All 6 harness skills together cost ~480 tokens at discovery — less than ONE loaded code module.
|
|
134
|
+
|
|
135
|
+
### 3. User-Editable Without Compilation
|
|
136
|
+
A project team can edit `.pi/skills/harness-critic/SKILL.md` to add project-specific attack patterns. No TypeScript knowledge needed. No build step. The markdown skill IS the configuration.
|
|
137
|
+
|
|
138
|
+
### 4. Skills Compose Naturally with the Wiki
|
|
139
|
+
L6 persistent memory is already wiki-based (claude-obsidian skills). Other harness layers reading/writing wiki pages is natural when they're also skills — the LLM invokes wiki-query from within a harness skill the same way it invokes any tool.
|
|
140
|
+
|
|
141
|
+
### 5. Cross-Platform Compatibility
|
|
142
|
+
The SKILL.md format is an open standard adopted by Anthropic, OpenAI, Google, GitHub, and Cursor. Harness skills work on ANY platform that supports the standard. Code modules are pi-specific.
|
|
143
|
+
|
|
144
|
+
## When NOT to Use a Skill
|
|
145
|
+
|
|
146
|
+
Skills are the WRONG choice when:
|
|
147
|
+
- **Deterministic execution is required.** The drift monitor MUST fire on every `tool_result` event with zero exceptions. Skills are probabilistic — the model decides when to activate them.
|
|
148
|
+
- **Sub-millisecond latency is required.** Pattern matching on a sliding window needs <1ms response. LLM invocation adds 200-500ms.
|
|
149
|
+
- **The behavior is purely mechanical.** Loading a config file, merging with defaults, registering pi event handlers — these are wiring, not reasoning. Skills add unnecessary LLM overhead.
|
|
150
|
+
- **State management across events.** Pi's native event bus tracks pipeline phase, turn count, drift history across hundreds of events. Skills are stateless per invocation — they'd need to re-read state from disk each time.
|
|
151
|
+
|
|
152
|
+
## Migration Path
|
|
153
|
+
|
|
154
|
+
From current plan (15 TS files) to skill-first (3 TS files + 6 skills):
|
|
155
|
+
|
|
156
|
+
1. **F0 + L2.5 first** (unchanged — these ARE code): Types, config, drift monitor. These are the foundation. Event bus is handled by pi's built-in system.
|
|
157
|
+
2. **Convert L1 Spec Hardening**: Extract the ambiguity detection and spec hardening logic from `l1-spec.ts` into `harness-spec/SKILL.md`. Pi's native event system fires this skill when it detects a `/harness` command.
|
|
158
|
+
3. **Convert L2 Planning**: Extract DAG generation and sprint contract logic into `harness-plan/SKILL.md`.
|
|
159
|
+
4. **Convert L4 Adversarial**: Already partially skill-based (critic.md agent definition). Extract attack pattern catalog into `harness-critic/SKILL.md`.
|
|
160
|
+
5. **Convert P20 Gate**: Already deterministic bash commands. Extract gate instructions into `harness-gate/SKILL.md`.
|
|
161
|
+
6. **Convert L5 Observability**: Extract Keep Rate tracking and LLM-as-Judge into `harness-observe/SKILL.md`.
|
|
162
|
+
7. **L6 Memory**: Already wiki-based. Add `harness-memory/SKILL.md` for the read-first/write-after contract.
|
|
163
|
+
8. **L7 Orchestration**: Already Archon YAML-based. No change.
|
|
164
|
+
9. **L8 Wiki Query**: Already claude-obsidian skills. No change.
|
|
165
|
+
|
|
166
|
+
> [!gap] Pi skill system integration details need verification. Can pi skills invoke other pi skills? Can pi skills write to `.pi/harness/` directories? These determine whether pi's event bus sequences skills or skills chain themselves.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: concept
|
|
3
|
+
title: "Structured Compaction Pipeline"
|
|
4
|
+
aliases: ["compaction pipeline", "five-layer compaction"]
|
|
5
|
+
created: 2026-05-01
|
|
6
|
+
tags: [concept, harness-design, context-management, compaction, claude-code]
|
|
7
|
+
status: developing
|
|
8
|
+
related:
|
|
9
|
+
- "[[harness-implementation-plan]]"
|
|
10
|
+
- "[[drift-detection-unified]]"
|
|
11
|
+
- "[[agentic-harness]]"
|
|
12
|
+
- "[[context-anxiety]]"
|
|
13
|
+
sources:
|
|
14
|
+
- "[[claude-code-architecture-vila-lab-2026]]"
|
|
15
|
+
- "[[claude-code-architecture-qubytes-2026]]"
|
|
16
|
+
- "[[claude-code-architecture-karaxai-2026]]"
|
|
17
|
+
updated: 2026-05-02
|
|
18
|
+
---
|
|
19
|
+
# Structured Compaction Pipeline
|
|
20
|
+
|
|
21
|
+
Claude Code's approach to context management: a five-layer compaction pipeline that uses a forked subagent to produce structured summaries tuned for software engineering tasks. Unlike simple truncation or lossy summarization, this is "structured extraction followed by selective reconstruction."
|
|
22
|
+
|
|
23
|
+
## How It Works
|
|
24
|
+
|
|
25
|
+
1. Context window fills to ~83.5% of capacity (e.g., ~167K / 200K tokens)
|
|
26
|
+
2. A forked subagent is spawned whose sole job is to produce a structured summary
|
|
27
|
+
3. The subagent receives a ~6,500 token compaction prompt tuned for SE tasks
|
|
28
|
+
4. The summary selectively preserves: file paths, code snippets, error histories, active skills, plan state, tool deltas
|
|
29
|
+
5. All prior messages are dropped. The summary is wrapped in `<summary>` tags and injected
|
|
30
|
+
6. CLAUDE.md, tool definitions, and skills reload from disk automatically
|
|
31
|
+
7. ~85% payload reduction (167K → ~25K tokens)
|
|
32
|
+
|
|
33
|
+
## What Survives Compaction
|
|
34
|
+
|
|
35
|
+
- File paths that were read or modified
|
|
36
|
+
- Code snippets (trimmed, not full files)
|
|
37
|
+
- Error messages and stack traces
|
|
38
|
+
- Active skills and their state
|
|
39
|
+
- Task plan state (TodoWrite)
|
|
40
|
+
- Tool deltas (what changed, not what was the same)
|
|
41
|
+
- CLAUDE.md (re-read from disk after compaction)
|
|
42
|
+
- Last 5 file attachments
|
|
43
|
+
|
|
44
|
+
## What Does Not Survive
|
|
45
|
+
|
|
46
|
+
- Full file contents (re-read on demand)
|
|
47
|
+
- Intermediate tool outputs
|
|
48
|
+
- Earlier conversation turns (summarized)
|
|
49
|
+
- Transient observations
|
|
50
|
+
- Claude's internal reasoning chains
|
|
51
|
+
|
|
52
|
+
## Compaction Instructions
|
|
53
|
+
|
|
54
|
+
Users embed preservation instructions directly in CLAUDE.md. The compactor reads CLAUDE.md like any other context and honors these instructions:
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
# Summary instructions
|
|
58
|
+
When summarizing this conversation, always preserve:
|
|
59
|
+
- The current task objective and acceptance criteria
|
|
60
|
+
- File paths that have been read or modified
|
|
61
|
+
- Test results and error messages
|
|
62
|
+
- Decisions made and the reasoning behind them
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Relationship to Current Drift Monitor
|
|
66
|
+
|
|
67
|
+
Our P3-P7 (Runtime Drift Monitor) detects stuck patterns and prunes context reactively. The compaction pipeline is proactive — it manages context before problems arise. They are complementary:
|
|
68
|
+
|
|
69
|
+
- **Drift Monitor**: Detects failure spirals, injects corrections, forces restart (reactive)
|
|
70
|
+
- **Compaction Pipeline**: Summarizes and reconstructs context at capacity thresholds (proactive)
|
|
71
|
+
|
|
72
|
+
## Integration Opportunities
|
|
73
|
+
|
|
74
|
+
- Replace P4 (Context pruning + correction injection) with structured compaction
|
|
75
|
+
- Extend P3 (Rule-based stuck-pattern detection) as a complement to compaction
|
|
76
|
+
- Add PreCompact/PostCompact hooks for archival and custom summarization
|
|
77
|
+
- Use forked subagent pattern (already in P25 subagent router, but not for compaction)
|
|
78
|
+
- Compaction instructions stored in wiki pages (L6), not CLAUDE.md files
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: concept
|
|
3
|
+
status: stub
|
|
4
|
+
created: 2026-05-02
|
|
5
|
+
updated: 2026-05-02
|
|
6
|
+
tags: [concept, agents, orchestration]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Subagent Orchestration
|
|
10
|
+
|
|
11
|
+
Pattern of spawning specialized subagents for isolated tasks with fresh context windows. Each subagent has its own context, tools, and scope. Enables parallel work and context isolation.
|
|
12
|
+
|
|
13
|
+
## References
|
|
14
|
+
|
|
15
|
+
- [[subagent-worktree-isolation]]
|
|
16
|
+
- [[model-routing-agents]]
|
|
17
|
+
- [[structured-compaction]]
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: concept
|
|
3
|
+
title: "Subagent Worktree Isolation"
|
|
4
|
+
aliases: ["worktree isolation", "subagent sandboxing"]
|
|
5
|
+
created: 2026-05-01
|
|
6
|
+
tags: [concept, harness-design, subagents, isolation, claude-code]
|
|
7
|
+
status: developing
|
|
8
|
+
related:
|
|
9
|
+
- "[[harness-implementation-plan]]"
|
|
10
|
+
- "[[agentic-harness]]"
|
|
11
|
+
- "[[consensus-debate]]"
|
|
12
|
+
sources:
|
|
13
|
+
- "[[claude-code-architecture-vila-lab-2026]]"
|
|
14
|
+
- "[[claude-code-security-architecture-penligent-2026]]"
|
|
15
|
+
- "[[claude-code-architecture-karaxai-2026]]"
|
|
16
|
+
updated: 2026-05-02
|
|
17
|
+
---
|
|
18
|
+
# Subagent Worktree Isolation
|
|
19
|
+
|
|
20
|
+
Claude Code's approach to subagent safety: each subagent gets a fresh context window AND optionally an isolated Git worktree. Only the final summary returns to the parent. No intermediate state leaks.
|
|
21
|
+
|
|
22
|
+
## Two Dimensions of Isolation
|
|
23
|
+
|
|
24
|
+
### Context Isolation
|
|
25
|
+
- Fresh 200K-token context window per subagent
|
|
26
|
+
- Only `subagent_type` (Explore, Plan, custom) and the prompt string are passed from parent
|
|
27
|
+
- NO parent conversation history, file contents, or tool outputs carry over
|
|
28
|
+
- Subagent's own file reads, tool calls, and reasoning stay isolated
|
|
29
|
+
- Only the final message returns to parent as a tool result
|
|
30
|
+
- Net effect: parent context grows by 1 summary, not the full subtask transcript
|
|
31
|
+
|
|
32
|
+
### Filesystem Isolation (Worktree)
|
|
33
|
+
- `isolation: worktree` creates a temporary Git worktree
|
|
34
|
+
- Subagent gets an isolated copy of the repository
|
|
35
|
+
- Edits don't conflict with main agent's working directory
|
|
36
|
+
- Worktree is cleaned up when subagent finishes
|
|
37
|
+
- Custom `WorktreeCreate`/`WorktreeRemove` hooks support non-Git VCS
|
|
38
|
+
- Blast-radius control: risky refactor runs in worktree, not on main tree
|
|
39
|
+
|
|
40
|
+
## Why This Matters
|
|
41
|
+
|
|
42
|
+
Without isolation, subagents are just named prompts. With isolation, they become:
|
|
43
|
+
|
|
44
|
+
1. **Context multipliers**: 10 subagents each with 200K context = 2M effective context across the session
|
|
45
|
+
2. **Safety boundaries**: Read-only subagent physically cannot write files (not just "promised not to")
|
|
46
|
+
3. **Parallelism enablers**: Multiple subagents editing in parallel worktrees, merges handled after completion
|
|
47
|
+
4. **Blast-radius limiters**: Risky operations contained within worktree, discardable on failure
|
|
48
|
+
|
|
49
|
+
## What Subagents CANNOT Do
|
|
50
|
+
- Spawn their own subagents (one level only — prevents infinite recursion)
|
|
51
|
+
- Access parent conversation history (fresh context only)
|
|
52
|
+
- Access plugin subagent capabilities (hooks, MCP servers, permissionMode — security boundary)
|
|
53
|
+
- Survive parent session termination (temporary by design)
|
|
54
|
+
|
|
55
|
+
## Integration with P25 Subagent Router
|
|
56
|
+
|
|
57
|
+
Our current P25 (Subagent Specialization Router) dispatches by task type but lacks:
|
|
58
|
+
- Fresh context per subagent (currently shares parent context)
|
|
59
|
+
- Worktree filesystem isolation
|
|
60
|
+
- Sidechain transcripts (currently all output goes to parent)
|
|
61
|
+
- Per-subagent tool restrictions (currently full tool access)
|
|
62
|
+
- Custom subagent definitions in YAML (currently only hardcoded router logic)
|
|
63
|
+
|
|
64
|
+
**Proposed**: P25 evolves to P25b — full subagent isolation with worktree support. See harness-implementation-plan for phase specification.
|
|
65
|
+
|
|
66
|
+
## Security Model
|
|
67
|
+
|
|
68
|
+
Plugin subagents have additional restrictions: no `hooks`, `mcpServers`, or `permissionMode` in frontmatter. This prevents plugin-supplied subagents from inheriting privilege. For full subagent capability, define in `.claude/agents/` (user-controlled), not in plugin bundles.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: concept
|
|
3
|
+
status: developing
|
|
4
|
+
created: 2026-05-05
|
|
5
|
+
tags:
|
|
6
|
+
- agent-skills
|
|
7
|
+
- methodology
|
|
8
|
+
- discipline
|
|
9
|
+
- tdd
|
|
10
|
+
- workflow
|
|
11
|
+
related:
|
|
12
|
+
- "[[superpowers-github-repo]]"
|
|
13
|
+
- "[[superpowers-release-blog]]"
|
|
14
|
+
- "[[superpowers-termdock-analysis]]"
|
|
15
|
+
- "[[skill-first-architecture]]"
|
|
16
|
+
- "[[agent-skills-pattern]]"
|
|
17
|
+
- "[[policy-engine-pattern]]"
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Superpowers Methodology
|
|
21
|
+
|
|
22
|
+
## Definition
|
|
23
|
+
|
|
24
|
+
Superpowers is an agentic skills framework that gives AI coding agents a disciplined, structured software development methodology. It transforms agents from fast typists into disciplined engineering partners by enforcing process through hard gates — not suggestions, not best-practice advice, but mandatory workflows that block progress until conditions are met.
|
|
25
|
+
|
|
26
|
+
## Core Principles
|
|
27
|
+
|
|
28
|
+
1. **Discipline over intelligence** — A disciplined junior engineer ships more reliable code than a brilliant cowboy who skips process. AI agents are the same.
|
|
29
|
+
2. **Hard gates over suggestions** — "Always write tests first" in CLAUDE.md is a suggestion that gets ignored under pressure. "NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST. Write code before the test? Delete it." is a gate that cannot be bypassed.
|
|
30
|
+
3. **Composable workflow** — Each skill's output is the next skill's input. Brainstorming → spec → plan → tasks → subagent implementation → code review → merge. The compounding effect matters more than individual skill quality.
|
|
31
|
+
4. **Fresh context per task** — Subagents start clean with only task description and relevant context, not full conversation history. Prevents context pollution and drift.
|
|
32
|
+
5. **Progressive disclosure** — Skills load only name and description at startup (~100 tokens each). Full instructions load on demand when task matches.
|
|
33
|
+
|
|
34
|
+
## The Brainstorm → Plan → Implement → Review Pipeline
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
User describes goal
|
|
38
|
+
↓
|
|
39
|
+
[brainstorming] — Ask clarifying questions, explore alternatives, present design in sections
|
|
40
|
+
↓ (user approves design)
|
|
41
|
+
[using-git-worktrees] — Create isolated branch, verify clean test baseline
|
|
42
|
+
↓
|
|
43
|
+
[writing-plans] — Break into 2-5 min tasks with exact file paths, code, verification steps
|
|
44
|
+
↓ (user approves plan)
|
|
45
|
+
[subagent-driven-development] — Dispatch fresh subagent per task
|
|
46
|
+
↓ per task
|
|
47
|
+
[test-driven-development] — RED: write failing test → GREEN: minimal code to pass → REFACTOR
|
|
48
|
+
↓
|
|
49
|
+
[requesting-code-review] — Review against plan, report by severity, critical = block
|
|
50
|
+
↓
|
|
51
|
+
[finishing-a-development-branch] — Verify tests, present merge/PR options, clean up
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Two Types of Enforcement
|
|
55
|
+
|
|
56
|
+
| Skill Type | Enforcement | Examples |
|
|
57
|
+
|-----------|-------------|----------|
|
|
58
|
+
| **Rigid (Iron Laws)** | Hard gates, delete-and-restart consequences | TDD, systematic debugging |
|
|
59
|
+
| **Adaptive (Structured)** | Checklist, hard gate on entry, flexible execution | Brainstorming, writing plans |
|
|
60
|
+
| **Advisory** | Reports findings, human decides | Code review |
|
|
61
|
+
|
|
62
|
+
## Why Hard Gates Work
|
|
63
|
+
|
|
64
|
+
LLMs are trained to be helpful, which means they rush to produce output. A prompt saying "write tests first" competes with the model's default helpfulness bias. A hard gate saying "NO production code without a failing test first — delete code written before tests" creates a structural constraint the model cannot bypass without explicitly violating its instructions. The model follows because it understands principles, not because it was told to follow blindly.
|
|
65
|
+
|
|
66
|
+
## Relationship to Our Harness
|
|
67
|
+
|
|
68
|
+
Superpowers and our harness share the same mission (discipline for AI agents) but operate at different levels:
|
|
69
|
+
|
|
70
|
+
| Dimension | Superpowers | Our Harness |
|
|
71
|
+
|-----------|-------------|-------------|
|
|
72
|
+
| **Enforcement** | Probabilistic (model compliance with skill instructions) | Deterministic (code-level drift monitor, pre-execution gates) |
|
|
73
|
+
| **Architecture** | Markdown skills only | Skills + TypeScript code (drift monitor, config, types) |
|
|
74
|
+
| **Scope** | Development methodology | Full agentic pipeline (spec, plan, execute, verify, observe, memory) |
|
|
75
|
+
| **Portability** | Any SKILL.md-compatible agent | Pi-specific (TypeScript extension API) |
|
|
76
|
+
| **Trigger** | Agent self-selects skills by description match | Harness layers fire at deterministic pipeline stages |
|
|
77
|
+
|
|
78
|
+
Superpowers validates our skill-first architecture choice and can be USED WITHIN our harness — as a `.pi/skills/superpowers/` skill set that the agent loads. But Superpowers cannot replace our code-level enforcement (drift monitor) because its enforcement is only as strong as the agent's compliance with the skill instructions.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: concept
|
|
3
|
+
title: Think in Code
|
|
4
|
+
created: 2026-04-30
|
|
5
|
+
updated: 2026-04-30
|
|
6
|
+
tags:
|
|
7
|
+
- context-optimization
|
|
8
|
+
- agentic-harness
|
|
9
|
+
- paradigm
|
|
10
|
+
status: developing
|
|
11
|
+
related:
|
|
12
|
+
- "[[context-mode]]"
|
|
13
|
+
- "[[agentic-harness-context-enforcement]]"
|
|
14
|
+
sources:
|
|
15
|
+
- "[[think-in-code-blog]]"
|
|
16
|
+
- "[[context-mode-website]]"
|
|
17
|
+
|
|
18
|
+
---# Think in Code
|
|
19
|
+
|
|
20
|
+
A paradigm for AI coding agents where the agent writes code to process data instead of reading raw data into the context window for mental processing.
|
|
21
|
+
|
|
22
|
+
## Definition
|
|
23
|
+
|
|
24
|
+
> When you need to analyze, count, filter, compare, or process data, write code that does the work and output only the answer. Don't read raw data into context to process mentally.
|
|
25
|
+
|
|
26
|
+
## Origin
|
|
27
|
+
|
|
28
|
+
Introduced by B. Mert Köseoğlu in context-mode v1.0.64 (2026). Mandatory across all 14 platform instruction files.
|
|
29
|
+
|
|
30
|
+
## Mechanism
|
|
31
|
+
|
|
32
|
+
1. Agent encounters a task requiring data analysis (count files, filter errors, parse JSON, compare configs)
|
|
33
|
+
2. Instead of calling `Read()` on each file, agent writes a JavaScript/TypeScript script
|
|
34
|
+
3. Script runs in sandbox via `ctx_execute()` MCP tool (Node.js built-ins only, no npm)
|
|
35
|
+
4. Only `console.log()` output enters the conversation
|
|
36
|
+
5. Results are 200× smaller in context
|
|
37
|
+
|
|
38
|
+
## Enforcing in Agentic Harness
|
|
39
|
+
|
|
40
|
+
To enforce "Think in Code" in any agentic harness:
|
|
41
|
+
|
|
42
|
+
### Method 1: System Prompt Injection
|
|
43
|
+
Add the rule to the agent's AGENTS.md or equivalent instruction file:
|
|
44
|
+
```markdown
|
|
45
|
+
## Think in Code (MANDATORY)
|
|
46
|
+
When you need to analyze, count, filter, compare, or process data,
|
|
47
|
+
write code (JavaScript/Python) that does the work. Output only the
|
|
48
|
+
answer. Do NOT read raw data into context for mental processing.
|
|
49
|
+
Use built-ins only. No package installs. Always try/catch.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Method 2: PreToolUse Hook
|
|
53
|
+
Intercept `Read()`, `Bash()`, `WebFetch()` calls and check if the call looks like data analysis. Redirect to a sandbox execution tool.
|
|
54
|
+
|
|
55
|
+
### Method 3: PostToolUse Compression
|
|
56
|
+
When large output enters context, automatically summarize/gist it and store raw data in a searchable index (FTS5 or similar). Mark the raw data as reference-only.
|
|
57
|
+
|
|
58
|
+
### Method 4: MCP Execution Tool
|
|
59
|
+
Provide an `execute()` MCP tool that runs code in a sandbox. The agent learns to prefer this over raw reads because it's faster and cheaper.
|
|
60
|
+
|
|
61
|
+
## Efficiency Gains (claimed)
|
|
62
|
+
|
|
63
|
+
| Before | After | Reduction |
|
|
64
|
+
|--------|-------|-----------|
|
|
65
|
+
| 47 files × Read() = 700 KB | 1 ctx_execute() = 3.6 KB | 200× |
|
|
66
|
+
| 20 tool calls = 600 KB | Same work, 20 KB | 30× |
|
|
67
|
+
| Cloudflare 2,500+ endpoints | 2 tools, ~1,000 tokens | 60× |
|
|
68
|
+
|
|
69
|
+
## Related Patterns
|
|
70
|
+
|
|
71
|
+
- **Cloudflare Code Mode**: Same concept for Workers API. LLM writes TypeScript, runs in V8 isolate (Dynamic Workers).
|
|
72
|
+
- **Code Interpreter**: Similar to ChatGPT's code interpreter but for local agent tool calls.
|
|
73
|
+
- **Output Compression**: context-mode's companion technique — strip filler words from agent responses (65-75% output reduction).
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: concept
|
|
3
|
+
title: "TypeScript Execution Layer"
|
|
4
|
+
created: 2026-05-01
|
|
5
|
+
updated: 2026-05-01
|
|
6
|
+
tags:
|
|
7
|
+
- agent-tools
|
|
8
|
+
- typescript-execution-layer
|
|
9
|
+
- sandbox
|
|
10
|
+
- context-optimization
|
|
11
|
+
- harness
|
|
12
|
+
status: developing
|
|
13
|
+
related:
|
|
14
|
+
- "[[mcp-tool-routing]]"
|
|
15
|
+
- "[[think-in-code-enforcement]]"
|
|
16
|
+
- "[[agentic-harness-context-enforcement]]"
|
|
17
|
+
- "[[harness-implementation-plan]]"
|
|
18
|
+
- "[[Research: executor.sh Harness Integration]]"
|
|
19
|
+
sources:
|
|
20
|
+
- "[[codeact-apple-2024]]"
|
|
21
|
+
- "[[cloudflare-codemode]]"
|
|
22
|
+
- "[[executor-rhyssullivan]]"
|
|
23
|
+
- "[[colinmcnamara-context-optimization-codemode]]"
|
|
24
|
+
|
|
25
|
+
---# TypeScript Execution Layer
|
|
26
|
+
|
|
27
|
+
Pattern for AI agent tool calling: instead of exposing dozens of tools as individual function calls in the LLM context, give the agent a **single "write TypeScript" tool** plus a **sandboxed TypeScript runtime** with a typed API surface for all tools. The LLM writes code; the runtime executes it; only results return to context.
|
|
28
|
+
|
|
29
|
+
## The Problem: Tool Context Bloat
|
|
30
|
+
|
|
31
|
+
Traditional MCP-based tool calling loads every tool definition into the LLM's context window:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
System prompt (~500 tokens)
|
|
35
|
+
+ Tool definitions for 10 MCP servers (~5,000 tokens)
|
|
36
|
+
+ Conversation history (~2,000 tokens)
|
|
37
|
+
+ Tool call/response pairs (~3,000 tokens per interaction)
|
|
38
|
+
= ~10,500+ tokens per turn
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Each additional MCP server adds 300-800 tokens of tool definitions. Organizations with 50+ MCP servers face impossible context budgets. Agents get "dumber" as more tools are added. Teams constantly enable/disable tools to prevent overload.
|
|
42
|
+
|
|
43
|
+
## The Solution: Code as Execution Layer
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
System prompt with coding instructions (~400 tokens)
|
|
47
|
+
+ TypeScript API type definitions (~2,000 tokens)
|
|
48
|
+
+ Generated code (~500 tokens)
|
|
49
|
+
+ Execution results only (~200 tokens)
|
|
50
|
+
= ~3,100 tokens per turn
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**~3-4x context reduction.** Multi-step workflows that would require 5-10 round-trips with traditional tool calling become one code generation turn.
|
|
54
|
+
|
|
55
|
+
## Why TypeScript (Not Python, Not JSON, Not Bash)
|
|
56
|
+
|
|
57
|
+
| Approach | Strengths | Weaknesses |
|
|
58
|
+
|----------|-----------|------------|
|
|
59
|
+
| **JSON tool-calling** | Simple, structured | No control flow, no composition, verbose for multi-step |
|
|
60
|
+
| **Bash execution** | LLMs good at Bash, discoverable | No fine-grained auth, dangerous, platform-specific |
|
|
61
|
+
| **Python (CodeAct)** | Rich libraries, interpreter errors | 60+ point gap open vs closed models, sandboxing hard |
|
|
62
|
+
| **TypeScript** | Massive training data, type guardrails, Node.js ecosystem | Requires sandbox infra, JS-only |
|
|
63
|
+
|
|
64
|
+
TypeScript advantages for agent code generation:
|
|
65
|
+
1. **Rich training data**: Millions of TS/JS repos in pretraining
|
|
66
|
+
2. **Type safety as guardrails**: Generated types guide correct API usage
|
|
67
|
+
3. **Deterministic execution**: Code runs predictably once generated
|
|
68
|
+
4. **Node.js ecosystem**: Huge library surface for data processing
|
|
69
|
+
|
|
70
|
+
## Implementations
|
|
71
|
+
|
|
72
|
+
| System | Sandbox | Language | Key Feature |
|
|
73
|
+
|--------|---------|----------|-------------|
|
|
74
|
+
| **CodeAct** (Apple 2024) | Python interpreter | Python | Foundation research, 20% improvement |
|
|
75
|
+
| **Cloudflare Code Mode** (2025) | V8 Worker isolates | TypeScript | Network isolation, RPC dispatch |
|
|
76
|
+
| **Executor** (RhysSullivan 2026) | Local Node.js runtime | TypeScript | Tool catalog, cross-agent sharing |
|
|
77
|
+
|
|
78
|
+
## Harness Integration
|
|
79
|
+
|
|
80
|
+
For the ultimate-pi harness, the TypeScript execution layer maps to a **new L3 tool phase**:
|
|
81
|
+
|
|
82
|
+
- All L3 tools (read, bash, edit, grep, find, ck_search) exposed as typed TS functions
|
|
83
|
+
- Agent gets single `write_ts` tool instead of 8-15 individual tools
|
|
84
|
+
- Code runs in sandboxed Node.js VM or Deno subprocess
|
|
85
|
+
- Tool calls dispatch via typed RPC back to harness
|
|
86
|
+
- Permission subsystem (P35) gates all tool calls within sandbox
|
|
87
|
+
- Extends P14 (Think-in-Code) from "write code for data analysis" to "write code to orchestrate tools"
|
|
88
|
+
|
|
89
|
+
See [[harness-implementation-plan]] for the P43 phase specification.
|
|
90
|
+
|
|
91
|
+
## Tradeoffs
|
|
92
|
+
|
|
93
|
+
| Pro | Con |
|
|
94
|
+
|-----|-----|
|
|
95
|
+
| 3-4x context reduction | Requires sandbox infrastructure |
|
|
96
|
+
| Multi-step in one turn | Permissioning moves to execution layer |
|
|
97
|
+
| Richer control flow, error handling | LLM must generate valid TypeScript |
|
|
98
|
+
| Deterministic execution | Sandbox escape is a security concern |
|
|
99
|
+
| Type guardrails reduce errors | Not all models equally good at TS |
|
|
100
|
+
| Tool discovery without context load | Requires type generation from tool schemas |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: concept
|
|
3
|
+
status: developing
|
|
4
|
+
tags:
|
|
5
|
+
- typescript
|
|
6
|
+
- strict-mode
|
|
7
|
+
- type-safety
|
|
8
|
+
related:
|
|
9
|
+
- "[[ts-strict-mode-rishikc]]"
|
|
10
|
+
- "[[Research: TypeScript Best Practices and Codebase Structure]]"
|
|
11
|
+
created: 2026-05-02
|
|
12
|
+
updated: 2026-05-02
|
|
13
|
+
|
|
14
|
+
---# TypeScript Strict Mode
|
|
15
|
+
|
|
16
|
+
The `"strict": true` compiler option in `tsconfig.json` enables a suite of type-checking flags that catch entire categories of runtime errors at compile time.
|
|
17
|
+
|
|
18
|
+
## Sub-flags Enabled
|
|
19
|
+
|
|
20
|
+
| Flag | What it catches |
|
|
21
|
+
|------|----------------|
|
|
22
|
+
| `noImplicitAny` | Variables/functions without explicit types fall back to `any` |
|
|
23
|
+
| `strictNullChecks` | `null` and `undefined` treated as distinct types, must be handled |
|
|
24
|
+
| `strictFunctionTypes` | Enforces contravariance on function parameter types |
|
|
25
|
+
| `strictPropertyInitialization` | Class properties must be initialized |
|
|
26
|
+
| `noImplicitThis` | `this` must be explicitly typed in functions |
|
|
27
|
+
| `strictBindCallApply` | Type-checks `.bind`, `.call`, `.apply` arguments |
|
|
28
|
+
| `alwaysStrict` | Emits `"use strict"` and prevents `with` statements |
|
|
29
|
+
| `useUnknownInCatchVariables` | Catch variables are `unknown`, not `any` |
|
|
30
|
+
|
|
31
|
+
## Consensus
|
|
32
|
+
|
|
33
|
+
All authoritative sources agree: enable `"strict": true` for new projects. For existing codebases, migrate incrementally — enable one flag at a time, fix errors per module.
|
|
34
|
+
|
|
35
|
+
## Pair With
|
|
36
|
+
|
|
37
|
+
ESLint `@typescript-eslint/recommended-type-checked` for defense-in-depth. Strict mode catches type issues; ESLint catches behavioral issues like floating promises.
|