@isaacriehm/cairn-core 0.6.0 → 0.7.1
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/dist/.tsbuildinfo +1 -1
- package/dist/align-undo/undo.js +2 -2
- package/dist/align-undo/undo.js.map +1 -1
- package/dist/attention/bulk-accept.js +104 -55
- package/dist/attention/bulk-accept.js.map +1 -1
- package/dist/attention/dedup.js +23 -10
- package/dist/attention/dedup.js.map +1 -1
- package/dist/attention/restore.js +2 -2
- package/dist/attention/restore.js.map +1 -1
- package/dist/attention/scoring.js +1 -1
- package/dist/attention/scoring.js.map +1 -1
- package/dist/attention/serve/api.d.ts +1 -0
- package/dist/attention/serve/api.js +130 -77
- package/dist/attention/serve/api.js.map +1 -1
- package/dist/attention/serve/index.d.ts +1 -0
- package/dist/attention/serve/index.js +21 -7
- package/dist/attention/serve/index.js.map +1 -1
- package/dist/attention/source-strip.js +41 -46
- package/dist/attention/source-strip.js.map +1 -1
- package/dist/claude/cache.d.ts +10 -19
- package/dist/claude/cache.js +0 -0
- package/dist/claude/cache.js.map +1 -1
- package/dist/claude/runner.d.ts +4 -6
- package/dist/claude/runner.js +242 -203
- package/dist/claude/runner.js.map +1 -1
- package/dist/claude/types.d.ts +5 -5
- package/dist/context/handoff-builder.d.ts +28 -4
- package/dist/context/handoff-builder.js +75 -157
- package/dist/context/handoff-builder.js.map +1 -1
- package/dist/context/spec-delta.js +61 -9
- package/dist/context/spec-delta.js.map +1 -1
- package/dist/context/task-summary.js +5 -1
- package/dist/context/task-summary.js.map +1 -1
- package/dist/decision-capture/id.js +1 -1
- package/dist/decision-capture/id.js.map +1 -1
- package/dist/doctor/index.d.ts +9 -11
- package/dist/doctor/index.js +118 -175
- package/dist/doctor/index.js.map +1 -1
- package/dist/drain/drain.d.ts +1 -1
- package/dist/drain/drain.js +16 -16
- package/dist/drain/drain.js.map +1 -1
- package/dist/drain/index.d.ts +1 -1
- package/dist/drain/index.js +1 -1
- package/dist/events/reader.d.ts +9 -10
- package/dist/events/reader.js +46 -57
- package/dist/events/reader.js.map +1 -1
- package/dist/events/writer.js +1 -1
- package/dist/events/writer.js.map +1 -1
- package/dist/fix-align/index.d.ts +1 -1
- package/dist/fix-align/index.js +1 -1
- package/dist/fix-align/run.d.ts +1 -1
- package/dist/fix-align/run.js +4 -3
- package/dist/fix-align/run.js.map +1 -1
- package/dist/fix-align/sentinel.d.ts +1 -2
- package/dist/fix-align/sentinel.js +3 -4
- package/dist/fix-align/sentinel.js.map +1 -1
- package/dist/gc/apply.js +1 -1
- package/dist/gc/apply.js.map +1 -1
- package/dist/gc/attested-commits.d.ts +19 -0
- package/dist/gc/attested-commits.js +48 -0
- package/dist/gc/attested-commits.js.map +1 -0
- package/dist/gc/canary.d.ts +11 -21
- package/dist/gc/canary.js +18 -24
- package/dist/gc/canary.js.map +1 -1
- package/dist/gc/citation-integrity.d.ts +11 -14
- package/dist/gc/citation-integrity.js +124 -125
- package/dist/gc/citation-integrity.js.map +1 -1
- package/dist/gc/classify.d.ts +1 -1
- package/dist/gc/classify.js +2 -2
- package/dist/gc/classify.js.map +1 -1
- package/dist/gc/completion-integrity.d.ts +6 -7
- package/dist/gc/completion-integrity.js +45 -53
- package/dist/gc/completion-integrity.js.map +1 -1
- package/dist/gc/doc-gardening.js +1 -9
- package/dist/gc/doc-gardening.js.map +1 -1
- package/dist/gc/frontmatter.js +2 -2
- package/dist/gc/frontmatter.js.map +1 -1
- package/dist/gc/index.d.ts +7 -6
- package/dist/gc/index.js +3 -2
- package/dist/gc/index.js.map +1 -1
- package/dist/gc/quality-update.d.ts +6 -10
- package/dist/gc/quality-update.js +12 -15
- package/dist/gc/quality-update.js.map +1 -1
- package/dist/gc/scope-coverage.js +1 -1
- package/dist/gc/scope-coverage.js.map +1 -1
- package/dist/gc/stub-hits.d.ts +7 -25
- package/dist/gc/stub-hits.js +14 -40
- package/dist/gc/stub-hits.js.map +1 -1
- package/dist/gc/sweep.js +15 -6
- package/dist/gc/sweep.js.map +1 -1
- package/dist/gc/types.d.ts +5 -5
- package/dist/gc/types.js +2 -2
- package/dist/gc/walk-source.js +8 -28
- package/dist/gc/walk-source.js.map +1 -1
- package/dist/hooks/defer.d.ts +9 -20
- package/dist/hooks/defer.js +10 -27
- package/dist/hooks/defer.js.map +1 -1
- package/dist/hooks/post-tool-use/allowlist-reader.d.ts +2 -1
- package/dist/hooks/post-tool-use/allowlist-reader.js +49 -34
- package/dist/hooks/post-tool-use/allowlist-reader.js.map +1 -1
- package/dist/hooks/post-tool-use/index.d.ts +3 -4
- package/dist/hooks/post-tool-use/index.js +3 -3
- package/dist/hooks/post-tool-use/index.js.map +1 -1
- package/dist/hooks/post-tool-use/legend-builder.d.ts +11 -2
- package/dist/hooks/post-tool-use/legend-builder.js +27 -2
- package/dist/hooks/post-tool-use/legend-builder.js.map +1 -1
- package/dist/hooks/post-tool-use/post-write.d.ts +8 -0
- package/dist/hooks/post-tool-use/post-write.js +112 -0
- package/dist/hooks/post-tool-use/post-write.js.map +1 -0
- package/dist/hooks/post-tool-use/read-enricher.d.ts +10 -5
- package/dist/hooks/post-tool-use/read-enricher.js +114 -149
- package/dist/hooks/post-tool-use/read-enricher.js.map +1 -1
- package/dist/hooks/post-tool-use/sot-align.d.ts +12 -0
- package/dist/hooks/post-tool-use/sot-align.js +73 -49
- package/dist/hooks/post-tool-use/sot-align.js.map +1 -1
- package/dist/hooks/post-tool-use/write-guardian.d.ts +40 -8
- package/dist/hooks/post-tool-use/write-guardian.js +202 -254
- package/dist/hooks/post-tool-use/write-guardian.js.map +1 -1
- package/dist/hooks/pre-commit/sot-align-precommit.js +2 -2
- package/dist/hooks/pre-commit/sot-align-precommit.js.map +1 -1
- package/dist/hooks/runners/index.d.ts +2 -2
- package/dist/hooks/runners/index.js +1 -1
- package/dist/hooks/runners/index.js.map +1 -1
- package/dist/hooks/runners/payload.d.ts +34 -19
- package/dist/hooks/runners/payload.js +47 -44
- package/dist/hooks/runners/payload.js.map +1 -1
- package/dist/hooks/runners/session-end.js +12 -11
- package/dist/hooks/runners/session-end.js.map +1 -1
- package/dist/hooks/runners/session-start.d.ts +4 -2
- package/dist/hooks/runners/session-start.js +88 -261
- package/dist/hooks/runners/session-start.js.map +1 -1
- package/dist/hooks/runners/stop.js +27 -8
- package/dist/hooks/runners/stop.js.map +1 -1
- package/dist/hooks/runners/user-prompt-submit.js +7 -1
- package/dist/hooks/runners/user-prompt-submit.js.map +1 -1
- package/dist/hooks/sot-align-common.d.ts +1 -2
- package/dist/hooks/sot-align-common.js +2 -2
- package/dist/hooks/sot-align-common.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -3
- package/dist/index.js.map +1 -1
- package/dist/init/baseline-audit.d.ts +14 -58
- package/dist/init/baseline-audit.js +92 -320
- package/dist/init/baseline-audit.js.map +1 -1
- package/dist/init/brand-derive.d.ts +11 -15
- package/dist/init/brand-derive.js +21 -46
- package/dist/init/brand-derive.js.map +1 -1
- package/dist/init/brand-setup.d.ts +1 -1
- package/dist/init/brand-setup.js +1 -1
- package/dist/init/detect.d.ts +25 -6
- package/dist/init/detect.js +107 -136
- package/dist/init/detect.js.map +1 -1
- package/dist/init/index.d.ts +4 -4
- package/dist/init/index.js +2 -2
- package/dist/init/index.js.map +1 -1
- package/dist/init/ingest-docs.d.ts +83 -23
- package/dist/init/ingest-docs.js +648 -136
- package/dist/init/ingest-docs.js.map +1 -1
- package/dist/init/init.d.ts +29 -20
- package/dist/init/init.js +132 -290
- package/dist/init/init.js.map +1 -1
- package/dist/init/mapper-merge.js +1 -1
- package/dist/init/mapper-merge.js.map +1 -1
- package/dist/init/mapper-parallel.d.ts +1 -1
- package/dist/init/mapper-parallel.js +10 -1
- package/dist/init/mapper-parallel.js.map +1 -1
- package/dist/init/mapper.js +1 -1
- package/dist/init/mapper.js.map +1 -1
- package/dist/init/multi-dev/install.d.ts +5 -5
- package/dist/init/multi-dev/install.js +4 -4
- package/dist/init/overlay.js +1 -0
- package/dist/init/overlay.js.map +1 -1
- package/dist/init/phases/1-detect.js +1 -1
- package/dist/init/phases/1-detect.js.map +1 -1
- package/dist/init/phases/{7c-rules-merge.d.ts → 10-rules-merge.d.ts} +2 -2
- package/dist/init/phases/{7c-rules-merge.js → 10-rules-merge.js} +6 -12
- package/dist/init/phases/10-rules-merge.js.map +1 -0
- package/dist/init/phases/11-baseline.d.ts +7 -0
- package/dist/init/phases/{8-baseline.js → 11-baseline.js} +5 -9
- package/dist/init/phases/11-baseline.js.map +1 -0
- package/dist/init/phases/12-strip.d.ts +10 -0
- package/dist/init/phases/{10-strip.js → 12-strip.js} +10 -14
- package/dist/init/phases/12-strip.js.map +1 -0
- package/dist/init/phases/{12-multidev.d.ts → 13-multidev.d.ts} +2 -2
- package/dist/init/phases/{12-multidev.js → 13-multidev.js} +4 -4
- package/dist/init/phases/{12-multidev.js.map → 13-multidev.js.map} +1 -1
- package/dist/init/phases/3-mapper.d.ts +1 -1
- package/dist/init/phases/3-mapper.js +2 -2
- package/dist/init/phases/3-mapper.js.map +1 -1
- package/dist/init/phases/{3b-seed.d.ts → 4-seed.d.ts} +2 -2
- package/dist/init/phases/{3b-seed.js → 4-seed.js} +7 -7
- package/dist/init/phases/4-seed.js.map +1 -0
- package/dist/init/phases/{4-pilot.d.ts → 5-pilot.d.ts} +2 -2
- package/dist/init/phases/{4-pilot.js → 5-pilot.js} +9 -9
- package/dist/init/phases/{4-pilot.js.map → 5-pilot.js.map} +1 -1
- package/dist/init/phases/{5-brand.d.ts → 6-brand.d.ts} +2 -7
- package/dist/init/phases/{5-brand.js → 6-brand.js} +6 -14
- package/dist/init/phases/6-brand.js.map +1 -0
- package/dist/init/phases/{5b-topic-index.d.ts → 7-topic-index.d.ts} +2 -11
- package/dist/init/phases/{5b-topic-index.js → 7-topic-index.js} +9 -18
- package/dist/init/phases/7-topic-index.js.map +1 -0
- package/dist/init/phases/8-docs-ingest.d.ts +10 -0
- package/dist/init/phases/{6-docs-ingest.js → 8-docs-ingest.js} +12 -14
- package/dist/init/phases/8-docs-ingest.js.map +1 -0
- package/dist/init/phases/9-source-comments.d.ts +6 -0
- package/dist/init/phases/{7b-source-comments.js → 9-source-comments.js} +7 -26
- package/dist/init/phases/9-source-comments.js.map +1 -0
- package/dist/init/phases/index.d.ts +12 -12
- package/dist/init/phases/index.js +11 -11
- package/dist/init/phases/index.js.map +1 -1
- package/dist/init/phases/{parallel-678.d.ts → parallel-8910.d.ts} +7 -8
- package/dist/init/phases/{parallel-678.js → parallel-8910.js} +34 -46
- package/dist/init/phases/parallel-8910.js.map +1 -0
- package/dist/init/phases/source-comments-output-io.d.ts +3 -3
- package/dist/init/phases/source-comments-output-io.js +3 -3
- package/dist/init/phases/types.d.ts +1 -1
- package/dist/init/phases/types.js +10 -10
- package/dist/init/phases/types.js.map +1 -1
- package/dist/init/rules-merge/discover.d.ts +2 -2
- package/dist/init/rules-merge/discover.js +28 -43
- package/dist/init/rules-merge/discover.js.map +1 -1
- package/dist/init/rules-merge/ingest.d.ts +6 -6
- package/dist/init/rules-merge/ingest.js +9 -10
- package/dist/init/rules-merge/ingest.js.map +1 -1
- package/dist/init/rules-merge/keep-markers.d.ts +1 -1
- package/dist/init/rules-merge/keep-markers.js +1 -1
- package/dist/init/rules-merge/regenerate.d.ts +3 -3
- package/dist/init/rules-merge/regenerate.js +3 -3
- package/dist/init/seed.js +17 -24
- package/dist/init/seed.js.map +1 -1
- package/dist/init/sot-emit.d.ts +48 -8
- package/dist/init/sot-emit.js +88 -10
- package/dist/init/sot-emit.js.map +1 -1
- package/dist/init/source-comments/classify.d.ts +2 -2
- package/dist/init/source-comments/classify.js +9 -1
- package/dist/init/source-comments/classify.js.map +1 -1
- package/dist/init/source-comments/index.d.ts +1 -1
- package/dist/init/source-comments/index.js.map +1 -1
- package/dist/init/source-comments/ingest.d.ts +2 -2
- package/dist/init/source-comments/ingest.js +110 -12
- package/dist/init/source-comments/ingest.js.map +1 -1
- package/dist/init/source-comments/strip-replace.js +3 -2
- package/dist/init/source-comments/strip-replace.js.map +1 -1
- package/dist/init/source-comments/walker.d.ts +3 -26
- package/dist/init/source-comments/walker.js +18 -30
- package/dist/init/source-comments/walker.js.map +1 -1
- package/dist/init/topic-index/index.d.ts +15 -1
- package/dist/init/topic-index/index.js +84 -5
- package/dist/init/topic-index/index.js.map +1 -1
- package/dist/init/topic-index/judge.d.ts +5 -9
- package/dist/init/topic-index/judge.js +25 -17
- package/dist/init/topic-index/judge.js.map +1 -1
- package/dist/init/topic-index/resolve.d.ts +23 -3
- package/dist/init/topic-index/resolve.js +102 -16
- package/dist/init/topic-index/resolve.js.map +1 -1
- package/dist/init/topic-index/walk.d.ts +36 -4
- package/dist/init/topic-index/walk.js +78 -12
- package/dist/init/topic-index/walk.js.map +1 -1
- package/dist/lock.js +4 -1
- package/dist/lock.js.map +1 -1
- package/dist/logger.js +3 -0
- package/dist/logger.js.map +1 -1
- package/dist/mcp/history/summarizer.js +6 -1
- package/dist/mcp/history/summarizer.js.map +1 -1
- package/dist/mcp/history/walker.js +1 -1
- package/dist/mcp/history/walker.js.map +1 -1
- package/dist/mcp/path-allowlist.js +1 -1
- package/dist/mcp/path-allowlist.js.map +1 -1
- package/dist/mcp/schemas.d.ts +47 -21
- package/dist/mcp/schemas.js +38 -9
- package/dist/mcp/schemas.js.map +1 -1
- package/dist/mcp/server.js +10 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/archive.js +1 -1
- package/dist/mcp/tools/archive.js.map +1 -1
- package/dist/mcp/tools/attention-wait.js +12 -2
- package/dist/mcp/tools/attention-wait.js.map +1 -1
- package/dist/mcp/tools/bulk-accept-attention.js +29 -30
- package/dist/mcp/tools/bulk-accept-attention.js.map +1 -1
- package/dist/mcp/tools/canonical-for-topic.js +37 -15
- package/dist/mcp/tools/canonical-for-topic.js.map +1 -1
- package/dist/mcp/tools/decision-get.js +2 -2
- package/dist/mcp/tools/decision-get.js.map +1 -1
- package/dist/mcp/tools/decisions-for-symbol.js +2 -2
- package/dist/mcp/tools/decisions-for-symbol.js.map +1 -1
- package/dist/mcp/tools/get-full.js +1 -1
- package/dist/mcp/tools/get-full.js.map +1 -1
- package/dist/mcp/tools/ground-get.js +1 -1
- package/dist/mcp/tools/ground-get.js.map +1 -1
- package/dist/mcp/tools/in-scope.d.ts +8 -0
- package/dist/mcp/tools/in-scope.js +125 -0
- package/dist/mcp/tools/in-scope.js.map +1 -0
- package/dist/mcp/tools/index.js +11 -6
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/init-phases.d.ts +3 -2
- package/dist/mcp/tools/init-phases.js +125 -124
- package/dist/mcp/tools/init-phases.js.map +1 -1
- package/dist/mcp/tools/invariant-get.js +2 -2
- package/dist/mcp/tools/invariant-get.js.map +1 -1
- package/dist/mcp/tools/record-decision.d.ts +4 -3
- package/dist/mcp/tools/record-decision.js +111 -36
- package/dist/mcp/tools/record-decision.js.map +1 -1
- package/dist/mcp/tools/reject-candidate.d.ts +24 -0
- package/dist/mcp/tools/reject-candidate.js +71 -0
- package/dist/mcp/tools/reject-candidate.js.map +1 -0
- package/dist/mcp/tools/resolve-attention.d.ts +5 -18
- package/dist/mcp/tools/resolve-attention.js +58 -158
- package/dist/mcp/tools/resolve-attention.js.map +1 -1
- package/dist/mcp/tools/search-candidates.d.ts +20 -0
- package/dist/mcp/tools/search-candidates.js +93 -0
- package/dist/mcp/tools/search-candidates.js.map +1 -0
- package/dist/mcp/tools/search.js +5 -4
- package/dist/mcp/tools/search.js.map +1 -1
- package/dist/mcp/tools/supersedes-chain.js +2 -2
- package/dist/mcp/tools/supersedes-chain.js.map +1 -1
- package/dist/mcp/tools/task-create.d.ts +1 -0
- package/dist/mcp/tools/task-create.js +2 -0
- package/dist/mcp/tools/task-create.js.map +1 -1
- package/dist/mcp/tools/timeline.js +1 -1
- package/dist/mcp/tools/timeline.js.map +1 -1
- package/dist/mcp/tools/types.d.ts +1 -0
- package/dist/mcp/tools/types.js +9 -1
- package/dist/mcp/tools/types.js.map +1 -1
- package/dist/sensors/attestation.d.ts +1 -1
- package/dist/sensors/attestation.js +2 -2
- package/dist/sensors/attestation.js.map +1 -1
- package/dist/sensors/catalog.d.ts +26 -28
- package/dist/sensors/catalog.js +79 -81
- package/dist/sensors/catalog.js.map +1 -1
- package/dist/sensors/decisions.d.ts +1 -1
- package/dist/sensors/decisions.js +15 -14
- package/dist/sensors/decisions.js.map +1 -1
- package/dist/sensors/diff.js +46 -22
- package/dist/sensors/diff.js.map +1 -1
- package/dist/sensors/runner.d.ts +2 -2
- package/dist/sensors/runner.js +3 -3
- package/dist/sensors/shell.d.ts +4 -0
- package/dist/sensors/shell.js +16 -0
- package/dist/sensors/shell.js.map +1 -0
- package/dist/sensors/structural.d.ts +3 -2
- package/dist/sensors/structural.js +3 -11
- package/dist/sensors/structural.js.map +1 -1
- package/dist/sensors/stub-catalog.d.ts +2 -1
- package/dist/sensors/stub-catalog.js +2 -9
- package/dist/sensors/stub-catalog.js.map +1 -1
- package/dist/sensors/types.d.ts +3 -4
- package/dist/sensors/types.js +1 -2
- package/dist/sensors/types.js.map +1 -1
- package/dist/session-start/build.js +1 -1
- package/dist/session-start/build.js.map +1 -1
- package/dist/status-line/event-queue.js +1 -1
- package/dist/status-line/index.d.ts +1 -1
- package/package.json +3 -2
- package/templates/.cairn/config/sensors.yaml +8 -8
- package/templates/attention-ui/app.js +101 -39
- package/dist/fs.d.ts +0 -5
- package/dist/fs.js +0 -11
- package/dist/fs.js.map +0 -1
- package/dist/ground/alignment-pending.d.ts +0 -28
- package/dist/ground/alignment-pending.js +0 -83
- package/dist/ground/alignment-pending.js.map +0 -1
- package/dist/ground/anchor-map.d.ts +0 -14
- package/dist/ground/anchor-map.js +0 -56
- package/dist/ground/anchor-map.js.map +0 -1
- package/dist/ground/drift.d.ts +0 -8
- package/dist/ground/drift.js +0 -23
- package/dist/ground/drift.js.map +0 -1
- package/dist/ground/frontmatter.d.ts +0 -32
- package/dist/ground/frontmatter.js +0 -77
- package/dist/ground/frontmatter.js.map +0 -1
- package/dist/ground/glob.d.ts +0 -10
- package/dist/ground/glob.js +0 -46
- package/dist/ground/glob.js.map +0 -1
- package/dist/ground/index.d.ts +0 -23
- package/dist/ground/index.js +0 -17
- package/dist/ground/index.js.map +0 -1
- package/dist/ground/ledgers.d.ts +0 -14
- package/dist/ground/ledgers.js +0 -105
- package/dist/ground/ledgers.js.map +0 -1
- package/dist/ground/manifest.d.ts +0 -10
- package/dist/ground/manifest.js +0 -84
- package/dist/ground/manifest.js.map +0 -1
- package/dist/ground/paths.d.ts +0 -41
- package/dist/ground/paths.js +0 -103
- package/dist/ground/paths.js.map +0 -1
- package/dist/ground/quality-grades.d.ts +0 -11
- package/dist/ground/quality-grades.js +0 -100
- package/dist/ground/quality-grades.js.map +0 -1
- package/dist/ground/schemas.d.ts +0 -502
- package/dist/ground/schemas.js +0 -318
- package/dist/ground/schemas.js.map +0 -1
- package/dist/ground/scope-index.d.ts +0 -96
- package/dist/ground/scope-index.js +0 -290
- package/dist/ground/scope-index.js.map +0 -1
- package/dist/ground/slug.d.ts +0 -60
- package/dist/ground/slug.js +0 -103
- package/dist/ground/slug.js.map +0 -1
- package/dist/ground/sot-bindings.d.ts +0 -14
- package/dist/ground/sot-bindings.js +0 -79
- package/dist/ground/sot-bindings.js.map +0 -1
- package/dist/ground/sot-cache.d.ts +0 -18
- package/dist/ground/sot-cache.js +0 -62
- package/dist/ground/sot-cache.js.map +0 -1
- package/dist/ground/topic-index.d.ts +0 -27
- package/dist/ground/topic-index.js +0 -82
- package/dist/ground/topic-index.js.map +0 -1
- package/dist/ground/walk.d.ts +0 -7
- package/dist/ground/walk.js +0 -53
- package/dist/ground/walk.js.map +0 -1
- package/dist/hooks/post-tool-use/ledger-cache.d.ts +0 -40
- package/dist/hooks/post-tool-use/ledger-cache.js +0 -290
- package/dist/hooks/post-tool-use/ledger-cache.js.map +0 -1
- package/dist/init/phases/10-strip.d.ts +0 -11
- package/dist/init/phases/10-strip.js.map +0 -1
- package/dist/init/phases/3b-seed.js.map +0 -1
- package/dist/init/phases/5-brand.js.map +0 -1
- package/dist/init/phases/5b-topic-index.js.map +0 -1
- package/dist/init/phases/6-docs-ingest.d.ts +0 -10
- package/dist/init/phases/6-docs-ingest.js.map +0 -1
- package/dist/init/phases/7b-source-comments.d.ts +0 -15
- package/dist/init/phases/7b-source-comments.js.map +0 -1
- package/dist/init/phases/7c-rules-merge.js.map +0 -1
- package/dist/init/phases/8-baseline.d.ts +0 -10
- package/dist/init/phases/8-baseline.js.map +0 -1
- package/dist/init/phases/parallel-678.js.map +0 -1
- package/dist/mcp/tools/decisions-in-scope.d.ts +0 -7
- package/dist/mcp/tools/decisions-in-scope.js +0 -66
- package/dist/mcp/tools/decisions-in-scope.js.map +0 -1
- package/dist/mcp/tools/invariants-in-scope.d.ts +0 -7
- package/dist/mcp/tools/invariants-in-scope.js +0 -81
- package/dist/mcp/tools/invariants-in-scope.js.map +0 -1
package/dist/ground/schemas.js
DELETED
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export const Audience = z.enum(["ai-only", "dual", "human-only"]);
|
|
3
|
-
export const ProvenanceFrontmatter = z
|
|
4
|
-
.object({
|
|
5
|
-
type: z.string().optional(),
|
|
6
|
-
status: z.string().optional(),
|
|
7
|
-
audience: Audience.optional(),
|
|
8
|
-
generated: z.string().optional(),
|
|
9
|
-
"verified-at": z.string().optional(),
|
|
10
|
-
"source-commits": z.array(z.string()).optional(),
|
|
11
|
-
supersedes: z.string().nullish(),
|
|
12
|
-
})
|
|
13
|
-
.passthrough();
|
|
14
|
-
export const ManifestEntry = z.object({
|
|
15
|
-
path: z.string(),
|
|
16
|
-
sha256: z.string().length(64),
|
|
17
|
-
classification: z.string(),
|
|
18
|
-
audience: z.string().optional(),
|
|
19
|
-
verified_at: z.string().optional(),
|
|
20
|
-
generator: z.string().optional(),
|
|
21
|
-
source: z.string().optional(),
|
|
22
|
-
related_invariants: z.array(z.string()).optional(),
|
|
23
|
-
});
|
|
24
|
-
export const Manifest = z.object({
|
|
25
|
-
version: z.literal(1),
|
|
26
|
-
generated: z.string(),
|
|
27
|
-
generator: z.string().optional(),
|
|
28
|
-
files: z.array(ManifestEntry),
|
|
29
|
-
});
|
|
30
|
-
export const DecisionAssertion = z.discriminatedUnion("kind", [
|
|
31
|
-
z.object({
|
|
32
|
-
id: z.string(),
|
|
33
|
-
kind: z.literal("schema_must_contain"),
|
|
34
|
-
table: z.string(),
|
|
35
|
-
column: z.string(),
|
|
36
|
-
column_type: z.string().optional(),
|
|
37
|
-
nullable: z.boolean().optional(),
|
|
38
|
-
}),
|
|
39
|
-
z.object({
|
|
40
|
-
id: z.string(),
|
|
41
|
-
kind: z.literal("text_must_match"),
|
|
42
|
-
pattern: z.string(),
|
|
43
|
-
in_globs: z.array(z.string()),
|
|
44
|
-
}),
|
|
45
|
-
z.object({
|
|
46
|
-
id: z.string(),
|
|
47
|
-
kind: z.literal("text_must_not_match"),
|
|
48
|
-
pattern: z.string(),
|
|
49
|
-
in_globs: z.array(z.string()),
|
|
50
|
-
}),
|
|
51
|
-
z.object({
|
|
52
|
-
id: z.string(),
|
|
53
|
-
kind: z.literal("index_must_exist"),
|
|
54
|
-
table: z.string(),
|
|
55
|
-
columns: z.array(z.string()),
|
|
56
|
-
where: z.string().optional(),
|
|
57
|
-
}),
|
|
58
|
-
z.object({
|
|
59
|
-
id: z.string(),
|
|
60
|
-
kind: z.literal("ast_pattern"),
|
|
61
|
-
language: z.string(),
|
|
62
|
-
pattern: z.string(),
|
|
63
|
-
in_globs: z.array(z.string()),
|
|
64
|
-
}),
|
|
65
|
-
z.object({
|
|
66
|
-
id: z.string(),
|
|
67
|
-
kind: z.literal("file_must_not_be_modified"),
|
|
68
|
-
path: z.string(),
|
|
69
|
-
}),
|
|
70
|
-
z.object({
|
|
71
|
-
id: z.string(),
|
|
72
|
-
kind: z.literal("query_must_filter_by"),
|
|
73
|
-
orm: z.string(),
|
|
74
|
-
in_globs: z.array(z.string()),
|
|
75
|
-
table: z.string(),
|
|
76
|
-
columns: z.array(z.string()),
|
|
77
|
-
operator: z.enum(["eq", "in", "between", "is_not_null"]),
|
|
78
|
-
require_combination: z.enum(["and", "or"]),
|
|
79
|
-
}),
|
|
80
|
-
z.object({
|
|
81
|
-
id: z.string(),
|
|
82
|
-
kind: z.literal("route_must_have_guard"),
|
|
83
|
-
in_globs: z.array(z.string()),
|
|
84
|
-
guard: z.string(),
|
|
85
|
-
require_on: z.array(z.string()),
|
|
86
|
-
}),
|
|
87
|
-
z.object({
|
|
88
|
-
id: z.string(),
|
|
89
|
-
kind: z.literal("event_must_emit"),
|
|
90
|
-
in_globs: z.array(z.string()),
|
|
91
|
-
after_method: z.string(),
|
|
92
|
-
event_key: z.string(),
|
|
93
|
-
payload_must_include: z.array(z.string()).optional(),
|
|
94
|
-
}),
|
|
95
|
-
z.object({
|
|
96
|
-
id: z.string(),
|
|
97
|
-
kind: z.literal("service_method_must_call"),
|
|
98
|
-
in_globs: z.array(z.string()),
|
|
99
|
-
in_method: z.string(),
|
|
100
|
-
must_call: z.string(),
|
|
101
|
-
before_returning: z.boolean().optional(),
|
|
102
|
-
}),
|
|
103
|
-
z.object({
|
|
104
|
-
id: z.string(),
|
|
105
|
-
kind: z.literal("human_review_hint"),
|
|
106
|
-
description: z.string(),
|
|
107
|
-
}),
|
|
108
|
-
]);
|
|
109
|
-
/**
|
|
110
|
-
* sot_kind = where the canonical prose lives for this DEC.
|
|
111
|
-
* "ledger" — body in this DEC file is canonical (source-comment essay,
|
|
112
|
-
* operator-recorded). Lens renders body verbatim.
|
|
113
|
-
* "path" — sot_path points at the canonical location (doc paragraph,
|
|
114
|
-
* CLAUDE.md section). Lens renders live content from there.
|
|
115
|
-
*/
|
|
116
|
-
export const SotKind = z.enum(["ledger", "path"]);
|
|
117
|
-
export const DecisionFrontmatter = z
|
|
118
|
-
.object({
|
|
119
|
-
id: z.string().regex(/^DEC-[0-9a-f]{7,}$/, "decision id must match DEC-<hash7>"),
|
|
120
|
-
title: z.string(),
|
|
121
|
-
type: z.literal("adr").optional(),
|
|
122
|
-
status: z
|
|
123
|
-
.string()
|
|
124
|
-
.refine((s) => s === "accepted" ||
|
|
125
|
-
s === "superseded" ||
|
|
126
|
-
s === "archived" ||
|
|
127
|
-
/^draft(?:-from-[a-z-]+)?$/.test(s), "decision status must be draft | draft-from-<source> | accepted | superseded | archived"),
|
|
128
|
-
audience: Audience.optional(),
|
|
129
|
-
generated: z.string().optional(),
|
|
130
|
-
"verified-at": z.string().optional(),
|
|
131
|
-
"source-commits": z.array(z.string()).optional(),
|
|
132
|
-
decided_at: z.string().optional(),
|
|
133
|
-
decided_by: z.string().optional(),
|
|
134
|
-
scope_globs: z.array(z.string()).optional(),
|
|
135
|
-
supersedes: z.string().nullish(),
|
|
136
|
-
superseded_by: z.string().nullish(),
|
|
137
|
-
assertions: z.array(DecisionAssertion).optional(),
|
|
138
|
-
human_review_hint: z.string().optional(),
|
|
139
|
-
related_invariants: z.array(z.string()).optional(),
|
|
140
|
-
sot_kind: SotKind,
|
|
141
|
-
sot_path: z.string().min(1),
|
|
142
|
-
sot_content_hash: z.string().length(64),
|
|
143
|
-
related: z.string().nullish(),
|
|
144
|
-
derived_from: z.string().nullish(),
|
|
145
|
-
})
|
|
146
|
-
.passthrough();
|
|
147
|
-
export const InvariantFrontmatter = z
|
|
148
|
-
.object({
|
|
149
|
-
id: z.string().regex(/^INV-[0-9a-f]{7,}$/, "invariant id must match INV-<hash7>"),
|
|
150
|
-
title: z.string(),
|
|
151
|
-
type: z.literal("invariant").optional(),
|
|
152
|
-
status: z.enum(["active", "superseded", "archived"]).optional(),
|
|
153
|
-
audience: Audience.optional(),
|
|
154
|
-
generated: z.string().optional(),
|
|
155
|
-
"verified-at": z.string().optional(),
|
|
156
|
-
source_run: z.string().optional(),
|
|
157
|
-
source_decision: z.string().nullish(),
|
|
158
|
-
introduced_for_bug: z.string().optional(),
|
|
159
|
-
sensor: z.string().optional(),
|
|
160
|
-
e2e: z.string().optional(),
|
|
161
|
-
naming_convention: z.string().optional(),
|
|
162
|
-
superseded_by: z.string().nullish(),
|
|
163
|
-
sot_kind: SotKind,
|
|
164
|
-
sot_path: z.string().min(1),
|
|
165
|
-
sot_content_hash: z.string().length(64),
|
|
166
|
-
related: z.string().nullish(),
|
|
167
|
-
derived_from: z.string().nullish(),
|
|
168
|
-
})
|
|
169
|
-
.passthrough();
|
|
170
|
-
export const DecisionLedgerEntry = z.object({
|
|
171
|
-
id: z.string(),
|
|
172
|
-
title: z.string(),
|
|
173
|
-
status: z.string(),
|
|
174
|
-
scope_globs: z.array(z.string()).optional(),
|
|
175
|
-
supersedes: z.string().nullish(),
|
|
176
|
-
superseded_by: z.string().nullish(),
|
|
177
|
-
});
|
|
178
|
-
export const InvariantLedgerEntry = z.object({
|
|
179
|
-
id: z.string(),
|
|
180
|
-
title: z.string(),
|
|
181
|
-
status: z.string(),
|
|
182
|
-
source_decision: z.string().nullish(),
|
|
183
|
-
superseded_by: z.string().nullish(),
|
|
184
|
-
});
|
|
185
|
-
export const QualityGrade = z.object({
|
|
186
|
-
module: z.string(),
|
|
187
|
-
score: z.number().min(0).max(100),
|
|
188
|
-
pass_rate: z.number().min(0).max(1),
|
|
189
|
-
drift_count: z.number().int().nonnegative(),
|
|
190
|
-
last_updated: z.string(),
|
|
191
|
-
recent_run_count: z.number().int().nonnegative(),
|
|
192
|
-
});
|
|
193
|
-
export const QualityGrades = z.object({
|
|
194
|
-
version: z.literal(1),
|
|
195
|
-
generated: z.string(),
|
|
196
|
-
modules: z.array(QualityGrade),
|
|
197
|
-
});
|
|
198
|
-
/**
|
|
199
|
-
* Topic-index entry — one row per content-fingerprint slug across all
|
|
200
|
-
* scanned sources. `sot_source` is the canonical source path picked by
|
|
201
|
-
* priority order (docs/* > CLAUDE.md > AGENTS.md > source comments).
|
|
202
|
-
* `candidates` lists every place the same prose appears (one becomes the
|
|
203
|
-
* SoT, the rest become §DEC-<id> cites).
|
|
204
|
-
*/
|
|
205
|
-
export const TopicIndexEntry = z.object({
|
|
206
|
-
slug: z.string(),
|
|
207
|
-
dec_id: z.string().optional(),
|
|
208
|
-
sot_source: z.string(),
|
|
209
|
-
candidates: z.array(z.object({
|
|
210
|
-
file: z.string(),
|
|
211
|
-
kind: z.enum(["doc", "claudemd", "agentsmd", "rule", "source-comment"]),
|
|
212
|
-
anchor: z.string().optional(),
|
|
213
|
-
line_range: z.tuple([z.number().int(), z.number().int()]).optional(),
|
|
214
|
-
})),
|
|
215
|
-
created_at: z.string(),
|
|
216
|
-
});
|
|
217
|
-
export const TopicIndex = z.object({
|
|
218
|
-
version: z.literal(1),
|
|
219
|
-
generated: z.string(),
|
|
220
|
-
topics: z.record(z.string(), TopicIndexEntry),
|
|
221
|
-
});
|
|
222
|
-
/**
|
|
223
|
-
* SoT bindings — bidirectional map between DEC ids and their canonical
|
|
224
|
-
* source paths. Forward index is one-to-one. Reverse index is one-to-many
|
|
225
|
-
* because supersedes chains keep the same sot_path across multiple DEC
|
|
226
|
-
* ids.
|
|
227
|
-
*/
|
|
228
|
-
export const SotBindings = z.object({
|
|
229
|
-
version: z.literal(1),
|
|
230
|
-
generated: z.string(),
|
|
231
|
-
forward: z.record(z.string(), z.string()),
|
|
232
|
-
reverse: z.record(z.string(), z.array(z.string())),
|
|
233
|
-
});
|
|
234
|
-
/**
|
|
235
|
-
* Sot-cache — tokenized DEC body shingles for Jaccard pre-filter in the
|
|
236
|
-
* Layer A alignment hook. Mtime-keyed so the cache rebuilds incrementally
|
|
237
|
-
* on PostToolUse Write events.
|
|
238
|
-
*/
|
|
239
|
-
export const SotCacheEntry = z.object({
|
|
240
|
-
dec_id: z.string(),
|
|
241
|
-
sot_path: z.string(),
|
|
242
|
-
body_hash: z.string().length(64),
|
|
243
|
-
tokens: z.array(z.string()),
|
|
244
|
-
shingles: z.array(z.string()),
|
|
245
|
-
mtime_ms: z.number(),
|
|
246
|
-
});
|
|
247
|
-
export const SotCache = z.object({
|
|
248
|
-
version: z.literal(1),
|
|
249
|
-
generated: z.string(),
|
|
250
|
-
entries: z.record(z.string(), SotCacheEntry),
|
|
251
|
-
});
|
|
252
|
-
/**
|
|
253
|
-
* Anchor-map — external map from topic slug to its current location in
|
|
254
|
-
* source. Allows operator's docs to stay pristine (no `<!-- cairn-anchor -->`
|
|
255
|
-
* injected) while drift detection reconciles via content_hash.
|
|
256
|
-
*/
|
|
257
|
-
export const AnchorMapEntry = z.object({
|
|
258
|
-
file: z.string(),
|
|
259
|
-
current_anchor: z.string().optional(),
|
|
260
|
-
content_hash: z.string().length(64),
|
|
261
|
-
line_range: z.tuple([z.number().int(), z.number().int()]).optional(),
|
|
262
|
-
kind: z.enum(["doc", "claudemd", "agentsmd", "rule", "source-comment"]),
|
|
263
|
-
});
|
|
264
|
-
export const AnchorMap = z.object({
|
|
265
|
-
version: z.literal(1),
|
|
266
|
-
generated: z.string(),
|
|
267
|
-
anchors: z.record(z.string(), AnchorMapEntry),
|
|
268
|
-
});
|
|
269
|
-
export const DriftEvent = z.object({
|
|
270
|
-
ts: z.string(),
|
|
271
|
-
kind: z.enum([
|
|
272
|
-
"frontmatter_stale",
|
|
273
|
-
"generator_drift",
|
|
274
|
-
"broken_link",
|
|
275
|
-
"orphan_path",
|
|
276
|
-
"manifest_hash_changed",
|
|
277
|
-
"doc-drift",
|
|
278
|
-
"paragraph-deleted",
|
|
279
|
-
"pre-commit-drift",
|
|
280
|
-
]),
|
|
281
|
-
path: z.string(),
|
|
282
|
-
detail: z.string().optional(),
|
|
283
|
-
severity: z.enum(["soft", "hard"]).default("soft"),
|
|
284
|
-
dec_id: z.string().optional(),
|
|
285
|
-
});
|
|
286
|
-
/**
|
|
287
|
-
* Layer B pre-commit-drift log entry written by the git pre-commit
|
|
288
|
-
* hook (`cairn hook pre-commit-align`). Layer C SessionStart drain
|
|
289
|
-
* consumes this file, re-checks each entry against the (possibly
|
|
290
|
-
* changed) source location, and runs the Haiku judge for ambiguous
|
|
291
|
-
* candidates.
|
|
292
|
-
*
|
|
293
|
-
* Path: `.cairn/staleness/pre-commit-deferred.jsonl`.
|
|
294
|
-
*
|
|
295
|
-
* `tier: tier1` — deterministic match passed (Jaccard ≥ 0.85, shingle
|
|
296
|
-
* ≥ 0.6, length ratio 0.5–2.0). Layer C can auto-cite without Haiku
|
|
297
|
-
* if the block survives.
|
|
298
|
-
*
|
|
299
|
-
* `tier: tier2-3` — Jaccard pre-filter survivors only; Tier 1 didn't
|
|
300
|
-
* fire. Layer C invokes Haiku dedup judge.
|
|
301
|
-
*/
|
|
302
|
-
export const PreCommitDriftCandidate = z.object({
|
|
303
|
-
id: z.string(),
|
|
304
|
-
similarity: z.number(),
|
|
305
|
-
body_hash: z.string(),
|
|
306
|
-
sot_path: z.string(),
|
|
307
|
-
});
|
|
308
|
-
export const PreCommitDriftLogEntry = z.object({
|
|
309
|
-
ts: z.string(),
|
|
310
|
-
file: z.string(),
|
|
311
|
-
block_start_line: z.number(),
|
|
312
|
-
block_end_line: z.number(),
|
|
313
|
-
block_content_hash: z.string(),
|
|
314
|
-
block_prose: z.string(),
|
|
315
|
-
tier: z.enum(["tier1", "tier2-3"]),
|
|
316
|
-
candidates: z.array(PreCommitDriftCandidate),
|
|
317
|
-
});
|
|
318
|
-
//# sourceMappingURL=schemas.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/ground/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;AAGlE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,MAAM,EAAE,CAAC,CAAC,MAA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,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAClC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC;CAC7C,CAAC,CAAC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Scope index — forward map from every file path in the repo to the decisions
|
|
3
|
-
* and invariants that apply to that file.
|
|
4
|
-
*
|
|
5
|
-
* Built at init by the Tier-2 mapper LLM, maintained by the GC sweep + the
|
|
6
|
-
* MCP record-decision tool when scope edits land. Read by the read-enricher
|
|
7
|
-
* / write-guardian hooks (via cached accessor in
|
|
8
|
-
* `hooks/post-tool-use/ledger-cache.ts`) and by the GC scope-coverage pass.
|
|
9
|
-
*
|
|
10
|
-
* Spec: docs/FILESYSTEM_LAYOUT.md §2.1.
|
|
11
|
-
*/
|
|
12
|
-
export interface ScopeIndexEntry {
|
|
13
|
-
decisions: string[];
|
|
14
|
-
invariants: string[];
|
|
15
|
-
unscoped?: true;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Mapper LLMs occasionally emit ledger-entry PROSE ("HTTP layer is the only
|
|
19
|
-
* public surface…") into `decisions[]` / `invariants[]` instead of bare IDs,
|
|
20
|
-
* because the user prompt lists them as `${id} — ${title}` and the JSON-mode
|
|
21
|
-
* schema only constrains the type to `string`. This coercer extracts the
|
|
22
|
-
* first ID-shaped token from each string and silently drops anything that
|
|
23
|
-
* doesn't match — IDs only, deduplicated, order preserved.
|
|
24
|
-
*/
|
|
25
|
-
export declare function coerceDecisionIds(raw: readonly unknown[]): string[];
|
|
26
|
-
export declare function coerceInvariantIds(raw: readonly unknown[]): string[];
|
|
27
|
-
export interface ScopeIndex {
|
|
28
|
-
generated: string;
|
|
29
|
-
files: Record<string, ScopeIndexEntry>;
|
|
30
|
-
}
|
|
31
|
-
export declare function scopeIndexPath(repoRoot: string): string;
|
|
32
|
-
export declare function readScopeIndex(repoRoot: string): ScopeIndex | null;
|
|
33
|
-
export declare function lookupScope(index: ScopeIndex, repoRelativePath: string): ScopeIndexEntry | null;
|
|
34
|
-
export declare function writeScopeIndex(repoRoot: string, index: ScopeIndex): void;
|
|
35
|
-
export interface RescanScopeIndexResult {
|
|
36
|
-
filesScanned: number;
|
|
37
|
-
entriesAdded: number;
|
|
38
|
-
entriesUpdated: number;
|
|
39
|
-
entriesUnchanged: number;
|
|
40
|
-
/** True when scope-index.yaml was rewritten. */
|
|
41
|
-
dirty: boolean;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Deterministic regex sweep — walk every git-tracked source file, parse
|
|
45
|
-
* `§INV-NNNN` / `§DEC-NNNN` cite tokens, and sync the scope-index so the
|
|
46
|
-
* in-scope tools never lag behind source-cite reality. No LLM, no
|
|
47
|
-
* incremental tracking complexity. Cheap enough to run on every
|
|
48
|
-
* SessionStart (~100ms on 50k files).
|
|
49
|
-
*
|
|
50
|
-
* Honors `unscoped: true` entries — never touches them. Skips files with
|
|
51
|
-
* no citations and no prior entry to avoid polluting the index. When a
|
|
52
|
-
* file's cite set differs from its scope-index entry (added, removed, or
|
|
53
|
-
* stale ids), the entry is rewritten with the deterministically-sorted
|
|
54
|
-
* current set.
|
|
55
|
-
*/
|
|
56
|
-
export declare function rescanScopeIndex(repoRoot: string): RescanScopeIndexResult;
|
|
57
|
-
/**
|
|
58
|
-
* Single-file scope-index sync from in-memory content. Called by the
|
|
59
|
-
* PostToolUse(Write/Edit) hook so an agent's writes don't leave the
|
|
60
|
-
* scope-index stale until the next SessionStart rescan. Same regex
|
|
61
|
-
* parser as `rescanScopeIndex`, but bounded to one file — O(1) cost,
|
|
62
|
-
* no walker.
|
|
63
|
-
*
|
|
64
|
-
* Honors `unscoped: true` entries (skips them). Honors the same skip
|
|
65
|
-
* rule the rescan does: file with no citations and no prior entry is
|
|
66
|
-
* a no-op so we don't pollute the index with empty rows.
|
|
67
|
-
*/
|
|
68
|
-
export declare function syncFileScopeFromContent(repoRoot: string, repoRelPath: string, content: string): {
|
|
69
|
-
dirty: boolean;
|
|
70
|
-
};
|
|
71
|
-
export interface RebuildScopeIndexOptions {
|
|
72
|
-
repoRoot: string;
|
|
73
|
-
/** Hard timeout for the mapper LLM call (ms). Default 300000. */
|
|
74
|
-
timeoutMs?: number;
|
|
75
|
-
}
|
|
76
|
-
export interface RebuildScopeIndexResult {
|
|
77
|
-
/** Absolute path to the file written. */
|
|
78
|
-
path: string;
|
|
79
|
-
/** Total scope-index entries after the rescan (added + updated + unchanged). */
|
|
80
|
-
filesClassified: number;
|
|
81
|
-
/** Wall-clock ms for the rescan. */
|
|
82
|
-
durationMs: number;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* `cairn scope rebuild` — full deterministic resync of `.cairn/ground/
|
|
86
|
-
* scope-index.yaml` from current source-cite reality. Used to be a
|
|
87
|
-
* Sonnet call (`runMapper`-style) that re-classified files via the
|
|
88
|
-
* Tier-2 mapper, but classification was always the wrong abstraction
|
|
89
|
-
* — bare-symbol citations in source are the canonical source of truth,
|
|
90
|
-
* `rescanScopeIndex` parses them deterministically, and the result
|
|
91
|
-
* matches what the read-enricher legend actually shows.
|
|
92
|
-
*
|
|
93
|
-
* No LLM. No tokens. No mapper. Just a regex sweep over git-tracked
|
|
94
|
-
* source files and an atomic write.
|
|
95
|
-
*/
|
|
96
|
-
export declare function rebuildScopeIndex(opts: RebuildScopeIndexOptions): Promise<RebuildScopeIndexResult>;
|