@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.
- package/dist/cli/commands/assumption.d.ts.map +1 -1
- package/dist/cli/commands/assumption.js +2 -1
- package/dist/cli/commands/assumption.js.map +1 -1
- package/dist/cli/commands/decision.d.ts.map +1 -1
- package/dist/cli/commands/decision.js +2 -1
- package/dist/cli/commands/decision.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +44 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/draft-new.d.ts.map +1 -1
- package/dist/cli/commands/draft-new.js +2 -1
- package/dist/cli/commands/draft-new.js.map +1 -1
- package/dist/cli/commands/intelligence.d.ts.map +1 -1
- package/dist/cli/commands/intelligence.js +4 -1
- package/dist/cli/commands/intelligence.js.map +1 -1
- package/dist/cli/commands/milestone.js +1 -1
- package/dist/cli/commands/milestone.js.map +1 -1
- package/dist/cli/commands/recommendation.d.ts.map +1 -1
- package/dist/cli/commands/recommendation.js +53 -1
- package/dist/cli/commands/recommendation.js.map +1 -1
- package/dist/cli/commands/spec.d.ts.map +1 -1
- package/dist/cli/commands/spec.js +2 -1
- package/dist/cli/commands/spec.js.map +1 -1
- package/dist/cli/register.d.ts.map +1 -1
- package/dist/cli/register.js +2 -0
- package/dist/cli/register.js.map +1 -1
- package/dist/doctor/model.d.ts +27 -0
- package/dist/doctor/model.d.ts.map +1 -0
- package/dist/doctor/model.js +10 -0
- package/dist/doctor/model.js.map +1 -0
- package/dist/doctor/run.d.ts +3 -0
- package/dist/doctor/run.d.ts.map +1 -0
- package/dist/doctor/run.js +141 -0
- package/dist/doctor/run.js.map +1 -0
- package/dist/intelligence/context.js +2 -1
- package/dist/intelligence/context.js.map +1 -1
- package/dist/intelligence/inspect.js +2 -1
- package/dist/intelligence/inspect.js.map +1 -1
- package/dist/intelligence/milestone.d.ts.map +1 -1
- package/dist/intelligence/milestone.js +2 -1
- package/dist/intelligence/milestone.js.map +1 -1
- package/dist/intelligence/recommend.d.ts.map +1 -1
- package/dist/intelligence/recommend.js +2 -1
- package/dist/intelligence/recommend.js.map +1 -1
- package/dist/intelligence/render-intelligence-audit.d.ts +1 -1
- package/dist/intelligence/render-intelligence-audit.d.ts.map +1 -1
- package/dist/intelligence/render-intelligence-stats.d.ts +1 -1
- package/dist/intelligence/render-intelligence-stats.d.ts.map +1 -1
- package/dist/intelligence/store/assumptions.d.ts +17 -0
- package/dist/intelligence/store/assumptions.d.ts.map +1 -0
- package/dist/intelligence/store/assumptions.js +63 -0
- package/dist/intelligence/store/assumptions.js.map +1 -0
- package/dist/intelligence/store/audit.d.ts +42 -0
- package/dist/intelligence/store/audit.d.ts.map +1 -0
- package/dist/intelligence/store/audit.js +88 -0
- package/dist/intelligence/store/audit.js.map +1 -0
- package/dist/intelligence/store/decisions.d.ts +19 -0
- package/dist/intelligence/store/decisions.d.ts.map +1 -0
- package/dist/intelligence/store/decisions.js +147 -0
- package/dist/intelligence/store/decisions.js.map +1 -0
- package/dist/intelligence/store/ids.d.ts +6 -0
- package/dist/intelligence/store/ids.d.ts.map +1 -0
- package/dist/intelligence/store/ids.js +44 -0
- package/dist/intelligence/store/ids.js.map +1 -0
- package/dist/intelligence/store/io.d.ts +10 -0
- package/dist/intelligence/store/io.d.ts.map +1 -0
- package/dist/intelligence/store/io.js +70 -0
- package/dist/intelligence/store/io.js.map +1 -0
- package/dist/intelligence/store/milestones.d.ts +4 -0
- package/dist/intelligence/store/milestones.d.ts.map +1 -0
- package/dist/intelligence/store/milestones.js +20 -0
- package/dist/intelligence/store/milestones.js.map +1 -0
- package/dist/intelligence/store/paths.d.ts +11 -0
- package/dist/intelligence/store/paths.d.ts.map +1 -0
- package/dist/intelligence/store/paths.js +42 -0
- package/dist/intelligence/store/paths.js.map +1 -0
- package/dist/intelligence/store/recommendations.d.ts +29 -0
- package/dist/intelligence/store/recommendations.d.ts.map +1 -0
- package/dist/intelligence/store/recommendations.js +168 -0
- package/dist/intelligence/store/recommendations.js.map +1 -0
- package/dist/intelligence/store/reconcile.d.ts +8 -0
- package/dist/intelligence/store/reconcile.d.ts.map +1 -0
- package/dist/intelligence/store/reconcile.js +42 -0
- package/dist/intelligence/store/reconcile.js.map +1 -0
- package/dist/intelligence/store/stats.d.ts +36 -0
- package/dist/intelligence/store/stats.d.ts.map +1 -0
- package/dist/intelligence/store/stats.js +106 -0
- package/dist/intelligence/store/stats.js.map +1 -0
- package/package.json +2 -2
- package/dist/intelligence/store.d.ts +0 -143
- package/dist/intelligence/store.d.ts.map +0 -1
- package/dist/intelligence/store.js +0 -701
- package/dist/intelligence/store.js.map +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AssumptionLedger, EvidenceLedger, IntelligenceDecisionLedger, RecommendationLedger } from '@manehorizons/cadence-types';
|
|
2
|
+
export type IntelligenceAuditFinding = {
|
|
3
|
+
kind: 'broken-assumption-link';
|
|
4
|
+
recId: string;
|
|
5
|
+
assumptionId: string;
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'broken-decision-link';
|
|
8
|
+
recId: string;
|
|
9
|
+
decisionId: string;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'broken-evidence-link';
|
|
12
|
+
recId: string;
|
|
13
|
+
evidenceId: string;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'orphan-assumption';
|
|
16
|
+
assumptionId: string;
|
|
17
|
+
missingRecId: string;
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'orphan-decision';
|
|
20
|
+
decisionId: string;
|
|
21
|
+
missingRecId: string;
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'orphan-evidence';
|
|
24
|
+
evidenceId: string;
|
|
25
|
+
missingRecId: string;
|
|
26
|
+
} | {
|
|
27
|
+
kind: 'stale-supersededby';
|
|
28
|
+
decisionId: string;
|
|
29
|
+
missingTargetId: string;
|
|
30
|
+
} | {
|
|
31
|
+
kind: 'stale-converted-phase';
|
|
32
|
+
recommendationId: string;
|
|
33
|
+
missingPhaseId: string;
|
|
34
|
+
};
|
|
35
|
+
export type IntelligenceAuditReport = {
|
|
36
|
+
findings: IntelligenceAuditFinding[];
|
|
37
|
+
byKind: Record<IntelligenceAuditFinding['kind'], IntelligenceAuditFinding[]>;
|
|
38
|
+
};
|
|
39
|
+
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"];
|
|
40
|
+
export type AuditKind = (typeof AUDIT_KINDS)[number];
|
|
41
|
+
export declare function computeIntelligenceAudit(recLedger: RecommendationLedger, evLedger: EvidenceLedger, asLedger: AssumptionLedger, decLedger: IntelligenceDecisionLedger, existingPhaseIds?: Set<string>): IntelligenceAuditReport;
|
|
42
|
+
//# sourceMappingURL=audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/intelligence/store/audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,0BAA0B,EAC1B,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,wBAAwB,GAChC;IAAE,IAAI,EAAE,wBAAwB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACvE;IAAE,IAAI,EAAE,sBAAsB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,IAAI,EAAE,sBAAsB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACnE;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACzE;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACrE;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GACrE;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,GAC3E;IAAE,IAAI,EAAE,uBAAuB,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC;AAExF,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,wBAAwB,EAAE,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,wBAAwB,EAAE,CAAC,CAAC;CAC9E,CAAC;AAEF,eAAO,MAAM,WAAW,+LASd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,oBAAoB,EAC/B,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,EAAE,0BAA0B,EACrC,gBAAgB,GAAE,GAAG,CAAC,MAAM,CAAa,GACxC,uBAAuB,CAqFzB"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export const AUDIT_KINDS = [
|
|
2
|
+
'broken-assumption-link',
|
|
3
|
+
'broken-decision-link',
|
|
4
|
+
'broken-evidence-link',
|
|
5
|
+
'orphan-assumption',
|
|
6
|
+
'orphan-decision',
|
|
7
|
+
'orphan-evidence',
|
|
8
|
+
'stale-supersededby',
|
|
9
|
+
'stale-converted-phase',
|
|
10
|
+
];
|
|
11
|
+
export function computeIntelligenceAudit(recLedger, evLedger, asLedger, decLedger, existingPhaseIds = new Set()) {
|
|
12
|
+
const findings = [];
|
|
13
|
+
const recIds = new Set(recLedger.recommendations.map((r) => r.id));
|
|
14
|
+
const evIds = new Set(evLedger.evidence.map((e) => e.id));
|
|
15
|
+
const asIds = new Set(asLedger.assumptions.map((a) => a.id));
|
|
16
|
+
const decIds = new Set(decLedger.decisions.map((d) => d.id));
|
|
17
|
+
for (const r of recLedger.recommendations) {
|
|
18
|
+
for (const id of r.assumptionIds) {
|
|
19
|
+
if (!asIds.has(id)) {
|
|
20
|
+
findings.push({ kind: 'broken-assumption-link', recId: r.id, assumptionId: id });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
for (const id of r.decisionIds) {
|
|
24
|
+
if (!decIds.has(id)) {
|
|
25
|
+
findings.push({ kind: 'broken-decision-link', recId: r.id, decisionId: id });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
for (const id of r.evidenceIds) {
|
|
29
|
+
if (!evIds.has(id)) {
|
|
30
|
+
findings.push({ kind: 'broken-evidence-link', recId: r.id, evidenceId: id });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
for (const a of asLedger.assumptions) {
|
|
35
|
+
if (!recIds.has(a.recommendationId)) {
|
|
36
|
+
findings.push({
|
|
37
|
+
kind: 'orphan-assumption',
|
|
38
|
+
assumptionId: a.id,
|
|
39
|
+
missingRecId: a.recommendationId,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
for (const d of decLedger.decisions) {
|
|
44
|
+
if (d.recommendationId !== undefined && !recIds.has(d.recommendationId)) {
|
|
45
|
+
findings.push({
|
|
46
|
+
kind: 'orphan-decision',
|
|
47
|
+
decisionId: d.id,
|
|
48
|
+
missingRecId: d.recommendationId,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
for (const ev of evLedger.evidence) {
|
|
53
|
+
if (!recIds.has(ev.recommendationId)) {
|
|
54
|
+
findings.push({
|
|
55
|
+
kind: 'orphan-evidence',
|
|
56
|
+
evidenceId: ev.id,
|
|
57
|
+
missingRecId: ev.recommendationId,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Slice 30: stale supersededBy refs (decision.supersededBy points to a missing decision id).
|
|
62
|
+
for (const d of decLedger.decisions) {
|
|
63
|
+
if (d.supersededBy !== undefined && !decIds.has(d.supersededBy)) {
|
|
64
|
+
findings.push({
|
|
65
|
+
kind: 'stale-supersededby',
|
|
66
|
+
decisionId: d.id,
|
|
67
|
+
missingTargetId: d.supersededBy,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Slice 34.2: stale convertedToPhaseId refs (rec converted to a phase that
|
|
72
|
+
// no longer exists on disk). Phase existence is a filesystem fact; the
|
|
73
|
+
// caller pre-computes the set so `computeIntelligenceAudit` stays pure-sync.
|
|
74
|
+
for (const r of recLedger.recommendations) {
|
|
75
|
+
if (r.convertedToPhaseId !== undefined && !existingPhaseIds.has(r.convertedToPhaseId)) {
|
|
76
|
+
findings.push({
|
|
77
|
+
kind: 'stale-converted-phase',
|
|
78
|
+
recommendationId: r.id,
|
|
79
|
+
missingPhaseId: r.convertedToPhaseId,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const byKind = Object.fromEntries(AUDIT_KINDS.map((k) => [k, []]));
|
|
84
|
+
for (const f of findings)
|
|
85
|
+
byKind[f.kind].push(f);
|
|
86
|
+
return { findings, byKind };
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../../src/intelligence/store/audit.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,wBAAwB;IACxB,sBAAsB;IACtB,sBAAsB;IACtB,mBAAmB;IACnB,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AC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type IntelligenceDecision, type IntelligenceDecisionLedger } from '@manehorizons/cadence-types';
|
|
2
|
+
export type AddIntelligenceDecisionInput = {
|
|
3
|
+
recommendationId?: string;
|
|
4
|
+
title: string;
|
|
5
|
+
rationale: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function addIntelligenceDecision(root: string, input: AddIntelligenceDecisionInput): Promise<IntelligenceDecision>;
|
|
8
|
+
export type DecisionTransitionAction = 'supersede' | 'rescind' | 'reactivate';
|
|
9
|
+
export type DecisionTransitionResult = {
|
|
10
|
+
ok: true;
|
|
11
|
+
ledger: IntelligenceDecisionLedger;
|
|
12
|
+
} | {
|
|
13
|
+
ok: false;
|
|
14
|
+
error: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function deriveDecisionInverseLinks(ledger: IntelligenceDecisionLedger): IntelligenceDecisionLedger;
|
|
17
|
+
export declare function applyDecisionTransition(ledger: IntelligenceDecisionLedger, id: string, action: DecisionTransitionAction, by?: string, _now?: Date): DecisionTransitionResult;
|
|
18
|
+
export declare function runDecisionTransition(root: string, id: string, action: DecisionTransitionAction, by?: string): Promise<DecisionTransitionResult>;
|
|
19
|
+
//# sourceMappingURL=decisions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decisions.d.ts","sourceRoot":"","sources":["../../../src/intelligence/store/decisions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAEhC,MAAM,6BAA6B,CAAC;AAarC,MAAM,MAAM,4BAA4B,GAAG;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,4BAA4B,GAClC,OAAO,CAAC,oBAAoB,CAAC,CAqC/B;AAED,MAAM,MAAM,wBAAwB,GAAG,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC;AAE9E,MAAM,MAAM,wBAAwB,GAChC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,0BAA0B,CAAA;CAAE,GAChD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AA2CjC,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,0BAA0B,GACjC,0BAA0B,CAU5B;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,0BAA0B,EAClC,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,wBAAwB,EAChC,EAAE,CAAC,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,IAAI,GACV,wBAAwB,CAqD1B;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,wBAAwB,EAChC,EAAE,CAAC,EAAE,MAAM,GACV,OAAO,CAAC,wBAAwB,CAAC,CAQnC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { nextIntelligenceDecisionId } from './ids.js';
|
|
2
|
+
import { readAssumptionLedger, readEvidenceLedger, readIntelligenceDecisionLedger, readRecommendationLedger, rerenderRecommendationsMdIfPresent, writeIntelligenceDecisionLedger, writeIntelligenceLedgers, } from './io.js';
|
|
3
|
+
import { deriveRecommendationLinks } from './recommendations.js';
|
|
4
|
+
export async function addIntelligenceDecision(root, input) {
|
|
5
|
+
let recLedger = null;
|
|
6
|
+
if (input.recommendationId !== undefined) {
|
|
7
|
+
recLedger = await readRecommendationLedger(root);
|
|
8
|
+
if (!recLedger.recommendations.some((r) => r.id === input.recommendationId)) {
|
|
9
|
+
throw new Error(`unknown recommendation "${input.recommendationId}"`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
const decLedger = await readIntelligenceDecisionLedger(root);
|
|
13
|
+
const now = new Date();
|
|
14
|
+
// Construct in schema-declaration order so the persisted JSON property
|
|
15
|
+
// order matches what `IntelligenceDecisionLedgerZ.parse(...)` would produce
|
|
16
|
+
// on reconcile. Keeps byte-equality between addIntelligenceDecision writes
|
|
17
|
+
// and reconcile writes (relied on by Slice-17 AC-6).
|
|
18
|
+
const out = {
|
|
19
|
+
id: nextIntelligenceDecisionId(decLedger, now),
|
|
20
|
+
...(input.recommendationId !== undefined ? { recommendationId: input.recommendationId } : {}),
|
|
21
|
+
title: input.title,
|
|
22
|
+
rationale: input.rationale,
|
|
23
|
+
status: 'active',
|
|
24
|
+
decidedAt: now.toISOString(),
|
|
25
|
+
supersedes: [],
|
|
26
|
+
};
|
|
27
|
+
decLedger.decisions.push(out);
|
|
28
|
+
// Slice 31: re-derive supersedes arrays across the whole ledger. New
|
|
29
|
+
// decisions can't be referenced by older ones yet, but pre-Slice-31
|
|
30
|
+
// ledgers being loaded for the first time benefit from the field
|
|
31
|
+
// being populated explicitly on write.
|
|
32
|
+
const derivedDec = deriveDecisionInverseLinks(decLedger);
|
|
33
|
+
await writeIntelligenceDecisionLedger(root, derivedDec);
|
|
34
|
+
if (input.recommendationId !== undefined && recLedger !== null) {
|
|
35
|
+
const asLedger = await readAssumptionLedger(root);
|
|
36
|
+
const evLedger = await readEvidenceLedger(root);
|
|
37
|
+
const derivedRec = deriveRecommendationLinks(recLedger, asLedger, decLedger);
|
|
38
|
+
await writeIntelligenceLedgers(root, derivedRec, evLedger);
|
|
39
|
+
}
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
const DECISION_TRANSITION_ALLOWED = {
|
|
43
|
+
supersede: ['active'],
|
|
44
|
+
rescind: ['active'],
|
|
45
|
+
reactivate: ['superseded', 'rescinded'],
|
|
46
|
+
};
|
|
47
|
+
const DECISION_TRANSITION_NEXT = {
|
|
48
|
+
supersede: 'superseded',
|
|
49
|
+
rescind: 'rescinded',
|
|
50
|
+
reactivate: 'active',
|
|
51
|
+
};
|
|
52
|
+
function walkSupersededByChain(ledger, startId, forbid) {
|
|
53
|
+
const chain = [];
|
|
54
|
+
const seen = new Set();
|
|
55
|
+
let cursor = startId;
|
|
56
|
+
while (cursor) {
|
|
57
|
+
if (cursor === forbid)
|
|
58
|
+
return { ok: false, chain };
|
|
59
|
+
if (seen.has(cursor))
|
|
60
|
+
return { ok: true, chain };
|
|
61
|
+
seen.add(cursor);
|
|
62
|
+
chain.push(cursor);
|
|
63
|
+
const node = ledger.decisions.find((d) => d.id === cursor);
|
|
64
|
+
cursor = node?.supersededBy;
|
|
65
|
+
}
|
|
66
|
+
return { ok: true, chain };
|
|
67
|
+
}
|
|
68
|
+
// Slice 31: pure helper. For every decision D in the ledger, recompute
|
|
69
|
+
// D.supersedes from current supersededBy values — the inverse-link of
|
|
70
|
+
// Slice 28's edge. Mirrors Slice 11's deriveRecommendationLinks shape
|
|
71
|
+
// but operates within one ledger. Idempotent.
|
|
72
|
+
export function deriveDecisionInverseLinks(ledger) {
|
|
73
|
+
return {
|
|
74
|
+
schemaVersion: 1,
|
|
75
|
+
decisions: ledger.decisions.map((d) => ({
|
|
76
|
+
...d,
|
|
77
|
+
supersedes: ledger.decisions
|
|
78
|
+
.filter((other) => other.supersededBy === d.id)
|
|
79
|
+
.map((other) => other.id),
|
|
80
|
+
})),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export function applyDecisionTransition(ledger, id, action, by, _now) {
|
|
84
|
+
const target = ledger.decisions.find((d) => d.id === id);
|
|
85
|
+
if (!target)
|
|
86
|
+
return { ok: false, error: `decision ${id} not found` };
|
|
87
|
+
if (!DECISION_TRANSITION_ALLOWED[action].includes(target.status)) {
|
|
88
|
+
return {
|
|
89
|
+
ok: false,
|
|
90
|
+
error: `cannot ${action} decision in status ${target.status}`,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (action === 'supersede' && by !== undefined) {
|
|
94
|
+
if (by === id) {
|
|
95
|
+
return {
|
|
96
|
+
ok: false,
|
|
97
|
+
error: 'cannot supersede: decision cannot supersede itself',
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
const replacement = ledger.decisions.find((d) => d.id === by);
|
|
101
|
+
if (!replacement) {
|
|
102
|
+
return {
|
|
103
|
+
ok: false,
|
|
104
|
+
error: `cannot supersede: decision ${by} not found`,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const walk = walkSupersededByChain(ledger, by, id);
|
|
108
|
+
if (!walk.ok) {
|
|
109
|
+
return {
|
|
110
|
+
ok: false,
|
|
111
|
+
error: `cannot supersede: would create cycle (${[...walk.chain, id].join(' → ')})`,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const nextStatus = DECISION_TRANSITION_NEXT[action];
|
|
116
|
+
const ledgerOut = {
|
|
117
|
+
schemaVersion: 1,
|
|
118
|
+
decisions: ledger.decisions.map((d) => {
|
|
119
|
+
if (d.id !== id)
|
|
120
|
+
return d;
|
|
121
|
+
const updated = { ...d, status: nextStatus };
|
|
122
|
+
if (action === 'supersede') {
|
|
123
|
+
if (by !== undefined)
|
|
124
|
+
updated.supersededBy = by;
|
|
125
|
+
}
|
|
126
|
+
else if (action === 'reactivate') {
|
|
127
|
+
delete updated.supersededBy;
|
|
128
|
+
}
|
|
129
|
+
return updated;
|
|
130
|
+
}),
|
|
131
|
+
};
|
|
132
|
+
// Slice 31: re-derive supersedes arrays so the returned ledger is fully
|
|
133
|
+
// consistent (target's supersededBy update propagates to the replacement's
|
|
134
|
+
// supersedes array, and reactivate-cleared targets drop out).
|
|
135
|
+
return { ok: true, ledger: deriveDecisionInverseLinks(ledgerOut) };
|
|
136
|
+
}
|
|
137
|
+
export async function runDecisionTransition(root, id, action, by) {
|
|
138
|
+
const ledger = await readIntelligenceDecisionLedger(root);
|
|
139
|
+
const res = applyDecisionTransition(ledger, id, action, by, new Date());
|
|
140
|
+
if (!res.ok)
|
|
141
|
+
return res;
|
|
142
|
+
await writeIntelligenceDecisionLedger(root, res.ledger);
|
|
143
|
+
// Slice 15: propagate status change into RECOMMENDATIONS.md annotated bullets.
|
|
144
|
+
await rerenderRecommendationsMdIfPresent(root);
|
|
145
|
+
return res;
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=decisions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decisions.js","sourceRoot":"","sources":["../../../src/intelligence/store/decisions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,8BAA8B,EAC9B,wBAAwB,EACxB,kCAAkC,EAClC,+BAA+B,EAC/B,wBAAwB,GACzB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAQjE,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,IAAY,EACZ,KAAmC;IAEnC,IAAI,SAAS,GAAgC,IAAI,CAAC;IAClD,IAAI,KAAK,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACzC,SAAS,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAC5E,MAAM,IAAI,KAAK,CAAC,2BAA2B,KAAK,CAAC,gBAAgB,GAAG,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IACD,MAAM,SAAS,GAAG,MAAM,8BAA8B,CAAC,IAAI,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,uEAAuE;IACvE,4EAA4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AAI,EAAE,CAAC,CAAC;IACxE,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,OAAO,GAAG,CAAC;IACxB,MAAM,+BAA+B,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxD,+EAA+E;IAC/E,MAAM,kCAAkC,CAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AssumptionLedger, EvidenceLedger, IntelligenceDecisionLedger, RecommendationLedger } from '@manehorizons/cadence-types';
|
|
2
|
+
export declare function nextRecommendationId(ledger: RecommendationLedger, now: Date): string;
|
|
3
|
+
export declare function nextEvidenceId(ledger: EvidenceLedger, now: Date): string;
|
|
4
|
+
export declare function nextAssumptionId(ledger: AssumptionLedger, now: Date): string;
|
|
5
|
+
export declare function nextIntelligenceDecisionId(ledger: IntelligenceDecisionLedger, now: Date): string;
|
|
6
|
+
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../src/intelligence/store/ids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,0BAA0B,EAC1B,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AAMrC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,EAAE,IAAI,GAAG,MAAM,CASpF;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,IAAI,GAAG,MAAM,CASxE;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,IAAI,GAAG,MAAM,CAS5E;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,0BAA0B,EAClC,GAAG,EAAE,IAAI,GACR,MAAM,CASR"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
function slugDate(now) {
|
|
2
|
+
return now.toISOString().slice(0, 10).replaceAll('-', '');
|
|
3
|
+
}
|
|
4
|
+
export function nextRecommendationId(ledger, now) {
|
|
5
|
+
const prefix = `rec-${slugDate(now)}-`;
|
|
6
|
+
const max = ledger.recommendations
|
|
7
|
+
.map((r) => r.id)
|
|
8
|
+
.filter((id) => id.startsWith(prefix))
|
|
9
|
+
.map((id) => Number.parseInt(id.slice(prefix.length), 10))
|
|
10
|
+
.filter((n) => Number.isFinite(n))
|
|
11
|
+
.reduce((a, b) => Math.max(a, b), 0);
|
|
12
|
+
return `${prefix}${String(max + 1).padStart(3, '0')}`;
|
|
13
|
+
}
|
|
14
|
+
export function nextEvidenceId(ledger, now) {
|
|
15
|
+
const prefix = `ev-${slugDate(now)}-`;
|
|
16
|
+
const max = ledger.evidence
|
|
17
|
+
.map((ev) => ev.id)
|
|
18
|
+
.filter((id) => id.startsWith(prefix))
|
|
19
|
+
.map((id) => Number.parseInt(id.slice(prefix.length), 10))
|
|
20
|
+
.filter((n) => Number.isFinite(n))
|
|
21
|
+
.reduce((a, b) => Math.max(a, b), 0);
|
|
22
|
+
return `${prefix}${String(max + 1).padStart(3, '0')}`;
|
|
23
|
+
}
|
|
24
|
+
export function nextAssumptionId(ledger, now) {
|
|
25
|
+
const prefix = `as-${slugDate(now)}-`;
|
|
26
|
+
const max = ledger.assumptions
|
|
27
|
+
.map((a) => a.id)
|
|
28
|
+
.filter((id) => id.startsWith(prefix))
|
|
29
|
+
.map((id) => Number.parseInt(id.slice(prefix.length), 10))
|
|
30
|
+
.filter((n) => Number.isFinite(n))
|
|
31
|
+
.reduce((a, b) => Math.max(a, b), 0);
|
|
32
|
+
return `${prefix}${String(max + 1).padStart(3, '0')}`;
|
|
33
|
+
}
|
|
34
|
+
export function nextIntelligenceDecisionId(ledger, now) {
|
|
35
|
+
const prefix = `dec-${slugDate(now)}-`;
|
|
36
|
+
const max = ledger.decisions
|
|
37
|
+
.map((d) => d.id)
|
|
38
|
+
.filter((id) => id.startsWith(prefix))
|
|
39
|
+
.map((id) => Number.parseInt(id.slice(prefix.length), 10))
|
|
40
|
+
.filter((n) => Number.isFinite(n))
|
|
41
|
+
.reduce((a, b) => Math.max(a, b), 0);
|
|
42
|
+
return `${prefix}${String(max + 1).padStart(3, '0')}`;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../../../src/intelligence/store/ids.ts"],"names":[],"mappings":"AAOA,SAAS,QAAQ,CAAC,GAAS;IACzB,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAA4B,EAAE,GAAS;IAC1E,MAAM,MAAM,GAAG,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;IACvC,MAAM,GAAG,GAAG,MAAM,CAAC,eAAe;SAC/B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAChB,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;SACrC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;SACzD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;SACjC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACvC,OAAO,GAAG,MAAM,G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AAG,MAAM,GAAG,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type AssumptionLedger, type EvidenceLedger, type IntelligenceDecisionLedger, type RecommendationLedger } from '@manehorizons/cadence-types';
|
|
2
|
+
export declare function readRecommendationLedger(root: string): Promise<RecommendationLedger>;
|
|
3
|
+
export declare function readEvidenceLedger(root: string): Promise<EvidenceLedger>;
|
|
4
|
+
export declare function readAssumptionLedger(root: string): Promise<AssumptionLedger>;
|
|
5
|
+
export declare function readIntelligenceDecisionLedger(root: string): Promise<IntelligenceDecisionLedger>;
|
|
6
|
+
export declare function writeIntelligenceLedgers(root: string, ledger: RecommendationLedger, evidenceLedger: EvidenceLedger): Promise<void>;
|
|
7
|
+
export declare function writeAssumptionLedger(root: string, ledger: AssumptionLedger): Promise<void>;
|
|
8
|
+
export declare function writeIntelligenceDecisionLedger(root: string, ledger: IntelligenceDecisionLedger): Promise<void>;
|
|
9
|
+
export declare function rerenderRecommendationsMdIfPresent(root: string): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=io.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../../src/intelligence/store/io.ts"],"names":[],"mappings":"AAEA,OAAO,EASL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AAgBrC,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAK1F;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAK9E;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAKlF;AAED,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,0BAA0B,CAAC,CAKrC;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,oBAAoB,EAC5B,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKjG;AAED,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAsB,kCAAkC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUpF"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { mkdir, readFile } from 'node:fs/promises';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { AssumptionLedgerZ, EvidenceLedgerZ, IntelligenceDecisionLedgerZ, RecommendationLedgerZ, emptyAssumptionLedger, emptyEvidenceLedger, emptyIntelligenceDecisionLedger, emptyRecommendationLedger, } from '@manehorizons/cadence-types';
|
|
4
|
+
import { atomicWriteJSON, atomicWriteText } from '../../state/atomic-write.js';
|
|
5
|
+
import { renderRecommendationsMd } from '../render.js';
|
|
6
|
+
import { renderAssumptionsMd } from '../render-assumption.js';
|
|
7
|
+
import { renderDecisionsMd } from '../render-decision.js';
|
|
8
|
+
import { assumptionsMdPath, assumptionsPath, decisionsMdPath, decisionsPath, evidencePath, intelligenceDir, recommendationsMdPath, recommendationsPath, } from './paths.js';
|
|
9
|
+
export async function readRecommendationLedger(root) {
|
|
10
|
+
const path = recommendationsPath(root);
|
|
11
|
+
if (!existsSync(path))
|
|
12
|
+
return emptyRecommendationLedger();
|
|
13
|
+
const raw = await readFile(path, 'utf8');
|
|
14
|
+
return RecommendationLedgerZ.parse(JSON.parse(raw));
|
|
15
|
+
}
|
|
16
|
+
export async function readEvidenceLedger(root) {
|
|
17
|
+
const path = evidencePath(root);
|
|
18
|
+
if (!existsSync(path))
|
|
19
|
+
return emptyEvidenceLedger();
|
|
20
|
+
const raw = await readFile(path, 'utf8');
|
|
21
|
+
return EvidenceLedgerZ.parse(JSON.parse(raw));
|
|
22
|
+
}
|
|
23
|
+
export async function readAssumptionLedger(root) {
|
|
24
|
+
const path = assumptionsPath(root);
|
|
25
|
+
if (!existsSync(path))
|
|
26
|
+
return emptyAssumptionLedger();
|
|
27
|
+
const raw = await readFile(path, 'utf8');
|
|
28
|
+
return AssumptionLedgerZ.parse(JSON.parse(raw));
|
|
29
|
+
}
|
|
30
|
+
export async function readIntelligenceDecisionLedger(root) {
|
|
31
|
+
const path = decisionsPath(root);
|
|
32
|
+
if (!existsSync(path))
|
|
33
|
+
return emptyIntelligenceDecisionLedger();
|
|
34
|
+
const raw = await readFile(path, 'utf8');
|
|
35
|
+
return IntelligenceDecisionLedgerZ.parse(JSON.parse(raw));
|
|
36
|
+
}
|
|
37
|
+
export async function writeIntelligenceLedgers(root, ledger, evidenceLedger) {
|
|
38
|
+
const dir = intelligenceDir(root);
|
|
39
|
+
await mkdir(dir, { recursive: true });
|
|
40
|
+
RecommendationLedgerZ.parse(ledger);
|
|
41
|
+
EvidenceLedgerZ.parse(evidenceLedger);
|
|
42
|
+
await atomicWriteJSON(recommendationsPath(root), ledger);
|
|
43
|
+
await atomicWriteJSON(evidencePath(root), evidenceLedger);
|
|
44
|
+
// Read sibling ledgers so the rec MD renders status-annotated link bullets (Slice 15).
|
|
45
|
+
const asLedger = await readAssumptionLedger(root);
|
|
46
|
+
const decLedger = await readIntelligenceDecisionLedger(root);
|
|
47
|
+
await atomicWriteText(recommendationsMdPath(root), renderRecommendationsMd(ledger, evidenceLedger, asLedger, decLedger));
|
|
48
|
+
}
|
|
49
|
+
export async function writeAssumptionLedger(root, ledger) {
|
|
50
|
+
AssumptionLedgerZ.parse(ledger);
|
|
51
|
+
await mkdir(intelligenceDir(root), { recursive: true });
|
|
52
|
+
await atomicWriteJSON(assumptionsPath(root), ledger);
|
|
53
|
+
await atomicWriteText(assumptionsMdPath(root), renderAssumptionsMd(ledger));
|
|
54
|
+
}
|
|
55
|
+
export async function writeIntelligenceDecisionLedger(root, ledger) {
|
|
56
|
+
IntelligenceDecisionLedgerZ.parse(ledger);
|
|
57
|
+
await mkdir(intelligenceDir(root), { recursive: true });
|
|
58
|
+
await atomicWriteJSON(decisionsPath(root), ledger);
|
|
59
|
+
await atomicWriteText(decisionsMdPath(root), renderDecisionsMd(ledger));
|
|
60
|
+
}
|
|
61
|
+
export async function rerenderRecommendationsMdIfPresent(root) {
|
|
62
|
+
if (!existsSync(recommendationsPath(root)))
|
|
63
|
+
return;
|
|
64
|
+
const recLedger = await readRecommendationLedger(root);
|
|
65
|
+
const evLedger = await readEvidenceLedger(root);
|
|
66
|
+
const asLedger = await readAssumptionLedger(root);
|
|
67
|
+
const decLedger = await readIntelligenceDecisionLedger(root);
|
|
68
|
+
await atomicWriteText(recommendationsMdPath(root), renderRecommendationsMd(recLedger, evLedger, asLedger, decLedger));
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=io.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../../src/intelligence/store/io.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,2BAA2B,EAC3B,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,+BAA+B,EAC/B,yBAAyB,GAK1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC/E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AQ,EAAE,SAAS,CAAC,CAClE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type MilestoneLedger } from '@manehorizons/cadence-types';
|
|
2
|
+
export declare function readMilestoneLedger(root: string): Promise<MilestoneLedger>;
|
|
3
|
+
export declare function writeMilestoneLedger(root: string, ledger: MilestoneLedger): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=milestones.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"milestones.d.ts","sourceRoot":"","sources":["../../../src/intelligence/store/milestones.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,6BAA6B,CAAC;AAKrC,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,eAAe,CAAC,CAK1B;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { mkdir, readFile } from 'node:fs/promises';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { MilestoneLedgerZ, emptyMilestoneLedger, } from '@manehorizons/cadence-types';
|
|
4
|
+
import { atomicWriteJSON, atomicWriteText } from '../../state/atomic-write.js';
|
|
5
|
+
import { renderMilestonesMd } from '../render-milestone.js';
|
|
6
|
+
import { intelligenceDir, milestonesMdPath, milestonesPath } from './paths.js';
|
|
7
|
+
export async function readMilestoneLedger(root) {
|
|
8
|
+
const path = milestonesPath(root);
|
|
9
|
+
if (!existsSync(path))
|
|
10
|
+
return emptyMilestoneLedger();
|
|
11
|
+
const raw = await readFile(path, 'utf8');
|
|
12
|
+
return MilestoneLedgerZ.parse(JSON.parse(raw));
|
|
13
|
+
}
|
|
14
|
+
export async function writeMilestoneLedger(root, ledger) {
|
|
15
|
+
await mkdir(intelligenceDir(root), { recursive: true });
|
|
16
|
+
MilestoneLedgerZ.parse(ledger);
|
|
17
|
+
await atomicWriteJSON(milestonesPath(root), ledger);
|
|
18
|
+
await atomicWriteText(milestonesMdPath(root), renderMilestonesMd(ledger));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=milestones.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"milestones.js","sourceRoot":"","sources":["../../../src/intelligence/store/milestones.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GAErB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE/E,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,IAAY;IAEZ,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,oBAAoB,EAAE,CAAC;IACrD,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACzC,OAAO,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAAY,EACZ,MAAuB;IAEvB,MAAM,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,MAAM,eAAe,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IACpD,MAAM,eAAe,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function intelligenceDir(root: string): string;
|
|
2
|
+
export declare function recommendationsPath(root: string): string;
|
|
3
|
+
export declare function evidencePath(root: string): string;
|
|
4
|
+
export declare function assumptionsPath(root: string): string;
|
|
5
|
+
export declare function decisionsPath(root: string): string;
|
|
6
|
+
export declare function recommendationsMdPath(root: string): string;
|
|
7
|
+
export declare function assumptionsMdPath(root: string): string;
|
|
8
|
+
export declare function decisionsMdPath(root: string): string;
|
|
9
|
+
export declare function milestonesPath(root: string): string;
|
|
10
|
+
export declare function milestonesMdPath(root: string): string;
|
|
11
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/intelligence/store/paths.ts"],"names":[],"mappings":"AAaA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
const INTELLIGENCE_DIR = '.cadence/intelligence';
|
|
3
|
+
const RECOMMENDATIONS_JSON = 'recommendations.json';
|
|
4
|
+
const EVIDENCE_JSON = 'evidence.json';
|
|
5
|
+
const RECOMMENDATIONS_MD = 'RECOMMENDATIONS.md';
|
|
6
|
+
const ASSUMPTIONS_JSON = 'assumptions.json';
|
|
7
|
+
const DECISIONS_JSON = 'decisions.json';
|
|
8
|
+
const ASSUMPTIONS_MD = 'ASSUMPTIONS.md';
|
|
9
|
+
const DECISIONS_MD = 'DECISIONS.md';
|
|
10
|
+
const MILESTONES_JSON = 'milestones.json';
|
|
11
|
+
const MILESTONES_MD = 'MILESTONES.md';
|
|
12
|
+
export function intelligenceDir(root) {
|
|
13
|
+
return join(root, INTELLIGENCE_DIR);
|
|
14
|
+
}
|
|
15
|
+
export function recommendationsPath(root) {
|
|
16
|
+
return join(intelligenceDir(root), RECOMMENDATIONS_JSON);
|
|
17
|
+
}
|
|
18
|
+
export function evidencePath(root) {
|
|
19
|
+
return join(intelligenceDir(root), EVIDENCE_JSON);
|
|
20
|
+
}
|
|
21
|
+
export function assumptionsPath(root) {
|
|
22
|
+
return join(intelligenceDir(root), ASSUMPTIONS_JSON);
|
|
23
|
+
}
|
|
24
|
+
export function decisionsPath(root) {
|
|
25
|
+
return join(intelligenceDir(root), DECISIONS_JSON);
|
|
26
|
+
}
|
|
27
|
+
export function recommendationsMdPath(root) {
|
|
28
|
+
return join(intelligenceDir(root), RECOMMENDATIONS_MD);
|
|
29
|
+
}
|
|
30
|
+
export function assumptionsMdPath(root) {
|
|
31
|
+
return join(intelligenceDir(root), ASSUMPTIONS_MD);
|
|
32
|
+
}
|
|
33
|
+
export function decisionsMdPath(root) {
|
|
34
|
+
return join(intelligenceDir(root), DECISIONS_MD);
|
|
35
|
+
}
|
|
36
|
+
export function milestonesPath(root) {
|
|
37
|
+
return join(intelligenceDir(root), MILESTONES_JSON);
|
|
38
|
+
}
|
|
39
|
+
export function milestonesMdPath(root) {
|
|
40
|
+
return join(intelligenceDir(root), MILESTONES_MD);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/intelligence/store/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AACjD,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AACpD,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAChD,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAC5C,MAAM,cAAc,GAAG,gBAAgB,CAAC;AACxC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AACxC,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAC1C,MAAM,aAAa,GAAG,eAAe,CAAC;AAEtC,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type AssumptionLedger, type IntelligenceDecisionLedger, type Recommendation, type RecommendationLedger, type RecommendationPriority, type RecommendationReadiness, type RecommendationStatus } 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 addRecommendation(root: string, input: AddRecommendationInput): Promise<Recommendation>;
|
|
12
|
+
export declare function deriveRecommendationLinks(recLedger: RecommendationLedger, asLedger: AssumptionLedger, decLedger: IntelligenceDecisionLedger): RecommendationLedger;
|
|
13
|
+
export type RecommendationTransitionAction = 'convert';
|
|
14
|
+
export type RecommendationTransitionResult = {
|
|
15
|
+
ok: true;
|
|
16
|
+
ledger: RecommendationLedger;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
error: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function applyRecommendationTransition(ledger: RecommendationLedger, id: string, action: RecommendationTransitionAction, toPhase: string, now: Date): RecommendationTransitionResult;
|
|
22
|
+
export interface RecommendationPromotionChanges {
|
|
23
|
+
status?: RecommendationStatus;
|
|
24
|
+
readiness?: RecommendationReadiness;
|
|
25
|
+
}
|
|
26
|
+
export declare function applyRecommendationPromotion(ledger: RecommendationLedger, id: string, changes: RecommendationPromotionChanges, now: Date): RecommendationTransitionResult;
|
|
27
|
+
export declare function runRecommendationTransition(root: string, id: string, action: RecommendationTransitionAction, toPhase: string): Promise<RecommendationTransitionResult>;
|
|
28
|
+
export declare function runRecommendationPromotion(root: string, id: string, changes: RecommendationPromotionChanges): Promise<RecommendationTransitionResult>;
|
|
29
|
+
//# sourceMappingURL=recommendations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recommendations.d.ts","sourceRoot":"","sources":["../../../src/intelligence/store/recommendations.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,0BAA0B,EAC/B,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AAQrC,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,sBAAsB,CAAC;IACjC,SAAS,EAAE,uBAAuB,CAAC;IACnC,aAAa,EAAE,MAAM,EAAE,C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