@c4a/extract-rush 0.6.18 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +24 -5
  2. package/README.zh-CN.md +20 -4
  3. package/index.js +5722 -136
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -4,8 +4,8 @@
4
4
 
5
5
  `@c4a/extract-rush` creates a deterministic structural index of a Rush
6
6
  workspace. It reports project identity, tags, subspaces, publish intent, entry
7
- signals, local dependency edges, decoupled dependencies, and nearest `OWNERS`
8
- boundaries.
7
+ signals, direct dependency/consumer edges, build phases and commands, release
8
+ units, decoupled dependencies, and nearest `OWNERS` boundaries.
9
9
 
10
10
  The index is evidence for a Context knowledge project; it is not a product
11
11
  taxonomy. A project decides which facts matter to its audience and maps them to
@@ -17,7 +17,7 @@ candidate freshness, review, approved knowledge, and package output.
17
17
  ```text
18
18
  confirmed Rush repository boundary
19
19
 
20
- rush.json + package.json + OWNERS facts
20
+ rush.json + package.json + Rush config + OWNERS facts
21
21
 
22
22
  project-owned candidate mapping
23
23
 
@@ -27,11 +27,16 @@ reviewed architecture / ownership / package knowledge
27
27
  ## Usage
28
28
 
29
29
  ```ts
30
- import { indexRushWorkspace } from "@c4a/extract-rush";
30
+ import {
31
+ indexRushWorkspace,
32
+ rushWorkspaceIndexToEvidenceAdapterResult,
33
+ } from "@c4a/extract-rush";
31
34
 
32
35
  const facts = await indexRushWorkspace(repositoryRoot, {
33
36
  tags: ["frontend"],
34
37
  });
38
+
39
+ const evidence = rushWorkspaceIndexToEvidenceAdapterResult(facts, invocation);
35
40
  ```
36
41
 
37
42
  With no tag filter, all projects are selected. `includeAll: true` explicitly
@@ -43,12 +48,26 @@ The index includes:
43
48
  - Rush and package-manager versions;
44
49
  - package names and whether `package.json` identity matches `rush.json`;
45
50
  - project folders, subspaces, tags, and publish flags;
51
+ - the registered subspace catalog and project membership;
46
52
  - `main`, `module`, `types`, `exports`, and `bin` entry signals;
47
- - local dependency kinds and specifiers, including decoupled edges;
53
+ - local dependency kinds, direct consumers, and specifiers, including
54
+ decoupled edges;
55
+ - phased-build dependencies, command-to-phase bindings, and per-project phase
56
+ implementation presence;
57
+ - lock-step, individual-policy, and standalone release units;
48
58
  - nearest repository-relative `OWNERS` file and normalized reviewers.
49
59
 
60
+ Build facts retain command and script identity only as content digests. The
61
+ index and Evidence ABI never copy raw shell commands or package scripts into
62
+ facts.
63
+
50
64
  This optional package does not add a public Agent entry or Context lifecycle
51
65
  phase. It remains a reusable structural library for project adapters.
66
+ The Evidence ABI conversion assigns one primary owner to each `rush.json`,
67
+ selected `package.json`, and `OWNERS` input, binds project files to authorized
68
+ module refs, and publishes workspace/project/dependency/owner facts as catalog
69
+ protocol items. `subspaces.json`, `command-line.json`, and
70
+ `version-policies.json` become separately owned evidence files when present.
52
71
 
53
72
  ## Development
54
73
 
package/README.zh-CN.md CHANGED
@@ -3,7 +3,8 @@
3
3
  [English](./README.md)
4
4
 
5
5
  `@c4a/extract-rush` 为 Rush 工作区生成确定性结构索引。它报告项目身份、标签、
6
- subspace、发布意图、入口信号、本地依赖边、解耦依赖和最近的 `OWNERS` 边界。
6
+ subspace、发布意图、入口信号、直接依赖/消费者边、构建 phase/command、发布单元、解耦依赖和
7
+ 最近的 `OWNERS` 边界。
7
8
 
8
9
  这些索引是 Context 知识项目的证据,不是产品分类。项目决定哪些事实对目标读者有
9
10
  价值,并通过 `extractCustom()` 映射为候选;来源身份、候选新鲜度、审核、正式知识
@@ -14,7 +15,7 @@ subspace、发布意图、入口信号、本地依赖边、解耦依赖和最近
14
15
  ```text
15
16
  已确认的 Rush 仓库边界
16
17
 
17
- rush.json + package.json + OWNERS 事实
18
+ rush.json + package.json + Rush 配置 + OWNERS 事实
18
19
 
19
20
  项目自有候选映射
20
21
 
@@ -24,11 +25,16 @@ rush.json + package.json + OWNERS 事实
24
25
  ## 使用
25
26
 
26
27
  ```ts
27
- import { indexRushWorkspace } from "@c4a/extract-rush";
28
+ import {
29
+ indexRushWorkspace,
30
+ rushWorkspaceIndexToEvidenceAdapterResult,
31
+ } from "@c4a/extract-rush";
28
32
 
29
33
  const facts = await indexRushWorkspace(repositoryRoot, {
30
34
  tags: ["frontend"],
31
35
  });
36
+
37
+ const evidence = rushWorkspaceIndexToEvidenceAdapterResult(facts, invocation);
32
38
  ```
33
39
 
34
40
  不提供 tag filter 时选择所有项目;`includeAll: true` 也会显式选择全部项目。结果
@@ -39,12 +45,22 @@ const facts = await indexRushWorkspace(repositoryRoot, {
39
45
  - Rush 和 package manager 版本;
40
46
  - package 名,以及 `package.json` 身份是否与 `rush.json` 一致;
41
47
  - project folder、subspace、tag 和 publish flag;
48
+ - 已登记的 subspace 目录及项目成员;
42
49
  - `main`、`module`、`types`、`exports` 和 `bin` 入口信号;
43
- - 本地依赖类型和 specifier,包括 decoupled edge;
50
+ - 本地依赖类型、直接消费者和 specifier,包括 decoupled edge;
51
+ - phased build 依赖、command 到 phase 的绑定,以及各项目是否实现 phase;
52
+ - lock-step、individual-policy 和 standalone 发布单元;
44
53
  - 最近的 repo-relative `OWNERS` 文件和标准化 reviewer。
45
54
 
55
+ 构建事实只通过内容摘要保留 command/script 身份;结构索引与 Evidence ABI 均不复制原始 shell
56
+ command 或 package script。
57
+
46
58
  这个可选包不会增加公开 Agent 入口或 Context 生命周期阶段,只作为项目 Adapter
47
59
  可以复用的结构库。
60
+ Evidence ABI 转换为每个 `rush.json`、已选择的 `package.json` 和 `OWNERS` 输入指定唯一
61
+ primary owner,把项目文件绑定到授权 module ref,并将 workspace/project/dependency/owner
62
+ 事实作为 catalog protocol item 发布。存在 `subspaces.json`、`command-line.json` 和
63
+ `version-policies.json` 时,它们分别成为具有唯一 owner 的 evidence 文件。
48
64
 
49
65
  ## 开发
50
66