@isaacriehm/cairn-core 0.22.5 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/attention/index.d.ts +0 -1
  3. package/dist/attention/index.js +0 -1
  4. package/dist/attention/index.js.map +1 -1
  5. package/dist/cites/expand.d.ts +75 -0
  6. package/dist/cites/expand.js +197 -0
  7. package/dist/cites/expand.js.map +1 -0
  8. package/dist/doctor/index.d.ts +10 -4
  9. package/dist/doctor/index.js +25 -97
  10. package/dist/doctor/index.js.map +1 -1
  11. package/dist/gc/apply.d.ts +1 -1
  12. package/dist/gc/apply.js +1 -1
  13. package/dist/gc/classify.d.ts +4 -8
  14. package/dist/gc/classify.js +6 -12
  15. package/dist/gc/classify.js.map +1 -1
  16. package/dist/gc/completion-integrity.d.ts +0 -1
  17. package/dist/gc/completion-integrity.js +0 -6
  18. package/dist/gc/completion-integrity.js.map +1 -1
  19. package/dist/gc/index.d.ts +1 -1
  20. package/dist/gc/index.js +1 -1
  21. package/dist/gc/sweep.d.ts +1 -3
  22. package/dist/gc/sweep.js +2 -7
  23. package/dist/gc/sweep.js.map +1 -1
  24. package/dist/gc/types.d.ts +5 -6
  25. package/dist/gc/types.js +4 -5
  26. package/dist/gc/types.js.map +1 -1
  27. package/dist/hooks/post-tool-use/index.d.ts +1 -1
  28. package/dist/hooks/post-tool-use/index.js +1 -1
  29. package/dist/hooks/post-tool-use/index.js.map +1 -1
  30. package/dist/hooks/post-tool-use/sot-align.js +52 -21
  31. package/dist/hooks/post-tool-use/sot-align.js.map +1 -1
  32. package/dist/hooks/sot-align-common.d.ts +13 -0
  33. package/dist/hooks/sot-align-common.js +69 -0
  34. package/dist/hooks/sot-align-common.js.map +1 -1
  35. package/dist/index.d.ts +3 -0
  36. package/dist/index.js +3 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/init/baseline-audit.js +3 -16
  39. package/dist/init/baseline-audit.js.map +1 -1
  40. package/dist/init/claude-rule.d.ts +1 -0
  41. package/dist/init/claude-rule.js +1 -1
  42. package/dist/init/claude-rule.js.map +1 -1
  43. package/dist/init/index.d.ts +0 -2
  44. package/dist/init/index.js +0 -1
  45. package/dist/init/index.js.map +1 -1
  46. package/dist/init/init.d.ts +2 -2
  47. package/dist/init/init.js +12 -27
  48. package/dist/init/init.js.map +1 -1
  49. package/dist/init/mapper-merge.d.ts +1 -4
  50. package/dist/init/mapper-merge.js +6 -22
  51. package/dist/init/mapper-merge.js.map +1 -1
  52. package/dist/init/mapper-parallel.d.ts +0 -4
  53. package/dist/init/mapper-parallel.js +3 -69
  54. package/dist/init/mapper-parallel.js.map +1 -1
  55. package/dist/init/mapper-prompts.d.ts +1 -25
  56. package/dist/init/mapper-prompts.js +2 -20
  57. package/dist/init/mapper-prompts.js.map +1 -1
  58. package/dist/init/mapper.d.ts +0 -4
  59. package/dist/init/mapper.js +2 -9
  60. package/dist/init/mapper.js.map +1 -1
  61. package/dist/init/overlay.js +6 -8
  62. package/dist/init/overlay.js.map +1 -1
  63. package/dist/init/phases/11-baseline.js +0 -10
  64. package/dist/init/phases/11-baseline.js.map +1 -1
  65. package/dist/init/phases/4-seed.js +0 -4
  66. package/dist/init/phases/4-seed.js.map +1 -1
  67. package/dist/init/source-comments/ingest.d.ts +0 -8
  68. package/dist/init/source-comments/ingest.js +11 -8
  69. package/dist/init/source-comments/ingest.js.map +1 -1
  70. package/dist/init/walker.d.ts +2 -3
  71. package/dist/init/walker.js +2 -3
  72. package/dist/init/walker.js.map +1 -1
  73. package/dist/init/workflow-block.d.ts +0 -4
  74. package/dist/init/workflow-block.js +0 -16
  75. package/dist/init/workflow-block.js.map +1 -1
  76. package/dist/invariants/prune.d.ts +50 -0
  77. package/dist/invariants/prune.js +113 -0
  78. package/dist/invariants/prune.js.map +1 -0
  79. package/dist/mcp/schemas.d.ts +8 -8
  80. package/dist/mcp/tools/mission-set-exit-gate.d.ts +1 -1
  81. package/dist/migrate/migrations/0004-drop-glob-settings.d.ts +16 -0
  82. package/dist/migrate/migrations/0004-drop-glob-settings.js +34 -0
  83. package/dist/migrate/migrations/0004-drop-glob-settings.js.map +1 -0
  84. package/dist/migrate/registry.js +2 -0
  85. package/dist/migrate/registry.js.map +1 -1
  86. package/dist/profiles/types.d.ts +0 -2
  87. package/dist/profiles/unknown.d.ts +2 -2
  88. package/dist/profiles/unknown.js +2 -3
  89. package/dist/profiles/unknown.js.map +1 -1
  90. package/dist/sensors/diff.d.ts +1 -1
  91. package/dist/sensors/diff.js +1 -1
  92. package/dist/sensors/index.d.ts +2 -3
  93. package/dist/sensors/index.js +1 -2
  94. package/dist/sensors/index.js.map +1 -1
  95. package/dist/sensors/runner.d.ts +7 -10
  96. package/dist/sensors/runner.js +6 -39
  97. package/dist/sensors/runner.js.map +1 -1
  98. package/dist/sensors/types.d.ts +0 -13
  99. package/dist/uninstall/index.d.ts +44 -0
  100. package/dist/uninstall/index.js +185 -0
  101. package/dist/uninstall/index.js.map +1 -0
  102. package/package.json +2 -2
  103. package/templates/.cairn/config/sensors.yaml +12 -91
  104. package/templates/.cairn/config/workflow.md +2 -5
  105. package/dist/attention/scoring.d.ts +0 -47
  106. package/dist/attention/scoring.js +0 -87
  107. package/dist/attention/scoring.js.map +0 -1
  108. package/dist/hooks/read-enrich.d.ts +0 -6
  109. package/dist/hooks/read-enrich.js +0 -11
  110. package/dist/hooks/read-enrich.js.map +0 -1
  111. package/dist/hooks/write-guard.d.ts +0 -6
  112. package/dist/hooks/write-guard.js +0 -11
  113. package/dist/hooks/write-guard.js.map +0 -1
  114. package/dist/init/glob-inference.d.ts +0 -16
  115. package/dist/init/glob-inference.js +0 -132
  116. package/dist/init/glob-inference.js.map +0 -1
  117. package/dist/init/phases/12-strip.d.ts +0 -10
  118. package/dist/init/phases/12-strip.js +0 -88
  119. package/dist/init/phases/12-strip.js.map +0 -1
  120. package/dist/sensors/structural.d.ts +0 -31
  121. package/dist/sensors/structural.js +0 -196
  122. package/dist/sensors/structural.js.map +0 -1
