@isaacriehm/cairn-core 0.1.10 → 0.3.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/dist/.tsbuildinfo +1 -1
- package/dist/claude/runner.d.ts +1 -1
- package/dist/claude/runner.js +62 -1
- package/dist/claude/runner.js.map +1 -1
- package/dist/claude/types.d.ts +14 -7
- package/dist/claude/types.js +5 -7
- package/dist/claude/types.js.map +1 -1
- package/dist/context/index.d.ts +4 -4
- package/dist/context/index.js +3 -4
- package/dist/context/index.js.map +1 -1
- package/dist/context/spec-delta.js +3 -4
- package/dist/context/spec-delta.js.map +1 -1
- package/dist/context/task-summary.d.ts +18 -0
- package/dist/context/task-summary.js +89 -0
- package/dist/context/task-summary.js.map +1 -0
- package/dist/decision-capture/id.d.ts +21 -4
- package/dist/decision-capture/id.js +56 -5
- package/dist/decision-capture/id.js.map +1 -1
- package/dist/decision-capture/index.d.ts +7 -22
- package/dist/decision-capture/index.js +7 -17
- package/dist/decision-capture/index.js.map +1 -1
- package/dist/doctor/index.d.ts +2 -2
- package/dist/doctor/index.js +5 -60
- package/dist/doctor/index.js.map +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.js +1 -1
- package/dist/events/writer.d.ts +1 -1
- package/dist/events/writer.js +1 -1
- package/dist/gc/canary.d.ts +13 -23
- package/dist/gc/canary.js +36 -92
- package/dist/gc/canary.js.map +1 -1
- package/dist/gc/citation-integrity.d.ts +6 -6
- package/dist/gc/citation-integrity.js +64 -20
- package/dist/gc/citation-integrity.js.map +1 -1
- package/dist/gc/frontmatter.js +1 -1
- package/dist/gc/generator-drift.js +1 -1
- package/dist/gc/generator-drift.js.map +1 -1
- package/dist/gc/index.d.ts +2 -2
- package/dist/gc/index.js +1 -1
- package/dist/gc/index.js.map +1 -1
- package/dist/gc/quality-update.d.ts +4 -4
- package/dist/gc/quality-update.js +5 -5
- package/dist/gc/quality-update.js.map +1 -1
- package/dist/gc/types.d.ts +1 -30
- package/dist/ground/index.d.ts +2 -2
- package/dist/ground/index.js +1 -1
- package/dist/ground/index.js.map +1 -1
- package/dist/ground/ledgers.d.ts +0 -4
- package/dist/ground/ledgers.js +10 -8
- package/dist/ground/ledgers.js.map +1 -1
- package/dist/ground/manifest.js +0 -4
- package/dist/ground/manifest.js.map +1 -1
- package/dist/ground/paths.js +0 -1
- package/dist/ground/paths.js.map +1 -1
- package/dist/ground/quality-grades.js +3 -1
- package/dist/ground/quality-grades.js.map +1 -1
- package/dist/ground/schemas.d.ts +2 -7
- package/dist/ground/schemas.js +7 -2
- package/dist/ground/schemas.js.map +1 -1
- package/dist/ground/scope-index.d.ts +62 -14
- package/dist/ground/scope-index.js +215 -45
- package/dist/ground/scope-index.js.map +1 -1
- package/dist/hooks/bypass-detection.js +14 -17
- package/dist/hooks/bypass-detection.js.map +1 -1
- package/dist/hooks/defer.d.ts +50 -0
- package/dist/hooks/defer.js +87 -0
- package/dist/hooks/defer.js.map +1 -0
- package/dist/hooks/post-tool-use/citation-scanner.d.ts +7 -5
- package/dist/hooks/post-tool-use/citation-scanner.js +15 -9
- package/dist/hooks/post-tool-use/citation-scanner.js.map +1 -1
- package/dist/hooks/post-tool-use/copy-scanner.js +1 -1
- package/dist/hooks/post-tool-use/copy-scanner.js.map +1 -1
- package/dist/hooks/post-tool-use/ledger-cache.d.ts +10 -2
- package/dist/hooks/post-tool-use/ledger-cache.js +58 -4
- package/dist/hooks/post-tool-use/ledger-cache.js.map +1 -1
- package/dist/hooks/post-tool-use/legend-builder.d.ts +3 -3
- package/dist/hooks/post-tool-use/legend-builder.js +30 -8
- package/dist/hooks/post-tool-use/legend-builder.js.map +1 -1
- package/dist/hooks/post-tool-use/read-enricher.d.ts +1 -1
- package/dist/hooks/post-tool-use/read-enricher.js +68 -21
- package/dist/hooks/post-tool-use/read-enricher.js.map +1 -1
- package/dist/hooks/post-tool-use/write-guardian.js +148 -18
- package/dist/hooks/post-tool-use/write-guardian.js.map +1 -1
- package/dist/hooks/runners/index.d.ts +3 -0
- package/dist/hooks/runners/index.js +2 -0
- package/dist/hooks/runners/index.js.map +1 -1
- package/dist/hooks/runners/payload.d.ts +1 -1
- package/dist/hooks/runners/payload.js +27 -12
- package/dist/hooks/runners/payload.js.map +1 -1
- package/dist/hooks/runners/session-start.js +250 -75
- package/dist/hooks/runners/session-start.js.map +1 -1
- package/dist/hooks/runners/stop.d.ts +9 -12
- package/dist/hooks/runners/stop.js +129 -41
- package/dist/hooks/runners/stop.js.map +1 -1
- package/dist/hooks/runners/user-prompt-submit.d.ts +15 -0
- package/dist/hooks/runners/user-prompt-submit.js +149 -0
- package/dist/hooks/runners/user-prompt-submit.js.map +1 -0
- package/dist/hooks/seed-attested.d.ts +25 -0
- package/dist/hooks/seed-attested.js +84 -0
- package/dist/hooks/seed-attested.js.map +1 -0
- package/dist/hooks/user-prompt-submit.d.ts +7 -0
- package/dist/hooks/user-prompt-submit.js +12 -0
- package/dist/hooks/user-prompt-submit.js.map +1 -0
- package/dist/index.d.ts +3 -6
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/dist/init/baseline-audit.d.ts +5 -1
- package/dist/init/baseline-audit.js +25 -2
- package/dist/init/baseline-audit.js.map +1 -1
- package/dist/init/glob-inference.d.ts +16 -0
- package/dist/init/glob-inference.js +108 -0
- package/dist/init/glob-inference.js.map +1 -0
- package/dist/init/index.d.ts +4 -0
- package/dist/init/index.js +2 -0
- package/dist/init/index.js.map +1 -1
- package/dist/init/ingest-docs.d.ts +1 -1
- package/dist/init/ingest-docs.js +19 -6
- package/dist/init/ingest-docs.js.map +1 -1
- package/dist/init/init.js +17 -94
- package/dist/init/init.js.map +1 -1
- package/dist/init/mapper-merge.d.ts +8 -2
- package/dist/init/mapper-merge.js +50 -32
- package/dist/init/mapper-merge.js.map +1 -1
- package/dist/init/mapper-parallel.d.ts +2 -3
- package/dist/init/mapper-parallel.js +9 -38
- package/dist/init/mapper-parallel.js.map +1 -1
- package/dist/init/mapper-prompts.js +1 -1
- package/dist/init/mapper-prompts.js.map +1 -1
- package/dist/init/mapper.d.ts +7 -128
- package/dist/init/mapper.js +30 -7
- package/dist/init/mapper.js.map +1 -1
- package/dist/init/module-slicer.d.ts +1 -1
- package/dist/init/module-slicer.js +1 -1
- package/dist/init/multi-dev/install.d.ts +9 -10
- package/dist/init/multi-dev/install.js +15 -84
- package/dist/init/multi-dev/install.js.map +1 -1
- package/dist/init/overlay.d.ts +14 -0
- package/dist/init/overlay.js +65 -0
- package/dist/init/overlay.js.map +1 -0
- package/dist/init/phases/1-detect.d.ts +10 -0
- package/dist/init/phases/1-detect.js +36 -0
- package/dist/init/phases/1-detect.js.map +1 -0
- package/dist/init/phases/10-strip.d.ts +11 -0
- package/dist/init/phases/10-strip.js +79 -0
- package/dist/init/phases/10-strip.js.map +1 -0
- package/dist/init/phases/12-multidev.d.ts +6 -0
- package/dist/init/phases/12-multidev.js +34 -0
- package/dist/init/phases/12-multidev.js.map +1 -0
- package/dist/init/phases/2-walker.d.ts +8 -0
- package/dist/init/phases/2-walker.js +34 -0
- package/dist/init/phases/2-walker.js.map +1 -0
- package/dist/init/phases/3-mapper.d.ts +14 -0
- package/dist/init/phases/3-mapper.js +56 -0
- package/dist/init/phases/3-mapper.js.map +1 -0
- package/dist/init/phases/3b-seed.d.ts +18 -0
- package/dist/init/phases/3b-seed.js +140 -0
- package/dist/init/phases/3b-seed.js.map +1 -0
- package/dist/init/phases/4-pilot.d.ts +10 -0
- package/dist/init/phases/4-pilot.js +108 -0
- package/dist/init/phases/4-pilot.js.map +1 -0
- package/dist/init/phases/5-brand.d.ts +10 -0
- package/dist/init/phases/5-brand.js +66 -0
- package/dist/init/phases/5-brand.js.map +1 -0
- package/dist/init/phases/6-docs-ingest.d.ts +11 -0
- package/dist/init/phases/6-docs-ingest.js +39 -0
- package/dist/init/phases/6-docs-ingest.js.map +1 -0
- package/dist/init/phases/7b-source-comments.d.ts +6 -0
- package/dist/init/phases/7b-source-comments.js +34 -0
- package/dist/init/phases/7b-source-comments.js.map +1 -0
- package/dist/init/phases/7c-rules-merge.d.ts +6 -0
- package/dist/init/phases/7c-rules-merge.js +34 -0
- package/dist/init/phases/7c-rules-merge.js.map +1 -0
- package/dist/init/phases/8-baseline.d.ts +10 -0
- package/dist/init/phases/8-baseline.js +52 -0
- package/dist/init/phases/8-baseline.js.map +1 -0
- package/dist/init/phases/index.d.ts +15 -0
- package/dist/init/phases/index.js +16 -0
- package/dist/init/phases/index.js.map +1 -0
- package/dist/init/phases/orchestrator.d.ts +49 -0
- package/dist/init/phases/orchestrator.js +85 -0
- package/dist/init/phases/orchestrator.js.map +1 -0
- package/dist/init/phases/state-io.d.ts +19 -0
- package/dist/init/phases/state-io.js +73 -0
- package/dist/init/phases/state-io.js.map +1 -0
- package/dist/init/phases/types.d.ts +93 -0
- package/dist/init/phases/types.js +30 -0
- package/dist/init/phases/types.js.map +1 -0
- package/dist/init/prompts.d.ts +6 -8
- package/dist/init/prompts.js +3 -6
- package/dist/init/prompts.js.map +1 -1
- package/dist/init/rules-merge/ingest.js +1 -1
- package/dist/init/seed.js +11 -2
- package/dist/init/seed.js.map +1 -1
- package/dist/init/source-comments/classify.d.ts +1 -41
- package/dist/init/source-comments/classify.js +68 -37
- package/dist/init/source-comments/classify.js.map +1 -1
- package/dist/init/source-comments/index.d.ts +2 -2
- package/dist/init/source-comments/index.js +2 -2
- package/dist/init/source-comments/index.js.map +1 -1
- package/dist/init/source-comments/ingest.d.ts +38 -2
- package/dist/init/source-comments/ingest.js +237 -4
- package/dist/init/source-comments/ingest.js.map +1 -1
- package/dist/init/source-comments/strip-replace.d.ts +10 -19
- package/dist/init/source-comments/strip-replace.js +26 -2
- package/dist/init/source-comments/strip-replace.js.map +1 -1
- package/dist/init/source-comments/walker.d.ts +9 -2
- package/dist/init/source-comments/walker.js +38 -19
- package/dist/init/source-comments/walker.js.map +1 -1
- package/dist/init/submodules.d.ts +3 -2
- package/dist/init/types.d.ts +3 -5
- package/dist/init/types.js +3 -5
- package/dist/init/types.js.map +1 -1
- package/dist/init/visual.d.ts +4 -9
- package/dist/init/visual.js +1 -16
- package/dist/init/visual.js.map +1 -1
- package/dist/init/walker.d.ts +0 -6
- package/dist/init/walker.js +2 -3
- package/dist/init/walker.js.map +1 -1
- package/dist/join/index.js +49 -2
- package/dist/join/index.js.map +1 -1
- package/dist/logger.d.ts +1 -2
- package/dist/logger.js +5 -6
- package/dist/logger.js.map +1 -1
- package/dist/mcp/context.d.ts +2 -3
- package/dist/mcp/context.js.map +1 -1
- package/dist/mcp/errors.d.ts +1 -1
- package/dist/mcp/errors.js.map +1 -1
- package/dist/mcp/history/prompt.d.ts +2 -1
- package/dist/mcp/history/walker.js +1 -1
- package/dist/mcp/history/walker.js.map +1 -1
- package/dist/mcp/path-allowlist.d.ts +0 -6
- package/dist/mcp/path-allowlist.js +0 -10
- package/dist/mcp/path-allowlist.js.map +1 -1
- package/dist/mcp/schemas.d.ts +34 -72
- package/dist/mcp/schemas.js +40 -70
- package/dist/mcp/schemas.js.map +1 -1
- package/dist/mcp/serve.d.ts +1 -1
- package/dist/mcp/serve.js +2 -5
- package/dist/mcp/serve.js.map +1 -1
- package/dist/mcp/server.js +10 -4
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/telemetry.d.ts +8 -1
- package/dist/mcp/telemetry.js +16 -0
- package/dist/mcp/telemetry.js.map +1 -1
- package/dist/mcp/tools/decision-get.js +37 -29
- package/dist/mcp/tools/decision-get.js.map +1 -1
- package/dist/mcp/tools/decisions-in-scope.js +22 -3
- package/dist/mcp/tools/decisions-in-scope.js.map +1 -1
- package/dist/mcp/tools/ground-get.js +2 -2
- package/dist/mcp/tools/ground-get.js.map +1 -1
- package/dist/mcp/tools/index.js +6 -2
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/init-phases.d.ts +24 -0
- package/dist/mcp/tools/init-phases.js +140 -0
- package/dist/mcp/tools/init-phases.js.map +1 -0
- package/dist/mcp/tools/invariant-get.js +1 -1
- package/dist/mcp/tools/invariant-get.js.map +1 -1
- package/dist/mcp/tools/invariants-in-scope.js +26 -7
- package/dist/mcp/tools/invariants-in-scope.js.map +1 -1
- package/dist/mcp/tools/query-history.js +3 -3
- package/dist/mcp/tools/query-history.js.map +1 -1
- package/dist/mcp/tools/resolve-attention.d.ts +6 -4
- package/dist/mcp/tools/resolve-attention.js +253 -24
- package/dist/mcp/tools/resolve-attention.js.map +1 -1
- package/dist/mcp/tools/search.js +3 -4
- package/dist/mcp/tools/search.js.map +1 -1
- package/dist/mcp/tools/task-create.d.ts +15 -0
- package/dist/mcp/tools/task-create.js +96 -0
- package/dist/mcp/tools/task-create.js.map +1 -0
- package/dist/mcp/tools/timeline.js +3 -7
- package/dist/mcp/tools/timeline.js.map +1 -1
- package/dist/profiles/types.d.ts +2 -2
- package/dist/profiles/types.js +1 -1
- package/dist/sensors/catalog.js +8 -3
- package/dist/sensors/catalog.js.map +1 -1
- package/dist/session/id.d.ts +1 -3
- package/dist/session/id.js +1 -1
- package/dist/session/id.js.map +1 -1
- package/dist/session-start/build.d.ts +7 -11
- package/dist/session-start/build.js +62 -34
- package/dist/session-start/build.js.map +1 -1
- package/dist/session-start/index.d.ts +2 -2
- package/dist/session-start/index.js +2 -2
- package/dist/session-start/index.js.map +1 -1
- package/dist/session-start/templates.d.ts +20 -4
- package/dist/session-start/templates.js +45 -35
- package/dist/session-start/templates.js.map +1 -1
- package/dist/status-line/format.d.ts +20 -9
- package/dist/status-line/format.js +45 -35
- package/dist/status-line/format.js.map +1 -1
- package/dist/status-line/index.d.ts +3 -4
- package/dist/status-line/index.js +1 -1
- package/dist/status-line/index.js.map +1 -1
- package/dist/status-line/reader.d.ts +9 -6
- package/dist/status-line/reader.js +50 -18
- package/dist/status-line/reader.js.map +1 -1
- package/dist/status-line/writer.d.ts +6 -9
- package/dist/status-line/writer.js +10 -12
- package/dist/status-line/writer.js.map +1 -1
- package/dist/trace/index.d.ts +44 -0
- package/dist/trace/index.js +51 -0
- package/dist/trace/index.js.map +1 -0
- package/package.json +2 -3
- package/templates/.archive/README.md +3 -3
- package/templates/.cairn/JOIN.md +3 -9
- package/templates/.cairn/config/sensors.yaml +16 -19
- package/templates/.cairn/config/stub-patterns.yaml +4 -4
- package/templates/.cairn/config/trust-policy.yaml +3 -35
- package/templates/.cairn/config/workflow.md +13 -194
- package/templates/.cairn/git-hooks/commit-msg +15 -4
- package/templates/.cairn/git-hooks/pre-commit +22 -13
- package/templates/.cairn/ground/canonical-map/topics.yaml +3 -26
- package/templates/.cairn/ground/capabilities/snippets.yaml +0 -1
- package/templates/.cairn/ground/manifest.yaml +5 -8
- package/templates/.cairn/ground/product/personas.yaml +0 -1
- package/dist/context/checkpoint.d.ts +0 -10
- package/dist/context/checkpoint.js +0 -29
- package/dist/context/checkpoint.js.map +0 -1
- package/dist/decision-capture/capture.d.ts +0 -57
- package/dist/decision-capture/capture.js +0 -186
- package/dist/decision-capture/capture.js.map +0 -1
- package/dist/decision-capture/extractor.d.ts +0 -20
- package/dist/decision-capture/extractor.js +0 -103
- package/dist/decision-capture/extractor.js.map +0 -1
- package/dist/decision-capture/prompt.d.ts +0 -15
- package/dist/decision-capture/prompt.js +0 -68
- package/dist/decision-capture/prompt.js.map +0 -1
- package/dist/decision-capture/refinement-prompt.d.ts +0 -25
- package/dist/decision-capture/refinement-prompt.js +0 -146
- package/dist/decision-capture/refinement-prompt.js.map +0 -1
- package/dist/decision-capture/refinement-schema.d.ts +0 -52
- package/dist/decision-capture/refinement-schema.js +0 -61
- package/dist/decision-capture/refinement-schema.js.map +0 -1
- package/dist/decision-capture/refinement.d.ts +0 -60
- package/dist/decision-capture/refinement.js +0 -439
- package/dist/decision-capture/refinement.js.map +0 -1
- package/dist/decision-capture/schema.d.ts +0 -70
- package/dist/decision-capture/schema.js +0 -71
- package/dist/decision-capture/schema.js.map +0 -1
- package/dist/decision-capture/types.d.ts +0 -201
- package/dist/decision-capture/types.js +0 -20
- package/dist/decision-capture/types.js.map +0 -1
- package/dist/decision-capture/writer.d.ts +0 -90
- package/dist/decision-capture/writer.js +0 -267
- package/dist/decision-capture/writer.js.map +0 -1
- package/dist/frontend-types.d.ts +0 -243
- package/dist/frontend-types.js +0 -15
- package/dist/frontend-types.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -12
- package/dist/hooks/index.js +0 -13
- package/dist/hooks/index.js.map +0 -1
- package/dist/inbox.d.ts +0 -17
- package/dist/inbox.js +0 -30
- package/dist/inbox.js.map +0 -1
- package/dist/mcp/tools/append-run-note.d.ts +0 -18
- package/dist/mcp/tools/append-run-note.js +0 -47
- package/dist/mcp/tools/append-run-note.js.map +0 -1
- package/dist/mcp/tools/append.d.ts +0 -8
- package/dist/mcp/tools/append.js +0 -37
- package/dist/mcp/tools/append.js.map +0 -1
- package/dist/mcp/tools/ask-operator.d.ts +0 -34
- package/dist/mcp/tools/ask-operator.js +0 -97
- package/dist/mcp/tools/ask-operator.js.map +0 -1
- package/dist/mcp/tools/drop-task.d.ts +0 -12
- package/dist/mcp/tools/drop-task.js +0 -68
- package/dist/mcp/tools/drop-task.js.map +0 -1
- package/dist/mcp/tools/record-run-event.d.ts +0 -10
- package/dist/mcp/tools/record-run-event.js +0 -32
- package/dist/mcp/tools/record-run-event.js.map +0 -1
- package/dist/prompt.d.ts +0 -19
- package/dist/prompt.js +0 -50
- package/dist/prompt.js.map +0 -1
- package/dist/tier0/classify.d.ts +0 -10
- package/dist/tier0/classify.js +0 -110
- package/dist/tier0/classify.js.map +0 -1
- package/dist/tier0/index.d.ts +0 -2
- package/dist/tier0/index.js +0 -2
- package/dist/tier0/index.js.map +0 -1
- package/dist/tier0/types.d.ts +0 -24
- package/dist/tier0/types.js +0 -9
- package/dist/tier0/types.js.map +0 -1
- package/dist/tightener/index.d.ts +0 -4
- package/dist/tightener/index.js +0 -4
- package/dist/tightener/index.js.map +0 -1
- package/dist/tightener/prompt.d.ts +0 -3
- package/dist/tightener/prompt.js +0 -67
- package/dist/tightener/prompt.js.map +0 -1
- package/dist/tightener/schema.d.ts +0 -68
- package/dist/tightener/schema.js +0 -44
- package/dist/tightener/schema.js.map +0 -1
- package/dist/tightener/tighten.d.ts +0 -2
- package/dist/tightener/tighten.js +0 -66
- package/dist/tightener/tighten.js.map +0 -1
- package/dist/tightener/types.d.ts +0 -74
- package/dist/tightener/types.js +0 -6
- package/dist/tightener/types.js.map +0 -1
- package/templates/.claude/settings.json +0 -57
- package/templates/.mcp.json +0 -8
- package/templates/README.md +0 -24
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Phase 12 — multi-developer enforcement
|
|
2
|
+
* Phase 12 — multi-developer enforcement detection.
|
|
3
3
|
*
|
|
4
4
|
* Spec: PLUGIN_ARCHITECTURE §17 + §6 Phase 12.
|
|
5
5
|
*
|
|
6
6
|
* Idempotent. Runs once during `cairn init` after the .cairn/ skeleton
|
|
7
|
-
* is seeded.
|
|
8
|
-
*
|
|
7
|
+
* is seeded. Detects the package manager(s) in use and emits per-host
|
|
8
|
+
* JOIN.md hints for new contributors. The plugin bundle is the
|
|
9
|
+
* primary delivery mechanism; the Claude Code SessionStart hook
|
|
10
|
+
* surfaces the per-clone bootstrap banner for unbootstrapped clones.
|
|
11
|
+
* Phase 12 does not auto-patch `package.json` `prepare`.
|
|
9
12
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* - Rust / Go / generic: emits the same hint — these toolchains don't
|
|
13
|
-
* have an install-time hook surface, so JOIN.md is the path
|
|
14
|
-
*
|
|
15
|
-
* The hint is captured in the result so the visual layer can render it once
|
|
16
|
-
* inline; nothing is written outside `package.json` automatically.
|
|
13
|
+
* `patchPackageJsonPrepare` is exported for explicit operator-driven
|
|
14
|
+
* wiring; phase 12 itself never calls it.
|
|
17
15
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
16
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
20
17
|
import { join } from "node:path";
|
|
21
18
|
const PREPARE_SCRIPT_FRAGMENT = "cairn join || true";
|
|
22
19
|
export function installMultiDev(args) {
|
|
@@ -27,8 +24,7 @@ export function installMultiDev(args) {
|
|
|
27
24
|
const pkgJson = join(repoRoot, "package.json");
|
|
28
25
|
if (existsSync(pkgJson)) {
|
|
29
26
|
hostKinds.push("node-package-json");
|
|
30
|
-
|
|
31
|
-
steps.push(patch.step);
|
|
27
|
+
manualHints.push("package.json detected — Claude Code contributors get the SessionStart bootstrap banner; CLI-only contributors run `cairn join` once after `npm install`");
|
|
32
28
|
}
|
|
33
29
|
const pyproject = join(repoRoot, "pyproject.toml");
|
|
34
30
|
if (existsSync(pyproject)) {
|
|
@@ -55,77 +51,12 @@ export function installMultiDev(args) {
|
|
|
55
51
|
hostKinds.push("none");
|
|
56
52
|
manualHints.push("No package-manager manifest detected — JOIN.md is the only on-ramp; share it with new contributors");
|
|
57
53
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// flags every pre-adoption commit as "not attested" — false positives
|
|
61
|
-
// for projects with prior history. Per PLUGIN_ARCHITECTURE §17 "Edge
|
|
62
|
-
// case: legacy commits before adoption", pre-existing history is
|
|
63
|
-
// grandfathered: it goes to the baseline audit, not the bypass
|
|
64
|
-
// surface. Future commits flow through the post-commit hook + go on
|
|
65
|
-
// top of this seeded list.
|
|
66
|
-
steps.push(seedAttestedCommits(repoRoot, args.dryRun === true));
|
|
67
|
-
const preparePatched = steps.some((s) => s.step === "patch-package-prepare" && s.status === "ok");
|
|
68
|
-
return { hostKinds, preparePatched, manualHints, steps };
|
|
69
|
-
}
|
|
70
|
-
/* -------------------------------------------------------------------------- */
|
|
71
|
-
/* attested-commits seed */
|
|
72
|
-
/* -------------------------------------------------------------------------- */
|
|
73
|
-
function seedAttestedCommits(repoRoot, dryRun) {
|
|
74
|
-
const path = join(repoRoot, ".cairn", ".attested-commits");
|
|
75
|
-
if (existsSync(path)) {
|
|
76
|
-
return {
|
|
77
|
-
step: "seed-attested-commits",
|
|
78
|
-
status: "skipped",
|
|
79
|
-
detail: ".cairn/.attested-commits already exists — leaving as-is",
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
if (!existsSync(join(repoRoot, ".git"))) {
|
|
83
|
-
return {
|
|
84
|
-
step: "seed-attested-commits",
|
|
85
|
-
status: "skipped",
|
|
86
|
-
detail: "no .git/ — bypass detection is git-only, nothing to seed",
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
let shas = [];
|
|
90
|
-
try {
|
|
91
|
-
const out = execFileSync("git", ["log", "--format=%H"], {
|
|
92
|
-
cwd: repoRoot,
|
|
93
|
-
encoding: "utf8",
|
|
94
|
-
maxBuffer: 64 * 1024 * 1024,
|
|
95
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
96
|
-
});
|
|
97
|
-
shas = out.split("\n").filter((s) => s.length > 0);
|
|
98
|
-
}
|
|
99
|
-
catch (err) {
|
|
100
|
-
return {
|
|
101
|
-
step: "seed-attested-commits",
|
|
102
|
-
status: "error",
|
|
103
|
-
detail: `git log failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
if (dryRun) {
|
|
107
|
-
return {
|
|
108
|
-
step: "seed-attested-commits",
|
|
109
|
-
status: "ok",
|
|
110
|
-
detail: `(dry-run) would seed ${shas.length} pre-adoption SHA${shas.length === 1 ? "" : "s"}`,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
try {
|
|
114
|
-
mkdirSync(join(repoRoot, ".cairn"), { recursive: true });
|
|
115
|
-
writeFileSync(path, `${shas.join("\n")}\n`, "utf8");
|
|
116
|
-
}
|
|
117
|
-
catch (err) {
|
|
118
|
-
return {
|
|
119
|
-
step: "seed-attested-commits",
|
|
120
|
-
status: "error",
|
|
121
|
-
detail: `write ${path} failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
return {
|
|
125
|
-
step: "seed-attested-commits",
|
|
54
|
+
steps.push({
|
|
55
|
+
step: "detect-host-kinds",
|
|
126
56
|
status: "ok",
|
|
127
|
-
detail: `
|
|
128
|
-
};
|
|
57
|
+
detail: `detected ${hostKinds.join(", ")}`,
|
|
58
|
+
});
|
|
59
|
+
return { hostKinds, preparePatched: false, manualHints, steps };
|
|
129
60
|
}
|
|
130
61
|
export function patchPackageJsonPrepare(pkgPath, dryRun) {
|
|
131
62
|
let raw;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/init/multi-dev/install.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/init/multi-dev/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AA+BrD,MAAM,UAAU,eAAe,CAAC,IAAyB;IACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/B,MAAM,SAAS,GAAuB,EAAE,CAAC;IACzC,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,MAAM,KAAK,GAA0B,EAAE,CAAC;IAExC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC/C,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxB,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACpC,WAAW,CAAC,IAAI,CACd,yJAAyJ,CAC1J,CAAC;IACJ,CAAC;IACD,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;IACnD,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QA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;IACD,OAAO;QACL,IAAI,EAAE;YACJ,IAAI,EAAE,uBAAuB;YAC7B,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,sBAAsB,UAAU,GAAG;SAC5C;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project-overlay config.yaml builder — extracted so both runInit
|
|
3
|
+
* (terminal CLI) and the v0.2.0 MCP-native phase pipeline can call
|
|
4
|
+
* it. Pure function; no IO.
|
|
5
|
+
*/
|
|
6
|
+
import type { MapperOutput } from "./mapper.js";
|
|
7
|
+
import type { DetectionResult } from "./types.js";
|
|
8
|
+
interface BuildProjectOverlayArgs {
|
|
9
|
+
detection: DetectionResult;
|
|
10
|
+
decidedSlug: string;
|
|
11
|
+
mapperOutput?: MapperOutput;
|
|
12
|
+
}
|
|
13
|
+
export declare function buildProjectOverlay(args: BuildProjectOverlayArgs): Record<string, unknown>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project-overlay config.yaml builder — extracted so both runInit
|
|
3
|
+
* (terminal CLI) and the v0.2.0 MCP-native phase pipeline can call
|
|
4
|
+
* it. Pure function; no IO.
|
|
5
|
+
*/
|
|
6
|
+
import { VERSION } from "../index.js";
|
|
7
|
+
const DEFAULT_OFF_LIMITS = [
|
|
8
|
+
".env",
|
|
9
|
+
".env.*",
|
|
10
|
+
"node_modules/",
|
|
11
|
+
"dist/",
|
|
12
|
+
"build/",
|
|
13
|
+
"target/",
|
|
14
|
+
"__pycache__/",
|
|
15
|
+
"vendor/",
|
|
16
|
+
".venv/",
|
|
17
|
+
".direnv/",
|
|
18
|
+
".cache/",
|
|
19
|
+
"coverage/",
|
|
20
|
+
];
|
|
21
|
+
export function buildProjectOverlay(args) {
|
|
22
|
+
const detected_sensor_commands = args.detection.proposed_sensors.map((s) => ({
|
|
23
|
+
id: s.id,
|
|
24
|
+
command: s.command,
|
|
25
|
+
args: s.args,
|
|
26
|
+
applies_to: s.applies_to,
|
|
27
|
+
reason: s.reason,
|
|
28
|
+
}));
|
|
29
|
+
const m = args.mapperOutput;
|
|
30
|
+
const offLimits = [...DEFAULT_OFF_LIMITS];
|
|
31
|
+
if (m !== undefined) {
|
|
32
|
+
for (const x of m.off_limits_globs) {
|
|
33
|
+
if (!offLimits.includes(x))
|
|
34
|
+
offLimits.push(x);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const overlay = {
|
|
38
|
+
version: 1,
|
|
39
|
+
cairn_version: VERSION,
|
|
40
|
+
slug: args.decidedSlug,
|
|
41
|
+
origin_url: args.detection.origin_url,
|
|
42
|
+
stack_signatures: args.detection.stack_signatures.map((s) => s.kind),
|
|
43
|
+
hook_capability: args.detection.hook_capability,
|
|
44
|
+
start_command: args.detection.start_command,
|
|
45
|
+
detected_sensor_commands,
|
|
46
|
+
off_limits: offLimits,
|
|
47
|
+
high_stakes_globs: m?.high_stakes_globs ?? [],
|
|
48
|
+
project_globs: {
|
|
49
|
+
route_handler_globs: m?.route_handler_globs ?? [],
|
|
50
|
+
dto_globs: m?.dto_globs ?? [],
|
|
51
|
+
generator_source_globs: m?.generator_source_globs ?? [],
|
|
52
|
+
high_stakes_globs: m?.high_stakes_globs ?? [],
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
if (m !== undefined) {
|
|
56
|
+
overlay["pilot_module"] = m.pilot_module;
|
|
57
|
+
overlay["domain_summary"] = m.domain_summary;
|
|
58
|
+
overlay["key_modules"] = m.key_modules;
|
|
59
|
+
overlay["mapper_proposed_sensors"] = m.proposed_sensors;
|
|
60
|
+
if (m.notes.trim().length > 0)
|
|
61
|
+
overlay["mapper_notes"] = m.notes;
|
|
62
|
+
}
|
|
63
|
+
return overlay;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay.js","sourceRoot":"","sources":["../../src/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AI,CAAC;QACpE,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe;QAC/C,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa;QAC3C,wBAAwB;QACxB,UAAU,EAAE,SAAS;QACrB,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,IAAI,EAAE;QAC7C,aAAa,EAAE;YACb,mBAAmB,EAAE,CAAC,EAAE,mBAAmB,IAAI,EAAE;YACjD,SAAS,EAAE,CAAC,EAAE,SAAS,IAAI,EAAE;YAC7B,sBAAsB,EAAE,CAAC,EAAE,sBAAsB,IAAI,EAAE;YACvD,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,IAAI,EAAE;SAC9C;KACF,CAAC;IACF,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACpB,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC;QACzC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC;QAC7C,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC;QACvC,OAAO,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,gBAAgB,CAAC;QACxD,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;IACnE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 1-detect — synchronous environment + stack signature scan.
|
|
3
|
+
*
|
|
4
|
+
* Wraps `detectAll` in the PhaseResult contract. No operator input;
|
|
5
|
+
* always advances. Output stamped under `state.outputs["1-detect"]`
|
|
6
|
+
* is the full DetectionResult so downstream phases can read repo_root,
|
|
7
|
+
* stack, sensors, etc. without re-detecting.
|
|
8
|
+
*/
|
|
9
|
+
import type { PhaseResult, PhaseState } from "./types.js";
|
|
10
|
+
export declare function runPhase1Detect(state: PhaseState): Promise<PhaseResult>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 1-detect — synchronous environment + stack signature scan.
|
|
3
|
+
*
|
|
4
|
+
* Wraps `detectAll` in the PhaseResult contract. No operator input;
|
|
5
|
+
* always advances. Output stamped under `state.outputs["1-detect"]`
|
|
6
|
+
* is the full DetectionResult so downstream phases can read repo_root,
|
|
7
|
+
* stack, sensors, etc. without re-detecting.
|
|
8
|
+
*/
|
|
9
|
+
import { detectAll } from "../detect.js";
|
|
10
|
+
import { advancePhase } from "./orchestrator.js";
|
|
11
|
+
export async function runPhase1Detect(state) {
|
|
12
|
+
try {
|
|
13
|
+
const detection = await detectAll(state.repoRoot);
|
|
14
|
+
const next = {
|
|
15
|
+
...state,
|
|
16
|
+
outputs: { ...state.outputs, "1-detect": detection },
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
status: "complete",
|
|
20
|
+
nextPhase: "2-walker",
|
|
21
|
+
state: advancePhase(next),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
return {
|
|
26
|
+
status: "error",
|
|
27
|
+
error: {
|
|
28
|
+
code: "detect-failed",
|
|
29
|
+
message: "Failed to scan project environment",
|
|
30
|
+
detail: err instanceof Error ? err.stack ?? err.message : String(err),
|
|
31
|
+
},
|
|
32
|
+
state,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=1-detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1-detect.js","sourceRoot":"","sources":["../../../src/init/phases/1-detect.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAAiB;IACrD,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAClD,MAAM,IAAI,GAAe;YACvB,GAAG,KAAK;YACR,OAAO,EAAE,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE;SACrD,CAAC;QACF,OAAO;YACL,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,UAAU;YACrB,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC;SAC1B,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,MAAM,EAAE,OAAO;YACf,KAAK,EAAE;gBACL,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE,oCAAoC;gBAC7C,MAAM,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aACtE;YACD,KAAK;SACN,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 10-strip — per-module strip-replace consent.
|
|
3
|
+
*
|
|
4
|
+
* Surfaces each ingestion-flagged module as an A/B/C choice (strip /
|
|
5
|
+
* keep / skip). Tracks remaining modules in
|
|
6
|
+
* `outputs["10-strip"].pending` and emits one question at a time
|
|
7
|
+
* until the queue is empty. When the list is empty (most repos), the
|
|
8
|
+
* phase completes immediately with no operator prompts.
|
|
9
|
+
*/
|
|
10
|
+
import type { PhaseResult, PhaseState } from "./types.js";
|
|
11
|
+
export declare function runPhase10Strip(state: PhaseState): Promise<PhaseResult>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 10-strip — per-module strip-replace consent.
|
|
3
|
+
*
|
|
4
|
+
* Surfaces each ingestion-flagged module as an A/B/C choice (strip /
|
|
5
|
+
* keep / skip). Tracks remaining modules in
|
|
6
|
+
* `outputs["10-strip"].pending` and emits one question at a time
|
|
7
|
+
* until the queue is empty. When the list is empty (most repos), the
|
|
8
|
+
* phase completes immediately with no operator prompts.
|
|
9
|
+
*/
|
|
10
|
+
import { advancePhase } from "./orchestrator.js";
|
|
11
|
+
export async function runPhase10Strip(state) {
|
|
12
|
+
const existing = state.outputs["10-strip"];
|
|
13
|
+
const modules = computeFlaggedModules(state);
|
|
14
|
+
// Initialize on first entry.
|
|
15
|
+
let s = existing ?? { pending: [...modules], decisions: {} };
|
|
16
|
+
// Operator just answered → record + dequeue.
|
|
17
|
+
if (state.answer !== undefined && state.answer.length > 0 && s.pending.length > 0) {
|
|
18
|
+
const head = s.pending[0];
|
|
19
|
+
const choice = normalizeChoice(state.answer);
|
|
20
|
+
s = {
|
|
21
|
+
pending: s.pending.slice(1),
|
|
22
|
+
decisions: { ...s.decisions, [head]: choice },
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (s.pending.length === 0) {
|
|
26
|
+
const next = {
|
|
27
|
+
...state,
|
|
28
|
+
outputs: { ...state.outputs, "10-strip": s },
|
|
29
|
+
answer: undefined,
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
status: "complete",
|
|
33
|
+
nextPhase: "12-multidev",
|
|
34
|
+
state: advancePhase(next),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const head = s.pending[0];
|
|
38
|
+
const question = {
|
|
39
|
+
id: `10-strip:${head}`,
|
|
40
|
+
prompt: `Strip the source-comment essay in ${head}?`,
|
|
41
|
+
options: [
|
|
42
|
+
{
|
|
43
|
+
id: "strip",
|
|
44
|
+
label: "strip — DEC is the source of truth",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: "keep",
|
|
48
|
+
label: "keep — leave comment alongside DEC",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: "skip",
|
|
52
|
+
label: "skip — decide later",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
default: "skip",
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
status: "needs_input",
|
|
59
|
+
question,
|
|
60
|
+
state: { ...state, outputs: { ...state.outputs, "10-strip": s }, answer: undefined },
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function normalizeChoice(answer) {
|
|
64
|
+
switch (answer) {
|
|
65
|
+
case "strip":
|
|
66
|
+
case "keep":
|
|
67
|
+
case "skip":
|
|
68
|
+
return answer;
|
|
69
|
+
default:
|
|
70
|
+
return "skip";
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function computeFlaggedModules(_state) {
|
|
74
|
+
// Source-comment + docs-ingest classifiers don't currently flag
|
|
75
|
+
// module-level strip candidates explicitly. Queue starts empty
|
|
76
|
+
// → phase 10 completes silently.
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=10-strip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"10-strip.js","sourceRoot":"","sources":["../../../src/init/phases/10-strip.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAcjD,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAAiB;IACrD,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAA2B,CAAC;IACrE,MAAM,OAAO,GAAa,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAEvD,6BAA6B;IAC7B,IAAI,CAAC,GAAe,QAAQ,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IAEzE,6CAA6C;IAC7C,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,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CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;KACrF,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,MAAc;IACrC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB;YACE,OAAO,MAAM,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAkB;IAC/C,gEAAgE;IAChE,+DAA+D;IAC/D,iCAAiC;IACjC,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 12-multidev — detect per-host package manager(s) and emit
|
|
3
|
+
* JOIN.md hints for new contributors. Idempotent.
|
|
4
|
+
*/
|
|
5
|
+
import type { PhaseResult, PhaseState } from "./types.js";
|
|
6
|
+
export declare function runPhase12Multidev(state: PhaseState): Promise<PhaseResult>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 12-multidev — detect per-host package manager(s) and emit
|
|
3
|
+
* JOIN.md hints for new contributors. Idempotent.
|
|
4
|
+
*/
|
|
5
|
+
import { installMultiDev, } from "../multi-dev/index.js";
|
|
6
|
+
import { advancePhase } from "./orchestrator.js";
|
|
7
|
+
export async function runPhase12Multidev(state) {
|
|
8
|
+
try {
|
|
9
|
+
const result = installMultiDev({
|
|
10
|
+
repoRoot: state.repoRoot,
|
|
11
|
+
});
|
|
12
|
+
const next = {
|
|
13
|
+
...state,
|
|
14
|
+
outputs: { ...state.outputs, "12-multidev": result },
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
status: "complete",
|
|
18
|
+
nextPhase: null,
|
|
19
|
+
state: advancePhase(next),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
return {
|
|
24
|
+
status: "error",
|
|
25
|
+
error: {
|
|
26
|
+
code: "multidev-failed",
|
|
27
|
+
message: "Multi-dev install failed",
|
|
28
|
+
detail: err instanceof Error ? err.stack ?? err.message : String(err),
|
|
29
|
+
},
|
|
30
|
+
state,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=12-multidev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"12-multidev.js","sourceRoot":"","sources":["../../../src/init/phases/12-multidev.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,eAAe,GAEhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,KAAiB;IACxD,IAAI,CAAC;QACH,MAAM,MAAM,GAA0B,eAAe,CAAC;YACpD,QAAQ,EAAE,KAAK,CAAC,QAAQ;SACzB,CAAC,CAAC;QACH,MAAM,IAAI,GAAe;YACvB,GAAG,KAAK;YACR,OAAO,EAAE,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE;SACrD,CAAC;QACF,OAAO;YACL,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC;SAC1B,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,MAAM,EAAE,OAAO;YACf,KAAK,EAAE;gBACL,IAAI,EAAE,iBAAiB;gBACvB,OAAO,EAAE,0BAA0B;gBACnC,MAAM,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aACtE;YACD,KAAK;SACN,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 2-walker — repo summary scan.
|
|
3
|
+
*
|
|
4
|
+
* Synchronous file walk producing manifest previews, by-extension
|
|
5
|
+
* counts, framework signals, etc. Feeds the mapper (3) + pilot (4).
|
|
6
|
+
*/
|
|
7
|
+
import type { PhaseResult, PhaseState } from "./types.js";
|
|
8
|
+
export declare function runPhase2Walker(state: PhaseState): Promise<PhaseResult>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 2-walker — repo summary scan.
|
|
3
|
+
*
|
|
4
|
+
* Synchronous file walk producing manifest previews, by-extension
|
|
5
|
+
* counts, framework signals, etc. Feeds the mapper (3) + pilot (4).
|
|
6
|
+
*/
|
|
7
|
+
import { buildRepoSummary } from "../walker.js";
|
|
8
|
+
import { advancePhase } from "./orchestrator.js";
|
|
9
|
+
export async function runPhase2Walker(state) {
|
|
10
|
+
try {
|
|
11
|
+
const summary = buildRepoSummary({ repoRoot: state.repoRoot });
|
|
12
|
+
const next = {
|
|
13
|
+
...state,
|
|
14
|
+
outputs: { ...state.outputs, "2-walker": summary },
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
status: "complete",
|
|
18
|
+
nextPhase: "3-mapper",
|
|
19
|
+
state: advancePhase(next),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
return {
|
|
24
|
+
status: "error",
|
|
25
|
+
error: {
|
|
26
|
+
code: "walker-failed",
|
|
27
|
+
message: "Failed to summarize repo layout",
|
|
28
|
+
detail: err instanceof Error ? err.stack ?? err.message : String(err),
|
|
29
|
+
},
|
|
30
|
+
state,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=2-walker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"2-walker.js","sourceRoot":"","sources":["../../../src/init/phases/2-walker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAAiB;IACrD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,gBAAgB,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/D,MAAM,IAAI,GAAe;YACvB,GAAG,KAAK;YACR,OAAO,EAAE,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE;SACnD,CAAC;QACF,OAAO;YACL,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,UAAU;YACrB,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC;SAC1B,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,MAAM,EAAE,OAAO;YACf,KAAK,EAAE;gBACL,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE,iCAAiC;gBAC1C,MAAM,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aACtE;YACD,KAAK;SACN,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 3-mapper — Sonnet-driven domain map.
|
|
3
|
+
*
|
|
4
|
+
* Reads detection (from phase 1) + repo summary (from phase 2),
|
|
5
|
+
* dispatches the chunked mapper pipeline, and stamps MapperResult
|
|
6
|
+
* under outputs["3-mapper"]. The downstream phases consume
|
|
7
|
+
* mapper.output for pilot suggestions, project_globs, sensor
|
|
8
|
+
* proposals, etc.
|
|
9
|
+
*
|
|
10
|
+
* No operator input — the mapper runs unattended (Sonnet via the
|
|
11
|
+
* cairn runner).
|
|
12
|
+
*/
|
|
13
|
+
import type { PhaseResult, PhaseState } from "./types.js";
|
|
14
|
+
export declare function runPhase3Mapper(state: PhaseState): Promise<PhaseResult>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 3-mapper — Sonnet-driven domain map.
|
|
3
|
+
*
|
|
4
|
+
* Reads detection (from phase 1) + repo summary (from phase 2),
|
|
5
|
+
* dispatches the chunked mapper pipeline, and stamps MapperResult
|
|
6
|
+
* under outputs["3-mapper"]. The downstream phases consume
|
|
7
|
+
* mapper.output for pilot suggestions, project_globs, sensor
|
|
8
|
+
* proposals, etc.
|
|
9
|
+
*
|
|
10
|
+
* No operator input — the mapper runs unattended (Sonnet via the
|
|
11
|
+
* cairn runner).
|
|
12
|
+
*/
|
|
13
|
+
import { runMapper } from "../mapper.js";
|
|
14
|
+
import { advancePhase } from "./orchestrator.js";
|
|
15
|
+
export async function runPhase3Mapper(state) {
|
|
16
|
+
const detection = state.outputs["1-detect"];
|
|
17
|
+
const summary = state.outputs["2-walker"];
|
|
18
|
+
if (detection === undefined || summary === undefined) {
|
|
19
|
+
return {
|
|
20
|
+
status: "error",
|
|
21
|
+
error: {
|
|
22
|
+
code: "missing-prereqs",
|
|
23
|
+
message: "Phase 3 needs phases 1-detect + 2-walker outputs",
|
|
24
|
+
},
|
|
25
|
+
state,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
const result = await runMapper({
|
|
30
|
+
detection,
|
|
31
|
+
summary,
|
|
32
|
+
repoRoot: state.repoRoot,
|
|
33
|
+
});
|
|
34
|
+
const next = {
|
|
35
|
+
...state,
|
|
36
|
+
outputs: { ...state.outputs, "3-mapper": result },
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
status: "complete",
|
|
40
|
+
nextPhase: "3b-seed",
|
|
41
|
+
state: advancePhase(next),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
return {
|
|
46
|
+
status: "error",
|
|
47
|
+
error: {
|
|
48
|
+
code: "mapper-failed",
|
|
49
|
+
message: "Mapper pipeline failed",
|
|
50
|
+
detail: err instanceof Error ? err.stack ?? err.message : String(err),
|
|
51
|
+
},
|
|
52
|
+
state,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=3-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"3-mapper.js","sourceRoot":"","sources":["../../../src/init/phases/3-mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAqB,MAAM,cAAc,CAAC;AAG5D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAAiB;IACrD,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAgC,CAAC;IAC3E,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAA4B,CAAC;IACrE,IAAI,SAAS,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACrD,OAAO;YACL,MAAM,EAAE,OAAO;YACf,KAAK,EAAE;gBACL,IAAI,EAAE,iBAAiB;gBACvB,OAAO,EAAE,kDAAkD;aAC5D;YACD,KAAK;SACN,CAAC;IACJ,CAAC;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAiB,MAAM,SAAS,CAAC;YAC3C,SAAS;YACT,OAAO;YACP,QAAQ,EAAE,KAAK,CAAC,QAAQ;SACzB,CAAC,CAAC;QACH,MAAM,IAAI,GAAe;YACvB,GAAG,KAAK;YACR,OAAO,EAAE,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE;SAClD,CAAC;QACF,OAAO;YACL,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,SAAS;YACpB,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC;SAC1B,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,MAAM,EAAE,OAAO;YACf,KAAK,EAAE;gBACL,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE,wBAAwB;gBACjC,MAAM,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aACtE;YACD,KAAK;SACN,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 3b-seed — write `.cairn/` skeleton + project overlay +
|
|
3
|
+
* grandfather pre-adoption commits.
|
|
4
|
+
*
|
|
5
|
+
* Steps:
|
|
6
|
+
* 1. seedCairnLayout (templates → .cairn/)
|
|
7
|
+
* 2. updateWorkflowSlugBlock (mapper output → workflow.md)
|
|
8
|
+
* 3. write .cairn/config.yaml + .cairn/ground/scope-index.yaml
|
|
9
|
+
* 4. seed .cairn/.attested-commits with every reachable HEAD SHA
|
|
10
|
+
* so the Stop-hook bypass detector grandfathers pre-adoption
|
|
11
|
+
* history.
|
|
12
|
+
*
|
|
13
|
+
* No operator input. Always advances. Idempotent — re-running on a
|
|
14
|
+
* project that already has .cairn/ keeps existing files (collisions
|
|
15
|
+
* recorded in seed.collisions but not fatal).
|
|
16
|
+
*/
|
|
17
|
+
import type { PhaseResult, PhaseState } from "./types.js";
|
|
18
|
+
export declare function runPhase3bSeed(state: PhaseState): Promise<PhaseResult>;
|