@c4a/context-cli 0.6.17 → 0.6.19
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/README.md +6 -2
- package/README.zh-CN.md +5 -2
- package/cli.js +11452 -7269
- package/docs/document-optimization.md +35 -11
- package/docs/document-optimization.zh-CN.md +29 -9
- package/package.json +2 -2
- package/plugins/VERSION +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/commands/context.md +44 -6
- package/plugins/codex/.codex-plugin/plugin.json +2 -2
- package/plugins/codex/skills/context/SKILL.md +44 -6
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/plugins/cursor/commands/c4a-context.md +44 -6
- package/plugins/skills/c4a-context/SKILL.md +44 -6
- package/providers/context/actions/apply-code-index-guidance.yaml +5 -0
- package/providers/context/actions/apply-forced-review.yaml +5 -0
- package/providers/context/actions/maintain-evidence.yaml +1 -1
- package/providers/context/actions/migrate-codeindex.yaml +5 -0
- package/providers/context/actions/register-source-batch.yaml +1 -1
- package/providers/context/actions/restore-repository-sources.yaml +1 -1
- package/providers/context/actions/revise-code-index-audit.yaml +5 -0
- package/providers/context/actions/submit-code-index-audit.yaml +6 -0
- package/providers/context/codes.yaml +5 -0
- package/providers/context/graphs/workspace.yaml +82 -2
- package/providers/context/manifest.json +128 -56
- package/providers/context/provider.yaml +1 -1
- package/providers/context/resources/dialogue/code-extraction.md +12 -0
- package/providers/context/resources/dialogue/document-classification.md +1 -1
- package/providers/context/resources/dialogue/knowledge-review.md +16 -1
- package/providers/context/resources/dialogue/source-boundary.md +9 -1
- package/providers/context/resources/dialogue/workflow-mode-after-capture.md +11 -8
- package/providers/context/resources/dialogue/workflow-mode-after-creation.md +6 -4
- package/providers/context/resources/manuals/guides/lark-resources.md +7 -0
- package/providers/context/resources/manuals/guides/package-outputs.md +3 -3
- package/providers/context/resources/manuals/reference/code-extractors.md +5 -4
- package/providers/context/resources/manuals/reference/package-templates.md +18 -10
- package/providers/context/resources/manuals/reference/project-api.md +56 -24
- package/providers/context/resources/procedures/close-and-build.md +26 -3
- package/providers/context/resources/procedures/code-extraction.md +45 -7
- package/providers/context/resources/procedures/code-index-audit.md +83 -0
- package/providers/context/resources/procedures/document-capture.md +9 -0
- package/providers/context/resources/procedures/document-optimization.md +69 -21
- package/providers/context/resources/procedures/document-revision.md +11 -6
- package/providers/context/resources/procedures/knowledge-review.md +10 -1
- package/providers/context/resources/procedures/source-boundary.md +20 -8
- package/providers/context/resources/semantic/align/structure-planning.md +4 -4
- package/providers/context/resources/semantic/code-index/classification.md +8 -5
- package/providers/context/resources/views/code-index-audit.yaml +6 -0
- package/providers/context/schemas/code-index-audit-decision.schema.json +94 -0
- package/providers/context/schemas/document-optimization-decisions.schema.json +29 -6
- package/providers/context/schemas/source-batch-input.schema.json +18 -3
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# Document revisions
|
|
2
2
|
|
|
3
|
-
New workspaces enable
|
|
4
|
-
build phase for source-backed prose that
|
|
5
|
-
|
|
6
|
-
broadly rewriting its meaning.
|
|
3
|
+
New workspaces enable source-constrained editorial revision by default. It is a
|
|
4
|
+
build phase for source-backed prose that improves publication value and
|
|
5
|
+
readability without changing the approved knowledge page or inventing facts.
|
|
7
6
|
|
|
8
7
|
To opt out during initialization:
|
|
9
8
|
|
|
@@ -19,9 +18,22 @@ context optimize-docs disable
|
|
|
19
18
|
context status --format json
|
|
20
19
|
```
|
|
21
20
|
|
|
22
|
-
When enabled, the workflow plans only new or changed
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
When enabled, the workflow plans only new or changed source Sections. For each
|
|
22
|
+
Section the CLI reports mechanical signals and allowed actions. The Agent may
|
|
23
|
+
keep it, repair local presentation, reshape it within the same source boundary,
|
|
24
|
+
or omit it when the CLI confirms a non-knowledge reason. Only changed pages
|
|
25
|
+
receive a full revision beside their approved page:
|
|
26
|
+
|
|
27
|
+
Signals are review leads rather than a complete readability verdict. The Agent
|
|
28
|
+
must read every Section. Keeping a signaled Section requires a concrete,
|
|
29
|
+
decision-only assessment explaining why each signal is a false positive or why
|
|
30
|
+
editing would reduce source fidelity. The assessment names every reported
|
|
31
|
+
signal code so the CLI can verify complete coverage; it is never published.
|
|
32
|
+
Time, cost, workload, batch size, or delivery pressure are not valid keep or
|
|
33
|
+
defer reasons. Fully managed operation applies all safe repairs, reshapes, and
|
|
34
|
+
eligible omissions autonomously; only genuinely unavailable semantic input is
|
|
35
|
+
batched for the user. A large fragment set must meet the same quality standard
|
|
36
|
+
as a single fragment.
|
|
25
37
|
|
|
26
38
|
```text
|
|
27
39
|
knowledge/guides/setup.md
|
|
@@ -32,10 +44,21 @@ The `__revision.md` suffix is reserved. Default knowledge discovery, structure,
|
|
|
32
44
|
search, and package selection exclude revision files. Validation and build
|
|
33
45
|
associate a revision with its sibling base page and apply it under the original
|
|
34
46
|
package path. A revision stores only the base digest that cannot be inferred;
|
|
35
|
-
its path and revised
|
|
47
|
+
its path and revised Sections are derived. Unchanged Sections inside a full
|
|
36
48
|
revision are inferred. A page with no changes stores only one derived negative
|
|
37
49
|
cache key below `.tmp/context-runtime/document-optimization/`; replacement
|
|
38
|
-
prose and
|
|
50
|
+
prose and Section metadata are not duplicated there.
|
|
51
|
+
|
|
52
|
+
Typical repair candidates are Markdown syntax, spacing, empty table rows, and
|
|
53
|
+
descriptive labels for links whose purpose is already present. Reshape handles
|
|
54
|
+
wide tables, long cells, mixed images and links, or long prose by creating a
|
|
55
|
+
clearer structure inside the same Section. Unanswered question sets, empty
|
|
56
|
+
placeholders, decision-free drafts, duplicates, and obsolete-only Sections may
|
|
57
|
+
be omitted. Questions with answers, limitations with an action, and
|
|
58
|
+
deprecations with a replacement remain knowledge. Link targets, images, code,
|
|
59
|
+
commands, numbers, identifiers, conditions, and source references are protected
|
|
60
|
+
through validation. Ambiguous currency, ownership, or sensitive values appear
|
|
61
|
+
together in the plan's `input_requests` and require one batched user decision.
|
|
39
62
|
|
|
40
63
|
After capture, review, or build, a user may ask conversationally to correct one
|
|
41
64
|
existing knowledge page. Start the correction by title, approved path, or
|
|
@@ -47,8 +70,9 @@ context revise "<title, approved path, or ViewRef>" --format json
|
|
|
47
70
|
|
|
48
71
|
Context starts `route.document-revision.requested` only after resolving one
|
|
49
72
|
page. Ambiguous requests return candidates instead of guessing. Edit
|
|
50
|
-
reader-visible prose
|
|
51
|
-
|
|
73
|
+
reader-visible prose within existing `context:section` boundaries without
|
|
74
|
+
changing provenance or protected values, then run `context optimize-docs
|
|
75
|
+
validate`. A valid correction ends
|
|
52
76
|
the request and the next Route offers a package build when output is stale. If
|
|
53
77
|
broad document optimization was disabled, this entry activates only the target
|
|
54
78
|
page and keeps every other eligible page out of the pending batch. If upstream
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# 文档修订页
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
新工作区默认开启来源约束的编辑修订。它是面向来源可追溯正文的构建阶段,在不修改
|
|
4
|
+
正式知识页、不补写事实的前提下,提高发布内容的知识价值和可读性。
|
|
5
5
|
|
|
6
6
|
初始化时如需关闭:
|
|
7
7
|
|
|
@@ -17,8 +17,9 @@ context optimize-docs disable
|
|
|
17
17
|
context status --format json
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
开启后,工作流只规划新增或发生变化的来源 Section。CLI 为每个 Section 枚举机械
|
|
21
|
+
信号和允许动作;Agent 可以保持不变、局部修复、在同一来源边界内重排,或在 CLI
|
|
22
|
+
确认其属于无知识价值内容时省略。只有实际变化的页面才在原文旁生成完整修订页:
|
|
22
23
|
|
|
23
24
|
```text
|
|
24
25
|
knowledge/guides/setup.md
|
|
@@ -27,9 +28,28 @@ knowledge/guides/setup__revision.md
|
|
|
27
28
|
|
|
28
29
|
`__revision.md` 是保留后缀。默认知识发现、结构、检索和包选择都排除修订页;
|
|
29
30
|
校验和构建根据文件名把它关联回同目录原文,并仍按原文件名输出。修订页只额外
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
记录无法推导的原文摘要;原文路径和修订 Section 由文件名与正文差异推导。完整修订
|
|
32
|
+
页中未变化的 Section 直接推导为 `keep`;整页都不修改时,运行时只保存一个页级负
|
|
33
|
+
缓存键,不重复保存改写正文或 Section 元数据。
|
|
34
|
+
|
|
35
|
+
局部修复适用于 Markdown、空白、空表格行,以及来源已经说明用途的链接名称。结构
|
|
36
|
+
重排适用于宽表格、长单元格、图片与链接混排或过长段落,但不能跨 Section 搬运事实。
|
|
37
|
+
未回答的问题集合、空占位、没有结论的草稿、重复内容和只有旧稿的 Section 可以省略;
|
|
38
|
+
有答案的问句、有影响和动作的限制、带替代方案的废弃说明仍属于知识。链接目标、图片、
|
|
39
|
+
代码、命令、数字、标识符、条件和来源引用由 CLI 机械保护。事实时效、职责或敏感值不
|
|
40
|
+
明确时,CLI 会把相关 Section 集中列入计划的 `input_requests`,工作流只询问用户一次,
|
|
41
|
+
不会自动省略。
|
|
42
|
+
|
|
43
|
+
机械信号只是审阅线索,不代表最终结论,也不是完整的可读性检查。Agent 必须阅读每个
|
|
44
|
+
Section;若对带信号的 Section 选择 `keep`,需要在本次决策中逐段说明信号为何误报,
|
|
45
|
+
或修改为何会损害来源忠实度,并在说明中逐一写出对应的信号 code,供 CLI 机械核对覆盖
|
|
46
|
+
是否完整。CLI 会拒绝没有具体说明或漏掉信号的 `keep`,但这段说明只用于当前决策审计,
|
|
47
|
+
不会写入正式知识、修订页或构建产物。部分信号误报也不能成为整批保持不变的理由。
|
|
48
|
+
|
|
49
|
+
时间、成本、工作量、批次规模或赶进度都不是 `keep`、跳过或延期的有效理由。全托管
|
|
50
|
+
模式下,Agent 应自动完成所有安全的局部修复、结构重排和允许省略,直到当前批次收敛;
|
|
51
|
+
只有确实无法从当前 Section 或来源证据取得的语义信息,才集中向用户询问一次。片段多
|
|
52
|
+
不能降低质量标准,也不能把整批默认判为 `keep`。
|
|
33
53
|
|
|
34
54
|
工作区采集、审核或构建完成后,用户可以直接通过对话要求修正某篇知识。Agent
|
|
35
55
|
先使用标题、正式知识路径或 ViewRef 启动修订:
|
|
@@ -40,8 +60,8 @@ context revise "<标题、正式知识路径或 ViewRef>" --format json
|
|
|
40
60
|
|
|
41
61
|
CLI 只在目标唯一时创建或复用该页修订,并由 Agent Graph 返回
|
|
42
62
|
`route.document-revision.requested`。若有多个候选,Agent 必须依据当前对话选定,
|
|
43
|
-
否则询问用户。Agent
|
|
44
|
-
|
|
63
|
+
否则询问用户。Agent 只在已有 `context:section` 内编辑面向读者的正文,不修改来源
|
|
64
|
+
信息、Section 边界和受保护值,随后运行 `context optimize-docs validate`。校验成功后,
|
|
45
65
|
请求自动结束;若产物因此过期,下一条 Route 会直接提示重新构建。即使工作区
|
|
46
66
|
此前关闭了整库文档编译优化,这个入口也只激活目标页面,不会让其他页面进入
|
|
47
67
|
待优化队列。上游内容变化后,旧修订页会成为冲突,不会被静默应用。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c4a/context-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local runtime and Agent integration for traceable knowledge production",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@c4a/agent-graph": "0.2.6",
|
|
27
|
-
"@c4a/context": "0.6.
|
|
27
|
+
"@c4a/context": "0.6.19",
|
|
28
28
|
"commander": "^11.0.0",
|
|
29
29
|
"fast-xml-parser": "^5.10.1",
|
|
30
30
|
"handlebars": "^4.7.8",
|
package/plugins/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.6.
|
|
1
|
+
0.6.19
|
|
@@ -26,6 +26,18 @@ Run:
|
|
|
26
26
|
context entry [project-dir] --language <language> --format json
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
If the request does not already choose ordinary review or fully managed
|
|
30
|
+
operation, first use the read-only entry result to state a short execution
|
|
31
|
+
plan, then ask the user to choose once. Explain that ordinary review pauses at
|
|
32
|
+
human Gates and presents HTML reports, while fully managed operation resolves
|
|
33
|
+
delegatable Gates within this conversation but still stops for permissions,
|
|
34
|
+
hard validation, or non-delegatable decisions. Prefer the host's native choice
|
|
35
|
+
UI. When initialization already needs a confirmation or missing option, combine
|
|
36
|
+
the mode choice with that question instead of adding another round. Keep the
|
|
37
|
+
answer only in this conversation and do not ask again after initialization,
|
|
38
|
+
capture, or resume. An explicit request for review, human confirmation, fully
|
|
39
|
+
managed work, or no further review already resolves this choice.
|
|
40
|
+
|
|
29
41
|
Use the user's explicit language choice when present; otherwise pass `zh-CN`
|
|
30
42
|
for a Chinese conversation and `en` for an English conversation. Pass
|
|
31
43
|
`project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
|
|
@@ -91,12 +103,14 @@ before workflow evaluation. Debugging records traces below
|
|
|
91
103
|
source evidence.
|
|
92
104
|
|
|
93
105
|
Document optimization is enabled by default for newly initialized workspaces.
|
|
94
|
-
It
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
106
|
+
It performs source-constrained editorial revision: the CLI identifies
|
|
107
|
+
readability and knowledge-value signals, and the Agent may keep, repair,
|
|
108
|
+
reshape, or safely omit content only inside its existing source Section. It
|
|
109
|
+
must preserve facts, link targets, images, code, numbers, identifiers, and
|
|
110
|
+
source evidence. Approved pages remain source-faithful; only changed full-page
|
|
111
|
+
revisions are stored beside them as `knowledge/**/*__revision.md`. Default
|
|
112
|
+
knowledge discovery excludes those reserved sidecars, and internal editorial
|
|
113
|
+
audit state is not included in package output.
|
|
100
114
|
|
|
101
115
|
For an existing workspace, respect its current `package.json` setting. Run
|
|
102
116
|
`context optimize-docs enable` or `context optimize-docs disable` only when the
|
|
@@ -123,6 +137,14 @@ The managed loop executes only Route-selected work and returns the current
|
|
|
123
137
|
host execution, diagnostics, or a non-unique plan needs attention. Resume from
|
|
124
138
|
that returned Route; never reconstruct a command from an earlier step.
|
|
125
139
|
|
|
140
|
+
Code knowledge is published under `codeindex`. Context mechanically audits each
|
|
141
|
+
module's input analysis, stable boundaries, facts, explanation, evidence scope,
|
|
142
|
+
and page shape without producing a total score. In fully managed operation,
|
|
143
|
+
follow returned repair actions automatically; after three failed revisions of
|
|
144
|
+
the same module problem, stop at the one aggregated human-guidance Gate. If a
|
|
145
|
+
legacy workspace returns `route.extract.codeindex-migration-required`, execute
|
|
146
|
+
only its migration command; do not rename `codegraph` paths manually.
|
|
147
|
+
|
|
126
148
|
### Follow the current Route
|
|
127
149
|
|
|
128
150
|
Treat `workflow.current` as the current-step authority:
|
|
@@ -139,6 +161,11 @@ Treat `workflow.current` as the current-step authority:
|
|
|
139
161
|
`inspection_action` resource only while inspecting the decision, and read a
|
|
140
162
|
`resolution_action` resource only after the user confirms the Gate. Neither
|
|
141
163
|
replaces ordinary required resources.
|
|
164
|
+
For ordinary Knowledge Review, follow the Route-selected dialogue: do not
|
|
165
|
+
advertise force approval in the initial prompt. If the user cannot access
|
|
166
|
+
the report, only their exact current-conversation reply `强制批准` authorizes
|
|
167
|
+
the returned force-approval resolution command; generic approval wording
|
|
168
|
+
does not.
|
|
142
169
|
3. Execute only `commands` returned by the Route, preserving revision and
|
|
143
170
|
authority flags exactly. A command marked `after-human-confirmation` waits
|
|
144
171
|
for the current Gate decision. Run a command whose `execution.target` is `agent-host`
|
|
@@ -146,6 +173,9 @@ Treat `workflow.current` as the current-step authority:
|
|
|
146
173
|
not inside a restricted child sandbox. Follow the Route-selected procedure
|
|
147
174
|
for its audit and approval contract; never invent a payload, destination, or
|
|
148
175
|
substitute command.
|
|
176
|
+
A Context command is complete only after its process returns an exit code and
|
|
177
|
+
receipt. If the host reports that it is still running, keep polling that same
|
|
178
|
+
invocation; never start a second Context write command in parallel.
|
|
149
179
|
Treat a code-extraction batch preview as one Route action. Read its complete
|
|
150
180
|
index-unit report and keep same-kind capability or scale decisions in the
|
|
151
181
|
single returned Gate; do not ask about modules one by one. A non-delegatable
|
|
@@ -160,6 +190,14 @@ Explain, ask, confirm, and summarize in the user's current conversation
|
|
|
160
190
|
language. Keep commands, flags, paths, ids, status values, JSONL keys,
|
|
161
191
|
`source_ref` values, and copied CLI tokens unchanged.
|
|
162
192
|
|
|
193
|
+
Keep a conversation-local list of HTML review reports that the user actually
|
|
194
|
+
used to make a review decision. Preserve each exact report URL or local path
|
|
195
|
+
and its reviewed scope when the Route provides them. In the final completion
|
|
196
|
+
summary, include one compact `Review reports` section containing those exact
|
|
197
|
+
references. Do not scan workspace internals to reconstruct the list, persist a
|
|
198
|
+
second ledger, invent a public URL, or describe an inaccessible report or a
|
|
199
|
+
fully managed/force approval as user-reviewed.
|
|
200
|
+
|
|
163
201
|
When the user explicitly asks to publish a completed build, treat publication
|
|
164
202
|
as a downstream distribution step outside the Context Route. Use only an
|
|
165
203
|
explicitly installed distribution tool and its documented complete-output
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c4a",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.19",
|
|
4
4
|
"description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "c4a"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"skills": "./skills/",
|
|
19
19
|
"interface": {
|
|
20
20
|
"displayName": "C4A Context",
|
|
21
|
-
"shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.
|
|
21
|
+
"shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.19",
|
|
22
22
|
"longDescription": "Create a Context workspace and use agent-guided next steps to register sources, run extraction, review candidates, build package outputs, and verify health without silently mutating source repositories.",
|
|
23
23
|
"developerName": "c4a",
|
|
24
24
|
"category": "Productivity",
|
|
@@ -38,6 +38,18 @@ Run:
|
|
|
38
38
|
context entry [project-dir] --language <language> --format json
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
If the request does not already choose ordinary review or fully managed
|
|
42
|
+
operation, first use the read-only entry result to state a short execution
|
|
43
|
+
plan, then ask the user to choose once. Explain that ordinary review pauses at
|
|
44
|
+
human Gates and presents HTML reports, while fully managed operation resolves
|
|
45
|
+
delegatable Gates within this conversation but still stops for permissions,
|
|
46
|
+
hard validation, or non-delegatable decisions. Prefer the host's native choice
|
|
47
|
+
UI. When initialization already needs a confirmation or missing option, combine
|
|
48
|
+
the mode choice with that question instead of adding another round. Keep the
|
|
49
|
+
answer only in this conversation and do not ask again after initialization,
|
|
50
|
+
capture, or resume. An explicit request for review, human confirmation, fully
|
|
51
|
+
managed work, or no further review already resolves this choice.
|
|
52
|
+
|
|
41
53
|
Use the user's explicit language choice when present; otherwise pass `zh-CN`
|
|
42
54
|
for a Chinese conversation and `en` for an English conversation. Pass
|
|
43
55
|
`project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
|
|
@@ -103,12 +115,14 @@ before workflow evaluation. Debugging records traces below
|
|
|
103
115
|
source evidence.
|
|
104
116
|
|
|
105
117
|
Document optimization is enabled by default for newly initialized workspaces.
|
|
106
|
-
It
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
118
|
+
It performs source-constrained editorial revision: the CLI identifies
|
|
119
|
+
readability and knowledge-value signals, and the Agent may keep, repair,
|
|
120
|
+
reshape, or safely omit content only inside its existing source Section. It
|
|
121
|
+
must preserve facts, link targets, images, code, numbers, identifiers, and
|
|
122
|
+
source evidence. Approved pages remain source-faithful; only changed full-page
|
|
123
|
+
revisions are stored beside them as `knowledge/**/*__revision.md`. Default
|
|
124
|
+
knowledge discovery excludes those reserved sidecars, and internal editorial
|
|
125
|
+
audit state is not included in package output.
|
|
112
126
|
|
|
113
127
|
For an existing workspace, respect its current `package.json` setting. Run
|
|
114
128
|
`context optimize-docs enable` or `context optimize-docs disable` only when the
|
|
@@ -135,6 +149,14 @@ The managed loop executes only Route-selected work and returns the current
|
|
|
135
149
|
host execution, diagnostics, or a non-unique plan needs attention. Resume from
|
|
136
150
|
that returned Route; never reconstruct a command from an earlier step.
|
|
137
151
|
|
|
152
|
+
Code knowledge is published under `codeindex`. Context mechanically audits each
|
|
153
|
+
module's input analysis, stable boundaries, facts, explanation, evidence scope,
|
|
154
|
+
and page shape without producing a total score. In fully managed operation,
|
|
155
|
+
follow returned repair actions automatically; after three failed revisions of
|
|
156
|
+
the same module problem, stop at the one aggregated human-guidance Gate. If a
|
|
157
|
+
legacy workspace returns `route.extract.codeindex-migration-required`, execute
|
|
158
|
+
only its migration command; do not rename `codegraph` paths manually.
|
|
159
|
+
|
|
138
160
|
### Follow the current Route
|
|
139
161
|
|
|
140
162
|
Treat `workflow.current` as the current-step authority:
|
|
@@ -151,6 +173,11 @@ Treat `workflow.current` as the current-step authority:
|
|
|
151
173
|
`inspection_action` resource only while inspecting the decision, and read a
|
|
152
174
|
`resolution_action` resource only after the user confirms the Gate. Neither
|
|
153
175
|
replaces ordinary required resources.
|
|
176
|
+
For ordinary Knowledge Review, follow the Route-selected dialogue: do not
|
|
177
|
+
advertise force approval in the initial prompt. If the user cannot access
|
|
178
|
+
the report, only their exact current-conversation reply `强制批准` authorizes
|
|
179
|
+
the returned force-approval resolution command; generic approval wording
|
|
180
|
+
does not.
|
|
154
181
|
3. Execute only `commands` returned by the Route, preserving revision and
|
|
155
182
|
authority flags exactly. A command marked `after-human-confirmation` waits
|
|
156
183
|
for the current Gate decision. Run a command whose `execution.target` is `agent-host`
|
|
@@ -158,6 +185,9 @@ Treat `workflow.current` as the current-step authority:
|
|
|
158
185
|
not inside a restricted child sandbox. Follow the Route-selected procedure
|
|
159
186
|
for its audit and approval contract; never invent a payload, destination, or
|
|
160
187
|
substitute command.
|
|
188
|
+
A Context command is complete only after its process returns an exit code and
|
|
189
|
+
receipt. If the host reports that it is still running, keep polling that same
|
|
190
|
+
invocation; never start a second Context write command in parallel.
|
|
161
191
|
Treat a code-extraction batch preview as one Route action. Read its complete
|
|
162
192
|
index-unit report and keep same-kind capability or scale decisions in the
|
|
163
193
|
single returned Gate; do not ask about modules one by one. A non-delegatable
|
|
@@ -172,6 +202,14 @@ Explain, ask, confirm, and summarize in the user's current conversation
|
|
|
172
202
|
language. Keep commands, flags, paths, ids, status values, JSONL keys,
|
|
173
203
|
`source_ref` values, and copied CLI tokens unchanged.
|
|
174
204
|
|
|
205
|
+
Keep a conversation-local list of HTML review reports that the user actually
|
|
206
|
+
used to make a review decision. Preserve each exact report URL or local path
|
|
207
|
+
and its reviewed scope when the Route provides them. In the final completion
|
|
208
|
+
summary, include one compact `Review reports` section containing those exact
|
|
209
|
+
references. Do not scan workspace internals to reconstruct the list, persist a
|
|
210
|
+
second ledger, invent a public URL, or describe an inaccessible report or a
|
|
211
|
+
fully managed/force approval as user-reviewed.
|
|
212
|
+
|
|
175
213
|
When the user explicitly asks to publish a completed build, treat publication
|
|
176
214
|
as a downstream distribution step outside the Context Route. Use only an
|
|
177
215
|
explicitly installed distribution tool and its documented complete-output
|
|
@@ -30,6 +30,18 @@ Run:
|
|
|
30
30
|
context entry [project-dir] --language <language> --format json
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
If the request does not already choose ordinary review or fully managed
|
|
34
|
+
operation, first use the read-only entry result to state a short execution
|
|
35
|
+
plan, then ask the user to choose once. Explain that ordinary review pauses at
|
|
36
|
+
human Gates and presents HTML reports, while fully managed operation resolves
|
|
37
|
+
delegatable Gates within this conversation but still stops for permissions,
|
|
38
|
+
hard validation, or non-delegatable decisions. Prefer the host's native choice
|
|
39
|
+
UI. When initialization already needs a confirmation or missing option, combine
|
|
40
|
+
the mode choice with that question instead of adding another round. Keep the
|
|
41
|
+
answer only in this conversation and do not ask again after initialization,
|
|
42
|
+
capture, or resume. An explicit request for review, human confirmation, fully
|
|
43
|
+
managed work, or no further review already resolves this choice.
|
|
44
|
+
|
|
33
45
|
Use the user's explicit language choice when present; otherwise pass `zh-CN`
|
|
34
46
|
for a Chinese conversation and `en` for an English conversation. Pass
|
|
35
47
|
`project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
|
|
@@ -95,12 +107,14 @@ before workflow evaluation. Debugging records traces below
|
|
|
95
107
|
source evidence.
|
|
96
108
|
|
|
97
109
|
Document optimization is enabled by default for newly initialized workspaces.
|
|
98
|
-
It
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
110
|
+
It performs source-constrained editorial revision: the CLI identifies
|
|
111
|
+
readability and knowledge-value signals, and the Agent may keep, repair,
|
|
112
|
+
reshape, or safely omit content only inside its existing source Section. It
|
|
113
|
+
must preserve facts, link targets, images, code, numbers, identifiers, and
|
|
114
|
+
source evidence. Approved pages remain source-faithful; only changed full-page
|
|
115
|
+
revisions are stored beside them as `knowledge/**/*__revision.md`. Default
|
|
116
|
+
knowledge discovery excludes those reserved sidecars, and internal editorial
|
|
117
|
+
audit state is not included in package output.
|
|
104
118
|
|
|
105
119
|
For an existing workspace, respect its current `package.json` setting. Run
|
|
106
120
|
`context optimize-docs enable` or `context optimize-docs disable` only when the
|
|
@@ -127,6 +141,14 @@ The managed loop executes only Route-selected work and returns the current
|
|
|
127
141
|
host execution, diagnostics, or a non-unique plan needs attention. Resume from
|
|
128
142
|
that returned Route; never reconstruct a command from an earlier step.
|
|
129
143
|
|
|
144
|
+
Code knowledge is published under `codeindex`. Context mechanically audits each
|
|
145
|
+
module's input analysis, stable boundaries, facts, explanation, evidence scope,
|
|
146
|
+
and page shape without producing a total score. In fully managed operation,
|
|
147
|
+
follow returned repair actions automatically; after three failed revisions of
|
|
148
|
+
the same module problem, stop at the one aggregated human-guidance Gate. If a
|
|
149
|
+
legacy workspace returns `route.extract.codeindex-migration-required`, execute
|
|
150
|
+
only its migration command; do not rename `codegraph` paths manually.
|
|
151
|
+
|
|
130
152
|
### Follow the current Route
|
|
131
153
|
|
|
132
154
|
Treat `workflow.current` as the current-step authority:
|
|
@@ -143,6 +165,11 @@ Treat `workflow.current` as the current-step authority:
|
|
|
143
165
|
`inspection_action` resource only while inspecting the decision, and read a
|
|
144
166
|
`resolution_action` resource only after the user confirms the Gate. Neither
|
|
145
167
|
replaces ordinary required resources.
|
|
168
|
+
For ordinary Knowledge Review, follow the Route-selected dialogue: do not
|
|
169
|
+
advertise force approval in the initial prompt. If the user cannot access
|
|
170
|
+
the report, only their exact current-conversation reply `强制批准` authorizes
|
|
171
|
+
the returned force-approval resolution command; generic approval wording
|
|
172
|
+
does not.
|
|
146
173
|
3. Execute only `commands` returned by the Route, preserving revision and
|
|
147
174
|
authority flags exactly. A command marked `after-human-confirmation` waits
|
|
148
175
|
for the current Gate decision. Run a command whose `execution.target` is `agent-host`
|
|
@@ -150,6 +177,9 @@ Treat `workflow.current` as the current-step authority:
|
|
|
150
177
|
not inside a restricted child sandbox. Follow the Route-selected procedure
|
|
151
178
|
for its audit and approval contract; never invent a payload, destination, or
|
|
152
179
|
substitute command.
|
|
180
|
+
A Context command is complete only after its process returns an exit code and
|
|
181
|
+
receipt. If the host reports that it is still running, keep polling that same
|
|
182
|
+
invocation; never start a second Context write command in parallel.
|
|
153
183
|
Treat a code-extraction batch preview as one Route action. Read its complete
|
|
154
184
|
index-unit report and keep same-kind capability or scale decisions in the
|
|
155
185
|
single returned Gate; do not ask about modules one by one. A non-delegatable
|
|
@@ -164,6 +194,14 @@ Explain, ask, confirm, and summarize in the user's current conversation
|
|
|
164
194
|
language. Keep commands, flags, paths, ids, status values, JSONL keys,
|
|
165
195
|
`source_ref` values, and copied CLI tokens unchanged.
|
|
166
196
|
|
|
197
|
+
Keep a conversation-local list of HTML review reports that the user actually
|
|
198
|
+
used to make a review decision. Preserve each exact report URL or local path
|
|
199
|
+
and its reviewed scope when the Route provides them. In the final completion
|
|
200
|
+
summary, include one compact `Review reports` section containing those exact
|
|
201
|
+
references. Do not scan workspace internals to reconstruct the list, persist a
|
|
202
|
+
second ledger, invent a public URL, or describe an inaccessible report or a
|
|
203
|
+
fully managed/force approval as user-reviewed.
|
|
204
|
+
|
|
167
205
|
When the user explicitly asks to publish a completed build, treat publication
|
|
168
206
|
as a downstream distribution step outside the Context Route. Use only an
|
|
169
207
|
explicitly installed distribution tool and its documented complete-output
|
|
@@ -38,6 +38,18 @@ Run:
|
|
|
38
38
|
context entry [project-dir] --language <language> --format json
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
If the request does not already choose ordinary review or fully managed
|
|
42
|
+
operation, first use the read-only entry result to state a short execution
|
|
43
|
+
plan, then ask the user to choose once. Explain that ordinary review pauses at
|
|
44
|
+
human Gates and presents HTML reports, while fully managed operation resolves
|
|
45
|
+
delegatable Gates within this conversation but still stops for permissions,
|
|
46
|
+
hard validation, or non-delegatable decisions. Prefer the host's native choice
|
|
47
|
+
UI. When initialization already needs a confirmation or missing option, combine
|
|
48
|
+
the mode choice with that question instead of adding another round. Keep the
|
|
49
|
+
answer only in this conversation and do not ask again after initialization,
|
|
50
|
+
capture, or resume. An explicit request for review, human confirmation, fully
|
|
51
|
+
managed work, or no further review already resolves this choice.
|
|
52
|
+
|
|
41
53
|
Use the user's explicit language choice when present; otherwise pass `zh-CN`
|
|
42
54
|
for a Chinese conversation and `en` for an English conversation. Pass
|
|
43
55
|
`project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
|
|
@@ -103,12 +115,14 @@ before workflow evaluation. Debugging records traces below
|
|
|
103
115
|
source evidence.
|
|
104
116
|
|
|
105
117
|
Document optimization is enabled by default for newly initialized workspaces.
|
|
106
|
-
It
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
118
|
+
It performs source-constrained editorial revision: the CLI identifies
|
|
119
|
+
readability and knowledge-value signals, and the Agent may keep, repair,
|
|
120
|
+
reshape, or safely omit content only inside its existing source Section. It
|
|
121
|
+
must preserve facts, link targets, images, code, numbers, identifiers, and
|
|
122
|
+
source evidence. Approved pages remain source-faithful; only changed full-page
|
|
123
|
+
revisions are stored beside them as `knowledge/**/*__revision.md`. Default
|
|
124
|
+
knowledge discovery excludes those reserved sidecars, and internal editorial
|
|
125
|
+
audit state is not included in package output.
|
|
112
126
|
|
|
113
127
|
For an existing workspace, respect its current `package.json` setting. Run
|
|
114
128
|
`context optimize-docs enable` or `context optimize-docs disable` only when the
|
|
@@ -135,6 +149,14 @@ The managed loop executes only Route-selected work and returns the current
|
|
|
135
149
|
host execution, diagnostics, or a non-unique plan needs attention. Resume from
|
|
136
150
|
that returned Route; never reconstruct a command from an earlier step.
|
|
137
151
|
|
|
152
|
+
Code knowledge is published under `codeindex`. Context mechanically audits each
|
|
153
|
+
module's input analysis, stable boundaries, facts, explanation, evidence scope,
|
|
154
|
+
and page shape without producing a total score. In fully managed operation,
|
|
155
|
+
follow returned repair actions automatically; after three failed revisions of
|
|
156
|
+
the same module problem, stop at the one aggregated human-guidance Gate. If a
|
|
157
|
+
legacy workspace returns `route.extract.codeindex-migration-required`, execute
|
|
158
|
+
only its migration command; do not rename `codegraph` paths manually.
|
|
159
|
+
|
|
138
160
|
### Follow the current Route
|
|
139
161
|
|
|
140
162
|
Treat `workflow.current` as the current-step authority:
|
|
@@ -151,6 +173,11 @@ Treat `workflow.current` as the current-step authority:
|
|
|
151
173
|
`inspection_action` resource only while inspecting the decision, and read a
|
|
152
174
|
`resolution_action` resource only after the user confirms the Gate. Neither
|
|
153
175
|
replaces ordinary required resources.
|
|
176
|
+
For ordinary Knowledge Review, follow the Route-selected dialogue: do not
|
|
177
|
+
advertise force approval in the initial prompt. If the user cannot access
|
|
178
|
+
the report, only their exact current-conversation reply `强制批准` authorizes
|
|
179
|
+
the returned force-approval resolution command; generic approval wording
|
|
180
|
+
does not.
|
|
154
181
|
3. Execute only `commands` returned by the Route, preserving revision and
|
|
155
182
|
authority flags exactly. A command marked `after-human-confirmation` waits
|
|
156
183
|
for the current Gate decision. Run a command whose `execution.target` is `agent-host`
|
|
@@ -158,6 +185,9 @@ Treat `workflow.current` as the current-step authority:
|
|
|
158
185
|
not inside a restricted child sandbox. Follow the Route-selected procedure
|
|
159
186
|
for its audit and approval contract; never invent a payload, destination, or
|
|
160
187
|
substitute command.
|
|
188
|
+
A Context command is complete only after its process returns an exit code and
|
|
189
|
+
receipt. If the host reports that it is still running, keep polling that same
|
|
190
|
+
invocation; never start a second Context write command in parallel.
|
|
161
191
|
Treat a code-extraction batch preview as one Route action. Read its complete
|
|
162
192
|
index-unit report and keep same-kind capability or scale decisions in the
|
|
163
193
|
single returned Gate; do not ask about modules one by one. A non-delegatable
|
|
@@ -172,6 +202,14 @@ Explain, ask, confirm, and summarize in the user's current conversation
|
|
|
172
202
|
language. Keep commands, flags, paths, ids, status values, JSONL keys,
|
|
173
203
|
`source_ref` values, and copied CLI tokens unchanged.
|
|
174
204
|
|
|
205
|
+
Keep a conversation-local list of HTML review reports that the user actually
|
|
206
|
+
used to make a review decision. Preserve each exact report URL or local path
|
|
207
|
+
and its reviewed scope when the Route provides them. In the final completion
|
|
208
|
+
summary, include one compact `Review reports` section containing those exact
|
|
209
|
+
references. Do not scan workspace internals to reconstruct the list, persist a
|
|
210
|
+
second ledger, invent a public URL, or describe an inaccessible report or a
|
|
211
|
+
fully managed/force approval as user-reviewed.
|
|
212
|
+
|
|
175
213
|
When the user explicitly asks to publish a completed build, treat publication
|
|
176
214
|
as a downstream distribution step outside the Context Route. Use only an
|
|
177
215
|
explicitly installed distribution tool and its documented complete-output
|
|
@@ -2,5 +2,5 @@ schema: agent-graph.action.v1
|
|
|
2
2
|
id: maintain-evidence
|
|
3
3
|
runner: command
|
|
4
4
|
effect: write
|
|
5
|
-
command: context review maintain --input - --format json
|
|
5
|
+
command: context review maintain --input .tmp/agent-payloads/evidence-maintenance.json --format json
|
|
6
6
|
inputSchema: schemas/evidence-maintenance-input.schema.json
|
|
@@ -3,5 +3,5 @@ id: register-source-batch
|
|
|
3
3
|
description: Register the source batch explicitly confirmed in the current conversation.
|
|
4
4
|
runner: command
|
|
5
5
|
effect: write
|
|
6
|
-
command: context source add batch --input - --format json
|
|
6
|
+
command: context source add batch --input .tmp/agent-payloads/source-batch.json --format json
|
|
7
7
|
inputSchema: schemas/source-batch-input.schema.json
|
|
@@ -3,5 +3,5 @@ id: restore-repository-sources
|
|
|
3
3
|
description: Restore registered repository sources from user-confirmed local paths or explicit clones.
|
|
4
4
|
runner: command
|
|
5
5
|
effect: external
|
|
6
|
-
command: context source restore --input - --format json
|
|
6
|
+
command: context source restore --input .tmp/agent-payloads/repository-source-recovery.json --format json
|
|
7
7
|
inputSchema: schemas/repository-source-recovery.schema.json
|