@cleocode/contracts 2026.4.154 → 2026.4.157
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/branch-lock.d.ts +30 -0
- package/dist/branch-lock.d.ts.map +1 -1
- package/dist/branch-lock.js.map +1 -1
- package/dist/exit-codes.d.ts +16 -0
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +16 -0
- package/dist/exit-codes.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lafs.d.ts +46 -11
- package/dist/lafs.d.ts.map +1 -1
- package/dist/lafs.js.map +1 -1
- package/dist/operations/nexus.d.ts +227 -0
- package/dist/operations/nexus.d.ts.map +1 -1
- package/dist/release/pipeline.d.ts +95 -0
- package/dist/release/pipeline.d.ts.map +1 -0
- package/dist/release/pipeline.js +16 -0
- package/dist/release/pipeline.js.map +1 -0
- package/package.json +1 -1
- package/src/branch-lock.ts +31 -0
- package/src/exit-codes.ts +16 -0
- package/src/index.ts +44 -0
- package/src/lafs.ts +47 -11
- package/src/operations/nexus.ts +247 -0
- package/src/release/pipeline.ts +100 -0
package/src/operations/nexus.ts
CHANGED
|
@@ -963,6 +963,238 @@ export interface NexusContractsLinkTasksParams {
|
|
|
963
963
|
/** Result of `nexus.contracts-link-tasks`. */
|
|
964
964
|
export type NexusContractsLinkTasksResult = unknown;
|
|
965
965
|
|
|
966
|
+
// ============================================================================
|
|
967
|
+
// T1510 — Phase 2 dispatch ops (clusters, flows, context, projects.*, diff,
|
|
968
|
+
// refresh-bridge, query-cte, hot-paths, hot-nodes, cold-symbols)
|
|
969
|
+
// ============================================================================
|
|
970
|
+
|
|
971
|
+
/** Parameters for `nexus.clusters`. */
|
|
972
|
+
export interface NexusClustersParams {
|
|
973
|
+
/** Project ID (optional, auto-generated from repoPath). */
|
|
974
|
+
projectId?: string;
|
|
975
|
+
/** Path to project directory (optional, defaults to cwd). */
|
|
976
|
+
repoPath?: string;
|
|
977
|
+
}
|
|
978
|
+
/** One detected Louvain community entry. */
|
|
979
|
+
export interface NexusCommunityEntry {
|
|
980
|
+
id: string;
|
|
981
|
+
label: string | null;
|
|
982
|
+
symbolCount: number;
|
|
983
|
+
cohesion: number;
|
|
984
|
+
}
|
|
985
|
+
/** Result of `nexus.clusters`. */
|
|
986
|
+
export interface NexusClustersResult {
|
|
987
|
+
projectId: string;
|
|
988
|
+
repoPath: string;
|
|
989
|
+
count: number;
|
|
990
|
+
communities: NexusCommunityEntry[];
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
/** Parameters for `nexus.flows`. */
|
|
994
|
+
export interface NexusFlowsParams {
|
|
995
|
+
/** Project ID (optional, auto-generated from repoPath). */
|
|
996
|
+
projectId?: string;
|
|
997
|
+
/** Path to project directory (optional, defaults to cwd). */
|
|
998
|
+
repoPath?: string;
|
|
999
|
+
}
|
|
1000
|
+
/** One detected execution flow entry. */
|
|
1001
|
+
export interface NexusFlowEntry {
|
|
1002
|
+
id: string;
|
|
1003
|
+
label: string | null;
|
|
1004
|
+
stepCount: number;
|
|
1005
|
+
processType: string;
|
|
1006
|
+
entryPointId: string | null;
|
|
1007
|
+
}
|
|
1008
|
+
/** Result of `nexus.flows`. */
|
|
1009
|
+
export interface NexusFlowsResult {
|
|
1010
|
+
projectId: string;
|
|
1011
|
+
repoPath: string;
|
|
1012
|
+
count: number;
|
|
1013
|
+
flows: NexusFlowEntry[];
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
/** Parameters for `nexus.context`. */
|
|
1017
|
+
export interface NexusContextParams {
|
|
1018
|
+
/** Symbol name to look up (required). */
|
|
1019
|
+
symbol: string;
|
|
1020
|
+
/** Project ID (optional, auto-generated from cwd). */
|
|
1021
|
+
projectId?: string;
|
|
1022
|
+
/** Max callers/callees per side (default: 20). */
|
|
1023
|
+
limit?: number;
|
|
1024
|
+
/** When true, fetch source code content. */
|
|
1025
|
+
content?: boolean;
|
|
1026
|
+
}
|
|
1027
|
+
/** Result of `nexus.context`. */
|
|
1028
|
+
export type NexusContextResult = unknown;
|
|
1029
|
+
|
|
1030
|
+
/** Parameters for `nexus.projects.list`. */
|
|
1031
|
+
export type NexusProjectsListParams = Record<string, never>;
|
|
1032
|
+
/** Result of `nexus.projects.list`. */
|
|
1033
|
+
export type NexusProjectsListResult = unknown;
|
|
1034
|
+
|
|
1035
|
+
/** Parameters for `nexus.projects.register`. */
|
|
1036
|
+
export interface NexusProjectsRegisterParams {
|
|
1037
|
+
/** Path to the project directory (required). */
|
|
1038
|
+
path: string;
|
|
1039
|
+
/** Custom project name (optional). */
|
|
1040
|
+
name?: string;
|
|
1041
|
+
}
|
|
1042
|
+
/** Result of `nexus.projects.register`. */
|
|
1043
|
+
export interface NexusProjectsRegisterResult {
|
|
1044
|
+
hash: string;
|
|
1045
|
+
path: string;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
/** Parameters for `nexus.projects.remove`. */
|
|
1049
|
+
export interface NexusProjectsRemoveParams {
|
|
1050
|
+
/** Project name or hash to remove (required). */
|
|
1051
|
+
nameOrHash: string;
|
|
1052
|
+
}
|
|
1053
|
+
/** Result of `nexus.projects.remove`. */
|
|
1054
|
+
export interface NexusProjectsRemoveResult {
|
|
1055
|
+
removed: string;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
/** Parameters for `nexus.projects.scan`. */
|
|
1059
|
+
export interface NexusProjectsScanParams {
|
|
1060
|
+
/** Comma-separated search roots (optional). */
|
|
1061
|
+
roots?: string;
|
|
1062
|
+
/** Maximum directory traversal depth (default: 4). */
|
|
1063
|
+
maxDepth?: number;
|
|
1064
|
+
/** Auto-register all discovered unregistered projects. */
|
|
1065
|
+
autoRegister?: boolean;
|
|
1066
|
+
/** Also report already-registered projects. */
|
|
1067
|
+
includeExisting?: boolean;
|
|
1068
|
+
}
|
|
1069
|
+
/** Result of `nexus.projects.scan`. */
|
|
1070
|
+
export type NexusProjectsScanResult = unknown;
|
|
1071
|
+
|
|
1072
|
+
/** Parameters for `nexus.projects.clean`. */
|
|
1073
|
+
export interface NexusProjectsCleanParams {
|
|
1074
|
+
/** Dry-run only (no deletions). */
|
|
1075
|
+
dryRun?: boolean;
|
|
1076
|
+
/** JS regex matched against project_path. */
|
|
1077
|
+
pattern?: string;
|
|
1078
|
+
/** Match paths containing a .temp/ segment. */
|
|
1079
|
+
includeTemp?: boolean;
|
|
1080
|
+
/** Match paths containing tmp/test/fixture/scratch/sandbox segments. */
|
|
1081
|
+
includeTests?: boolean;
|
|
1082
|
+
/** Also match unhealthy rows. */
|
|
1083
|
+
matchUnhealthy?: boolean;
|
|
1084
|
+
/** Also match never-indexed rows. */
|
|
1085
|
+
matchNeverIndexed?: boolean;
|
|
1086
|
+
}
|
|
1087
|
+
/** Result of `nexus.projects.clean`. */
|
|
1088
|
+
export type NexusProjectsCleanResult = unknown;
|
|
1089
|
+
|
|
1090
|
+
/** Parameters for `nexus.refresh-bridge`. */
|
|
1091
|
+
export interface NexusRefreshBridgeParams {
|
|
1092
|
+
/** Path to project directory (optional, defaults to cwd). */
|
|
1093
|
+
repoPath?: string;
|
|
1094
|
+
/** Override the project ID. */
|
|
1095
|
+
projectId?: string;
|
|
1096
|
+
}
|
|
1097
|
+
/** Result of `nexus.refresh-bridge`. */
|
|
1098
|
+
export interface NexusRefreshBridgeResult {
|
|
1099
|
+
path: string;
|
|
1100
|
+
written: boolean;
|
|
1101
|
+
projectId: string;
|
|
1102
|
+
repoPath: string;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
/** Parameters for `nexus.diff`. */
|
|
1106
|
+
export interface NexusDiffParams {
|
|
1107
|
+
/** Git ref for the "before" snapshot (default: HEAD~1). */
|
|
1108
|
+
beforeRef?: string;
|
|
1109
|
+
/** Git ref for the "after" snapshot (default: HEAD). */
|
|
1110
|
+
afterRef?: string;
|
|
1111
|
+
/** Repository path (optional, defaults to cwd). */
|
|
1112
|
+
repoPath?: string;
|
|
1113
|
+
/** Override the project ID. */
|
|
1114
|
+
projectId?: string;
|
|
1115
|
+
}
|
|
1116
|
+
/** Result of `nexus.diff`. */
|
|
1117
|
+
export type NexusDiffResult = unknown;
|
|
1118
|
+
|
|
1119
|
+
/** Parameters for `nexus.query-cte`. */
|
|
1120
|
+
export interface NexusQueryCteParams {
|
|
1121
|
+
/** CTE SQL or template alias (required). */
|
|
1122
|
+
cte: string;
|
|
1123
|
+
/** Positional parameters for the CTE (optional). */
|
|
1124
|
+
params?: string[];
|
|
1125
|
+
}
|
|
1126
|
+
/** Result of `nexus.query-cte`. */
|
|
1127
|
+
export type NexusQueryCteResult = unknown;
|
|
1128
|
+
|
|
1129
|
+
/** One hot-path relation edge. */
|
|
1130
|
+
export interface NexusHotPath {
|
|
1131
|
+
sourceId: string;
|
|
1132
|
+
targetId: string;
|
|
1133
|
+
type: string;
|
|
1134
|
+
weight: number;
|
|
1135
|
+
lastAccessedAt: string | null;
|
|
1136
|
+
coAccessedCount: number;
|
|
1137
|
+
}
|
|
1138
|
+
/** Parameters for `nexus.hot-paths`. */
|
|
1139
|
+
export interface NexusHotPathsParams {
|
|
1140
|
+
/** Maximum number of edges to return (default: 20). */
|
|
1141
|
+
limit?: number;
|
|
1142
|
+
}
|
|
1143
|
+
/** Result of `nexus.hot-paths`. */
|
|
1144
|
+
export interface NexusHotPathsResult {
|
|
1145
|
+
paths: NexusHotPath[];
|
|
1146
|
+
count: number;
|
|
1147
|
+
note?: string;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
/** One hot-node symbol. */
|
|
1151
|
+
export interface NexusHotNode {
|
|
1152
|
+
nodeId: string;
|
|
1153
|
+
sourceId: string;
|
|
1154
|
+
label: string;
|
|
1155
|
+
filePath: string | null;
|
|
1156
|
+
kind: string;
|
|
1157
|
+
totalWeight: number;
|
|
1158
|
+
pathCount: number;
|
|
1159
|
+
}
|
|
1160
|
+
/** Parameters for `nexus.hot-nodes`. */
|
|
1161
|
+
export interface NexusHotNodesParams {
|
|
1162
|
+
/** Maximum number of nodes to return (default: 20). */
|
|
1163
|
+
limit?: number;
|
|
1164
|
+
}
|
|
1165
|
+
/** Result of `nexus.hot-nodes`. */
|
|
1166
|
+
export interface NexusHotNodesResult {
|
|
1167
|
+
nodes: NexusHotNode[];
|
|
1168
|
+
count: number;
|
|
1169
|
+
note?: string;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
/** One cold symbol. */
|
|
1173
|
+
export interface NexusColdSymbol {
|
|
1174
|
+
nodeId: string;
|
|
1175
|
+
sourceId: string;
|
|
1176
|
+
label: string;
|
|
1177
|
+
filePath: string | null;
|
|
1178
|
+
kind: string;
|
|
1179
|
+
lastAccessedAt: string | null;
|
|
1180
|
+
lastAccessed: string | null;
|
|
1181
|
+
ageDays: number | null;
|
|
1182
|
+
pathCount: number;
|
|
1183
|
+
maxWeight: number;
|
|
1184
|
+
}
|
|
1185
|
+
/** Parameters for `nexus.cold-symbols`. */
|
|
1186
|
+
export interface NexusColdSymbolsParams {
|
|
1187
|
+
/** Age threshold in days (default: 30). */
|
|
1188
|
+
days?: number;
|
|
1189
|
+
}
|
|
1190
|
+
/** Result of `nexus.cold-symbols`. */
|
|
1191
|
+
export interface NexusColdSymbolsResult {
|
|
1192
|
+
symbols: NexusColdSymbol[];
|
|
1193
|
+
count: number;
|
|
1194
|
+
thresholdDays: number;
|
|
1195
|
+
note?: string;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
966
1198
|
// ============================================================================
|
|
967
1199
|
// Typed Operations Union (T1424 — Wave D typed-dispatch migration)
|
|
968
1200
|
// ============================================================================
|
|
@@ -1034,4 +1266,19 @@ export type NexusOps = {
|
|
|
1034
1266
|
NexusContractsLinkTasksResult,
|
|
1035
1267
|
];
|
|
1036
1268
|
readonly 'conduit-scan': readonly [NexusConduitScanParams, NexusConduitScanResult];
|
|
1269
|
+
// T1510 — Phase 2 dispatch ops
|
|
1270
|
+
readonly clusters: readonly [NexusClustersParams, NexusClustersResult];
|
|
1271
|
+
readonly flows: readonly [NexusFlowsParams, NexusFlowsResult];
|
|
1272
|
+
readonly context: readonly [NexusContextParams, NexusContextResult];
|
|
1273
|
+
readonly 'projects.list': readonly [NexusProjectsListParams, NexusProjectsListResult];
|
|
1274
|
+
readonly 'projects.register': readonly [NexusProjectsRegisterParams, NexusProjectsRegisterResult];
|
|
1275
|
+
readonly 'projects.remove': readonly [NexusProjectsRemoveParams, NexusProjectsRemoveResult];
|
|
1276
|
+
readonly 'projects.scan': readonly [NexusProjectsScanParams, NexusProjectsScanResult];
|
|
1277
|
+
readonly 'projects.clean': readonly [NexusProjectsCleanParams, NexusProjectsCleanResult];
|
|
1278
|
+
readonly 'refresh-bridge': readonly [NexusRefreshBridgeParams, NexusRefreshBridgeResult];
|
|
1279
|
+
readonly diff: readonly [NexusDiffParams, NexusDiffResult];
|
|
1280
|
+
readonly 'query-cte': readonly [NexusQueryCteParams, NexusQueryCteResult];
|
|
1281
|
+
readonly 'hot-paths': readonly [NexusHotPathsParams, NexusHotPathsResult];
|
|
1282
|
+
readonly 'hot-nodes': readonly [NexusHotNodesParams, NexusHotNodesResult];
|
|
1283
|
+
readonly 'cold-symbols': readonly [NexusColdSymbolsParams, NexusColdSymbolsResult];
|
|
1037
1284
|
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release pipeline contracts — canonical 4-step release flow types.
|
|
3
|
+
*
|
|
4
|
+
* Defines the type surface shared by `@cleocode/core/release/pipeline` and
|
|
5
|
+
* `@cleocode/cleo/cli/commands/release` for the canonical pipeline:
|
|
6
|
+
*
|
|
7
|
+
* start → verify → publish → reconcile
|
|
8
|
+
*
|
|
9
|
+
* All types are project-agnostic. Concrete commands and version-scheme rules
|
|
10
|
+
* resolve at runtime from `.cleo/project-context.json`.
|
|
11
|
+
*
|
|
12
|
+
* @task T1597
|
|
13
|
+
* @adr ADR-063
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Supported version schemes. Mirrors `version.scheme` in
|
|
18
|
+
* `.cleo/project-context.json`. `auto` defers to per-project detection
|
|
19
|
+
* (CalVer for projects whose current version matches `YYYY.M.P`, SemVer
|
|
20
|
+
* otherwise).
|
|
21
|
+
*/
|
|
22
|
+
export type ReleaseVersionScheme = 'calver' | 'semver' | 'sha' | 'auto';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Handle returned by {@link releaseStart} and threaded through the rest of
|
|
26
|
+
* the pipeline. Persisted under `.cleo/release/handle.json` so that
|
|
27
|
+
* `cleo release verify` / `publish` / `reconcile` can resume without
|
|
28
|
+
* re-passing `--version` on every step.
|
|
29
|
+
*/
|
|
30
|
+
export interface ReleaseHandle {
|
|
31
|
+
/** Resolved version string (e.g. "2026.4.155" or "1.4.2"). */
|
|
32
|
+
version: string;
|
|
33
|
+
/** Resolved release tag (e.g. "v2026.4.155"). */
|
|
34
|
+
tag: string;
|
|
35
|
+
/** Active version scheme used for validation. */
|
|
36
|
+
scheme: ReleaseVersionScheme;
|
|
37
|
+
/** Branch the release is being cut from (resolved from git). */
|
|
38
|
+
branch: string;
|
|
39
|
+
/** ISO-8601 timestamp of `releaseStart`. */
|
|
40
|
+
startedAt: string;
|
|
41
|
+
/** Absolute project root the pipeline is operating against. */
|
|
42
|
+
projectRoot: string;
|
|
43
|
+
/** Optional epic ID this release ships (for reconcile auto-completion). */
|
|
44
|
+
epicId?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Per-gate verification status. */
|
|
48
|
+
export interface ReleaseGateStatus {
|
|
49
|
+
/** Canonical gate name (test/lint/typecheck/audit/security-scan). */
|
|
50
|
+
gate: string;
|
|
51
|
+
/** Whether the gate passed. */
|
|
52
|
+
passed: boolean;
|
|
53
|
+
/** Tool that was invoked (resolved via project-context). */
|
|
54
|
+
tool?: string;
|
|
55
|
+
/** Human-readable reason on failure. */
|
|
56
|
+
reason?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Result of {@link releaseVerify}. */
|
|
60
|
+
export interface VerifyResult {
|
|
61
|
+
/** All gates passed AND all child tasks have green gates. */
|
|
62
|
+
passed: boolean;
|
|
63
|
+
/** Per-gate results. */
|
|
64
|
+
gates: ReleaseGateStatus[];
|
|
65
|
+
/** Tasks discovered as children of the release epic with ungreen gates. */
|
|
66
|
+
ungreenChildren: Array<{
|
|
67
|
+
taskId: string;
|
|
68
|
+
missingGates: string[];
|
|
69
|
+
}>;
|
|
70
|
+
/** Total tasks examined under the release epic (0 if no epic). */
|
|
71
|
+
childrenExamined: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Result of {@link releasePublish}. */
|
|
75
|
+
export interface PublishResult {
|
|
76
|
+
/** Whether publish succeeded. */
|
|
77
|
+
success: boolean;
|
|
78
|
+
/** Command that was executed (after project-context resolution). */
|
|
79
|
+
command: string;
|
|
80
|
+
/** Combined stdout/stderr (truncated). */
|
|
81
|
+
output: string;
|
|
82
|
+
/** Artifact identifier on the registry, when extractable (e.g. npm tag). */
|
|
83
|
+
artifact?: string;
|
|
84
|
+
/** Whether the publish was a dry-run (no remote mutation). */
|
|
85
|
+
dryRun: boolean;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Result of {@link releaseReconcile}. */
|
|
89
|
+
export interface ReleaseReconcileResult {
|
|
90
|
+
/** Whether reconcile completed without errors. */
|
|
91
|
+
success: boolean;
|
|
92
|
+
/** The tag reconciled. */
|
|
93
|
+
tag: string;
|
|
94
|
+
/** Tasks auto-completed by archive-reason invariant. */
|
|
95
|
+
reconciledTasks: string[];
|
|
96
|
+
/** Tasks that need operator follow-up. */
|
|
97
|
+
unreconciledTasks: string[];
|
|
98
|
+
/** Errors raised by any invariant. */
|
|
99
|
+
errors: string[];
|
|
100
|
+
}
|