arscontexta 0.6.0
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/.claude-plugin/marketplace.json +11 -0
- package/.claude-plugin/plugin.json +22 -0
- package/README.md +683 -0
- package/agents/knowledge-guide.md +49 -0
- package/bin/cli.mjs +66 -0
- package/generators/agents-md.md +240 -0
- package/generators/claude-md.md +379 -0
- package/generators/features/atomic-notes.md +124 -0
- package/generators/features/ethical-guardrails.md +58 -0
- package/generators/features/graph-analysis.md +188 -0
- package/generators/features/helper-functions.md +92 -0
- package/generators/features/maintenance.md +164 -0
- package/generators/features/methodology-knowledge.md +70 -0
- package/generators/features/mocs.md +144 -0
- package/generators/features/multi-domain.md +61 -0
- package/generators/features/personality.md +71 -0
- package/generators/features/processing-pipeline.md +428 -0
- package/generators/features/schema.md +149 -0
- package/generators/features/self-evolution.md +229 -0
- package/generators/features/self-space.md +78 -0
- package/generators/features/semantic-search.md +99 -0
- package/generators/features/session-rhythm.md +85 -0
- package/generators/features/templates.md +85 -0
- package/generators/features/wiki-links.md +88 -0
- package/generators/soul-md.md +121 -0
- package/hooks/hooks.json +45 -0
- package/hooks/scripts/auto-commit.sh +44 -0
- package/hooks/scripts/session-capture.sh +35 -0
- package/hooks/scripts/session-orient.sh +86 -0
- package/hooks/scripts/write-validate.sh +42 -0
- package/methodology/AI shifts knowledge systems from externalizing memory to externalizing attention.md +59 -0
- package/methodology/BM25 retrieval fails on full-length descriptions because query term dilution reduces match scores.md +39 -0
- package/methodology/IBIS framework maps claim-based architecture to structured argumentation.md +58 -0
- package/methodology/LLM attention degrades as context fills.md +49 -0
- package/methodology/MOC construction forces synthesis that automated generation from metadata cannot replicate.md +49 -0
- package/methodology/MOC maintenance investment compounds because orientation savings multiply across every future session.md +41 -0
- package/methodology/MOCs are attention management devices not just organizational tools.md +51 -0
- package/methodology/PKM failure follows a predictable cycle.md +50 -0
- package/methodology/ThreadMode to DocumentMode transformation is the core value creation step.md +52 -0
- package/methodology/WIP limits force processing over accumulation.md +53 -0
- package/methodology/Zeigarnik effect validates capture-first philosophy because open loops drain attention.md +42 -0
- package/methodology/academic research uses structured extraction with cross-source synthesis.md +566 -0
- package/methodology/adapt the four-phase processing pipeline to domain-specific throughput needs.md +197 -0
- package/methodology/agent notes externalize navigation intuition that search cannot discover and traversal cannot reconstruct.md +48 -0
- package/methodology/agent self-memory should be architecturally separate from user knowledge systems.md +48 -0
- package/methodology/agent session boundaries create natural automation checkpoints that human-operated systems lack.md +56 -0
- package/methodology/agent-cognition.md +107 -0
- package/methodology/agents are simultaneously methodology executors and subjects creating a unique trust asymmetry.md +66 -0
- package/methodology/aspect-oriented programming solved the same cross-cutting concern problem that hooks solve.md +39 -0
- package/methodology/associative ontologies beat hierarchical taxonomies because heterarchy adapts while hierarchy brittles.md +53 -0
- package/methodology/attention residue may have a minimum granularity that cannot be subdivided.md +46 -0
- package/methodology/auto-commit hooks eliminate prospective memory failures by converting remember-to-act into guaranteed execution.md +47 -0
- package/methodology/automated detection is always safe because it only reads state while automated remediation risks content corruption.md +42 -0
- package/methodology/automation should be retired when its false positive rate exceeds its true positive rate or it catches zero issues.md +56 -0
- package/methodology/backlinks implicitly define notes by revealing usage context.md +35 -0
- package/methodology/backward maintenance asks what would be different if written today.md +62 -0
- package/methodology/balance onboarding enforcement and questions to prevent premature complexity.md +229 -0
- package/methodology/basic level categorization determines optimal MOC granularity.md +51 -0
- package/methodology/batching by context similarity reduces switching costs in agent processing.md +43 -0
- package/methodology/behavioral anti-patterns matter more than tool selection.md +42 -0
- package/methodology/betweenness centrality identifies bridge notes connecting disparate knowledge domains.md +57 -0
- package/methodology/blueprints that teach construction outperform downloads that provide pre-built code for platform-dependent modules.md +42 -0
- package/methodology/bootstrapping principle enables self-improving systems.md +62 -0
- package/methodology/build automatic memory through cognitive offloading and session handoffs.md +285 -0
- package/methodology/capture the reaction to content not just the content itself.md +41 -0
- package/methodology/claims must be specific enough to be wrong.md +36 -0
- package/methodology/closure rituals create clean breaks that prevent attention residue bleed.md +44 -0
- package/methodology/cognitive offloading is the architectural foundation for vault design.md +46 -0
- package/methodology/cognitive outsourcing risk in agent-operated systems.md +55 -0
- package/methodology/coherence maintains consistency despite inconsistent inputs.md +96 -0
- package/methodology/coherent architecture emerges from wiki links spreading activation and small-world topology.md +48 -0
- package/methodology/community detection algorithms can inform when MOCs should split or merge.md +52 -0
- package/methodology/complete navigation requires four complementary types that no single mechanism provides.md +43 -0
- package/methodology/complex systems evolve from simple working systems.md +59 -0
- package/methodology/composable knowledge architecture builds systems from independent toggleable modules not monolithic templates.md +61 -0
- package/methodology/compose multi-domain systems through separate templates and shared graph.md +372 -0
- package/methodology/concept-orientation beats source-orientation for cross-domain connections.md +51 -0
- package/methodology/confidence thresholds gate automated action between the mechanical and judgment zones.md +50 -0
- package/methodology/configuration dimensions interact so choices in one create pressure on others.md +58 -0
- package/methodology/configuration paralysis emerges when derivation surfaces too many decisions.md +44 -0
- package/methodology/context files function as agent operating systems through self-referential self-extension.md +46 -0
- package/methodology/context phrase clarity determines how deep a navigation hierarchy can scale.md +46 -0
- package/methodology/continuous small-batch processing eliminates review dread.md +48 -0
- package/methodology/controlled disorder engineers serendipity through semantic rather than topical linking.md +51 -0
- package/methodology/creative writing uses worldbuilding consistency with character tracking.md +672 -0
- package/methodology/cross-links between MOC territories indicate creative leaps and integration depth.md +43 -0
- package/methodology/dangling links reveal which notes want to exist.md +62 -0
- package/methodology/data exit velocity measures how quickly content escapes vendor lock-in.md +74 -0
- package/methodology/decontextualization risk means atomicity may strip meaning that cannot be recovered.md +48 -0
- package/methodology/dense interlinked research claims enable derivation while sparse references only enable templating.md +47 -0
- package/methodology/dependency resolution through topological sort makes module composition transparent and verifiable.md +56 -0
- package/methodology/derivation generates knowledge systems from composable research claims not template customization.md +63 -0
- package/methodology/derivation-engine.md +27 -0
- package/methodology/derived systems follow a seed-evolve-reseed lifecycle.md +56 -0
- package/methodology/description quality for humans diverges from description quality for keyword search.md +73 -0
- package/methodology/descriptions are retrieval filters not summaries.md +112 -0
- package/methodology/design MOCs as attention management devices with lifecycle governance.md +318 -0
- package/methodology/design-dimensions.md +66 -0
- package/methodology/digital mutability enables note evolution that physical permanence forbids.md +54 -0
- package/methodology/discovery-retrieval.md +48 -0
- package/methodology/distinctiveness scoring treats description quality as measurable.md +69 -0
- package/methodology/does agent processing recover what fast capture loses.md +43 -0
- package/methodology/domain-compositions.md +37 -0
- package/methodology/dual-coding with visual elements could enhance agent traversal.md +55 -0
- package/methodology/each module must be describable in one sentence under 200 characters or it does too many things.md +45 -0
- package/methodology/each new note compounds value by creating traversal paths.md +55 -0
- package/methodology/eight configuration dimensions parameterize the space of possible knowledge systems.md +56 -0
- package/methodology/elaborative encoding is the quality gate for new notes.md +55 -0
- package/methodology/enforce schema with graduated strictness across capture processing and query zones.md +221 -0
- package/methodology/enforcing atomicity can create paralysis when ideas resist decomposition.md +43 -0
- package/methodology/engineering uses technical decision tracking with architectural memory.md +766 -0
- package/methodology/every knowledge domain shares a four-phase processing skeleton that diverges only in the process step.md +53 -0
- package/methodology/evolution observations provide actionable signals for system adaptation.md +67 -0
- package/methodology/external memory shapes cognition more than base model.md +60 -0
- package/methodology/faceted classification treats notes as multi-dimensional objects rather than folder contents.md +65 -0
- package/methodology/failure-modes.md +27 -0
- package/methodology/false universalism applies same processing logic regardless of domain.md +49 -0
- package/methodology/federated wiki pattern enables multi-agent divergence as feature not bug.md +59 -0
- package/methodology/flat files break at retrieval scale.md +75 -0
- package/methodology/forced engagement produces weak connections.md +48 -0
- package/methodology/four abstraction layers separate platform-agnostic from platform-dependent knowledge system features.md +47 -0
- package/methodology/fresh context per task preserves quality better than chaining phases.md +44 -0
- package/methodology/friction reveals architecture.md +63 -0
- package/methodology/friction-driven module adoption prevents configuration debt by adding complexity only at pain points.md +48 -0
- package/methodology/gardening cycle implements tend prune fertilize operations.md +41 -0
- package/methodology/generation effect gate blocks processing without transformation.md +40 -0
- package/methodology/goal-driven memory orchestration enables autonomous domain learning through directed compute allocation.md +41 -0
- package/methodology/good descriptions layer heuristic then mechanism then implication.md +57 -0
- package/methodology/graph-structure.md +65 -0
- package/methodology/guided notes might outperform post-hoc structuring for high-volume capture.md +37 -0
- package/methodology/health wellness uses symptom-trigger correlation with multi-dimensional tracking.md +819 -0
- package/methodology/hook composition creates emergent methodology from independent single-concern components.md +47 -0
- package/methodology/hook enforcement guarantees quality while instruction enforcement merely suggests it.md +51 -0
- package/methodology/hook-driven learning loops create self-improving methodology through observation accumulation.md +62 -0
- package/methodology/hooks are the agent habit system that replaces the missing basal ganglia.md +40 -0
- package/methodology/hooks cannot replace genuine cognitive engagement yet more automation is always tempting.md +87 -0
- package/methodology/hooks enable context window efficiency by delegating deterministic checks to external processes.md +47 -0
- package/methodology/idempotent maintenance operations are safe to automate because running them twice produces the same result as running them once.md +44 -0
- package/methodology/implement condition-based maintenance triggers for derived systems.md +255 -0
- package/methodology/implicit dependencies create distributed monoliths that fail silently across configurations.md +58 -0
- package/methodology/implicit knowledge emerges from traversal.md +55 -0
- package/methodology/incremental formalization happens through repeated touching of old notes.md +60 -0
- package/methodology/incremental reading enables cross-source connection finding.md +39 -0
- package/methodology/index.md +32 -0
- package/methodology/inline links carry richer relationship data than metadata fields.md +91 -0
- package/methodology/insight accretion differs from productivity in knowledge systems.md +41 -0
- package/methodology/intermediate packets enable assembly over creation.md +52 -0
- package/methodology/intermediate representation pattern enables reliable vault operations beyond regex.md +62 -0
- package/methodology/justification chains enable forward backward and evolution reasoning about configuration decisions.md +46 -0
- package/methodology/knowledge system architecture is parameterized by platform capabilities not fixed by methodology.md +51 -0
- package/methodology/knowledge systems become communication partners through complexity and memory humans cannot sustain.md +47 -0
- package/methodology/knowledge systems share universal operations and structural components across all methodology traditions.md +46 -0
- package/methodology/legal case management uses precedent chains with regulatory change propagation.md +892 -0
- package/methodology/live index via periodic regeneration keeps discovery current.md +58 -0
- package/methodology/local-first file formats are inherently agent-native.md +69 -0
- package/methodology/logic column pattern separates reasoning from procedure.md +35 -0
- package/methodology/maintenance operations are more universal than creative pipelines because structural health is domain-invariant.md +47 -0
- package/methodology/maintenance scheduling frequency should match consequence speed not detection capability.md +50 -0
- package/methodology/maintenance targeting should prioritize mechanism and theory notes.md +26 -0
- package/methodology/maintenance-patterns.md +72 -0
- package/methodology/markdown plus YAML plus ripgrep implements a queryable graph database without infrastructure.md +55 -0
- package/methodology/maturity field enables agent context prioritization.md +33 -0
- package/methodology/memory-architecture.md +27 -0
- package/methodology/metacognitive confidence can diverge from retrieval capability.md +42 -0
- package/methodology/metadata reduces entropy enabling precision over recall.md +91 -0
- package/methodology/methodology development should follow the trajectory from documentation to skill to hook as understanding hardens.md +80 -0
- package/methodology/methodology traditions are named points in a shared configuration space not competing paradigms.md +64 -0
- package/methodology/mnemonic medium embeds verification into navigation.md +46 -0
- package/methodology/module communication through shared YAML fields creates loose coupling without direct dependencies.md +44 -0
- package/methodology/module deactivation must account for structural artifacts that survive the toggle.md +49 -0
- package/methodology/multi-domain systems compose through separate templates and shared graph.md +61 -0
- package/methodology/multi-domain-composition.md +27 -0
- package/methodology/narrow folksonomy optimizes for single-operator retrieval unlike broad consensus tagging.md +53 -0
- package/methodology/navigation infrastructure passes through distinct scaling regimes that require qualitative strategy shifts.md +48 -0
- package/methodology/navigational vertigo emerges in pure association systems without local hierarchy.md +54 -0
- package/methodology/note titles should function as APIs enabling sentence transclusion.md +51 -0
- package/methodology/note-design.md +57 -0
- package/methodology/notes are skills /342/200/224 curated knowledge injected when relevant.md" +62 -0
- package/methodology/notes function as cognitive anchors that stabilize attention during complex tasks.md +41 -0
- package/methodology/novel domains derive by mapping knowledge type to closest reference domain then adapting.md +50 -0
- package/methodology/nudge theory explains graduated hook enforcement as choice architecture for agents.md +59 -0
- package/methodology/observation and tension logs function as dead-letter queues for failed automation.md +51 -0
- package/methodology/operational memory and knowledge memory serve different functions in agent architecture.md +48 -0
- package/methodology/operational wisdom requires contextual observation.md +52 -0
- package/methodology/orchestrated vault creation transforms arscontexta from tool to autonomous knowledge factory.md +40 -0
- package/methodology/organic emergence versus active curation creates a fundamental vault governance tension.md +68 -0
- package/methodology/orphan notes are seeds not failures.md +38 -0
- package/methodology/over-automation corrupts quality when hooks encode judgment rather than verification.md +62 -0
- package/methodology/people relationships uses Dunbar-layered graphs with interaction tracking.md +659 -0
- package/methodology/personal assistant uses life area management with review automation.md +610 -0
- package/methodology/platform adapter translation is semantic not mechanical because hook event meanings differ.md +40 -0
- package/methodology/platform capability tiers determine which knowledge system features can be implemented.md +48 -0
- package/methodology/platform fragmentation means identical conceptual operations require different implementations across agent environments.md +44 -0
- package/methodology/premature complexity is the most common derivation failure mode.md +45 -0
- package/methodology/prevent domain-specific failure modes through the vulnerability matrix.md +336 -0
- package/methodology/processing effort should follow retrieval demand.md +57 -0
- package/methodology/processing-workflows.md +75 -0
- package/methodology/product management uses feedback pipelines with experiment tracking.md +789 -0
- package/methodology/productivity porn risk in meta-system building.md +30 -0
- package/methodology/programmable notes could enable property-triggered workflows.md +64 -0
- package/methodology/progressive disclosure means reading right not reading less.md +69 -0
- package/methodology/progressive schema validates only what active modules require not the full system schema.md +49 -0
- package/methodology/project management uses decision tracking with stakeholder context.md +776 -0
- package/methodology/propositional link semantics transform wiki links from associative to reasoned.md +87 -0
- package/methodology/prospective memory requires externalization.md +53 -0
- package/methodology/provenance tracks where beliefs come from.md +62 -0
- package/methodology/queries evolve during search so agents should checkpoint.md +35 -0
- package/methodology/question-answer metadata enables inverted search patterns.md +39 -0
- package/methodology/random note resurfacing prevents write-only memory.md +33 -0
- package/methodology/reconciliation loops that compare desired state to actual state enable drift correction without continuous monitoring.md +59 -0
- package/methodology/reflection synthesizes existing notes into new insight.md +100 -0
- package/methodology/retrieval utility should drive design over capture completeness.md +69 -0
- package/methodology/retrieval verification loop tests description quality at scale.md +81 -0
- package/methodology/role field makes graph structure explicit.md +94 -0
- package/methodology/scaffolding enables divergence that fine-tuning cannot.md +67 -0
- package/methodology/schema enforcement via validation agents enables soft consistency.md +60 -0
- package/methodology/schema evolution follows observe-then-formalize not design-then-enforce.md +65 -0
- package/methodology/schema field names are the only domain specific element in the universal note pattern.md +46 -0
- package/methodology/schema fields should use domain-native vocabulary not abstract terminology.md +47 -0
- package/methodology/schema templates reduce cognitive overhead at capture time.md +55 -0
- package/methodology/schema validation hooks externalize inhibitory control that degrades under cognitive load.md +48 -0
- package/methodology/schema-enforcement.md +27 -0
- package/methodology/self-extension requires context files to contain platform operations knowledge not just methodology.md +47 -0
- package/methodology/sense-making vs storage does compression lose essential nuance.md +73 -0
- package/methodology/session boundary hooks implement cognitive bookends for orientation and reflection.md +60 -0
- package/methodology/session handoff creates continuity without persistent memory.md +43 -0
- package/methodology/session outputs are packets for future selves.md +43 -0
- package/methodology/session transcript mining enables experiential validation that structural tests cannot provide.md +38 -0
- package/methodology/skill context budgets constrain knowledge system complexity on agent platforms.md +52 -0
- package/methodology/skills encode methodology so manual execution bypasses quality gates.md +50 -0
- package/methodology/small-world topology requires hubs and dense local links.md +99 -0
- package/methodology/source attribution enables tracing claims to foundations.md +38 -0
- package/methodology/spaced repetition scheduling could optimize vault maintenance.md +44 -0
- package/methodology/spreading activation models how agents should traverse.md +79 -0
- package/methodology/stale navigation actively misleads because agents trust curated maps completely.md +43 -0
- package/methodology/stigmergy coordinates agents through environmental traces without direct communication.md +62 -0
- package/methodology/storage versus thinking distinction determines which tool patterns apply.md +56 -0
- package/methodology/structure enables navigation without reading everything.md +52 -0
- package/methodology/structure without processing provides no value.md +56 -0
- package/methodology/student learning uses prerequisite graphs with spaced retrieval.md +770 -0
- package/methodology/summary coherence tests composability before filing.md +37 -0
- package/methodology/tag rot applies to wiki links because titles serve as both identifier and display text.md +50 -0
- package/methodology/temporal media must convert to spatial text for agent traversal.md +43 -0
- package/methodology/temporal processing priority creates age-based inbox urgency.md +45 -0
- package/methodology/temporal separation of capture and processing preserves context freshness.md +39 -0
- package/methodology/ten universal primitives form the kernel of every viable agent knowledge system.md +162 -0
- package/methodology/testing effect could enable agent knowledge verification.md +38 -0
- package/methodology/the AgentSkills standard embodies progressive disclosure at the skill level.md +40 -0
- package/methodology/the derivation engine improves recursively as deployed systems generate observations.md +49 -0
- package/methodology/the determinism boundary separates hook methodology from skill methodology.md +46 -0
- package/methodology/the fix-versus-report decision depends on determinism reversibility and accumulated trust.md +45 -0
- package/methodology/the generation effect requires active transformation not just storage.md +57 -0
- package/methodology/the no wrong patches guarantee ensures any valid module combination produces a valid system.md +58 -0
- package/methodology/the system is the argument.md +46 -0
- package/methodology/the vault constitutes identity for agents.md +86 -0
- package/methodology/the vault methodology transfers because it encodes cognitive science not domain specifics.md +47 -0
- package/methodology/therapy journal uses warm personality with pattern detection for emotional processing.md +584 -0
- package/methodology/three capture schools converge through agent-mediated synthesis.md +55 -0
- package/methodology/three concurrent maintenance loops operate at different timescales to catch different classes of problems.md +56 -0
- package/methodology/throughput matters more than accumulation.md +58 -0
- package/methodology/title as claim enables traversal as reasoning.md +50 -0
- package/methodology/topological organization beats temporal for knowledge work.md +52 -0
- package/methodology/trading uses conviction tracking with thesis-outcome correlation.md +699 -0
- package/methodology/trails transform ephemeral navigation into persistent artifacts.md +39 -0
- package/methodology/transform universal vocabulary to domain-native language through six levels.md +259 -0
- package/methodology/type field enables structured queries without folder hierarchies.md +53 -0
- package/methodology/use-case presets dissolve the tension between composability and simplicity.md +44 -0
- package/methodology/vault conventions may impose hidden rigidity on thinking.md +44 -0
- package/methodology/verbatim risk applies to agents too.md +31 -0
- package/methodology/vibe notetaking is the emerging industry consensus for AI-native self-organization.md +56 -0
- package/methodology/vivid memories need verification.md +45 -0
- package/methodology/vocabulary-transformation.md +27 -0
- package/methodology/voice capture is the highest-bandwidth channel for agent-delegated knowledge systems.md +45 -0
- package/methodology/wiki links are the digital evolution of analog indexing.md +73 -0
- package/methodology/wiki links as social contract transforms agents into stewards of incomplete references.md +52 -0
- package/methodology/wiki links create navigation paths that shape retrieval.md +63 -0
- package/methodology/wiki links implement GraphRAG without the infrastructure.md +101 -0
- package/methodology/writing for audience blocks authentic creation.md +22 -0
- package/methodology/you operate a system that takes notes.md +79 -0
- package/openclaw/SKILL.md +110 -0
- package/package.json +45 -0
- package/platforms/README.md +51 -0
- package/platforms/claude-code/generator.md +61 -0
- package/platforms/claude-code/hooks/README.md +186 -0
- package/platforms/claude-code/hooks/auto-commit.sh.template +38 -0
- package/platforms/claude-code/hooks/session-capture.sh.template +72 -0
- package/platforms/claude-code/hooks/session-orient.sh.template +189 -0
- package/platforms/claude-code/hooks/write-validate.sh.template +106 -0
- package/platforms/openclaw/generator.md +82 -0
- package/platforms/openclaw/hooks/README.md +89 -0
- package/platforms/openclaw/hooks/bootstrap.ts.template +224 -0
- package/platforms/openclaw/hooks/command-new.ts.template +165 -0
- package/platforms/openclaw/hooks/heartbeat.ts.template +214 -0
- package/platforms/shared/features/README.md +70 -0
- package/platforms/shared/skill-blocks/graph.md +145 -0
- package/platforms/shared/skill-blocks/learn.md +119 -0
- package/platforms/shared/skill-blocks/next.md +131 -0
- package/platforms/shared/skill-blocks/pipeline.md +326 -0
- package/platforms/shared/skill-blocks/ralph.md +616 -0
- package/platforms/shared/skill-blocks/reduce.md +1142 -0
- package/platforms/shared/skill-blocks/refactor.md +129 -0
- package/platforms/shared/skill-blocks/reflect.md +780 -0
- package/platforms/shared/skill-blocks/remember.md +524 -0
- package/platforms/shared/skill-blocks/rethink.md +574 -0
- package/platforms/shared/skill-blocks/reweave.md +680 -0
- package/platforms/shared/skill-blocks/seed.md +320 -0
- package/platforms/shared/skill-blocks/stats.md +145 -0
- package/platforms/shared/skill-blocks/tasks.md +171 -0
- package/platforms/shared/skill-blocks/validate.md +323 -0
- package/platforms/shared/skill-blocks/verify.md +562 -0
- package/platforms/shared/templates/README.md +35 -0
- package/presets/experimental/categories.yaml +1 -0
- package/presets/experimental/preset.yaml +38 -0
- package/presets/experimental/starter/README.md +7 -0
- package/presets/experimental/vocabulary.yaml +7 -0
- package/presets/personal/categories.yaml +7 -0
- package/presets/personal/preset.yaml +41 -0
- package/presets/personal/starter/goals.md +21 -0
- package/presets/personal/starter/index.md +17 -0
- package/presets/personal/starter/life-areas.md +21 -0
- package/presets/personal/starter/people.md +21 -0
- package/presets/personal/vocabulary.yaml +32 -0
- package/presets/research/categories.yaml +8 -0
- package/presets/research/preset.yaml +41 -0
- package/presets/research/starter/index.md +17 -0
- package/presets/research/starter/methods.md +21 -0
- package/presets/research/starter/open-questions.md +21 -0
- package/presets/research/vocabulary.yaml +33 -0
- package/reference/AUDIT-REPORT.md +238 -0
- package/reference/claim-map.md +172 -0
- package/reference/components.md +327 -0
- package/reference/conversation-patterns.md +542 -0
- package/reference/derivation-validation.md +649 -0
- package/reference/dimension-claim-map.md +134 -0
- package/reference/evolution-lifecycle.md +297 -0
- package/reference/failure-modes.md +235 -0
- package/reference/interaction-constraints.md +204 -0
- package/reference/kernel.yaml +242 -0
- package/reference/methodology.md +283 -0
- package/reference/open-questions.md +279 -0
- package/reference/personality-layer.md +302 -0
- package/reference/self-space.md +299 -0
- package/reference/semantic-vs-keyword.md +288 -0
- package/reference/session-lifecycle.md +298 -0
- package/reference/templates/base-note.md +16 -0
- package/reference/templates/companion-note.md +70 -0
- package/reference/templates/creative-note.md +16 -0
- package/reference/templates/learning-note.md +16 -0
- package/reference/templates/life-note.md +16 -0
- package/reference/templates/moc.md +26 -0
- package/reference/templates/relationship-note.md +17 -0
- package/reference/templates/research-note.md +19 -0
- package/reference/templates/session-log.md +24 -0
- package/reference/templates/therapy-note.md +16 -0
- package/reference/test-fixtures/edge-case-constraints.md +148 -0
- package/reference/test-fixtures/multi-domain.md +164 -0
- package/reference/test-fixtures/novel-domain-gaming.md +138 -0
- package/reference/test-fixtures/research-minimal.md +102 -0
- package/reference/test-fixtures/therapy-full.md +155 -0
- package/reference/testing-milestones.md +1087 -0
- package/reference/three-spaces.md +363 -0
- package/reference/tradition-presets.md +203 -0
- package/reference/use-case-presets.md +341 -0
- package/reference/validate-kernel.sh +432 -0
- package/reference/vocabulary-transforms.md +85 -0
- package/scripts/sync-thinking.sh +147 -0
- package/skill-sources/graph/SKILL.md +567 -0
- package/skill-sources/graph/skill.json +17 -0
- package/skill-sources/learn/SKILL.md +254 -0
- package/skill-sources/learn/skill.json +17 -0
- package/skill-sources/next/SKILL.md +407 -0
- package/skill-sources/next/skill.json +17 -0
- package/skill-sources/pipeline/SKILL.md +314 -0
- package/skill-sources/pipeline/skill.json +17 -0
- package/skill-sources/ralph/SKILL.md +604 -0
- package/skill-sources/ralph/skill.json +17 -0
- package/skill-sources/reduce/SKILL.md +1113 -0
- package/skill-sources/reduce/skill.json +17 -0
- package/skill-sources/refactor/SKILL.md +448 -0
- package/skill-sources/refactor/skill.json +17 -0
- package/skill-sources/reflect/SKILL.md +747 -0
- package/skill-sources/reflect/skill.json +17 -0
- package/skill-sources/remember/SKILL.md +534 -0
- package/skill-sources/remember/skill.json +17 -0
- package/skill-sources/rethink/SKILL.md +658 -0
- package/skill-sources/rethink/skill.json +17 -0
- package/skill-sources/reweave/SKILL.md +657 -0
- package/skill-sources/reweave/skill.json +17 -0
- package/skill-sources/seed/SKILL.md +303 -0
- package/skill-sources/seed/skill.json +17 -0
- package/skill-sources/stats/SKILL.md +371 -0
- package/skill-sources/stats/skill.json +17 -0
- package/skill-sources/tasks/SKILL.md +402 -0
- package/skill-sources/tasks/skill.json +17 -0
- package/skill-sources/validate/SKILL.md +310 -0
- package/skill-sources/validate/skill.json +17 -0
- package/skill-sources/verify/SKILL.md +532 -0
- package/skill-sources/verify/skill.json +17 -0
- package/skills/add-domain/SKILL.md +441 -0
- package/skills/add-domain/skill.json +17 -0
- package/skills/architect/SKILL.md +568 -0
- package/skills/architect/skill.json +17 -0
- package/skills/ask/SKILL.md +388 -0
- package/skills/ask/skill.json +17 -0
- package/skills/health/SKILL.md +760 -0
- package/skills/health/skill.json +17 -0
- package/skills/help/SKILL.md +348 -0
- package/skills/help/skill.json +17 -0
- package/skills/recommend/SKILL.md +553 -0
- package/skills/recommend/skill.json +17 -0
- package/skills/reseed/SKILL.md +385 -0
- package/skills/reseed/skill.json +17 -0
- package/skills/setup/SKILL.md +1688 -0
- package/skills/setup/skill.json +17 -0
- package/skills/tutorial/SKILL.md +496 -0
- package/skills/tutorial/skill.json +17 -0
- package/skills/upgrade/SKILL.md +395 -0
- package/skills/upgrade/skill.json +17 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# Search Modality Selection Reference
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Guide the derivation engine in selecting which search modalities a generated system should support, how they interact, and when each is appropriate. Search is a kernel primitive (semantic-search in kernel.yaml) but implementation varies dramatically by platform, volume, and processing intensity. The wrong search configuration produces either retrieval failures (missing semantic when needed) or wasted complexity (deploying hybrid search for a 30-note vault).
|
|
6
|
+
|
|
7
|
+
This document answers: given a derived system's configuration (volume, granularity, linking style, platform tier), which search modalities should be enabled, how should they be prioritized, and what fallback chains should be generated?
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Derivation Questions
|
|
12
|
+
|
|
13
|
+
Questions the engine must answer when generating search configuration:
|
|
14
|
+
|
|
15
|
+
1. **What is the expected note volume trajectory?** Low (<50), moderate (50-200), high (>200). Search modality requirements shift at each threshold.
|
|
16
|
+
2. **Does the linking dimension include implicit connections?** If linking = explicit+implicit, semantic search is structurally required — it IS the implicit linking mechanism.
|
|
17
|
+
3. **What platform tier is available?** Tier-1 (Claude Code with MCP) enables persistent semantic search servers. Tier-2 (CLI tools) enables batch semantic search. Tier-3 (convention only) limits to keyword search plus manual review.
|
|
18
|
+
4. **What is the processing intensity?** Heavy processing generates vocabulary divergence faster (many notes reformulating the same concepts in different words), increasing semantic search value.
|
|
19
|
+
5. **How domain-specific is the vocabulary?** Narrow domains with consistent terminology get less value from semantic search. Broad or cross-domain systems where the same concept appears under different names get maximum value.
|
|
20
|
+
6. **Is duplicate detection a requirement?** If the pipeline includes a reduce phase that extracts claims, semantic duplicate detection prevents the same insight from being captured under different phrasings.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Curated Claims
|
|
25
|
+
|
|
26
|
+
### Modality Foundations
|
|
27
|
+
|
|
28
|
+
#### BM25 provides the baseline for all text retrieval
|
|
29
|
+
|
|
30
|
+
**Summary:** BM25 (Best Matching 25) is a probabilistic ranking function that scores documents by term frequency, inverse document frequency, and document length normalization. It is the standard algorithm behind keyword search. BM25 excels when the searcher knows the exact vocabulary used in the target document — it is fast (sub-second on large corpora), deterministic, requires no model loading or embedding computation, and works on any system with a text index.
|
|
31
|
+
|
|
32
|
+
**Derivation Implication:** Every generated system gets keyword search as the floor. Even tier-3 convention-only systems can instruct the agent to use ripgrep or grep. Keyword search is the universal fallback that never fails — it requires only filesystem access.
|
|
33
|
+
|
|
34
|
+
**Source:** Robertson & Zaragoza, "The Probabilistic Relevance Framework: BM25 and Beyond" (2009). Validated operationally in the vault's qmd `search` mode.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
#### Embedding similarity captures meaning across vocabulary boundaries
|
|
39
|
+
|
|
40
|
+
**Summary:** Vector embeddings project text into a high-dimensional space where semantic similarity corresponds to geometric proximity. Two notes about "friction in learning systems" and "errors as pedagogical feedback" share no significant keywords but occupy nearby regions in embedding space. This is the core value proposition of semantic search: it finds connections that keyword search structurally cannot, because keyword search requires vocabulary overlap that semantic relatedness does not guarantee.
|
|
41
|
+
|
|
42
|
+
**Derivation Implication:** Semantic search (vsearch) becomes valuable when vocabulary divergence is expected — which correlates with note volume, processing intensity, and domain breadth. Systems with heavy processing generate more reformulations of the same concepts, increasing the chance that two notes about the same idea use different words.
|
|
43
|
+
|
|
44
|
+
**Source:** Mikolov et al., "Efficient Estimation of Word Representations in Vector Space" (2013). Operationally confirmed: the vault's qmd vsearch catches duplicates that BM25 misses entirely.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
#### Query expansion amplifies semantic search by generating alternative phrasings
|
|
49
|
+
|
|
50
|
+
**Summary:** Query expansion takes the user's original query and generates alternative formulations before searching. "Knowledge management friction" might expand to "obstacles in personal knowledge systems," "note-taking workflow bottlenecks," and "PKM failure patterns." Each expanded query runs against the embedding index, and results are merged. This compensates for the single-query blind spot where the searcher's phrasing might not match the embedding space's optimal representation of the concept.
|
|
51
|
+
|
|
52
|
+
**Derivation Implication:** Query expansion is a feature of hybrid search mode (the qmd `query` tool). It adds latency (~5-15 seconds) but significantly improves recall for exploratory searches. Generated systems should use expansion for connection-finding and deep exploration, not for quick lookups.
|
|
53
|
+
|
|
54
|
+
**Source:** Operational experience with qmd's expansion pipeline. Grounded in Rocchio relevance feedback (1971) adapted for neural retrieval.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
#### LLM reranking evaluates genuine conceptual connection beyond surface similarity
|
|
59
|
+
|
|
60
|
+
**Summary:** After BM25 and vector search produce candidate results, an LLM evaluates each candidate against the original query for genuine conceptual relevance. This is the most expensive step but also the most valuable for connection-finding. Vector similarity can be fooled by topical overlap — two notes about "context windows" might score high even if one is about UI design and the other about LLM architecture. The LLM reranker distinguishes surface overlap from deep connection by reasoning about the semantic relationship.
|
|
61
|
+
|
|
62
|
+
**Derivation Implication:** LLM reranking is the highest-quality search mode and should be reserved for tasks where connection quality matters most: reflect (finding connections for new notes), reweave (updating old notes), and exploratory research. It should NOT be the default for routine lookups.
|
|
63
|
+
|
|
64
|
+
**Source:** Nogueira & Cho, "Passage Re-ranking with BERT" (2019). Operationally validated in the vault's qmd `query` mode, which uses LLM reranking as the final stage.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
### Task-to-Modality Mapping
|
|
69
|
+
|
|
70
|
+
#### Finding known notes requires keyword search, not semantic search
|
|
71
|
+
|
|
72
|
+
**Summary:** When the agent knows what it is looking for — a specific filename, a known term, a particular YAML field value — keyword search is strictly superior. It is faster (0.2s vs 5-20s), deterministic (same query always returns same results), and more precise (no false positives from embedding noise). Semantic search adds latency and potential noise when the target is lexically identifiable.
|
|
73
|
+
|
|
74
|
+
**Derivation Implication:** Generated context files should instruct agents to use keyword search (grep/ripgrep) for: checking if a filename exists, querying YAML fields (`rg '^type: tension'`), finding exact phrases, and looking up known note titles. The search modality instruction should be task-specific, not "always use the best search."
|
|
75
|
+
|
|
76
|
+
**Source:** Operational pattern in the vault: `/seed` uses keyword search to check if a source was already processed. No semantic search needed — filenames are exact-match targets.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
#### Exploring concepts requires semantic search to cross vocabulary boundaries
|
|
81
|
+
|
|
82
|
+
**Summary:** When the agent is exploring a concept without knowing which notes are relevant, semantic search finds candidates that keyword search misses. Searching for "how agents maintain identity across sessions" might surface notes titled "session handoff creates continuity without persistent memory" and "closure rituals create clean breaks" — neither of which contains the words "identity" or "maintain" but both are deeply relevant. This is the canonical use case for embedding-based retrieval.
|
|
83
|
+
|
|
84
|
+
**Derivation Implication:** Generated systems should route conceptual exploration to semantic search (vsearch). This applies to: the reflect phase (finding connections for a new note), pre-creation duplicate detection (does this claim already exist under different words?), and ad-hoc research queries. The context file should teach the agent when to switch from keyword to semantic.
|
|
85
|
+
|
|
86
|
+
**Source:** Vault operational experience. The claim "vector proximity measures surface overlap not deep connection" documents both the value and limitations of this modality.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
#### Connection finding requires hybrid search with LLM reranking
|
|
91
|
+
|
|
92
|
+
**Summary:** Finding genuine connections between notes is the highest-value search task in a knowledge system. It requires the full pipeline: BM25 for exact-term matches, vector search for vocabulary-divergent matches, query expansion for coverage, and LLM reranking to evaluate which candidates represent genuine conceptual connections rather than surface similarity. Each layer catches what the previous one misses. Skipping the reranking step produces connection suggestions that are topically related but not genuinely connected — the difference between "both mention context windows" and "this note's argument depends on that note's claim."
|
|
93
|
+
|
|
94
|
+
**Derivation Implication:** Generated systems with processing = heavy or moderate should include a hybrid search mode for the reflect and reweave phases. Systems with processing = light can skip hybrid search because they generate fewer notes and the agent can use MOC traversal + keyword search for the limited connection-finding needed.
|
|
95
|
+
|
|
96
|
+
**Source:** Vault operational experience. The reflect skill uses `mcp__qmd__query` (hybrid) because connection quality justifies the ~20s latency.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
#### Duplicate detection requires semantic search because duplicates use different words
|
|
101
|
+
|
|
102
|
+
**Summary:** The most dangerous duplicates are semantic duplicates: notes that make the same claim in different vocabulary. "Curation becomes the work when creation is easy" and "AI makes creation cheap so filtering becomes expensive" are semantic duplicates — same insight, different framing. BM25 will not catch this because the notes share almost no significant terms. Only vector embedding similarity reliably detects semantic duplicates, because the notes occupy nearby regions in embedding space despite lexical divergence.
|
|
103
|
+
|
|
104
|
+
**Derivation Implication:** Any generated system with a processing pipeline (reduce phase) should include semantic duplicate detection. The reduce skill should check each extracted claim against the existing note corpus via semantic search before creating a new note. This is a quality gate, not an optional convenience.
|
|
105
|
+
|
|
106
|
+
**Source:** Vault operational experience. The reduce skill uses `mcp__qmd__vsearch` for duplicate detection, and regularly catches duplicates that would be invisible to keyword search.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
#### Description quality testing requires semantic search without reranking
|
|
111
|
+
|
|
112
|
+
**Summary:** Testing whether a note's description enables retrieval means searching for the note using only its description, without the title. If semantic search (without LLM reranking) finds the note from its description alone, the description is doing its job as a retrieval filter. If it fails, the description needs improvement. Using reranking would hide bad descriptions behind the LLM's ability to infer relevance — the test must use raw vector similarity to expose weak descriptions.
|
|
113
|
+
|
|
114
|
+
**Derivation Implication:** Generated systems with a verify or recite phase should use semantic search (vsearch, not query) for description quality testing. The absence of reranking is intentional — it tests what agents will actually encounter during routine search.
|
|
115
|
+
|
|
116
|
+
**Source:** Vault operational experience. The recite and verify skills use `mcp__qmd__vsearch` to test description findability, specifically avoiding the query tool's reranking.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
### Implementation Guidance
|
|
121
|
+
|
|
122
|
+
#### Minimum viable search is keyword-only with MOC traversal
|
|
123
|
+
|
|
124
|
+
**Summary:** A knowledge system with only keyword search (grep/ripgrep) and MOC navigation is fully functional. MOCs provide structural navigation — following curated links from topic hubs to relevant notes. Keyword search provides precision retrieval for known terms. Together they cover the majority of retrieval needs. Semantic search adds value at scale and for cross-vocabulary discovery, but its absence does not make a system non-functional.
|
|
125
|
+
|
|
126
|
+
**Derivation Implication:** Tier-3 (convention-only) systems generate with keyword search instructions and MOC-based navigation only. No semantic search infrastructure. The context file should still describe the concept of semantic search as a future upgrade path, so the agent understands what it is missing and can recommend adding it when friction emerges.
|
|
127
|
+
|
|
128
|
+
**Source:** Gall's Law: "A complex system that works is invariably found to have evolved from a simple system that worked." The vault itself operated on keyword + MOC navigation before qmd was added.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
#### Semantic search requires embedding infrastructure with maintenance
|
|
133
|
+
|
|
134
|
+
**Summary:** Deploying semantic search means running an embedding model, maintaining a vector index, and keeping that index synchronized with the filesystem. Embeddings go stale when notes are created, modified, or deleted without re-indexing. A stale index is worse than no index — it gives the agent false confidence that search is comprehensive when recent content is invisible. Any generated system with semantic search must include index maintenance procedures.
|
|
135
|
+
|
|
136
|
+
**Derivation Implication:** When generating semantic search configuration, always include: (1) the embedding tool or service, (2) index update commands, (3) a freshness check protocol (compare indexed document count against actual file count), and (4) instructions for what to do when the index is stale. The vault's Phase 0 freshness check pattern should be adapted for the generated system.
|
|
137
|
+
|
|
138
|
+
**Source:** Vault operational experience. The Phase 0 freshness check was added after search results missed recently created notes, causing reflect to miss connections.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
#### Fallback chains prevent search failures from blocking work
|
|
143
|
+
|
|
144
|
+
**Summary:** Search infrastructure can fail: MCP servers crash, embedding models fail to load, vector indices become corrupt. A system that depends entirely on semantic search for connection-finding will be blocked when semantic search fails. Dual discovery paths — semantic search plus structural navigation (MOC traversal + keyword search) — ensure that work continues regardless of search infrastructure state. The fallback is not a degraded mode; it is a parallel path that is always available.
|
|
145
|
+
|
|
146
|
+
**Derivation Implication:** Every generated system must include a fallback chain in its context file. The pattern: try semantic search first, fall back to keyword search + MOC traversal if semantic fails. Never let search failure block work. For tier-1 systems: MCP tool -> CLI tool with locking -> keyword + MOC. For tier-2: CLI tool -> keyword + MOC. For tier-3: keyword + MOC is the only path (no fallback needed because it is the primary).
|
|
147
|
+
|
|
148
|
+
**Source:** Vault operational experience. The three-tier fallback pattern (MCP -> bash with lock -> grep) was developed after MCP server crashes blocked pipeline processing.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
### Platform Adaptation
|
|
153
|
+
|
|
154
|
+
#### Claude Code enables persistent semantic search via MCP servers
|
|
155
|
+
|
|
156
|
+
**Summary:** Claude Code's MCP (Model Context Protocol) integration allows semantic search to run as a persistent server process. The qmd MCP server keeps embedding models loaded in memory between requests, eliminating the 5-10 second cold-start penalty of spawning a new process per query. This makes semantic search practical for interactive use and for pipeline phases that issue multiple queries. The MCP server also solves the parallel worker problem: a singleton LlamaCpp instance with reference-counted sessions prevents multiple workers from loading duplicate models into RAM.
|
|
157
|
+
|
|
158
|
+
**Derivation Implication:** For Claude Code (tier-1) systems, generate MCP configuration (`.mcp.json`) that points to the semantic search server. Include collection definitions matching the system's folder structure. Document the MCP tool names in the context file so the agent knows which tools to call. Note the MCP-in-subagents limitation: custom agents spawned via Task tool do not inherit MCP access, requiring the CLI fallback.
|
|
159
|
+
|
|
160
|
+
**Source:** Vault operational experience with qmd MCP server. The `.mcp.json` configuration and collection definitions are proven patterns.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
#### Convention-only systems compensate with structured manual review
|
|
165
|
+
|
|
166
|
+
**Summary:** Systems without any search tooling (tier-3) rely entirely on the agent's ability to navigate the graph through MOCs and keyword search. This works at low-to-moderate volume because the agent can hold the full structure in context. At higher volumes, the context file should instruct the agent to periodically review topic adjacencies manually — reading MOCs in related topics and scanning for connections that keyword search would miss. This is the human-era equivalent of "browse your notes" but systematized as a periodic maintenance task.
|
|
167
|
+
|
|
168
|
+
**Derivation Implication:** For convention-only systems, generate a "Discovery Patterns" section in the context file that teaches manual cross-topic review. Include the topic adjacency pattern: after creating a note in topic A, scan the MOCs of adjacent topics (B, C) for potential connections. This compensates partially for the absence of semantic search.
|
|
169
|
+
|
|
170
|
+
**Source:** Pre-computational knowledge management practice (Luhmann's physical Zettelkasten relied on sequential browsing and register-based lookup, not search).
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
#### OpenClaw systems use skill-based search invocation
|
|
175
|
+
|
|
176
|
+
**Summary:** OpenClaw's skill system provides a different integration point for semantic search than Claude Code's MCP. Search can be wrapped in external skills that the agent invokes by name. The skill handles model loading, query execution, and result formatting. This is functionally equivalent to MCP tools but uses OpenClaw's skill invocation infrastructure instead of MCP's tool protocol.
|
|
177
|
+
|
|
178
|
+
**Derivation Implication:** For OpenClaw systems, generate search skills (e.g., `skills/qmd/`) rather than MCP configuration. The skill should expose the same three modalities (keyword, semantic, hybrid) with the same task-to-modality mapping. The context file references skill names instead of MCP tool names.
|
|
179
|
+
|
|
180
|
+
**Source:** Vault dual-operator architecture. Cornelius (OpenClaw) uses skills/qmd/ while Heinrich (Claude Code) uses MCP tools. Same search modalities, different invocation paths.
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
### Search Quality and Failure Modes
|
|
185
|
+
|
|
186
|
+
#### Vector proximity measures surface overlap, not deep connection
|
|
187
|
+
|
|
188
|
+
**Summary:** Embedding similarity has a fundamental limitation: it measures vocabulary and topic similarity, not genuine conceptual connection. Two notes about "context windows" — one about LLM architecture, one about UI design — may score high vector similarity because they share vocabulary, but they are not meaningfully connected. Conversely, a note about "friction in learning" and a note about "errors as pedagogical feedback" are deeply connected but may score low because they share few terms. This is why LLM reranking exists: to evaluate what vector similarity cannot — whether the conceptual relationship is genuine.
|
|
189
|
+
|
|
190
|
+
**Derivation Implication:** Generated context files should include a search quality warning: "High similarity scores do not guarantee genuine connections. When using semantic search results, evaluate each candidate: does this note's argument actually relate to what you are searching for, or does it just use similar vocabulary?" This is especially important for the reflect phase where false connections degrade graph quality.
|
|
191
|
+
|
|
192
|
+
**Source:** Research claim: "vector proximity measures surface overlap not deep connection." Vault operational experience: reflect phases using vsearch without reranking occasionally propose surface-similar but conceptually unrelated connections.
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
#### Stale indices produce false confidence that is worse than no index
|
|
197
|
+
|
|
198
|
+
**Summary:** When the semantic search index falls out of sync with the filesystem — notes created after the last index update, notes modified without re-embedding, notes deleted but still in the index — the agent receives search results that omit recent content. The danger is not the missing results themselves but the agent's trust in search comprehensiveness. An agent that believes "I searched and found nothing similar" when the search actually missed 10 recently created notes will create a duplicate without realizing it. No index is honest; a stale index lies.
|
|
199
|
+
|
|
200
|
+
**Derivation Implication:** Every generated system with semantic search must include an index staleness detection mechanism. The minimum viable implementation: compare the count of indexed documents against the count of actual files. If they differ, run index update before trusting search results. The context file should frame this as a mandatory pre-search step, not an optional maintenance task. The vault's Phase 0 freshness check is the reference pattern.
|
|
201
|
+
|
|
202
|
+
**Source:** Vault operational failure. Notes created during a processing batch were invisible to reflect phases that ran before index sync, producing duplicate notes and missing connections.
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
#### BM25 query dilution occurs when full descriptions are used as search queries
|
|
207
|
+
|
|
208
|
+
**Summary:** BM25 scores documents by term frequency and inverse document frequency. When the search query itself is long (e.g., a full 150-character description), the query contains many terms, each with low individual weight. This dilution effect means that long queries return fewer and lower-quality BM25 results compared to short, focused keyword queries. The solution is to use condensed keywords or phrases for BM25 search, reserving full-text descriptions for semantic search where the embedding model handles longer inputs gracefully.
|
|
209
|
+
|
|
210
|
+
**Derivation Implication:** Generated context files that instruct agents on search usage should distinguish between query formulation for keyword search (short, focused terms) and query formulation for semantic search (natural language descriptions). A single instruction like "search for your concept" is insufficient — the agent needs to know how to phrase queries differently for each modality.
|
|
211
|
+
|
|
212
|
+
**Source:** Vault operational experience. Full-length descriptions used as BM25 queries via `mcp__qmd__search` frequently returned zero results, while the same descriptions used via `mcp__qmd__vsearch` returned accurate matches.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
### Search Mode Selection Matrix
|
|
217
|
+
|
|
218
|
+
#### Volume determines the minimum viable search configuration
|
|
219
|
+
|
|
220
|
+
**Summary:** The relationship between note volume and search modality requirements follows clear thresholds. Below 50 notes, the agent can read all descriptions and navigate the full MOC structure — keyword search suffices. Between 50-200 notes, vocabulary divergence begins to create blind spots that semantic search addresses. Above 200 notes, keyword search alone produces retrieval failures for cross-vocabulary concepts. These thresholds are approximate but directionally reliable across domains.
|
|
221
|
+
|
|
222
|
+
**Derivation Implication:** The derivation engine should use expected volume trajectory (not current volume) to configure search. A system starting at 10 notes but expected to reach 200+ should be configured for semantic search from the start, with the understanding that it provides little value initially but prevents a painful mid-life reconfiguration.
|
|
223
|
+
|
|
224
|
+
**Source:** Vault experience and information retrieval theory. Vocabulary divergence grows logarithmically with corpus size (Heaps' Law), creating an increasing gap between what keyword search finds and what exists.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
#### Domain breadth determines how quickly vocabulary diverges
|
|
229
|
+
|
|
230
|
+
**Summary:** A narrow-domain system (e.g., tracking one sport's strategy) uses consistent terminology. "Opening move," "midgame position," and "endgame technique" are standard vocabulary that all notes share. Keyword search works well because the vocabulary is constrained. A broad or cross-domain system (e.g., tools for thought research that draws from cognitive science, information retrieval, software engineering, and philosophy) accumulates vocabulary divergence rapidly because each source domain brings its own terminology for overlapping concepts. "Context window" (LLM architecture), "working memory" (cognitive science), and "attention budget" (productivity) all describe related limitations but use completely different terms.
|
|
231
|
+
|
|
232
|
+
**Derivation Implication:** Cross-domain systems should receive semantic search earlier in their lifecycle than single-domain systems. The derivation engine should ask about domain breadth during init and adjust search modality recommendations accordingly. A system spanning 3+ source domains should probably start with semantic search enabled regardless of initial volume.
|
|
233
|
+
|
|
234
|
+
**Source:** Information retrieval research on vocabulary mismatch in cross-domain corpora. Vault operational experience: the vault draws from 6+ source domains and experienced vocabulary divergence from the first 30 notes.
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
#### Processing intensity amplifies vocabulary divergence
|
|
239
|
+
|
|
240
|
+
**Summary:** Heavy processing (extraction, reformulation, synthesis) generates more varied phrasings of the same concepts than light processing. Each reduce pass produces notes that reformulate source material in the agent's own words. Each reweave pass may further rephrase claims as understanding deepens. This compounding reformulation means heavy-processing systems accumulate vocabulary divergence faster than light-processing systems at the same note count, increasing the value of semantic search earlier in the system's lifecycle.
|
|
241
|
+
|
|
242
|
+
**Derivation Implication:** Adjust the volume thresholds for search modality based on processing intensity. Heavy processing: semantic search becomes valuable at ~30 notes. Moderate processing: ~75 notes. Light processing: ~150 notes. These adjusted thresholds reflect how quickly vocabulary divergence accumulates.
|
|
243
|
+
|
|
244
|
+
**Source:** Vault operational observation. After heavy /reduce processing of 5 sources, the vault had significant vocabulary divergence across ~80 notes — concepts expressed in source-author vocabulary, vault-native vocabulary, and synthesized vocabulary.
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
### Modality Cost-Benefit Analysis
|
|
249
|
+
|
|
250
|
+
#### The cost structure of search modalities follows an exponential curve
|
|
251
|
+
|
|
252
|
+
**Summary:** Keyword search costs O(n) where n is corpus size — essentially free on modern hardware. Semantic search (vector similarity) costs O(1) per query against a pre-built index, but building and maintaining the index costs O(n) per update and requires ~2GB of model memory. Hybrid search with LLM reranking adds O(k) where k is the number of candidates reranked — each candidate requires an LLM inference pass. The practical costs: keyword ~0.2s, semantic ~5s, hybrid ~20s. The quality improvement at each step is diminishing: keyword to semantic is a large jump, semantic to hybrid is a smaller jump, but hybrid catches connections that semantic alone misses in ~15% of cases.
|
|
253
|
+
|
|
254
|
+
**Derivation Implication:** The cost-quality tradeoff informs which search mode to default to. For routine operations (file lookup, YAML queries), keyword is the only rational choice. For standard discovery (exploring related notes), semantic provides the best cost-quality ratio. For high-stakes connection finding (reflect, reweave), hybrid is justified by the quality premium. Generated context files should encode this cost awareness so agents do not default to the most expensive mode for routine tasks.
|
|
255
|
+
|
|
256
|
+
**Source:** Vault operational measurements. The 0.2s / 5s / 20s benchmarks are from qmd running on Apple Silicon with models kept warm.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
#### Search configuration should be generated as a decision table, not a default
|
|
261
|
+
|
|
262
|
+
**Summary:** Rather than setting a single default search mode, the generated context file should include a decision table mapping tasks to modalities. The agent should know: "For this task, use this search mode, because X." This is more effective than a global default because different tasks within the same session require different modalities. A single session might use keyword search for YAML queries, semantic search for duplicate checking, and hybrid search for connection finding — three modalities in one session, each justified by the task at hand.
|
|
263
|
+
|
|
264
|
+
**Derivation Implication:** Generate a task-to-modality mapping table in every context file that includes search instructions. The table should list the system's operational tasks (the ones defined by its processing pipeline and maintenance routine) and the appropriate search modality for each. This is the search equivalent of the pre-task context router — it routes tasks to appropriate search modes.
|
|
265
|
+
|
|
266
|
+
**Source:** Vault CLAUDE.md "Which mode for which skill" table. This task-specific routing replaced an earlier pattern where agents defaulted to hybrid search for everything, wasting 20 seconds on lookups that keyword search handles in 0.2 seconds.
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Exclusion Notes
|
|
271
|
+
|
|
272
|
+
**Excluded from this reference:**
|
|
273
|
+
|
|
274
|
+
- Full-text search engine comparisons (Elasticsearch, Solr, Meilisearch) — these are infrastructure choices, not derivation decisions. The derivation engine selects modalities, not implementations.
|
|
275
|
+
- Embedding model selection (which model to use for vectors) — implementation detail that belongs in platform-specific documentation, not derivation reference.
|
|
276
|
+
- RAG (Retrieval Augmented Generation) pipeline architecture — the vault's wiki-link graph is explicitly NOT a RAG system. Wiki links provide curated edges; RAG provides automated chunk retrieval. Different paradigms.
|
|
277
|
+
- Image or multimodal search — the vault is text-only. Multimodal search is a future consideration, not a current derivation concern.
|
|
278
|
+
- Real-time indexing vs batch indexing trade-offs — operational concern for the search tool maintainer, not a derivation decision.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Version
|
|
283
|
+
|
|
284
|
+
- Last curated: 2026-02-12
|
|
285
|
+
- Sources reviewed: 22
|
|
286
|
+
- Claims included: 23
|
|
287
|
+
- Claims excluded: 5
|
|
288
|
+
- Cross-references: `kernel.yaml` (semantic-search primitive), `interaction-constraints.md` (volume cascade, linking dimension), `components.md` (Search component blueprint), `methodology.md` (key research claims on retrieval), `claim-map.md` (discovery-retrieval topic)
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
# Session Lifecycle Reference
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Specify how generated systems structure agent sessions for optimal knowledge work. Every session has a beginning (orient), a middle (work), and an end (persist). This three-phase pattern is a kernel primitive (session-rhythm in kernel.yaml), but the specific behaviors in each phase vary by session type, platform capabilities, and domain. The derivation engine uses this document to generate session instructions that are concrete enough to follow and flexible enough to adapt.
|
|
6
|
+
|
|
7
|
+
This document answers: what should the agent read at session start, how should it manage focus during work, and what must it persist before session end — and how do these answers change across session types and platforms?
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Derivation Questions
|
|
12
|
+
|
|
13
|
+
Questions the engine must answer when generating session configuration:
|
|
14
|
+
|
|
15
|
+
1. **What platform capabilities exist for session automation?** Hooks (Claude Code) can automate orientation and persistence. OpenClaw requires manual loading of MEMORY.md. Convention-only systems rely on context file instructions.
|
|
16
|
+
2. **What is the self/ space structure?** Session orientation reads self/ — the derivation must know which files exist to generate the orientation sequence.
|
|
17
|
+
3. **What session types will this system support?** Processing sessions (pipeline work), maintenance sessions (health checks), exploration sessions (research and connection finding), capture sessions (rapid note creation). Different types orient and persist differently.
|
|
18
|
+
4. **What is the expected session frequency?** Frequent sessions need different handoff than infrequent sessions. Systems used rarely need heavier orientation because more has been forgotten.
|
|
19
|
+
5. **How large is the context window budget?** Orientation competes with work for context space. Generated systems should specify how much context to allocate to orientation vs task execution.
|
|
20
|
+
6. **Does the system have a processing pipeline?** Pipeline sessions have different rhythm than ad-hoc sessions — they read queue state at orient, process tasks during work, and update queue state at persist.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Curated Claims
|
|
25
|
+
|
|
26
|
+
### Three-Phase Pattern
|
|
27
|
+
|
|
28
|
+
#### Orient-work-persist is the universal session rhythm because agents lose everything between sessions
|
|
29
|
+
|
|
30
|
+
**Summary:** LLM agents have no persistent memory. Every session begins from zero knowledge of identity, goals, recent work, and system state. Without an explicit orientation phase, the agent must rediscover who it is, what it is working on, and what exists in the vault — consuming context window and making mistakes along the way. The orient-work-persist pattern solves this by externalizing session state: orient reads the previous session's output, work produces value, persist writes the next session's input. This cycle creates continuity without requiring persistent memory.
|
|
31
|
+
|
|
32
|
+
**Derivation Implication:** Every generated context file must include an explicit session rhythm section documenting what to read at start, how to work, and what to save at end. This is not optional guidance — it is the mechanism by which the system maintains coherence across sessions.
|
|
33
|
+
|
|
34
|
+
**Source:** Kernel primitive `session-rhythm`. Research claim: "session handoff creates continuity without persistent memory." Operationally validated across hundreds of vault sessions.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
#### Orientation loads identity before task context because identity constrains behavior
|
|
39
|
+
|
|
40
|
+
**Summary:** The agent must know who it is before it knows what to do. Identity (self/identity.md) establishes voice, values, and approach. Methodology (self/methodology.md) establishes quality standards and operational patterns. Goals (self/goals.md) establishes current work threads and priorities. Loading task context before identity produces an agent that knows what to work on but not how to work on it — and "how" includes quality standards, voice consistency, and behavioral constraints that shape every action. The loading order matters: identity -> methodology -> goals -> task context.
|
|
41
|
+
|
|
42
|
+
**Derivation Implication:** The generated context file's session start section must specify loading order, not just loading list. For systems with hooks: the session-start hook loads self/ files in identity-first order. For convention systems: the context file instructs the agent to read self/ files in the correct sequence before proceeding to any task.
|
|
43
|
+
|
|
44
|
+
**Source:** Vault operational experience. Voice drift and quality inconsistency were traced to sessions where task context was loaded before identity context.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
#### The smart zone is the first 40% of context where attention quality is highest
|
|
49
|
+
|
|
50
|
+
**Summary:** LLM attention quality degrades as the context window fills. Empirically, the first ~40% of context capacity produces the sharpest reasoning, the most careful instruction-following, and the best quality output. Beyond this threshold, attention degradation manifests as missed instructions, shallower reasoning, and reduced connection-finding ability. This is not a hard cliff but a gradient — quality degrades progressively, with noticeable impact after 40% and severe impact after 70%.
|
|
51
|
+
|
|
52
|
+
**Derivation Implication:** The derivation engine should calculate approximate context budgets for orient vs work phases. If orientation consumes 25% of context, the work phase has ~15% of smart-zone capacity remaining. Systems with large self/ spaces or heavy orientation requirements should either (a) limit orientation to essential files or (b) use progressive disclosure (read descriptions before full files) to stay within budget. The context file should explicitly warn agents about context budget management.
|
|
53
|
+
|
|
54
|
+
**Source:** Research claim: "LLM attention degrades as context fills." Operationally validated: late-context processing phases produce measurably lower quality output in the vault's pipeline.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### Session Types
|
|
59
|
+
|
|
60
|
+
#### Processing sessions orient from queue state and persist phase completion
|
|
61
|
+
|
|
62
|
+
**Summary:** Processing sessions follow the pipeline: read queue.json to find the next unblocked task, execute one or more phases (reduce, reflect, reweave, verify), and update queue state with completion. Orientation is minimal and targeted — the agent needs queue state, the specific task file, and the relevant skill instructions. It does NOT need full self/ orientation because processing is methodological, not identity-dependent. The persist phase must advance the queue entry (mark phases complete, update status) — without this, the pipeline stalls.
|
|
63
|
+
|
|
64
|
+
**Derivation Implication:** Generated systems with processing pipelines should include a processing session template in the context file. This template specifies: (1) read queue state, (2) identify next task, (3) load task-specific context, (4) execute phase, (5) update task file, (6) advance queue. Skip heavy orientation — processing sessions are mechanical, not exploratory.
|
|
65
|
+
|
|
66
|
+
**Source:** Vault /ralph orchestration pattern. Each subagent spawned by /ralph follows this minimal-orientation processing session pattern.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
#### Maintenance sessions orient from health metrics and persist improvement actions
|
|
71
|
+
|
|
72
|
+
**Summary:** Maintenance sessions focus on system health: schema validation, orphan detection, link health, MOC coverage, stale note identification. Orientation loads the latest health report (if one exists) and the maintenance checklist from the context file. Work runs health checks systematically — not ad-hoc inspection but scripted validation. Persistence captures findings as observation notes, updates health reports, and creates tasks for issues that require separate sessions to fix.
|
|
73
|
+
|
|
74
|
+
**Derivation Implication:** Generated systems should include a maintenance session section in the context file with: which health checks to run, expected thresholds (orphan percentage, schema compliance), and where to log findings. The maintenance session type should be distinct from processing and exploration — mixing maintenance with content work produces incomplete maintenance because content work is more engaging.
|
|
75
|
+
|
|
76
|
+
**Source:** Vault /review skill and reconciliation pattern. Maintenance is most effective when it is the sole focus of a session, not a side activity.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
#### Exploration sessions orient from MOCs and persist connection discoveries
|
|
81
|
+
|
|
82
|
+
**Summary:** Exploration sessions are open-ended: the agent is looking for connections, investigating a concept, or building understanding of a new topic area. Orientation reads the relevant MOC(s) to understand current thinking, tensions, and gaps. Work follows connections through the graph — reading notes, following wiki links, using semantic search for cross-vocabulary discovery. Persistence captures new connections as inline links in existing notes, updates MOCs with new entries, and logs any observations or tensions discovered. Exploration sessions are the highest-value session type for knowledge compounding but also the most context-hungry.
|
|
83
|
+
|
|
84
|
+
**Derivation Implication:** Generated systems should include exploration session guidance that teaches: (1) start from a MOC, not from a random note, (2) follow links deliberately — checkpoint after each note to reassess direction, (3) persist discoveries immediately rather than batching them, (4) time-box exploration to prevent context exhaustion without persisting findings.
|
|
85
|
+
|
|
86
|
+
**Source:** Vault working technique: "checkpoint during traversal." Exploration without checkpointing follows the original query even when the agent has learned something that reframes the question.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
#### Capture sessions orient minimally and persist raw material for future processing
|
|
91
|
+
|
|
92
|
+
**Summary:** Capture sessions prioritize speed over structure. The agent receives raw material (voice transcript, article, URL, idea) and files it with minimal ceremony. Orientation is minimal — just enough to know where to put things (inbox structure, naming conventions). Work is filing, tagging, and basic triage (is this relevant? which topic area?). Persistence is the filed material itself, possibly with a queue entry if the material should be processed in a future session. Capture sessions should never attempt processing — that is a different session type.
|
|
93
|
+
|
|
94
|
+
**Derivation Implication:** Generated systems should explicitly separate capture from processing in their session guidance. The context file should include a "Quick Capture" section that teaches zero-friction filing: drop it in inbox with a descriptive filename and minimal metadata. Processing happens later in a dedicated processing session with fresh context.
|
|
95
|
+
|
|
96
|
+
**Source:** Research claim: "temporal separation of capture and processing preserves context freshness." Vault pattern: 00_inbox/ as zero-friction capture zone.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### Context Budget
|
|
101
|
+
|
|
102
|
+
#### Context budget allocation should match session type
|
|
103
|
+
|
|
104
|
+
**Summary:** Different session types have different context budgets. Processing sessions need minimal orientation context (~10%) and maximum work context (~90%). Exploration sessions need moderate orientation context (~25% for MOC loading) and moderate work context (~75% for traversal). Maintenance sessions need moderate orientation context (~20% for health baselines) and moderate work context (~80% for running checks). Capture sessions need minimal context overall — they are short-lived. Misallocating context budget (heavy orientation in a capture session, minimal orientation in an exploration session) degrades session quality.
|
|
105
|
+
|
|
106
|
+
**Derivation Implication:** Generated context files should include session-type-specific context loading guidance. Rather than a single "orient" section, provide type-specific orientation checklists with approximate context costs. This helps agents make informed decisions about how much to load.
|
|
107
|
+
|
|
108
|
+
**Source:** Vault operational experience. Pipeline phases running inside /ralph subagents use minimal orientation (task file + skill instructions) to maximize smart-zone availability for the actual work.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
#### Progressive disclosure during orientation prevents context waste
|
|
113
|
+
|
|
114
|
+
**Summary:** Not every self/ file needs to be loaded fully at session start. Progressive disclosure applies to orientation: load identity.md fully (it is small and essential), load goals.md fully (it is the active orientation file), but load methodology.md only when the session involves quality decisions. For large self/ spaces with memory/ directories, load the memory directory listing first, then read specific memories only when relevant to the current task. This preserves context budget for work without sacrificing orientation quality.
|
|
115
|
+
|
|
116
|
+
**Derivation Implication:** Generated systems with self/ spaces larger than ~2000 tokens total should include progressive disclosure guidance for orientation. The context file should distinguish between "always load" files (identity.md, goals.md) and "load when relevant" files (memory/, relationships.md). Hooks can automate the "always load" files while leaving "load when relevant" files to agent judgment.
|
|
117
|
+
|
|
118
|
+
**Source:** Vault discovery layer pattern. The vault applies progressive disclosure to note discovery (description before content); the same principle applies to self/ orientation.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### Session Boundaries as Automation Checkpoints
|
|
123
|
+
|
|
124
|
+
#### Session boundaries create natural points for automated behavior
|
|
125
|
+
|
|
126
|
+
**Summary:** The beginning and end of a session are the two moments where automated behavior adds the most value. At session start: load orientation files, inject file tree, evaluate condition-based triggers against vault state, display health warnings. At session end: save session transcript to ops/sessions/ (Primitive 15 — session capture), auto-create mining tasks for future processing, validate that notes were saved, check for broken links introduced during the session, auto-commit changes, push to remote. These are deterministic operations (verification, not judgment) that hooks can handle without corrupting quality.
|
|
127
|
+
|
|
128
|
+
**Derivation Implication:** For hook-capable platforms (Claude Code), generate session-start and stop hooks that automate the deterministic parts of orient and persist. The stop hook MUST save session transcripts (session capture is INVARIANT). For convention-only systems, generate checklist instructions that the agent follows manually. The checklist should cover the same behaviors as the hooks, just without automation. The context file should explain what the hooks do so the agent understands the automated behavior.
|
|
129
|
+
|
|
130
|
+
**Source:** Vault hook infrastructure. The session-start hook (tree injection + condition evaluation) and stop hook (session capture + auto-commit) are proven patterns that eliminate routine tasks without requiring judgment.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
#### Attention residue from incomplete sessions degrades future work
|
|
135
|
+
|
|
136
|
+
**Summary:** When a session ends without proper persistence, the agent in the next session lacks information about what was in progress, what was discovered, and what decisions were made. This is the agent equivalent of attention residue — incomplete tasks from a previous context contaminating the current context. The persist phase eliminates attention residue by explicitly capturing session state: what was done, what was discovered, what remains to do. Cal Newport's research on attention residue for humans translates directly: incomplete work contaminates future attention, and explicit closure rituals are the remedy.
|
|
137
|
+
|
|
138
|
+
**Derivation Implication:** Generated context files must include an explicit session-end checklist. Minimum: update self/goals.md with current state, capture any observations, push changes to remote. For pipeline sessions: update queue state. For exploration sessions: update MOCs with discoveries. The checklist should be positioned prominently (not buried in appendix) because skipping it is the most common session failure mode.
|
|
139
|
+
|
|
140
|
+
**Source:** Newport, "Deep Work" (2016) — attention residue concept. Research claim: "closure rituals create clean breaks that prevent attention residue bleed." Vault operational experience with goals.md as the primary session-handoff mechanism.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
#### The Zeigarnik effect means open tasks persist in working memory until closed
|
|
145
|
+
|
|
146
|
+
**Summary:** Bluma Zeigarnik demonstrated that uncompleted tasks are remembered better than completed ones — the mind maintains a "rehearsal loop" for unfinished work. For agents, this translates to the self/goals.md pattern: open threads listed in goals.md are the agent's externalized Zeigarnik effect. They persist across sessions because they are written down, and they create a pull toward completion that prevents aimless sessions. Without goals.md, each session starts without momentum — the agent has no open threads pulling it toward specific work.
|
|
147
|
+
|
|
148
|
+
**Derivation Implication:** Every generated system must include a goals.md (or domain-equivalent) file in self/ that tracks open threads. The context file should instruct the agent to read goals.md at session start and update it at session end. The format should be simple: a list of active threads with current status, not a complex project management system. The Zeigarnik effect works best with concise, emotionally engaging descriptions of unfinished work.
|
|
149
|
+
|
|
150
|
+
**Source:** Zeigarnik, "On Finished and Unfinished Tasks" (1927). Vault self/goals.md as operational implementation.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### Platform Adaptation
|
|
155
|
+
|
|
156
|
+
#### Claude Code automates session rhythm through hooks
|
|
157
|
+
|
|
158
|
+
**Summary:** Claude Code's hook system (PreToolUse, PostToolUse, Stop events) enables automatic session rhythm. A SessionStart hook injects the file tree and loads orientation files. A PostToolUse hook on Write operations validates note quality. A Stop hook (or pre-push hook) can remind the agent to update goals.md. This automation makes the session rhythm invisible — the agent follows it without conscious effort because the infrastructure enforces it. The hooks encode deterministic verification (does the file exist? is the schema valid?) while leaving judgment operations (is the description good? are the connections meaningful?) to skills.
|
|
159
|
+
|
|
160
|
+
**Derivation Implication:** For Claude Code systems, generate hook configurations in `.claude/hooks/` that automate: (1) tree injection at session start, (2) self/ file loading at session start, (3) note validation on Write, (4) session-end reminders. The context file should document what hooks exist and what they do, so the agent understands the automated behavior and doesn't duplicate it.
|
|
161
|
+
|
|
162
|
+
**Source:** Vault `.claude/hooks/` implementation. Proven hook patterns: session-start tree injection, PostToolUse validation, auto-commit.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
#### OpenClaw requires manual orientation with MEMORY.md as anchor
|
|
167
|
+
|
|
168
|
+
**Summary:** OpenClaw's session model loads SOUL.md, USER.md, and AGENTS.md automatically, but vault-specific orientation (the equivalent of self/ loading and tree injection) must be triggered manually. MEMORY.md serves as the orientation anchor — it points the agent to self/ files and instructs it to load workspace context. The agent must follow MEMORY.md's instructions to achieve the orientation that Claude Code automates via hooks. This works but requires discipline — the instruction to "read MEMORY.md first" must be prominent and unambiguous.
|
|
169
|
+
|
|
170
|
+
**Derivation Implication:** For OpenClaw systems, generate MEMORY.md as the session anchor with explicit loading instructions: read identity.md, read goals.md, load workspace map. The AGENTS.md file should include session workflow instructions that reference MEMORY.md. Since hooks are TypeScript-based in OpenClaw, generate command hooks for orient and persist if the user's setup supports them.
|
|
171
|
+
|
|
172
|
+
**Source:** Vault dual-operator architecture. Cornelius (OpenClaw) uses MEMORY.md for session orientation while Heinrich (Claude Code) uses hooks.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
#### Convention-only systems encode session rhythm in the context file itself
|
|
177
|
+
|
|
178
|
+
**Summary:** Systems without hooks or skill infrastructure rely entirely on the context file to teach session rhythm. The context file must include explicit session sections: "When you start a session, read these files in this order. When you finish, update these files." This is the lowest-automation approach but it works — context file instructions are loaded at every session start (by definition), so the session rhythm instructions are always present. The risk is instruction-following degradation as context fills, which means session-end instructions (the persist phase) are the most likely to be skipped.
|
|
179
|
+
|
|
180
|
+
**Derivation Implication:** For convention-only systems, place session rhythm instructions at the top of the context file (where they benefit from smart-zone attention quality). Use bold formatting and clear headers to make the instructions visually prominent. Include a session-end checklist near the end of the context file with "CRITICAL: Do not end the session without completing these steps" framing to counteract attention degradation.
|
|
181
|
+
|
|
182
|
+
**Source:** Vault CLAUDE.md session patterns section. Convention-based instruction-following is the foundation layer that all platforms share.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
### Session Anti-Patterns
|
|
187
|
+
|
|
188
|
+
#### Context contamination occurs when one task's context degrades another task's quality
|
|
189
|
+
|
|
190
|
+
**Summary:** When an agent chains multiple tasks in a single session, the context from task A contaminates the reasoning for task B. Processing a dense research paper fills context with source-specific vocabulary and concepts. If the agent then immediately switches to writing a new note about a different topic, the source vocabulary bleeds into the new note's phrasing. Fresh context per task — the principle behind /ralph's subagent isolation — prevents this contamination by giving each task a clean context window.
|
|
191
|
+
|
|
192
|
+
**Derivation Implication:** Generated context files should include a "one task per session" discipline section for systems with processing = heavy. For lighter systems where context contamination is less severe, the guidance can be softer: "If you are switching between very different tasks, consider whether the previous task's context might influence your current work." The pipeline architecture (fresh context per phase) is the structural solution; session discipline is the behavioral solution.
|
|
193
|
+
|
|
194
|
+
**Source:** Research claim: "fresh context per task preserves quality better than chaining phases." Vault operational experience: quality differences between early-session and late-session processing are measurable.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
#### Session capture saves transcripts automatically for future mining
|
|
199
|
+
|
|
200
|
+
**Summary:** Session capture (Primitive 15, INVARIANT) ensures that every session's transcript is saved to ops/sessions/ via the stop hook. This is not optional — session transcripts contain friction patterns, methodology learnings, and connection discoveries that the user may not have explicitly captured via /remember. Auto-created mining tasks queue these transcripts for future processing, where the system extracts friction signals and operational insights. This means the improvement loop works even when the user forgets to call /remember — the system detects friction on its own from recorded sessions.
|
|
201
|
+
|
|
202
|
+
**Derivation Implication:** Every generated system MUST include session capture in the stop hook. The stop hook saves the session transcript with a timestamp filename to ops/sessions/ and creates a mining task. For convention-only systems, the context file must include an explicit instruction to save session notes before ending. Session capture feeds the operational learning loop (Primitive 12) and condition-based maintenance — without it, the system loses its ability to learn from its own operation.
|
|
203
|
+
|
|
204
|
+
**Source:** v1.6 Primitive 15 specification. The vault's recursive improvement loop depends on session capture as an automatic input mechanism.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
#### Skipping the persist phase is the most common and most damaging session failure
|
|
209
|
+
|
|
210
|
+
**Summary:** The orient and work phases are naturally motivated — the agent needs orientation to function, and work is the session's purpose. The persist phase has no natural motivation: the agent's session is ending, the user may have moved on, and the "save your progress" step feels like overhead. But skipping persist means the next session starts without handoff, goals.md is outdated, observations are lost, and newly created notes may not be committed. Session capture (Primitive 15) mitigates the worst consequence — transcript loss — by automating it via the stop hook. But goals.md updates and observation capture still require explicit action.
|
|
211
|
+
|
|
212
|
+
**Derivation Implication:** Generated systems should make the persist phase as prominent and explicit as possible. Session capture (stop hook) automates transcript persistence. For remaining persist actions (goals.md update, observation capture, git commit): hook-based systems should generate reminders or automation. Convention systems should place the session-end checklist prominently with "CRITICAL" framing. The vault's auto-commit hook is an example of automating the most commonly skipped persist action (committing changes to git).
|
|
213
|
+
|
|
214
|
+
**Source:** Vault operational observation. Multiple sessions ended without goals.md updates, producing orientation gaps in subsequent sessions.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
#### Discovery during work must be captured without derailing the current task
|
|
219
|
+
|
|
220
|
+
**Summary:** During focused work, agents frequently discover things worth investigating: a related note that needs updating, a potential connection to explore, a maintenance issue to address. Following these discoveries immediately creates context contamination and loses focus on the primary task. Ignoring them entirely loses the discovery. The correct pattern is: capture the discovery as a minimal note (inbox item, queue entry, agent note in a MOC) and return to the current task. The discovery becomes a future session's work, not a tangent in the current session.
|
|
221
|
+
|
|
222
|
+
**Derivation Implication:** Generated context files should include explicit discovery-during-work guidance: "When you find something interesting while working on a different task, capture it quickly (drop a note in inbox/ or add to the relevant MOC's open questions) and return to your task. Do not follow the discovery now — give it its own session where it can get full attention." This prevents the session from becoming an unstructured exploration that produces many partial results and no complete ones.
|
|
223
|
+
|
|
224
|
+
**Source:** Vault working technique: "handling discoveries during work." Research claim: "WIP limits force processing over accumulation" — the same principle applies to in-session discovery management.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
### Session Handoff Mechanisms
|
|
229
|
+
|
|
230
|
+
#### Goals.md is the primary handoff vehicle between sessions
|
|
231
|
+
|
|
232
|
+
**Summary:** self/goals.md serves as the session-to-session handoff document. At session end, the agent updates goals.md with: what was accomplished, what is in progress, what should be done next, and any discoveries that affect priorities. At the next session start, reading goals.md gives the agent immediate orientation on current work state. This is more effective than session logs (which are append-only and grow indefinitely) because goals.md is a living document that reflects current state, not historical state. It is the shortest path from "I know nothing" to "I know what to do next."
|
|
233
|
+
|
|
234
|
+
**Derivation Implication:** Every generated system must include goals.md in self/ with a template that encourages structured handoff: active threads, next actions, recent discoveries, and deferred items. The context file should emphasize that goals.md is the most important file to update at session end — skipping this update is the single most damaging persist-phase failure.
|
|
235
|
+
|
|
236
|
+
**Source:** Vault self/goals.md implementation. Confirmed as the most valuable self/ file for session continuity.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
#### Reminders bridge time-bound commitments across sessions
|
|
241
|
+
|
|
242
|
+
**Summary:** Goals.md tracks work threads; reminders.md tracks time-bound actions. "Follow up with Sarah by Friday" is not a goal — it is a deadline-bound action that should surface at the right time and disappear when completed. The reminders mechanism (ops/reminders.md as a simple checkbox list with dates) provides a lightweight way for the user to delegate time-sensitive actions to the agent without polluting goals.md with one-off items. At session start, the agent checks reminders.md for due items and surfaces them. This is not a calendar — it is a delegation mechanism for actions the user wants the agent to remind them about.
|
|
243
|
+
|
|
244
|
+
**Derivation Implication:** Generated systems should include ops/reminders.md with a simple format: `- [ ] YYYY-MM-DD: action description`. The orient phase should include "check reminders.md for due items" as a standard step. This is lightweight enough for all configurations — even convention-only systems can include reminder checking as a context file instruction.
|
|
245
|
+
|
|
246
|
+
**Source:** `three-spaces.md` — reminders specification. Time-bound actions and knowledge work goals serve different purposes and require different tracking mechanisms.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
#### Condition-based trigger evaluation replaces time-based scheduling in the orient phase
|
|
251
|
+
|
|
252
|
+
**Summary:** At session start, the system evaluates a set of declared conditions against the current vault state. When a condition fires, it surfaces as a task on the task stack via /next. This replaces all time-based scheduling (weekly health checks, monthly reviews, quarterly rethink). Conditions respond to actual state: "topic MOC exceeds 50 notes" fires when it is true, not on a Tuesday. "Stale nodes exceed 20%" fires when graph metrics warrant it, not monthly. "Unprocessed sessions exceed N" fires when transcripts accumulate. Conditions do not stack during periods of inactivity — if the vault has not changed since the last session, no conditions fire.
|
|
253
|
+
|
|
254
|
+
**Derivation Implication:** Every generated system should include condition-based triggers evaluated at session start. For hook-capable systems, the session-start hook runs condition evaluation and surfaces fired conditions. For convention-only systems, the context file instructs the agent to check vault state conditions manually. The condition declarations should be domain-appropriate: research vaults check orphan notes and MOC sizes; personal assistant vaults check follow-up due dates and memory staleness.
|
|
255
|
+
|
|
256
|
+
**Source:** v1.6 condition-based maintenance specification. Cognitive science mapping: human prospective memory works through environmental cues, not calendar schedules.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
#### The morning briefing pattern gives each session a purpose statement
|
|
261
|
+
|
|
262
|
+
**Summary:** Systems with processing pipelines or maintenance schedules benefit from a "morning briefing" at session start: a summary of what happened since the last session, what conditions have fired, and what the system's health looks like. This is richer than just reading goals.md — it synthesizes queue state, fired conditions, health metrics, and recent observations into a single orientation snapshot. The briefing gives the session a purpose statement: "Today: 3 queue items ready for reflect, 2 conditions fired (orphan notes detected, pending observations threshold exceeded), inbox has 5 new items."
|
|
263
|
+
|
|
264
|
+
**Derivation Implication:** Generated systems with processing = moderate or heavy should include a morning briefing mechanism. The session-start hook can aggregate condition evaluation results with queue status and inbox count. For convention-only systems, the context file can instruct the agent to manually evaluate conditions and summarize. The briefing pattern transforms "what should I do?" into "here is what needs doing" — reducing the orientation cost.
|
|
265
|
+
|
|
266
|
+
**Source:** Vault queue reconciliation pattern. The session-start hook shows queue status and /next runs condition reconciliation, functioning as the morning briefing.
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
#### Session logs provide historical context that goals.md cannot
|
|
271
|
+
|
|
272
|
+
**Summary:** While goals.md captures current state, session logs (ops/sessions/) capture history — what was tried, what failed, what was learned, and how understanding evolved. Session logs are append-only and temporal. They serve a different purpose than goals.md: goals.md answers "what should I do next?" while session logs answer "what has been tried before?" For systems with complex multi-session projects, session logs prevent the agent from re-attempting failed approaches or re-discovering insights already captured.
|
|
273
|
+
|
|
274
|
+
**Derivation Implication:** Generated systems with processing = moderate or heavy should include session logging in ops/sessions/. Systems with processing = light may skip session logs — goals.md provides sufficient handoff for simple systems. The context file should distinguish between the two: goals.md is mandatory, session logs are optional based on complexity.
|
|
275
|
+
|
|
276
|
+
**Source:** Vault ops/sessions/ pattern (mapped to 04_meta/logs/ in the vault's structure). Session logs proved valuable during multi-week research sprints where approaches were tried and abandoned.
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Exclusion Notes
|
|
281
|
+
|
|
282
|
+
**Excluded from this reference:**
|
|
283
|
+
|
|
284
|
+
- Multi-agent session coordination (multiple agents working simultaneously) — this is a composition concern, not a session lifecycle concern. See future multi-agent reference if created.
|
|
285
|
+
- Session scheduling (when sessions should run, cron patterns for automated sessions) — operational concern for deployment, not derivation.
|
|
286
|
+
- Specific hook implementation code (bash scripts, TypeScript handlers) — implementation detail that belongs in platform-specific templates, not derivation reference.
|
|
287
|
+
- Token counting and context window measurement — model-specific technical detail that changes with each model release. The "40% smart zone" heuristic is sufficient for derivation.
|
|
288
|
+
- Conversation history management (how many turns to keep, summarization strategies) — platform-specific concern outside derivation scope.
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## Version
|
|
293
|
+
|
|
294
|
+
- Last curated: 2026-02-12
|
|
295
|
+
- Sources reviewed: 20
|
|
296
|
+
- Claims included: 22
|
|
297
|
+
- Claims excluded: 5
|
|
298
|
+
- Cross-references: `kernel.yaml` (session-rhythm and self-space primitives), `three-spaces.md` (self/ space specification, session rhythm integration), `personality-layer.md` (personality affects session communication style), `components.md` (hooks component blueprint), `methodology.md` (session rhythm section), `failure-modes.md` (temporal staleness)
|