@@ -27,48 +27,6 @@ sensors:
27
27
  - every_run
28
28
  fail_severity: hard
29
29
 
30
- # ── Layer B — attestation cross-check ─────────────────────────────────────
31
- - id: attestation-cross-check
32
- layer: B
33
- kind: attestation
34
- description: "Cross-checks agent's attestation.yaml against the actual diff. Mismatches (lying about completeness, files-touched count, todos/stubs introduced) fail the run."
35
- triggers:
36
- - every_run_completion
37
- fail_severity: hard
38
-
39
- # ── Layer C — project structural / contract sensors ──────────────────────
40
- - id: route-handler-non-empty
41
- layer: C
42
- kind: structural
43
- description: "For every route/controller method, body must contain non-trivial implementation (not just `return null` / empty / throw not-implemented)."
44
- triggers:
45
- - diff_touches_glob
46
- glob_keys:
47
- - route_handler_globs
48
- fail_severity: hard
49
-
50
- - id: dto-no-fake-fields
51
- layer: C
52
- kind: structural
53
- description: "DTO/schema fields that are declared optional and always evaluate undefined fail this sensor — they look thorough without doing work."
54
- triggers:
55
- - diff_touches_glob
56
- glob_keys:
57
- - dto_globs
58
- fail_severity: hard
59
-
60
- # ── Generator-drift sensors (profile-driven) ──────────────────────────────
61
- - id: generator-drift
62
- layer: D
63
- kind: generator_drift
64
- 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."
65
- triggers:
66
- - diff_touches_glob
67
- glob_keys:
68
- - generator_source_globs
69
- profile_hook: profile.generators
70
- fail_severity: hard
71
-
72
30
  # ── Decision-assertion sensor ─────────────────────────────────────────────
73
31
  - id: decision-assertions
74
32
  layer: decisions
