context-type-system
Govern LLM prompt context through four partitioned semantic channels with immutable provenance ledgers, tool output elevation, and quota-budgeted assembly. Do not use for generic text summarization, unpartitioned prompt concatenation, or ad-hoc string formatting.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- context-type-system
- cluster
- memory_and_epistemics
- description
- Govern LLM prompt context through four partitioned semantic channels with immutable provenance ledgers, tool output elevation, and quota-budgeted assembly. Do not use for generic text summarization, unpartitioned prompt concatenation, or ad-hoc string formatting.
02 资源文件 1
- 参考文档CARD.md2.4 KB
03 SKILL.md 正文
Context Type System & Semantic Provenance Ledger
Overview
The context-type-system skill governs the assembly, provenance tracking, and type enforcement of LLM context windows. It segregates prompt inputs into four immutable semantic channels:
instruction: High-priority operational directives and developer task goals.evidence: Formally validated observations, grep extracts, and test results.memory: Long-term or working-memory state recalled from external stores.tool_output: Unsanitized raw outputs from shell commands, APIs, or subprocess tools.
Cross-channel transitions are strictly governed by policy: raw tool_output can never be injected as instruction (preventing indirect prompt injection), and can only elevate to evidence after passing structural or schema validation.
┌─────────────────────────────────────────────────────────────┐
│ Context Pipeline │
└──────────────────────────────┬──────────────────────────────┘
│
┌───────────────────────┼───────────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Instruction │ │ Memory │ │ Tool Output │
│ (Protected) │ │ (Recalled) │ │ (Unverified) │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ │ │
│ │ ▼ validate_tool_output
│ │ ┌──────────────┐
│ │ │ Evidence │
│ │ │ (Elevated) │
│ │ └──────┬───────┘
│ │ │
└───────────────────────┼───────────────────────┘
▼
┌───────────────────────────────┐
│ Context Assembler (Quota) │
└───────────────┬───────────────┘
▼
┌───────────────────────────────┐
│ Rendered Budgeted Prompt │
└───────────────────────────────┘
Visual Brief
Architecture
- Provenance Ledger: Tracks initial item registration and subsequent transformation hops back to the root observation.
- Budget Allocator: Ensures context windows do not exceed token caps while allocating reserved quotas to each semantic channel.
- Policy Enforcement: Prevents unauthorized channel hops and logs audit trails.
Verification Flow
- Register inputs via
harness context add. - Inspect or elevate tool results via
harness context validate-tool. - Assemble budgeted prompt with
harness context assemble. - Audit lineage via
harness context ledger.
Workflow Steps
Phase 1: Context Ingestion and Channel Tagging
Register inputs into their designated channels:
harness context add --session my-run --type instruction --content "Refactor auth module"
harness context add --session my-run --type memory --content "Previous fix in commit abc1234"
Phase 2: Tool Execution and Validation
Stage raw tool output and promote to evidence:
harness context validate-tool --session my-run --tool-name "git-status" --output-json '{"status": "clean"}'
Phase 3: Budgeted Assembly
Render the assembled prompt partitioned by semantic headers:
harness context assemble --session my-run --budget-tokens 4000 --json
Phase 4: Provenance Audit
Trace multi-hop Isnad provenance:
harness context ledger --session my-run --json
Mandatory Checkpoints
- [ ] Channel Isolation: Verify that raw
tool_outputcannot be registered asinstruction. - [ ] Validation Gate: Verify that
validate-toolpromotes items with a newly generatedevidenceID. - [ ] Budget Cap: Verify that assembled tokens do not exceed the specified budget ceiling.
Anti-Patterns
- Raw String Splice — Concatenating untyped raw tool outputs directly into agent instructions.
- Unverified Promotion — Elevating tool output to evidence without structural or schema validation.
- Unbudgeted Assembly — Rendering prompts without token ceilings or channel quotas.
- Unlinked Transformations — Mutating item types without recording parent lineage in the provenance ledger.
Related Skills & Docs
04 同仓库更多 Skills
ui-behavior-primitive-architect
Architect, audit, and verify zero-dependency headless UI behavior primitives, WebMCP agent bridges, WAI-ARIA/SSR/RTL tri-modal checks, and framework expert routing. Do not use for static CSS theme styling or backend database migrations.
trustgraph-ontology-governor
Govern knowledge graphs, SHACL-AF triple policies, OntologyRAG subclass validation, PROV-O dual named graphs, and Laya entropy decision scoring. Do not use for relational SQL queries or generic web scraping.
shim-harness-governor
Govern universal CLI agent loops, 4-tier tool permissions, ancestor-symlink workspace sandboxes, deterministic-first command routing, collision-safe MCP namespacing, and layered skill loading. Do not use for static UI styling or external SQL analytics.
graphiti-zep-memory-governor
Govern bi-temporal knowledge graphs with Graphiti future-edge clamping, MinHash/LSH entity dedup, RRF/MMR reranking, and Zep typed ontologies. Do not use for static SQL joins or generic web crawling.
agora-mcp-workbench-architect
Architect, audit, and orchestrate Agora Workbench MCP servers, loopback sidecars, unified state graphs, gateway/dispatcher connectors, and policy-enforced data lakes. Do not use for static frontend CSS styling or non-MCP desktop GUI automation.
skill-eval-assurance-runner
Evaluate and assure agent skills using small-N Wilson confidence intervals, unbiased pass^k reliability, deterministic trajectory graders, preflight boundary honesty, and sealed digest verification. Do not use for subjective prose review or unconstrained production deployment.