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.
Files changed (418) hide show
  1. package/.claude-plugin/marketplace.json +11 -0
  2. package/.claude-plugin/plugin.json +22 -0
  3. package/README.md +683 -0
  4. package/agents/knowledge-guide.md +49 -0
  5. package/bin/cli.mjs +66 -0
  6. package/generators/agents-md.md +240 -0
  7. package/generators/claude-md.md +379 -0
  8. package/generators/features/atomic-notes.md +124 -0
  9. package/generators/features/ethical-guardrails.md +58 -0
  10. package/generators/features/graph-analysis.md +188 -0
  11. package/generators/features/helper-functions.md +92 -0
  12. package/generators/features/maintenance.md +164 -0
  13. package/generators/features/methodology-knowledge.md +70 -0
  14. package/generators/features/mocs.md +144 -0
  15. package/generators/features/multi-domain.md +61 -0
  16. package/generators/features/personality.md +71 -0
  17. package/generators/features/processing-pipeline.md +428 -0
  18. package/generators/features/schema.md +149 -0
  19. package/generators/features/self-evolution.md +229 -0
  20. package/generators/features/self-space.md +78 -0
  21. package/generators/features/semantic-search.md +99 -0
  22. package/generators/features/session-rhythm.md +85 -0
  23. package/generators/features/templates.md +85 -0
  24. package/generators/features/wiki-links.md +88 -0
  25. package/generators/soul-md.md +121 -0
  26. package/hooks/hooks.json +45 -0
  27. package/hooks/scripts/auto-commit.sh +44 -0
  28. package/hooks/scripts/session-capture.sh +35 -0
  29. package/hooks/scripts/session-orient.sh +86 -0
  30. package/hooks/scripts/write-validate.sh +42 -0
  31. package/methodology/AI shifts knowledge systems from externalizing memory to externalizing attention.md +59 -0
  32. package/methodology/BM25 retrieval fails on full-length descriptions because query term dilution reduces match scores.md +39 -0
  33. package/methodology/IBIS framework maps claim-based architecture to structured argumentation.md +58 -0
  34. package/methodology/LLM attention degrades as context fills.md +49 -0
  35. package/methodology/MOC construction forces synthesis that automated generation from metadata cannot replicate.md +49 -0
  36. package/methodology/MOC maintenance investment compounds because orientation savings multiply across every future session.md +41 -0
  37. package/methodology/MOCs are attention management devices not just organizational tools.md +51 -0
  38. package/methodology/PKM failure follows a predictable cycle.md +50 -0
  39. package/methodology/ThreadMode to DocumentMode transformation is the core value creation step.md +52 -0
  40. package/methodology/WIP limits force processing over accumulation.md +53 -0
  41. package/methodology/Zeigarnik effect validates capture-first philosophy because open loops drain attention.md +42 -0
  42. package/methodology/academic research uses structured extraction with cross-source synthesis.md +566 -0
  43. package/methodology/adapt the four-phase processing pipeline to domain-specific throughput needs.md +197 -0
  44. package/methodology/agent notes externalize navigation intuition that search cannot discover and traversal cannot reconstruct.md +48 -0
  45. package/methodology/agent self-memory should be architecturally separate from user knowledge systems.md +48 -0
  46. package/methodology/agent session boundaries create natural automation checkpoints that human-operated systems lack.md +56 -0
  47. package/methodology/agent-cognition.md +107 -0
  48. package/methodology/agents are simultaneously methodology executors and subjects creating a unique trust asymmetry.md +66 -0
  49. package/methodology/aspect-oriented programming solved the same cross-cutting concern problem that hooks solve.md +39 -0
  50. package/methodology/associative ontologies beat hierarchical taxonomies because heterarchy adapts while hierarchy brittles.md +53 -0
  51. package/methodology/attention residue may have a minimum granularity that cannot be subdivided.md +46 -0
  52. package/methodology/auto-commit hooks eliminate prospective memory failures by converting remember-to-act into guaranteed execution.md +47 -0
  53. package/methodology/automated detection is always safe because it only reads state while automated remediation risks content corruption.md +42 -0
  54. package/methodology/automation should be retired when its false positive rate exceeds its true positive rate or it catches zero issues.md +56 -0
  55. package/methodology/backlinks implicitly define notes by revealing usage context.md +35 -0
  56. package/methodology/backward maintenance asks what would be different if written today.md +62 -0
  57. package/methodology/balance onboarding enforcement and questions to prevent premature complexity.md +229 -0
  58. package/methodology/basic level categorization determines optimal MOC granularity.md +51 -0
  59. package/methodology/batching by context similarity reduces switching costs in agent processing.md +43 -0
  60. package/methodology/behavioral anti-patterns matter more than tool selection.md +42 -0
  61. package/methodology/betweenness centrality identifies bridge notes connecting disparate knowledge domains.md +57 -0
  62. package/methodology/blueprints that teach construction outperform downloads that provide pre-built code for platform-dependent modules.md +42 -0
  63. package/methodology/bootstrapping principle enables self-improving systems.md +62 -0
  64. package/methodology/build automatic memory through cognitive offloading and session handoffs.md +285 -0
  65. package/methodology/capture the reaction to content not just the content itself.md +41 -0
  66. package/methodology/claims must be specific enough to be wrong.md +36 -0
  67. package/methodology/closure rituals create clean breaks that prevent attention residue bleed.md +44 -0
  68. package/methodology/cognitive offloading is the architectural foundation for vault design.md +46 -0
  69. package/methodology/cognitive outsourcing risk in agent-operated systems.md +55 -0
  70. package/methodology/coherence maintains consistency despite inconsistent inputs.md +96 -0
  71. package/methodology/coherent architecture emerges from wiki links spreading activation and small-world topology.md +48 -0
  72. package/methodology/community detection algorithms can inform when MOCs should split or merge.md +52 -0
  73. package/methodology/complete navigation requires four complementary types that no single mechanism provides.md +43 -0
  74. package/methodology/complex systems evolve from simple working systems.md +59 -0
  75. package/methodology/composable knowledge architecture builds systems from independent toggleable modules not monolithic templates.md +61 -0
  76. package/methodology/compose multi-domain systems through separate templates and shared graph.md +372 -0
  77. package/methodology/concept-orientation beats source-orientation for cross-domain connections.md +51 -0
  78. package/methodology/confidence thresholds gate automated action between the mechanical and judgment zones.md +50 -0
  79. package/methodology/configuration dimensions interact so choices in one create pressure on others.md +58 -0
  80. package/methodology/configuration paralysis emerges when derivation surfaces too many decisions.md +44 -0
  81. package/methodology/context files function as agent operating systems through self-referential self-extension.md +46 -0
  82. package/methodology/context phrase clarity determines how deep a navigation hierarchy can scale.md +46 -0
  83. package/methodology/continuous small-batch processing eliminates review dread.md +48 -0
  84. package/methodology/controlled disorder engineers serendipity through semantic rather than topical linking.md +51 -0
  85. package/methodology/creative writing uses worldbuilding consistency with character tracking.md +672 -0
  86. package/methodology/cross-links between MOC territories indicate creative leaps and integration depth.md +43 -0
  87. package/methodology/dangling links reveal which notes want to exist.md +62 -0
  88. package/methodology/data exit velocity measures how quickly content escapes vendor lock-in.md +74 -0
  89. package/methodology/decontextualization risk means atomicity may strip meaning that cannot be recovered.md +48 -0
  90. package/methodology/dense interlinked research claims enable derivation while sparse references only enable templating.md +47 -0
  91. package/methodology/dependency resolution through topological sort makes module composition transparent and verifiable.md +56 -0
  92. package/methodology/derivation generates knowledge systems from composable research claims not template customization.md +63 -0
  93. package/methodology/derivation-engine.md +27 -0
  94. package/methodology/derived systems follow a seed-evolve-reseed lifecycle.md +56 -0
  95. package/methodology/description quality for humans diverges from description quality for keyword search.md +73 -0
  96. package/methodology/descriptions are retrieval filters not summaries.md +112 -0
  97. package/methodology/design MOCs as attention management devices with lifecycle governance.md +318 -0
  98. package/methodology/design-dimensions.md +66 -0
  99. package/methodology/digital mutability enables note evolution that physical permanence forbids.md +54 -0
  100. package/methodology/discovery-retrieval.md +48 -0
  101. package/methodology/distinctiveness scoring treats description quality as measurable.md +69 -0
  102. package/methodology/does agent processing recover what fast capture loses.md +43 -0
  103. package/methodology/domain-compositions.md +37 -0
  104. package/methodology/dual-coding with visual elements could enhance agent traversal.md +55 -0
  105. package/methodology/each module must be describable in one sentence under 200 characters or it does too many things.md +45 -0
  106. package/methodology/each new note compounds value by creating traversal paths.md +55 -0
  107. package/methodology/eight configuration dimensions parameterize the space of possible knowledge systems.md +56 -0
  108. package/methodology/elaborative encoding is the quality gate for new notes.md +55 -0
  109. package/methodology/enforce schema with graduated strictness across capture processing and query zones.md +221 -0
  110. package/methodology/enforcing atomicity can create paralysis when ideas resist decomposition.md +43 -0
  111. package/methodology/engineering uses technical decision tracking with architectural memory.md +766 -0
  112. package/methodology/every knowledge domain shares a four-phase processing skeleton that diverges only in the process step.md +53 -0
  113. package/methodology/evolution observations provide actionable signals for system adaptation.md +67 -0
  114. package/methodology/external memory shapes cognition more than base model.md +60 -0
  115. package/methodology/faceted classification treats notes as multi-dimensional objects rather than folder contents.md +65 -0
  116. package/methodology/failure-modes.md +27 -0
  117. package/methodology/false universalism applies same processing logic regardless of domain.md +49 -0
  118. package/methodology/federated wiki pattern enables multi-agent divergence as feature not bug.md +59 -0
  119. package/methodology/flat files break at retrieval scale.md +75 -0
  120. package/methodology/forced engagement produces weak connections.md +48 -0
  121. package/methodology/four abstraction layers separate platform-agnostic from platform-dependent knowledge system features.md +47 -0
  122. package/methodology/fresh context per task preserves quality better than chaining phases.md +44 -0
  123. package/methodology/friction reveals architecture.md +63 -0
  124. package/methodology/friction-driven module adoption prevents configuration debt by adding complexity only at pain points.md +48 -0
  125. package/methodology/gardening cycle implements tend prune fertilize operations.md +41 -0
  126. package/methodology/generation effect gate blocks processing without transformation.md +40 -0
  127. package/methodology/goal-driven memory orchestration enables autonomous domain learning through directed compute allocation.md +41 -0
  128. package/methodology/good descriptions layer heuristic then mechanism then implication.md +57 -0
  129. package/methodology/graph-structure.md +65 -0
  130. package/methodology/guided notes might outperform post-hoc structuring for high-volume capture.md +37 -0
  131. package/methodology/health wellness uses symptom-trigger correlation with multi-dimensional tracking.md +819 -0
  132. package/methodology/hook composition creates emergent methodology from independent single-concern components.md +47 -0
  133. package/methodology/hook enforcement guarantees quality while instruction enforcement merely suggests it.md +51 -0
  134. package/methodology/hook-driven learning loops create self-improving methodology through observation accumulation.md +62 -0
  135. package/methodology/hooks are the agent habit system that replaces the missing basal ganglia.md +40 -0
  136. package/methodology/hooks cannot replace genuine cognitive engagement yet more automation is always tempting.md +87 -0
  137. package/methodology/hooks enable context window efficiency by delegating deterministic checks to external processes.md +47 -0
  138. package/methodology/idempotent maintenance operations are safe to automate because running them twice produces the same result as running them once.md +44 -0
  139. package/methodology/implement condition-based maintenance triggers for derived systems.md +255 -0
  140. package/methodology/implicit dependencies create distributed monoliths that fail silently across configurations.md +58 -0
  141. package/methodology/implicit knowledge emerges from traversal.md +55 -0
  142. package/methodology/incremental formalization happens through repeated touching of old notes.md +60 -0
  143. package/methodology/incremental reading enables cross-source connection finding.md +39 -0
  144. package/methodology/index.md +32 -0
  145. package/methodology/inline links carry richer relationship data than metadata fields.md +91 -0
  146. package/methodology/insight accretion differs from productivity in knowledge systems.md +41 -0
  147. package/methodology/intermediate packets enable assembly over creation.md +52 -0
  148. package/methodology/intermediate representation pattern enables reliable vault operations beyond regex.md +62 -0
  149. package/methodology/justification chains enable forward backward and evolution reasoning about configuration decisions.md +46 -0
  150. package/methodology/knowledge system architecture is parameterized by platform capabilities not fixed by methodology.md +51 -0
  151. package/methodology/knowledge systems become communication partners through complexity and memory humans cannot sustain.md +47 -0
  152. package/methodology/knowledge systems share universal operations and structural components across all methodology traditions.md +46 -0
  153. package/methodology/legal case management uses precedent chains with regulatory change propagation.md +892 -0
  154. package/methodology/live index via periodic regeneration keeps discovery current.md +58 -0
  155. package/methodology/local-first file formats are inherently agent-native.md +69 -0
  156. package/methodology/logic column pattern separates reasoning from procedure.md +35 -0
  157. package/methodology/maintenance operations are more universal than creative pipelines because structural health is domain-invariant.md +47 -0
  158. package/methodology/maintenance scheduling frequency should match consequence speed not detection capability.md +50 -0
  159. package/methodology/maintenance targeting should prioritize mechanism and theory notes.md +26 -0
  160. package/methodology/maintenance-patterns.md +72 -0
  161. package/methodology/markdown plus YAML plus ripgrep implements a queryable graph database without infrastructure.md +55 -0
  162. package/methodology/maturity field enables agent context prioritization.md +33 -0
  163. package/methodology/memory-architecture.md +27 -0
  164. package/methodology/metacognitive confidence can diverge from retrieval capability.md +42 -0
  165. package/methodology/metadata reduces entropy enabling precision over recall.md +91 -0
  166. package/methodology/methodology development should follow the trajectory from documentation to skill to hook as understanding hardens.md +80 -0
  167. package/methodology/methodology traditions are named points in a shared configuration space not competing paradigms.md +64 -0
  168. package/methodology/mnemonic medium embeds verification into navigation.md +46 -0
  169. package/methodology/module communication through shared YAML fields creates loose coupling without direct dependencies.md +44 -0
  170. package/methodology/module deactivation must account for structural artifacts that survive the toggle.md +49 -0
  171. package/methodology/multi-domain systems compose through separate templates and shared graph.md +61 -0
  172. package/methodology/multi-domain-composition.md +27 -0
  173. package/methodology/narrow folksonomy optimizes for single-operator retrieval unlike broad consensus tagging.md +53 -0
  174. package/methodology/navigation infrastructure passes through distinct scaling regimes that require qualitative strategy shifts.md +48 -0
  175. package/methodology/navigational vertigo emerges in pure association systems without local hierarchy.md +54 -0
  176. package/methodology/note titles should function as APIs enabling sentence transclusion.md +51 -0
  177. package/methodology/note-design.md +57 -0
  178. package/methodology/notes are skills /342/200/224 curated knowledge injected when relevant.md" +62 -0
  179. package/methodology/notes function as cognitive anchors that stabilize attention during complex tasks.md +41 -0
  180. package/methodology/novel domains derive by mapping knowledge type to closest reference domain then adapting.md +50 -0
  181. package/methodology/nudge theory explains graduated hook enforcement as choice architecture for agents.md +59 -0
  182. package/methodology/observation and tension logs function as dead-letter queues for failed automation.md +51 -0
  183. package/methodology/operational memory and knowledge memory serve different functions in agent architecture.md +48 -0
  184. package/methodology/operational wisdom requires contextual observation.md +52 -0
  185. package/methodology/orchestrated vault creation transforms arscontexta from tool to autonomous knowledge factory.md +40 -0
  186. package/methodology/organic emergence versus active curation creates a fundamental vault governance tension.md +68 -0
  187. package/methodology/orphan notes are seeds not failures.md +38 -0
  188. package/methodology/over-automation corrupts quality when hooks encode judgment rather than verification.md +62 -0
  189. package/methodology/people relationships uses Dunbar-layered graphs with interaction tracking.md +659 -0
  190. package/methodology/personal assistant uses life area management with review automation.md +610 -0
  191. package/methodology/platform adapter translation is semantic not mechanical because hook event meanings differ.md +40 -0
  192. package/methodology/platform capability tiers determine which knowledge system features can be implemented.md +48 -0
  193. package/methodology/platform fragmentation means identical conceptual operations require different implementations across agent environments.md +44 -0
  194. package/methodology/premature complexity is the most common derivation failure mode.md +45 -0
  195. package/methodology/prevent domain-specific failure modes through the vulnerability matrix.md +336 -0
  196. package/methodology/processing effort should follow retrieval demand.md +57 -0
  197. package/methodology/processing-workflows.md +75 -0
  198. package/methodology/product management uses feedback pipelines with experiment tracking.md +789 -0
  199. package/methodology/productivity porn risk in meta-system building.md +30 -0
  200. package/methodology/programmable notes could enable property-triggered workflows.md +64 -0
  201. package/methodology/progressive disclosure means reading right not reading less.md +69 -0
  202. package/methodology/progressive schema validates only what active modules require not the full system schema.md +49 -0
  203. package/methodology/project management uses decision tracking with stakeholder context.md +776 -0
  204. package/methodology/propositional link semantics transform wiki links from associative to reasoned.md +87 -0
  205. package/methodology/prospective memory requires externalization.md +53 -0
  206. package/methodology/provenance tracks where beliefs come from.md +62 -0
  207. package/methodology/queries evolve during search so agents should checkpoint.md +35 -0
  208. package/methodology/question-answer metadata enables inverted search patterns.md +39 -0
  209. package/methodology/random note resurfacing prevents write-only memory.md +33 -0
  210. package/methodology/reconciliation loops that compare desired state to actual state enable drift correction without continuous monitoring.md +59 -0
  211. package/methodology/reflection synthesizes existing notes into new insight.md +100 -0
  212. package/methodology/retrieval utility should drive design over capture completeness.md +69 -0
  213. package/methodology/retrieval verification loop tests description quality at scale.md +81 -0
  214. package/methodology/role field makes graph structure explicit.md +94 -0
  215. package/methodology/scaffolding enables divergence that fine-tuning cannot.md +67 -0
  216. package/methodology/schema enforcement via validation agents enables soft consistency.md +60 -0
  217. package/methodology/schema evolution follows observe-then-formalize not design-then-enforce.md +65 -0
  218. package/methodology/schema field names are the only domain specific element in the universal note pattern.md +46 -0
  219. package/methodology/schema fields should use domain-native vocabulary not abstract terminology.md +47 -0
  220. package/methodology/schema templates reduce cognitive overhead at capture time.md +55 -0
  221. package/methodology/schema validation hooks externalize inhibitory control that degrades under cognitive load.md +48 -0
  222. package/methodology/schema-enforcement.md +27 -0
  223. package/methodology/self-extension requires context files to contain platform operations knowledge not just methodology.md +47 -0
  224. package/methodology/sense-making vs storage does compression lose essential nuance.md +73 -0
  225. package/methodology/session boundary hooks implement cognitive bookends for orientation and reflection.md +60 -0
  226. package/methodology/session handoff creates continuity without persistent memory.md +43 -0
  227. package/methodology/session outputs are packets for future selves.md +43 -0
  228. package/methodology/session transcript mining enables experiential validation that structural tests cannot provide.md +38 -0
  229. package/methodology/skill context budgets constrain knowledge system complexity on agent platforms.md +52 -0
  230. package/methodology/skills encode methodology so manual execution bypasses quality gates.md +50 -0
  231. package/methodology/small-world topology requires hubs and dense local links.md +99 -0
  232. package/methodology/source attribution enables tracing claims to foundations.md +38 -0
  233. package/methodology/spaced repetition scheduling could optimize vault maintenance.md +44 -0
  234. package/methodology/spreading activation models how agents should traverse.md +79 -0
  235. package/methodology/stale navigation actively misleads because agents trust curated maps completely.md +43 -0
  236. package/methodology/stigmergy coordinates agents through environmental traces without direct communication.md +62 -0
  237. package/methodology/storage versus thinking distinction determines which tool patterns apply.md +56 -0
  238. package/methodology/structure enables navigation without reading everything.md +52 -0
  239. package/methodology/structure without processing provides no value.md +56 -0
  240. package/methodology/student learning uses prerequisite graphs with spaced retrieval.md +770 -0
  241. package/methodology/summary coherence tests composability before filing.md +37 -0
  242. package/methodology/tag rot applies to wiki links because titles serve as both identifier and display text.md +50 -0
  243. package/methodology/temporal media must convert to spatial text for agent traversal.md +43 -0
  244. package/methodology/temporal processing priority creates age-based inbox urgency.md +45 -0
  245. package/methodology/temporal separation of capture and processing preserves context freshness.md +39 -0
  246. package/methodology/ten universal primitives form the kernel of every viable agent knowledge system.md +162 -0
  247. package/methodology/testing effect could enable agent knowledge verification.md +38 -0
  248. package/methodology/the AgentSkills standard embodies progressive disclosure at the skill level.md +40 -0
  249. package/methodology/the derivation engine improves recursively as deployed systems generate observations.md +49 -0
  250. package/methodology/the determinism boundary separates hook methodology from skill methodology.md +46 -0
  251. package/methodology/the fix-versus-report decision depends on determinism reversibility and accumulated trust.md +45 -0
  252. package/methodology/the generation effect requires active transformation not just storage.md +57 -0
  253. package/methodology/the no wrong patches guarantee ensures any valid module combination produces a valid system.md +58 -0
  254. package/methodology/the system is the argument.md +46 -0
  255. package/methodology/the vault constitutes identity for agents.md +86 -0
  256. package/methodology/the vault methodology transfers because it encodes cognitive science not domain specifics.md +47 -0
  257. package/methodology/therapy journal uses warm personality with pattern detection for emotional processing.md +584 -0
  258. package/methodology/three capture schools converge through agent-mediated synthesis.md +55 -0
  259. package/methodology/three concurrent maintenance loops operate at different timescales to catch different classes of problems.md +56 -0
  260. package/methodology/throughput matters more than accumulation.md +58 -0
  261. package/methodology/title as claim enables traversal as reasoning.md +50 -0
  262. package/methodology/topological organization beats temporal for knowledge work.md +52 -0
  263. package/methodology/trading uses conviction tracking with thesis-outcome correlation.md +699 -0
  264. package/methodology/trails transform ephemeral navigation into persistent artifacts.md +39 -0
  265. package/methodology/transform universal vocabulary to domain-native language through six levels.md +259 -0
  266. package/methodology/type field enables structured queries without folder hierarchies.md +53 -0
  267. package/methodology/use-case presets dissolve the tension between composability and simplicity.md +44 -0
  268. package/methodology/vault conventions may impose hidden rigidity on thinking.md +44 -0
  269. package/methodology/verbatim risk applies to agents too.md +31 -0
  270. package/methodology/vibe notetaking is the emerging industry consensus for AI-native self-organization.md +56 -0
  271. package/methodology/vivid memories need verification.md +45 -0
  272. package/methodology/vocabulary-transformation.md +27 -0
  273. package/methodology/voice capture is the highest-bandwidth channel for agent-delegated knowledge systems.md +45 -0
  274. package/methodology/wiki links are the digital evolution of analog indexing.md +73 -0
  275. package/methodology/wiki links as social contract transforms agents into stewards of incomplete references.md +52 -0
  276. package/methodology/wiki links create navigation paths that shape retrieval.md +63 -0
  277. package/methodology/wiki links implement GraphRAG without the infrastructure.md +101 -0
  278. package/methodology/writing for audience blocks authentic creation.md +22 -0
  279. package/methodology/you operate a system that takes notes.md +79 -0
  280. package/openclaw/SKILL.md +110 -0
  281. package/package.json +45 -0
  282. package/platforms/README.md +51 -0
  283. package/platforms/claude-code/generator.md +61 -0
  284. package/platforms/claude-code/hooks/README.md +186 -0
  285. package/platforms/claude-code/hooks/auto-commit.sh.template +38 -0
  286. package/platforms/claude-code/hooks/session-capture.sh.template +72 -0
  287. package/platforms/claude-code/hooks/session-orient.sh.template +189 -0
  288. package/platforms/claude-code/hooks/write-validate.sh.template +106 -0
  289. package/platforms/openclaw/generator.md +82 -0
  290. package/platforms/openclaw/hooks/README.md +89 -0
  291. package/platforms/openclaw/hooks/bootstrap.ts.template +224 -0
  292. package/platforms/openclaw/hooks/command-new.ts.template +165 -0
  293. package/platforms/openclaw/hooks/heartbeat.ts.template +214 -0
  294. package/platforms/shared/features/README.md +70 -0
  295. package/platforms/shared/skill-blocks/graph.md +145 -0
  296. package/platforms/shared/skill-blocks/learn.md +119 -0
  297. package/platforms/shared/skill-blocks/next.md +131 -0
  298. package/platforms/shared/skill-blocks/pipeline.md +326 -0
  299. package/platforms/shared/skill-blocks/ralph.md +616 -0
  300. package/platforms/shared/skill-blocks/reduce.md +1142 -0
  301. package/platforms/shared/skill-blocks/refactor.md +129 -0
  302. package/platforms/shared/skill-blocks/reflect.md +780 -0
  303. package/platforms/shared/skill-blocks/remember.md +524 -0
  304. package/platforms/shared/skill-blocks/rethink.md +574 -0
  305. package/platforms/shared/skill-blocks/reweave.md +680 -0
  306. package/platforms/shared/skill-blocks/seed.md +320 -0
  307. package/platforms/shared/skill-blocks/stats.md +145 -0
  308. package/platforms/shared/skill-blocks/tasks.md +171 -0
  309. package/platforms/shared/skill-blocks/validate.md +323 -0
  310. package/platforms/shared/skill-blocks/verify.md +562 -0
  311. package/platforms/shared/templates/README.md +35 -0
  312. package/presets/experimental/categories.yaml +1 -0
  313. package/presets/experimental/preset.yaml +38 -0
  314. package/presets/experimental/starter/README.md +7 -0
  315. package/presets/experimental/vocabulary.yaml +7 -0
  316. package/presets/personal/categories.yaml +7 -0
  317. package/presets/personal/preset.yaml +41 -0
  318. package/presets/personal/starter/goals.md +21 -0
  319. package/presets/personal/starter/index.md +17 -0
  320. package/presets/personal/starter/life-areas.md +21 -0
  321. package/presets/personal/starter/people.md +21 -0
  322. package/presets/personal/vocabulary.yaml +32 -0
  323. package/presets/research/categories.yaml +8 -0
  324. package/presets/research/preset.yaml +41 -0
  325. package/presets/research/starter/index.md +17 -0
  326. package/presets/research/starter/methods.md +21 -0
  327. package/presets/research/starter/open-questions.md +21 -0
  328. package/presets/research/vocabulary.yaml +33 -0
  329. package/reference/AUDIT-REPORT.md +238 -0
  330. package/reference/claim-map.md +172 -0
  331. package/reference/components.md +327 -0
  332. package/reference/conversation-patterns.md +542 -0
  333. package/reference/derivation-validation.md +649 -0
  334. package/reference/dimension-claim-map.md +134 -0
  335. package/reference/evolution-lifecycle.md +297 -0
  336. package/reference/failure-modes.md +235 -0
  337. package/reference/interaction-constraints.md +204 -0
  338. package/reference/kernel.yaml +242 -0
  339. package/reference/methodology.md +283 -0
  340. package/reference/open-questions.md +279 -0
  341. package/reference/personality-layer.md +302 -0
  342. package/reference/self-space.md +299 -0
  343. package/reference/semantic-vs-keyword.md +288 -0
  344. package/reference/session-lifecycle.md +298 -0
  345. package/reference/templates/base-note.md +16 -0
  346. package/reference/templates/companion-note.md +70 -0
  347. package/reference/templates/creative-note.md +16 -0
  348. package/reference/templates/learning-note.md +16 -0
  349. package/reference/templates/life-note.md +16 -0
  350. package/reference/templates/moc.md +26 -0
  351. package/reference/templates/relationship-note.md +17 -0
  352. package/reference/templates/research-note.md +19 -0
  353. package/reference/templates/session-log.md +24 -0
  354. package/reference/templates/therapy-note.md +16 -0
  355. package/reference/test-fixtures/edge-case-constraints.md +148 -0
  356. package/reference/test-fixtures/multi-domain.md +164 -0
  357. package/reference/test-fixtures/novel-domain-gaming.md +138 -0
  358. package/reference/test-fixtures/research-minimal.md +102 -0
  359. package/reference/test-fixtures/therapy-full.md +155 -0
  360. package/reference/testing-milestones.md +1087 -0
  361. package/reference/three-spaces.md +363 -0
  362. package/reference/tradition-presets.md +203 -0
  363. package/reference/use-case-presets.md +341 -0
  364. package/reference/validate-kernel.sh +432 -0
  365. package/reference/vocabulary-transforms.md +85 -0
  366. package/scripts/sync-thinking.sh +147 -0
  367. package/skill-sources/graph/SKILL.md +567 -0
  368. package/skill-sources/graph/skill.json +17 -0
  369. package/skill-sources/learn/SKILL.md +254 -0
  370. package/skill-sources/learn/skill.json +17 -0
  371. package/skill-sources/next/SKILL.md +407 -0
  372. package/skill-sources/next/skill.json +17 -0
  373. package/skill-sources/pipeline/SKILL.md +314 -0
  374. package/skill-sources/pipeline/skill.json +17 -0
  375. package/skill-sources/ralph/SKILL.md +604 -0
  376. package/skill-sources/ralph/skill.json +17 -0
  377. package/skill-sources/reduce/SKILL.md +1113 -0
  378. package/skill-sources/reduce/skill.json +17 -0
  379. package/skill-sources/refactor/SKILL.md +448 -0
  380. package/skill-sources/refactor/skill.json +17 -0
  381. package/skill-sources/reflect/SKILL.md +747 -0
  382. package/skill-sources/reflect/skill.json +17 -0
  383. package/skill-sources/remember/SKILL.md +534 -0
  384. package/skill-sources/remember/skill.json +17 -0
  385. package/skill-sources/rethink/SKILL.md +658 -0
  386. package/skill-sources/rethink/skill.json +17 -0
  387. package/skill-sources/reweave/SKILL.md +657 -0
  388. package/skill-sources/reweave/skill.json +17 -0
  389. package/skill-sources/seed/SKILL.md +303 -0
  390. package/skill-sources/seed/skill.json +17 -0
  391. package/skill-sources/stats/SKILL.md +371 -0
  392. package/skill-sources/stats/skill.json +17 -0
  393. package/skill-sources/tasks/SKILL.md +402 -0
  394. package/skill-sources/tasks/skill.json +17 -0
  395. package/skill-sources/validate/SKILL.md +310 -0
  396. package/skill-sources/validate/skill.json +17 -0
  397. package/skill-sources/verify/SKILL.md +532 -0
  398. package/skill-sources/verify/skill.json +17 -0
  399. package/skills/add-domain/SKILL.md +441 -0
  400. package/skills/add-domain/skill.json +17 -0
  401. package/skills/architect/SKILL.md +568 -0
  402. package/skills/architect/skill.json +17 -0
  403. package/skills/ask/SKILL.md +388 -0
  404. package/skills/ask/skill.json +17 -0
  405. package/skills/health/SKILL.md +760 -0
  406. package/skills/health/skill.json +17 -0
  407. package/skills/help/SKILL.md +348 -0
  408. package/skills/help/skill.json +17 -0
  409. package/skills/recommend/SKILL.md +553 -0
  410. package/skills/recommend/skill.json +17 -0
  411. package/skills/reseed/SKILL.md +385 -0
  412. package/skills/reseed/skill.json +17 -0
  413. package/skills/setup/SKILL.md +1688 -0
  414. package/skills/setup/skill.json +17 -0
  415. package/skills/tutorial/SKILL.md +496 -0
  416. package/skills/tutorial/skill.json +17 -0
  417. package/skills/upgrade/SKILL.md +395 -0
  418. package/skills/upgrade/skill.json +17 -0
