@manehorizons/cadence-core 1.6.0 → 1.7.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 (94) hide show
  1. package/dist/cli/commands/assumption.d.ts.map +1 -1
  2. package/dist/cli/commands/assumption.js +2 -1
  3. package/dist/cli/commands/assumption.js.map +1 -1
  4. package/dist/cli/commands/decision.d.ts.map +1 -1
  5. package/dist/cli/commands/decision.js +2 -1
  6. package/dist/cli/commands/decision.js.map +1 -1
  7. package/dist/cli/commands/doctor.d.ts +3 -0
  8. package/dist/cli/commands/doctor.d.ts.map +1 -0
  9. package/dist/cli/commands/doctor.js +44 -0
  10. package/dist/cli/commands/doctor.js.map +1 -0
  11. package/dist/cli/commands/draft-new.d.ts.map +1 -1
  12. package/dist/cli/commands/draft-new.js +2 -1
  13. package/dist/cli/commands/draft-new.js.map +1 -1
  14. package/dist/cli/commands/intelligence.d.ts.map +1 -1
  15. package/dist/cli/commands/intelligence.js +4 -1
  16. package/dist/cli/commands/intelligence.js.map +1 -1
  17. package/dist/cli/commands/milestone.js +1 -1
  18. package/dist/cli/commands/milestone.js.map +1 -1
  19. package/dist/cli/commands/recommendation.d.ts.map +1 -1
  20. package/dist/cli/commands/recommendation.js +53 -1
  21. package/dist/cli/commands/recommendation.js.map +1 -1
  22. package/dist/cli/commands/spec.d.ts.map +1 -1
  23. package/dist/cli/commands/spec.js +2 -1
  24. package/dist/cli/commands/spec.js.map +1 -1
  25. package/dist/cli/register.d.ts.map +1 -1
  26. package/dist/cli/register.js +2 -0
  27. package/dist/cli/register.js.map +1 -1
  28. package/dist/doctor/model.d.ts +27 -0
  29. package/dist/doctor/model.d.ts.map +1 -0
  30. package/dist/doctor/model.js +10 -0
  31. package/dist/doctor/model.js.map +1 -0
  32. package/dist/doctor/run.d.ts +3 -0
  33. package/dist/doctor/run.d.ts.map +1 -0
  34. package/dist/doctor/run.js +141 -0
  35. package/dist/doctor/run.js.map +1 -0
  36. package/dist/intelligence/context.js +2 -1
  37. package/dist/intelligence/context.js.map +1 -1
  38. package/dist/intelligence/inspect.js +2 -1
  39. package/dist/intelligence/inspect.js.map +1 -1
  40. package/dist/intelligence/milestone.d.ts.map +1 -1
  41. package/dist/intelligence/milestone.js +2 -1
  42. package/dist/intelligence/milestone.js.map +1 -1
  43. package/dist/intelligence/recommend.d.ts.map +1 -1
  44. package/dist/intelligence/recommend.js +2 -1
  45. package/dist/intelligence/recommend.js.map +1 -1
  46. package/dist/intelligence/render-intelligence-audit.d.ts +1 -1
  47. package/dist/intelligence/render-intelligence-audit.d.ts.map +1 -1
  48. package/dist/intelligence/render-intelligence-stats.d.ts +1 -1
  49. package/dist/intelligence/render-intelligence-stats.d.ts.map +1 -1
  50. package/dist/intelligence/store/assumptions.d.ts +17 -0
  51. package/dist/intelligence/store/assumptions.d.ts.map +1 -0
  52. package/dist/intelligence/store/assumptions.js +63 -0
  53. package/dist/intelligence/store/assumptions.js.map +1 -0
  54. package/dist/intelligence/store/audit.d.ts +42 -0
  55. package/dist/intelligence/store/audit.d.ts.map +1 -0
  56. package/dist/intelligence/store/audit.js +88 -0
  57. package/dist/intelligence/store/audit.js.map +1 -0
  58. package/dist/intelligence/store/decisions.d.ts +19 -0
  59. package/dist/intelligence/store/decisions.d.ts.map +1 -0
  60. package/dist/intelligence/store/decisions.js +147 -0
  61. package/dist/intelligence/store/decisions.js.map +1 -0
  62. package/dist/intelligence/store/ids.d.ts +6 -0
  63. package/dist/intelligence/store/ids.d.ts.map +1 -0
  64. package/dist/intelligence/store/ids.js +44 -0
  65. package/dist/intelligence/store/ids.js.map +1 -0
  66. package/dist/intelligence/store/io.d.ts +10 -0
  67. package/dist/intelligence/store/io.d.ts.map +1 -0
  68. package/dist/intelligence/store/io.js +70 -0
  69. package/dist/intelligence/store/io.js.map +1 -0
  70. package/dist/intelligence/store/milestones.d.ts +4 -0
  71. package/dist/intelligence/store/milestones.d.ts.map +1 -0
  72. package/dist/intelligence/store/milestones.js +20 -0
  73. package/dist/intelligence/store/milestones.js.map +1 -0
  74. package/dist/intelligence/store/paths.d.ts +11 -0
  75. package/dist/intelligence/store/paths.d.ts.map +1 -0
  76. package/dist/intelligence/store/paths.js +42 -0
  77. package/dist/intelligence/store/paths.js.map +1 -0
  78. package/dist/intelligence/store/recommendations.d.ts +29 -0
  79. package/dist/intelligence/store/recommendations.d.ts.map +1 -0
  80. package/dist/intelligence/store/recommendations.js +168 -0
  81. package/dist/intelligence/store/recommendations.js.map +1 -0
  82. package/dist/intelligence/store/reconcile.d.ts +8 -0
  83. package/dist/intelligence/store/reconcile.d.ts.map +1 -0
  84. package/dist/intelligence/store/reconcile.js +42 -0
  85. package/dist/intelligence/store/reconcile.js.map +1 -0
  86. package/dist/intelligence/store/stats.d.ts +36 -0
  87. package/dist/intelligence/store/stats.d.ts.map +1 -0
  88. package/dist/intelligence/store/stats.js +106 -0
  89. package/dist/intelligence/store/stats.js.map +1 -0
  90. package/package.json +2 -2
  91. package/dist/intelligence/store.d.ts +0 -143
  92. package/dist/intelligence/store.d.ts.map +0 -1
  93. package/dist/intelligence/store.js +0 -701
  94. package/dist/intelligence/store.js.map +0 -1
