@isaacriehm/cairn-core 0.1.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/LICENSE +21 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/claude/error.d.ts +33 -0
- package/dist/claude/error.js +58 -0
- package/dist/claude/error.js.map +1 -0
- package/dist/claude/index.d.ts +3 -0
- package/dist/claude/index.js +3 -0
- package/dist/claude/index.js.map +1 -0
- package/dist/claude/runner.d.ts +11 -0
- package/dist/claude/runner.js +132 -0
- package/dist/claude/runner.js.map +1 -0
- package/dist/claude/types.d.ts +52 -0
- package/dist/claude/types.js +14 -0
- package/dist/claude/types.js.map +1 -0
- package/dist/context/checkpoint.d.ts +10 -0
- package/dist/context/checkpoint.js +29 -0
- package/dist/context/checkpoint.js.map +1 -0
- package/dist/context/handoff-builder.d.ts +11 -0
- package/dist/context/handoff-builder.js +268 -0
- package/dist/context/handoff-builder.js.map +1 -0
- package/dist/context/index.d.ts +11 -0
- package/dist/context/index.js +11 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/spec-delta.d.ts +47 -0
- package/dist/context/spec-delta.js +237 -0
- package/dist/context/spec-delta.js.map +1 -0
- package/dist/decision-capture/capture.d.ts +57 -0
- package/dist/decision-capture/capture.js +186 -0
- package/dist/decision-capture/capture.js.map +1 -0
- package/dist/decision-capture/extractor.d.ts +20 -0
- package/dist/decision-capture/extractor.js +103 -0
- package/dist/decision-capture/extractor.js.map +1 -0
- package/dist/decision-capture/id.d.ts +21 -0
- package/dist/decision-capture/id.js +60 -0
- package/dist/decision-capture/id.js.map +1 -0
- package/dist/decision-capture/index.d.ts +25 -0
- package/dist/decision-capture/index.js +21 -0
- package/dist/decision-capture/index.js.map +1 -0
- package/dist/decision-capture/prompt.d.ts +15 -0
- package/dist/decision-capture/prompt.js +68 -0
- package/dist/decision-capture/prompt.js.map +1 -0
- package/dist/decision-capture/refinement-prompt.d.ts +25 -0
- package/dist/decision-capture/refinement-prompt.js +146 -0
- package/dist/decision-capture/refinement-prompt.js.map +1 -0
- package/dist/decision-capture/refinement-schema.d.ts +52 -0
- package/dist/decision-capture/refinement-schema.js +61 -0
- package/dist/decision-capture/refinement-schema.js.map +1 -0
- package/dist/decision-capture/refinement.d.ts +60 -0
- package/dist/decision-capture/refinement.js +439 -0
- package/dist/decision-capture/refinement.js.map +1 -0
- package/dist/decision-capture/schema.d.ts +70 -0
- package/dist/decision-capture/schema.js +71 -0
- package/dist/decision-capture/schema.js.map +1 -0
- package/dist/decision-capture/types.d.ts +201 -0
- package/dist/decision-capture/types.js +20 -0
- package/dist/decision-capture/types.js.map +1 -0
- package/dist/decision-capture/writer.d.ts +90 -0
- package/dist/decision-capture/writer.js +267 -0
- package/dist/decision-capture/writer.js.map +1 -0
- package/dist/doctor/index.d.ts +48 -0
- package/dist/doctor/index.js +460 -0
- package/dist/doctor/index.js.map +1 -0
- package/dist/events/index.d.ts +15 -0
- package/dist/events/index.js +14 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/paths.d.ts +2 -0
- package/dist/events/paths.js +6 -0
- package/dist/events/paths.js.map +1 -0
- package/dist/events/reader.d.ts +40 -0
- package/dist/events/reader.js +139 -0
- package/dist/events/reader.js.map +1 -0
- package/dist/events/writer.d.ts +61 -0
- package/dist/events/writer.js +68 -0
- package/dist/events/writer.js.map +1 -0
- package/dist/frontend-types.d.ts +243 -0
- package/dist/frontend-types.js +15 -0
- package/dist/frontend-types.js.map +1 -0
- package/dist/gc/apply.d.ts +26 -0
- package/dist/gc/apply.js +48 -0
- package/dist/gc/apply.js.map +1 -0
- package/dist/gc/canary.d.ts +42 -0
- package/dist/gc/canary.js +134 -0
- package/dist/gc/canary.js.map +1 -0
- package/dist/gc/citation-integrity.d.ts +24 -0
- package/dist/gc/citation-integrity.js +151 -0
- package/dist/gc/citation-integrity.js.map +1 -0
- package/dist/gc/classify.d.ts +25 -0
- package/dist/gc/classify.js +89 -0
- package/dist/gc/classify.js.map +1 -0
- package/dist/gc/completion-integrity.d.ts +22 -0
- package/dist/gc/completion-integrity.js +165 -0
- package/dist/gc/completion-integrity.js.map +1 -0
- package/dist/gc/doc-gardening.d.ts +29 -0
- package/dist/gc/doc-gardening.js +146 -0
- package/dist/gc/doc-gardening.js.map +1 -0
- package/dist/gc/frontmatter.d.ts +35 -0
- package/dist/gc/frontmatter.js +105 -0
- package/dist/gc/frontmatter.js.map +1 -0
- package/dist/gc/generator-drift.d.ts +28 -0
- package/dist/gc/generator-drift.js +53 -0
- package/dist/gc/generator-drift.js.map +1 -0
- package/dist/gc/index.d.ts +42 -0
- package/dist/gc/index.js +30 -0
- package/dist/gc/index.js.map +1 -0
- package/dist/gc/quality-update.d.ts +23 -0
- package/dist/gc/quality-update.js +69 -0
- package/dist/gc/quality-update.js.map +1 -0
- package/dist/gc/scope-coverage.d.ts +20 -0
- package/dist/gc/scope-coverage.js +70 -0
- package/dist/gc/scope-coverage.js.map +1 -0
- package/dist/gc/stub-hits.d.ts +31 -0
- package/dist/gc/stub-hits.js +78 -0
- package/dist/gc/stub-hits.js.map +1 -0
- package/dist/gc/sweep.d.ts +56 -0
- package/dist/gc/sweep.js +205 -0
- package/dist/gc/sweep.js.map +1 -0
- package/dist/gc/types.d.ts +129 -0
- package/dist/gc/types.js +26 -0
- package/dist/gc/types.js.map +1 -0
- package/dist/gc/walk-source.d.ts +14 -0
- package/dist/gc/walk-source.js +59 -0
- package/dist/gc/walk-source.js.map +1 -0
- package/dist/ground/drift.d.ts +8 -0
- package/dist/ground/drift.js +23 -0
- package/dist/ground/drift.js.map +1 -0
- package/dist/ground/frontmatter.d.ts +20 -0
- package/dist/ground/frontmatter.js +49 -0
- package/dist/ground/frontmatter.js.map +1 -0
- package/dist/ground/glob.d.ts +10 -0
- package/dist/ground/glob.js +46 -0
- package/dist/ground/glob.js.map +1 -0
- package/dist/ground/index.d.ts +16 -0
- package/dist/ground/index.js +11 -0
- package/dist/ground/index.js.map +1 -0
- package/dist/ground/ledgers.d.ts +18 -0
- package/dist/ground/ledgers.js +103 -0
- package/dist/ground/ledgers.js.map +1 -0
- package/dist/ground/manifest.d.ts +10 -0
- package/dist/ground/manifest.js +88 -0
- package/dist/ground/manifest.js.map +1 -0
- package/dist/ground/paths.d.ts +20 -0
- package/dist/ground/paths.js +61 -0
- package/dist/ground/paths.js.map +1 -0
- package/dist/ground/quality-grades.d.ts +11 -0
- package/dist/ground/quality-grades.js +98 -0
- package/dist/ground/quality-grades.js.map +1 -0
- package/dist/ground/schemas.d.ts +306 -0
- package/dist/ground/schemas.js +188 -0
- package/dist/ground/schemas.js.map +1 -0
- package/dist/ground/scope-index.d.ts +48 -0
- package/dist/ground/scope-index.js +120 -0
- package/dist/ground/scope-index.js.map +1 -0
- package/dist/ground/walk.d.ts +7 -0
- package/dist/ground/walk.js +53 -0
- package/dist/ground/walk.js.map +1 -0
- package/dist/hooks/bypass-detection.d.ts +28 -0
- package/dist/hooks/bypass-detection.js +106 -0
- package/dist/hooks/bypass-detection.js.map +1 -0
- package/dist/hooks/index.d.ts +12 -0
- package/dist/hooks/index.js +13 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/post-tool-use/allowlist-reader.d.ts +14 -0
- package/dist/hooks/post-tool-use/allowlist-reader.js +69 -0
- package/dist/hooks/post-tool-use/allowlist-reader.js.map +1 -0
- package/dist/hooks/post-tool-use/citation-scanner.d.ts +23 -0
- package/dist/hooks/post-tool-use/citation-scanner.js +59 -0
- package/dist/hooks/post-tool-use/citation-scanner.js.map +1 -0
- package/dist/hooks/post-tool-use/copy-scanner.d.ts +25 -0
- package/dist/hooks/post-tool-use/copy-scanner.js +192 -0
- package/dist/hooks/post-tool-use/copy-scanner.js.map +1 -0
- package/dist/hooks/post-tool-use/index.d.ts +19 -0
- package/dist/hooks/post-tool-use/index.js +15 -0
- package/dist/hooks/post-tool-use/index.js.map +1 -0
- package/dist/hooks/post-tool-use/ledger-cache.d.ts +32 -0
- package/dist/hooks/post-tool-use/ledger-cache.js +236 -0
- package/dist/hooks/post-tool-use/ledger-cache.js.map +1 -0
- package/dist/hooks/post-tool-use/legend-builder.d.ts +15 -0
- package/dist/hooks/post-tool-use/legend-builder.js +84 -0
- package/dist/hooks/post-tool-use/legend-builder.js.map +1 -0
- package/dist/hooks/post-tool-use/read-enricher.d.ts +13 -0
- package/dist/hooks/post-tool-use/read-enricher.js +157 -0
- package/dist/hooks/post-tool-use/read-enricher.js.map +1 -0
- package/dist/hooks/post-tool-use/write-guardian.d.ts +17 -0
- package/dist/hooks/post-tool-use/write-guardian.js +176 -0
- package/dist/hooks/post-tool-use/write-guardian.js.map +1 -0
- package/dist/hooks/read-enrich.d.ts +6 -0
- package/dist/hooks/read-enrich.js +11 -0
- package/dist/hooks/read-enrich.js.map +1 -0
- package/dist/hooks/runners/index.d.ts +12 -0
- package/dist/hooks/runners/index.js +11 -0
- package/dist/hooks/runners/index.js.map +1 -0
- package/dist/hooks/runners/payload.d.ts +32 -0
- package/dist/hooks/runners/payload.js +70 -0
- package/dist/hooks/runners/payload.js.map +1 -0
- package/dist/hooks/runners/session-end.d.ts +7 -0
- package/dist/hooks/runners/session-end.js +42 -0
- package/dist/hooks/runners/session-end.js.map +1 -0
- package/dist/hooks/runners/session-start.d.ts +10 -0
- package/dist/hooks/runners/session-start.js +167 -0
- package/dist/hooks/runners/session-start.js.map +1 -0
- package/dist/hooks/runners/stop.d.ts +18 -0
- package/dist/hooks/runners/stop.js +165 -0
- package/dist/hooks/runners/stop.js.map +1 -0
- package/dist/hooks/session-end.d.ts +5 -0
- package/dist/hooks/session-end.js +10 -0
- package/dist/hooks/session-end.js.map +1 -0
- package/dist/hooks/session-start.d.ts +7 -0
- package/dist/hooks/session-start.js +12 -0
- package/dist/hooks/session-start.js.map +1 -0
- package/dist/hooks/stop.d.ts +5 -0
- package/dist/hooks/stop.js +10 -0
- package/dist/hooks/stop.js.map +1 -0
- package/dist/hooks/write-guard.d.ts +6 -0
- package/dist/hooks/write-guard.js +11 -0
- package/dist/hooks/write-guard.js.map +1 -0
- package/dist/inbox.d.ts +17 -0
- package/dist/inbox.js +30 -0
- package/dist/inbox.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/init/baseline-audit.d.ts +71 -0
- package/dist/init/baseline-audit.js +377 -0
- package/dist/init/baseline-audit.js.map +1 -0
- package/dist/init/brand-setup.d.ts +44 -0
- package/dist/init/brand-setup.js +201 -0
- package/dist/init/brand-setup.js.map +1 -0
- package/dist/init/daemon-autostart.d.ts +16 -0
- package/dist/init/daemon-autostart.js +95 -0
- package/dist/init/daemon-autostart.js.map +1 -0
- package/dist/init/detect.d.ts +25 -0
- package/dist/init/detect.js +319 -0
- package/dist/init/detect.js.map +1 -0
- package/dist/init/index.d.ts +32 -0
- package/dist/init/index.js +18 -0
- package/dist/init/index.js.map +1 -0
- package/dist/init/ingest-docs.d.ts +74 -0
- package/dist/init/ingest-docs.js +499 -0
- package/dist/init/ingest-docs.js.map +1 -0
- package/dist/init/init.d.ts +165 -0
- package/dist/init/init.js +1166 -0
- package/dist/init/init.js.map +1 -0
- package/dist/init/mapper-legacy.d.ts +148 -0
- package/dist/init/mapper-legacy.js +238 -0
- package/dist/init/mapper-legacy.js.map +1 -0
- package/dist/init/mapper-merge.d.ts +38 -0
- package/dist/init/mapper-merge.js +238 -0
- package/dist/init/mapper-merge.js.map +1 -0
- package/dist/init/mapper-parallel.d.ts +48 -0
- package/dist/init/mapper-parallel.js +409 -0
- package/dist/init/mapper-parallel.js.map +1 -0
- package/dist/init/mapper-prompts.d.ts +135 -0
- package/dist/init/mapper-prompts.js +189 -0
- package/dist/init/mapper-prompts.js.map +1 -0
- package/dist/init/mapper.d.ts +211 -0
- package/dist/init/mapper.js +151 -0
- package/dist/init/mapper.js.map +1 -0
- package/dist/init/module-slicer.d.ts +39 -0
- package/dist/init/module-slicer.js +809 -0
- package/dist/init/module-slicer.js.map +1 -0
- package/dist/init/multi-dev/index.d.ts +2 -0
- package/dist/init/multi-dev/index.js +2 -0
- package/dist/init/multi-dev/index.js.map +1 -0
- package/dist/init/multi-dev/install.d.ts +40 -0
- package/dist/init/multi-dev/install.js +139 -0
- package/dist/init/multi-dev/install.js.map +1 -0
- package/dist/init/preflight-guards.d.ts +42 -0
- package/dist/init/preflight-guards.js +108 -0
- package/dist/init/preflight-guards.js.map +1 -0
- package/dist/init/prompts.d.ts +61 -0
- package/dist/init/prompts.js +66 -0
- package/dist/init/prompts.js.map +1 -0
- package/dist/init/rules-merge/discover.d.ts +21 -0
- package/dist/init/rules-merge/discover.js +78 -0
- package/dist/init/rules-merge/discover.js.map +1 -0
- package/dist/init/rules-merge/index.d.ts +10 -0
- package/dist/init/rules-merge/index.js +6 -0
- package/dist/init/rules-merge/index.js.map +1 -0
- package/dist/init/rules-merge/ingest.d.ts +56 -0
- package/dist/init/rules-merge/ingest.js +336 -0
- package/dist/init/rules-merge/ingest.js.map +1 -0
- package/dist/init/rules-merge/keep-markers.d.ts +39 -0
- package/dist/init/rules-merge/keep-markers.js +97 -0
- package/dist/init/rules-merge/keep-markers.js.map +1 -0
- package/dist/init/rules-merge/parse-sections.d.ts +24 -0
- package/dist/init/rules-merge/parse-sections.js +71 -0
- package/dist/init/rules-merge/parse-sections.js.map +1 -0
- package/dist/init/rules-merge/regenerate.d.ts +33 -0
- package/dist/init/rules-merge/regenerate.js +163 -0
- package/dist/init/rules-merge/regenerate.js.map +1 -0
- package/dist/init/secrets.d.ts +18 -0
- package/dist/init/secrets.js +76 -0
- package/dist/init/secrets.js.map +1 -0
- package/dist/init/seed.d.ts +21 -0
- package/dist/init/seed.js +96 -0
- package/dist/init/seed.js.map +1 -0
- package/dist/init/setup-runners.d.ts +15 -0
- package/dist/init/setup-runners.js +143 -0
- package/dist/init/setup-runners.js.map +1 -0
- package/dist/init/source-comments/classify.d.ts +98 -0
- package/dist/init/source-comments/classify.js +244 -0
- package/dist/init/source-comments/classify.js.map +1 -0
- package/dist/init/source-comments/index.d.ts +8 -0
- package/dist/init/source-comments/index.js +5 -0
- package/dist/init/source-comments/index.js.map +1 -0
- package/dist/init/source-comments/ingest.d.ts +51 -0
- package/dist/init/source-comments/ingest.js +236 -0
- package/dist/init/source-comments/ingest.js.map +1 -0
- package/dist/init/source-comments/strip-replace.d.ts +106 -0
- package/dist/init/source-comments/strip-replace.js +284 -0
- package/dist/init/source-comments/strip-replace.js.map +1 -0
- package/dist/init/source-comments/walker.d.ts +65 -0
- package/dist/init/source-comments/walker.js +777 -0
- package/dist/init/source-comments/walker.js.map +1 -0
- package/dist/init/submodules.d.ts +48 -0
- package/dist/init/submodules.js +149 -0
- package/dist/init/submodules.js.map +1 -0
- package/dist/init/types.d.ts +55 -0
- package/dist/init/types.js +10 -0
- package/dist/init/types.js.map +1 -0
- package/dist/init/visual.d.ts +69 -0
- package/dist/init/visual.js +265 -0
- package/dist/init/visual.js.map +1 -0
- package/dist/init/walker.d.ts +82 -0
- package/dist/init/walker.js +585 -0
- package/dist/init/walker.js.map +1 -0
- package/dist/init/workflow-block.d.ts +34 -0
- package/dist/init/workflow-block.js +110 -0
- package/dist/init/workflow-block.js.map +1 -0
- package/dist/join/index.d.ts +67 -0
- package/dist/join/index.js +256 -0
- package/dist/join/index.js.map +1 -0
- package/dist/lock.d.ts +39 -0
- package/dist/lock.js +129 -0
- package/dist/lock.js.map +1 -0
- package/dist/logger.d.ts +13 -0
- package/dist/logger.js +78 -0
- package/dist/logger.js.map +1 -0
- package/dist/mcp/bootstrap-guard.d.ts +29 -0
- package/dist/mcp/bootstrap-guard.js +47 -0
- package/dist/mcp/bootstrap-guard.js.map +1 -0
- package/dist/mcp/context.d.ts +23 -0
- package/dist/mcp/context.js +9 -0
- package/dist/mcp/context.js.map +1 -0
- package/dist/mcp/errors.d.ts +17 -0
- package/dist/mcp/errors.js +23 -0
- package/dist/mcp/errors.js.map +1 -0
- package/dist/mcp/history/index.d.ts +6 -0
- package/dist/mcp/history/index.js +5 -0
- package/dist/mcp/history/index.js.map +1 -0
- package/dist/mcp/history/prompt.d.ts +32 -0
- package/dist/mcp/history/prompt.js +99 -0
- package/dist/mcp/history/prompt.js.map +1 -0
- package/dist/mcp/history/schema.d.ts +58 -0
- package/dist/mcp/history/schema.js +41 -0
- package/dist/mcp/history/schema.js.map +1 -0
- package/dist/mcp/history/summarizer.d.ts +81 -0
- package/dist/mcp/history/summarizer.js +196 -0
- package/dist/mcp/history/summarizer.js.map +1 -0
- package/dist/mcp/history/walker.d.ts +57 -0
- package/dist/mcp/history/walker.js +156 -0
- package/dist/mcp/history/walker.js.map +1 -0
- package/dist/mcp/index.d.ts +13 -0
- package/dist/mcp/index.js +9 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/path-allowlist.d.ts +29 -0
- package/dist/mcp/path-allowlist.js +71 -0
- package/dist/mcp/path-allowlist.js.map +1 -0
- package/dist/mcp/result.d.ts +8 -0
- package/dist/mcp/result.js +18 -0
- package/dist/mcp/result.js.map +1 -0
- package/dist/mcp/schemas.d.ts +192 -0
- package/dist/mcp/schemas.js +174 -0
- package/dist/mcp/schemas.js.map +1 -0
- package/dist/mcp/serve.d.ts +15 -0
- package/dist/mcp/serve.js +71 -0
- package/dist/mcp/serve.js.map +1 -0
- package/dist/mcp/server.d.ts +11 -0
- package/dist/mcp/server.js +58 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/telemetry.d.ts +15 -0
- package/dist/mcp/telemetry.js +13 -0
- package/dist/mcp/telemetry.js.map +1 -0
- package/dist/mcp/tools/append-run-note.d.ts +18 -0
- package/dist/mcp/tools/append-run-note.js +47 -0
- package/dist/mcp/tools/append-run-note.js.map +1 -0
- package/dist/mcp/tools/append.d.ts +8 -0
- package/dist/mcp/tools/append.js +37 -0
- package/dist/mcp/tools/append.js.map +1 -0
- package/dist/mcp/tools/archive.d.ts +8 -0
- package/dist/mcp/tools/archive.js +72 -0
- package/dist/mcp/tools/archive.js.map +1 -0
- package/dist/mcp/tools/ask-operator.d.ts +34 -0
- package/dist/mcp/tools/ask-operator.js +97 -0
- package/dist/mcp/tools/ask-operator.js.map +1 -0
- package/dist/mcp/tools/canonical-for-topic.d.ts +6 -0
- package/dist/mcp/tools/canonical-for-topic.js +40 -0
- package/dist/mcp/tools/canonical-for-topic.js.map +1 -0
- package/dist/mcp/tools/decision-get.d.ts +6 -0
- package/dist/mcp/tools/decision-get.js +49 -0
- package/dist/mcp/tools/decision-get.js.map +1 -0
- package/dist/mcp/tools/decisions-for-symbol.d.ts +7 -0
- package/dist/mcp/tools/decisions-for-symbol.js +42 -0
- package/dist/mcp/tools/decisions-for-symbol.js.map +1 -0
- package/dist/mcp/tools/decisions-in-scope.d.ts +7 -0
- package/dist/mcp/tools/decisions-in-scope.js +47 -0
- package/dist/mcp/tools/decisions-in-scope.js.map +1 -0
- package/dist/mcp/tools/drop-task.d.ts +12 -0
- package/dist/mcp/tools/drop-task.js +68 -0
- package/dist/mcp/tools/drop-task.js.map +1 -0
- package/dist/mcp/tools/get-full.d.ts +7 -0
- package/dist/mcp/tools/get-full.js +46 -0
- package/dist/mcp/tools/get-full.js.map +1 -0
- package/dist/mcp/tools/ground-get.d.ts +7 -0
- package/dist/mcp/tools/ground-get.js +77 -0
- package/dist/mcp/tools/ground-get.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +3 -0
- package/dist/mcp/tools/index.js +40 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/invariant-get.d.ts +6 -0
- package/dist/mcp/tools/invariant-get.js +49 -0
- package/dist/mcp/tools/invariant-get.js.map +1 -0
- package/dist/mcp/tools/invariants-in-scope.d.ts +7 -0
- package/dist/mcp/tools/invariants-in-scope.js +62 -0
- package/dist/mcp/tools/invariants-in-scope.js.map +1 -0
- package/dist/mcp/tools/query-history.d.ts +20 -0
- package/dist/mcp/tools/query-history.js +51 -0
- package/dist/mcp/tools/query-history.js.map +1 -0
- package/dist/mcp/tools/record-decision.d.ts +14 -0
- package/dist/mcp/tools/record-decision.js +98 -0
- package/dist/mcp/tools/record-decision.js.map +1 -0
- package/dist/mcp/tools/record-run-event.d.ts +10 -0
- package/dist/mcp/tools/record-run-event.js +32 -0
- package/dist/mcp/tools/record-run-event.js.map +1 -0
- package/dist/mcp/tools/resolve-attention.d.ts +31 -0
- package/dist/mcp/tools/resolve-attention.js +191 -0
- package/dist/mcp/tools/resolve-attention.js.map +1 -0
- package/dist/mcp/tools/search.d.ts +9 -0
- package/dist/mcp/tools/search.js +164 -0
- package/dist/mcp/tools/search.js.map +1 -0
- package/dist/mcp/tools/supersedes-chain.d.ts +6 -0
- package/dist/mcp/tools/supersedes-chain.js +66 -0
- package/dist/mcp/tools/supersedes-chain.js.map +1 -0
- package/dist/mcp/tools/timeline.d.ts +9 -0
- package/dist/mcp/tools/timeline.js +65 -0
- package/dist/mcp/tools/timeline.js.map +1 -0
- package/dist/mcp/tools/types.d.ts +9 -0
- package/dist/mcp/tools/types.js +2 -0
- package/dist/mcp/tools/types.js.map +1 -0
- package/dist/mirror/clone.d.ts +6 -0
- package/dist/mirror/clone.js +48 -0
- package/dist/mirror/clone.js.map +1 -0
- package/dist/mirror/dirty-overlap.d.ts +13 -0
- package/dist/mirror/dirty-overlap.js +42 -0
- package/dist/mirror/dirty-overlap.js.map +1 -0
- package/dist/mirror/index.d.ts +7 -0
- package/dist/mirror/index.js +7 -0
- package/dist/mirror/index.js.map +1 -0
- package/dist/mirror/paths.d.ts +18 -0
- package/dist/mirror/paths.js +45 -0
- package/dist/mirror/paths.js.map +1 -0
- package/dist/mirror/push.d.ts +9 -0
- package/dist/mirror/push.js +27 -0
- package/dist/mirror/push.js.map +1 -0
- package/dist/mirror/state.d.ts +4 -0
- package/dist/mirror/state.js +36 -0
- package/dist/mirror/state.js.map +1 -0
- package/dist/mirror/sync.d.ts +9 -0
- package/dist/mirror/sync.js +33 -0
- package/dist/mirror/sync.js.map +1 -0
- package/dist/mirror/types.d.ts +77 -0
- package/dist/mirror/types.js +2 -0
- package/dist/mirror/types.js.map +1 -0
- package/dist/paths/index.d.ts +23 -0
- package/dist/paths/index.js +50 -0
- package/dist/paths/index.js.map +1 -0
- package/dist/profiles/index.d.ts +3 -0
- package/dist/profiles/index.js +3 -0
- package/dist/profiles/index.js.map +1 -0
- package/dist/profiles/registry.d.ts +5 -0
- package/dist/profiles/registry.js +31 -0
- package/dist/profiles/registry.js.map +1 -0
- package/dist/profiles/types.d.ts +48 -0
- package/dist/profiles/types.js +11 -0
- package/dist/profiles/types.js.map +1 -0
- package/dist/profiles/unknown.d.ts +9 -0
- package/dist/profiles/unknown.js +17 -0
- package/dist/profiles/unknown.js.map +1 -0
- package/dist/prompt.d.ts +19 -0
- package/dist/prompt.js +50 -0
- package/dist/prompt.js.map +1 -0
- package/dist/sensors/attestation.d.ts +44 -0
- package/dist/sensors/attestation.js +262 -0
- package/dist/sensors/attestation.js.map +1 -0
- package/dist/sensors/catalog.d.ts +41 -0
- package/dist/sensors/catalog.js +123 -0
- package/dist/sensors/catalog.js.map +1 -0
- package/dist/sensors/decisions.d.ts +30 -0
- package/dist/sensors/decisions.js +393 -0
- package/dist/sensors/decisions.js.map +1 -0
- package/dist/sensors/diff.d.ts +27 -0
- package/dist/sensors/diff.js +148 -0
- package/dist/sensors/diff.js.map +1 -0
- package/dist/sensors/index.d.ts +13 -0
- package/dist/sensors/index.js +9 -0
- package/dist/sensors/index.js.map +1 -0
- package/dist/sensors/remediation.d.ts +20 -0
- package/dist/sensors/remediation.js +65 -0
- package/dist/sensors/remediation.js.map +1 -0
- package/dist/sensors/runner.d.ts +44 -0
- package/dist/sensors/runner.js +95 -0
- package/dist/sensors/runner.js.map +1 -0
- package/dist/sensors/structural.d.ts +30 -0
- package/dist/sensors/structural.js +204 -0
- package/dist/sensors/structural.js.map +1 -0
- package/dist/sensors/stub-catalog.d.ts +39 -0
- package/dist/sensors/stub-catalog.js +115 -0
- package/dist/sensors/stub-catalog.js.map +1 -0
- package/dist/sensors/types.d.ts +135 -0
- package/dist/sensors/types.js +14 -0
- package/dist/sensors/types.js.map +1 -0
- package/dist/session/events-marker.d.ts +39 -0
- package/dist/session/events-marker.js +74 -0
- package/dist/session/events-marker.js.map +1 -0
- package/dist/session/id.d.ts +83 -0
- package/dist/session/id.js +166 -0
- package/dist/session/id.js.map +1 -0
- package/dist/session/index.d.ts +14 -0
- package/dist/session/index.js +13 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session-start/build.d.ts +53 -0
- package/dist/session-start/build.js +645 -0
- package/dist/session-start/build.js.map +1 -0
- package/dist/session-start/index.d.ts +18 -0
- package/dist/session-start/index.js +18 -0
- package/dist/session-start/index.js.map +1 -0
- package/dist/session-start/templates.d.ts +6 -0
- package/dist/session-start/templates.js +38 -0
- package/dist/session-start/templates.js.map +1 -0
- package/dist/status-line/format.d.ts +14 -0
- package/dist/status-line/format.js +40 -0
- package/dist/status-line/format.js.map +1 -0
- package/dist/status-line/index.d.ts +29 -0
- package/dist/status-line/index.js +14 -0
- package/dist/status-line/index.js.map +1 -0
- package/dist/status-line/reader.d.ts +13 -0
- package/dist/status-line/reader.js +76 -0
- package/dist/status-line/reader.js.map +1 -0
- package/dist/status-line/writer.d.ts +33 -0
- package/dist/status-line/writer.js +72 -0
- package/dist/status-line/writer.js.map +1 -0
- package/dist/tier0/classify.d.ts +10 -0
- package/dist/tier0/classify.js +110 -0
- package/dist/tier0/classify.js.map +1 -0
- package/dist/tier0/index.d.ts +2 -0
- package/dist/tier0/index.js +2 -0
- package/dist/tier0/index.js.map +1 -0
- package/dist/tier0/ollama.d.ts +22 -0
- package/dist/tier0/ollama.js +63 -0
- package/dist/tier0/ollama.js.map +1 -0
- package/dist/tier0/types.d.ts +24 -0
- package/dist/tier0/types.js +9 -0
- package/dist/tier0/types.js.map +1 -0
- package/dist/tightener/index.d.ts +4 -0
- package/dist/tightener/index.js +4 -0
- package/dist/tightener/index.js.map +1 -0
- package/dist/tightener/prompt.d.ts +3 -0
- package/dist/tightener/prompt.js +67 -0
- package/dist/tightener/prompt.js.map +1 -0
- package/dist/tightener/schema.d.ts +68 -0
- package/dist/tightener/schema.js +44 -0
- package/dist/tightener/schema.js.map +1 -0
- package/dist/tightener/tighten.d.ts +2 -0
- package/dist/tightener/tighten.js +66 -0
- package/dist/tightener/tighten.js.map +1 -0
- package/dist/tightener/types.d.ts +74 -0
- package/dist/tightener/types.js +6 -0
- package/dist/tightener/types.js.map +1 -0
- package/dist/voice/index.d.ts +4 -0
- package/dist/voice/index.js +4 -0
- package/dist/voice/index.js.map +1 -0
- package/dist/voice/model.d.ts +23 -0
- package/dist/voice/model.js +46 -0
- package/dist/voice/model.js.map +1 -0
- package/dist/voice/pipe.d.ts +9 -0
- package/dist/voice/pipe.js +47 -0
- package/dist/voice/pipe.js.map +1 -0
- package/dist/voice/transcribe.d.ts +3 -0
- package/dist/voice/transcribe.js +43 -0
- package/dist/voice/transcribe.js.map +1 -0
- package/dist/voice/types.d.ts +26 -0
- package/dist/voice/types.js +9 -0
- package/dist/voice/types.js.map +1 -0
- package/package.json +54 -0
- package/templates/.archive/README.md +67 -0
- package/templates/.cairn/JOIN.md +87 -0
- package/templates/.cairn/config/sensors.yaml +185 -0
- package/templates/.cairn/config/stub-patterns.yaml +231 -0
- package/templates/.cairn/config/trust-policy.yaml +95 -0
- package/templates/.cairn/config/workflow.md +230 -0
- package/templates/.cairn/git-hooks/commit-msg +17 -0
- package/templates/.cairn/git-hooks/post-commit +28 -0
- package/templates/.cairn/git-hooks/pre-commit +24 -0
- package/templates/.cairn/ground/brand/overview.md +24 -0
- package/templates/.cairn/ground/brand/voice.md +20 -0
- package/templates/.cairn/ground/canonical-map/topics.yaml +54 -0
- package/templates/.cairn/ground/capabilities/mcp-tools.yaml +4 -0
- package/templates/.cairn/ground/capabilities/skills.yaml +3 -0
- package/templates/.cairn/ground/capabilities/snippets.yaml +3 -0
- package/templates/.cairn/ground/manifest.yaml +16 -0
- package/templates/.cairn/ground/product/personas.yaml +4 -0
- package/templates/.cairn/ground/product/positioning.md +21 -0
- package/templates/.claude/settings.json +57 -0
- package/templates/.github/workflows/cairn-check.yml +31 -0
- package/templates/.mcp.json +8 -0
- package/templates/README.md +24 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { logger } from "../logger.js";
|
|
2
|
+
import { getWhisper } from "./model.js";
|
|
3
|
+
import { audioToPcm } from "./pipe.js";
|
|
4
|
+
const log = logger("voice.transcribe");
|
|
5
|
+
export async function transcribeBuffer(audio, opts = {}) {
|
|
6
|
+
const startedAt = Date.now();
|
|
7
|
+
const pcm = await audioToPcm(audio);
|
|
8
|
+
const language = opts.language ?? "en";
|
|
9
|
+
const whisper = getWhisper();
|
|
10
|
+
const task = await whisper.transcribe(pcm, {
|
|
11
|
+
language,
|
|
12
|
+
format: "detail",
|
|
13
|
+
no_timestamps: false,
|
|
14
|
+
print_progress: false,
|
|
15
|
+
print_realtime: false,
|
|
16
|
+
print_special: false,
|
|
17
|
+
print_timestamps: false,
|
|
18
|
+
suppress_blank: true,
|
|
19
|
+
...(opts.initialPrompt !== undefined ? { initial_prompt: opts.initialPrompt } : {}),
|
|
20
|
+
});
|
|
21
|
+
const detailed = await task.result;
|
|
22
|
+
const segments = detailed.map((d) => ({
|
|
23
|
+
from: d.from,
|
|
24
|
+
to: d.to,
|
|
25
|
+
text: d.text.trim(),
|
|
26
|
+
confidence: typeof d.confidence === "number" ? d.confidence : 0,
|
|
27
|
+
}));
|
|
28
|
+
const text = segments.map((s) => s.text).join(" ").trim();
|
|
29
|
+
const avgLogprob = segments.length > 0
|
|
30
|
+
? segments.reduce((sum, s) => sum + s.confidence, 0) / segments.length
|
|
31
|
+
: 0;
|
|
32
|
+
const durationMs = Date.now() - startedAt;
|
|
33
|
+
log.info({ chars: text.length, segments: segments.length, avgLogprob, durationMs }, "transcribed");
|
|
34
|
+
return { text, avgLogprob, segments, language, durationMs };
|
|
35
|
+
}
|
|
36
|
+
export async function transcribeUrl(attachmentUrl, opts = {}) {
|
|
37
|
+
const res = await fetch(attachmentUrl);
|
|
38
|
+
if (!res.ok)
|
|
39
|
+
throw new Error(`attachment fetch ${res.status} for ${attachmentUrl}`);
|
|
40
|
+
const buf = Buffer.from(await res.arrayBuffer());
|
|
41
|
+
return transcribeBuffer(buf, opts);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=transcribe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcribe.js","sourceRoot":"","sources":["../../src/voice/transcribe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAOvC,MAAM,GAAG,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAEvC,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,KAAa,EACb,OAA0B,EAAE;IAE5B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC;IACvC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE;QACzC,QAAQ;QACR,MAAM,EAAE,QAAQ;QAChB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,KAAK;QACrB,cAAc,EAAE,KAAK;QACrB,aAAa,EAAE,KAAK;QACpB,gBAAgB,EAAE,KAAK;QACvB,cAAc,EAAE,IAAI;QACpB,GAAG,CAAC,IAAI,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpF,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC;IACnC,MAAM,QAAQ,GAA2B,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5D,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE;QACnB,UAAU,EAAE,OAAO,CAAC,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;KAChE,CAAC,CAAC,CAAC;IACJ,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1D,MAAM,UAAU,GACd,QAAQ,CAAC,MAAM,GAAG,CAAC;QACjB,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM;QACtE,CAAC,CAAC,CAAC,CAAC;IACR,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;IAC1C,GAAG,CAAC,IAAI,CACN,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,EACzE,aAAa,CACd,CAAC;IACF,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AAC9D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,aAAqB,EACrB,OAA0B,EAAE;IAE5B,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC;IACvC,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,GAAG,CAAC,MAAM,QAAQ,aAAa,EAAE,CAAC,CAAC;IACpF,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IACjD,OAAO,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voice transcription contract.
|
|
3
|
+
*
|
|
4
|
+
* Audio NEVER touches disk per L12. Buffers flow:
|
|
5
|
+
* discord attachment → fetch → Buffer → ffmpeg pipe → Float32Array (16k mono)
|
|
6
|
+
* → smart-whisper → TranscriptionResult.
|
|
7
|
+
*/
|
|
8
|
+
export interface TranscriptionSegment {
|
|
9
|
+
from: number;
|
|
10
|
+
to: number;
|
|
11
|
+
text: string;
|
|
12
|
+
/** smart-whisper's "confidence" — average per-token probability. */
|
|
13
|
+
confidence: number;
|
|
14
|
+
}
|
|
15
|
+
export interface TranscriptionResult {
|
|
16
|
+
text: string;
|
|
17
|
+
/** Average per-segment confidence. Used as `avg_logprob`-equivalent gate. */
|
|
18
|
+
avgLogprob: number;
|
|
19
|
+
segments: TranscriptionSegment[];
|
|
20
|
+
language: string;
|
|
21
|
+
durationMs: number;
|
|
22
|
+
}
|
|
23
|
+
export interface TranscribeOptions {
|
|
24
|
+
language?: string;
|
|
25
|
+
initialPrompt?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voice transcription contract.
|
|
3
|
+
*
|
|
4
|
+
* Audio NEVER touches disk per L12. Buffers flow:
|
|
5
|
+
* discord attachment → fetch → Buffer → ffmpeg pipe → Float32Array (16k mono)
|
|
6
|
+
* → smart-whisper → TranscriptionResult.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/voice/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@isaacriehm/cairn-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Cairn core — state + context layer. Curated `.cairn/ground/` (decisions, §V invariants, canonical-map, brand, quality-grades), MCP server, init wizard, hook runners, sensors, GC drift sweep.",
|
|
5
|
+
"author": "Isaac Riehm",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/isaacriehm/cairn",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/isaacriehm/cairn.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/isaacriehm/cairn/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=22"
|
|
18
|
+
},
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"import": "./dist/index.js",
|
|
24
|
+
"types": "./dist/index.d.ts"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"templates",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@inquirer/prompts": "^8.4.2",
|
|
34
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
35
|
+
"chalk": "^5.6.2",
|
|
36
|
+
"cli-progress": "^3.12.0",
|
|
37
|
+
"ora": "^9.0.0",
|
|
38
|
+
"pino": "^9.5.0",
|
|
39
|
+
"simple-git": "^3.36.0",
|
|
40
|
+
"yaml": "^2.8.4",
|
|
41
|
+
"zod": "^4.4.2"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/cli-progress": "^3.11.6",
|
|
45
|
+
"@types/node": "^25.6.0",
|
|
46
|
+
"tsx": "^4.21.0",
|
|
47
|
+
"typescript": "^6.0.3"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsc -b",
|
|
51
|
+
"typecheck": "tsc -b",
|
|
52
|
+
"clean": "rm -rf dist *.tsbuildinfo"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: rule
|
|
3
|
+
status: accepted
|
|
4
|
+
audience: dual
|
|
5
|
+
generated: 2026-05-02T13:19:00Z
|
|
6
|
+
verified-at: 2026-05-02T13:19:00Z
|
|
7
|
+
source-commits:
|
|
8
|
+
- manual
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# `.archive/` — quarantine zone
|
|
12
|
+
|
|
13
|
+
This directory holds files that were once canonical but are no longer current. **It is committed history, not deletion.** Per `docs/FILESYSTEM_LAYOUT.md` §2 it is Cairn's `historical` zone.
|
|
14
|
+
|
|
15
|
+
## What lives here
|
|
16
|
+
|
|
17
|
+
- Pre-Cairn state files moved out at adoption (e.g. `2026-05-pre-cairn/STATE.md`)
|
|
18
|
+
- Documents superseded by an ADR (the new ADR cites the archived path)
|
|
19
|
+
- Stale generated artifacts whose source has been removed
|
|
20
|
+
- Completed runs' terminal artifacts (auto-moved by Cairn)
|
|
21
|
+
|
|
22
|
+
## What does NOT live here
|
|
23
|
+
|
|
24
|
+
- Files marked `[STALE]` in canonical paths — Cairn rejects this pattern. Stale files are MOVED here, never banner-flagged in place. (See `docs/PRIMER.md` §11 anti-patterns.)
|
|
25
|
+
- Branches or tagged refs — `.archive/` is filesystem-only.
|
|
26
|
+
- Secrets — `.env*` patterns stay in `.gitignore` regardless.
|
|
27
|
+
|
|
28
|
+
## Layout convention
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
.archive/
|
|
32
|
+
├── README.md
|
|
33
|
+
├── 2026-05-pre-cairn/ ← one bucket per migration / adoption / cleanup wave
|
|
34
|
+
│ └── <original-path> ← preserves the file's prior path inside the bucket
|
|
35
|
+
└── <YYYY-MM-DD>/ ← daily quarantine drops
|
|
36
|
+
└── <original-path>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Reading from `.archive/`
|
|
40
|
+
|
|
41
|
+
Agents do **not** read this directory directly. Soft enforcement, three layers:
|
|
42
|
+
|
|
43
|
+
1. The `cairn hook session-start` SessionStart hook injects a reminder instructing the agent that historical paths are off-default.
|
|
44
|
+
2. Cairn walkers (manifest build, GC sweep, sensor scans) exclude `.archive/` from canonical-zone reads.
|
|
45
|
+
3. The only sanctioned read path is the MCP tool:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
cairn_query_history(scope, question)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`cairn_query_history` walks `.archive/` (matched by `path_hint` + `since`/`until`), runs a Tier-1 Haiku summarizer, and returns structured per-claim records with source citations and supersedes-pointers. The agent receives only the summary — raw stale content never enters its context.
|
|
52
|
+
|
|
53
|
+
PreToolUse-style interception is **not** used (operator decision 2026-05-04). The combination of SessionStart instruction + walker exclusion + `cairn_query_history` is sufficient and avoids the brittleness of a hot-path tool-call hook.
|
|
54
|
+
|
|
55
|
+
## Writing to `.archive/`
|
|
56
|
+
|
|
57
|
+
Only via `cairn_archive(path, reason)`. Direct moves are accepted but discouraged because they bypass the audit log. The MCP tool records the reason, the operator who issued the move (frontend-adapter user-id), and the timestamp.
|
|
58
|
+
|
|
59
|
+
## Why we don't delete
|
|
60
|
+
|
|
61
|
+
1. Decisions cite archived paths. Deletion breaks the audit trail.
|
|
62
|
+
2. The init script's mapper agent learns from prior moves what's project-specific.
|
|
63
|
+
3. Historical context is occasionally re-needed (e.g. confirming an old decision's premise). Quarantine preserves that without polluting canonical reads.
|
|
64
|
+
|
|
65
|
+
## Restoring an archived file
|
|
66
|
+
|
|
67
|
+
`cairn restore <path>` (CLI subcommand, future) — moves a file out of `.archive/<bucket>/` back to its original location and writes a `cairn_record_run_event` of the restoration. Use sparingly.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# JOIN — bootstrapping a new clone of this project
|
|
2
|
+
|
|
3
|
+
This project is Cairn-adopted. Every developer who touches it must run
|
|
4
|
+
Cairn locally so that decisions, invariants, and sensor results stay in
|
|
5
|
+
sync across clones.
|
|
6
|
+
|
|
7
|
+
If you just cloned, run **one** of the bootstrap paths below before
|
|
8
|
+
attempting your first commit. The local pre-commit hook will refuse to run
|
|
9
|
+
otherwise; the CI gate on every PR will refuse to merge otherwise.
|
|
10
|
+
|
|
11
|
+
## Path A — Claude Code users (recommended)
|
|
12
|
+
|
|
13
|
+
If you opened this project with Claude Code and the Cairn plugin is
|
|
14
|
+
enabled, the SessionStart hook detects an unbootstrapped clone and surfaces
|
|
15
|
+
an inline `[a]` bootstrap prompt. Pick `[a]` once and you are done.
|
|
16
|
+
|
|
17
|
+
If the plugin isn't installed yet:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Inside Claude Code
|
|
21
|
+
/plugin install cairn@isaacriehm-cairn
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
…then reopen the project. The SessionStart prompt will fire.
|
|
25
|
+
|
|
26
|
+
## Path B — CLI bootstrap
|
|
27
|
+
|
|
28
|
+
If you don't use Claude Code, run the CLI command:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install -g @isaacriehm/cairn # only if Cairn isn't already installed
|
|
32
|
+
cairn join # idempotent; safe to re-run
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`cairn join` does three things:
|
|
36
|
+
|
|
37
|
+
1. Checks the `cairn` CLI version is compatible with this project's
|
|
38
|
+
`.cairn/config.yaml` `cairn_version` constraint.
|
|
39
|
+
2. Sets `git config core.hooksPath .cairn/git-hooks` on this clone so the
|
|
40
|
+
versioned pre-commit / post-commit / commit-msg hooks run.
|
|
41
|
+
3. Creates `.cairn/sessions/` for this clone if missing.
|
|
42
|
+
|
|
43
|
+
## Path C — `package.json` `prepare` (Node projects only)
|
|
44
|
+
|
|
45
|
+
For Node projects the adoption flow already wires
|
|
46
|
+
`prepare: cairn join || true` into `package.json`. Running
|
|
47
|
+
`npm install` / `pnpm install` runs `cairn join` for you. The `|| true`
|
|
48
|
+
lets the install succeed even if Cairn isn't yet on PATH; the failure
|
|
49
|
+
surfaces at first commit attempt instead.
|
|
50
|
+
|
|
51
|
+
## Verifying
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
git config --get core.hooksPath
|
|
55
|
+
# Expected output: .cairn/git-hooks
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
cairn doctor
|
|
60
|
+
# Should print: "core.hooksPath = .cairn/git-hooks ✓"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Why this is required
|
|
64
|
+
|
|
65
|
+
Without bootstrap:
|
|
66
|
+
|
|
67
|
+
- **Local commits** — pre-commit hook isn't on the path; you can commit code
|
|
68
|
+
that violates project decisions or invariants.
|
|
69
|
+
- **PR merges** — CI gate catches it but the round-trip is wasteful.
|
|
70
|
+
- **MCP write tools** — the Claude Code plugin enters degraded mode (read-
|
|
71
|
+
only) and refuses to record DECs from your clone, because there's no
|
|
72
|
+
attestation layer to flag bypassed commits.
|
|
73
|
+
|
|
74
|
+
The bootstrap step is one-time per clone and takes < 5 seconds. If you
|
|
75
|
+
genuinely want to opt the project out of Cairn entirely, delete
|
|
76
|
+
`.cairn/` and the next commit will succeed (no hooks, no CI). That is a
|
|
77
|
+
project-level decision, not a per-clone one — discuss with the team first.
|
|
78
|
+
|
|
79
|
+
## Troubleshooting
|
|
80
|
+
|
|
81
|
+
- **`cairn: command not found`** — install the CLI first via the npm
|
|
82
|
+
command above, or open the project in Claude Code with the plugin.
|
|
83
|
+
- **`pre-commit hook failed`** — read the sensor output. The hook never
|
|
84
|
+
fails silently. If you genuinely need to bypass once, `git commit
|
|
85
|
+
--no-verify` works locally but the CI gate on the PR will still block.
|
|
86
|
+
- **`cairn join` reports a version mismatch** — upgrade your CLI:
|
|
87
|
+
`npm install -g @isaacriehm/cairn@latest`.
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Cairn sensor registry.
|
|
2
|
+
#
|
|
3
|
+
# Sensors are mechanical checks the orchestrator runs against an agent's diff.
|
|
4
|
+
# Listed here are the GENERIC kinds that ship with the Cairn package. Stack
|
|
5
|
+
# profiles (typescript-next-nest, python-fastapi, rails, go, rust, unknown — see
|
|
6
|
+
# INTEGRATION_PLAN.md §16.1) propose profile-specific sensors at adoption; the
|
|
7
|
+
# operator confirms each one. Project-specific sensors live in the adopting
|
|
8
|
+
# project's extension block (see workflow.md).
|
|
9
|
+
#
|
|
10
|
+
# Per operator answer S1: Cairn package code does NOT hardcode any specific
|
|
11
|
+
# project's sensor names. All concrete sensor identifiers below are
|
|
12
|
+
# stack-profile-agnostic primitives.
|
|
13
|
+
|
|
14
|
+
version: 1
|
|
15
|
+
|
|
16
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
17
|
+
# Generic (stack-profile-agnostic) sensors.
|
|
18
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
19
|
+
|
|
20
|
+
sensors:
|
|
21
|
+
|
|
22
|
+
# ── Layer A — mechanical stub catalog ─────────────────────────────────────
|
|
23
|
+
- id: stub-pattern-catalog
|
|
24
|
+
layer: A
|
|
25
|
+
kind: regex_catalog
|
|
26
|
+
description: "Mechanical scan of diff against .cairn/config/stub-patterns.yaml. Layer A of the honest-agent invariants stack."
|
|
27
|
+
catalog: .cairn/config/stub-patterns.yaml
|
|
28
|
+
triggers:
|
|
29
|
+
- every_run
|
|
30
|
+
fail_severity: hard
|
|
31
|
+
|
|
32
|
+
# ── Layer B — attestation cross-check ─────────────────────────────────────
|
|
33
|
+
- id: attestation-cross-check
|
|
34
|
+
layer: B
|
|
35
|
+
kind: attestation
|
|
36
|
+
description: "Cross-checks agent's attestation.yaml against the actual diff. Mismatches (lying about completeness, files-touched count, todos/stubs introduced) fail the run."
|
|
37
|
+
triggers:
|
|
38
|
+
- every_run_completion
|
|
39
|
+
fail_severity: hard
|
|
40
|
+
|
|
41
|
+
# ── Layer D — project structural / contract sensors ──────────────────────
|
|
42
|
+
- id: route-handler-non-empty
|
|
43
|
+
layer: D
|
|
44
|
+
kind: structural
|
|
45
|
+
description: "For every route/controller method, body must contain non-trivial implementation (not just `return null` / empty / throw not-implemented)."
|
|
46
|
+
triggers:
|
|
47
|
+
- diff_touches_glob
|
|
48
|
+
glob_keys:
|
|
49
|
+
- route_handler_globs
|
|
50
|
+
fail_severity: hard
|
|
51
|
+
|
|
52
|
+
- id: dto-no-fake-fields
|
|
53
|
+
layer: D
|
|
54
|
+
kind: structural
|
|
55
|
+
description: "DTO/schema fields that are declared optional and always evaluate undefined fail this sensor — they look thorough without doing work."
|
|
56
|
+
triggers:
|
|
57
|
+
- diff_touches_glob
|
|
58
|
+
glob_keys:
|
|
59
|
+
- dto_globs
|
|
60
|
+
fail_severity: hard
|
|
61
|
+
|
|
62
|
+
# ── Generator-drift sensors (profile-driven) ──────────────────────────────
|
|
63
|
+
- id: generator-drift
|
|
64
|
+
layer: D
|
|
65
|
+
kind: generator_drift
|
|
66
|
+
description: "Re-runs the project's declared generator commands (e.g. openapi:generate, db:generate, sqlc generate, alembic check). Any non-empty diff = source out of sync with artifact."
|
|
67
|
+
triggers:
|
|
68
|
+
- diff_touches_glob
|
|
69
|
+
glob_keys:
|
|
70
|
+
- generator_source_globs
|
|
71
|
+
profile_hook: profile.generators
|
|
72
|
+
fail_severity: hard
|
|
73
|
+
|
|
74
|
+
# ── Decision-assertion sensor ─────────────────────────────────────────────
|
|
75
|
+
- id: decision-assertions
|
|
76
|
+
layer: decisions
|
|
77
|
+
kind: assertion_evaluator
|
|
78
|
+
description: "For every accepted decision whose scope_globs overlap the diff, evaluate machine-readable assertions (schema_must_contain, text_must_*, index_must_exist, ast_pattern, file_must_not_be_modified, query_must_filter_by, route_must_have_guard, event_must_emit, service_method_must_call, human_review_hint). Failure quotes the assertion id + decision id + the contradicting line."
|
|
79
|
+
triggers:
|
|
80
|
+
- every_run
|
|
81
|
+
fail_severity: hard
|
|
82
|
+
|
|
83
|
+
# ── §V invariant sensors (auto-registered by backprop) ───────────────────
|
|
84
|
+
- id: invariant-suite
|
|
85
|
+
layer: invariants
|
|
86
|
+
kind: invariant_runner
|
|
87
|
+
description: "Runs every active §V invariant's linked sensor script (see backprop protocol — PRIMER §13). Active invariants accumulate over time; superseded ones are skipped."
|
|
88
|
+
triggers:
|
|
89
|
+
- every_run
|
|
90
|
+
sources:
|
|
91
|
+
- .cairn/ground/invariants/
|
|
92
|
+
fail_severity: hard
|
|
93
|
+
|
|
94
|
+
# ── Reviewer subagent (Layer C) ───────────────────────────────────────────
|
|
95
|
+
- id: reviewer-subagent
|
|
96
|
+
layer: C
|
|
97
|
+
kind: inferential
|
|
98
|
+
description: "Same model as implementer; fresh context. Reads only spec.tightened.md + diff + decisions ledger + in-scope assertions. Anti-completionist framing. For high-stakes runs, also enforces query-scope completeness (Codex audit Q1)."
|
|
99
|
+
model_strategy: same_as_implementer
|
|
100
|
+
triggers:
|
|
101
|
+
- all_layer_d_sensors_passed
|
|
102
|
+
fail_severity: soft # produces verdict; orchestrator gates on operator override or auto-fail
|
|
103
|
+
|
|
104
|
+
# ── Layer E — high-stakes E2E / demo ─────────────────────────────────────
|
|
105
|
+
- id: e2e-real-db
|
|
106
|
+
layer: E
|
|
107
|
+
kind: e2e
|
|
108
|
+
description: "Runs the project's E2E suite against a real database (no mocks). High-stakes UAT MUST include a cross-tenant negative fixture (Codex audit Q1) — a request from user/org B against a resource owned by user/org A returning the expected denial."
|
|
109
|
+
triggers:
|
|
110
|
+
- high_stakes_glob_match
|
|
111
|
+
profile_hook: profile.e2e_command
|
|
112
|
+
fail_severity: hard
|
|
113
|
+
requires:
|
|
114
|
+
cross_tenant_fixture: true # per L43
|
|
115
|
+
|
|
116
|
+
# ── Layer U — UAT-on-phone ───────────────────────────────────────────────
|
|
117
|
+
- id: uat-headless-chrome
|
|
118
|
+
layer: U
|
|
119
|
+
kind: uat
|
|
120
|
+
description: "Headless Chrome via Playwright captures GIF + screenshots + console + network. Evidence-file gate: .uat-passed contains SHA256 of bundle. Bare touch rejected."
|
|
121
|
+
triggers:
|
|
122
|
+
- code_class_or_high_stakes
|
|
123
|
+
fail_severity: hard
|
|
124
|
+
|
|
125
|
+
# ── Frontmatter freshness (nightly GC pass) ──────────────────────────────
|
|
126
|
+
- id: frontmatter-freshness
|
|
127
|
+
layer: gc
|
|
128
|
+
kind: frontmatter_check
|
|
129
|
+
description: "Walks load-bearing markdown in canonical zone. Flags files with verified-at older than 30 days; blocks reads via hook on > 60 days."
|
|
130
|
+
triggers:
|
|
131
|
+
- nightly_cron
|
|
132
|
+
fail_severity: soft
|
|
133
|
+
|
|
134
|
+
# ── Local-dirty-overlap gate (per Codex audit Q3) ─────────────────────────
|
|
135
|
+
- id: local-dirty-overlap
|
|
136
|
+
layer: pre_dispatch
|
|
137
|
+
kind: working_tree_check
|
|
138
|
+
description: "Before dispatch AND before push, check user's working tree for un-pushed dirty files that overlap the run's target_path_globs. If overlap, pause run and offer A/B/C resolution (stash / cancel / wait)."
|
|
139
|
+
triggers:
|
|
140
|
+
- pre_dispatch
|
|
141
|
+
- pre_push
|
|
142
|
+
fail_severity: soft # operator decides resolution
|
|
143
|
+
|
|
144
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
145
|
+
# Scoped-glob keys.
|
|
146
|
+
#
|
|
147
|
+
# Each adopting project fills these in its `<project_name>:` block. Sensors that
|
|
148
|
+
# trigger on `glob_keys` resolve them at dispatch from the project block.
|
|
149
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
150
|
+
|
|
151
|
+
required_glob_keys:
|
|
152
|
+
- route_handler_globs # e.g. core/src/**/*.controller.ts (NestJS) | app/controllers/**/*.rb (Rails)
|
|
153
|
+
- dto_globs # e.g. core/src/**/*.dto.ts | apps/api/schemas/**/*.py
|
|
154
|
+
- generator_source_globs # files that, when changed, mean the generator should re-run
|
|
155
|
+
- high_stakes_globs # paths whose changes require Layer E + cross-tenant fixture
|
|
156
|
+
|
|
157
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
158
|
+
# Copy-safety configuration (write guardian + Layer D sensor)
|
|
159
|
+
#
|
|
160
|
+
# The write guardian (PostToolUse hook on Write/Edit) and the Layer D
|
|
161
|
+
# copy-safety sensor both consume this block. Globs default to common frontend
|
|
162
|
+
# file extensions; extend per-project as needed. allowlist holds verbatim
|
|
163
|
+
# strings that match a pattern but are intentional (technical error codes,
|
|
164
|
+
# product names, etc.).
|
|
165
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
166
|
+
|
|
167
|
+
copy_safety:
|
|
168
|
+
enabled: true
|
|
169
|
+
globs:
|
|
170
|
+
- "src/**/*.tsx"
|
|
171
|
+
- "src/**/*.jsx"
|
|
172
|
+
- "src/**/*.vue"
|
|
173
|
+
- "src/**/*.svelte"
|
|
174
|
+
- "**/*.html"
|
|
175
|
+
- "src/**/i18n/**/*.json"
|
|
176
|
+
- "src/**/locales/**/*.json"
|
|
177
|
+
allowlist: []
|
|
178
|
+
|
|
179
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
180
|
+
# Disable list — sensors known to false-positive at >50% on a given project.
|
|
181
|
+
# Default empty; populated per-project via /oops dialog (PRIMER §11 anti-pattern:
|
|
182
|
+
# we DO NOT mock or stub sensor results to make them pass).
|
|
183
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
184
|
+
|
|
185
|
+
disabled_per_project: []
|