@microwiseai/snapshot 0.5.2 → 0.6.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 (134) hide show
  1. package/dist/commands/doctor.d.ts +2 -0
  2. package/dist/commands/doctor.d.ts.map +1 -0
  3. package/dist/commands/doctor.js +37 -0
  4. package/dist/commands/doctor.js.map +1 -0
  5. package/dist/commands/install.d.ts.map +1 -1
  6. package/dist/commands/install.js +68 -206
  7. package/dist/commands/install.js.map +1 -1
  8. package/dist/commands/publish.d.ts +0 -4
  9. package/dist/commands/publish.d.ts.map +1 -1
  10. package/dist/commands/publish.js +1 -35
  11. package/dist/commands/publish.js.map +1 -1
  12. package/dist/commands/setup.d.ts +5 -0
  13. package/dist/commands/setup.d.ts.map +1 -0
  14. package/dist/commands/setup.js +52 -0
  15. package/dist/commands/setup.js.map +1 -0
  16. package/dist/index.js +18 -27
  17. package/dist/index.js.map +1 -1
  18. package/dist/lib/config.js +1 -1
  19. package/dist/lib/config.js.map +1 -1
  20. package/dist/lib/gitlab.d.ts.map +1 -1
  21. package/dist/lib/gitlab.js +8 -6
  22. package/dist/lib/gitlab.js.map +1 -1
  23. package/dist/lib/prerequisites.d.ts +33 -0
  24. package/dist/lib/prerequisites.d.ts.map +1 -0
  25. package/dist/lib/prerequisites.js +123 -0
  26. package/dist/lib/prerequisites.js.map +1 -0
  27. package/dist/lib/transitive-resolver.d.ts +0 -121
  28. package/dist/lib/transitive-resolver.d.ts.map +1 -1
  29. package/dist/lib/transitive-resolver.js +0 -190
  30. package/dist/lib/transitive-resolver.js.map +1 -1
  31. package/package.json +3 -20
  32. package/dist/commands/clone-all.d.ts +0 -21
  33. package/dist/commands/clone-all.d.ts.map +0 -1
  34. package/dist/commands/clone-all.js +0 -57
  35. package/dist/commands/clone-all.js.map +0 -1
  36. package/dist/commands/preflight.d.ts +0 -31
  37. package/dist/commands/preflight.d.ts.map +0 -1
  38. package/dist/commands/preflight.js +0 -83
  39. package/dist/commands/preflight.js.map +0 -1
  40. package/dist/lib/distkit-closure-bridge.d.ts +0 -102
  41. package/dist/lib/distkit-closure-bridge.d.ts.map +0 -1
  42. package/dist/lib/distkit-closure-bridge.js +0 -177
  43. package/dist/lib/distkit-closure-bridge.js.map +0 -1
  44. package/dist/lib/distkit-closure-parity.d.ts +0 -110
  45. package/dist/lib/distkit-closure-parity.d.ts.map +0 -1
  46. package/dist/lib/distkit-closure-parity.js +0 -134
  47. package/dist/lib/distkit-closure-parity.js.map +0 -1
  48. package/dist/lib/distkit-routing-port.d.ts +0 -37
  49. package/dist/lib/distkit-routing-port.d.ts.map +0 -1
  50. package/dist/lib/distkit-routing-port.js +0 -72
  51. package/dist/lib/distkit-routing-port.js.map +0 -1
  52. package/dist/lib/install-timeline.d.ts +0 -81
  53. package/dist/lib/install-timeline.d.ts.map +0 -1
  54. package/dist/lib/install-timeline.js +0 -243
  55. package/dist/lib/install-timeline.js.map +0 -1
  56. package/dist/lib/preflight-adapter.d.ts +0 -52
  57. package/dist/lib/preflight-adapter.d.ts.map +0 -1
  58. package/dist/lib/preflight-adapter.js +0 -224
  59. package/dist/lib/preflight-adapter.js.map +0 -1
  60. package/node_modules/@gitdot/clone-lib/README.md +0 -117
  61. package/node_modules/@gitdot/clone-lib/dist/bin/gitdot-resolve.d.ts +0 -9
  62. package/node_modules/@gitdot/clone-lib/dist/bin/gitdot-resolve.d.ts.map +0 -1
  63. package/node_modules/@gitdot/clone-lib/dist/bin/gitdot-resolve.js +0 -154
  64. package/node_modules/@gitdot/clone-lib/dist/bin/gitdot-resolve.js.map +0 -1
  65. package/node_modules/@gitdot/clone-lib/dist/clone.d.ts +0 -21
  66. package/node_modules/@gitdot/clone-lib/dist/clone.d.ts.map +0 -1
  67. package/node_modules/@gitdot/clone-lib/dist/clone.js +0 -228
  68. package/node_modules/@gitdot/clone-lib/dist/clone.js.map +0 -1
  69. package/node_modules/@gitdot/clone-lib/dist/dotpath.d.ts +0 -10
  70. package/node_modules/@gitdot/clone-lib/dist/dotpath.d.ts.map +0 -1
  71. package/node_modules/@gitdot/clone-lib/dist/dotpath.js +0 -27
  72. package/node_modules/@gitdot/clone-lib/dist/dotpath.js.map +0 -1
  73. package/node_modules/@gitdot/clone-lib/dist/git.d.ts +0 -23
  74. package/node_modules/@gitdot/clone-lib/dist/git.d.ts.map +0 -1
  75. package/node_modules/@gitdot/clone-lib/dist/git.js +0 -134
  76. package/node_modules/@gitdot/clone-lib/dist/git.js.map +0 -1
  77. package/node_modules/@gitdot/clone-lib/dist/index.d.ts +0 -17
  78. package/node_modules/@gitdot/clone-lib/dist/index.d.ts.map +0 -1
  79. package/node_modules/@gitdot/clone-lib/dist/index.js +0 -35
  80. package/node_modules/@gitdot/clone-lib/dist/index.js.map +0 -1
  81. package/node_modules/@gitdot/clone-lib/dist/lock.d.ts +0 -24
  82. package/node_modules/@gitdot/clone-lib/dist/lock.d.ts.map +0 -1
  83. package/node_modules/@gitdot/clone-lib/dist/lock.js +0 -97
  84. package/node_modules/@gitdot/clone-lib/dist/lock.js.map +0 -1
  85. package/node_modules/@gitdot/clone-lib/dist/resolve/gitlab.d.ts +0 -15
  86. package/node_modules/@gitdot/clone-lib/dist/resolve/gitlab.d.ts.map +0 -1
  87. package/node_modules/@gitdot/clone-lib/dist/resolve/gitlab.js +0 -124
  88. package/node_modules/@gitdot/clone-lib/dist/resolve/gitlab.js.map +0 -1
  89. package/node_modules/@gitdot/clone-lib/dist/resolve/index.d.ts +0 -12
  90. package/node_modules/@gitdot/clone-lib/dist/resolve/index.d.ts.map +0 -1
  91. package/node_modules/@gitdot/clone-lib/dist/resolve/index.js +0 -31
  92. package/node_modules/@gitdot/clone-lib/dist/resolve/index.js.map +0 -1
  93. package/node_modules/@gitdot/clone-lib/dist/resolve/manifest.d.ts +0 -32
  94. package/node_modules/@gitdot/clone-lib/dist/resolve/manifest.d.ts.map +0 -1
  95. package/node_modules/@gitdot/clone-lib/dist/resolve/manifest.js +0 -159
  96. package/node_modules/@gitdot/clone-lib/dist/resolve/manifest.js.map +0 -1
  97. package/node_modules/@gitdot/clone-lib/dist/resolve/member.d.ts +0 -44
  98. package/node_modules/@gitdot/clone-lib/dist/resolve/member.d.ts.map +0 -1
  99. package/node_modules/@gitdot/clone-lib/dist/resolve/member.js +0 -163
  100. package/node_modules/@gitdot/clone-lib/dist/resolve/member.js.map +0 -1
  101. package/node_modules/@gitdot/clone-lib/dist/resolve/resolve.d.ts +0 -18
  102. package/node_modules/@gitdot/clone-lib/dist/resolve/resolve.d.ts.map +0 -1
  103. package/node_modules/@gitdot/clone-lib/dist/resolve/resolve.js +0 -155
  104. package/node_modules/@gitdot/clone-lib/dist/resolve/resolve.js.map +0 -1
  105. package/node_modules/@gitdot/clone-lib/dist/types.d.ts +0 -225
  106. package/node_modules/@gitdot/clone-lib/dist/types.d.ts.map +0 -1
  107. package/node_modules/@gitdot/clone-lib/dist/types.js +0 -9
  108. package/node_modules/@gitdot/clone-lib/dist/types.js.map +0 -1
  109. package/node_modules/@gitdot/clone-lib/package.json +0 -53
  110. package/node_modules/@microwiseai/install-preflight/dist/index.d.ts +0 -27
  111. package/node_modules/@microwiseai/install-preflight/dist/index.d.ts.map +0 -1
  112. package/node_modules/@microwiseai/install-preflight/dist/index.js +0 -26
  113. package/node_modules/@microwiseai/install-preflight/dist/index.js.map +0 -1
  114. package/node_modules/@microwiseai/install-preflight/dist/policy.d.ts +0 -42
  115. package/node_modules/@microwiseai/install-preflight/dist/policy.d.ts.map +0 -1
  116. package/node_modules/@microwiseai/install-preflight/dist/policy.js +0 -79
  117. package/node_modules/@microwiseai/install-preflight/dist/policy.js.map +0 -1
  118. package/node_modules/@microwiseai/install-preflight/dist/preflight.d.ts +0 -18
  119. package/node_modules/@microwiseai/install-preflight/dist/preflight.d.ts.map +0 -1
  120. package/node_modules/@microwiseai/install-preflight/dist/preflight.js +0 -0
  121. package/node_modules/@microwiseai/install-preflight/dist/preflight.js.map +0 -1
  122. package/node_modules/@microwiseai/install-preflight/dist/resolvers.d.ts +0 -26
  123. package/node_modules/@microwiseai/install-preflight/dist/resolvers.d.ts.map +0 -1
  124. package/node_modules/@microwiseai/install-preflight/dist/resolvers.js +0 -63
  125. package/node_modules/@microwiseai/install-preflight/dist/resolvers.js.map +0 -1
  126. package/node_modules/@microwiseai/install-preflight/dist/semver.d.ts +0 -45
  127. package/node_modules/@microwiseai/install-preflight/dist/semver.d.ts.map +0 -1
  128. package/node_modules/@microwiseai/install-preflight/dist/semver.js +0 -195
  129. package/node_modules/@microwiseai/install-preflight/dist/semver.js.map +0 -1
  130. package/node_modules/@microwiseai/install-preflight/dist/types.d.ts +0 -136
  131. package/node_modules/@microwiseai/install-preflight/dist/types.d.ts.map +0 -1
  132. package/node_modules/@microwiseai/install-preflight/dist/types.js +0 -11
  133. package/node_modules/@microwiseai/install-preflight/dist/types.js.map +0 -1
  134. package/node_modules/@microwiseai/install-preflight/package.json +0 -49