@@ -0,0 +1,168 @@
1
+ import { stat } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+ import { nextEvidenceId, nextRecommendationId } from './ids.js';
4
+ import { readEvidenceLedger, readRecommendationLedger, writeIntelligenceLedgers, } from './io.js';
5
+ export async function addRecommendation(root, input) {
6
+ const ledger = await readRecommendationLedger(root);
7
+ const evidenceLedger = await readEvidenceLedger(root);
8
+ const now = new Date();
9
+ const ts = now.toISOString();
10
+ const recommendationId = nextRecommendationId(ledger, now);
11
+ const evidence = input.evidenceSummary
12
+ ? {
13
+ id: nextEvidenceId(evidenceLedger, now),
14
+ recommendationId,
15
+ kind: 'note',
16
+ summary: input.evidenceSummary,
17
+ createdAt: ts,
18
+ }
19
+ : null;
20
+ const rec = {
21
+ id: recommendationId,
22
+ title: input.title,
23
+ summary: input.summary,
24
+ source: 'manual',
25
+ status: 'candidate',
26
+ readiness: input.readiness,
27
+ priority: input.priority,
28
+ leverageScore: 5,
29
+ riskScore: 5,
30
+ confidence: input.evidenceSummary ? 0.7 : 0.4,
31
+ decayState: 'fresh',
32
+ affectedAreas: input.affectedAreas,
33
+ affectedFiles: input.affectedFiles,
34
+ suggestedBackendAction: 'cadence milestone propose',
35
+ evidenceIds: evidence ? [evidence.id] : [],
36
+ assumptionIds: [],
37
+ decisionIds: [],
38
+ createdAt: ts,
39
+ updatedAt: ts,
40
+ };
41
+ if (evidence)
42
+ evidenceLedger.evidence.push(evidence);
43
+ ledger.recommendations.push(rec);
44
+ await writeIntelligenceLedgers(root, ledger, evidenceLedger);
45
+ return rec;
46
+ }
47
+ export function deriveRecommendationLinks(recLedger, asLedger, decLedger) {
48
+ return {
49
+ schemaVersion: 1,
50
+ recommendations: recLedger.recommendations.map((r) => ({
51
+ ...r,
52
+ assumptionIds: asLedger.assumptions
53
+ .filter((a) => a.recommendationId === r.id)
54
+ .map((a) => a.id),
55
+ decisionIds: decLedger.decisions
56
+ .filter((d) => d.recommendationId === r.id)
57
+ .map((d) => d.id),
58
+ })),
59
+ };
60
+ }
61
+ const RECOMMENDATION_TRANSITION_ALLOWED = {
62
+ convert: ['candidate', 'accepted'],
63
+ };
64
+ const RECOMMENDATION_TRANSITION_NEXT = {
65
+ convert: 'converted',
66
+ };
67
+ export function applyRecommendationTransition(ledger, id, action, toPhase, now) {
68
+ const target = ledger.recommendations.find((r) => r.id === id);
69
+ if (!target)
70
+ return { ok: false, error: `recommendation ${id} not found` };
71
+ if (!RECOMMENDATION_TRANSITION_ALLOWED[action].includes(target.status)) {
72
+ return {
73
+ ok: false,
74
+ error: `cannot ${action} recommendation in status ${target.status}`,
75
+ };
76
+ }
77
+ const nextStatus = RECOMMENDATION_TRANSITION_NEXT[action];
78
+ const updatedAt = now.toISOString();
79
+ const ledgerOut = {
80
+ schemaVersion: 1,
81
+ recommendations: ledger.recommendations.map((r) => r.id === id
82
+ ? { ...r, status: nextStatus, convertedToPhaseId: toPhase, updatedAt }
83
+ : r),
84
+ };
85
+ return { ok: true, ledger: ledgerOut };
86
+ }
87
+ /** Statuses an operator may promote *from*. `converted`/`rejected` are terminal. */
88
+ const PROMOTABLE_FROM = new Set([
89
+ 'candidate',
90
+ 'accepted',
91
+ 'deferred',
92
+ ]);
93
+ export function applyRecommendationPromotion(ledger, id, changes, now) {
94
+ const target = ledger.recommendations.find((r) => r.id === id);
95
+ if (!target)
96
+ return { ok: false, error: `recommendation ${id} not found` };
97
+ if (changes.status === undefined && changes.readiness === undefined) {
98
+ return {
99
+ ok: false,
100
+ error: 'nothing to promote: provide --status and/or --readiness',
101
+ };
102
+ }
103
+ if (changes.status === 'converted') {
104
+ return {
105
+ ok: false,
106
+ error: 'cannot promote to converted — use `cadence recommendation convert` (it sets the phase link)',
107
+ };
108
+ }
109
+ if (!PROMOTABLE_FROM.has(target.status)) {
110
+ return {
111
+ ok: false,
112
+ error: `cannot promote recommendation in terminal status ${target.status}`,
113
+ };
114
+ }
115
+ const updatedAt = now.toISOString();
116
+ const ledgerOut = {
117
+ schemaVersion: 1,
118
+ recommendations: ledger.recommendations.map((r) => r.id === id
119
+ ? {
120
+ ...r,
121
+ ...(changes.status !== undefined ? { status: changes.status } : {}),
122
+ ...(changes.readiness !== undefined
123
+ ? { readiness: changes.readiness }
124
+ : {}),
125
+ updatedAt,
126
+ }
127
+ : r),
128
+ };
129
+ return { ok: true, ledger: ledgerOut };
130
+ }
131
+ // Slice 34.1: existence check for `.cadence/phases/<phaseId>/` lives in the
132
+ // I/O wrapper deliberately — keeps the pure helper disk-free (per Slice 34
133
+ // Decision Log §10 + §11 architectural principle).
134
+ async function phaseDirectoryExists(root, phaseId) {
135
+ try {
136
+ const s = await stat(join(root, '.cadence/phases', phaseId));
137
+ return s.isDirectory();
138
+ }
139
+ catch {
140
+ return false;
141
+ }
142
+ }
143
+ export async function runRecommendationTransition(root, id, action, toPhase) {
144
+ // FK check FIRST so a missing phase is caught before any ledger read.
145
+ // Mirrors Slice 28's --by precedence: validate FK before applying transition.
146
+ if (!(await phaseDirectoryExists(root, toPhase))) {
147
+ return { ok: false, error: `cannot convert: phase ${toPhase} not found` };
148
+ }
149
+ const ledger = await readRecommendationLedger(root);
150
+ const res = applyRecommendationTransition(ledger, id, action, toPhase, new Date());
151
+ if (!res.ok)
152
+ return res;
153
+ // writeIntelligenceLedgers handles atomic JSON + RECOMMENDATIONS.md re-render
154
+ // (Slice 15 annotated form), so we don't need a separate rerender call.
155
+ const evidenceLedger = await readEvidenceLedger(root);
156
+ await writeIntelligenceLedgers(root, res.ledger, evidenceLedger);
157
+ return res;
158
+ }
159
+ export async function runRecommendationPromotion(root, id, changes) {
160
+ const ledger = await readRecommendationLedger(root);
161
+ const res = applyRecommendationPromotion(ledger, id, changes, new Date());
162
+ if (!res.ok)
163
+ return res;
164
+ const evidenceLedger = await readEvidenceLedger(root);
165
+ await writeIntelligenceLedgers(root, res.ledger, evidenceLedger);
166
+ return res;
167
+ }
168
+ //# sourceMappingURL=recommendations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recommendations.js","sourceRoot":"","sources":["../../../src/intelligence/store/recommendations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAWjC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAYjB,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,IAAY,EACZ,KAA6B;IAE7B,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,cAAc,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtD,MAAM,GAAG,GAAG,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AAC;IAC1E,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,OAAO,GAAG,CAAC;IACxB,MAAM,cAAc,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtD,MAAM,wBAAwB,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACjE,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,8 @@
1
+ export type IntelligenceReconcileResult = {
2
+ present: boolean;
3
+ recommendations: number;
4
+ assumptions: number;
5
+ decisions: number;
6
+ };
7
+ export declare function runIntelligenceReconcile(root: string): Promise<IntelligenceReconcileResult>;
8
+ //# sourceMappingURL=reconcile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../../../src/intelligence/store/reconcile.ts"],"names":[],"mappings":"AAyBA,MAAM,MAAM,2BAA2B,GAAG;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,2BAA2B,CAAC,CA+BtC"}
@@ -0,0 +1,42 @@
1
+ import { mkdir } from 'node:fs/promises';
2
+ import { existsSync } from 'node:fs';
3
+ import { atomicWriteText } from '../../state/atomic-write.js';
4
+ import { renderAssumptionsMd } from '../render-assumption.js';
5
+ import { renderDecisionsMd } from '../render-decision.js';
6
+ import { assumptionsMdPath, assumptionsPath, decisionsMdPath, decisionsPath, evidencePath, intelligenceDir, recommendationsPath, } from './paths.js';
7
+ import { readAssumptionLedger, readEvidenceLedger, readIntelligenceDecisionLedger, readRecommendationLedger, writeIntelligenceDecisionLedger, writeIntelligenceLedgers, } from './io.js';
8
+ import { deriveRecommendationLinks } from './recommendations.js';
9
+ import { deriveDecisionInverseLinks } from './decisions.js';
10
+ export async function runIntelligenceReconcile(root) {
11
+ const recExists = existsSync(recommendationsPath(root));
12
+ const evExists = existsSync(evidencePath(root));
13
+ const asExists = existsSync(assumptionsPath(root));
14
+ const decExists = existsSync(decisionsPath(root));
15
+ if (!recExists && !evExists && !asExists && !decExists) {
16
+ return { present: false, recommendations: 0, assumptions: 0, decisions: 0 };
17
+ }
18
+ const recLedger = await readRecommendationLedger(root);
19
+ const evLedger = await readEvidenceLedger(root);
20
+ const asLedger = await readAssumptionLedger(root);
21
+ const decLedger = await readIntelligenceDecisionLedger(root);
22
+ // Re-derive rec link arrays from current subject ledgers (idempotent if already correct).
23
+ const derivedRec = deriveRecommendationLinks(recLedger, asLedger, decLedger);
24
+ // Slice 31: re-derive decision inverse-links (supersedes arrays) from
25
+ // current supersededBy values. Idempotent. Operator's "force re-derive"
26
+ // command fixes any drift introduced by manual JSON edits.
27
+ const derivedDec = deriveDecisionInverseLinks(decLedger);
28
+ // writeIntelligenceLedgers handles atomic JSON + RECOMMENDATIONS.md re-render (Slice 15 annotated form).
29
+ await writeIntelligenceLedgers(root, derivedRec, evLedger);
30
+ await writeIntelligenceDecisionLedger(root, derivedDec);
31
+ // Re-render subject MDs from current ledgers (source-of-truth JSON untouched).
32
+ await mkdir(intelligenceDir(root), { recursive: true });
33
+ await atomicWriteText(assumptionsMdPath(root), renderAssumptionsMd(asLedger));
34
+ await atomicWriteText(decisionsMdPath(root), renderDecisionsMd(derivedDec));
35
+ return {
36
+ present: true,
37
+ recommendations: derivedRec.recommendations.length,
38
+ assumptions: asLedger.assumptions.length,
39
+ decisions: derivedDec.decisions.length,
40
+ };
41
+ }
42
+ //# sourceMappingURL=reconcile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconcile.js","sourceRoot":"","sources":["../../../src/intelligence/store/reconcile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;A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MAAM,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,MAAM,8BAA8B,CAAC,IAAI,CAAC,CAAC;IAC7D,0FAA0F;IAC1F,MAAM,UAAU,GAAG,yBAAyB,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC7E,sEAAsE;IACtE,wEAAwE;IACxE,2DAA2D;IAC3D,MAAM,UAAU,GAAG,0BAA0B,CAAC,SAAS,CAAC,CAAC;IACzD,yGAAyG;IACzG,MAAM,wBAAwB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC3D,MAAM,+BAA+B,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACxD,+EAA+E;IAC/E,MAAM,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,MAAM,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9E,MAAM,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5E,OAAO;QACL,OAAO,EAAE,IAAI;QACb,eAAe,EAAE,UAAU,CAAC,eAAe,CAAC,MAAM;QAClD,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,MAAM;QACxC,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,MAAM;KACvC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { Assumption, AssumptionLedger, Evidence, EvidenceLedger, IntelligenceDecision, IntelligenceDecisionLedger, Recommendation, RecommendationLedger } from '@manehorizons/cadence-types';
2
+ export type IntelligenceStats = {
3
+ recommendations: {
4
+ total: number;
5
+ byStatus: Record<Recommendation['status'], number>;
6
+ byReadiness: Record<Recommendation['readiness'], number>;
7
+ };
8
+ evidence: {
9
+ total: number;
10
+ byKind: Record<Evidence['kind'], number>;
11
+ };
12
+ assumptions: {
13
+ total: number;
14
+ byStatus: Record<Assumption['status'], number>;
15
+ };
16
+ decisions: {
17
+ total: number;
18
+ byStatus: Record<IntelligenceDecision['status'], number>;
19
+ untied: number;
20
+ };
21
+ links: {
22
+ brokenAssumptionLinks: number;
23
+ brokenDecisionLinks: number;
24
+ brokenEvidenceLinks: number;
25
+ };
26
+ perRec: Array<{
27
+ id: string;
28
+ title: string;
29
+ status: Recommendation['status'];
30
+ assumptionsByStatus: Record<Assumption['status'], number>;
31
+ decisionsByStatus: Record<IntelligenceDecision['status'], number>;
32
+ evidenceCount: number;
33
+ }>;
34
+ };
35
+ export declare function computeIntelligenceStats(recLedger: RecommendationLedger, evLedger: EvidenceLedger, asLedger: AssumptionLedger, decLedger: IntelligenceDecisionLedger): IntelligenceStats;
36
+ //# sourceMappingURL=stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/intelligence/store/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,0BAA0B,EAC1B,cAAc,EACd,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,EAAE;QACf,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;QACnD,WAAW,EAAE,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;KAC1D,CAAC;IACF,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;KAC1C,CAAC;IACF,WAAW,EAAE;QACX,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;KAChD,CAAC;IACF,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;QACzD,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,EAAE;QACL,qBAAqB,EAAE,MAAM,CAAC;QAC9B,mBAAmB,EAAE,MAAM,CAAC;QAC5B,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC;IACF,MAAM,EAAE,KAAK,CAAC;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;QACjC,mBAAmB,EAAE,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;QAC1D,iBAAiB,EAAE,MAAM,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;QAClE,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC,CAAC;CACJ,CAAC;AAyBF,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,oBAAoB,EAC/B,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,EAAE,0BAA0B,GACpC,iBAAiB,CA0FnB"}
@@ -0,0 +1,106 @@
1
+ const REC_STATUSES = [
2
+ 'candidate',
3
+ 'accepted',
4
+ 'deferred',
5
+ 'rejected',
6
+ 'converted',
7
+ ];
8
+ const REC_READINESSES = [
9
+ 'raw-idea',
10
+ 'needs-evidence',
11
+ 'needs-decision',
12
+ 'ready-for-milestone',
13
+ 'ready-for-cadence-spec',
14
+ 'blocked',
15
+ ];
16
+ const EV_KINDS = ['file', 'command', 'cadence-artifact', 'note'];
17
+ const AS_STATUSES = ['open', 'validated', 'rejected'];
18
+ const DEC_STATUSES = [
19
+ 'active',
20
+ 'superseded',
21
+ 'rescinded',
22
+ ];
23
+ export function computeIntelligenceStats(recLedger, evLedger, asLedger, decLedger) {
24
+ const recByStatus = Object.fromEntries(REC_STATUSES.map((s) => [s, 0]));
25
+ const recByReadiness = Object.fromEntries(REC_READINESSES.map((r) => [r, 0]));
26
+ for (const r of recLedger.recommendations) {
27
+ recByStatus[r.status]++;
28
+ recByReadiness[r.readiness]++;
29
+ }
30
+ const evByKind = Object.fromEntries(EV_KINDS.map((k) => [k, 0]));
31
+ for (const ev of evLedger.evidence)
32
+ evByKind[ev.kind]++;
33
+ const asByStatus = Object.fromEntries(AS_STATUSES.map((s) => [s, 0]));
34
+ for (const a of asLedger.assumptions)
35
+ asByStatus[a.status]++;
36
+ const decByStatus = Object.fromEntries(DEC_STATUSES.map((s) => [s, 0]));
37
+ let decUntied = 0;
38
+ for (const d of decLedger.decisions) {
39
+ decByStatus[d.status]++;
40
+ if (d.recommendationId === undefined)
41
+ decUntied++;
42
+ }
43
+ const asById = new Map(asLedger.assumptions.map((a) => [a.id, a]));
44
+ const decById = new Map(decLedger.decisions.map((d) => [d.id, d]));
45
+ const evById = new Map(evLedger.evidence.map((e) => [e.id, e]));
46
+ let brokenAssumptionLinks = 0;
47
+ let brokenDecisionLinks = 0;
48
+ let brokenEvidenceLinks = 0;
49
+ for (const r of recLedger.recommendations) {
50
+ for (const id of r.assumptionIds)
51
+ if (!asById.has(id))
52
+ brokenAssumptionLinks++;
53
+ for (const id of r.decisionIds)
54
+ if (!decById.has(id))
55
+ brokenDecisionLinks++;
56
+ for (const id of r.evidenceIds)
57
+ if (!evById.has(id))
58
+ brokenEvidenceLinks++;
59
+ }
60
+ const perRec = recLedger.recommendations.map((r) => {
61
+ const ascount = Object.fromEntries(AS_STATUSES.map((s) => [s, 0]));
62
+ const dccount = Object.fromEntries(DEC_STATUSES.map((s) => [s, 0]));
63
+ for (const id of r.assumptionIds) {
64
+ const a = asById.get(id);
65
+ if (a)
66
+ ascount[a.status]++;
67
+ }
68
+ for (const id of r.decisionIds) {
69
+ const d = decById.get(id);
70
+ if (d)
71
+ dccount[d.status]++;
72
+ }
73
+ let evCount = 0;
74
+ for (const id of r.evidenceIds)
75
+ if (evById.has(id))
76
+ evCount++;
77
+ return {
78
+ id: r.id,
79
+ title: r.title,
80
+ status: r.status,
81
+ assumptionsByStatus: ascount,
82
+ decisionsByStatus: dccount,
83
+ evidenceCount: evCount,
84
+ };
85
+ });
86
+ return {
87
+ recommendations: {
88
+ total: recLedger.recommendations.length,
89
+ byStatus: recByStatus,
90
+ byReadiness: recByReadiness,
91
+ },
92
+ evidence: { total: evLedger.evidence.length, byKind: evByKind },
93
+ assumptions: {
94
+ total: asLedger.assumptions.length,
95
+ byStatus: asByStatus,
96
+ },
97
+ decisions: {
98
+ total: decLedger.decisions.length,
99
+ byStatus: decByStatus,
100
+ untied: decUntied,
101
+ },
102
+ links: { brokenAssumptionLinks, brokenDecisionLinks, brokenEvidenceLinks },
103
+ perRec,
104
+ };
105
+ }
106
+ //# sourceMappingURL=stats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../src/intelligence/store/stats.ts"],"names":[],"mappings":"AA6CA,MAAM,YAAY,GAA+B;IAC/C,WAAW;IACX,UAAU;IACV,UAAU;IACV,UAAU;IACV,WAAW;CACZ,CAAC;AACF,MAAM,eAAe,GAAkC;IACrD,UAAU;IACV,gBAAgB;IAChB,gBAAgB;IAChB,qBAAqB;IACrB,wBAAwB;IACxB,SAAS;CACV,CAAC;AACF,MAAM,QAAQ,GAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAC;AACrF,MAAM,WAAW,GAA2B,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;AAC9E,MAAM,YAAY,GAAqC;IACrD,QAAQ;IACR,YAAY;IACZ,WAAW;CACZ,CAAC;AAEF,MAAM,UAAU,wB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AAO;SACvB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,eAAe,EAAE;YACf,KAAK,EAAE,SAAS,CAAC,eAAe,CAAC,MAAM;YACvC,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,cAAc;SAC5B;QACD,QAAQ,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE;QAC/D,WAAW,EAAE;YACX,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,MAAM;YAClC,QAAQ,EAAE,UAAU;SACrB;QACD,SAAS,EAAE;YACT,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM;YACjC,QAAQ,EAAE,WAAW;YACrB,MAAM,EAAE,SAAS;SAClB;QACD,KAAK,EAAE,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE;QAC1E,MAAM;KACP,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manehorizons/cadence-core",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "engines": {
5
5
  "node": ">=20"