@@ -78,48 +36,24 @@ sensors:
78
36
  - every_run
79
37
  fail_severity: hard
80
38
 
81
- # ── §INV invariant sensors (auto-registered by backprop) ────────────────
39
+ # ── §INV invariant sensors ───────────────────────────────────────────────
40
+ # PLANNED — not yet wired. No runner reads this entry: the pre-commit sweep
41
+ # executes only stub-pattern-catalog + decision-assertions. Invariants are
42
+ # curated (§INV pillar) but enforcement (an assertions[] array on each
43
+ # invariant routed through the assertion evaluator, like decisions) is a
44
+ # gap, not a live gate. Kept `soft` so it reads as a roadmap item, NOT a
45
+ # hard gate that silently passes because nothing runs it.
82
46
  - id: invariant-suite
83
47
  layer: invariants
84
48
  kind: invariant_runner
85
- description: "Runs every active §INV invariant's linked sensor script. Active invariants accumulate over time; superseded ones are skipped."
49
+ status: planned
50
+ description: "PLANNED (not wired): would run every active §INV invariant's linked assertion. Today no runner reads this; invariant enforcement is unimplemented."
86
51
  triggers:
87
52
  - every_run
88
53
  sources:
89
54
  - .cairn/ground/invariants/
90
- fail_severity: hard
91
-
92
- # ── Reviewer subagent (SessionStart Drain) ───────────────────────────────────────────
93
- - id: reviewer-subagent
94
- layer: D
95
- kind: inferential
96
- 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."
97
- model_strategy: same_as_implementer
98
- triggers:
99
- - all_layer_c_sensors_passed
100
55
  fail_severity: soft
101
56
 
102
- # ── Layer E — high-stakes E2E / demo ─────────────────────────────────────
103
- - id: e2e-real-db
104
- layer: E
105
- kind: e2e
106
- description: "Runs the project's E2E suite against a real database (no mocks). High-stakes UAT MUST include a cross-tenant negative fixture — a request from user/org B against a resource owned by user/org A returning the expected denial."
107
- triggers:
108
- - high_stakes_glob_match
109
- profile_hook: profile.e2e_command
110
- fail_severity: hard
111
- requires:
112
- cross_tenant_fixture: true
113
-
114
- # ── Layer U — UAT headless ───────────────────────────────────────────────
115
- - id: uat-headless-chrome
116
- layer: U
117
- kind: uat
118
- description: "Headless Chrome via Playwright captures GIF + screenshots + console + network. Evidence-file gate: .uat-passed contains SHA256 of bundle. Bare touch rejected."
119
- triggers:
120
- - code_class_or_high_stakes
121
- fail_severity: hard
122
-
123
57
  # ── Frontmatter freshness (nightly GC pass) ──────────────────────────────
124
58
  - id: frontmatter-freshness
125
59
  layer: gc
@@ -140,23 +74,10 @@ sensors:
140
74
  fail_severity: soft
141
75
 
142
76
  # ──────────────────────────────────────────────────────────────────────────────
143
- # Scoped-glob keys.
144
- #
145
- # Each adopting project fills these in its `<project_name>:` block. Sensors that
146
- # trigger on `glob_keys` resolve them at dispatch from the project block.
147
- # ──────────────────────────────────────────────────────────────────────────────
148
-
149
- required_glob_keys:
150
- - route_handler_globs # e.g. core/src/**/*.controller.ts (NestJS) | app/controllers/**/*.rb (Rails)
151
- - dto_globs # e.g. core/src/**/*.dto.ts | apps/api/schemas/**/*.py
152
- - generator_source_globs # files that, when changed, mean the generator should re-run
153
- - high_stakes_globs # paths whose changes require Layer E + cross-tenant fixture
154
-
155
- # ──────────────────────────────────────────────────────────────────────────────
156
- # Copy-safety configuration (write guardian + Layer C sensor)
77
+ # Copy-safety configuration (write guardian + copy scanner)
157
78
  #
158
- # The write guardian (PostToolUse hook on Write/Edit) and the Layer C
159
- # copy-safety sensor both consume this block. Globs default to common frontend
79
+ # The write guardian and the copy scanner (both PostToolUse hooks on
80
+ # Write/Edit) consume this block. Globs default to common frontend
160
81
  # file extensions; extend per-project as needed. allowlist holds verbatim
161
82
  # strings that match a pattern but are intentional (technical error codes,
162
83
  # product names, etc.).
@@ -26,19 +26,16 @@ source-commits:
26
26
  - .env.local