@@ -1 +0,0 @@
1
- {"version":3,"file":"distkit-closure-bridge.js","sourceRoot":"","sources":["../../src/lib/distkit-closure-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,GAQpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,GAExB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,+BAA+B,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAiC5F;;;;GAIG;AACH,KAAK,UAAU,0BAA0B,CACvC,YAAoB,EACpB,OAAiC;IAEjC,IAAI,CAAC,uBAAuB,EAAE,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AG,EAAE,EAAE;QACrD,YAAY;QACZ,UAAU,EAAE,KAAK;QACjB,WAAW;QACX,2EAA2E;QAC3E,wDAAwD;KACzD,CAAC,CAAC;AACL,CAAC;AAED,uEAAuE;AACvE,KAAK,UAAU,oBAAoB,CAAC,YAAoB;IACtD,MAAM,IAAI,GAAG,MAAM,qBAAqB,CAAC,YAAY,CAAC,CAAC;IACvD,OAAO,IAAI,CAAC,OAAO,CAAC;AACtB,CAAC"}
@@ -1,110 +0,0 @@
1
- /**
2
- * ============================================================================
3
- * Phase-2b §1.2c — parity-diff harness (walkClosure vs legacy /resolve-deps)
4
- * ============================================================================
5
- *
6
- * STATUS: harness SKELETON (pure, testable NOW). The distkit side is fed by
7
- * {@link resolveClosureViaDistkit} (HELD until distkit is linked); this module's
8
- * diff functions are pure and unit-tested today against synthetic inputs so the
9
- * classification is ready the moment real outputs exist.
10
- *
11
- * PURPOSE (cutover GATE): before any cutover, diff the flag-on distkit closure
12
- * against the current `/resolve-deps` output on a real snapshot and CLASSIFY the
13
- * differences so each is either accepted (a known B2 improvement) or flagged (a
14
- * regression). Four classification axes (SSOT §1.2c):
15
- *
16
- * 1. ORDERING — distkit emits deterministic sorted order; legacy order may
17
- * differ. Same SET, different sequence ⇒ benign.
18
- * 2. DEDUP — a `name@version` present in one side only. distkit dedups
19
- * by `name@version` (multi-parent diamond collapses to one).
20
- * 3. requestedBy — legacy carries a SINGLE parent (`requestedBy?: string`);
21
- * MERGE distkit carries the MERGED multi-parent set (`string[]`).
22
- * A superset on the distkit side is the expected B2 gap-close.
23
- * 4. PEER — distkit includes peerDependencies as OPTIONAL by default;
24
- * INCLUSION legacy returned peers separately (`includePeer`). Packages
25
- * present only because of a peer edge are surfaced here.
26
- *
27
- * This module is provenance-neutral: it compares by `name@version` identity and
28
- * `requestedBy` sets, NOT by installer/source (that is §1.3 mapping, out of scope).
29
- */
30
- /** A legacy `/resolve-deps` row (snapshot `ResolvedPackage`, single-parent). */
31
- export interface LegacyClosureRow {
32
- name: string;
33
- version: string;
34
- isDirect?: boolean;
35
- /** legacy single-parent provenance (undefined for direct roots). */
36
- requestedBy?: string;
37
- }
38
- /** A distkit `ResolvedPackageInput` row (multi-parent). Structural subset. */
39
- export interface DistkitClosureRow {
40
- name: string;
41
- version: string;
42
- isDirect: boolean;
43
- /** merged, deduped, sorted parents. */
44
- requestedBy: string[];
45
- }
46
- /** Optional hints that let the harness classify PEER-only inclusions precisely. */
47
- export interface PeerClassificationHints {
48
- /** `name@version` keys known to enter the closure ONLY via a peer edge. */
49
- peerOnlyKeys?: readonly string[];
50
- }
51
- export interface RequestedByDiff {
52
- key: string;
53
- legacy: string[];
54
- distkit: string[];
55
- /** true iff distkit's parent set ⊇ legacy's (expected multi-parent gap-close). */
56
- distkitSuperset: boolean;
57
- }
58
- export interface ParityReport {
59
- /** `name@version` present in legacy but missing from distkit (investigate). */
60
- onlyInLegacy: string[];
61
- /** `name@version` present in distkit but missing from legacy (dedup/peer/new). */
62
- onlyInDistkit: string[];
63
- /** ordering comparison over the shared key set. */
64
- ordering: {
65
- sameSet: boolean;
66
- legacyOrder: string[];
67
- distkitOrder: string[];
68
- sameOrder: boolean;
69
- };
70
- /** per-key requestedBy differences (only keys present on BOTH sides). */
71
- requestedBy: RequestedByDiff[];
72
- /** `onlyInDistkit` keys attributable to peer inclusion (via hints). */
73
- peerInclusions: string[];
74
- /** rollup counts for a quick gate read. */
75
- summary: {
76
- legacyCount: number;
77
- distkitCount: number;
78
- sharedCount: number;
79
- onlyInLegacyCount: number;
80
- onlyInDistkitCount: number;
81
- requestedByDiffCount: number;
82
- /** requestedBy diffs where distkit is NOT a superset of legacy (⇒ inspect). */
83
- requestedByNonSupersetCount: number;
84
- peerInclusionCount: number;
85
- };
86
- }
87
- /** Stable identity key for a closure row. */
88
- export declare function closureKey(row: {
89
- name: string;
90
- version: string;
91
- }): string;
92
- /**
93
- * Classify the differences between the legacy `/resolve-deps` closure and the
94
- * distkit `walkClosure` closure. PURE — deterministic, no I/O. Ready to run on
95
- * real outputs the moment {@link resolveClosureViaDistkit} is unblocked.
96
- */
97
- export declare function diffClosures(legacy: readonly LegacyClosureRow[], distkit: readonly DistkitClosureRow[], hints?: PeerClassificationHints): ParityReport;
98
- /**
99
- * Gate verdict over a {@link ParityReport}. The cutover GATE passes only when
100
- * every difference is a KNOWN-BENIGN B2 improvement:
101
- * - `onlyInLegacy` MUST be empty (distkit dropped nothing).
102
- * - every `onlyInDistkit` key is attributable to peer inclusion (hints).
103
- * - every requestedBy diff is a distkit SUPERSET (multi-parent gap-close).
104
- * Ordering differences are always benign (distkit is canonically sorted).
105
- */
106
- export declare function isParityAcceptable(report: ParityReport): {
107
- ok: boolean;
108
- reasons: string[];
109
- };
110
- //# sourceMappingURL=distkit-closure-parity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"distkit-closure-parity.d.ts","sourceRoot":"","sources":["../../src/lib/distkit-closure-parity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,8EAA8E;AAC9E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,mFAAmF;AACnF,MAAM,WAAW,uBAAuB;IACtC,2EAA2E;IAC3E,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAID,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,E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,CAAC;CACnB,CAaA"}
@@ -1,134 +0,0 @@
1
- /**
2
- * ============================================================================
3
- * Phase-2b §1.2c — parity-diff harness (walkClosure vs legacy /resolve-deps)
4
- * ============================================================================
5
- *
6
- * STATUS: harness SKELETON (pure, testable NOW). The distkit side is fed by
7
- * {@link resolveClosureViaDistkit} (HELD until distkit is linked); this module's
8
- * diff functions are pure and unit-tested today against synthetic inputs so the
9
- * classification is ready the moment real outputs exist.
10
- *
11
- * PURPOSE (cutover GATE): before any cutover, diff the flag-on distkit closure
12
- * against the current `/resolve-deps` output on a real snapshot and CLASSIFY the
13
- * differences so each is either accepted (a known B2 improvement) or flagged (a
14
- * regression). Four classification axes (SSOT §1.2c):
15
- *
16
- * 1. ORDERING — distkit emits deterministic sorted order; legacy order may
17
- * differ. Same SET, different sequence ⇒ benign.
18
- * 2. DEDUP — a `name@version` present in one side only. distkit dedups
19
- * by `name@version` (multi-parent diamond collapses to one).
20
- * 3. requestedBy — legacy carries a SINGLE parent (`requestedBy?: string`);
21
- * MERGE distkit carries the MERGED multi-parent set (`string[]`).
22
- * A superset on the distkit side is the expected B2 gap-close.
23
- * 4. PEER — distkit includes peerDependencies as OPTIONAL by default;
24
- * INCLUSION legacy returned peers separately (`includePeer`). Packages
25
- * present only because of a peer edge are surfaced here.
26
- *
27
- * This module is provenance-neutral: it compares by `name@version` identity and
28
- * `requestedBy` sets, NOT by installer/source (that is §1.3 mapping, out of scope).
29
- */
30
- // ── Pure helpers ─────────────────────────────────────────────────────────────
31
- /** Stable identity key for a closure row. */
32
- export function closureKey(row) {
33
- return `${row.name}@${row.version}`;
34
- }
35
- function sortedUnique(xs) {
36
- return [...new Set(xs)].sort();
37
- }
38
- function setsEqual(a, b) {
39
- if (a.length !== b.length)
40
- return false;
41
- const bs = new Set(b);
42
- return a.every((x) => bs.has(x));
43
- }
44
- /** True iff every element of `sub` is in `sup`. */
45
- function isSuperset(sup, sub) {
46
- const s = new Set(sup);
47
- return sub.every((x) => s.has(x));
48
- }
49
- /**
50
- * Classify the differences between the legacy `/resolve-deps` closure and the
51
- * distkit `walkClosure` closure. PURE — deterministic, no I/O. Ready to run on
52
- * real outputs the moment {@link resolveClosureViaDistkit} is unblocked.
53
- */
54
- export function diffClosures(legacy, distkit, hints = {}) {
55
- const legacyByKey = new Map();
56
- for (const r of legacy)
57
- legacyByKey.set(closureKey(r), r);
58
- const distkitByKey = new Map();
59
- for (const r of distkit)
60
- distkitByKey.set(closureKey(r), r);
61
- const legacyKeys = [...legacyByKey.keys()];
62
- const distkitKeys = [...distkitByKey.keys()];
63
- const onlyInLegacy = legacyKeys.filter((k) => !distkitByKey.has(k)).sort();
64
- const onlyInDistkit = distkitKeys.filter((k) => !legacyByKey.has(k)).sort();
65
- // Ordering: compare the sequence of the SHARED keys as each side lists them.
66
- const sharedLegacyOrder = legacyKeys.filter((k) => distkitByKey.has(k));
67
- const sharedDistkitOrder = distkitKeys.filter((k) => legacyByKey.has(k));
68
- const sameSet = setsEqual(legacyKeys, distkitKeys);
69
- const sameOrder = sharedLegacyOrder.length === sharedDistkitOrder.length &&
70
- sharedLegacyOrder.every((k, i) => k === sharedDistkitOrder[i]);
71
- // requestedBy diffs over shared keys (legacy single-parent → set of size ≤1).
72
- const requestedBy = [];
73
- for (const key of sharedLegacyOrder) {
74
- const l = legacyByKey.get(key);
75
- const d = distkitByKey.get(key);
76
- const legacyParents = sortedUnique(l.requestedBy ? [l.requestedBy] : []);
77
- const distkitParents = sortedUnique(d.requestedBy);
78
- if (!setsEqual(legacyParents, distkitParents)) {
79
- requestedBy.push({
80
- key,
81
- legacy: legacyParents,
82
- distkit: distkitParents,
83
- distkitSuperset: isSuperset(distkitParents, legacyParents),
84
- });
85
- }
86
- }
87
- const peerSet = new Set(hints.peerOnlyKeys ?? []);
88
- const peerInclusions = onlyInDistkit.filter((k) => peerSet.has(k));
89
- return {
90
- onlyInLegacy,
91
- onlyInDistkit,
92
- ordering: {
93
- sameSet,
94
- legacyOrder: sharedLegacyOrder,
95
- distkitOrder: sharedDistkitOrder,
96
- sameOrder,
97
- },
98
- requestedBy,
99
- peerInclusions,
100
- summary: {
101
- legacyCount: legacyKeys.length,
102
- distkitCount: distkitKeys.length,
103
- sharedCount: sharedLegacyOrder.length,
104
- onlyInLegacyCount: onlyInLegacy.length,
105
- onlyInDistkitCount: onlyInDistkit.length,
106
- requestedByDiffCount: requestedBy.length,
107
- requestedByNonSupersetCount: requestedBy.filter((r) => !r.distkitSuperset).length,
108
- peerInclusionCount: peerInclusions.length,
109
- },
110
- };
111
- }
112
- /**
113
- * Gate verdict over a {@link ParityReport}. The cutover GATE passes only when
114
- * every difference is a KNOWN-BENIGN B2 improvement:
115
- * - `onlyInLegacy` MUST be empty (distkit dropped nothing).
116
- * - every `onlyInDistkit` key is attributable to peer inclusion (hints).
117
- * - every requestedBy diff is a distkit SUPERSET (multi-parent gap-close).
118
- * Ordering differences are always benign (distkit is canonically sorted).
119
- */
120
- export function isParityAcceptable(report) {
121
- const reasons = [];
122
- if (report.summary.onlyInLegacyCount > 0) {
123
- reasons.push(`${report.summary.onlyInLegacyCount} package(s) present in legacy but MISSING from distkit`);
124
- }
125
- const unexplainedNew = report.onlyInDistkit.filter((k) => !report.peerInclusions.includes(k));
126
- if (unexplainedNew.length > 0) {
127
- reasons.push(`${unexplainedNew.length} distkit-only package(s) not explained by peer inclusion`);
128
- }
129
- if (report.summary.requestedByNonSupersetCount > 0) {
130
- reasons.push(`${report.summary.requestedByNonSupersetCount} requestedBy diff(s) where distkit is not a superset of legacy`);
131
- }
132
- return { ok: reasons.length === 0, reasons };
133
- }
134
- //# sourceMappingURL=distkit-closure-parity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"distkit-closure-parity.js","sourceRoot":"","sources":["../../src/lib/distkit-closure-parity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AA+DH,gFAAgF;AAEhF,6CAA6C;AAC7C,MAAM,UAAU,UAAU,CAAC,GAAsC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AAkB,CAAC,MAAoB;IAIrD,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,MAAM,CAAC,OAAO,CAAC,iBAAiB,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,wDAAwD,CAAC,CAAC;IAC5G,CAAC;IACD,MAAM,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9F,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,0DAA0D,CAAC,CAAC;IACnG,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,CAAC,2BAA2B,GAAG,CAAC,EAAE,CAAC;QACnD,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,2BAA2B,gEAAgE,CAAC,CAAC;IAC9H,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;AAC/C,CAAC"}
@@ -1,37 +0,0 @@
1
- import { type PackumentPort } from '@microwiseai/distkit/adapters';
2
- /**
3
- * True iff `name` belongs to one of the PRIVATE scopes (the snapshot's registry
4
- * scope-map keys, e.g. `@ist`, `@microwiseai`). A private name routes to the
5
- * proxy (+ token); everything else is PUBLIC (npmjs, token-less).
6
- *
7
- * ★ Task-5 / ADR 0003 (ecosystem-neutral identity): `scope` here is an
8
- * npm-adapter-LOCAL projection — the private/public LANE selector for the npm
9
- * closure — NOT a core identity axis. It carries no npm privilege: any name not
10
- * in `privateScopes` (an unscoped-npm public dep AND a pypi-style name alike) is
11
- * uniformly PUBLIC. The core (group, name) identity is delegated downstream to
12
- * distkit's `resolveManifestToLock` / `resolvePackageOriginByIdentity`, and the
13
- * emitted lock keys on (name, group) — never on scope.
14
- */
15
- export declare function isPrivateScope(name: string, privateScopes: readonly string[]): boolean;
16
- /** Options for {@link createScopeRoutingPackumentPort}. */
17
- export interface ScopeRoutingPortOptions {
18
- /** the PRIVATE scopes (snapshot registry scope-map keys). Everything else = public. */
19
- privateScopes: readonly string[];
20
- /** our access-controlling proxy base url (private lane). */
21
- proxyUrl: string;
22
- /** public npm registry base. Default {@link NPMJS_PUBLIC_REGISTRY_URL}. */
23
- npmjsUrl?: string;
24
- /** session/PAT token — injected into the PRIVATE lane ONLY (never public). */
25
- token?: string;
26
- /** injectable fetch (tests). Defaults to global `fetch` inside each sub-port. */
27
- fetchImpl?: typeof fetch;
28
- /** per-request timeout (ms) forwarded to both sub-ports. */
29
- timeoutMs?: number;
30
- }
31
- /**
32
- * Build a {@link PackumentPort} that routes each `fetchPackument(name)` to the
33
- * proxy (private, tokened) or npmjs (public, token-less) by scope. Plug into
34
- * `createNpmAdapter(port)`.
35
- */
36
- export declare function createScopeRoutingPackumentPort(opts: ScopeRoutingPortOptions): PackumentPort;
37
- //# sourceMappingURL=distkit-routing-port.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"distkit-routing-port.d.ts","sourceRoot":"","sources":["../../src/lib/distkit-routing-port.ts"],"names":[],"mappings":"AAuBA,OAAO,EAA4B,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE7F;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAKtF;AAED,2DAA2D;AAC3D,MAAM,WAAW,uBAAuB;IACtC,uFAAuF;IACvF,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,uBAAuB,GAAG,aAAa,CAuB5F"}
@@ -1,72 +0,0 @@
1
- /**
2
- * ============================================================================
3
- * Phase-2b §1.2/§1.3 (decision A) — production scope-routing PackumentPort
4
- * ============================================================================
5
- *
6
- * Decision A (owner-confirmed): distkit resolves the npm closure CLIENT-SIDE with
7
- * PER-SCOPE registry routing. A real closure mixes lanes — PRIVATE roots/deps
8
- * (`@ist/*`, `@microwiseai/*` … the snapshot's registry scopes) served by our
9
- * proxy (+ session token), and PUBLIC transitive deps (`semver`, `commander`, …)
10
- * served by npmjs (token-less). distkit's npm adapter takes ONE PackumentPort, so
11
- * this port DISPATCHES per package name to the right registry.
12
- *
13
- * ★ TOKEN ISOLATION (C1 — the whole point): the two lanes are SEPARATE
14
- * {@link createFetchPackumentPort} instances. The public port is constructed
15
- * WITHOUT a token, so `createFetchPackumentPort` never attaches an
16
- * `Authorization` header to an npmjs read — it is structurally impossible for
17
- * the license/session token to leak to npmjs. Only the private port carries the
18
- * Bearer token.
19
- * ★ FAIL-LOUD (§1.4): each sub-port surfaces a non-2xx as `PackumentResolutionError`
20
- * (an unentitled private read → 401 → throw). This port adds NO catch — a miss
21
- * propagates; it NEVER silently degrades to a public read for a private name.
22
- */
23
- import { NPMJS_PUBLIC_REGISTRY_URL } from '@microwiseai/distkit';
24
- import { createFetchPackumentPort } from '@microwiseai/distkit/adapters';
25
- /**
26
- * True iff `name` belongs to one of the PRIVATE scopes (the snapshot's registry
27
- * scope-map keys, e.g. `@ist`, `@microwiseai`). A private name routes to the
28
- * proxy (+ token); everything else is PUBLIC (npmjs, token-less).
29
- *
30
- * ★ Task-5 / ADR 0003 (ecosystem-neutral identity): `scope` here is an
31
- * npm-adapter-LOCAL projection — the private/public LANE selector for the npm
32
- * closure — NOT a core identity axis. It carries no npm privilege: any name not
33
- * in `privateScopes` (an unscoped-npm public dep AND a pypi-style name alike) is
34
- * uniformly PUBLIC. The core (group, name) identity is delegated downstream to
35
- * distkit's `resolveManifestToLock` / `resolvePackageOriginByIdentity`, and the
36
- * emitted lock keys on (name, group) — never on scope.
37
- */
38
- export function isPrivateScope(name, privateScopes) {
39
- return privateScopes.some((s) => {
40
- const scope = s.endsWith('/') ? s.slice(0, -1) : s;
41
- return name === scope || name.startsWith(`${scope}/`);
42
- });
43
- }
44
- /**
45
- * Build a {@link PackumentPort} that routes each `fetchPackument(name)` to the
46
- * proxy (private, tokened) or npmjs (public, token-less) by scope. Plug into
47
- * `createNpmAdapter(port)`.
48
- */
49
- export function createScopeRoutingPackumentPort(opts) {
50
- // PRIVATE lane — proxy + Bearer token (guardrail 1).
51
- const privatePort = createFetchPackumentPort({
52
- registryUrl: opts.proxyUrl,
53
- token: opts.token,
54
- fetchImpl: opts.fetchImpl,
55
- timeoutMs: opts.timeoutMs,
56
- });
57
- // PUBLIC lane — npmjs, NO token passed (guardrail 2 / C1). Token isolation by
58
- // construction: this port has no credential to send.
59
- const publicPort = createFetchPackumentPort({
60
- registryUrl: opts.npmjsUrl ?? NPMJS_PUBLIC_REGISTRY_URL,
61
- fetchImpl: opts.fetchImpl,
62
- timeoutMs: opts.timeoutMs,
63
- });
64
- return {
65
- fetchPackument(name) {
66
- return isPrivateScope(name, opts.privateScopes)
67
- ? privatePort.fetchPackument(name)
68
- : publicPort.fetchPackument(name);
69
- },
70
- };
71
- }
72
- //# sourceMappingURL=distkit-routing-port.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"distkit-routing-port.js","sourceRoot":"","sources":["../../src/lib/distkit-routing-port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACj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@
1
- /**
2
- * install-timeline.ts — Install timeline instrumentation (investigation only).
3
- *
4
- * Purpose: measure WHY a snapshot install is slow, from the inside, without
5
- * changing any install behavior. Purely additive: when the opt-in env flag is
6
- * unset the whole thing is a no-op with negligible overhead — every `start()`
7
- * returns one shared no-op handle and `finalize()` returns immediately.
8
- *
9
- * Opt-in: SNAPSHOT_INSTALL_TIMELINE ∈ {'1','true'} (case-insensitive).
10
- *
11
- * Output when enabled:
12
- * (a) console phase-summary table with relative [+Xs] offsets, per-phase
13
- * durations, a `◄ dominant` marker on the largest phase, and per-command /
14
- * per-package rows indented under their phase, then a total line.
15
- * (b) JSONL file at ~/.ist/logs/snapshot-install-timeline/<ISO>.jsonl —
16
- * one line per event + a trailing summary line, for cross-run diffing.
17
- *
18
- * Security (security-ssot-principle): tokens must NEVER be written. Command
19
- * strings and meta are sanitized — IST_SESSION_TOKEN, authToken, _authToken=,
20
- * and Bearer values are replaced with `***` before any record/print/write.
21
- */
22
- export type TimelineCategory = 'phase' | 'command' | 'package';
23
- export interface TimelineEvent {
24
- label: string;
25
- category: TimelineCategory;
26
- /** Offset from timeline t0, in ms (span start). */
27
- startOffsetMs: number;
28
- /** Measured span duration, in ms (performance.now based). */
29
- durationMs: number;
30
- /** Wall-clock ISO timestamp of the span start (Date.now based). */
31
- wallStartIso: string;
32
- /** Label of the enclosing phase span, if any (for indentation/grouping). */
33
- parentLabel?: string;
34
- meta?: Record<string, unknown>;
35
- }
36
- export interface SpanHandle {
37
- /** Close the span, recording its duration. Extra meta is merged in. */
38
- end(meta?: Record<string, unknown>): void;
39
- }
40
- export interface StartOptions {
41
- category?: TimelineCategory;
42
- meta?: Record<string, unknown>;
43
- }
44
- export interface InstallTimelineOptions {
45
- /** Force enable/disable. When omitted, decided from env opt-in flag. */
46
- enabled?: boolean;
47
- /** Env source (default: process.env). */
48
- env?: Record<string, string | undefined>;
49
- /** Monotonic clock in ms (default: performance.now). Injectable for tests. */
50
- now?: () => number;
51
- /** Wall clock in ms (default: Date.now). Injectable for tests. */
52
- wallNow?: () => number;
53
- /** Directory for JSONL logs (default: ~/.ist/logs/snapshot-install-timeline). */
54
- logDir?: string;
55
- /** Console sink (default: console.log). Injectable for tests. */
56
- logger?: (line: string) => void;
57
- /** Directory creator (default: mkdirSync -p). Injectable for tests. */
58
- mkdir?: (dir: string) => void;
59
- /** File writer (default: writeFileSync). Injectable for tests. */
60
- writeFile?: (path: string, content: string) => void;
61
- }
62
- /** Redact token material from an arbitrary string. */
63
- export declare function sanitizeString(input: string, env?: Record<string, string | undefined>): string;
64
- /** Deep-sanitize a meta object: scrub string values and redact suspicious keys. */
65
- export declare function sanitizeMeta(meta: Record<string, unknown> | undefined, env?: Record<string, string | undefined>): Record<string, unknown> | undefined;
66
- export interface InstallTimeline {
67
- readonly enabled: boolean;
68
- start(label: string, opts?: StartOptions): SpanHandle;
69
- finalize(): void;
70
- /** Read recorded events (for tests / introspection). */
71
- getEvents(): TimelineEvent[];
72
- }
73
- /**
74
- * Decide enablement from the opt-in env flag (unless explicitly overridden).
75
- */
76
- export declare function isTimelineEnabled(env?: Record<string, string | undefined>): boolean;
77
- /**
78
- * Factory: returns an active timeline when opted-in, else a zero-overhead no-op.
79
- */
80
- export declare function createInstallTimeline(opts?: InstallTimelineOptions): InstallTimeline;
81
- //# sourceMappingURL=install-timeline.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"install-timeline.d.ts","sourceRoot":"","sources":["../../src/lib/install-timeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAOH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,mDAAmD;IACnD,aAAa,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE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