6
6
  },
@@ -50,7 +50,7 @@
50
50
  "@anthropic-ai/sdk": "^0.96.0",
51
51
  "commander": "^13.0.0",
52
52
  "zod": "^4.4.3",
53
- "@manehorizons/cadence-types": "1.6.0"
53
+ "@manehorizons/cadence-types": "1.7.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "vitest": "^2.1.0",
@@ -1,143 +0,0 @@
1
- import { type Assumption, type AssumptionLedger, type Evidence, type EvidenceLedger, type IntelligenceDecision, type IntelligenceDecisionLedger, type MilestoneLedger, type Recommendation, type RecommendationLedger, type RecommendationPriority, type RecommendationReadiness } from '@manehorizons/cadence-types';
2
- export type AddRecommendationInput = {
3
- title: string;
4
- summary: string;
5
- priority: RecommendationPriority;
6
- readiness: RecommendationReadiness;
7
- affectedAreas: string[];
8
- affectedFiles: string[];
9
- evidenceSummary?: string;
10
- };
11
- export declare function intelligenceDir(root: string): string;
12
- export declare function readRecommendationLedger(root: string): Promise<RecommendationLedger>;
13
- export declare function readEvidenceLedger(root: string): Promise<EvidenceLedger>;
14
- export declare function readAssumptionLedger(root: string): Promise<AssumptionLedger>;
15
- export declare function readIntelligenceDecisionLedger(root: string): Promise<IntelligenceDecisionLedger>;
16
- export declare function addRecommendation(root: string, input: AddRecommendationInput): Promise<Recommendation>;
17
- export type AddAssumptionInput = {
18
- recommendationId: string;
19
- text: string;
20
- };
21
- export declare function addAssumption(root: string, input: AddAssumptionInput): Promise<Assumption>;
22
- export type AssumptionTransitionAction = 'validate' | 'reject' | 'reopen';
23
- export type AssumptionTransitionResult = {
24
- ok: true;
25
- ledger: AssumptionLedger;
26
- } | {
27
- ok: false;
28
- error: string;
29
- };
30
- export declare function applyAssumptionTransition(ledger: AssumptionLedger, id: string, action: AssumptionTransitionAction, _now?: Date): AssumptionTransitionResult;
31
- export declare function runAssumptionTransition(root: string, id: string, action: AssumptionTransitionAction): Promise<AssumptionTransitionResult>;
32
- export declare function deriveRecommendationLinks(recLedger: RecommendationLedger, asLedger: AssumptionLedger, decLedger: IntelligenceDecisionLedger): RecommendationLedger;
33
- export type AddIntelligenceDecisionInput = {
34
- recommendationId?: string;
35
- title: string;
36
- rationale: string;
37
- };
38
- export declare function addIntelligenceDecision(root: string, input: AddIntelligenceDecisionInput): Promise<IntelligenceDecision>;
39
- export type DecisionTransitionAction = 'supersede' | 'rescind' | 'reactivate';
40
- export type DecisionTransitionResult = {
41
- ok: true;
42
- ledger: IntelligenceDecisionLedger;
43
- } | {
44
- ok: false;
45
- error: string;
46
- };
47
- export declare function deriveDecisionInverseLinks(ledger: IntelligenceDecisionLedger): IntelligenceDecisionLedger;
48
- export declare function applyDecisionTransition(ledger: IntelligenceDecisionLedger, id: string, action: DecisionTransitionAction, by?: string, _now?: Date): DecisionTransitionResult;
49
- export declare function runDecisionTransition(root: string, id: string, action: DecisionTransitionAction, by?: string): Promise<DecisionTransitionResult>;
50
- export type RecommendationTransitionAction = 'convert';
51
- export type RecommendationTransitionResult = {
52
- ok: true;
53
- ledger: RecommendationLedger;
54
- } | {
55
- ok: false;
56
- error: string;
57
- };
58
- export declare function applyRecommendationTransition(ledger: RecommendationLedger, id: string, action: RecommendationTransitionAction, toPhase: string, now: Date): RecommendationTransitionResult;
59
- export declare function runRecommendationTransition(root: string, id: string, action: RecommendationTransitionAction, toPhase: string): Promise<RecommendationTransitionResult>;
60
- export type IntelligenceStats = {
61
- recommendations: {
62
- total: number;
63
- byStatus: Record<Recommendation['status'], number>;
64
- byReadiness: Record<Recommendation['readiness'], number>;
65
- };
66
- evidence: {
67
- total: number;
68
- byKind: Record<Evidence['kind'], number>;
69
- };
70
- assumptions: {
71
- total: number;
72
- byStatus: Record<Assumption['status'], number>;
73
- };
74
- decisions: {
75
- total: number;
76
- byStatus: Record<IntelligenceDecision['status'], number>;
77
- untied: number;
78
- };
79
- links: {
80
- brokenAssumptionLinks: number;
81
- brokenDecisionLinks: number;
82
- brokenEvidenceLinks: number;
83
- };
84
- perRec: Array<{
85
- id: string;
86
- title: string;
87
- status: Recommendation['status'];
88
- assumptionsByStatus: Record<Assumption['status'], number>;
89
- decisionsByStatus: Record<IntelligenceDecision['status'], number>;
90
- evidenceCount: number;
91
- }>;
92
- };
93
- export declare function computeIntelligenceStats(recLedger: RecommendationLedger, evLedger: EvidenceLedger, asLedger: AssumptionLedger, decLedger: IntelligenceDecisionLedger): IntelligenceStats;
94
- export type IntelligenceAuditFinding = {
95
- kind: 'broken-assumption-link';
96
- recId: string;
97
- assumptionId: string;
98
- } | {
99
- kind: 'broken-decision-link';
100
- recId: string;
101
- decisionId: string;
102
- } | {
103
- kind: 'broken-evidence-link';
104
- recId: string;
105
- evidenceId: string;
106
- } | {
107
- kind: 'orphan-assumption';
108
- assumptionId: string;
109
- missingRecId: string;
110
- } | {
111
- kind: 'orphan-decision';
112
- decisionId: string;
113
- missingRecId: string;
114
- } | {
115
- kind: 'orphan-evidence';
116
- evidenceId: string;
117
- missingRecId: string;
118
- } | {
119
- kind: 'stale-supersededby';
120
- decisionId: string;
121
- missingTargetId: string;
122
- } | {
123
- kind: 'stale-converted-phase';
124
- recommendationId: string;
125
- missingPhaseId: string;
126
- };
127
- export type IntelligenceAuditReport = {
128
- findings: IntelligenceAuditFinding[];
129
- byKind: Record<IntelligenceAuditFinding['kind'], IntelligenceAuditFinding[]>;
130
- };
131
- export declare const AUDIT_KINDS: readonly ["broken-assumption-link", "broken-decision-link", "broken-evidence-link", "orphan-assumption", "orphan-decision", "orphan-evidence", "stale-supersededby", "stale-converted-phase"];
132
- export type AuditKind = (typeof AUDIT_KINDS)[number];
133
- export declare function computeIntelligenceAudit(recLedger: RecommendationLedger, evLedger: EvidenceLedger, asLedger: AssumptionLedger, decLedger: IntelligenceDecisionLedger, existingPhaseIds?: Set<string>): IntelligenceAuditReport;
134
- export type IntelligenceReconcileResult = {
135
- present: boolean;
136
- recommendations: number;
137
- assumptions: number;
138
- decisions: number;
139
- };
140
- export declare function runIntelligenceReconcile(root: string): Promise<IntelligenceReconcileResult>;
141
- export declare function readMilestoneLedger(root: string): Promise<MilestoneLedger>;
142
- export declare function writeMilestoneLedger(root: string, ledger: MilestoneLedger): Promise<void>;
143
- //# sourceMappingURL=store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/intelligence/store.ts"],"names":[],"mappings":"AAGA,OAAO,EAWL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC7B,MAAM,6BAA6B,CAAC;AAgBrC,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,C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