@productbrain/cli 0.1.0-beta.2378 → 0.1.0-beta.2394

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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=chain-classifier-kernel-client-drift.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chain-classifier-kernel-client-drift.test.d.ts","sourceRoot":"","sources":["../../src/generators/chain-classifier-kernel-client-drift.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Compile-time drift test — PR #393 review (Codex P2), post-Lane-C-S3a fix.
3
+ *
4
+ * `chain-classifier.ts`'s `GovernanceFunction`/`GovernanceRelationEdge` are LOCAL,
5
+ * structural declarations again (not `import type`-re-exported from
6
+ * `@productbrain/kernel-client/governance`) — a re-export would leak the kernel-client
7
+ * import specifier into cli's PUBLISHED `.d.ts` output (`npm pack --dry-run` confirmed
8
+ * `dist/generators/chain-classifier.d.ts` ships in the tarball; a TypeScript consumer
9
+ * following that declaration would hit `TS2307: Cannot find module
10
+ * '@productbrain/kernel-client/governance'`, since that package is `private: true` and
11
+ * never published).
12
+ *
13
+ * This file is what replaces the deleted pre-S3a "zero drift risk" comment's unverified
14
+ * promise with an ENFORCED one: it imports BOTH chain-classifier.ts's local types and
15
+ * kernel-client's canonical originals, and asserts mutual structural assignability at
16
+ * the TYPE level. If either shape drifts without the other being updated to match, this
17
+ * file FAILS TO COMPILE (`tsc --noEmit` / `check:package-types` / this vitest run all
18
+ * fail) — a real, re-runnable check.
19
+ *
20
+ * This file exports NOTHING, so its own compiled declaration carries no kernel-client
21
+ * reference (verified: `npm pack --dry-run` shows no import in the emitted
22
+ * `chain-classifier-kernel-client-drift.test.d.ts` — nothing here is part of the public
23
+ * surface a consumer could ever deep-import).
24
+ */
25
+ import { describe, expect, it } from 'vitest';
26
+ // If either line below fails to compile, chain-classifier.ts's local mirror has drifted
27
+ // from kernel-client's canonical shape — update the local declaration in
28
+ // chain-classifier.ts to match kernel/governance/classifyGovernance.ts's real shape.
29
+ const _governanceFunctionMatchesKernelClient = true;
30
+ const _governanceRelationEdgeMatchesKernelClient = true;
31
+ void _governanceFunctionMatchesKernelClient;
32
+ void _governanceRelationEdgeMatchesKernelClient;
33
+ describe('chain-classifier.ts governance types stay structurally identical to @productbrain/kernel-client/governance (PR #393 review)', () => {
34
+ it('compiles only when both AssertEqual checks above resolve to `true` — this test passing IS the drift check; the assertion below is a no-op runtime confirmation', () => {
35
+ // The real check already ran at compile time (the `const _...: AssertEqual<...> =
36
+ // true` lines above). If this test file compiled and vitest is running it, the
37
+ // types matched. This assertion just gives the check a visible, reportable pass.
38
+ expect(true).toBe(true);
39
+ });
40
+ });
41
+ //# sourceMappingURL=chain-classifier-kernel-client-drift.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chain-classifier-kernel-client-drift.test.js","sourceRoot":"","sources":["../../src/generators/chain-classifier-kernel-client-drift.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AA0B9C,wFAAwF;AACxF,yEAAyE;AACzE,qFAAqF;AACrF,MAAM,sCAAsC,GAA8D,IAAI,CAAC;AAC/G,MAAM,0CAA0C,GAAsE,IAAI,CAAC;AAC3H,KAAK,sCAAsC,CAAC;AAC5C,KAAK,0CAA0C,CAAC;AAEhD,QAAQ,CAAC,6HAA6H,EAAE,GAAG,EAAE;IAC3I,EAAE,CAAC,gKAAgK,EAAE,GAAG,EAAE;QACxK,kFAAkF;QAClF,+EAA+E;QAC/E,iFAAiF;QACjF,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -9,14 +9,52 @@
9
9
  * `packages/cli` cannot import `kernel/` directly (`kernel/` is a private, unpublished
10
10
  * workspace package; CLI compiles with plain `tsc`, no bundler — a `kernel` import
11
11
  * would emit an unresolvable specifier into the published `dist/`, verified in WP-488
12
- * Slice 3 for the identical class of failure). Duplicated as TYPES only — zero logic,
13
- * zero drift risk (a type either matches the server's real shape or the build fails).
12
+ * Slice 3 for the identical class of failure).
13
+ *
14
+ * Lane C S3a (TEN-2733 pattern extension), REVISED post-merge (PR #393 review,
15
+ * Codex P2): `GovernanceFunction`/`GovernanceRelationEdge` were briefly `import
16
+ * type`-only re-exports from `@productbrain/kernel-client/governance`. Confirmed real:
17
+ * `import type` erases from EMITTED JS (no runtime import — verified, unchanged), but
18
+ * `tsc`'s DECLARATION (`.d.ts`) output for a re-export like `export type { X } from
19
+ * 'module'` PRESERVES the import specifier — and `npm pack --dry-run` confirms
20
+ * `dist/generators/chain-classifier.d.ts` ships in the published tarball. A TypeScript
21
+ * consumer following that shipped declaration (cli's package.json has no "exports" map,
22
+ * so nothing blocks a deep import of `dist/generators/chain-classifier.js`) would hit
23
+ * `TS2307: Cannot find module '@productbrain/kernel-client/governance'` — that package
24
+ * is `private: true`, never published. A `type X = import('@productbrain/kernel-client/
25
+ * governance').X` alias form doesn't fix this either — the import specifier still leaks
26
+ * into the declaration the same way.
27
+ *
28
+ * FIX: `GovernanceFunction`/`GovernanceRelationEdge` are LOCAL, structural declarations
29
+ * again (below) — the published `.d.ts` is fully self-contained, no kernel-client
30
+ * reference at all. Binding to kernel-client's canonical shape moved from "the type
31
+ * IS the import" to "a committed, compile-time DRIFT TEST" —
32
+ * `chain-classifier-kernel-client-drift.test.ts` (same directory) imports BOTH this
33
+ * file's local types AND kernel-client's `@productbrain/kernel-client/governance`
34
+ * originals and asserts mutual structural assignability; if either shape drifts without
35
+ * the other being updated to match, that test FAILS TO COMPILE — a real, enforced
36
+ * check, not the deleted pre-S3a "zero drift risk" comment's unverified promise. The
37
+ * drift test itself exports nothing, so ITS declaration carries no kernel-client
38
+ * reference either (verified: `npm pack --dry-run` shows an empty/no-op `.d.ts` for it).
39
+ *
40
+ * `@productbrain/kernel-client/governance` (the subpath added in S3a) still exists and
41
+ * is still useful — it's now the drift test's comparison source, and remains available
42
+ * for any FUTURE consumer that can afford a kernel-client type dependency (mcp-server,
43
+ * which never ships declarations at all — it bundles via tsup, not `tsc -d`).
44
+ *
45
+ * `GovernanceEntryInput`/`GovernanceCollectionInput`/`ClassifiedGovernance` below remain
46
+ * hand-declared (never re-exported from kernel-client — same self-contained-declaration
47
+ * reasoning now applies to them too, not just out of scope).
14
48
  *
15
49
  * Chain: BET-286 (Chain-Derived Agent Configuration), TEN-2733, TEN-2705
16
50
  */
17
- /** The governance functions that archetypes exist for. */
51
+ /** The governance functions that archetypes exist for. Mirrors kernel/governance/
52
+ * classifyGovernance.ts's GovernanceFunction exactly — verified by
53
+ * chain-classifier-kernel-client-drift.test.ts's compile-time assertion. */
18
54
  export type GovernanceFunction = 'constraint' | 'boundary' | 'convention' | 'policy' | 'workflow' | 'quality-gate' | 'unclassified';
19
- /** Typed relation edge mirrors GovernanceRelationEdge from convex/agentKnowledge/governanceQuery.ts */
55
+ /** Typed relation edge. Mirrors GovernanceRelationEdge from kernel/governance/
56
+ * classifyGovernance.ts exactly — verified by
57
+ * chain-classifier-kernel-client-drift.test.ts's compile-time assertion. */
20
58
  export interface GovernanceRelationEdge {
21
59
  type: string;
22
60
  direction: 'outgoing' | 'incoming';
@@ -1 +1 @@
1
- {"version":3,"file":"chain-classifier.d.ts","sourceRoot":"","sources":["../../src/generators/chain-classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,0DAA0D;AAC1D,MAAM,MAAM,kBAAkB,GAC1B,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,cAAc,GACd,cAAc,CAAC;AAEnB,yGAAyG;AACzG,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,UAAU,GA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AC,GAAG,IAAI,CAAC;IACrC,wCAAwC;IACxC,SAAS,EAAE,sBAAsB,EAAE,CAAC;CACrC"}
1
+ {"version":3,"file":"chain-classifier.d.ts","sourceRoot":"","sources":["../../src/generators/chain-classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH;;4EAE4E;AAC5E,MAAM,MAAM,kBAAkB,GAC1B,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,cAAc,GACd,cAAc,CAAC;AAEnB;;4EAE4E;AAC5E,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,UAAU,GAAG,UAAU,CAAC;IACnC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,mEAAmE;AACnE,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI,CAAC;IACrD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACrC,SAAS,EAAE,sBAAsB,EAAE,CAAC;CACrC;AAED,gEAAgE;AAChE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED,iGAAiG;AACjG,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACrC,wCAAwC;IACxC,SAAS,EAAE,sBAAsB,EAAE,CAAC;CACrC"}
@@ -9,8 +9,42 @@
9
9
  * `packages/cli` cannot import `kernel/` directly (`kernel/` is a private, unpublished
10
10
  * workspace package; CLI compiles with plain `tsc`, no bundler — a `kernel` import
11
11
  * would emit an unresolvable specifier into the published `dist/`, verified in WP-488
12
- * Slice 3 for the identical class of failure). Duplicated as TYPES only — zero logic,
13
- * zero drift risk (a type either matches the server's real shape or the build fails).
12
+ * Slice 3 for the identical class of failure).
13
+ *
14
+ * Lane C S3a (TEN-2733 pattern extension), REVISED post-merge (PR #393 review,
15
+ * Codex P2): `GovernanceFunction`/`GovernanceRelationEdge` were briefly `import
16
+ * type`-only re-exports from `@productbrain/kernel-client/governance`. Confirmed real:
17
+ * `import type` erases from EMITTED JS (no runtime import — verified, unchanged), but
18
+ * `tsc`'s DECLARATION (`.d.ts`) output for a re-export like `export type { X } from
19
+ * 'module'` PRESERVES the import specifier — and `npm pack --dry-run` confirms
20
+ * `dist/generators/chain-classifier.d.ts` ships in the published tarball. A TypeScript
21
+ * consumer following that shipped declaration (cli's package.json has no "exports" map,
22
+ * so nothing blocks a deep import of `dist/generators/chain-classifier.js`) would hit
23
+ * `TS2307: Cannot find module '@productbrain/kernel-client/governance'` — that package
24
+ * is `private: true`, never published. A `type X = import('@productbrain/kernel-client/
25
+ * governance').X` alias form doesn't fix this either — the import specifier still leaks
26
+ * into the declaration the same way.
27
+ *
28
+ * FIX: `GovernanceFunction`/`GovernanceRelationEdge` are LOCAL, structural declarations
29
+ * again (below) — the published `.d.ts` is fully self-contained, no kernel-client
30
+ * reference at all. Binding to kernel-client's canonical shape moved from "the type
31
+ * IS the import" to "a committed, compile-time DRIFT TEST" —
32
+ * `chain-classifier-kernel-client-drift.test.ts` (same directory) imports BOTH this
33
+ * file's local types AND kernel-client's `@productbrain/kernel-client/governance`
34
+ * originals and asserts mutual structural assignability; if either shape drifts without
35
+ * the other being updated to match, that test FAILS TO COMPILE — a real, enforced
36
+ * check, not the deleted pre-S3a "zero drift risk" comment's unverified promise. The
37
+ * drift test itself exports nothing, so ITS declaration carries no kernel-client
38
+ * reference either (verified: `npm pack --dry-run` shows an empty/no-op `.d.ts` for it).
39
+ *
40
+ * `@productbrain/kernel-client/governance` (the subpath added in S3a) still exists and
41
+ * is still useful — it's now the drift test's comparison source, and remains available
42
+ * for any FUTURE consumer that can afford a kernel-client type dependency (mcp-server,
43
+ * which never ships declarations at all — it bundles via tsup, not `tsc -d`).
44
+ *
45
+ * `GovernanceEntryInput`/`GovernanceCollectionInput`/`ClassifiedGovernance` below remain
46
+ * hand-declared (never re-exported from kernel-client — same self-contained-declaration
47
+ * reasoning now applies to them too, not just out of scope).
14
48
  *
15
49
  * Chain: BET-286 (Chain-Derived Agent Configuration), TEN-2733, TEN-2705
16
50
  */
@@ -1 +1 @@
1
- {"version":3,"file":"chain-classifier.js","sourceRoot":"","sources":["../../src/generators/chain-classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
1
+ {"version":3,"file":"chain-classifier.js","sourceRoot":"","sources":["../../src/generators/chain-classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@productbrain/cli",
3
- "version": "0.1.0-beta.2378",
3
+ "version": "0.1.0-beta.2394",
4
4
  "description": "Product Brain — Chain knowledge and write-back CLI",
5
5
  "type": "module",
6
6
  "bin": {