27
27
  - node_modules/**
28
28
  # adopting project extends with its own off-limits paths at init
29
- high_stakes_globs: [] # populated at init from stack-profile heuristic + operator confirm
30
29
  trust_posture:
31
30
  safe_class_auto_merge: true
32
31
  code_class_auto_merge: false
33
- high_stakes_auto_merge: false
34
32
 
35
33
  ---
36
34
 
37
35
  # Workflow policy
38
36
 
39
- This file is the on-disk surface for the **project-extension block** that
40
- `cairn-core/src/sensors/runner.ts` reads (via `Object.keys()` lookup) and
41
- that the Phase-3 init mapper patches with discovered globs and sensors.
37
+ This file carries the **project-extension block** the project's `off_limits`
38
+ denylist and trust posture, seeded at adoption and extended by the operator.
42
39
 
43
40
  The plugin-era cairn does NOT use this file as a per-task prompt template
44
41
  — each task's spec lives at `.cairn/tasks/active/<task_id>/spec.tightened.md`
@@ -1,47 +0,0 @@
1
- /**
2
- * Confidence scoring for source-comment-derived DEC drafts and
3
- * invariant proposals.
4
- *
5
- * Phase 7b emits one DEC draft per "rationale"-class essay comment and
6
- * one invariant per "constraint"-class essay comment. On a busy
7
- * monorepo the classifier easily produces 400+ drafts — no human will
8
- * sort through that interactively, so we score each draft by a small
9
- * set of heuristics and bulk-accept the obvious ones during attention
10
- * drain. Operator triages only the medium / low-confidence remainder.
11
- *
12
- * Heuristic stance:
13
- * - **DEC drafts** are attribution-of-existing-prose. Cost of keeping
14
- * a borderline draft is near zero (queryable rationale metadata).
15
- * Bias accepts upward — score ≥7 → high.
16
- * - **Invariants** become enforcement signals; false positives turn
17
- * into noise during sensor sweeps. Bias accepts downward —
18
- * stricter signal required (modal verb + reason + high-stakes
19
- * location) before high-confidence accept.
20
- *
21
- * Scoring is pure. Inputs are the parsed draft fields; no filesystem.
22
- */
23
- import type { ProjectGlobs } from "../sensors/types.js";
24
- export type DraftConfidence = "high" | "medium" | "low";
25
- export interface DraftScoreInput {
26
- /** Repo-relative path to the source file the draft was extracted from. */
27
- sourceFile: string;
28
- /** Comment prose (markers stripped). */
29
- prose: string;
30
- /** Suggested DEC title or invariant text. */
31
- title: string;
32
- /** Raw block including markers + JSDoc tags. */
33
- rawComment: string;
34
- /** Project globs from `.cairn/config.yaml`. */
35
- globs: ProjectGlobs;
36
- }
37
- /**
38
- * Score a DEC draft. Max 8 / threshold 7→high / 4→medium.
39
- */
40
- export declare function scoreDecDraft(input: DraftScoreInput): DraftConfidence;
41
- /**
42
- * Score an invariant proposal. Max 9 / threshold 7→high / 4→medium.
43
- * Stricter than DEC scoring: requires modal verb + reason + high-stakes
44
- * location for high confidence, since false-positive invariants become
45
- * sensor-sweep noise downstream.
46
- */
47
- export declare function scoreInvariant(input: DraftScoreInput): DraftConfidence;
@@ -1,87 +0,0 @@
1
- /**
2
- * Confidence scoring for source-comment-derived DEC drafts and
3
- * invariant proposals.
4
- *
5
- * Phase 7b emits one DEC draft per "rationale"-class essay comment and
6
- * one invariant per "constraint"-class essay comment. On a busy
7
- * monorepo the classifier easily produces 400+ drafts — no human will
8
- * sort through that interactively, so we score each draft by a small
9
- * set of heuristics and bulk-accept the obvious ones during attention
10
- * drain. Operator triages only the medium / low-confidence remainder.
11
- *
12
- * Heuristic stance:
13
- * - **DEC drafts** are attribution-of-existing-prose. Cost of keeping
14
- * a borderline draft is near zero (queryable rationale metadata).
15
- * Bias accepts upward — score ≥7 → high.
16
- * - **Invariants** become enforcement signals; false positives turn
17
- * into noise during sensor sweeps. Bias accepts downward —
18
- * stricter signal required (modal verb + reason + high-stakes
19
- * location) before high-confidence accept.
20
- *
21
- * Scoring is pure. Inputs are the parsed draft fields; no filesystem.
22
- */
23
- import { matchAnyGlob } from "@isaacriehm/cairn-state";
24
- const DECISION_VERBS = /\b(chose|chosen|choose|decided|prefer|preferred|because|locked|enforce|enforced|require|required|adopt|adopted|standardize|standardized|switch|migrated|deprecate|reject|rejected)\b/i;
25
- const JSDOC_TAGS = /@(domain|scope|orgScope|see|param|returns|throws|deprecated|since|module|namespace|file|fileoverview|public|private|protected|internal|readonly|override|sealed|immutable|invariant)\b/;
26
- const INVARIANT_MODALS = /\b(MUST|MUSTN'T|MUST NOT|NEVER|ALWAYS|SHALL|SHALL NOT|CANNOT|FORBID|FORBIDDEN|REQUIRED|REQUIRES)\b/i;
27
- const REASON_MARKERS = /\b(because|to (prevent|ensure|avoid|guarantee|preserve|enforce|stop)|otherwise)\b/i;
28
- function inHighStakes(file, globs) {
29
- return matchAnyGlob(file, globs.high_stakes_globs ?? []);
30
- }
31
- function inRoutesOrDtos(file, globs) {
32
- const combined = [
33
- ...(globs.route_handler_globs ?? []),
34
- ...(globs.dto_globs ?? []),
35
- ];
36
- return matchAnyGlob(file, combined);
37
- }
38
- /**
39
- * Score a DEC draft. Max 8 / threshold 7→high / 4→medium.
40
- */
41
- export function scoreDecDraft(input) {
42
- let score = 0;
43
- if (inHighStakes(input.sourceFile, input.globs))
44
- score += 3;
45
- if (inRoutesOrDtos(input.sourceFile, input.globs))
46
- score += 1;
47
- const proseLen = input.prose.trim().length;
48
- if (proseLen >= 80 && proseLen <= 800)
49
- score += 2;
50
- const titleLen = input.title.trim().length;
51
- if (titleLen >= 10 && titleLen <= 80)
52
- score += 1;
53
- if (DECISION_VERBS.test(input.prose))
54
- score += 2;
55
- if (JSDOC_TAGS.test(input.rawComment))
56
- score += 1;
57
- if (score >= 7)
58
- return "high";
59
- if (score >= 4)
60
- return "medium";
61
- return "low";
62
- }
63
- /**
64
- * Score an invariant proposal. Max 9 / threshold 7→high / 4→medium.
65
- * Stricter than DEC scoring: requires modal verb + reason + high-stakes
66
- * location for high confidence, since false-positive invariants become
67
- * sensor-sweep noise downstream.
68
- */
69
- export function scoreInvariant(input) {
70
- let score = 0;
71
- if (inHighStakes(input.sourceFile, input.globs))
72
- score += 3;
73
- const modalText = `${input.title}\n${input.prose}`;
74
- if (INVARIANT_MODALS.test(modalText))
75
- score += 3;
76
- if (REASON_MARKERS.test(input.prose))
77
- score += 2;
78
- const proseLen = input.prose.trim().length;
79
- if (proseLen >= 50 && proseLen <= 600)
80
- score += 1;
81
- if (score >= 7)
82
- return "high";
83
- if (score >= 4)
84
- return "medium";
85
- return "low";
86
- }
87
- //# sourceMappingURL=scoring.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scoring.js","sourceRoot":"","sources":["../../src/attention/scoring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAkBvD,MAAM,cAAc,GAClB,uLAAuL,CAAC;AAE1L,MAAM,UAAU,GAAG,wLAAwL,CAAC;AAE5M,MAAM,gBAAgB,GACpB,qGAAqG,CAAC;AAExG,MAAM,cAAc,GAAG,oFAAoF,CAAC;AAE5G,SAAS,YAAY,CAAC,IAAY,EAAE,KAAmB;IACrD,OAAO,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E,OAAO,QAAQ,CAAC;IAChC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAsB;IACnD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC;QAAE,KAAK,IAAI,CAAC,CAAC;IAC5D,MAAM,SAAS,GAAG,GAAG,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;IACnD,IAAI,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,KAAK,IAAI,CAAC,CAAC;IACjD,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAAE,KAAK,IAAI,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC;IAC3C,IAAI,QAAQ,IAAI,EAAE,IAAI,QAAQ,IAAI,GAAG;QAAE,KAAK,IAAI,CAAC,CAAC;IAElD,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC;IAC9B,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IAChC,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Bin entrypoint — `node cairn-core/dist/hooks/read-enrich.js`.
4
- * PostToolUse on Read; injects citation legend.
5
- */
6
- export {};
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Bin entrypoint — `node cairn-core/dist/hooks/read-enrich.js`.
4
- * PostToolUse on Read; injects citation legend.
5
- */
6
- import { runReadEnricher } from "./post-tool-use/index.js";
7
- runReadEnricher().catch((err) => {
8
- process.stderr.write(`[cairn read-enrich] ${err instanceof Error ? err.message : String(err)}\n`);
9
- process.exit(1);
10
- });
11
- //# sourceMappingURL=read-enrich.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"read-enrich.js","sourceRoot":"","sources":["../../src/hooks/read-enrich.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,eAAe,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACvC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,uBAAuB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAC5E,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Bin entrypoint — `node cairn-core/dist/hooks/write-guard.js`.
4
- * PostToolUse on Write/Edit; copy-safety + scope reminder.
5
- */
6
- export {};
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Bin entrypoint — `node cairn-core/dist/hooks/write-guard.js`.
4
- * PostToolUse on Write/Edit; copy-safety + scope reminder.
5
- */
6
- import { runWriteGuardian } from "./post-tool-use/index.js";
7
- runWriteGuardian().catch((err) => {
8
- process.stderr.write(`[cairn write-guard] ${err instanceof Error ? err.message : String(err)}\n`);
9
- process.exit(1);
10
- });
11
- //# sourceMappingURL=write-guard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"write-guard.js","sourceRoot":"","sources":["../../src/hooks/write-guard.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,gBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IACxC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,uBAAuB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAC5E,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -1,16 +0,0 @@
1
- /**
2
- * Deterministic glob baseline derived from framework conventions detected
3
- * in Phase 1. The mapper LLM still adds project-specific globs on top;
4
- * these are always included regardless of LLM output.
5
- *
6
- * Pure function. Uses existsSync for file-presence checks only.
7
- */
8
- import type { DetectionResult } from "./types.js";
9
- export interface InferredGlobs {
10
- route_handler_globs: string[];
11
- dto_globs: string[];
12
- generator_source_globs: string[];
13
- high_stakes_globs: string[];
14
- off_limits_globs: string[];
15
- }
16
- export declare function inferGlobsFromDetection(detection: DetectionResult, repoRoot: string): InferredGlobs;
@@ -1,132 +0,0 @@
1
- /**
2
- * Deterministic glob baseline derived from framework conventions detected
3
- * in Phase 1. The mapper LLM still adds project-specific globs on top;
4
- * these are always included regardless of LLM output.
5
- *
6
- * Pure function. Uses existsSync for file-presence checks only.
7
- */
8
- import { existsSync } from "node:fs";
9
- import { join } from "node:path";
10
- export function inferGlobsFromDetection(detection, repoRoot) {
11
- const route_handler_globs = [];
12
- const dto_globs = [];
13
- const generator_source_globs = [];
14
- const sigs = detection.stack_signatures;
15
- const has = (rel) => existsSync(join(repoRoot, rel));
16
- // ── NestJS ───────────────────────────────────────────────
17
- if (has("nest-cli.json")) {
18
- route_handler_globs.push("**/*.controller.ts");
19
- dto_globs.push("**/*.dto.ts");
20
- }
21
- // ── Ruby ─────────────────────────────────────────────────
22
- if (sigs.some((s) => s.kind === "ruby")) {
23
- route_handler_globs.push("app/controllers/**/*.rb");
24
- dto_globs.push("app/forms/**/*.rb", "app/serializers/**/*.rb");
25
- }
26
- // ── Python ───────────────────────────────────────────────
27
- if (sigs.some((s) => s.kind === "python")) {
28
- route_handler_globs.push("**/views.py", "**/routes.py", "**/api/**/*.py");
29
- }
30
- // ── Go ───────────────────────────────────────────────────
31
- if (sigs.some((s) => s.kind === "go")) {
32
- route_handler_globs.push("**/handlers/**/*.go", "**/routes/**/*.go");
33
- }
34
- // ── Rust ─────────────────────────────────────────────────
35
- if (sigs.some((s) => s.kind === "rust")) {
36
- route_handler_globs.push("**/handlers.rs", "**/routes.rs");
37
- }
38
- // ── Java (Spring) ────────────────────────────────────────
39
- if (sigs.some((s) => s.kind === "java")) {
40
- route_handler_globs.push("**/*Controller.java", "**/*Resource.java");
41
- dto_globs.push("**/dto/**/*.java", "**/*Dto.java", "**/*Request.java");
42
- }
43
- // ── Kotlin (Spring / Ktor) ───────────────────────────────
44
- if (sigs.some((s) => s.kind === "kotlin")) {
45
- route_handler_globs.push("**/*Controller.kt", "**/routes/**/*.kt");
46
- dto_globs.push("**/dto/**/*.kt", "**/*Dto.kt", "**/*Request.kt");
47
- }
48
- // ── C# (.NET) ────────────────────────────────────────────
49
- if (sigs.some((s) => s.kind === "csharp")) {
50
- route_handler_globs.push("**/Controllers/**/*.cs", "**/*Controller.cs");
51
- dto_globs.push("**/Dtos/**/*.cs", "**/*Dto.cs");
52
- }
53
- // ── PHP (Laravel / Symfony) ──────────────────────────────
54
- if (sigs.some((s) => s.kind === "php")) {
55
- route_handler_globs.push("app/Http/Controllers/**/*.php", "**/*Controller.php");
56
- dto_globs.push("app/Http/Requests/**/*.php");
57
- }
58
- // ── Elixir (Phoenix) ─────────────────────────────────────
59
- if (sigs.some((s) => s.kind === "elixir")) {
60
- route_handler_globs.push("lib/**/*_controller.ex", "lib/**/controllers/**/*.ex");
61
- }
62
- // ── Prisma ───────────────────────────────────────────────
63
- if (has("prisma/schema.prisma")) {
64
- generator_source_globs.push("prisma/schema.prisma");
65
- }
66
- // ── Drizzle ──────────────────────────────────────────────
67
- if (has("drizzle.config.ts") ||
68
- has("drizzle.config.js") ||
69
- has("drizzle.config.mjs")) {
70
- generator_source_globs.push("**/db/schema.ts", "**/schema.ts");
71
- }
72
- // ── Protobuf ─────────────────────────────────────────────
73
- if (hasGlob(repoRoot, ".proto")) {
74
- generator_source_globs.push("**/*.proto");
75
- }
76
- // ── GraphQL ──────────────────────────────────────────────
77
- if (hasGlob(repoRoot, ".graphql") || hasGlob(repoRoot, ".gql")) {
78
- generator_source_globs.push("**/*.graphql", "**/*.gql");
79
- }
80
- // ── OpenAPI / Swagger ────────────────────────────────────
81
- if (has("openapi.json") ||
82
- has("openapi.yaml") ||
83
- has("swagger.json") ||
84
- has("swagger.yaml")) {
85
- generator_source_globs.push("openapi.{json,yaml}", "swagger.{json,yaml}");
86
- }
87
- // ── Always-on ────────────────────────────────────────────
88
- const high_stakes_globs = [
89
- "**/auth/**",
90
- "**/billing/**",
91
- "**/payment*/**",
92
- "**/security/**",
93
- "**/secrets/**",
94
- ];
95
- const off_limits_globs = [
96
- "**/vendor/**",
97
- "**/__generated__/**",
98
- "**/*.generated.ts",
99
- "**/*.pb.go",
100
- ];
101
- return {
102
- route_handler_globs,
103
- dto_globs,
104
- generator_source_globs,
105
- high_stakes_globs,
106
- off_limits_globs,
107
- };
108
- }
109
- /**
110
- * Returns true if any conventional top-level directory or file associated
111
- * with the given extension exists. Checks known common locations only —
112
- * avoids recursive tree walks for init performance.
113
- *
114
- * Proto: look for protos/, proto/, or *.proto at root.
115
- * GraphQL: look for schema.graphql/schema.gql at root or graphql/ dir.
116
- */
117
- function hasGlob(repoRoot, ext) {
118
- if (ext === ".proto") {
119
- return (existsSync(join(repoRoot, "protos")) ||
120
- existsSync(join(repoRoot, "proto")) ||
121
- existsSync(join(repoRoot, "schema.proto")) ||
122
- existsSync(join(repoRoot, "service.proto")));
123
- }
124
- if (ext === ".graphql" || ext === ".gql") {
125
- return (existsSync(join(repoRoot, "graphql")) ||
126
- existsSync(join(repoRoot, "schema.graphql")) ||
127
- existsSync(join(repoRoot, "schema.gql")) ||
128
- existsSync(join(repoRoot, "graph")));
129
- }
130
- return false;
131
- }
132
- //# sourceMappingURL=glob-inference.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"glob-inference.js","sourceRoot":"","sources":["../../src/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ces each ingestion-flagged module as an A/B/C choice (strip /
5
- * keep / skip). Tracks remaining modules in
6
- * `outputs["12-strip"].pending` and emits one question at a time
7
- * until the queue is empty.
8
- */
9
- import type { PhaseResult, PhaseState } from "./types.js";
10
- export declare function runPhase12Strip(state: PhaseState): Promise<PhaseResult>;
@@ -1,88 +0,0 @@
1
- /**
2
- * Phase 12-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["12-strip"].pending` and emits one question at a time
7
- * until the queue is empty.
8
- */
9
- import { advancePhase, isSelfAdoptState } from "./orchestrator.js";
10
- export async function runPhase12Strip(state) {
11
- if (isSelfAdoptState(state)) {
12
- const skipped = { pending: [], decisions: {} };
13
- const next = {
14
- ...state,
15
- outputs: { ...state.outputs, "12-strip": skipped },
16
- answer: undefined,
17
- };
18
- return {
19
- status: "complete",
20
- nextPhase: "13-multidev",
21
- state: advancePhase(next),
22
- };
23
- }
24
- const existing = state.outputs["12-strip"];
25
- const modules = computeFlaggedModules(state);
26
- // Initialize on first entry.
27
- let s = existing ?? { pending: [...modules], decisions: {} };
28
- // Operator just answered → record + dequeue.
29
- if (state.answer !== undefined && state.answer.length > 0 && s.pending.length > 0) {
30
- const head = s.pending[0];
31
- const choice = normalizeChoice(state.answer);
32
- s = {
33
- pending: s.pending.slice(1),
34
- decisions: { ...s.decisions, [head]: choice },
35
- };
36
- }
37
- if (s.pending.length === 0) {
38
- const next = {
39
- ...state,
40
- outputs: { ...state.outputs, "12-strip": s },
41
- answer: undefined,
42
- };
43
- return {
44
- status: "complete",
45
- nextPhase: "13-multidev",
46
- state: advancePhase(next),
47
- };
48
- }
49
- const head = s.pending[0];
50
- const question = {
51
- id: `12-strip:${head}`,
52
- prompt: `Strip the source-comment essay in ${head}?`,
53
- options: [
54
- {
55
- id: "strip",
56
- label: "strip — DEC is the source of truth",
57
- },
58
- {
59
- id: "keep",
60
- label: "keep — leave comment alongside DEC",
61
- },
62
- {
63
- id: "skip",
64
- label: "skip — decide later",
65
- },
66
- ],
67
- default: "skip",
68
- };
69
- return {
70
- status: "needs_input",
71
- question,
72
- state: { ...state, outputs: { ...state.outputs, "12-strip": s }, answer: undefined },
73
- };
74
- }
75
- function normalizeChoice(answer) {
76
- switch (answer) {
77
- case "strip":
78
- case "keep":
79
- case "skip":
80
- return answer;
81
- default:
82
- return "skip";
83
- }
84
- }
85
- function computeFlaggedModules(_state) {
86
- return [];
87
- }
88
- //# sourceMappingURL=12-strip.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"12-strip.js","sourceRoot":"","sources":["../../../src/init/phases/12-strip.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAQnE,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAAiB;IACrD,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAe,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;QAC3D,MAAM,IAAI,GAAe;YACvB,GAAG,KAAK;YACR,OAAO,EAAE,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE;YAClD,MAAM,EAAE,SAAS;SAClB,CAAC;QACF,OAAO;YACL,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,aAAa;YACxB,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC;SAC1B,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3C,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,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F;QACD,OAAO,EAAE,MAAM;KAChB,CAAC;IACF,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,QAAQ;QACR,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,KAAK,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,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -1,31 +0,0 @@
1
- /**
2
- * Layer C — generic project-agnostic structural sensors.
3
- *
4
- * Triggered when the diff touches files matching the project's glob keys.
5
- * Each sensor inspects the POST-change content of those files (not just
6
- * the diff) — Layer C is "do these load-bearing files follow contract",
7
- * which is stricter than Layer A's "did this run add new debt".
8
- *
9
- * route-handler-non-empty — every method in a route/controller class has a
10
- * non-trivial body. Catches "added handler that
11
- * does nothing" disguised as completion.
12
- * dto-no-fake-fields — @IsOptional() fields with no other validator
13
- * are fake-thoroughness; they look like work and
14
- * do nothing.
15
- *
16
- * Both are pattern-based; profiles plug stack-specific globs. The regex is
17
- * intentionally conservative (false-negatives over false-positives) — sensors
18
- * that fail-loud-on-noise get disabled which defeats the purpose.
19
- */
20
- import type { DiffEntry, SensorResult } from "./types.js";
21
- /** Run route-handler-non-empty against changed files matching globs. */
22
- export declare function runRouteHandlerNonEmpty(args: {
23
- diff: DiffEntry[];
24
- globs: string[] | undefined;
25
- }): SensorResult;
26
- /** Run dto-no-fake-fields against changed files matching globs. */
27
- export declare function runDtoNoFakeFields(args: {
28
- diff: DiffEntry[];
29
- globs: string[] | undefined;
30
- }): SensorResult;
31
- /** 1-based line number from a character offset. */