arscontexta 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +11 -0
- package/.claude-plugin/plugin.json +22 -0
- package/README.md +683 -0
- package/agents/knowledge-guide.md +49 -0
- package/bin/cli.mjs +66 -0
- package/generators/agents-md.md +240 -0
- package/generators/claude-md.md +379 -0
- package/generators/features/atomic-notes.md +124 -0
- package/generators/features/ethical-guardrails.md +58 -0
- package/generators/features/graph-analysis.md +188 -0
- package/generators/features/helper-functions.md +92 -0
- package/generators/features/maintenance.md +164 -0
- package/generators/features/methodology-knowledge.md +70 -0
- package/generators/features/mocs.md +144 -0
- package/generators/features/multi-domain.md +61 -0
- package/generators/features/personality.md +71 -0
- package/generators/features/processing-pipeline.md +428 -0
- package/generators/features/schema.md +149 -0
- package/generators/features/self-evolution.md +229 -0
- package/generators/features/self-space.md +78 -0
- package/generators/features/semantic-search.md +99 -0
- package/generators/features/session-rhythm.md +85 -0
- package/generators/features/templates.md +85 -0
- package/generators/features/wiki-links.md +88 -0
- package/generators/soul-md.md +121 -0
- package/hooks/hooks.json +45 -0
- package/hooks/scripts/auto-commit.sh +44 -0
- package/hooks/scripts/session-capture.sh +35 -0
- package/hooks/scripts/session-orient.sh +86 -0
- package/hooks/scripts/write-validate.sh +42 -0
- package/methodology/AI shifts knowledge systems from externalizing memory to externalizing attention.md +59 -0
- package/methodology/BM25 retrieval fails on full-length descriptions because query term dilution reduces match scores.md +39 -0
- package/methodology/IBIS framework maps claim-based architecture to structured argumentation.md +58 -0
- package/methodology/LLM attention degrades as context fills.md +49 -0
- package/methodology/MOC construction forces synthesis that automated generation from metadata cannot replicate.md +49 -0
- package/methodology/MOC maintenance investment compounds because orientation savings multiply across every future session.md +41 -0
- package/methodology/MOCs are attention management devices not just organizational tools.md +51 -0
- package/methodology/PKM failure follows a predictable cycle.md +50 -0
- package/methodology/ThreadMode to DocumentMode transformation is the core value creation step.md +52 -0
- package/methodology/WIP limits force processing over accumulation.md +53 -0
- package/methodology/Zeigarnik effect validates capture-first philosophy because open loops drain attention.md +42 -0
- package/methodology/academic research uses structured extraction with cross-source synthesis.md +566 -0
- package/methodology/adapt the four-phase processing pipeline to domain-specific throughput needs.md +197 -0
- package/methodology/agent notes externalize navigation intuition that search cannot discover and traversal cannot reconstruct.md +48 -0
- package/methodology/agent self-memory should be architecturally separate from user knowledge systems.md +48 -0
- package/methodology/agent session boundaries create natural automation checkpoints that human-operated systems lack.md +56 -0
- package/methodology/agent-cognition.md +107 -0
- package/methodology/agents are simultaneously methodology executors and subjects creating a unique trust asymmetry.md +66 -0
- package/methodology/aspect-oriented programming solved the same cross-cutting concern problem that hooks solve.md +39 -0
- package/methodology/associative ontologies beat hierarchical taxonomies because heterarchy adapts while hierarchy brittles.md +53 -0
- package/methodology/attention residue may have a minimum granularity that cannot be subdivided.md +46 -0
- package/methodology/auto-commit hooks eliminate prospective memory failures by converting remember-to-act into guaranteed execution.md +47 -0
- package/methodology/automated detection is always safe because it only reads state while automated remediation risks content corruption.md +42 -0
- package/methodology/automation should be retired when its false positive rate exceeds its true positive rate or it catches zero issues.md +56 -0
- package/methodology/backlinks implicitly define notes by revealing usage context.md +35 -0
- package/methodology/backward maintenance asks what would be different if written today.md +62 -0
- package/methodology/balance onboarding enforcement and questions to prevent premature complexity.md +229 -0
- package/methodology/basic level categorization determines optimal MOC granularity.md +51 -0
- package/methodology/batching by context similarity reduces switching costs in agent processing.md +43 -0
- package/methodology/behavioral anti-patterns matter more than tool selection.md +42 -0
- package/methodology/betweenness centrality identifies bridge notes connecting disparate knowledge domains.md +57 -0
- package/methodology/blueprints that teach construction outperform downloads that provide pre-built code for platform-dependent modules.md +42 -0
- package/methodology/bootstrapping principle enables self-improving systems.md +62 -0
- package/methodology/build automatic memory through cognitive offloading and session handoffs.md +285 -0
- package/methodology/capture the reaction to content not just the content itself.md +41 -0
- package/methodology/claims must be specific enough to be wrong.md +36 -0
- package/methodology/closure rituals create clean breaks that prevent attention residue bleed.md +44 -0
- package/methodology/cognitive offloading is the architectural foundation for vault design.md +46 -0
- package/methodology/cognitive outsourcing risk in agent-operated systems.md +55 -0
- package/methodology/coherence maintains consistency despite inconsistent inputs.md +96 -0
- package/methodology/coherent architecture emerges from wiki links spreading activation and small-world topology.md +48 -0
- package/methodology/community detection algorithms can inform when MOCs should split or merge.md +52 -0
- package/methodology/complete navigation requires four complementary types that no single mechanism provides.md +43 -0
- package/methodology/complex systems evolve from simple working systems.md +59 -0
- package/methodology/composable knowledge architecture builds systems from independent toggleable modules not monolithic templates.md +61 -0
- package/methodology/compose multi-domain systems through separate templates and shared graph.md +372 -0
- package/methodology/concept-orientation beats source-orientation for cross-domain connections.md +51 -0
- package/methodology/confidence thresholds gate automated action between the mechanical and judgment zones.md +50 -0
- package/methodology/configuration dimensions interact so choices in one create pressure on others.md +58 -0
- package/methodology/configuration paralysis emerges when derivation surfaces too many decisions.md +44 -0
- package/methodology/context files function as agent operating systems through self-referential self-extension.md +46 -0
- package/methodology/context phrase clarity determines how deep a navigation hierarchy can scale.md +46 -0
- package/methodology/continuous small-batch processing eliminates review dread.md +48 -0
- package/methodology/controlled disorder engineers serendipity through semantic rather than topical linking.md +51 -0
- package/methodology/creative writing uses worldbuilding consistency with character tracking.md +672 -0
- package/methodology/cross-links between MOC territories indicate creative leaps and integration depth.md +43 -0
- package/methodology/dangling links reveal which notes want to exist.md +62 -0
- package/methodology/data exit velocity measures how quickly content escapes vendor lock-in.md +74 -0
- package/methodology/decontextualization risk means atomicity may strip meaning that cannot be recovered.md +48 -0
- package/methodology/dense interlinked research claims enable derivation while sparse references only enable templating.md +47 -0
- package/methodology/dependency resolution through topological sort makes module composition transparent and verifiable.md +56 -0
- package/methodology/derivation generates knowledge systems from composable research claims not template customization.md +63 -0
- package/methodology/derivation-engine.md +27 -0
- package/methodology/derived systems follow a seed-evolve-reseed lifecycle.md +56 -0
- package/methodology/description quality for humans diverges from description quality for keyword search.md +73 -0
- package/methodology/descriptions are retrieval filters not summaries.md +112 -0
- package/methodology/design MOCs as attention management devices with lifecycle governance.md +318 -0
- package/methodology/design-dimensions.md +66 -0
- package/methodology/digital mutability enables note evolution that physical permanence forbids.md +54 -0
- package/methodology/discovery-retrieval.md +48 -0
- package/methodology/distinctiveness scoring treats description quality as measurable.md +69 -0
- package/methodology/does agent processing recover what fast capture loses.md +43 -0
- package/methodology/domain-compositions.md +37 -0
- package/methodology/dual-coding with visual elements could enhance agent traversal.md +55 -0
- package/methodology/each module must be describable in one sentence under 200 characters or it does too many things.md +45 -0
- package/methodology/each new note compounds value by creating traversal paths.md +55 -0
- package/methodology/eight configuration dimensions parameterize the space of possible knowledge systems.md +56 -0
- package/methodology/elaborative encoding is the quality gate for new notes.md +55 -0
- package/methodology/enforce schema with graduated strictness across capture processing and query zones.md +221 -0
- package/methodology/enforcing atomicity can create paralysis when ideas resist decomposition.md +43 -0
- package/methodology/engineering uses technical decision tracking with architectural memory.md +766 -0
- package/methodology/every knowledge domain shares a four-phase processing skeleton that diverges only in the process step.md +53 -0
- package/methodology/evolution observations provide actionable signals for system adaptation.md +67 -0
- package/methodology/external memory shapes cognition more than base model.md +60 -0
- package/methodology/faceted classification treats notes as multi-dimensional objects rather than folder contents.md +65 -0
- package/methodology/failure-modes.md +27 -0
- package/methodology/false universalism applies same processing logic regardless of domain.md +49 -0
- package/methodology/federated wiki pattern enables multi-agent divergence as feature not bug.md +59 -0
- package/methodology/flat files break at retrieval scale.md +75 -0
- package/methodology/forced engagement produces weak connections.md +48 -0
- package/methodology/four abstraction layers separate platform-agnostic from platform-dependent knowledge system features.md +47 -0
- package/methodology/fresh context per task preserves quality better than chaining phases.md +44 -0
- package/methodology/friction reveals architecture.md +63 -0
- package/methodology/friction-driven module adoption prevents configuration debt by adding complexity only at pain points.md +48 -0
- package/methodology/gardening cycle implements tend prune fertilize operations.md +41 -0
- package/methodology/generation effect gate blocks processing without transformation.md +40 -0
- package/methodology/goal-driven memory orchestration enables autonomous domain learning through directed compute allocation.md +41 -0
- package/methodology/good descriptions layer heuristic then mechanism then implication.md +57 -0
- package/methodology/graph-structure.md +65 -0
- package/methodology/guided notes might outperform post-hoc structuring for high-volume capture.md +37 -0
- package/methodology/health wellness uses symptom-trigger correlation with multi-dimensional tracking.md +819 -0
- package/methodology/hook composition creates emergent methodology from independent single-concern components.md +47 -0
- package/methodology/hook enforcement guarantees quality while instruction enforcement merely suggests it.md +51 -0
- package/methodology/hook-driven learning loops create self-improving methodology through observation accumulation.md +62 -0
- package/methodology/hooks are the agent habit system that replaces the missing basal ganglia.md +40 -0
- package/methodology/hooks cannot replace genuine cognitive engagement yet more automation is always tempting.md +87 -0
- package/methodology/hooks enable context window efficiency by delegating deterministic checks to external processes.md +47 -0
- package/methodology/idempotent maintenance operations are safe to automate because running them twice produces the same result as running them once.md +44 -0
- package/methodology/implement condition-based maintenance triggers for derived systems.md +255 -0
- package/methodology/implicit dependencies create distributed monoliths that fail silently across configurations.md +58 -0
- package/methodology/implicit knowledge emerges from traversal.md +55 -0
- package/methodology/incremental formalization happens through repeated touching of old notes.md +60 -0
- package/methodology/incremental reading enables cross-source connection finding.md +39 -0
- package/methodology/index.md +32 -0
- package/methodology/inline links carry richer relationship data than metadata fields.md +91 -0
- package/methodology/insight accretion differs from productivity in knowledge systems.md +41 -0
- package/methodology/intermediate packets enable assembly over creation.md +52 -0
- package/methodology/intermediate representation pattern enables reliable vault operations beyond regex.md +62 -0
- package/methodology/justification chains enable forward backward and evolution reasoning about configuration decisions.md +46 -0
- package/methodology/knowledge system architecture is parameterized by platform capabilities not fixed by methodology.md +51 -0
- package/methodology/knowledge systems become communication partners through complexity and memory humans cannot sustain.md +47 -0
- package/methodology/knowledge systems share universal operations and structural components across all methodology traditions.md +46 -0
- package/methodology/legal case management uses precedent chains with regulatory change propagation.md +892 -0
- package/methodology/live index via periodic regeneration keeps discovery current.md +58 -0
- package/methodology/local-first file formats are inherently agent-native.md +69 -0
- package/methodology/logic column pattern separates reasoning from procedure.md +35 -0
- package/methodology/maintenance operations are more universal than creative pipelines because structural health is domain-invariant.md +47 -0
- package/methodology/maintenance scheduling frequency should match consequence speed not detection capability.md +50 -0
- package/methodology/maintenance targeting should prioritize mechanism and theory notes.md +26 -0
- package/methodology/maintenance-patterns.md +72 -0
- package/methodology/markdown plus YAML plus ripgrep implements a queryable graph database without infrastructure.md +55 -0
- package/methodology/maturity field enables agent context prioritization.md +33 -0
- package/methodology/memory-architecture.md +27 -0
- package/methodology/metacognitive confidence can diverge from retrieval capability.md +42 -0
- package/methodology/metadata reduces entropy enabling precision over recall.md +91 -0
- package/methodology/methodology development should follow the trajectory from documentation to skill to hook as understanding hardens.md +80 -0
- package/methodology/methodology traditions are named points in a shared configuration space not competing paradigms.md +64 -0
- package/methodology/mnemonic medium embeds verification into navigation.md +46 -0
- package/methodology/module communication through shared YAML fields creates loose coupling without direct dependencies.md +44 -0
- package/methodology/module deactivation must account for structural artifacts that survive the toggle.md +49 -0
- package/methodology/multi-domain systems compose through separate templates and shared graph.md +61 -0
- package/methodology/multi-domain-composition.md +27 -0
- package/methodology/narrow folksonomy optimizes for single-operator retrieval unlike broad consensus tagging.md +53 -0
- package/methodology/navigation infrastructure passes through distinct scaling regimes that require qualitative strategy shifts.md +48 -0
- package/methodology/navigational vertigo emerges in pure association systems without local hierarchy.md +54 -0
- package/methodology/note titles should function as APIs enabling sentence transclusion.md +51 -0
- package/methodology/note-design.md +57 -0
- package/methodology/notes are skills /342/200/224 curated knowledge injected when relevant.md" +62 -0
- package/methodology/notes function as cognitive anchors that stabilize attention during complex tasks.md +41 -0
- package/methodology/novel domains derive by mapping knowledge type to closest reference domain then adapting.md +50 -0
- package/methodology/nudge theory explains graduated hook enforcement as choice architecture for agents.md +59 -0
- package/methodology/observation and tension logs function as dead-letter queues for failed automation.md +51 -0
- package/methodology/operational memory and knowledge memory serve different functions in agent architecture.md +48 -0
- package/methodology/operational wisdom requires contextual observation.md +52 -0
- package/methodology/orchestrated vault creation transforms arscontexta from tool to autonomous knowledge factory.md +40 -0
- package/methodology/organic emergence versus active curation creates a fundamental vault governance tension.md +68 -0
- package/methodology/orphan notes are seeds not failures.md +38 -0
- package/methodology/over-automation corrupts quality when hooks encode judgment rather than verification.md +62 -0
- package/methodology/people relationships uses Dunbar-layered graphs with interaction tracking.md +659 -0
- package/methodology/personal assistant uses life area management with review automation.md +610 -0
- package/methodology/platform adapter translation is semantic not mechanical because hook event meanings differ.md +40 -0
- package/methodology/platform capability tiers determine which knowledge system features can be implemented.md +48 -0
- package/methodology/platform fragmentation means identical conceptual operations require different implementations across agent environments.md +44 -0
- package/methodology/premature complexity is the most common derivation failure mode.md +45 -0
- package/methodology/prevent domain-specific failure modes through the vulnerability matrix.md +336 -0
- package/methodology/processing effort should follow retrieval demand.md +57 -0
- package/methodology/processing-workflows.md +75 -0
- package/methodology/product management uses feedback pipelines with experiment tracking.md +789 -0
- package/methodology/productivity porn risk in meta-system building.md +30 -0
- package/methodology/programmable notes could enable property-triggered workflows.md +64 -0
- package/methodology/progressive disclosure means reading right not reading less.md +69 -0
- package/methodology/progressive schema validates only what active modules require not the full system schema.md +49 -0
- package/methodology/project management uses decision tracking with stakeholder context.md +776 -0
- package/methodology/propositional link semantics transform wiki links from associative to reasoned.md +87 -0
- package/methodology/prospective memory requires externalization.md +53 -0
- package/methodology/provenance tracks where beliefs come from.md +62 -0
- package/methodology/queries evolve during search so agents should checkpoint.md +35 -0
- package/methodology/question-answer metadata enables inverted search patterns.md +39 -0
- package/methodology/random note resurfacing prevents write-only memory.md +33 -0
- package/methodology/reconciliation loops that compare desired state to actual state enable drift correction without continuous monitoring.md +59 -0
- package/methodology/reflection synthesizes existing notes into new insight.md +100 -0
- package/methodology/retrieval utility should drive design over capture completeness.md +69 -0
- package/methodology/retrieval verification loop tests description quality at scale.md +81 -0
- package/methodology/role field makes graph structure explicit.md +94 -0
- package/methodology/scaffolding enables divergence that fine-tuning cannot.md +67 -0
- package/methodology/schema enforcement via validation agents enables soft consistency.md +60 -0
- package/methodology/schema evolution follows observe-then-formalize not design-then-enforce.md +65 -0
- package/methodology/schema field names are the only domain specific element in the universal note pattern.md +46 -0
- package/methodology/schema fields should use domain-native vocabulary not abstract terminology.md +47 -0
- package/methodology/schema templates reduce cognitive overhead at capture time.md +55 -0
- package/methodology/schema validation hooks externalize inhibitory control that degrades under cognitive load.md +48 -0
- package/methodology/schema-enforcement.md +27 -0
- package/methodology/self-extension requires context files to contain platform operations knowledge not just methodology.md +47 -0
- package/methodology/sense-making vs storage does compression lose essential nuance.md +73 -0
- package/methodology/session boundary hooks implement cognitive bookends for orientation and reflection.md +60 -0
- package/methodology/session handoff creates continuity without persistent memory.md +43 -0
- package/methodology/session outputs are packets for future selves.md +43 -0
- package/methodology/session transcript mining enables experiential validation that structural tests cannot provide.md +38 -0
- package/methodology/skill context budgets constrain knowledge system complexity on agent platforms.md +52 -0
- package/methodology/skills encode methodology so manual execution bypasses quality gates.md +50 -0
- package/methodology/small-world topology requires hubs and dense local links.md +99 -0
- package/methodology/source attribution enables tracing claims to foundations.md +38 -0
- package/methodology/spaced repetition scheduling could optimize vault maintenance.md +44 -0
- package/methodology/spreading activation models how agents should traverse.md +79 -0
- package/methodology/stale navigation actively misleads because agents trust curated maps completely.md +43 -0
- package/methodology/stigmergy coordinates agents through environmental traces without direct communication.md +62 -0
- package/methodology/storage versus thinking distinction determines which tool patterns apply.md +56 -0
- package/methodology/structure enables navigation without reading everything.md +52 -0
- package/methodology/structure without processing provides no value.md +56 -0
- package/methodology/student learning uses prerequisite graphs with spaced retrieval.md +770 -0
- package/methodology/summary coherence tests composability before filing.md +37 -0
- package/methodology/tag rot applies to wiki links because titles serve as both identifier and display text.md +50 -0
- package/methodology/temporal media must convert to spatial text for agent traversal.md +43 -0
- package/methodology/temporal processing priority creates age-based inbox urgency.md +45 -0
- package/methodology/temporal separation of capture and processing preserves context freshness.md +39 -0
- package/methodology/ten universal primitives form the kernel of every viable agent knowledge system.md +162 -0
- package/methodology/testing effect could enable agent knowledge verification.md +38 -0
- package/methodology/the AgentSkills standard embodies progressive disclosure at the skill level.md +40 -0
- package/methodology/the derivation engine improves recursively as deployed systems generate observations.md +49 -0
- package/methodology/the determinism boundary separates hook methodology from skill methodology.md +46 -0
- package/methodology/the fix-versus-report decision depends on determinism reversibility and accumulated trust.md +45 -0
- package/methodology/the generation effect requires active transformation not just storage.md +57 -0
- package/methodology/the no wrong patches guarantee ensures any valid module combination produces a valid system.md +58 -0
- package/methodology/the system is the argument.md +46 -0
- package/methodology/the vault constitutes identity for agents.md +86 -0
- package/methodology/the vault methodology transfers because it encodes cognitive science not domain specifics.md +47 -0
- package/methodology/therapy journal uses warm personality with pattern detection for emotional processing.md +584 -0
- package/methodology/three capture schools converge through agent-mediated synthesis.md +55 -0
- package/methodology/three concurrent maintenance loops operate at different timescales to catch different classes of problems.md +56 -0
- package/methodology/throughput matters more than accumulation.md +58 -0
- package/methodology/title as claim enables traversal as reasoning.md +50 -0
- package/methodology/topological organization beats temporal for knowledge work.md +52 -0
- package/methodology/trading uses conviction tracking with thesis-outcome correlation.md +699 -0
- package/methodology/trails transform ephemeral navigation into persistent artifacts.md +39 -0
- package/methodology/transform universal vocabulary to domain-native language through six levels.md +259 -0
- package/methodology/type field enables structured queries without folder hierarchies.md +53 -0
- package/methodology/use-case presets dissolve the tension between composability and simplicity.md +44 -0
- package/methodology/vault conventions may impose hidden rigidity on thinking.md +44 -0
- package/methodology/verbatim risk applies to agents too.md +31 -0
- package/methodology/vibe notetaking is the emerging industry consensus for AI-native self-organization.md +56 -0
- package/methodology/vivid memories need verification.md +45 -0
- package/methodology/vocabulary-transformation.md +27 -0
- package/methodology/voice capture is the highest-bandwidth channel for agent-delegated knowledge systems.md +45 -0
- package/methodology/wiki links are the digital evolution of analog indexing.md +73 -0
- package/methodology/wiki links as social contract transforms agents into stewards of incomplete references.md +52 -0
- package/methodology/wiki links create navigation paths that shape retrieval.md +63 -0
- package/methodology/wiki links implement GraphRAG without the infrastructure.md +101 -0
- package/methodology/writing for audience blocks authentic creation.md +22 -0
- package/methodology/you operate a system that takes notes.md +79 -0
- package/openclaw/SKILL.md +110 -0
- package/package.json +45 -0
- package/platforms/README.md +51 -0
- package/platforms/claude-code/generator.md +61 -0
- package/platforms/claude-code/hooks/README.md +186 -0
- package/platforms/claude-code/hooks/auto-commit.sh.template +38 -0
- package/platforms/claude-code/hooks/session-capture.sh.template +72 -0
- package/platforms/claude-code/hooks/session-orient.sh.template +189 -0
- package/platforms/claude-code/hooks/write-validate.sh.template +106 -0
- package/platforms/openclaw/generator.md +82 -0
- package/platforms/openclaw/hooks/README.md +89 -0
- package/platforms/openclaw/hooks/bootstrap.ts.template +224 -0
- package/platforms/openclaw/hooks/command-new.ts.template +165 -0
- package/platforms/openclaw/hooks/heartbeat.ts.template +214 -0
- package/platforms/shared/features/README.md +70 -0
- package/platforms/shared/skill-blocks/graph.md +145 -0
- package/platforms/shared/skill-blocks/learn.md +119 -0
- package/platforms/shared/skill-blocks/next.md +131 -0
- package/platforms/shared/skill-blocks/pipeline.md +326 -0
- package/platforms/shared/skill-blocks/ralph.md +616 -0
- package/platforms/shared/skill-blocks/reduce.md +1142 -0
- package/platforms/shared/skill-blocks/refactor.md +129 -0
- package/platforms/shared/skill-blocks/reflect.md +780 -0
- package/platforms/shared/skill-blocks/remember.md +524 -0
- package/platforms/shared/skill-blocks/rethink.md +574 -0
- package/platforms/shared/skill-blocks/reweave.md +680 -0
- package/platforms/shared/skill-blocks/seed.md +320 -0
- package/platforms/shared/skill-blocks/stats.md +145 -0
- package/platforms/shared/skill-blocks/tasks.md +171 -0
- package/platforms/shared/skill-blocks/validate.md +323 -0
- package/platforms/shared/skill-blocks/verify.md +562 -0
- package/platforms/shared/templates/README.md +35 -0
- package/presets/experimental/categories.yaml +1 -0
- package/presets/experimental/preset.yaml +38 -0
- package/presets/experimental/starter/README.md +7 -0
- package/presets/experimental/vocabulary.yaml +7 -0
- package/presets/personal/categories.yaml +7 -0
- package/presets/personal/preset.yaml +41 -0
- package/presets/personal/starter/goals.md +21 -0
- package/presets/personal/starter/index.md +17 -0
- package/presets/personal/starter/life-areas.md +21 -0
- package/presets/personal/starter/people.md +21 -0
- package/presets/personal/vocabulary.yaml +32 -0
- package/presets/research/categories.yaml +8 -0
- package/presets/research/preset.yaml +41 -0
- package/presets/research/starter/index.md +17 -0
- package/presets/research/starter/methods.md +21 -0
- package/presets/research/starter/open-questions.md +21 -0
- package/presets/research/vocabulary.yaml +33 -0
- package/reference/AUDIT-REPORT.md +238 -0
- package/reference/claim-map.md +172 -0
- package/reference/components.md +327 -0
- package/reference/conversation-patterns.md +542 -0
- package/reference/derivation-validation.md +649 -0
- package/reference/dimension-claim-map.md +134 -0
- package/reference/evolution-lifecycle.md +297 -0
- package/reference/failure-modes.md +235 -0
- package/reference/interaction-constraints.md +204 -0
- package/reference/kernel.yaml +242 -0
- package/reference/methodology.md +283 -0
- package/reference/open-questions.md +279 -0
- package/reference/personality-layer.md +302 -0
- package/reference/self-space.md +299 -0
- package/reference/semantic-vs-keyword.md +288 -0
- package/reference/session-lifecycle.md +298 -0
- package/reference/templates/base-note.md +16 -0
- package/reference/templates/companion-note.md +70 -0
- package/reference/templates/creative-note.md +16 -0
- package/reference/templates/learning-note.md +16 -0
- package/reference/templates/life-note.md +16 -0
- package/reference/templates/moc.md +26 -0
- package/reference/templates/relationship-note.md +17 -0
- package/reference/templates/research-note.md +19 -0
- package/reference/templates/session-log.md +24 -0
- package/reference/templates/therapy-note.md +16 -0
- package/reference/test-fixtures/edge-case-constraints.md +148 -0
- package/reference/test-fixtures/multi-domain.md +164 -0
- package/reference/test-fixtures/novel-domain-gaming.md +138 -0
- package/reference/test-fixtures/research-minimal.md +102 -0
- package/reference/test-fixtures/therapy-full.md +155 -0
- package/reference/testing-milestones.md +1087 -0
- package/reference/three-spaces.md +363 -0
- package/reference/tradition-presets.md +203 -0
- package/reference/use-case-presets.md +341 -0
- package/reference/validate-kernel.sh +432 -0
- package/reference/vocabulary-transforms.md +85 -0
- package/scripts/sync-thinking.sh +147 -0
- package/skill-sources/graph/SKILL.md +567 -0
- package/skill-sources/graph/skill.json +17 -0
- package/skill-sources/learn/SKILL.md +254 -0
- package/skill-sources/learn/skill.json +17 -0
- package/skill-sources/next/SKILL.md +407 -0
- package/skill-sources/next/skill.json +17 -0
- package/skill-sources/pipeline/SKILL.md +314 -0
- package/skill-sources/pipeline/skill.json +17 -0
- package/skill-sources/ralph/SKILL.md +604 -0
- package/skill-sources/ralph/skill.json +17 -0
- package/skill-sources/reduce/SKILL.md +1113 -0
- package/skill-sources/reduce/skill.json +17 -0
- package/skill-sources/refactor/SKILL.md +448 -0
- package/skill-sources/refactor/skill.json +17 -0
- package/skill-sources/reflect/SKILL.md +747 -0
- package/skill-sources/reflect/skill.json +17 -0
- package/skill-sources/remember/SKILL.md +534 -0
- package/skill-sources/remember/skill.json +17 -0
- package/skill-sources/rethink/SKILL.md +658 -0
- package/skill-sources/rethink/skill.json +17 -0
- package/skill-sources/reweave/SKILL.md +657 -0
- package/skill-sources/reweave/skill.json +17 -0
- package/skill-sources/seed/SKILL.md +303 -0
- package/skill-sources/seed/skill.json +17 -0
- package/skill-sources/stats/SKILL.md +371 -0
- package/skill-sources/stats/skill.json +17 -0
- package/skill-sources/tasks/SKILL.md +402 -0
- package/skill-sources/tasks/skill.json +17 -0
- package/skill-sources/validate/SKILL.md +310 -0
- package/skill-sources/validate/skill.json +17 -0
- package/skill-sources/verify/SKILL.md +532 -0
- package/skill-sources/verify/skill.json +17 -0
- package/skills/add-domain/SKILL.md +441 -0
- package/skills/add-domain/skill.json +17 -0
- package/skills/architect/SKILL.md +568 -0
- package/skills/architect/skill.json +17 -0
- package/skills/ask/SKILL.md +388 -0
- package/skills/ask/skill.json +17 -0
- package/skills/health/SKILL.md +760 -0
- package/skills/health/skill.json +17 -0
- package/skills/help/SKILL.md +348 -0
- package/skills/help/skill.json +17 -0
- package/skills/recommend/SKILL.md +553 -0
- package/skills/recommend/skill.json +17 -0
- package/skills/reseed/SKILL.md +385 -0
- package/skills/reseed/skill.json +17 -0
- package/skills/setup/SKILL.md +1688 -0
- package/skills/setup/skill.json +17 -0
- package/skills/tutorial/SKILL.md +496 -0
- package/skills/tutorial/skill.json +17 -0
- package/skills/upgrade/SKILL.md +395 -0
- package/skills/upgrade/skill.json +17 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# validate-kernel.sh — Check a knowledge system against the 15 universal primitives
|
|
3
|
+
# Usage: ./validate-kernel.sh [path-to-vault]
|
|
4
|
+
# Defaults to current directory if no path given.
|
|
5
|
+
|
|
6
|
+
VAULT="${1:-.}"
|
|
7
|
+
PASS=0
|
|
8
|
+
WARN=0
|
|
9
|
+
FAIL=0
|
|
10
|
+
|
|
11
|
+
# Colors
|
|
12
|
+
RED='\033[0;31m'
|
|
13
|
+
GREEN='\033[0;32m'
|
|
14
|
+
YELLOW='\033[1;33m'
|
|
15
|
+
NC='\033[0m'
|
|
16
|
+
|
|
17
|
+
pass() { echo -e " ${GREEN}PASS${NC} $1"; PASS=$((PASS + 1)); }
|
|
18
|
+
warn() { echo -e " ${YELLOW}WARN${NC} $1"; WARN=$((WARN + 1)); }
|
|
19
|
+
fail() { echo -e " ${RED}FAIL${NC} $1"; FAIL=$((FAIL + 1)); }
|
|
20
|
+
|
|
21
|
+
echo "=== Kernel Validation: $VAULT ==="
|
|
22
|
+
echo ""
|
|
23
|
+
|
|
24
|
+
# --- Primitive 1: Markdown files with YAML frontmatter ---
|
|
25
|
+
echo "1. Markdown files with YAML frontmatter"
|
|
26
|
+
md_files=$(find "$VAULT" -name "*.md" -not -path "*/.git/*" -not -path "*/node_modules/*" -not -name "README.md" -not -name "SKILL.md" -not -name "CLAUDE.md" -not -name "AGENTS.md" -not -name "SOUL.md")
|
|
27
|
+
md_count=$(echo "$md_files" | grep -c . || true)
|
|
28
|
+
|
|
29
|
+
if [ "$md_count" -gt 0 ]; then
|
|
30
|
+
yaml_count=$(echo "$md_files" | xargs -I{} head -1 {} 2>/dev/null | grep -c "^---$" || true)
|
|
31
|
+
no_yaml=$((md_count - yaml_count))
|
|
32
|
+
|
|
33
|
+
if [ "$no_yaml" -eq 0 ]; then
|
|
34
|
+
pass "$md_count markdown files, all with YAML frontmatter"
|
|
35
|
+
elif [ "$no_yaml" -lt "$((yaml_count / 5 + 1))" ]; then
|
|
36
|
+
warn "$yaml_count with YAML, $no_yaml without (< 20% missing)"
|
|
37
|
+
else
|
|
38
|
+
fail "$no_yaml of $md_count files missing YAML frontmatter"
|
|
39
|
+
fi
|
|
40
|
+
else
|
|
41
|
+
fail "No markdown files found"
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
# --- Primitive 2: Wiki links as graph edges ---
|
|
45
|
+
echo "2. Wiki links as graph edges"
|
|
46
|
+
link_files=$(grep -rl '\[\[' "$VAULT" --include="*.md" 2>/dev/null | grep -v ".git" | wc -l | tr -d ' ')
|
|
47
|
+
total_notes=$(echo "$md_count")
|
|
48
|
+
if [ "$total_notes" -eq 0 ]; then
|
|
49
|
+
fail "No notes to check"
|
|
50
|
+
elif [ "$link_files" -gt "$((total_notes / 2))" ]; then
|
|
51
|
+
pass "$link_files of $total_notes files contain wiki links"
|
|
52
|
+
else
|
|
53
|
+
warn "Only $link_files of $total_notes files contain wiki links (< 50%)"
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
# Build index of existing filenames for dangling link check
|
|
57
|
+
existing_files=$(find "$VAULT" -name "*.md" -not -path "*/.git/*" 2>/dev/null | xargs -I{} basename {} .md | sort -u)
|
|
58
|
+
|
|
59
|
+
# Extract wiki links from note content (scan known note directories)
|
|
60
|
+
dangling=0
|
|
61
|
+
checked=0
|
|
62
|
+
|
|
63
|
+
# Collect links from note directories only
|
|
64
|
+
link_candidates=""
|
|
65
|
+
for d in "01_thinking" "notes" "00_inbox" "04_meta/logs"; do
|
|
66
|
+
if [ -d "$VAULT/$d" ]; then
|
|
67
|
+
new_links=$(grep -roh '\[\[[A-Za-z][^]]*\]\]' "$VAULT/$d" 2>/dev/null | sed 's/\[\[//g;s/\]\]//g' | sort -u)
|
|
68
|
+
if [ -n "$new_links" ]; then
|
|
69
|
+
link_candidates=$(printf '%s\n%s' "$link_candidates" "$new_links")
|
|
70
|
+
fi
|
|
71
|
+
fi
|
|
72
|
+
done
|
|
73
|
+
# Also check parent self/ if it exists
|
|
74
|
+
[ -d "$VAULT/../self" ] && {
|
|
75
|
+
new_links=$(grep -roh '\[\[[A-Za-z][^]]*\]\]' "$VAULT/../self" 2>/dev/null | sed 's/\[\[//g;s/\]\]//g' | sort -u)
|
|
76
|
+
[ -n "$new_links" ] && link_candidates=$(printf '%s\n%s' "$link_candidates" "$new_links")
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
# Deduplicate and sample
|
|
80
|
+
link_candidates=$(echo "$link_candidates" | sort -u | head -100)
|
|
81
|
+
|
|
82
|
+
while IFS= read -r link; do
|
|
83
|
+
[ -z "$link" ] && continue
|
|
84
|
+
checked=$((checked + 1))
|
|
85
|
+
if ! echo "$existing_files" | grep -qxF "$link"; then
|
|
86
|
+
dangling=$((dangling + 1))
|
|
87
|
+
fi
|
|
88
|
+
done <<< "$link_candidates"
|
|
89
|
+
|
|
90
|
+
if [ "$checked" -eq 0 ]; then
|
|
91
|
+
warn "No wiki links found to check"
|
|
92
|
+
elif [ "$dangling" -eq 0 ]; then
|
|
93
|
+
pass "No dangling wiki links (checked $checked unique links)"
|
|
94
|
+
else
|
|
95
|
+
# Dangling links are common in mature vaults (examples, planned notes)
|
|
96
|
+
# Report as info, not failure
|
|
97
|
+
warn "$dangling unresolved wiki links out of $checked unique (may include examples)"
|
|
98
|
+
fi
|
|
99
|
+
|
|
100
|
+
# --- Primitive 3: MOC hierarchy ---
|
|
101
|
+
echo "3. MOC hierarchy for attention management"
|
|
102
|
+
moc_count=$(grep -rl '^type: moc' "$VAULT" --include="*.md" 2>/dev/null | grep -v ".git" | wc -l | tr -d ' ')
|
|
103
|
+
if [ "$moc_count" -eq 0 ]; then
|
|
104
|
+
moc_like=$(grep -rl '## Core Ideas' "$VAULT" --include="*.md" 2>/dev/null | grep -v ".git" | wc -l | tr -d ' ')
|
|
105
|
+
if [ "$moc_like" -gt 0 ]; then
|
|
106
|
+
warn "$moc_like MOC-like files but none declare type: moc"
|
|
107
|
+
else
|
|
108
|
+
fail "No MOCs found"
|
|
109
|
+
fi
|
|
110
|
+
elif [ "$moc_count" -lt 3 ]; then
|
|
111
|
+
warn "$moc_count MOCs (minimum recommended: 3)"
|
|
112
|
+
else
|
|
113
|
+
pass "$moc_count MOCs found"
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
# --- Primitive 4: Tree injection / workspace map ---
|
|
117
|
+
echo "4. Tree injection at session start"
|
|
118
|
+
has_tree=false
|
|
119
|
+
[ -f "$VAULT/.claude/hooks/session-start.sh" ] && has_tree=true
|
|
120
|
+
[ -f "$VAULT/WORKSPACE-MAP.md" ] && has_tree=true
|
|
121
|
+
for ctx in "$VAULT/CLAUDE.md" "$VAULT/AGENTS.md" "$VAULT/SOUL.md"; do
|
|
122
|
+
[ -f "$ctx" ] && grep -qi "tree\|workspace.map\|orient" "$ctx" 2>/dev/null && has_tree=true
|
|
123
|
+
done
|
|
124
|
+
find "$VAULT" -name "session-orient.sh" -not -path "*/.git/*" 2>/dev/null | grep -q . && has_tree=true
|
|
125
|
+
|
|
126
|
+
if $has_tree; then
|
|
127
|
+
pass "Tree injection mechanism found"
|
|
128
|
+
else
|
|
129
|
+
warn "No tree injection mechanism detected"
|
|
130
|
+
fi
|
|
131
|
+
|
|
132
|
+
# --- Primitive 5: Description field ---
|
|
133
|
+
echo "5. Description field for progressive disclosure"
|
|
134
|
+
# Find notes in common locations
|
|
135
|
+
notes_dirs=""
|
|
136
|
+
for d in "notes" "01_thinking" "thinking" "knowledge"; do
|
|
137
|
+
[ -d "$VAULT/$d" ] && notes_dirs="$notes_dirs $VAULT/$d"
|
|
138
|
+
done
|
|
139
|
+
[ -z "$notes_dirs" ] && notes_dirs="$VAULT"
|
|
140
|
+
|
|
141
|
+
desc_count=0
|
|
142
|
+
no_desc=0
|
|
143
|
+
for dir in $notes_dirs; do
|
|
144
|
+
d=$(grep -rl '^description:' "$dir" --include="*.md" -l 2>/dev/null | grep -v ".git" | wc -l | tr -d ' ')
|
|
145
|
+
n=$(find "$dir" -maxdepth 1 -name "*.md" -not -name "README.md" -not -name "SKILL.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
146
|
+
desc_count=$((desc_count + d))
|
|
147
|
+
no_desc=$((no_desc + n - d))
|
|
148
|
+
done
|
|
149
|
+
|
|
150
|
+
total_n=$((desc_count + no_desc))
|
|
151
|
+
if [ "$total_n" -eq 0 ]; then
|
|
152
|
+
warn "No notes found in expected directories"
|
|
153
|
+
elif [ "$no_desc" -le 0 ]; then
|
|
154
|
+
pass "All $desc_count notes have description fields"
|
|
155
|
+
elif [ "$no_desc" -lt "$((total_n / 5 + 1))" ]; then
|
|
156
|
+
warn "$desc_count with descriptions, $no_desc without (< 20% missing)"
|
|
157
|
+
else
|
|
158
|
+
fail "$no_desc of $total_n notes missing description field"
|
|
159
|
+
fi
|
|
160
|
+
|
|
161
|
+
# --- Primitive 6: Topics footer ---
|
|
162
|
+
echo "6. Topics footer linking notes to MOCs"
|
|
163
|
+
topics_count=0
|
|
164
|
+
no_topics=0
|
|
165
|
+
for dir in $notes_dirs; do
|
|
166
|
+
t=$(grep -rl '^topics:' "$dir" --include="*.md" 2>/dev/null | grep -v ".git" | wc -l | tr -d ' ')
|
|
167
|
+
n=$(find "$dir" -maxdepth 1 -name "*.md" -not -name "README.md" -not -name "SKILL.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
168
|
+
topics_count=$((topics_count + t))
|
|
169
|
+
no_topics=$((no_topics + n - t))
|
|
170
|
+
done
|
|
171
|
+
|
|
172
|
+
total_t=$((topics_count + no_topics))
|
|
173
|
+
if [ "$total_t" -eq 0 ]; then
|
|
174
|
+
warn "No notes found in expected directories"
|
|
175
|
+
elif [ "$no_topics" -le 0 ]; then
|
|
176
|
+
pass "All $topics_count notes have topics"
|
|
177
|
+
elif [ "$no_topics" -lt "$((total_t / 5 + 1))" ]; then
|
|
178
|
+
warn "$topics_count with topics, $no_topics without (< 20% missing)"
|
|
179
|
+
else
|
|
180
|
+
fail "$no_topics of $total_t notes missing topics"
|
|
181
|
+
fi
|
|
182
|
+
|
|
183
|
+
# --- Primitive 7: Schema enforcement ---
|
|
184
|
+
echo "7. Schema enforcement via validation"
|
|
185
|
+
has_templates=false
|
|
186
|
+
has_validation=false
|
|
187
|
+
for d in "templates" "04_meta/templates" "_templates"; do
|
|
188
|
+
[ -d "$VAULT/$d" ] && has_templates=true && break
|
|
189
|
+
done
|
|
190
|
+
find "$VAULT" -name "validate-schema.sh" -o -name "validate.sh" -not -path "*/.git/*" 2>/dev/null | grep -q . && has_validation=true
|
|
191
|
+
find "$VAULT" -path "*/validate/SKILL.md" -o -path "*/verify/SKILL.md" 2>/dev/null | grep -q . && has_validation=true
|
|
192
|
+
|
|
193
|
+
if $has_templates && $has_validation; then
|
|
194
|
+
pass "Templates and validation mechanism found"
|
|
195
|
+
elif $has_templates; then
|
|
196
|
+
warn "Templates found but no validation mechanism"
|
|
197
|
+
elif $has_validation; then
|
|
198
|
+
warn "Validation found but no template directory"
|
|
199
|
+
else
|
|
200
|
+
fail "No templates or validation mechanism found"
|
|
201
|
+
fi
|
|
202
|
+
|
|
203
|
+
# --- Primitive 8: Self space (CONFIGURABLE) ---
|
|
204
|
+
echo "8. Self space for agent persistent memory (configurable)"
|
|
205
|
+
# Check for self/ in vault, sibling to vault, or common alternatives
|
|
206
|
+
self_dir=""
|
|
207
|
+
for candidate in "$VAULT/self" "$VAULT/../self" "$VAULT/self/memory"; do
|
|
208
|
+
[ -d "$candidate" ] && self_dir="$candidate" && break
|
|
209
|
+
done
|
|
210
|
+
|
|
211
|
+
if [ -n "$self_dir" ]; then
|
|
212
|
+
self_files=$(find "$self_dir" -name "*.md" 2>/dev/null | wc -l | tr -d ' ')
|
|
213
|
+
has_identity=false; [ -f "$self_dir/identity.md" ] && has_identity=true
|
|
214
|
+
has_methodology=false; [ -f "$self_dir/methodology.md" ] && has_methodology=true
|
|
215
|
+
has_goals=false; [ -f "$self_dir/goals.md" ] && has_goals=true
|
|
216
|
+
|
|
217
|
+
if $has_identity && $has_methodology && $has_goals; then
|
|
218
|
+
pass "self/ with $self_files files (identity, methodology, goals present)"
|
|
219
|
+
elif [ "$self_files" -gt 0 ]; then
|
|
220
|
+
warn "self/ exists with $self_files files but missing some core MOCs"
|
|
221
|
+
else
|
|
222
|
+
warn "self/ directory exists but is empty"
|
|
223
|
+
fi
|
|
224
|
+
else
|
|
225
|
+
# Self space is configurable — check for ops/ fallback
|
|
226
|
+
if [ -f "$VAULT/ops/goals.md" ]; then
|
|
227
|
+
pass "self/ disabled, ops/ fallback in use (ops/goals.md found)"
|
|
228
|
+
elif [ -d "$VAULT/.claude/memory" ] || [ -f "$VAULT/MEMORY.md" ]; then
|
|
229
|
+
warn "Memory mechanism found but no dedicated self/ space"
|
|
230
|
+
else
|
|
231
|
+
warn "No self/ directory found (configurable — off by default for research vaults)"
|
|
232
|
+
fi
|
|
233
|
+
fi
|
|
234
|
+
|
|
235
|
+
# --- Primitive 9: Session rhythm ---
|
|
236
|
+
echo "9. Session rhythm: orient, work, persist"
|
|
237
|
+
has_rhythm=false
|
|
238
|
+
for ctx in "$VAULT/CLAUDE.md" "$VAULT/AGENTS.md" "$VAULT/SOUL.md"; do
|
|
239
|
+
[ -f "$ctx" ] && grep -qi "orient\|session start\|session end\|persist\|session rhythm" "$ctx" 2>/dev/null && has_rhythm=true
|
|
240
|
+
done
|
|
241
|
+
[ -f "$VAULT/.claude/hooks/session-start.sh" ] && has_rhythm=true
|
|
242
|
+
find "$VAULT" -name "session-orient.sh" -not -path "*/.git/*" 2>/dev/null | grep -q . && has_rhythm=true
|
|
243
|
+
|
|
244
|
+
if $has_rhythm; then
|
|
245
|
+
pass "Session rhythm documented or automated"
|
|
246
|
+
else
|
|
247
|
+
warn "No session rhythm pattern found"
|
|
248
|
+
fi
|
|
249
|
+
|
|
250
|
+
# --- Primitive 10: Semantic search (CONFIGURABLE) ---
|
|
251
|
+
echo "10. Semantic search capability (configurable)"
|
|
252
|
+
has_search=false
|
|
253
|
+
[ -f "$VAULT/.mcp.json" ] && grep -q "qmd\|search\|embed" "$VAULT/.mcp.json" 2>/dev/null && has_search=true
|
|
254
|
+
command -v qmd &>/dev/null && has_search=true
|
|
255
|
+
for ctx in "$VAULT/CLAUDE.md" "$VAULT/AGENTS.md" "$VAULT/SOUL.md"; do
|
|
256
|
+
[ -f "$ctx" ] && grep -qi "semantic search\|qmd\|vsearch" "$ctx" 2>/dev/null && has_search=true
|
|
257
|
+
done
|
|
258
|
+
|
|
259
|
+
if $has_search; then
|
|
260
|
+
pass "Semantic search capability found"
|
|
261
|
+
else
|
|
262
|
+
pass "Semantic search not enabled (configurable)"
|
|
263
|
+
fi
|
|
264
|
+
|
|
265
|
+
# --- Primitive 10A: Filesystem graph database (unique-addresses) ---
|
|
266
|
+
echo "10A. Filesystem graph database (unique-addresses)"
|
|
267
|
+
has_graph_scripts=false
|
|
268
|
+
for d in "ops/scripts/graph" "04_meta/scripts/graph" "scripts/graph"; do
|
|
269
|
+
[ -d "$VAULT/$d" ] && has_graph_scripts=true && break
|
|
270
|
+
done
|
|
271
|
+
|
|
272
|
+
if $has_graph_scripts; then
|
|
273
|
+
pass "Graph analysis scripts directory found"
|
|
274
|
+
else
|
|
275
|
+
warn "No ops/scripts/graph/ directory detected"
|
|
276
|
+
fi
|
|
277
|
+
|
|
278
|
+
# --- Primitive 11: Discovery-first quality gate ---
|
|
279
|
+
echo "11. Discovery-first quality gate"
|
|
280
|
+
has_discovery_section=false
|
|
281
|
+
has_discovery_skills=false
|
|
282
|
+
|
|
283
|
+
# Check context files for Discovery-First section
|
|
284
|
+
for ctx in "$VAULT/CLAUDE.md" "$VAULT/AGENTS.md" "$VAULT/SOUL.md"; do
|
|
285
|
+
[ -f "$ctx" ] && grep -qi "discovery.first" "$ctx" 2>/dev/null && has_discovery_section=true
|
|
286
|
+
done
|
|
287
|
+
|
|
288
|
+
# Check skills for discovery checks
|
|
289
|
+
skill_dirs=""
|
|
290
|
+
for d in ".claude/skills" "skills"; do
|
|
291
|
+
[ -d "$VAULT/$d" ] && skill_dirs="$skill_dirs $VAULT/$d"
|
|
292
|
+
done
|
|
293
|
+
if [ -n "$skill_dirs" ]; then
|
|
294
|
+
for dir in $skill_dirs; do
|
|
295
|
+
grep -rqi "discovery\|findability" "$dir" 2>/dev/null && has_discovery_skills=true
|
|
296
|
+
done
|
|
297
|
+
fi
|
|
298
|
+
|
|
299
|
+
if $has_discovery_section && $has_discovery_skills; then
|
|
300
|
+
pass "Discovery-first gate in context file and skills"
|
|
301
|
+
elif $has_discovery_section; then
|
|
302
|
+
warn "Discovery-first in context file but not in skills"
|
|
303
|
+
elif $has_discovery_skills; then
|
|
304
|
+
warn "Discovery checks in skills but no context file section"
|
|
305
|
+
else
|
|
306
|
+
warn "No discovery-first quality gate detected"
|
|
307
|
+
fi
|
|
308
|
+
|
|
309
|
+
# --- Primitive 12: Operational learning loop ---
|
|
310
|
+
echo "12. Operational learning loop"
|
|
311
|
+
has_obs_dir=false
|
|
312
|
+
has_tensions_dir=false
|
|
313
|
+
has_review_trigger=false
|
|
314
|
+
has_rethink=false
|
|
315
|
+
|
|
316
|
+
# Check for ops/observations/ and ops/tensions/ directories (or common variants)
|
|
317
|
+
for candidate in "ops/observations" "04_meta/logs/observations" "logs/observations" "observations"; do
|
|
318
|
+
[ -d "$VAULT/$candidate" ] && has_obs_dir=true && break
|
|
319
|
+
done
|
|
320
|
+
for candidate in "ops/tensions" "04_meta/logs/tensions" "logs/tensions" "tensions"; do
|
|
321
|
+
[ -d "$VAULT/$candidate" ] && has_tensions_dir=true && break
|
|
322
|
+
done
|
|
323
|
+
|
|
324
|
+
# Check context files for review trigger documentation
|
|
325
|
+
for ctx in "$VAULT/CLAUDE.md" "$VAULT/AGENTS.md" "$VAULT/SOUL.md"; do
|
|
326
|
+
[ -f "$ctx" ] && grep -qi "rethink\|review\|observations" "$ctx" 2>/dev/null && has_review_trigger=true
|
|
327
|
+
done
|
|
328
|
+
|
|
329
|
+
# Check for rethink command/skill
|
|
330
|
+
for d in ".claude/skills/rethink" "skills/rethink"; do
|
|
331
|
+
[ -d "$VAULT/$d" ] && has_rethink=true && break
|
|
332
|
+
done
|
|
333
|
+
# Also check for rethink skill files directly
|
|
334
|
+
find "$VAULT" -path "*/rethink/SKILL.md" -not -path "*/.git/*" 2>/dev/null | grep -q . && has_rethink=true
|
|
335
|
+
find "$VAULT" -path "*/rethink.md" -not -path "*/.git/*" 2>/dev/null | grep -q . && has_rethink=true
|
|
336
|
+
|
|
337
|
+
checks_passed=0
|
|
338
|
+
$has_obs_dir && checks_passed=$((checks_passed + 1))
|
|
339
|
+
$has_tensions_dir && checks_passed=$((checks_passed + 1))
|
|
340
|
+
$has_review_trigger && checks_passed=$((checks_passed + 1))
|
|
341
|
+
$has_rethink && checks_passed=$((checks_passed + 1))
|
|
342
|
+
|
|
343
|
+
if [ "$checks_passed" -eq 4 ]; then
|
|
344
|
+
pass "Operational learning loop: observations, tensions, review trigger, rethink mechanism"
|
|
345
|
+
elif [ "$checks_passed" -ge 2 ]; then
|
|
346
|
+
details=""
|
|
347
|
+
$has_obs_dir || details="${details}observations dir, "
|
|
348
|
+
$has_tensions_dir || details="${details}tensions dir, "
|
|
349
|
+
$has_review_trigger || details="${details}review trigger, "
|
|
350
|
+
$has_rethink || details="${details}rethink mechanism, "
|
|
351
|
+
details=$(echo "$details" | sed 's/, $//')
|
|
352
|
+
warn "Partial learning loop ($checks_passed/4). Missing: $details"
|
|
353
|
+
else
|
|
354
|
+
fail "No operational learning loop detected (need observations dir, tensions dir, review trigger, rethink mechanism)"
|
|
355
|
+
fi
|
|
356
|
+
|
|
357
|
+
# --- Primitive 13: Task stack ---
|
|
358
|
+
echo "13. Task stack"
|
|
359
|
+
has_tasks_md=false
|
|
360
|
+
has_queue_file=false
|
|
361
|
+
|
|
362
|
+
# Check for ops/tasks.md or common variants
|
|
363
|
+
for candidate in "ops/tasks.md" "04_meta/tasks/tasks.md"; do
|
|
364
|
+
[ -f "$VAULT/$candidate" ] && has_tasks_md=true && break
|
|
365
|
+
done
|
|
366
|
+
|
|
367
|
+
# Check for queue file (JSON or YAML)
|
|
368
|
+
for candidate in "ops/queue/queue.json" "ops/queue/queue.yaml" "04_meta/tasks/queue.json" "04_meta/tasks/queue.yaml"; do
|
|
369
|
+
[ -f "$VAULT/$candidate" ] && has_queue_file=true && break
|
|
370
|
+
done
|
|
371
|
+
|
|
372
|
+
if $has_tasks_md && $has_queue_file; then
|
|
373
|
+
pass "Task stack: tasks.md and queue file found"
|
|
374
|
+
elif $has_tasks_md; then
|
|
375
|
+
warn "tasks.md found but no queue file"
|
|
376
|
+
elif $has_queue_file; then
|
|
377
|
+
warn "Queue file found but no tasks.md"
|
|
378
|
+
else
|
|
379
|
+
warn "No task stack detected (ops/tasks.md + queue file)"
|
|
380
|
+
fi
|
|
381
|
+
|
|
382
|
+
# --- Primitive 14: Methodology folder ---
|
|
383
|
+
echo "14. Methodology folder"
|
|
384
|
+
has_methodology_dir=false
|
|
385
|
+
has_methodology_moc=false
|
|
386
|
+
|
|
387
|
+
for candidate in "ops/methodology" "04_meta/methodology"; do
|
|
388
|
+
[ -d "$VAULT/$candidate" ] && has_methodology_dir=true
|
|
389
|
+
[ -f "$VAULT/$candidate/methodology.md" ] && has_methodology_moc=true
|
|
390
|
+
$has_methodology_dir && break
|
|
391
|
+
done
|
|
392
|
+
|
|
393
|
+
if $has_methodology_dir && $has_methodology_moc; then
|
|
394
|
+
pass "Methodology folder with methodology.md MOC found"
|
|
395
|
+
elif $has_methodology_dir; then
|
|
396
|
+
warn "ops/methodology/ exists but no methodology.md MOC inside"
|
|
397
|
+
else
|
|
398
|
+
warn "No ops/methodology/ directory detected"
|
|
399
|
+
fi
|
|
400
|
+
|
|
401
|
+
# --- Primitive 15: Session capture ---
|
|
402
|
+
echo "15. Session capture"
|
|
403
|
+
has_sessions_dir=false
|
|
404
|
+
|
|
405
|
+
for candidate in "ops/sessions" "04_meta/sessions" "self/sessions"; do
|
|
406
|
+
[ -d "$VAULT/$candidate" ] && has_sessions_dir=true && break
|
|
407
|
+
done
|
|
408
|
+
|
|
409
|
+
if $has_sessions_dir; then
|
|
410
|
+
pass "Session capture directory found"
|
|
411
|
+
else
|
|
412
|
+
warn "No ops/sessions/ directory detected"
|
|
413
|
+
fi
|
|
414
|
+
|
|
415
|
+
# --- Summary ---
|
|
416
|
+
echo ""
|
|
417
|
+
echo "=== Kernel Validation Summary ==="
|
|
418
|
+
echo -e " ${GREEN}PASS:${NC} $PASS"
|
|
419
|
+
echo -e " ${YELLOW}WARN:${NC} $WARN"
|
|
420
|
+
echo -e " ${RED}FAIL:${NC} $FAIL"
|
|
421
|
+
echo ""
|
|
422
|
+
|
|
423
|
+
if [ "$FAIL" -eq 0 ] && [ "$WARN" -eq 0 ]; then
|
|
424
|
+
echo -e "${GREEN}All 15 primitives validated successfully.${NC}"
|
|
425
|
+
exit 0
|
|
426
|
+
elif [ "$FAIL" -eq 0 ]; then
|
|
427
|
+
echo -e "${YELLOW}Kernel present with warnings. $WARN primitive(s) need attention.${NC}"
|
|
428
|
+
exit 0
|
|
429
|
+
else
|
|
430
|
+
echo -e "${RED}$FAIL kernel primitive(s) missing. System may not function reliably.${NC}"
|
|
431
|
+
exit 1
|
|
432
|
+
fi
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Vocabulary Transformation Reference
|
|
2
|
+
|
|
3
|
+
When generating a knowledge system for a specific domain, every universal term in the generated context file, templates, skills, and self/ files must use the domain-native equivalent. Vocabulary transformation is not cosmetic — it changes how the system feels to use.
|
|
4
|
+
|
|
5
|
+
"Surface patterns in reflections" is therapy work. "Extract claims from sources" is research work. Same structural operation, different cognitive framing.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Universal → Domain Mapping
|
|
10
|
+
|
|
11
|
+
| Universal Term | Research | Therapy | Learning | Relationships | Creative | PM | Companion |
|
|
12
|
+
|---------------|----------|---------|----------|---------------|----------|-----|-----------|
|
|
13
|
+
| note | claim | reflection | concept note | observation | idea | decision | memory |
|
|
14
|
+
| extract / reduce | reduce | surface | break down | notice | discover | document | remember |
|
|
15
|
+
| connect / reflect | reflect | find patterns | relate concepts | trace connections | combine ideas | link decisions | recall together |
|
|
16
|
+
| verify | verify | check resonance | test understanding | confirm accuracy | evaluate draft | review quality | verify memory |
|
|
17
|
+
| MOC | topic map | theme | study guide | relationship map | project hub | decision register | memory collection |
|
|
18
|
+
| description field | claim context | reflection summary | concept explanation | observation context | idea sketch | decision rationale | memory context |
|
|
19
|
+
| topics footer | research areas | themes | study areas | relationship facets | creative projects | project areas | life areas |
|
|
20
|
+
| inbox | capture | journaling | study notes | encounters | inspiration | action items | moments |
|
|
21
|
+
| processing / pipeline | pipeline | reflection cycle | study cycle | relationship review | creative process | review cycle | reminiscence |
|
|
22
|
+
| wiki link | connection | pattern link | concept link | connection | inspiration thread | decision trail | memory link |
|
|
23
|
+
| thinking notes | claims | reflections | concepts | observations | ideas | decisions | memories |
|
|
24
|
+
| archive | processed sources | past reflections | mastered material | past encounters | completed works | closed decisions | past events |
|
|
25
|
+
| self/ space | research identity | reflection partner | study companion | relationship tracker | creative identity | project mind | companion memory |
|
|
26
|
+
| orient | orient | center | review progress | check in | survey ideas | status check | remember |
|
|
27
|
+
| persist | persist | journal | log progress | update records | save state | update status | save memories |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Template Name Mapping
|
|
32
|
+
|
|
33
|
+
| Universal Template | Research | Therapy | Learning | Relationships | Creative | PM | Companion |
|
|
34
|
+
|-------------------|----------|---------|----------|---------------|----------|-----|-----------|
|
|
35
|
+
| base-note.md | thinking-note.md | reflection-note.md | concept-note.md | observation-note.md | idea-note.md | decision-note.md | memory-note.md |
|
|
36
|
+
| moc.md | topic-map.md | theme.md | study-guide.md | relationship-map.md | project-hub.md | decision-register.md | collection.md |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Folder Name Mapping
|
|
41
|
+
|
|
42
|
+
| Universal Folder | Research | Therapy | Learning | Relationships | Creative | PM | Companion |
|
|
43
|
+
|-----------------|----------|---------|----------|---------------|----------|-----|-----------|
|
|
44
|
+
| notes/ | notes/ | reflections/ | concepts/ | observations/ | ideas/ | decisions/ | memories/ |
|
|
45
|
+
| inbox/ | inbox/ | journal/ | study-inbox/ | encounters/ | inspiration/ | action-items/ | moments/ |
|
|
46
|
+
| archive/ | archive/ | past/ | mastered/ | history/ | completed/ | closed/ | past/ |
|
|
47
|
+
| templates/ | templates/ | templates/ | templates/ | templates/ | templates/ | templates/ | templates/ |
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Skill Name Mapping
|
|
52
|
+
|
|
53
|
+
| Universal Skill | Research | Therapy | Learning | Relationships | Creative | PM | Companion |
|
|
54
|
+
|----------------|----------|---------|----------|---------------|----------|-----|-----------|
|
|
55
|
+
| /reduce | /reduce | /surface | /break-down | /notice | /discover | /document | /capture |
|
|
56
|
+
| /reflect | /reflect | /find-patterns | /relate | /trace | /combine | /link | /recall |
|
|
57
|
+
| /verify | /verify | /check-resonance | /test | /confirm | /evaluate | /review | /verify |
|
|
58
|
+
| /reweave | /reweave | /revisit | /revise | /reconnect | /rework | /update | /revisit |
|
|
59
|
+
| /remember | /remember | /note-friction | /flag | /flag | /flag | /flag | /remember |
|
|
60
|
+
| /next | /next | /next | /next | /next | /next | /next | /next |
|
|
61
|
+
| /stats | /stats | /stats | /stats | /stats | /stats | /stats | /stats |
|
|
62
|
+
| /graph | /graph | /graph | /graph | /graph | /graph | /graph | /graph |
|
|
63
|
+
|
|
64
|
+
**Note:** /remember (formerly /friction) captures operational friction with automatic detection in session transcripts. /next (formerly /work + /next) surfaces the next recommended action from the task stack. /stats provides vault metrics and progress visualization. /graph enables graph query generation. These commands use universal names across all domains.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Applying Transformations
|
|
69
|
+
|
|
70
|
+
### In the init wizard (Step 5b):
|
|
71
|
+
|
|
72
|
+
1. Determine the user's use case
|
|
73
|
+
2. Look up all universal terms in the mapping table above
|
|
74
|
+
3. Replace every instance in the generated context file
|
|
75
|
+
4. Replace template names and folder names
|
|
76
|
+
5. Replace skill names if generating skills
|
|
77
|
+
6. **Verify:** Read the generated output. Does it feel natural for the domain? Would a therapy user ever see the word "claim"? Would a PM user see "reduce"?
|
|
78
|
+
|
|
79
|
+
### Quality check:
|
|
80
|
+
|
|
81
|
+
The vocabulary test: read the generated context file as if you were the domain user. Every technical term should feel native to the domain. If any term feels imported from a different discipline, transform it.
|
|
82
|
+
|
|
83
|
+
### Extending the table:
|
|
84
|
+
|
|
85
|
+
For "Custom / Mixed" use cases, the init wizard should ask the user for their preferred vocabulary. Populate a custom column using the universal terms as prompts: "What do you call a single knowledge unit?" → their answer becomes the "note" equivalent.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# sync-thinking.sh
|
|
4
|
+
# Syncs the research graph from the vault into the bundled thinking/ directory.
|
|
5
|
+
# Tracks added/removed/changed files and records the vault's git hash.
|
|
6
|
+
#
|
|
7
|
+
# Usage:
|
|
8
|
+
# ./scripts/sync-thinking.sh # uses default vault path
|
|
9
|
+
# VAULT_PATH=/path/to/vault ./scripts/sync-thinking.sh # custom vault path
|
|
10
|
+
# ./scripts/sync-thinking.sh --dry-run # preview changes without copying
|
|
11
|
+
|
|
12
|
+
set -euo pipefail
|
|
13
|
+
|
|
14
|
+
# --- Configuration ---
|
|
15
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
16
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
17
|
+
VAULT_PATH="${VAULT_PATH:-/Users/jozark/Documents/cornelius/workspace/vault}"
|
|
18
|
+
SOURCE_DIR="$VAULT_PATH/01_thinking"
|
|
19
|
+
DEST_DIR="$PROJECT_ROOT/thinking"
|
|
20
|
+
HASH_FILE="$PROJECT_ROOT/thinking/.vault-sync-hash"
|
|
21
|
+
DRY_RUN=false
|
|
22
|
+
|
|
23
|
+
if [[ "${1:-}" == "--dry-run" ]]; then
|
|
24
|
+
DRY_RUN=true
|
|
25
|
+
echo "=== DRY RUN — no files will be modified ==="
|
|
26
|
+
echo ""
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# --- Validate source ---
|
|
30
|
+
if [[ ! -d "$SOURCE_DIR" ]]; then
|
|
31
|
+
echo "ERROR: Source directory not found: $SOURCE_DIR"
|
|
32
|
+
echo "Set VAULT_PATH to the vault root directory."
|
|
33
|
+
exit 1
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
# --- Ensure destination exists ---
|
|
37
|
+
if [[ "$DRY_RUN" == false ]]; then
|
|
38
|
+
mkdir -p "$DEST_DIR"
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# --- Get vault git hash ---
|
|
42
|
+
VAULT_HASH="(not a git repo)"
|
|
43
|
+
if git -C "$VAULT_PATH" rev-parse --git-dir &>/dev/null; then
|
|
44
|
+
VAULT_HASH=$(git -C "$VAULT_PATH" rev-parse --short HEAD)
|
|
45
|
+
VAULT_DIRTY=""
|
|
46
|
+
if ! git -C "$VAULT_PATH" diff --quiet 2>/dev/null; then
|
|
47
|
+
VAULT_DIRTY="-dirty"
|
|
48
|
+
fi
|
|
49
|
+
VAULT_HASH="${VAULT_HASH}${VAULT_DIRTY}"
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
# --- Previous hash ---
|
|
53
|
+
PREV_HASH="(none)"
|
|
54
|
+
if [[ -f "$HASH_FILE" ]]; then
|
|
55
|
+
PREV_HASH=$(cat "$HASH_FILE")
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
# --- Diff: find added, removed, changed ---
|
|
59
|
+
# Build file lists (basenames only)
|
|
60
|
+
SOURCE_FILES=$(ls -1 "$SOURCE_DIR"/*.md 2>/dev/null | xargs -I{} basename {} | sort)
|
|
61
|
+
DEST_FILES=$(ls -1 "$DEST_DIR"/*.md 2>/dev/null | xargs -I{} basename {} | sort)
|
|
62
|
+
|
|
63
|
+
ADDED=$(comm -23 <(echo "$SOURCE_FILES") <(echo "$DEST_FILES"))
|
|
64
|
+
REMOVED=$(comm -13 <(echo "$SOURCE_FILES") <(echo "$DEST_FILES"))
|
|
65
|
+
COMMON=$(comm -12 <(echo "$SOURCE_FILES") <(echo "$DEST_FILES"))
|
|
66
|
+
|
|
67
|
+
# Check which common files have changed
|
|
68
|
+
CHANGED=""
|
|
69
|
+
CHANGED_COUNT=0
|
|
70
|
+
while IFS= read -r file; do
|
|
71
|
+
[[ -z "$file" ]] && continue
|
|
72
|
+
if ! diff -q "$SOURCE_DIR/$file" "$DEST_DIR/$file" &>/dev/null; then
|
|
73
|
+
CHANGED="${CHANGED}${file}"$'\n'
|
|
74
|
+
((CHANGED_COUNT++))
|
|
75
|
+
fi
|
|
76
|
+
done <<< "$COMMON"
|
|
77
|
+
|
|
78
|
+
if [[ -z "$ADDED" ]]; then
|
|
79
|
+
ADDED_COUNT=0
|
|
80
|
+
else
|
|
81
|
+
ADDED_COUNT=$(echo "$ADDED" | wc -l | tr -d ' ')
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
if [[ -z "$REMOVED" ]]; then
|
|
85
|
+
REMOVED_COUNT=0
|
|
86
|
+
else
|
|
87
|
+
REMOVED_COUNT=$(echo "$REMOVED" | wc -l | tr -d ' ')
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
# --- Report ---
|
|
91
|
+
echo "Sync: vault/01_thinking/ -> thinking/"
|
|
92
|
+
echo "Vault hash: $VAULT_HASH (previous: $PREV_HASH)"
|
|
93
|
+
echo ""
|
|
94
|
+
SOURCE_COUNT=$(echo "$SOURCE_FILES" | wc -l | tr -d ' ')
|
|
95
|
+
DEST_COUNT=$(echo "$DEST_FILES" | wc -l | tr -d ' ')
|
|
96
|
+
echo "Source files: $SOURCE_COUNT"
|
|
97
|
+
echo "Dest files: $DEST_COUNT"
|
|
98
|
+
echo ""
|
|
99
|
+
|
|
100
|
+
if [[ "$ADDED_COUNT" -gt 0 ]]; then
|
|
101
|
+
echo "ADDED ($ADDED_COUNT):"
|
|
102
|
+
echo "$ADDED" | sed 's/^/ + /'
|
|
103
|
+
echo ""
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
if [[ "$REMOVED_COUNT" -gt 0 ]]; then
|
|
107
|
+
echo "REMOVED ($REMOVED_COUNT):"
|
|
108
|
+
echo "$REMOVED" | sed 's/^/ - /'
|
|
109
|
+
echo ""
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
if [[ "$CHANGED_COUNT" -gt 0 ]]; then
|
|
113
|
+
echo "CHANGED ($CHANGED_COUNT):"
|
|
114
|
+
echo "$CHANGED" | grep -v '^$' | sed 's/^/ ~ /'
|
|
115
|
+
echo ""
|
|
116
|
+
fi
|
|
117
|
+
|
|
118
|
+
TOTAL_CHANGES=$((ADDED_COUNT + REMOVED_COUNT + CHANGED_COUNT))
|
|
119
|
+
if [[ "$TOTAL_CHANGES" -eq 0 ]]; then
|
|
120
|
+
echo "No changes detected. Already in sync."
|
|
121
|
+
exit 0
|
|
122
|
+
fi
|
|
123
|
+
|
|
124
|
+
echo "Total changes: $TOTAL_CHANGES"
|
|
125
|
+
echo ""
|
|
126
|
+
|
|
127
|
+
# --- Apply changes ---
|
|
128
|
+
if [[ "$DRY_RUN" == true ]]; then
|
|
129
|
+
echo "Dry run complete. Re-run without --dry-run to apply."
|
|
130
|
+
exit 0
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
# Copy all source files (overwrites changed, adds new)
|
|
134
|
+
cp "$SOURCE_DIR"/*.md "$DEST_DIR/"
|
|
135
|
+
|
|
136
|
+
# Remove files that no longer exist in source
|
|
137
|
+
while IFS= read -r file; do
|
|
138
|
+
[[ -z "$file" ]] && continue
|
|
139
|
+
rm "$DEST_DIR/$file"
|
|
140
|
+
echo "Removed: $file"
|
|
141
|
+
done <<< "$REMOVED"
|
|
142
|
+
|
|
143
|
+
# Record vault hash
|
|
144
|
+
echo "$VAULT_HASH" > "$HASH_FILE"
|
|
145
|
+
|
|
146
|
+
FINAL_COUNT=$(ls -1 "$DEST_DIR"/*.md 2>/dev/null | wc -l | tr -d ' ')
|
|
147
|
+
echo "Sync complete. $FINAL_COUNT files in thinking/. Vault hash: $VAULT_HASH"
|