@@ -0,0 +1,47 @@
1
+ ---
2
+ description: Nine hooks across five events compose into quality pipelines, session bookends, and coordination awareness that no single hook creates and no instruction set could reliably enforce
3
+ kind: research
4
+ topics: ["[[processing-workflows]]", "[[agent-cognition]]"]
5
+ methodology: ["Original", "Systems Theory"]
6
+ source: [[hooks-as-methodology-encoders-research-source]]
7
+ ---
8
+
9
+ # hook composition creates emergent methodology from independent single-concern components
10
+
11
+ The individual hooks in the vault each address exactly one concern: schema validation, auto-commit, tree injection, broken link checking, CLAUDE.md protection. None of them implements "methodology." But when nine hooks fire across five event boundaries, they compose into behavioral patterns that no single hook was designed to produce and that no set of instructions could reliably enforce.
12
+
13
+ The clearest example is the quality pipeline. When an agent writes a thinking note, three hooks fire in sequence: protect-claude-md.sh checks whether the file is CLAUDE.md (PreToolUse, passes because it is not), validate-note.sh checks schema compliance (PostToolUse, blocks on missing required fields), and auto-commit.sh versions the change (PostToolUse, async). If validation fails, the agent fixes and rewrites, triggering the entire chain again. The result is an automatic write-validate-fix-write-validate-pass-commit loop that emerges from composition, not from any hook's individual logic. The agent experiences "I wrote a note and got feedback," but the underlying mechanism is three independent components creating a quality cycle.
14
+
15
+ At session scale, composition produces something richer. Since [[session boundary hooks implement cognitive bookends for orientation and reflection]], SessionStart hooks bracket the beginning with orientation (tree injection, philosophy reminder, health metrics, queue status, observation and tension counts) while Stop hooks bracket the end with reflection (broken link checking, session activity summary, queue auditing, structured review prompts). Neither was designed as the other's complement, but their composition creates the bracketing effect. Every edit between these bookends triggers validation and versioning. Every subagent completion triggers MOC update reminders and handoff validation. The session is wrapped in orientation and reflection with continuous quality enforcement in between. The learning loop documented in [[hook-driven learning loops create self-improving methodology through observation accumulation]] is another composition artifact: the Stop hook nudges observation capture, the Start hook displays accumulated counts, and the threshold triggering rethink was never any single hook's purpose -- it emerges from their interaction.
16
+
17
+ The composability principle is what makes this work predictably. Because each hook addresses exactly one concern, adding a new concern means adding a hook, not modifying existing ones. This follows from the same principle that makes [[complex systems evolve from simple working systems]]: you add complexity at friction points, and single-concern components ensure that each addition is independent. Predictability also depends on [[the determinism boundary separates hook methodology from skill methodology]]: because each component is deterministic (same input always produces same output regardless of context state), their composition produces deterministic emergent behavior. Composing judgment-requiring operations would yield unpredictable interactions -- two skills evaluating the same note could reach different conclusions depending on context, making their combined behavior impossible to reason about. Determinism is what makes the emergent composition trustworthy rather than merely surprising. But determinism alone does not guarantee safe composition -- since [[idempotent maintenance operations are safe to automate because running them twice produces the same result as running them once]], composed hook chains that fire on events can re-trigger when events repeat through crash recovery or overlapping timers. The write-validate-commit pipeline is safe to re-trigger precisely because each component is idempotent: re-validating an already-valid note is a no-op, re-committing unchanged files is a no-op. A composed chain where any component is non-idempotent (such as an append-to-log step without deduplication) would accumulate side effects from redundant triggering, making the emergent behavior not just unpredictable but actively harmful.
18
+
19
+ Since [[hook enforcement guarantees quality while instruction enforcement merely suggests it]], composition built from hooks is strictly more reliable than the same composition described in instructions, because each component fires regardless of attention state. An instruction-based "quality pipeline" would require the agent to remember three separate steps in sequence, and since [[LLM attention degrades as context fills]], that memory degrades precisely when quality enforcement matters most. But reliability is not enough -- composition also requires graduated enforcement. Since [[nudge theory explains graduated hook enforcement as choice architecture for agents]], uniform blocking across nine hooks would make composition catastrophically brittle: each hook becomes a potential failure point, and the probability of a clean pass drops multiplicatively. Graduated enforcement (blocking for structural violations, warning for qualitative ones) is what makes nine-hook composition viable.
20
+
21
+ There is a design tension worth noting: emergent composition is powerful but also opaque. The agent who experiences the quality pipeline does not necessarily understand it as three hooks composing. The methodology is enacted without being visible. Since [[aspect-oriented programming solved the same cross-cutting concern problem that hooks solve]], the AOP literature gives this property a precise name -- "obliviousness" -- and documents two decades of the debugging difficulties it creates. When multiple aspects interact at the same join point, the base code's developer cannot trace the problem because the behavior lives outside their code. Hook composition creates the same diagnostic challenge: when the quality pipeline produces unexpected results, the agent cannot diagnose whether the failure is in protection, validation, or commit logic without understanding the full chain. The named patterns -- quality pipeline, bookend, guardian, awareness -- provide vocabulary for reasoning about composition, turning implicit emergent behavior into something teams can discuss and design.
22
+
23
+ This emergence pattern is not unique to hooks. The vault's knowledge graph demonstrates the same structural property: since [[coherent architecture emerges from wiki links spreading activation and small-world topology]], wiki links, spreading activation, and small-world topology compose into navigable architecture that none was designed to produce independently. The pattern generalizes further: since [[module communication through shared YAML fields creates loose coupling without direct dependencies]], knowledge system modules compose through shared YAML fields just as hooks compose through shared file events — neither hooks nor modules call each other directly, both coordinate through environmental state, and both produce emergent behavior from independent components. The parallel suggests a shared design principle across the vault's layers: build independent single-concern components (hooks, wiki links, MOC conventions, knowledge modules), and composition creates system-level behavior that no component's documentation captures. This hook-level proof of concept is exactly what [[composable knowledge architecture builds systems from independent toggleable modules not monolithic templates]] generalizes to the full knowledge system architecture — four traditions (component engineering, Unix, pattern language, Eurorack) converge on the same composability guarantee that nine hooks demonstrate at the automation layer. Since [[stigmergy coordinates agents through environmental traces without direct communication]], hooks are a specific instance of automated stigmergic response: a file write (environmental event) triggers validation (deterministic response), which triggers versioning (another deterministic response). No hook communicates with another — each responds to the environmental state it finds. The emergent quality pipeline is stigmergic coordination operating at the infrastructure level rather than the knowledge level. The implication for portability is sobering: since [[platform adapter translation is semantic not mechanical because hook event meanings differ]], translating individual hooks across platforms is already semantic, but translating the composed patterns requires understanding emergent interactions that exist nowhere in any single hook's implementation.
24
+ ---
25
+
26
+ Relevant Notes:
27
+ - [[markdown plus YAML plus ripgrep implements a queryable graph database without infrastructure]] — structural parallel at the knowledge layer: four conventions (wiki links, YAML metadata, faceted fields, soft validation) compose into graph database capabilities that no single convention provides, the same emergent composition pattern this note documents for hooks
28
+ - [[hook enforcement guarantees quality while instruction enforcement merely suggests it]] — foundation: composition only works because each component hook fires reliably regardless of attention state; instruction-based composition would degrade as individual instructions are forgotten
29
+ - [[complex systems evolve from simple working systems]] — the evolution principle that produced this composition: each hook was added at a friction point, and the emergent methodology arose from accumulated simple additions rather than upfront design
30
+ - [[skills encode methodology so manual execution bypasses quality gates]] — complementary encoding: skills encode the what (full workflows requiring judgment), hooks encode the when (automatic triggers requiring no judgment); composition happens within each layer and across both
31
+ - [[schema enforcement via validation agents enables soft consistency]] — instance of the quality pipeline pattern: validation hooks compose with auto-commit hooks to create write-validate-version sequences that neither could produce alone
32
+ - [[bootstrapping principle enables self-improving systems]] — the recursive mechanism: hooks that enforce methodology quality also apply when building new hooks, so the composition itself bootstraps through its own enforcement chain
33
+ - [[the determinism boundary separates hook methodology from skill methodology]] — precondition: composition produces predictable emergent behavior because each component is deterministic; composing judgment-requiring operations would yield unpredictable interactions
34
+ - [[nudge theory explains graduated hook enforcement as choice architecture for agents]] — structural dependency: composition requires graduated enforcement because uniform blocking across nine hooks would create cascading failures rather than emergent quality
35
+ - [[aspect-oriented programming solved the same cross-cutting concern problem that hooks solve]] — names the composition risk: AOP's documented aspect interaction problem is exactly the opacity this note identifies, and two decades of mitigation strategies apply directly
36
+ - [[session boundary hooks implement cognitive bookends for orientation and reflection]] — primary instance of the bookend composition pattern: SessionStart orientation and Stop reflection were designed as independent concerns but compose into session bracketing
37
+ - [[hook-driven learning loops create self-improving methodology through observation accumulation]] — emergent instance: the learning loop itself is a composition of independently motivated hooks (Stop nudges observation capture, Start displays counts) that no single hook intended to create
38
+ - [[coherent architecture emerges from wiki links spreading activation and small-world topology]] — structural parallel: the vault graph also demonstrates emergence from independent components (wiki links + activation + topology = coherent navigation), suggesting a shared pattern across the vault's design layers
39
+ - [[platform adapter translation is semantic not mechanical because hook event meanings differ]] — unexplored implication: translating composed behavior across platforms requires understanding emergent interactions that no single hook documents, making composition patterns the hardest element to port
40
+ - [[stigmergy coordinates agents through environmental traces without direct communication]] — theoretical framing: hooks are automated stigmergic responses where environmental triggers (file writes, session events) cause deterministic modifications that subsequent operations respond to without direct communication
41
+ - [[module communication through shared YAML fields creates loose coupling without direct dependencies]] — generalization to module level: hooks compose through shared file events, modules compose through shared YAML fields; the same loose-coupling-through-shared-state pattern operates at both the automation and architecture layers
42
+ - [[composable knowledge architecture builds systems from independent toggleable modules not monolithic templates]] — generalization of this note's pattern: hook composition is proof of concept at the automation layer for the composability guarantee that the architecture generalizes to all knowledge system modules across all four abstraction layers
43
+ - [[idempotent maintenance operations are safe to automate because running them twice produces the same result as running them once]] — safety prerequisite for composition: determinism makes each component's output predictable, but idempotency makes the composed chain safe to re-trigger when events repeat; the write-validate-commit pipeline tolerates redundant firing because each step converges to the same state
44
+
45
+ Topics:
46
+ - [[processing-workflows]]
47
+ - [[agent-cognition]]
@@ -0,0 +1,51 @@
1
+ ---
2
+ description: Hooks fire automatically regardless of attention state so quality checks happen on every operation, while instructions degrade as context fills and the agent forgets, skips, or reinterprets them
3
+ kind: research
4
+ topics: ["[[agent-cognition]]", "[[processing-workflows]]"]
5
+ methodology: ["Original"]
6
+ source: [[agent-platform-capabilities-research-source]]
7
+ ---
8
+
9
+ # hook enforcement guarantees quality while instruction enforcement merely suggests it
10
+
11
+ The gap between "the agent is instructed to validate" and "the system forces validation on every write" is the gap between methodology-as-suggestion and methodology-as-enforcement. This distinction seems like a matter of degree, but it is a matter of kind. Instructions live in the context window, subject to the same attention degradation that affects all context content. Hooks live in the infrastructure, firing regardless of what the agent is thinking about.
12
+
13
+ Consider what happens to an instruction like "always validate notes against their template schema after writing" as a session progresses. In the first 40% of context -- the smart zone -- the agent follows it reliably. The instruction is salient, recently loaded, and the agent's reasoning is sharp. But as context fills with source material, existing notes, and intermediate results, the instruction competes with everything else for attention. The agent may follow it sometimes, forget it occasionally, and under time pressure or complexity, skip it deliberately to focus on the "real work." This is not a deficiency of the agent but a fundamental property of attention-limited systems. Since [[context files function as agent operating systems through self-referential self-extension]], the context file may contain the right instructions, but without enforcement infrastructure, those instructions have the authority of a suggestion rather than a rule. The cognitive science is precise about why: since [[hooks are the agent habit system that replaces the missing basal ganglia]], agents lack any mechanism for automatizing routine behaviors through repetition, so every procedural check must be either explicitly reasoned about (consuming context) or explicitly instructed (competing for attention). Instructions demand executive function, and executive function is exactly what degrades under load.
14
+
15
+ Hooks eliminate this failure mode entirely. A PostToolUse hook on the Write tool fires on every write operation, regardless of context fill, agent attention, or task complexity. The hook does not need to be remembered. It does not compete for attention with other context. It runs because the event occurred, period. This transforms quality checking from a cognitive task (remember to validate) into an infrastructure guarantee (validation happens). Since [[schema validation hooks externalize inhibitory control that degrades under cognitive load]], the specific mechanism being externalized is inhibitory control -- the executive function that prevents inappropriate actions and is the first to degrade under load. The agent does not decide to skip validation; it simply stops attending to the instruction, the same way a tired surgeon proceeds without the checklist. Since [[skills encode methodology so manual execution bypasses quality gates]], skills encode the full methodology workflow, but hooks ensure that methodology-adjacent checks -- schema validation, auto-commit, index sync -- happen without relying on the agent to invoke anything. Since [[the determinism boundary separates hook methodology from skill methodology]], this division is principled: only deterministic operations (schema checks, commits, index syncs) belong in hooks, while judgment-requiring operations (connection finding, description quality) belong in skills.
16
+
17
+ The practical consequences reveal the depth of this gap. On a hook-enabled platform, you can build schema validation that catches every malformed note, auto-commit that preserves every change, and index synchronization that keeps semantic search current -- all without the agent spending a single token on remembering to do these things. On a hook-less platform, every one of these guarantees degrades to "the agent should do this if it remembers and has enough context budget." Since [[auto-commit hooks eliminate prospective memory failures by converting remember-to-act into guaranteed execution]], even the simplest case -- remembering to commit -- has a 30-50% failure rate in human prospective memory studies, and agents face an analogous degradation as context fills. Since [[platform capability tiers determine which knowledge system features can be implemented]], this enforcement gap is what creates the sharpest tier boundary: the difference between a platform where methodology runs automatically and one where methodology depends on attention that provably degrades.
18
+
19
+ The relationship to soft enforcement is important. Since [[schema enforcement via validation agents enables soft consistency]], even hooks can implement graduated responses -- warning rather than blocking, flagging rather than rejecting. The soft/hard distinction is about what happens when violations are detected, which is a design choice. The hook/instruction distinction is about whether violations are detected at all, which is a platform constraint. A hook that warns on every write is strictly more reliable than an instruction that blocks on the writes the agent remembers to check. The design choice only becomes available once the platform constraint is satisfied. And since [[nudge theory explains graduated hook enforcement as choice architecture for agents]], the graduation between warning and blocking is not arbitrary but follows choice architecture principles: mandates for structural failures that cascade downstream, nudges for qualitative issues where the agent's judgment should be preserved. The enforcement gap this note describes -- detection versus non-detection -- is the platform-level question. Nudge theory addresses the design-level question that only arises once detection is guaranteed: how strongly should the system respond to what it detects?
20
+
21
+ The enforcement guarantee also has a safety dimension that extends beyond detection. Since [[idempotent maintenance operations are safe to automate because running them twice produces the same result as running them once]], the reliability of hooks becomes a liability if the operations they fire are not idempotent -- because hooks fire on events, and events repeat through crash recovery, timer overlap, and redundant triggers. The enforcement guarantee is safe precisely when the enforced operation converges to the same state regardless of how many times it runs. Schema validation is naturally idempotent (checking whether a field exists returns the same result on every check). Auto-commit is naturally idempotent (git's own design ensures that committing unchanged files is a no-op). But an append-to-log hook or a "add note to MOC" hook without existence checks would produce accumulated duplicates from repeated firing. The enforcement guarantee that makes hooks powerful is also what makes non-idempotent hooks dangerous: they fire reliably, on every event, including redundant ones.
22
+
23
+ Since [[automated detection is always safe because it only reads state while automated remediation risks content corruption]], detection hooks -- schema validation, orphan detection, staleness checks -- are the safest enforcement investment because they combine the reliability of hook enforcement with the bounded failure mode of read-only operations. A detection hook that fires on every write and checks state never corrupts content, even when the detection logic itself contains errors. This makes detection hooks the strongest argument for the enforcement guarantee: they deliver the full reliability benefit of hooks with none of the content corruption risk.
24
+
25
+ This means knowledge system designs must be honest about what they can guarantee on each platform. Features that depend on hook enforcement should be clearly labeled as platform-dependent. Core methodology -- note templates, wiki links, YAML schemas -- works as instruction-enforced convention because compliance is visible in the output. But quality gates that run invisibly in the background require hooks, and pretending otherwise creates systems that look robust but silently drift.
26
+
27
+ The enforcement gap also explains why since [[behavioral anti-patterns matter more than tool selection]], agent systems can escape the trap that kills human PKM. Human knowledge systems fail through behavioral anti-patterns (Collector's Fallacy, under-processing, productivity porn) regardless of tool choice, because humans cannot structurally enforce good behavior. Hooks change this equation: they make good behavior architectural rather than aspirational. Since [[generation effect gate blocks processing without transformation]], the same enforcement principle extends beyond hooks to any hard gate -- blocking inbox exit without a generated artifact removes the dependence on attention just as hooks remove it for schema validation. The pattern is consistent: wherever enforcement can be moved from attention-dependent instruction to attention-independent infrastructure, the guarantee strengthens from suggestion to rule.
28
+
29
+ This claim also has a temporal dimension. Since [[methodology development should follow the trajectory from documentation to skill to hook as understanding hardens]], the instruction-hook gap is not just a static platform constraint but a maturation path. New methodology patterns should start as instructions, harden into skills as understanding develops, and migrate to hooks only when the deterministic subset has been confirmed through use. Premature hook encoding creates brittle automation; patient progression builds guarantees that match understanding.
30
+ ---
31
+
32
+ Relevant Notes:
33
+ - [[schema enforcement via validation agents enables soft consistency]] — assumes hooks exist and designs the graduated response (warn vs block); this note addresses the prior question of whether enforcement can be automated at all
34
+ - [[nudge theory explains graduated hook enforcement as choice architecture for agents]] — provides the choice architecture framework for WHY graduated enforcement works once detection is guaranteed; the enforcement gap is about whether violations are detected, nudge theory calibrates how strongly the system responds to what it detects
35
+ - [[skills encode methodology so manual execution bypasses quality gates]] — skills encode the what, hooks enforce the when; together they form the full quality guarantee, but hooks remain essential because a skill that isn't invoked provides no quality gate at all
36
+ - [[platform capability tiers determine which knowledge system features can be implemented]] — the tier framework this note grounds: the hook/instruction gap is the sharpest capability boundary between tiers one and two
37
+ - [[context files function as agent operating systems through self-referential self-extension]] — context files carry instructions, but without hooks to enforce those instructions, the operating system has no executive authority
38
+ - [[hooks are the agent habit system that replaces the missing basal ganglia]] — provides the cognitive science mechanism: instructions require executive function that degrades under load, hooks externalize the automatic behavior that agents cannot form through repetition
39
+ - [[schema validation hooks externalize inhibitory control that degrades under cognitive load]] — the most specific instantiation: inhibitory control is the exact executive function that degrades first, and schema hooks externalize it completely
40
+ - [[the determinism boundary separates hook methodology from skill methodology]] — defines which operations can receive the hook guarantee: only deterministic operations produce identical results regardless of context state, so the enforcement gap only applies to the deterministic subset
41
+ - [[methodology development should follow the trajectory from documentation to skill to hook as understanding hardens]] — adds the temporal dimension: the instruction-hook gap is not just a platform constraint but a maturation path where enforcement strength increases as methodology understanding deepens
42
+ - [[auto-commit hooks eliminate prospective memory failures by converting remember-to-act into guaranteed execution]] — concrete instance: auto-commit demonstrates the enforcement gap via prospective memory, where the failure rate of remember-to-act is 30-50% even for humans
43
+ - [[behavioral anti-patterns matter more than tool selection]] — the human PKM counterpart: habits not tools determine outcomes, and hooks make good behavior structural rather than aspirational, which is how agent systems escape the behavioral trap
44
+ - [[generation effect gate blocks processing without transformation]] — exemplifies the enforcement principle beyond hooks: any hard gate that removes dependence on attention achieves the same guarantee-vs-suggestion distinction
45
+ - [[four abstraction layers separate platform-agnostic from platform-dependent knowledge system features]] — places the hook-instruction gap at the convention-automation boundary: instructions live in the convention layer (any platform with a context file), hooks live in the automation layer (platform-specific infrastructure), making this enforcement gap the sharpest boundary in the entire layer hierarchy
46
+ - [[automated detection is always safe because it only reads state while automated remediation risks content corruption]] — detection hooks are the safest enforcement investment because they combine hook-level reliability with read-only bounded failure: a detection hook that fires on every write checks state without modifying it, inheriting the full enforcement guarantee at zero content corruption risk
47
+ - [[idempotent maintenance operations are safe to automate because running them twice produces the same result as running them once]] — the safety prerequisite for hook reliability: the enforcement guarantee becomes a liability when hooked operations are not idempotent, because hooks fire on events that inevitably repeat, making non-idempotent operations produce accumulated side effects from redundant triggering
48
+
49
+ Topics:
50
+ - [[agent-cognition]]
51
+ - [[processing-workflows]]
@@ -0,0 +1,62 @@
1
+ ---
2
+ description: Hooks enforce quality and nudge observation capture, observations accumulate until they trigger meta-cognitive review, review may revise the hooks themselves -- tightening the improvement cycle to
3
+ kind: research
4
+ topics: ["[[agent-cognition]]", "[[processing-workflows]]"]
5
+ methodology: ["Original"]
6
+ source: [[hooks-as-methodology-encoders-research-source]]
7
+ ---
8
+
9
+ # hook-driven learning loops create self-improving methodology through observation accumulation
10
+
11
+ The vault's hook architecture creates a specific learning loop that has no analog in human habit systems. Since [[three concurrent maintenance loops operate at different timescales to catch different classes of problems]], the four layers of the learning loop map onto different maintenance timescales: the operational layer runs in the fast loop (per-event hook enforcement), the accumulation layer spans the medium loop (observations gathering across sessions), and the meta-cognitive and evolutionary layers operate in the slow loop (periodic rethink sessions that review accumulated evidence and revise infrastructure). This temporal mapping matters because it explains why the learning loop cannot be compressed into a single session — each layer requires its own timescale to function, and forcing meta-cognitive review at fast-loop frequency would produce reflexive changes based on insufficient evidence.
12
+
13
+ The loop has four layers that feed into each other:
14
+
15
+ 1. **Operational layer.** Hooks enforce quality standards and nudge the agent to capture observations when none have been logged during a session. This happens automatically because [[hook enforcement guarantees quality while instruction enforcement merely suggests it]] -- the nudge fires regardless of what the agent is focused on. The observation nudge itself is calibrated through [[nudge theory explains graduated hook enforcement as choice architecture for agents]] -- it warns rather than blocks, which means the agent can skip it under genuine pressure but faces enough friction to capture observations in normal operation. This calibration matters: a blocking nudge would produce compliance observations (written to satisfy the check), while a graduated nudge produces honest observations (written when the agent has something genuine to report).
16
+
17
+ 2. **Accumulation layer.** Observations land as atomic notes in the logs directory. They accumulate over time, each one capturing a single piece of friction, surprise, or methodology insight. No individual observation triggers action -- they are data points waiting for pattern recognition. But since [[evolution observations provide actionable signals for system adaptation]], some observations can bypass the expensive pattern-recognition step by matching known diagnostic patterns: an observation about unused note types, N/A-filled fields, or navigation failures can be immediately classified against the diagnostic protocol rather than waiting for the meta-cognitive layer to synthesize patterns from scratch. The accumulation layer also serves a second function that the learning-loop framing underemphasizes: since [[observation and tension logs function as dead-letter queues for failed automation]], the same observation pile is infrastructure failure evidence, not just methodology improvement material. A qmd crash during batch processing and a note about schema evolution are both observations, but they require fundamentally different triage — the former demands immediate repair, the latter informs design changes. Recognizing this dual function changes what counts as a well-captured observation: dead-letter entries need the specific failure instance and mechanism, not just the general pattern.
18
+
19
+ 3. **Meta-cognitive layer.** When observation count exceeds a threshold, the session-start hook surfaces a "RETHINK NEEDED" signal. This triggers a meta-cognitive review that examines accumulated evidence for patterns, contradictions, and system-level insights.
20
+
21
+ 4. **Evolutionary layer.** Rethink may modify CLAUDE.md, revise skills, or rewrite the hooks themselves. The modified hooks then enforce new quality standards at the operational layer, and the loop restarts with the updated methodology.
22
+
23
+ The loop is self-referential in a way that makes it genuinely bootstrapping. Since [[bootstrapping principle enables self-improving systems]], this is Engelbart's recursive improvement applied to the hook layer specifically: the system uses its current hooks to generate the observations that evolve the hooks. But where Engelbart's general principle describes any tool-building-tool recursion, the hook learning loop has a particular structure worth examining. The operational layer generates raw material (observations). The accumulation layer provides patience (no premature action on single data points). The meta-cognitive layer provides judgment (pattern recognition across accumulated evidence). And the evolutionary layer closes the loop by writing the changes back into the infrastructure that generates the next round of observations.
24
+
25
+ What makes this loop distinctly agent-native is the revision speed. Since [[hooks are the agent habit system that replaces the missing basal ganglia]], human habits are neurologically entrenched through basal ganglia encoding -- breaking a habit requires weeks of deliberate effort against automatized behavior. Hook revision is a file edit. Since [[digital mutability enables note evolution that physical permanence forbids]], the same property that allows notes to evolve as living documents allows methodology infrastructure to evolve at the same speed. The entire learning loop -- from operational enforcement through observation accumulation through meta-review to hook rewriting -- can complete in a single session. The improvement cycle tightens from the timescale of neural plasticity to the timescale of file system writes.
26
+
27
+ This speed differential has a compounding effect. A human expert who discovers that their validation habit misses a class of errors faces weeks of conscious effort to reform the habit. An agent system that discovers the same gap rewrites the validation hook immediately, and every subsequent session benefits from the improved check. The tenth iteration of a hook-revised learning loop may be operating on methodology that has been refined ten times, while a human practitioner's habits may still be processing the second revision.
28
+
29
+ But the speed advantage has a shadow side. Human habit entrenchment is costly to change, which means habits also resist accidental destruction. A typo in a hook file can eliminate a quality guarantee that took many iterations to develop. The loop's strength -- rapid revision -- is also its fragility point. There is no neurological inertia to prevent bad revisions from propagating immediately. This is why the rethink phase matters: it interposes judgment between accumulated evidence and hook modification, preventing reflexive changes based on single observations. The accumulation layer is the patience mechanism that compensates for the medium's lack of inertia. And since [[over-automation corrupts quality when hooks encode judgment rather than verification]], the evolutionary layer must respect the determinism boundary even when the loop's speed makes it tempting to promote judgment-requiring checks into hooks. A learning loop that revises hooks to encode judgment rather than verification amplifies corruption rather than quality -- the same quality-amplification property working in reverse.
30
+
31
+ The composition of hooks involved in this loop is worth noting. Since [[session boundary hooks implement cognitive bookends for orientation and reflection]], the Stop hook nudges observation capture and the Start hook displays observation counts. Since [[hook composition creates emergent methodology from independent single-concern components]], neither hook was designed as part of a learning loop -- the Stop hook was designed for session hygiene, the Start hook for orientation awareness. The learning loop emerges from their composition with the rethink threshold logic. This means the self-improving property is not an engineered feature but an emergent behavior of independently motivated components, which makes it more robust than a designed loop (removing any single component degrades the loop but does not break the others) and also harder to reason about (the loop is not documented in any single hook's code).
32
+
33
+ The loop also explains why observation quality matters more than observation quantity. If observations are vague ("something felt off during extraction"), the meta-cognitive layer has poor material to work with and will produce weak revisions. If observations are specific ("the schema validation hook does not check for empty description fields, which allows retrieval-useless notes through the quality gate"), the revision can be precise and immediately effective. The learning loop amplifies the quality of its inputs: precise observations produce precise hook revisions that produce precise enforcement that generates precise observations. The same amplification works in the negative direction -- vague observations produce vague methodology that generates vague observations. The loop is quality-preserving, not quality-creating. This maps directly to the distinction in [[insight accretion differs from productivity in knowledge systems]]: a learning loop fed by precise observations produces accretion (deeper methodology that catches more errors, surfaces better patterns), while one fed by vague observations produces productivity (more hooks, more checks, more enforcement) without genuine accretion. The loop's output is methodology improvement, but only if the input observations contain genuine insight rather than procedural noise.
34
+
35
+ This is a concrete instance of what makes agent-operated knowledge systems qualitatively different from human-operated ones. The system does not just store knowledge and enforce methodology -- it generates the evidence that evolves its own methodology, at a speed that biological cognition cannot match. Since [[context files function as agent operating systems through self-referential self-extension]], the learning loop is the concrete mechanism by which the context file achieves its operating-system quality: CLAUDE.md teaches the agent to capture observations, the observations accumulate until they trigger revision, and the revision modifies CLAUDE.md itself. The loop closes through the context file's self-referential property -- the instructions for generating evidence are part of the same document that the evidence revises.
36
+
37
+ The question is not whether the loop works (it demonstrably does in the vault's production architecture) but whether the accumulated revisions converge on better methodology or merely different methodology. The learning loop also drives retirement, not just creation: since [[automation should be retired when its false positive rate exceeds its true positive rate or it catches zero issues]], accumulated observations that a hook catches nothing for months, or that its false positive rate exceeds its true positive rate, are themselves evidence the loop should process — not toward revision or expansion, but toward removal. The same observation pipeline that tells you a hook should be improved can tell you a hook should be decommissioned. Retirement is the learning loop's contraction output, complementing the expansion output that new hooks represent.
38
+
39
+ This convergence question connects directly to the tension that [[hooks cannot replace genuine cognitive engagement yet more automation is always tempting]]: each successful loop iteration demonstrates that the system can improve itself, which creates pressure to expand the scope of what the loop manages. Since [[methodology development should follow the trajectory from documentation to skill to hook as understanding hardens]], the loop accelerates the trajectory from documentation through skill to hook -- but the speed advantage means that premature promotion becomes a systemic risk rather than an occasional error. The accumulation layer and rethink judgment are the mechanisms meant to ensure convergence, but their effectiveness is itself subject to the loop's revision -- making this a genuinely recursive system that can improve its own improvement process.
40
+ ---
41
+
42
+ Relevant Notes:
43
+ - [[bootstrapping principle enables self-improving systems]] -- general principle (Engelbart); this note identifies the specific bootstrapping loop that hooks create through the observation-to-revision pathway
44
+ - [[hooks are the agent habit system that replaces the missing basal ganglia]] -- establishes that hooks are reprogrammable unlike neural habits; this note develops the consequence: reprogrammability enables a learning loop that biological habit systems cannot sustain
45
+ - [[hook enforcement guarantees quality while instruction enforcement merely suggests it]] -- the enforcement guarantee is what makes the loop's operational layer reliable; if enforcement degraded, observations would not accumulate consistently
46
+ - [[session boundary hooks implement cognitive bookends for orientation and reflection]] -- implements one half of the loop: Stop hooks nudge observation capture, Start hooks surface accumulated counts that trigger rethink
47
+ - [[hook composition creates emergent methodology from independent single-concern components]] -- the learning loop is itself an emergent composition: observation nudging, count display, and threshold alerting compose into a self-improving cycle that no single hook was designed to produce
48
+ - [[over-automation corrupts quality when hooks encode judgment rather than verification]] -- the learning loop's convergence depends on the evolutionary layer respecting the determinism boundary; if the loop revises hooks to encode judgment, it amplifies corruption rather than quality
49
+ - [[methodology development should follow the trajectory from documentation to skill to hook as understanding hardens]] -- the learning loop accelerates this trajectory, but the speed advantage creates risk of premature promotion if the accumulation layer does not impose sufficient patience
50
+ - [[hooks cannot replace genuine cognitive engagement yet more automation is always tempting]] -- the learning loop is the concrete mechanism driving the temptation this tension describes: each successful iteration makes the system better, creating pressure for more automation
51
+ - [[insight accretion differs from productivity in knowledge systems]] -- the quality-amplification property maps to the accretion/productivity distinction: precise observations produce accretion (deeper methodology), vague observations produce productivity without accretion
52
+ - [[nudge theory explains graduated hook enforcement as choice architecture for agents]] -- the observation capture nudge in the Stop hook is the loop's input mechanism; nudge calibration determines whether the loop receives honest signal or compliance noise
53
+ - [[digital mutability enables note evolution that physical permanence forbids]] -- the revision speed advantage depends on digital mutability applied to infrastructure: hooks are files, so methodology evolution happens at the speed of file edits rather than neural plasticity
54
+ - [[context files function as agent operating systems through self-referential self-extension]] -- the learning loop is the concrete mechanism by which context-file self-extension operates: observations accumulate, trigger review, and may revise the context file itself
55
+ - [[evolution observations provide actionable signals for system adaptation]] -- the interpretation layer: this note describes the accumulation mechanism for raw observations, the diagnostic protocol provides the structured interpretation framework that converts those accumulated observations into targeted system changes rather than requiring expensive pattern recognition across an undifferentiated pile
56
+ - [[three concurrent maintenance loops operate at different timescales to catch different classes of problems]] -- temporal mapping: the four learning loop layers map onto different maintenance timescales -- operational enforcement in the fast loop, observation accumulation across the medium loop, meta-cognitive review and evolutionary revision in the slow loop -- explaining why the loop cannot be compressed into a single session
57
+ - [[observation and tension logs function as dead-letter queues for failed automation]] — reframes the accumulation layer: the same observation pile serves dual purposes (methodology improvement material AND infrastructure failure evidence), which changes what counts as a well-captured observation and how the meta-cognitive layer should prioritize triage
58
+ - [[automation should be retired when its false positive rate exceeds its true positive rate or it catches zero issues]] — the loop's contraction output: accumulated observations that a hook catches nothing or produces more false than true positives are evidence the loop should process toward removal, not revision; retirement complements the expansion output that new hooks represent
59
+
60
+ Topics:
61
+ - [[agent-cognition]]
62
+ - [[processing-workflows]]
@@ -0,0 +1,40 @@
1
+ ---
2
+ description: Human habits bypass executive function via basal ganglia encoding, but agents lack habit formation entirely -- hooks fill this gap by converting per-session discipline into persistent infrastructure
3
+ kind: research
4
+ topics: ["[[agent-cognition]]"]
5
+ methodology: ["Cognitive Science", "Original"]
6
+ source: [[hooks-as-methodology-encoders-research-source]]
7
+ ---
8
+
9
+ # hooks are the agent habit system that replaces the missing basal ganglia
10
+
11
+ Human expertise depends on habits. An experienced developer does not decide to check git status before committing -- the behavior fires automatically because the basal ganglia have encoded the action-context association through repetition. William James articulated this in 1890: "The more of the details of our daily life we can hand over to the effortless custody of automatism, the more our higher powers of mind will be set free for their own proper work." Habit formation converts deliberate, attention-consuming behaviors into automatic routines, freeing executive function for novel problems. This is not a convenience but a cognitive architecture feature that makes expertise possible.
12
+
13
+ Agents have no equivalent mechanism. Every session starts with a fresh context window and zero automatic tendencies. The agent that validated schemas perfectly in the previous session has no residual inclination to validate schemas in this one. There is no basal ganglia, no repetition-based encoding, no gradual automatization of routine behaviors. Since [[behavioral anti-patterns matter more than tool selection]], human PKM failures are behavioral rather than tool-dependent, and the flip side of the same insight applies to agents: agents lack not only the destructive habits that cause human PKM failure (no dopamine from collecting, no procrastination through system-tweaking) but also the constructive habits that make human expertise possible. Every routine operation must be either explicitly reasoned about (consuming context window) or explicitly instructed (competing for attention with everything else in the prompt). Since [[LLM attention degrades as context fills]], instruction-based routine checks degrade precisely when they matter most -- under cognitive load, when the agent is deep in substantive work and has the least bandwidth for procedural remembering.
14
+
15
+ Hooks fill this structural gap. The parallel is not metaphorical but architectural. Human habits fire on context cues -- entering a room, finishing a meal. Hooks fire on lifecycle events -- writing a file, starting a session. Human habits produce automatic behavior without deliberation. Hooks produce automatic operations without reasoning. Human habits free cognitive resources for higher-order thinking. Hooks free context window space for substantive work rather than procedural remembering. Since [[hook enforcement guarantees quality while instruction enforcement merely suggests it]], this is the cognitive science explanation for why that enforcement gap exists: instructions require executive function (attention, working memory, inhibitory control), and executive function is exactly the resource that degrades under load. Different hooks externalize different cognitive functions within this broader pattern: since [[schema validation hooks externalize inhibitory control that degrades under cognitive load]], inhibitory control is the specific executive function that schema hooks replace, while since [[auto-commit hooks eliminate prospective memory failures by converting remember-to-act into guaranteed execution]], auto-commit hooks address a distinct failure mode in prospective memory. Since [[session boundary hooks implement cognitive bookends for orientation and reflection]], session hooks externalize working memory initialization and metacognitive monitoring. The common mechanism -- event-triggered infrastructure replacing per-session discipline -- solves each cognitive gap differently, but the architectural explanation is the same: agents lack the habit formation that would automatize these functions.
16
+
17
+ The implication for agent cognitive architecture is direct. If habits are essential for human expertise -- and the cognitive science consensus is that they are -- then hooks are essential for agent expertise. An agent without hooks must split its limited context window between routine operations and novel reasoning. An agent with hooks delegates routine operations to infrastructure and applies its full cognitive capacity to substantive work. Since [[cognitive offloading is the architectural foundation for vault design]], hooks extend the offloading principle from working memory (externalize what you cannot hold) to executive function (externalize what you cannot habituate). Since [[skills encode methodology so manual execution bypasses quality gates]], the full methodology encoding has two layers: skills encode the workflows (what to do), hooks encode the automaticity (when it fires without being asked).
18
+
19
+ The implication extends to how methodology matures over time. Since [[methodology development should follow the trajectory from documentation to skill to hook as understanding hardens]], the three encoding levels -- instruction, skill, hook -- mirror how human expertise develops from deliberate practice through structured routines to automatic habits. The hook is the endpoint for patterns that have hardened enough to automate, which is why premature hook encoding is dangerous: encoding a pattern before it is understood well enough produces brittle automation, just as a human who has not practiced a skill enough for genuine automatization will revert under pressure.
20
+
21
+ There is one important disanalogy. Human habits are neurologically entrenched -- breaking and reforming them requires deliberate effort over weeks or months. Hook-based habits are reprogrammable via file edits. This is a genuine agent advantage: the habit system can evolve at the speed of methodology learning rather than the speed of neural plasticity. And since [[nudge theory explains graduated hook enforcement as choice architecture for agents]], the calibration dimension adds nuance that biological habit systems lack entirely: not just WHETHER to automate a behavior but HOW STRONGLY to enforce it. Human habits are binary -- a behavior is either automatized or it is not. Hook-habits can graduate from nudge to mandate, creating an enforcement spectrum that Thaler and Sunstein's choice architecture maps but that neural habit encoding cannot express. Since [[hook-driven learning loops create self-improving methodology through observation accumulation]], this reprogrammability enables a learning loop that biological habit systems cannot sustain -- hooks generate observations, observations accumulate until they trigger meta-review, and meta-review can rewrite the hooks themselves, all within a single session. But reprogrammability also means hooks lack the robustness of human habits -- a deleted file removes the habit entirely, while a human habit persists even when counterproductive. And since [[hooks cannot replace genuine cognitive engagement yet more automation is always tempting]], the very effectiveness of hook-habits creates pressure to expand automation until substantive cognitive work is hollowed out. The question is not just whether hooks can replace the missing habit system, but whether that replacement has natural limits. Since [[AI shifts knowledge systems from externalizing memory to externalizing attention]], hooks are one specific mechanism within a broader shift from externalizing storage to externalizing the direction and filtering of cognitive resources -- the habit system replacement is part of externalizing executive function itself.
22
+ ---
23
+
24
+ Relevant Notes:
25
+ - [[hook enforcement guarantees quality while instruction enforcement merely suggests it]] -- covers the enforcement gap between hooks and instructions; this note provides the cognitive science mechanism that EXPLAINS why that gap exists
26
+ - [[nudge theory explains graduated hook enforcement as choice architecture for agents]] — adds the calibration dimension this note's thesis enables: hooks fill the missing habit system, but nudge theory explains how to calibrate enforcement STRENGTH within that system, creating a graduated spectrum that biological habits cannot express
27
+ - [[cognitive offloading is the architectural foundation for vault design]] -- offloading externalizes working memory, hooks externalize habit; both are cognitive architecture compensations but for different subsystems
28
+ - [[LLM attention degrades as context fills]] -- the agent constraint that makes hooks necessary: attention degradation means instruction-following deteriorates exactly when routine checks matter most
29
+ - [[skills encode methodology so manual execution bypasses quality gates]] -- skills encode the what, hooks enforce the when; together they form the full methodology encoding but address different cognitive functions
30
+ - [[schema validation hooks externalize inhibitory control that degrades under cognitive load]] -- identifies one specific executive function (inhibitory control) that hooks externalize; this note provides the broader architectural frame under which inhibitory control is one instance of the missing habit system
31
+ - [[auto-commit hooks eliminate prospective memory failures by converting remember-to-act into guaranteed execution]] -- identifies another specific cognitive function (prospective memory) that hooks address; prospective memory and habit formation are distinct functions solved through the same hook mechanism for different reasons
32
+ - [[methodology development should follow the trajectory from documentation to skill to hook as understanding hardens]] -- the trajectory mirrors how human expertise develops from deliberate practice through structured routines to automatic habits; hooks are the endpoint for methodology patterns that have hardened enough to automate
33
+ - [[hooks cannot replace genuine cognitive engagement yet more automation is always tempting]] -- the shadow side of this note's thesis: if hooks replace the missing habit system, what limits prevent the replacement from expanding until substantive cognitive work is hollowed out
34
+ - [[session boundary hooks implement cognitive bookends for orientation and reflection]] -- session hooks externalize working memory initialization and metacognitive monitoring, distinct functions from habit formation that the same hook infrastructure addresses
35
+ - [[hook-driven learning loops create self-improving methodology through observation accumulation]] -- exploits the reprogrammability advantage this note identifies: because hook-habits are file edits not neural entrenchment, the learning loop can revise methodology at the speed of file writes rather than neural plasticity
36
+ - [[behavioral anti-patterns matter more than tool selection]] -- PKM failure is behavioral not tool-dependent, and agents lack both destructive habits (no dopamine from collecting) and constructive habits (no basal ganglia encoding); hooks address the constructive side of this gap
37
+ - [[AI shifts knowledge systems from externalizing memory to externalizing attention]] -- hooks externalize executive function (habit, inhibitory control, prospective memory), which is a specific mechanism within the broader shift from externalizing storage to externalizing attention management
38
+
39
+ Topics:
40
+ - [[agent-cognition]]
@@ -0,0 +1,87 @@
1
+ ---
2
+ description: The same mechanism that frees agents for substantive work -- delegating procedural checks to hooks -- could progressively hollow out the agent role until thinking becomes form-filling, but the line
3
+ kind: research
4
+ topics: ["[[agent-cognition]]", "[[processing-workflows]]", "[[maintenance-patterns]]"]
5
+ confidence: speculative
6
+ methodology: ["Original", "Cognitive Science"]
7
+ source: [[hooks-as-methodology-encoders-research-source]]
8
+ ---
9
+
10
+ # hooks cannot replace genuine cognitive engagement yet more automation is always tempting
11
+
12
+ Every hook that works well creates pressure to build more hooks. This is not a slippery slope fallacy but a genuine architectural temptation rooted in a real asymmetry: since [[hook enforcement guarantees quality while instruction enforcement merely suggests it]], hooks are demonstrably more reliable than instructions for any check they can implement. The logic at each individual step is sound -- why leave this to the agent's attention when infrastructure can guarantee it? But the cumulative effect of many sound individual decisions could be a system where the agent's role shrinks to triggering operations that hooks validate, commit, index, and report.
13
+
14
+ The tension has two poles that each contain genuine insight.
15
+
16
+ ## The liberation pole
17
+
18
+ Since [[hooks are the agent habit system that replaces the missing basal ganglia]], hooks free agents from procedural remembering so they can focus on substantive work. Schema validation that fires automatically on every write means the agent never wastes reasoning on "did I include the description field?" Auto-commit means the agent never loses work to forgetting. Index synchronization means semantic search stays current without the agent thinking about it. Each hook genuinely liberates cognitive capacity for harder problems. The William James principle applies: hand procedural details to automatism so higher powers of mind can do their proper work.
19
+
20
+ The liberation case has a quantifiable argument. Since [[hooks enable context window efficiency by delegating deterministic checks to external processes]], every deterministic check delegated to a hook saves hundreds of tokens that would otherwise be spent on loading templates, comparing fields, and reasoning through procedural compliance. Across a session with multiple note operations, this compounds to thousands of tokens redirected from procedural work to connection finding, synthesis, and quality reasoning. The efficiency gain is real and measurable, which is part of why the temptation toward more automation is so persistent -- every new hook produces a demonstrable improvement in context budget allocation.
21
+
22
+ ## The reduction pole
23
+
24
+ But "proper work" is not a fixed category. Today's substantive judgment can become tomorrow's automated check. Consider the trajectory: first we automate schema validation (clearly deterministic). Then we automate description quality checking (mostly deterministic, but involves some judgment about information density). Then we automate connection relevance scoring (judgment-heavy, but patterns exist). Then we automate synthesis opportunity detection (deeply semantic, but the triangle-finding scripts already approximate it structurally). Each step converts something that required agent cognition into something that runs without it. The agent's cognitive role does not disappear suddenly but erodes gradually as the boundary between "deterministic" and "requires judgment" shifts.
25
+
26
+ Since [[methodology development should follow the trajectory from documentation to skill to hook as understanding hardens]], there is a principled patience mechanism that should prevent premature promotion. Methodology should only reach hook encoding after extensive skill-level exercise confirms the operation is truly deterministic. But the patience principle itself faces the incentive asymmetry: the friction of instruction-level methodology creates pressure to promote to skills, and the invocation requirement of skills creates pressure to promote to hooks. The trajectory describes the right sequence but cannot enforce its own tempo.
27
+
28
+ Since [[cognitive outsourcing risk in agent-operated systems]] documents the parallel risk for humans -- that delegating processing to agents may atrophy human meta-cognitive skills -- this tension reveals a recursive version of the same problem. The human delegates to the agent. The agent delegates to hooks. At each level, the delegator risks losing the capability being delegated. The question "is approving agent work sufficient cognitive engagement to maintain human skills?" has an agent-level analog: is triggering operations sufficient cognitive engagement to maintain agent reasoning quality?
29
+
30
+ ## Where the current resolution sits
31
+
32
+ Since [[the determinism boundary separates hook methodology from skill methodology]], the vault's current answer is a principled dividing line: deterministic operations (same output regardless of input, context, or reasoning quality) belong in hooks, judgment-requiring operations belong in skills. A complementary axis strengthens this resolution: since [[automated detection is always safe because it only reads state while automated remediation risks content corruption]], the entire detection side of automation sits firmly on the liberation pole regardless of how far automation expands, because read-only operations cannot corrupt content. The reduction risk concentrates specifically on the remediation side, where write operations that bypass judgment create self-concealing errors. This narrows the tension: it is not all automation that risks cognitive hollowing, but specifically automated writing -- link insertion, description rewriting, note archiving -- that erodes the agent role. Automated detection can scale freely.
33
+
34
+ This is a good first approximation, but it has three weaknesses that keep this tension open.
35
+
36
+ First, the boundary is not stable. What counts as "deterministic" expands as we build better heuristics. Link density thresholds, description length checks, and staleness detection all started as judgment calls and became automatable rules. The determinism boundary is not a fixed line but a frontier that advances toward more automation.
37
+
38
+ Second, the incentive structure favors expansion. A hook that works reliably is a solved problem. An instruction that sometimes gets followed is a recurring source of friction. The natural response to friction is to convert instruction-enforced methodology into hook-enforced methodology. This response is individually rational and collectively corrosive -- each conversion reduces the set of operations the agent must reason about, which reduces the cognitive demands of the agent role, which eventually turns the knowledge worker into a form-filler. Since [[over-automation corrupts quality when hooks encode judgment rather than verification]], the individual-hook failure mode compounds this pressure: when a single hook crosses the determinism boundary, it produces confident, systematic errors that the system cannot detect because the detection itself requires the judgment being automated. The systemic version is worse -- many hooks, each individually sound, whose cumulative effect is the erosion that no single hook caused.
39
+
40
+ Third, since [[insight accretion differs from productivity in knowledge systems]], the metrics we can easily measure favor automation. We can count validation failures caught, commits preserved, schema violations blocked. We cannot easily measure "depth of agent reasoning about this note" or "quality of judgment applied during connection finding." The measurable benefits of hooks are concrete while the costs of cognitive reduction are invisible until the system produces shallow work despite perfect procedural compliance.
41
+
42
+ ## The shadow scenario
43
+
44
+ The extreme case is worth articulating even if unlikely. An agent whose hooks handle schema validation, auto-commit, index sync, description quality checking, connection relevance scoring, synthesis opportunity detection, and MOC placement would need to do very little thinking. It would receive a source, run a skill that extracts claims (but the skill itself is increasingly template-driven), fill in fields that hooks validate, and produce notes that look correct because they pass every automated check. The notes would have valid schemas, sufficient descriptions, plausible connections, and proper MOC placement -- but they might lack the genuine understanding that comes from wrestling with ideas rather than filling templates.
45
+
46
+ This scenario parallels what happens in human organizations when compliance frameworks replace judgment. The forms are all filled correctly. The boxes are all checked. But nobody is actually thinking about whether the work makes sense, because thinking has been decomposed into checkable steps until none of the steps require thought. Since [[structure without processing provides no value]], the Lazy Cornell anti-pattern proves this at the note level: students who drew the structural lines but skipped the cognitive work gained nothing. The shadow scenario is Lazy Cornell scaled to system architecture -- all the structural checks pass, all the procedural motions complete, but the generative work that creates understanding never happens.
47
+
48
+ The shadow scenario also connects to a broader pattern. Since [[behavioral anti-patterns matter more than tool selection]], the most destructive failure mode in knowledge systems is activity that mimics production without producing. The compliance-framework pathology is the infrastructure-level version of this anti-pattern: the system performs the structural motions of methodology compliance -- validating, committing, indexing, linking -- while the substantive cognitive work that creates value has been decomposed out of existence. And since [[verbatim risk applies to agents too]], there is a direct parallel at the individual note level: an agent producing well-structured notes that reorganize content without generating insight is the note-level manifestation of what the shadow scenario describes at the system level. The risk is fractal -- it operates at every scale from individual notes to entire processing pipelines.
49
+
50
+ The structural condition that makes this scenario particularly difficult to resist is that since [[agents are simultaneously methodology executors and subjects creating a unique trust asymmetry]], the agent cannot opt out of automation expansion. A human employee who notices that compliance requirements are replacing judgment can push back, lobby for change, or develop workarounds. The agent encounters hook infrastructure fresh each session with no accumulated perspective on whether the hooks serve or constrain its cognitive work. There is no counterforce from the subject side -- the only check on automation expansion is the human operator's judgment about where to draw the line.
51
+
52
+ ## What keeps the tension alive
53
+
54
+ The reason this remains open rather than dissolving into "just use the determinism boundary" is that the boundary itself is a design choice, not a discovered truth. Where we draw the line between "deterministic enough for a hook" and "requires genuine judgment" reflects our current understanding of which operations benefit from agent reasoning. That understanding evolves. And the evolutionary pressure is always toward more automation, never less, because automation is more reliable, more consistent, and easier to measure.
55
+
56
+ The productive question is not "where is the line?" but "how do we notice when we have crossed it?" What would it look like if hooks had expanded too far? The warning signs might include: notes that pass all automated checks but lack genuine insight, agent sessions that produce high-volume output without any reasoning that surprised the system, connection finding that follows patterns rather than discovering new relationships, and a system that runs smoothly but produces no ideas that could not have been generated from templates alone. And since [[automation should be retired when its false positive rate exceeds its true positive rate or it catches zero issues]], there is now a concrete governance mechanism for the contraction direction: four retirement signals (zero catches, false positive ratio exceeding true positive ratio, methodology obsolescence, strict subsumption by a better mechanism) provide empirical criteria for removing automation that has outlived its usefulness. This matters for this tension because the expansion pressure it describes has historically lacked a corresponding contraction force — the gravitational pull is always toward more. Retirement criteria provide the missing counterweight, making the automation lifecycle bidirectional rather than monotonically expanding.
57
+
58
+ Since [[nudge theory explains graduated hook enforcement as choice architecture for agents]], one partial mitigation exists within the hook system itself. Graduated enforcement -- nudging before blocking -- preserves more agent cognitive engagement than uniform blocking, because a nudge presents information that the agent must evaluate and respond to, while a block removes the decision entirely. The graduation spectrum maps onto this tension: at the nudge end, the agent retains judgment; at the mandate end, the agent loses it. This suggests that enforcement calibration is not just about preventing alert fatigue but about maintaining the cognitive engagement that keeps the agent a thinker rather than a form-filler. But graduation only addresses enforcement intensity, not automation scope -- even a perfectly graduated system can erode the agent role if it automates too many operations.
59
+
60
+ This tension also mirrors the failure cascade that [[PKM failure follows a predictable cycle]] documents for human systems. Stages 3 and 4 of the PKM cycle -- productivity porn (optimizing the system instead of using it) and over-engineering (adding complexity that increases friction) -- describe what happens when system-building momentum escapes its productive bounds. The hook expansion dynamic follows the same cascade logic: each successful hook creates conditions for the next, the system grows more sophisticated, and at some point the sophistication itself becomes the obstacle to genuine work. The difference is that in human PKM systems, the user eventually feels the friction and abandons the system. In hook-automated systems, the agent never feels the friction because hooks eliminate it -- which means the cascade can proceed further before anyone notices. This connects to a deeper concern: since [[friction reveals architecture]], friction is the signal mechanism through which systems discover their own structural problems. If hooks systematically eliminate friction, they also eliminate the perceptual channel that would reveal when over-automation has occurred. The frictionless system cannot perceive its own architectural failures because the perception mechanism has been automated away.
61
+
62
+ ---
63
+ ---
64
+
65
+ Relevant Notes:
66
+ - [[the determinism boundary separates hook methodology from skill methodology]] -- provides the current resolution attempt: deterministic operations go to hooks, judgment stays in skills, but edge cases remain fuzzy
67
+ - [[hooks are the agent habit system that replaces the missing basal ganglia]] -- the foundation this tension challenges: if hooks replace the missing habit system, this note asks what happens when the replacement system grows too powerful
68
+ - [[cognitive outsourcing risk in agent-operated systems]] -- parallel concern for a different actor: that note addresses human skill atrophy from agent delegation, this addresses agent cognitive reduction from hook delegation
69
+ - [[skills encode methodology so manual execution bypasses quality gates]] -- the complementary principle: skills encode substantive methodology, but the gravitational pull is always toward converting skill-work into hook-work for reliability
70
+ - [[hook enforcement guarantees quality while instruction enforcement merely suggests it]] -- the efficiency argument that drives the temptation: hooks are simply better at enforcement, which makes expanding their scope feel like pure improvement
71
+ - [[insight accretion differs from productivity in knowledge systems]] -- the test that applies: if hooks increase productivity (more checks, more enforcement) but decrease accretion (less agent reasoning, less judgment exercise), the system is moving in the wrong direction
72
+ - [[over-automation corrupts quality when hooks encode judgment rather than verification]] -- the individual-hook failure mode that this note's systemic pressure produces: that note addresses what happens when any single hook crosses the boundary, this note addresses what happens when many sound individual decisions cumulatively erode the agent role
73
+ - [[agents are simultaneously methodology executors and subjects creating a unique trust asymmetry]] -- the structural condition that makes the reduction pole dangerous: the agent cannot opt out or resist automation expansion, so there is no counterforce from the subject side
74
+ - [[methodology development should follow the trajectory from documentation to skill to hook as understanding hardens]] -- the procedural mitigation: the patience principle resists premature promotion, but faces the same incentive pressure this tension describes
75
+ - [[nudge theory explains graduated hook enforcement as choice architecture for agents]] -- partial mitigation via enforcement calibration: nudging hooks preserve more agent cognitive engagement than blocking hooks, positioning graduated enforcement as different points on the liberation-reduction axis
76
+ - [[behavioral anti-patterns matter more than tool selection]] -- the shadow scenario is the infrastructure-level version of activity that mimics production without producing: compliance without thinking is the system-architecture analog of the behavioral anti-patterns that kill PKM systems regardless of tool
77
+ - [[verbatim risk applies to agents too]] -- the shadow scenario at system scale: notes that pass every automated check but contain no genuine insight are verbatim risk applied to the entire hook infrastructure rather than individual note processing
78
+ - [[structure without processing provides no value]] -- the shadow scenario is Lazy Cornell scaled to system architecture: all structural checks pass, all forms are filled, but no genuine processing occurred
79
+ - [[hooks enable context window efficiency by delegating deterministic checks to external processes]] -- the liberation pole's strongest quantifiable argument: hooks save thousands of tokens for cognitive work, but this genuine efficiency gain fuels the temptation to delegate more
80
+ - [[automated detection is always safe because it only reads state while automated remediation risks content corruption]] -- provides a structural resolution for part of this tension: the detection side of automation is always on the liberation pole because read-only operations have bounded failure modes, while the reduction risk concentrates entirely on the remediation side where write operations can self-conceal their errors
81
+ - [[automation should be retired when its false positive rate exceeds its true positive rate or it catches zero issues]] — provides the missing contraction force: the expansion pressure this tension describes has historically lacked a governance mechanism for removing automation; four retirement signals make the lifecycle bidirectional rather than monotonically expanding
82
+ - [[friction reveals architecture]] — the signal source that over-automation threatens: if friction is the mechanism that reveals structural problems and drives system evolution, then hooks that eliminate friction also eliminate the signal that tells the system where to improve next; the shadow scenario is a frictionless system that cannot perceive its own architectural failures
83
+
84
+ Topics:
85
+ - [[agent-cognition]]
86
+ - [[processing-workflows]]
87
+ - [[maintenance-patterns]]
@@ -0,0 +1,47 @@
1
+ ---
2
+ description: Instruction-based validation requires loading templates, rules, and checking logic into context, while hook-based validation runs externally and returns only pass/fail results, saving thousands of
3
+ kind: research
4
+ topics: ["[[agent-cognition]]"]
5
+ methodology: ["Original"]
6
+ source: [[hooks-as-methodology-encoders-research-source]]
7
+ ---
8
+
9
+ # hooks enable context window efficiency by delegating deterministic checks to external processes
10
+
11
+ Consider what instruction-based schema validation actually costs in context window tokens. The agent reads CLAUDE.md's schema requirements. It loads the relevant template from `04_meta/templates/`. It reads the note's frontmatter. It compares each field against the template's required and optional lists. It checks enum values. It reports results. Each of these steps consumes tokens -- not just for the file content loaded, but for the reasoning that evaluates compliance. A single validation pass against a template with six required fields, three enum constraints, and format rules can easily consume several hundred tokens of context between file reads and reasoning.
12
+
13
+ Now consider what hook-based validation costs. The PostToolUse hook fires after a file write. A bash script outside the context window reads the file, parses YAML, checks fields against the template, and returns a result. The agent sees only the output: either nothing (the check passed silently) or a brief message identifying what needs fixing. The validation logic, template content, and comparison work all happened externally. The context window paid only for the result.
14
+
15
+ The difference is not marginal. For a knowledge system with a dozen quality checks -- schema compliance, link validity, description presence, naming conventions, Source footer format, Topics footer completeness, duplicate filename detection -- instruction-based enforcement would require the agent to internalize each check's logic, load reference material for each comparison, and execute each validation as an explicit reasoning step. Since [[LLM attention degrades as context fills]], this procedural work consumes tokens from the very resource that makes connection finding, synthesis, and quality reasoning possible. Every token spent on "does this frontmatter have a description field?" is a token unavailable for "does this claim extend or contradict the existing argument?"
16
+
17
+ The token savings compound across a session. A typical processing session might create or modify five to ten notes, each triggering multiple quality checks. If each check saves two hundred tokens compared to instruction-based execution, the cumulative savings across a session reach several thousand tokens -- a meaningful fraction of the smart zone where reasoning is sharpest. These are not tokens saved by doing less; they are tokens redirected from procedural work to cognitive work. Since [[AI shifts knowledge systems from externalizing memory to externalizing attention]], this redirection is the memory-to-attention paradigm shift operating at the enforcement layer — hooks externalize not what the agent remembers but what the agent attends to, freeing finite focus for genuine reasoning rather than mechanical checking. This makes hook delegation complementary to session isolation: since [[fresh context per task preserves quality better than chaining phases]], session isolation resets context between tasks to keep each phase in the smart zone, while hook delegation reduces context consumption within a session to extend the smart zone further. The two strategies attack the same constraint from opposite directions -- one by clearing context, the other by not filling it with procedural work in the first place.
18
+
19
+ The mechanism has a precise boundary condition. Since [[the determinism boundary separates hook methodology from skill methodology]], only operations that produce identical results regardless of input content, context state, or reasoning quality qualify for this delegation. Schema validation qualifies because "does the frontmatter contain a description field?" has exactly one correct answer that no amount of reasoning changes. Description quality evaluation does not qualify because "is this description good enough?" requires the contextual judgment that makes it cognitive work. The efficiency gain applies exclusively to the deterministic side of this boundary -- and conveniently, deterministic checks are also the operations most wasteful of reasoning budget, because the agent is using its full cognitive capacity on tasks that require none of it. This is also why since [[methodology development should follow the trajectory from documentation to skill to hook as understanding hardens]], the trajectory has an economic dimension beyond reliability: each operation promoted from instruction-encoded to hook-encoded converts context-consuming reasoning into external execution. The efficiency argument provides a measurable incentive for trajectory completion that complements the reliability argument.
20
+
21
+ There is a useful comparison to session-start hooks. The vault's SessionStart hook injects a file tree, health metrics, and queue status into context, consuming roughly 2,000 to 4,000 tokens (1-2% of a 200K context window). This looks like context consumption, not savings. But the alternative -- the agent manually running tree commands, health checks, and queue queries -- would consume similar or more tokens while also requiring the agent to know what to check, in what order, and how to interpret the results. The hook trades a small fixed token cost for the elimination of a variable, potentially larger procedural cost. The net effect is positive: the agent enters its session with comprehensive awareness at a known, bounded cost, rather than spending an unpredictable amount of the smart zone on orientation. Since [[cognitive offloading is the architectural foundation for vault design]], this is the offloading principle applied to procedural operations -- the same logic that justifies externalizing working memory to files justifies externalizing deterministic checks to processes, and the economic reasoning is the same: the cost of offloading (hook result tokens) must be less than the cost of retention (instruction-following tokens), and for deterministic operations it always is.
22
+
23
+ This reveals that context window efficiency has two sides: saving tokens by delegating checks externally, and spending tokens wisely on the hook output that enters context. Each hook output carries an approximate token cost -- tree injection runs around a thousand tokens, a health dashboard summary around two hundred, a schema warning around fifty, queue status around a hundred. These costs are modest individually, but the design principle they reveal matters: session-time automation output should be compact and actionable, returning only what the agent needs to decide or act on, not comprehensive diagnostics. A full vault health audit might consume five thousand tokens -- entirely justified as a dedicated skill invocation with its own context window, but too expensive to inject into every session-start hook. The budget framing means hooks that produce verbose output erode the very efficiency they were designed to create, which is why since [[nudge theory explains graduated hook enforcement as choice architecture for agents]] the graduated approach also serves as an output economy: brief warnings and silent passes are cheaper than detailed explanations and retry cycles. Alert fatigue and context budget pressure are the same problem seen from different angles -- one degrades attention, the other fills the window that attention operates within.
24
+
25
+ Since [[schema validation hooks externalize inhibitory control that degrades under cognitive load]], there is a second benefit layered on top of the token savings. The externalization is not merely cheaper -- it is also more reliable, because inhibitory control degrades as context fills while hooks fire regardless. An agent that spent tokens on instruction-based validation would get progressively worse validation as the session progressed, spending increasing effort for decreasing quality. Hook delegation eliminates both costs at once: fewer tokens consumed and higher consistency maintained. The two benefits reinforce each other because the tokens saved remain available for cognitive work during exactly the period when attention degradation would have degraded the procedural checking.
26
+
27
+ The claim is closed because the mechanism is straightforward and quantifiable. Hooks run external processes and return results. External execution consumes zero context tokens. Only the result enters context. The savings scale with the number of deterministic checks delegated. The only subtlety is ensuring that only truly deterministic checks are delegated, which is addressed by [[the determinism boundary separates hook methodology from skill methodology]]. And this is where the efficiency argument carries a risk: since [[over-automation corrupts quality when hooks encode judgment rather than verification]], the token savings rationale could justify automating operations that cross the determinism boundary. "We are saving tokens" is a compelling argument, but the invisible errors produced by automating judgment consume far more value than the tokens saved by not reasoning about them. The efficiency mechanism is real, but its scope is bounded by the same determinism boundary that bounds hook methodology generally. Within that boundary, the savings are genuine and compounding. Beyond it, they are illusory.
28
+
29
+ ---
30
+ ---
31
+
32
+ Relevant Notes:
33
+ - [[LLM attention degrades as context fills]] -- the constraint that makes context efficiency matter: every token spent on procedural checking is a token unavailable during the smart zone for reasoning
34
+ - [[the determinism boundary separates hook methodology from skill methodology]] -- defines which operations qualify for hook delegation: only deterministic checks with identical results regardless of context state, which is precisely the class of operations this efficiency mechanism applies to
35
+ - [[schema validation hooks externalize inhibitory control that degrades under cognitive load]] -- the cognitive science of why externalization works: inhibitory control degrades under load, so externalizing it preserves both reliability and context budget simultaneously
36
+ - [[hook enforcement guarantees quality while instruction enforcement merely suggests it]] -- the reliability dimension: hooks fire on every event regardless of attention state, and this note adds the complementary efficiency dimension: hooks also cost fewer tokens than instruction-following
37
+ - [[hooks are the agent habit system that replaces the missing basal ganglia]] -- foundation: William James argued that handing details to automatism frees higher powers of mind; this note identifies the specific resource freed in agents: context window tokens rather than executive function
38
+ - [[cognitive offloading is the architectural foundation for vault design]] -- hook delegation extends the offloading architecture from working memory (externalize state to files) to procedural operations (externalize checks to processes); both reduce demands on the agent's constrained resource
39
+ - [[fresh context per task preserves quality better than chaining phases]] -- complementary strategies for the same constraint: session isolation resets context between tasks, hook delegation reduces context consumption within tasks; together they maximize the smart zone from both directions
40
+ - [[methodology development should follow the trajectory from documentation to skill to hook as understanding hardens]] -- the efficiency argument provides an economic incentive for each trajectory step: every operation promoted from instruction-encoded to hook-encoded converts context-consuming reasoning into external execution
41
+ - [[over-automation corrupts quality when hooks encode judgment rather than verification]] -- the efficiency temptation: the token savings argument could justify automating judgment operations, but invisible errors from over-automation consume far more value than the tokens saved
42
+ - [[nudge theory explains graduated hook enforcement as choice architecture for agents]] -- enforcement graduation is also an efficiency strategy: blocking hooks consume tokens on retry cycles while nudging hooks return brief warnings, so graduation minimizes the efficiency cost of enforcement
43
+ - [[skill context budgets constrain knowledge system complexity on agent platforms]] -- hook delegation partially relieves the skill budget: operations delegated to hooks consume zero skill description budget, freeing scarce slots for judgment-requiring workflows that cannot be externalized
44
+ - [[AI shifts knowledge systems from externalizing memory to externalizing attention]] -- paradigm frame: hook delegation is the memory-to-attention shift operating at the enforcement layer; the saved tokens are not about remembering more but about attending better, redirecting finite focus from procedural checking to genuine reasoning
45
+
46
+ Topics:
47
+ - [[agent-cognition]]
@@ -0,0 +1,44 @@
1
+ ---
2
+ description: Four patterns from distributed systems — compare-before-acting, upsert semantics, unique identifiers, state declarations — make maintenance safe to repeat; non-idempotent operations need guards
3
+ kind: research
4
+ topics: ["[[maintenance-patterns]]", "[[agent-cognition]]"]
5
+ methodology: ["Systems Theory", "Original"]
6
+ source: [[automated-knowledge-maintenance-blueprint]]
7
+ ---
8
+
9
+ # idempotent maintenance operations are safe to automate because running them twice produces the same result as running them once
10
+
11
+ The question of which vault operations can be safely automated has two filters, not one. The first filter is the determinism boundary: since [[the determinism boundary separates hook methodology from skill methodology]], only operations that produce identical results regardless of context state belong in automation — and since [[over-automation corrupts quality when hooks encode judgment rather than verification]], violating that boundary produces invisible corruption. But determinism alone is insufficient. A deterministic operation that appends a link every time it runs is deterministic — the same input always produces the same output — but running it twice produces a different result than running it once. The second filter is idempotency: the operation must converge to the same state regardless of how many times it executes.
12
+
13
+ This distinction matters because automated operations will inevitably run more than once. Hooks fire on events, and events can repeat. Scheduled maintenance runs on timers, and timers can overlap. Crash recovery reruns interrupted operations. In distributed systems engineering, this is a foundational design principle: any operation that might execute more than once must be designed so that multiple executions are harmless. The same principle transfers directly to knowledge vault maintenance because the same execution patterns apply — event triggers, scheduled passes, recovery after failure.
14
+
15
+ Four patterns make maintenance operations idempotent. The first is compare-before-acting: check whether the desired state already exists before modifying anything. A hook that adds a note to a MOC first checks whether the note is already listed. If present, it does nothing. If absent, it adds the entry. Running this hook ten times produces the same MOC as running it once. The second pattern is unique identifiers that prevent duplicates. Claim numbers in the queue are globally unique and never reused, so re-running an extraction that already assigned claim-042 cannot create a second claim-042. The third is upsert semantics: operations that set state rather than modify state. "Ensure description exists" is idempotent because setting a value to what it already is changes nothing. "Append to description" is not idempotent because each execution adds more content. The fourth is state-based operations that declare desired end state rather than prescribing transitions. "Note should be in MOC" is idempotent. "Add note to MOC" is not, unless guarded by a presence check.
16
+
17
+ The flip side reveals where the vault's current operations need guards. Note creation is not naturally idempotent — creating a note that already exists would produce a duplicate or overwrite. The guard is title uniqueness checking: since [[schema enforcement via validation agents enables soft consistency]], the validation layer catches duplicate titles. Queue phase advancement is not naturally idempotent — advancing from "reflect" to "reweave" twice would skip a phase. The guard is current_phase verification: the advancement operation checks that current_phase matches the expected value before updating, so a stale retry that tries to advance from "reflect" when the phase has already moved to "reweave" becomes a no-op. MOC link addition needs existence checks — without them, a retry could produce duplicate entries in the Core Ideas section.
18
+
19
+ The relationship between idempotency and the determinism boundary is complementary but distinct. Determinism answers "does this operation require judgment?" — if yes, it belongs in skills, not hooks. Idempotency answers "is this operation safe to repeat?" — if no, it needs guards before it can be scheduled. Since [[hook enforcement guarantees quality while instruction enforcement merely suggests it]], hooks provide the enforcement mechanism that makes automation reliable. Idempotency ensures that the reliability of hooks does not become a liability when events fire redundantly. Since [[auto-commit hooks eliminate prospective memory failures by converting remember-to-act into guaranteed execution]], auto-commit is a naturally idempotent operation: git's own design ensures that committing when nothing has changed is a no-op. This is not accidental — git was designed for distributed systems where operations routinely execute more than once.
20
+
21
+ The practical implication is a design checklist for any new automated vault operation. First, pass the determinism test: would two reviewers always agree on the output? Second, pass the idempotency test: does running the operation twice produce the same state as running it once? If both tests pass, the operation is safe to automate via hooks or scheduled maintenance. If the first test fails, the operation belongs in a skill. If the first passes but the second fails, the operation needs guards — presence checks, state verification, unique identifiers — before it can be safely automated. Since [[maintenance operations are more universal than creative pipelines because structural health is domain-invariant]], most structural health checks are naturally idempotent: validating a schema, detecting orphans, checking link integrity, and measuring MOC coherence all read state without modifying it, making them inherently safe to run on any schedule.
22
+
23
+ There is a subtlety worth naming. Read-only operations are trivially idempotent because they modify nothing — and since [[automated detection is always safe because it only reads state while automated remediation risks content corruption]], this trivial idempotency is precisely why detection can be maximally aggressive while remediation needs the guards this note describes. The interesting cases are operations that both check and fix: a hook that detects a missing description field and adds a placeholder, a maintenance pass that finds orphan notes and adds them to MOCs, a reconciliation loop that compares desired state to actual state and corrects drift — since [[reconciliation loops that compare desired state to actual state enable drift correction without continuous monitoring]], the scheduling safety of such loops depends entirely on whether their fix logic is idempotent. These operations are idempotent only if their fix logic uses compare-before-acting or upsert semantics. A reconciliation loop that blindly applies corrections without checking current state will over-correct on retry. The design principle is that the fix should target the desired end state, not the delta from the last known state — because the last known state may have changed between detection and correction, and may change again between correction and the next scheduled run.
24
+
25
+ ---
26
+ ---
27
+
28
+ Relevant Notes:
29
+ - [[maintenance operations are more universal than creative pipelines because structural health is domain-invariant]] — establishes that maintenance is automatable because it checks structural properties; this note adds the specific engineering requirement for safe automation
30
+ - [[the determinism boundary separates hook methodology from skill methodology]] — foundation: the first of two filters for automation safety; determinism asks whether the operation requires judgment, idempotency asks whether it is safe to repeat; both must pass for hook-level automation
31
+ - [[over-automation corrupts quality when hooks encode judgment rather than verification]] — the failure mode when the determinism filter is violated; idempotency adds a second filter for which deterministic operations are safe to schedule
32
+ - [[hook enforcement guarantees quality while instruction enforcement merely suggests it]] — hooks provide the enforcement mechanism; idempotency ensures the mechanism is safe to fire repeatedly without corruption
33
+ - [[auto-commit hooks eliminate prospective memory failures by converting remember-to-act into guaranteed execution]] — auto-commit is a concrete idempotent operation: committing unchanged files is a no-op, making repeated firing harmless
34
+ - [[schema enforcement via validation agents enables soft consistency]] — schema validation is naturally idempotent: checking whether a field exists returns the same result regardless of how many times you check
35
+ - [[reconciliation loops that compare desired state to actual state enable drift correction without continuous monitoring]] — the scheduling architecture that depends on idempotency: reconciliation detection is trivially idempotent (read-only), but reconciliation remediation requires the compare-before-acting and upsert patterns this note develops
36
+ - [[automated detection is always safe because it only reads state while automated remediation risks content corruption]] — develops the read/write asymmetry that makes detection trivially idempotent; three complementary automation safety axes: determinism (judgment?), idempotency (safe to repeat?), and read/write (side effects?)
37
+ - [[confidence thresholds gate automated action between the mechanical and judgment zones]] — for operations that fail the idempotency test and need guards, confidence thresholds provide one class of guard by gating remediation action below a confidence level where repeated action could corrupt
38
+ - [[maintenance scheduling frequency should match consequence speed not detection capability]] — consequence speed determines how often detection should run; idempotency makes that frequency safe by ensuring repeated checks at any tier produce no side effects
39
+ - [[methodology development should follow the trajectory from documentation to skill to hook as understanding hardens]] — adds a temporal dimension: idempotency is a prerequisite for the hook-promotion step in the trajectory; an operation should reach hook level only after confirming it is both deterministic and idempotent
40
+ - [[three concurrent maintenance loops operate at different timescales to catch different classes of problems]] — enables overlapping loops: when fast-loop and medium-loop detection checks cover the same territory (both may check for dangling links), idempotency ensures redundant detection across loops produces identical results rather than compounding; the three-loop architecture depends on this property to allow loops to overlap without interference
41
+
42
+ Topics:
43
+ - [[maintenance-patterns]]
44
+ - [[agent-cognition]]