@c4a/context-cli 0.6.2 → 0.6.4

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 (50) hide show
  1. package/README.md +51 -3
  2. package/README.zh-CN.md +43 -3
  3. package/cli.js +32849 -28177
  4. package/docs/context-debug-event-v1.schema.json +31 -0
  5. package/docs/context-debug-replay-v1.schema.json +33 -0
  6. package/docs/debug-tracing.md +94 -0
  7. package/docs/quickstart.md +1 -1
  8. package/package.json +6 -3
  9. package/plugins/VERSION +1 -1
  10. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  11. package/plugins/claude/commands/continue.md +19 -14
  12. package/plugins/claude/commands/init.md +3 -1
  13. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  14. package/plugins/codex/skills/continue/SKILL.md +19 -14
  15. package/plugins/codex/skills/init/SKILL.md +2 -0
  16. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  17. package/plugins/cursor/commands/context-continue.md +19 -14
  18. package/plugins/cursor/commands/context-init.md +3 -1
  19. package/plugins/skills/context-continue/SKILL.md +19 -14
  20. package/plugins/skills/context-init/SKILL.md +2 -0
  21. package/providers/context/actions/inspect-code-extraction.yaml +5 -0
  22. package/providers/context/actions/inspect-repository-recovery.yaml +6 -0
  23. package/providers/context/actions/reconcile-review-identities.yaml +5 -0
  24. package/providers/context/actions/repair-verification.yaml +3 -3
  25. package/providers/context/actions/restore-repository-sources.yaml +7 -0
  26. package/providers/context/codes.yaml +2 -1
  27. package/providers/context/graphs/workspace.yaml +51 -8
  28. package/providers/context/manifest.json +126 -45
  29. package/providers/context/provider.yaml +1 -1
  30. package/providers/context/resources/dialogue/code-extraction.md +11 -0
  31. package/providers/context/resources/dialogue/package-output.md +9 -0
  32. package/providers/context/resources/dialogue/repository-source-recovery.md +23 -0
  33. package/providers/context/resources/manuals/guides/lark-resources.md +121 -0
  34. package/providers/context/resources/manuals/guides/package-outputs.md +22 -0
  35. package/providers/context/resources/manuals/reference/code-extractors.md +94 -0
  36. package/providers/context/resources/manuals/reference/package-templates.md +52 -0
  37. package/providers/context/resources/manuals/reference/project-api.md +78 -7
  38. package/providers/context/resources/procedures/close-and-build.md +5 -3
  39. package/providers/context/resources/procedures/code-extraction.md +23 -0
  40. package/providers/context/resources/procedures/document-capture.md +5 -1
  41. package/providers/context/resources/procedures/knowledge-review.md +10 -0
  42. package/providers/context/resources/procedures/package-output.md +21 -0
  43. package/providers/context/resources/procedures/repository-source-recovery.md +43 -0
  44. package/providers/context/resources/procedures/source-capture-detailed.md +13 -0
  45. package/providers/context/resources/procedures/verify-and-repair.md +12 -0
  46. package/providers/context/resources/semantic/align/gates.md +2 -2
  47. package/providers/context/resources/semantic/align/structure-planning.md +8 -3
  48. package/providers/context/resources/views/source-boundary.yaml +6 -0
  49. package/providers/context/schemas/repository-source-recovery.schema.json +40 -0
  50. package/providers/context/actions/ensure-repository-sources.yaml +0 -5
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://context4.ai/schemas/context-debug-event-v1.schema.json",
4
+ "title": "Context debug event v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema", "trace_id", "sequence", "at", "kind", "data"],
8
+ "properties": {
9
+ "schema": { "const": "context.debug.event.v1" },
10
+ "trace_id": { "type": "string", "minLength": 1 },
11
+ "sequence": { "type": "integer", "minimum": 1 },
12
+ "at": { "type": "string", "format": "date-time" },
13
+ "kind": {
14
+ "enum": [
15
+ "debug.enabled",
16
+ "debug.disabled",
17
+ "cli.invoked",
18
+ "cli.completed",
19
+ "agent-graph.evaluated",
20
+ "workflow.action-started",
21
+ "workflow.action-completed",
22
+ "workflow.scope-opened",
23
+ "workflow.scope-closed",
24
+ "workflow.stopped"
25
+ ]
26
+ },
27
+ "invocation_id": { "type": "string", "minLength": 1 },
28
+ "parent_invocation_id": { "type": "string", "minLength": 1 },
29
+ "data": { "type": "object" }
30
+ }
31
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://context4.ai/schemas/context-debug-replay-v1.schema.json",
4
+ "title": "Context debug replay v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema", "generated_at", "events", "transitions"],
8
+ "properties": {
9
+ "schema": { "const": "context.debug.replay.v1" },
10
+ "generated_at": { "type": "string", "format": "date-time" },
11
+ "trace_id": { "type": "string" },
12
+ "events": {
13
+ "type": "array",
14
+ "items": { "$ref": "./context-debug-event-v1.schema.json" }
15
+ },
16
+ "transitions": {
17
+ "type": "array",
18
+ "items": {
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": ["sequence", "at", "current"],
22
+ "properties": {
23
+ "sequence": { "type": "integer", "minimum": 1 },
24
+ "at": { "type": "string", "format": "date-time" },
25
+ "invocation_id": { "type": "string" },
26
+ "previous": { "type": "object" },
27
+ "current": { "type": "object" },
28
+ "selected_route": { "type": "object" }
29
+ }
30
+ }
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,94 @@
1
+ # Workspace debug tracing
2
+
3
+ Context debug tracing is an explicit, workspace-local observation mode. It is
4
+ disabled by default. It does not change Agent Graph facts, route selection,
5
+ human gates, command eligibility, lifecycle writes, or command exit status.
6
+
7
+ Enable it while initializing a workspace:
8
+
9
+ ```bash
10
+ context init context --debug
11
+ ```
12
+
13
+ Or enable it later:
14
+
15
+ ```bash
16
+ context debug enable
17
+ ```
18
+
19
+ Both forms set `package.json` `context.debug` to `true`. Disabling tracing
20
+ removes that property but keeps the existing trace for inspection:
21
+
22
+ ```bash
23
+ context debug disable
24
+ ```
25
+
26
+ ## Files
27
+
28
+ Tracing writes only below the ignored workspace `.tmp` directory:
29
+
30
+ ```text
31
+ .tmp/context-runtime/debug/
32
+ ├── events.jsonl
33
+ ├── state.json
34
+ └── replay.json
35
+ ```
36
+
37
+ - `events.jsonl` is the append-only source of truth. Each line conforms to
38
+ [`context.debug.event.v1`](./context-debug-event-v1.schema.json).
39
+ - `state.json` owns the trace id, monotonic sequence, and last observed graph
40
+ state. It is recorder state, not workflow state.
41
+ - `replay.json` is a disposable projection produced by `context debug export`
42
+ and conforms to [`context.debug.replay.v1`](./context-debug-replay-v1.schema.json).
43
+
44
+ No command stdout, source body, knowledge page, or resource body is copied into
45
+ the trace. Sensitive option values are redacted. Command receipts contain only
46
+ status, duration, byte counts, and hashes already available to the managed
47
+ runner.
48
+
49
+ ## Event model
50
+
51
+ The event stream records:
52
+
53
+ - CLI invocation and completion, including parent invocation identity for
54
+ managed child commands;
55
+ - Agent Graph evaluation revision, status, selected route, alternatives, and
56
+ whether the observable graph position changed;
57
+ - managed workflow action start and completion with deterministic receipts;
58
+ - execution-scope open and close events, including whether a deterministic
59
+ action ran in-process or in a child process and whether every short-lived
60
+ resource was released;
61
+ - the reason and graph position at which a managed loop stopped.
62
+
63
+ `trace_id` groups the workspace-local debug history, `sequence` defines replay order,
64
+ `invocation_id` groups work performed by one CLI process, and
65
+ `parent_invocation_id` connects managed child commands to their runner. A UI
66
+ can animate `agent-graph.evaluated` events whose `data.transition.changed` is
67
+ true, then associate intervening command and action events by sequence and
68
+ invocation identity.
69
+
70
+ Execution-scope events are runtime evidence, not workflow facts. They make
71
+ resource ownership and cleanup observable without changing a Route or adding
72
+ workspace state. Durable knowledge mutations are still audited through the
73
+ normal action receipt, revision, close, and verify results.
74
+
75
+ ## Inspect and export
76
+
77
+ ```bash
78
+ context debug status --format json
79
+ context debug export --format json
80
+ ```
81
+
82
+ Status returns configuration, event counts, and relative trace paths. Export
83
+ mechanically derives a replay document containing the complete event stream and
84
+ its changed graph transitions. A custom export path must remain below the
85
+ workspace `.tmp` directory:
86
+
87
+ ```bash
88
+ context debug export --output .tmp/analysis/replay.json --format json
89
+ ```
90
+
91
+ Recorder failures are intentionally non-fatal. They can make a trace
92
+ incomplete, but they cannot alter the command being observed. Consumers should
93
+ therefore validate monotonic `sequence` values before presenting a replay as
94
+ complete.
@@ -75,7 +75,7 @@ The CLI performs mechanical work such as source registration, capture,
75
75
  validation, review application, verify, close, and build. The agent performs
76
76
  semantic judgment only when the workflow asks for it.
77
77
 
78
- When the user explicitly requests fully managed operation, the Agent may use
78
+ When the user explicitly requests fully managed operation, the Agent starts with
79
79
  `context run --managed --until blocked-or-complete --format json` to collapse
80
80
  consecutive deterministic routes. The CLI re-evaluates every revision and
81
81
  stops before semantic reads, configuration, missing authority, diagnostics, or
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4a/context-cli",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "type": "module",
5
5
  "description": "Local CLI for capturing, compiling, and governing knowledge workspaces",
6
6
  "license": "MIT",
@@ -16,12 +16,15 @@
16
16
  "claude-code",
17
17
  "claude-plugin"
18
18
  ],
19
+ "engines": {
20
+ "node": ">=20"
21
+ },
19
22
  "bin": {
20
23
  "context": "cli.js"
21
24
  },
22
25
  "dependencies": {
23
- "@c4a/agent-graph": "0.2.3",
24
- "@c4a/context": "0.6.2",
26
+ "@c4a/agent-graph": "0.2.5",
27
+ "@c4a/context": "0.6.4",
25
28
  "commander": "^11.0.0",
26
29
  "fast-xml-parser": "^5.10.1",
27
30
  "handlebars": "^4.7.8",
package/plugins/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.2
1
+ 0.6.4
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "context",
3
3
  "description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
4
- "version": "0.6.2",
4
+ "version": "0.6.4",
5
5
  "author": {
6
6
  "name": "c4a"
7
7
  },
@@ -7,31 +7,36 @@ allowed-tools: Bash(context:*), Bash(bun:*), Bash(cd *)
7
7
  ## Your Task
8
8
 
9
9
  Use this as the conversational entry for an existing Context workspace. There
10
- is no `context continue` CLI primitive. Start with:
10
+ is no `context continue` CLI primitive. Without explicit fully managed
11
+ authority, start with:
11
12
 
12
13
  ```bash
13
14
  context status --format json
14
15
  ```
15
16
 
16
- Use `context status --managed --format json` only when the user explicitly
17
- requested fully managed operation in this conversation. Never persist or reuse
18
- that authority in another conversation. While the request remains active, use
19
- `--managed` for every status evaluation; stop using it when the conversation
20
- ends or the user revokes it.
17
+ If the user explicitly asks to enable debugging, first run
18
+ `context debug enable`. It sets `package.json` `context.debug=true` and records
19
+ subsequent CLI and Agent Graph events only below `.tmp/context-runtime/debug/`.
20
+ Do not enable it proactively; tracing is not workflow authority or evidence.
21
21
 
22
- If the user is starting a new workspace or a new batch from a raw repository
23
- root, do not run `context status` first. Use the public Context init entry or
24
- `context init` to create the workspace, complete the init setup command, then
25
- return here from the initialized workspace.
26
-
27
- For an explicitly managed conversation, the CLI can collapse consecutive
28
- mechanical routes:
22
+ When the user explicitly requests fully managed operation in this conversation,
23
+ start with the managed loop instead of a manual status/action cycle:
29
24
 
30
25
  ```bash
31
26
  context run --managed --until blocked-or-complete --format json
32
27
  ```
33
28
 
34
- Pass an additional `--authority` only when the user explicitly granted that
29
+ Never persist or reuse that authority in another conversation. While the
30
+ request remains active, use `--managed` for every resumed status evaluation;
31
+ stop using it when the conversation ends or the user revokes it.
32
+
33
+ If the user is starting a new workspace or a new batch from a raw repository
34
+ root, do not run `context status` first. Use the public Context init entry or
35
+ `context init` to create the workspace, complete the init setup command, then
36
+ return here from the initialized workspace.
37
+
38
+ The managed loop is the default entry for an explicitly managed conversation,
39
+ not an optional optimization. Pass an additional `--authority` only when the user explicitly granted that
35
40
  non-managed authority in this conversation. This loop executes only one
36
41
  revision-bound command at a time and re-evaluates after every receipt. It stops
37
42
  before read-only interpretation, project configuration, unresolved authority,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Initialize a Context knowledge workspace."
3
- argument-hint: "[project-dir] [--name <name>] [--language en|zh-CN]"
3
+ argument-hint: "[project-dir] [--name <name>] [--language en|zh-CN] [--debug]"
4
4
  allowed-tools: Bash(context:*), Bash(bun:*), Bash(cd *)
5
5
  ---
6
6
 
@@ -18,6 +18,8 @@ Chinese conversation and `en` for an English conversation. This explicit CLI
18
18
  value controls generated workspace instructions and starter templates. Never
19
19
  substitute `.` when `project-dir` was omitted; the default is `context/`. Use
20
20
  `--dev` only for an explicitly requested local-link test.
21
+ Add `--debug` only when the user explicitly asks to trace this workspace. Debug
22
+ mode is otherwise off by default.
21
23
 
22
24
  If init reports `init-target-nonempty`, explain that existing files would share
23
25
  the workspace root. Run the returned `--allow-nonempty` command only after
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "context",
3
- "version": "0.6.2",
3
+ "version": "0.6.4",
4
4
  "description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
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.2",
21
+ "shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.4",
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",
@@ -19,31 +19,36 @@ Public Context entry for agents that expose skills instead of slash commands.
19
19
  ## Workflow
20
20
 
21
21
  Use this as the conversational entry for an existing Context workspace. There
22
- is no `context continue` CLI primitive. Start with:
22
+ is no `context continue` CLI primitive. Without explicit fully managed
23
+ authority, start with:
23
24
 
24
25
  ```bash
25
26
  context status --format json
26
27
  ```
27
28
 
28
- Use `context status --managed --format json` only when the user explicitly
29
- requested fully managed operation in this conversation. Never persist or reuse
30
- that authority in another conversation. While the request remains active, use
31
- `--managed` for every status evaluation; stop using it when the conversation
32
- ends or the user revokes it.
29
+ If the user explicitly asks to enable debugging, first run
30
+ `context debug enable`. It sets `package.json` `context.debug=true` and records
31
+ subsequent CLI and Agent Graph events only below `.tmp/context-runtime/debug/`.
32
+ Do not enable it proactively; tracing is not workflow authority or evidence.
33
33
 
34
- If the user is starting a new workspace or a new batch from a raw repository
35
- root, do not run `context status` first. Use the public Context init entry or
36
- `context init` to create the workspace, complete the init setup command, then
37
- return here from the initialized workspace.
38
-
39
- For an explicitly managed conversation, the CLI can collapse consecutive
40
- mechanical routes:
34
+ When the user explicitly requests fully managed operation in this conversation,
35
+ start with the managed loop instead of a manual status/action cycle:
41
36
 
42
37
  ```bash
43
38
  context run --managed --until blocked-or-complete --format json
44
39
  ```
45
40
 
46
- Pass an additional `--authority` only when the user explicitly granted that
41
+ Never persist or reuse that authority in another conversation. While the
42
+ request remains active, use `--managed` for every resumed status evaluation;
43
+ stop using it when the conversation ends or the user revokes it.
44
+
45
+ If the user is starting a new workspace or a new batch from a raw repository
46
+ root, do not run `context status` first. Use the public Context init entry or
47
+ `context init` to create the workspace, complete the init setup command, then
48
+ return here from the initialized workspace.
49
+
50
+ The managed loop is the default entry for an explicitly managed conversation,
51
+ not an optional optimization. Pass an additional `--authority` only when the user explicitly granted that
47
52
  non-managed authority in this conversation. This loop executes only one
48
53
  revision-bound command at a time and re-evaluates after every receipt. It stops
49
54
  before read-only interpretation, project configuration, unresolved authority,
@@ -30,6 +30,8 @@ Chinese conversation and `en` for an English conversation. This explicit CLI
30
30
  value controls generated workspace instructions and starter templates. Never
31
31
  substitute `.` when `project-dir` was omitted; the default is `context/`. Use
32
32
  `--dev` only for an explicitly requested local-link test.
33
+ Add `--debug` only when the user explicitly asks to trace this workspace. Debug
34
+ mode is otherwise off by default.
33
35
 
34
36
  If init reports `init-target-nonempty`, explain that existing files would share
35
37
  the workspace root. Run the returned `--allow-nonempty` command only after
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "context",
3
3
  "displayName": "C4A Context",
4
- "version": "0.6.2",
4
+ "version": "0.6.4",
5
5
  "description": "Maintain a project-local knowledge workspace through init and next-step agent guidance.",
6
6
  "author": {
7
7
  "name": "Context4AI",
@@ -11,31 +11,36 @@ Continue the Context workflow from the current workspace state.
11
11
  ## Workflow
12
12
 
13
13
  Use this as the conversational entry for an existing Context workspace. There
14
- is no `context continue` CLI primitive. Start with:
14
+ is no `context continue` CLI primitive. Without explicit fully managed
15
+ authority, start with:
15
16
 
16
17
  ```bash
17
18
  context status --format json
18
19
  ```
19
20
 
20
- Use `context status --managed --format json` only when the user explicitly
21
- requested fully managed operation in this conversation. Never persist or reuse
22
- that authority in another conversation. While the request remains active, use
23
- `--managed` for every status evaluation; stop using it when the conversation
24
- ends or the user revokes it.
21
+ If the user explicitly asks to enable debugging, first run
22
+ `context debug enable`. It sets `package.json` `context.debug=true` and records
23
+ subsequent CLI and Agent Graph events only below `.tmp/context-runtime/debug/`.
24
+ Do not enable it proactively; tracing is not workflow authority or evidence.
25
25
 
26
- If the user is starting a new workspace or a new batch from a raw repository
27
- root, do not run `context status` first. Use the public Context init entry or
28
- `context init` to create the workspace, complete the init setup command, then
29
- return here from the initialized workspace.
30
-
31
- For an explicitly managed conversation, the CLI can collapse consecutive
32
- mechanical routes:
26
+ When the user explicitly requests fully managed operation in this conversation,
27
+ start with the managed loop instead of a manual status/action cycle:
33
28
 
34
29
  ```bash
35
30
  context run --managed --until blocked-or-complete --format json
36
31
  ```
37
32
 
38
- Pass an additional `--authority` only when the user explicitly granted that
33
+ Never persist or reuse that authority in another conversation. While the
34
+ request remains active, use `--managed` for every resumed status evaluation;
35
+ stop using it when the conversation ends or the user revokes it.
36
+
37
+ If the user is starting a new workspace or a new batch from a raw repository
38
+ root, do not run `context status` first. Use the public Context init entry or
39
+ `context init` to create the workspace, complete the init setup command, then
40
+ return here from the initialized workspace.
41
+
42
+ The managed loop is the default entry for an explicitly managed conversation,
43
+ not an optional optimization. Pass an additional `--authority` only when the user explicitly granted that
39
44
  non-managed authority in this conversation. This loop executes only one
40
45
  revision-bound command at a time and re-evaluates after every receipt. It stops
41
46
  before read-only interpretation, project configuration, unresolved authority,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Initialize a Context knowledge workspace."
3
- argument-hint: "[project-dir] [--name <name>] [--language en|zh-CN]"
3
+ argument-hint: "[project-dir] [--name <name>] [--language en|zh-CN] [--debug]"
4
4
  allowed-tools: Bash(context:*), Bash(bun:*), Bash(cd *)
5
5
  ---
6
6
 
@@ -22,6 +22,8 @@ Chinese conversation and `en` for an English conversation. This explicit CLI
22
22
  value controls generated workspace instructions and starter templates. Never
23
23
  substitute `.` when `project-dir` was omitted; the default is `context/`. Use
24
24
  `--dev` only for an explicitly requested local-link test.
25
+ Add `--debug` only when the user explicitly asks to trace this workspace. Debug
26
+ mode is otherwise off by default.
25
27
 
26
28
  If init reports `init-target-nonempty`, explain that existing files would share
27
29
  the workspace root. Run the returned `--allow-nonempty` command only after
@@ -19,31 +19,36 @@ Public Context entry for agents that expose skills instead of slash commands.
19
19
  ## Workflow
20
20
 
21
21
  Use this as the conversational entry for an existing Context workspace. There
22
- is no `context continue` CLI primitive. Start with:
22
+ is no `context continue` CLI primitive. Without explicit fully managed
23
+ authority, start with:
23
24
 
24
25
  ```bash
25
26
  context status --format json
26
27
  ```
27
28
 
28
- Use `context status --managed --format json` only when the user explicitly
29
- requested fully managed operation in this conversation. Never persist or reuse
30
- that authority in another conversation. While the request remains active, use
31
- `--managed` for every status evaluation; stop using it when the conversation
32
- ends or the user revokes it.
29
+ If the user explicitly asks to enable debugging, first run
30
+ `context debug enable`. It sets `package.json` `context.debug=true` and records
31
+ subsequent CLI and Agent Graph events only below `.tmp/context-runtime/debug/`.
32
+ Do not enable it proactively; tracing is not workflow authority or evidence.
33
33
 
34
- If the user is starting a new workspace or a new batch from a raw repository
35
- root, do not run `context status` first. Use the public Context init entry or
36
- `context init` to create the workspace, complete the init setup command, then
37
- return here from the initialized workspace.
38
-
39
- For an explicitly managed conversation, the CLI can collapse consecutive
40
- mechanical routes:
34
+ When the user explicitly requests fully managed operation in this conversation,
35
+ start with the managed loop instead of a manual status/action cycle:
41
36
 
42
37
  ```bash
43
38
  context run --managed --until blocked-or-complete --format json
44
39
  ```
45
40
 
46
- Pass an additional `--authority` only when the user explicitly granted that
41
+ Never persist or reuse that authority in another conversation. While the
42
+ request remains active, use `--managed` for every resumed status evaluation;
43
+ stop using it when the conversation ends or the user revokes it.
44
+
45
+ If the user is starting a new workspace or a new batch from a raw repository
46
+ root, do not run `context status` first. Use the public Context init entry or
47
+ `context init` to create the workspace, complete the init setup command, then
48
+ return here from the initialized workspace.
49
+
50
+ The managed loop is the default entry for an explicitly managed conversation,
51
+ not an optional optimization. Pass an additional `--authority` only when the user explicitly granted that
47
52
  non-managed authority in this conversation. This loop executes only one
48
53
  revision-bound command at a time and re-evaluates after every receipt. It stops
49
54
  before read-only interpretation, project configuration, unresolved authority,
@@ -30,6 +30,8 @@ Chinese conversation and `en` for an English conversation. This explicit CLI
30
30
  value controls generated workspace instructions and starter templates. Never
31
31
  substitute `.` when `project-dir` was omitted; the default is `context/`. Use
32
32
  `--dev` only for an explicitly requested local-link test.
33
+ Add `--debug` only when the user explicitly asks to trace this workspace. Debug
34
+ mode is otherwise off by default.
33
35
 
34
36
  If init reports `init-target-nonempty`, explain that existing files would share
35
37
  the workspace root. Run the returned `--allow-nonempty` command only after
@@ -0,0 +1,5 @@
1
+ schema: agent-graph.action.v1
2
+ id: inspect-code-extraction
3
+ runner: host
4
+ effect: read
5
+ handler: context.extract.inspect-capabilities
@@ -0,0 +1,6 @@
1
+ schema: agent-graph.action.v1
2
+ id: inspect-repository-recovery
3
+ description: Group missing repository modules by physical checkout and show recovery choices.
4
+ runner: command
5
+ effect: read
6
+ command: context source recovery-plan --format json
@@ -0,0 +1,5 @@
1
+ schema: agent-graph.action.v1
2
+ id: reconcile-review-identities
3
+ runner: host
4
+ effect: write
5
+ handler: context.review.preserve-approved-identities
@@ -1,5 +1,5 @@
1
1
  schema: agent-graph.action.v1
2
2
  id: repair-verification
3
- runner: command
4
- effect: read
5
- command: context verify --format json
3
+ runner: host
4
+ effect: external
5
+ handler: context.verification.repair-next
@@ -0,0 +1,7 @@
1
+ schema: agent-graph.action.v1
2
+ id: restore-repository-sources
3
+ description: Restore registered repository sources from user-confirmed local paths or explicit clones.
4
+ runner: command
5
+ effect: external
6
+ command: context source restore --input - --format json
7
+ inputSchema: schemas/repository-source-recovery.schema.json
@@ -18,7 +18,7 @@ codes:
18
18
  - { code: route.evidence.decision-required, kind: route-reason, summary: A source-evidence change needs an explicit maintenance decision., document: resources/procedures/evidence-maintenance.md }
19
19
  - { code: route.evidence.maintenance-required, kind: route-reason, summary: Apply the selected evidence-maintenance action., document: resources/procedures/evidence-maintenance.md }
20
20
  - { code: route.source.boundary-required, kind: route-reason, summary: No knowledge source boundary has been registered., document: resources/procedures/source-boundary.md }
21
- - { code: route.source.repository-not-ready, kind: route-reason, summary: A registered repository source is not ready locally., document: resources/procedures/source-boundary.md }
21
+ - { code: route.source.repository-not-ready, kind: route-reason, summary: A registered repository checkout or local source link must be restored., document: resources/procedures/repository-source-recovery.md }
22
22
  - { code: route.capture.configuration-required, kind: route-reason, summary: Registered document sources are missing capture declarations., document: resources/procedures/project-configuration.md }
23
23
  - { code: route.capture.permission-required, kind: route-reason, summary: External document capture requires source-read permission., document: resources/procedures/document-capture.md }
24
24
  - { code: route.capture.pending-target, kind: route-reason, summary: Capture the next declared document target., document: resources/procedures/document-capture.md }
@@ -31,6 +31,7 @@ codes:
31
31
  - { code: route.structure.confirmation-required, kind: route-reason, summary: A staged structure is waiting for confirmation., document: resources/procedures/prose-align.md }
32
32
  - { code: route.structure.confirm, kind: route-reason, summary: Persist the confirmed structure slot., document: resources/procedures/prose-align.md }
33
33
  - { code: route.compile.pending-target, kind: route-reason, summary: Compile the next planned source-bound knowledge view., document: resources/procedures/prose-compile.md }
34
+ - { code: route.review.identity-conflict, kind: route-reason, summary: Preserve approved ViewRef and path identity before Review., document: resources/procedures/knowledge-review.md }
34
35
  - { code: route.review.decision-required, kind: route-reason, summary: The complete current candidate batch needs one review decision set., document: resources/procedures/knowledge-review.md }
35
36
  - { code: route.review.apply-managed, kind: route-reason, summary: Apply the current candidate batch under explicit session-managed authority., document: resources/procedures/knowledge-review.md }
36
37
  - { code: route.close.projection-stale, kind: route-reason, summary: Rebuild the deterministic approved structure projection., document: resources/procedures/close-and-build.md }