@c4a/context-cli 0.6.2 → 0.6.3

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 (41) hide show
  1. package/README.md +30 -3
  2. package/README.zh-CN.md +29 -3
  3. package/cli.js +23732 -20136
  4. package/docs/context-debug-event-v1.schema.json +29 -0
  5. package/docs/context-debug-replay-v1.schema.json +33 -0
  6. package/docs/debug-tracing.md +86 -0
  7. package/docs/quickstart.md +1 -1
  8. package/package.json +7 -4
  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-repository-recovery.yaml +6 -0
  22. package/providers/context/actions/reconcile-review-identities.yaml +5 -0
  23. package/providers/context/actions/repair-verification.yaml +3 -3
  24. package/providers/context/actions/restore-repository-sources.yaml +7 -0
  25. package/providers/context/codes.yaml +2 -1
  26. package/providers/context/graphs/workspace.yaml +49 -7
  27. package/providers/context/manifest.json +94 -31
  28. package/providers/context/provider.yaml +1 -1
  29. package/providers/context/resources/dialogue/repository-source-recovery.md +23 -0
  30. package/providers/context/resources/manuals/guides/lark-resources.md +121 -0
  31. package/providers/context/resources/manuals/guides/package-outputs.md +8 -0
  32. package/providers/context/resources/manuals/reference/project-api.md +43 -7
  33. package/providers/context/resources/procedures/close-and-build.md +5 -3
  34. package/providers/context/resources/procedures/document-capture.md +5 -1
  35. package/providers/context/resources/procedures/knowledge-review.md +10 -0
  36. package/providers/context/resources/procedures/repository-source-recovery.md +43 -0
  37. package/providers/context/resources/procedures/source-capture-detailed.md +13 -0
  38. package/providers/context/resources/procedures/verify-and-repair.md +12 -0
  39. package/providers/context/resources/views/source-boundary.yaml +6 -0
  40. package/providers/context/schemas/repository-source-recovery.schema.json +40 -0
  41. package/providers/context/actions/ensure-repository-sources.yaml +0 -5
@@ -107,6 +107,23 @@ nodes:
107
107
  - resources/dialogue/structure-confirmation.md
108
108
  - resources/views/structure-current.yaml
109
109
 
110
+ - id: resume-align-next
111
+ kind: action
112
+ reasonCode: route.structure.pending-target
113
+ action: actions/align-next.yaml
114
+ satisfiedBy:
115
+ - path: resume.structure_refresh_required
116
+ exists: false
117
+ resources:
118
+ required:
119
+ - resources/procedures/prose-align.md
120
+ - resources/views/structure-current.yaml
121
+ recommended:
122
+ - resources/semantic/align/structure-planning.md
123
+ - resources/semantic/align/gates.md
124
+ - resources/semantic/align/density-profile.md
125
+ - resources/semantic/align/candidate-resolution.md
126
+
110
127
  - id: apply-structure-confirmation
111
128
  kind: action
112
129
  reasonCode: route.structure.confirm
@@ -133,6 +150,18 @@ nodes:
133
150
  - resources/views/structure-current.yaml
134
151
  - resources/semantic/compile/index.md
135
152
 
153
+ - id: resolve-review-identities
154
+ kind: action
155
+ reasonCode: route.review.identity-conflict
156
+ action: actions/reconcile-review-identities.yaml
157
+ satisfiedBy:
158
+ - path: review.identity_conflicts_present
159
+ exists: false
160
+ resources:
161
+ required:
162
+ - resources/procedures/knowledge-review.md
163
+ - resources/views/review-current.yaml
164
+
136
165
  - id: resume-review-current-batch
137
166
  kind: gate
138
167
  reasonCode: route.review.decision-required
@@ -186,15 +215,23 @@ nodes:
186
215
  - resources/procedures/source-capture-detailed.md
187
216
 
188
217
  - id: ensure-repository-sources
189
- kind: action
218
+ kind: gate
190
219
  reasonCode: route.source.repository-not-ready
191
- action: actions/ensure-repository-sources.yaml
220
+ inspectionAction: actions/inspect-repository-recovery.yaml
221
+ resolutionAction: actions/restore-repository-sources.yaml
222
+ gate:
223
+ id: repository-source-recovery
224
+ prompt: Choose how to restore each missing registered repository checkout.
225
+ authority: context.repository-restore
226
+ delegatable: false
192
227
  satisfiedBy:
193
228
  - path: sources.repositories_ready
194
229
  equals: true
195
230
  resources:
196
231
  required:
197
- - resources/procedures/source-boundary.md
232
+ - resources/procedures/repository-source-recovery.md
233
+ - resources/dialogue/human-gates.md
234
+ - resources/dialogue/repository-source-recovery.md
198
235
  - resources/views/source-current.yaml
199
236
 
200
237
  - id: configure-document-capture
@@ -211,6 +248,7 @@ nodes:
211
248
  recommended:
212
249
  - resources/procedures/document-capture.md
213
250
  - resources/views/source-current.yaml
251
+ - resources/manuals/guides/lark-resources.md
214
252
 
215
253
  - id: authorize-document-capture
216
254
  kind: gate
@@ -231,6 +269,7 @@ nodes:
231
269
  - resources/views/source-current.yaml
232
270
  recommended:
233
271
  - resources/procedures/source-capture-detailed.md
272
+ - resources/manuals/guides/lark-resources.md
234
273
 
235
274
  - id: capture-next
236
275
  kind: action
@@ -242,9 +281,10 @@ nodes:
242
281
  resources:
243
282
  required:
244
283
  - resources/procedures/document-capture.md
245
- - resources/views/source-current.yaml
284
+ - resources/views/source-boundary.yaml
246
285
  recommended:
247
286
  - resources/procedures/source-capture-detailed.md
287
+ - resources/manuals/guides/lark-resources.md
248
288
 
249
289
  - id: choose-extraction-scope
250
290
  kind: gate
@@ -290,7 +330,7 @@ nodes:
290
330
  resources:
291
331
  required:
292
332
  - resources/procedures/code-extraction.md
293
- - resources/views/source-current.yaml
333
+ - resources/views/source-boundary.yaml
294
334
 
295
335
  - id: classify-document
296
336
  kind: gate
@@ -469,10 +509,12 @@ edges:
469
509
  - { from: choose-evidence-maintenance, to: maintain-evidence, kind: gatedBy }
470
510
  - { from: maintain-evidence, to: close-approved-knowledge }
471
511
  - { from: close-approved-knowledge, to: resume-prose-lifecycle }
472
- - { from: resume-prose-lifecycle, to: confirm-structure }
512
+ - { from: resume-prose-lifecycle, to: resume-align-next }
513
+ - { from: resume-align-next, to: confirm-structure }
473
514
  - { from: confirm-structure, to: apply-structure-confirmation, kind: gatedBy }
474
515
  - { from: apply-structure-confirmation, to: compile-next }
475
- - { from: compile-next, to: resume-review-current-batch }
516
+ - { from: compile-next, to: resolve-review-identities }
517
+ - { from: resolve-review-identities, to: resume-review-current-batch }
476
518
  - { from: resume-review-current-batch, to: apply-resumed-review, kind: gatedBy }
477
519
  - { from: apply-resumed-review, to: choose-source-boundary }
478
520
  - { from: choose-source-boundary, to: ensure-repository-sources, kind: gatedBy }
@@ -2,14 +2,14 @@
2
2
  "schema": "agent-graph.bundle.v1",
3
3
  "provider": {
4
4
  "id": "c4a/context",
5
- "version": "0.6.2"
5
+ "version": "0.6.3"
6
6
  },
7
7
  "providerManifest": "provider.yaml",
8
8
  "graphs": [
9
9
  {
10
10
  "id": "workspace",
11
11
  "path": "graphs/workspace.yaml",
12
- "digest": "sha256:4b344cb9ecc03990f2a2f35aca372949917510f5957c4760fe69a651368eddbc"
12
+ "digest": "sha256:98b74bb6a59a9024978209e70c2519bd3608ea77b7576326685576184947898f"
13
13
  }
14
14
  ],
15
15
  "actions": [
@@ -73,11 +73,6 @@
73
73
  "path": "actions/configure-prose-lifecycle.yaml",
74
74
  "digest": "sha256:226d20be637455b3ffba4a115dd0437d3330354d8a73b8e5313b3af303d53bcc"
75
75
  },
76
- {
77
- "id": "ensure-repository-sources",
78
- "path": "actions/ensure-repository-sources.yaml",
79
- "digest": "sha256:00205debd0e58065f04520b1543c3e5dffc0da63cf42ffff4370757e59557791"
80
- },
81
76
  {
82
77
  "id": "extract-next",
83
78
  "path": "actions/extract-next.yaml",
@@ -88,6 +83,11 @@
88
83
  "path": "actions/inspect-document-classification.yaml",
89
84
  "digest": "sha256:973889832e3adfba4fa019b3dfadda35fe22536c44ef97efba2299e6cdd65786"
90
85
  },
86
+ {
87
+ "id": "inspect-repository-recovery",
88
+ "path": "actions/inspect-repository-recovery.yaml",
89
+ "digest": "sha256:6890fc2fb95823753beb7684066ddaac0b02e377c5fe3f568ac75286e00c9e88"
90
+ },
91
91
  {
92
92
  "id": "inspect-review",
93
93
  "path": "actions/inspect-review.yaml",
@@ -108,6 +108,11 @@
108
108
  "path": "actions/materialize-context-view.yaml",
109
109
  "digest": "sha256:0ed6b73b6a31324575fd10fb8f2067c8381609ab272a031b326080506105d115"
110
110
  },
111
+ {
112
+ "id": "reconcile-review-identities",
113
+ "path": "actions/reconcile-review-identities.yaml",
114
+ "digest": "sha256:aac95cc46ab8a872bdd1cc53cf64e3bbde8cf8dc2d6e9ac2da82bb378fcfe09a"
115
+ },
111
116
  {
112
117
  "id": "register-source-batch",
113
118
  "path": "actions/register-source-batch.yaml",
@@ -121,12 +126,17 @@
121
126
  {
122
127
  "id": "repair-verification",
123
128
  "path": "actions/repair-verification.yaml",
124
- "digest": "sha256:ab78ad85d3d001e7897bbb3f952f1489753d58a222b7aaefecb41d189a806375"
129
+ "digest": "sha256:835789670d5a3ee0b140820c79a26b925b8df374a4a93f598055dfcb06498cc7"
125
130
  },
126
131
  {
127
132
  "id": "repair-workspace-state",
128
133
  "path": "actions/repair-workspace-state.yaml",
129
134
  "digest": "sha256:67296adf5336a7f746e250dc23676972282f88410fb6a6edc41a929e15d1856b"
135
+ },
136
+ {
137
+ "id": "restore-repository-sources",
138
+ "path": "actions/restore-repository-sources.yaml",
139
+ "digest": "sha256:8e44f0dc15ac9b0eea8af62dcefd315d7c03a52dab1cda373537d275ae7383dc"
130
140
  }
131
141
  ],
132
142
  "resources": [
@@ -140,10 +150,15 @@
140
150
  "path": "resources/views/review-current.yaml",
141
151
  "digest": "sha256:264b6f7de5cce9034e5e0a344bf29341421467bfb1ef96c298d4936ee99d13f5"
142
152
  },
153
+ {
154
+ "id": "context.sdk.lark-resources",
155
+ "path": "resources/manuals/guides/lark-resources.md",
156
+ "digest": "sha256:a179bb8bf7d8185bb6f3033ef692dd15fa5b702c91525e7c272d3025d3bb7c52"
157
+ },
143
158
  {
144
159
  "id": "context.sdk.package-outputs",
145
160
  "path": "resources/manuals/guides/package-outputs.md",
146
- "digest": "sha256:df6236373c23ffde93283b0999450250d90fa1e961185f83b9060a6ba56400fc"
161
+ "digest": "sha256:32337aae19ba17ec01fc6da04a40cec9aab4ba4ee7561d8073e600d601b560ae"
147
162
  },
148
163
  {
149
164
  "id": "context.sdk.package-templates",
@@ -153,7 +168,7 @@
153
168
  {
154
169
  "id": "context.sdk.project-api",
155
170
  "path": "resources/manuals/reference/project-api.md",
156
- "digest": "sha256:9ab0be26aeccea79f561c7ecd01636beb97b7088ea1ddb141c3cbc96af758508"
171
+ "digest": "sha256:3dd8dfa54ba4b34a31d0a284385c77992f84ad2d7ef46583ff34683aae4081ac"
157
172
  },
158
173
  {
159
174
  "id": "context.sdk.template-variables",
@@ -185,6 +200,11 @@
185
200
  "path": "resources/semantic/compile/index.md",
186
201
  "digest": "sha256:4145f6bdc2855e354d00d311448584c3ed4b73849fc1277a2ed72d7be84e9e7c"
187
202
  },
203
+ {
204
+ "id": "context.source-boundary",
205
+ "path": "resources/views/source-boundary.yaml",
206
+ "digest": "sha256:6ff3eeaeb3ea8c3908106c26cfe8b8a6c6b0f636e3daaf7da9511830305feee2"
207
+ },
188
208
  {
189
209
  "id": "context.source-current",
190
210
  "path": "resources/views/source-current.yaml",
@@ -255,6 +275,11 @@
255
275
  "path": "resources/dialogue/package-output.md",
256
276
  "digest": "sha256:0ca7a9e56397f9acc62d92777d91e0203e2d6caa7f08268dca8037987e5911a5"
257
277
  },
278
+ {
279
+ "id": "dialogue.repository-source-recovery",
280
+ "path": "resources/dialogue/repository-source-recovery.md",
281
+ "digest": "sha256:ac1c7ba59f91d870f011eb1526afa83003e45205a6c436f635fb0e5b2e3c3055"
282
+ },
258
283
  {
259
284
  "id": "dialogue.source-boundary",
260
285
  "path": "resources/dialogue/source-boundary.md",
@@ -268,7 +293,7 @@
268
293
  {
269
294
  "id": "procedure.close-and-build",
270
295
  "path": "resources/procedures/close-and-build.md",
271
- "digest": "sha256:19c630e9c4c05f5b430df603fb705731427d2ef4bfcaf83a1b653d364164cae2"
296
+ "digest": "sha256:752f44bbb939cfb2c48bf3900069412b7c8c0eb135bb2b539de6b1e6862e847c"
272
297
  },
273
298
  {
274
299
  "id": "procedure.code-extraction",
@@ -278,7 +303,7 @@
278
303
  {
279
304
  "id": "procedure.document-capture",
280
305
  "path": "resources/procedures/document-capture.md",
281
- "digest": "sha256:07f8ccfe3429c28f7dd6b732821911b9636e9a0a9f1b6034986dce669b416248"
306
+ "digest": "sha256:482fa395dbc5ed167a4c1180463e0b9929d2a9a5a90f4ef0b5122cabf2cce80b"
282
307
  },
283
308
  {
284
309
  "id": "procedure.document-classification",
@@ -293,7 +318,7 @@
293
318
  {
294
319
  "id": "procedure.knowledge-review",
295
320
  "path": "resources/procedures/knowledge-review.md",
296
- "digest": "sha256:5ebf2bb9399d291f8a5dbba249169b4fb221e456aa6c05081c4c54b2e6f3cf48"
321
+ "digest": "sha256:a5d1f85514125eee0da2fda87b9b9af1e922248dffd8e3fc98f626a8325297d2"
297
322
  },
298
323
  {
299
324
  "id": "procedure.package-output",
@@ -315,6 +340,11 @@
315
340
  "path": "resources/procedures/prose-compile.md",
316
341
  "digest": "sha256:c36ba3dcf9aa11a8759afaab2c9a99859c31acaf5f06456c4e0e6793130b7d6e"
317
342
  },
343
+ {
344
+ "id": "procedure.repository-source-recovery",
345
+ "path": "resources/procedures/repository-source-recovery.md",
346
+ "digest": "sha256:af42c0f67d48518e76f4feac1969476fe16e35f591d2dd4432ae57fb31b6f794"
347
+ },
318
348
  {
319
349
  "id": "procedure.source-boundary",
320
350
  "path": "resources/procedures/source-boundary.md",
@@ -323,12 +353,12 @@
323
353
  {
324
354
  "id": "procedure.source-capture-detailed",
325
355
  "path": "resources/procedures/source-capture-detailed.md",
326
- "digest": "sha256:0cf764a43c33fbcf86b32a3731fec5905ebf0d312b7939059aae99a6ab0532e2"
356
+ "digest": "sha256:45fd35260c6bcd799ebf4f9069596a604cd23333332e45ef05d2b87f1ad02dfc"
327
357
  },
328
358
  {
329
359
  "id": "procedure.verify-and-repair",
330
360
  "path": "resources/procedures/verify-and-repair.md",
331
- "digest": "sha256:6becb02923a07eae47de7a9cfca2fc28ee3932a62bbcf4d273ec0f5b430b15e9"
361
+ "digest": "sha256:177d6c1f1f263f5c502ad197067a7fdcd5165d7ce2ac778672201c9f90888589"
332
362
  }
333
363
  ],
334
364
  "schemas": [
@@ -342,6 +372,11 @@
342
372
  "path": "schemas/prose-structure-batch.schema.json",
343
373
  "digest": "sha256:fc4ebbb5ee81ae77238cd60350ebac16f55e8a5adf3f5f5db411040474e01842"
344
374
  },
375
+ {
376
+ "id": "schemas/repository-source-recovery.schema.json",
377
+ "path": "schemas/repository-source-recovery.schema.json",
378
+ "digest": "sha256:589aea722965d81c9291232346bfc1d90ea04a94913d8ab7e3461e5a92746c56"
379
+ },
345
380
  {
346
381
  "id": "schemas/source-batch-input.schema.json",
347
382
  "path": "schemas/source-batch-input.schema.json",
@@ -397,10 +432,6 @@
397
432
  "path": "actions/configure-prose-lifecycle.yaml",
398
433
  "digest": "sha256:226d20be637455b3ffba4a115dd0437d3330354d8a73b8e5313b3af303d53bcc"
399
434
  },
400
- {
401
- "path": "actions/ensure-repository-sources.yaml",
402
- "digest": "sha256:00205debd0e58065f04520b1543c3e5dffc0da63cf42ffff4370757e59557791"
403
- },
404
435
  {
405
436
  "path": "actions/extract-next.yaml",
406
437
  "digest": "sha256:3d5e26cbdd912c9be666ce423b19456b31ab67da53c4e01a1a1c7a3dc1e6420a"
@@ -409,6 +440,10 @@
409
440
  "path": "actions/inspect-document-classification.yaml",
410
441
  "digest": "sha256:973889832e3adfba4fa019b3dfadda35fe22536c44ef97efba2299e6cdd65786"
411
442
  },
443
+ {
444
+ "path": "actions/inspect-repository-recovery.yaml",
445
+ "digest": "sha256:6890fc2fb95823753beb7684066ddaac0b02e377c5fe3f568ac75286e00c9e88"
446
+ },
412
447
  {
413
448
  "path": "actions/inspect-review.yaml",
414
449
  "digest": "sha256:79ab3605a3b17d227f4c3ae4d207634884e1422c4bb07fc275e98c2bb296f140"
@@ -425,6 +460,10 @@
425
460
  "path": "actions/materialize-context-view.yaml",
426
461
  "digest": "sha256:0ed6b73b6a31324575fd10fb8f2067c8381609ab272a031b326080506105d115"
427
462
  },
463
+ {
464
+ "path": "actions/reconcile-review-identities.yaml",
465
+ "digest": "sha256:aac95cc46ab8a872bdd1cc53cf64e3bbde8cf8dc2d6e9ac2da82bb378fcfe09a"
466
+ },
428
467
  {
429
468
  "path": "actions/register-source-batch.yaml",
430
469
  "digest": "sha256:e2f406ce398f21bfb0a0cb43b88416422581519a8e74168f44a2a4f5f7e673f6"
@@ -435,23 +474,27 @@
435
474
  },
436
475
  {
437
476
  "path": "actions/repair-verification.yaml",
438
- "digest": "sha256:ab78ad85d3d001e7897bbb3f952f1489753d58a222b7aaefecb41d189a806375"
477
+ "digest": "sha256:835789670d5a3ee0b140820c79a26b925b8df374a4a93f598055dfcb06498cc7"
439
478
  },
440
479
  {
441
480
  "path": "actions/repair-workspace-state.yaml",
442
481
  "digest": "sha256:67296adf5336a7f746e250dc23676972282f88410fb6a6edc41a929e15d1856b"
443
482
  },
483
+ {
484
+ "path": "actions/restore-repository-sources.yaml",
485
+ "digest": "sha256:8e44f0dc15ac9b0eea8af62dcefd315d7c03a52dab1cda373537d275ae7383dc"
486
+ },
444
487
  {
445
488
  "path": "codes.yaml",
446
- "digest": "sha256:cee059821edb0cf7601189649172418031ec145438e0647a248813c6255f0d55"
489
+ "digest": "sha256:583f6b7e4d489d42328ea0f7ad73b95c6a28c03cc44bd4b703443f00cdb66a6d"
447
490
  },
448
491
  {
449
492
  "path": "graphs/workspace.yaml",
450
- "digest": "sha256:4b344cb9ecc03990f2a2f35aca372949917510f5957c4760fe69a651368eddbc"
493
+ "digest": "sha256:98b74bb6a59a9024978209e70c2519bd3608ea77b7576326685576184947898f"
451
494
  },
452
495
  {
453
496
  "path": "provider.yaml",
454
- "digest": "sha256:0edd1fb11947dbf99179fc715b1a9182a4ed8ffe2007ff1859c09eb2aba609d5"
497
+ "digest": "sha256:42dbd41c64f6ef7cc2f22a7aeef5be12c8e8619ca31f48050a3de4e449fbf043"
455
498
  },
456
499
  {
457
500
  "path": "resources/diagnostics/projection-stale.md",
@@ -493,6 +536,10 @@
493
536
  "path": "resources/dialogue/package-output.md",
494
537
  "digest": "sha256:0ca7a9e56397f9acc62d92777d91e0203e2d6caa7f08268dca8037987e5911a5"
495
538
  },
539
+ {
540
+ "path": "resources/dialogue/repository-source-recovery.md",
541
+ "digest": "sha256:ac1c7ba59f91d870f011eb1526afa83003e45205a6c436f635fb0e5b2e3c3055"
542
+ },
496
543
  {
497
544
  "path": "resources/dialogue/source-boundary.md",
498
545
  "digest": "sha256:ae8436045b0de5ace6843b47a552a72ffc0020fa82612e594465cf193255803f"
@@ -501,9 +548,13 @@
501
548
  "path": "resources/dialogue/structure-confirmation.md",
502
549
  "digest": "sha256:4f9667860bb555c2cf236237c5a21644b7a2b249a452337d83087fa4c389dc2d"
503
550
  },
551
+ {
552
+ "path": "resources/manuals/guides/lark-resources.md",
553
+ "digest": "sha256:a179bb8bf7d8185bb6f3033ef692dd15fa5b702c91525e7c272d3025d3bb7c52"
554
+ },
504
555
  {
505
556
  "path": "resources/manuals/guides/package-outputs.md",
506
- "digest": "sha256:df6236373c23ffde93283b0999450250d90fa1e961185f83b9060a6ba56400fc"
557
+ "digest": "sha256:32337aae19ba17ec01fc6da04a40cec9aab4ba4ee7561d8073e600d601b560ae"
507
558
  },
508
559
  {
509
560
  "path": "resources/manuals/reference/package-templates.md",
@@ -511,7 +562,7 @@
511
562
  },
512
563
  {
513
564
  "path": "resources/manuals/reference/project-api.md",
514
- "digest": "sha256:9ab0be26aeccea79f561c7ecd01636beb97b7088ea1ddb141c3cbc96af758508"
565
+ "digest": "sha256:3dd8dfa54ba4b34a31d0a284385c77992f84ad2d7ef46583ff34683aae4081ac"
515
566
  },
516
567
  {
517
568
  "path": "resources/manuals/reference/template-variables.md",
@@ -519,7 +570,7 @@
519
570
  },
520
571
  {
521
572
  "path": "resources/procedures/close-and-build.md",
522
- "digest": "sha256:19c630e9c4c05f5b430df603fb705731427d2ef4bfcaf83a1b653d364164cae2"
573
+ "digest": "sha256:752f44bbb939cfb2c48bf3900069412b7c8c0eb135bb2b539de6b1e6862e847c"
523
574
  },
524
575
  {
525
576
  "path": "resources/procedures/code-extraction.md",
@@ -527,7 +578,7 @@
527
578
  },
528
579
  {
529
580
  "path": "resources/procedures/document-capture.md",
530
- "digest": "sha256:07f8ccfe3429c28f7dd6b732821911b9636e9a0a9f1b6034986dce669b416248"
581
+ "digest": "sha256:482fa395dbc5ed167a4c1180463e0b9929d2a9a5a90f4ef0b5122cabf2cce80b"
531
582
  },
532
583
  {
533
584
  "path": "resources/procedures/document-classification.md",
@@ -539,7 +590,7 @@
539
590
  },
540
591
  {
541
592
  "path": "resources/procedures/knowledge-review.md",
542
- "digest": "sha256:5ebf2bb9399d291f8a5dbba249169b4fb221e456aa6c05081c4c54b2e6f3cf48"
593
+ "digest": "sha256:a5d1f85514125eee0da2fda87b9b9af1e922248dffd8e3fc98f626a8325297d2"
543
594
  },
544
595
  {
545
596
  "path": "resources/procedures/package-output.md",
@@ -557,17 +608,21 @@
557
608
  "path": "resources/procedures/prose-compile.md",
558
609
  "digest": "sha256:c36ba3dcf9aa11a8759afaab2c9a99859c31acaf5f06456c4e0e6793130b7d6e"
559
610
  },
611
+ {
612
+ "path": "resources/procedures/repository-source-recovery.md",
613
+ "digest": "sha256:af42c0f67d48518e76f4feac1969476fe16e35f591d2dd4432ae57fb31b6f794"
614
+ },
560
615
  {
561
616
  "path": "resources/procedures/source-boundary.md",
562
617
  "digest": "sha256:99097947961d7fa5b17f9e6b9c9471aac38cec1943bd7feb414b21d6a1e26a49"
563
618
  },
564
619
  {
565
620
  "path": "resources/procedures/source-capture-detailed.md",
566
- "digest": "sha256:0cf764a43c33fbcf86b32a3731fec5905ebf0d312b7939059aae99a6ab0532e2"
621
+ "digest": "sha256:45fd35260c6bcd799ebf4f9069596a604cd23333332e45ef05d2b87f1ad02dfc"
567
622
  },
568
623
  {
569
624
  "path": "resources/procedures/verify-and-repair.md",
570
- "digest": "sha256:6becb02923a07eae47de7a9cfca2fc28ee3932a62bbcf4d273ec0f5b430b15e9"
625
+ "digest": "sha256:177d6c1f1f263f5c502ad197067a7fdcd5165d7ce2ac778672201c9f90888589"
571
626
  },
572
627
  {
573
628
  "path": "resources/semantic/align/candidate-resolution.md",
@@ -597,6 +652,10 @@
597
652
  "path": "resources/views/review-current.yaml",
598
653
  "digest": "sha256:264b6f7de5cce9034e5e0a344bf29341421467bfb1ef96c298d4936ee99d13f5"
599
654
  },
655
+ {
656
+ "path": "resources/views/source-boundary.yaml",
657
+ "digest": "sha256:6ff3eeaeb3ea8c3908106c26cfe8b8a6c6b0f636e3daaf7da9511830305feee2"
658
+ },
600
659
  {
601
660
  "path": "resources/views/source-current.yaml",
602
661
  "digest": "sha256:2d9c832f7f6c460d2b1e413048093da1ffb939f7d6ac4dc770433815c8fe3f09"
@@ -621,6 +680,10 @@
621
680
  "path": "schemas/prose-structure-batch.schema.json",
622
681
  "digest": "sha256:fc4ebbb5ee81ae77238cd60350ebac16f55e8a5adf3f5f5db411040474e01842"
623
682
  },
683
+ {
684
+ "path": "schemas/repository-source-recovery.schema.json",
685
+ "digest": "sha256:589aea722965d81c9291232346bfc1d90ea04a94913d8ab7e3461e5a92746c56"
686
+ },
624
687
  {
625
688
  "path": "schemas/source-batch-input.schema.json",
626
689
  "digest": "sha256:aa5f1a1bf6a6573982e89e50c9d991f6aa72a5cbbda0867d1f483e30315c4409"
@@ -633,5 +696,5 @@
633
696
  "graphDependencies": {
634
697
  "workspace": []
635
698
  },
636
- "digest": "sha256:f9d3b6ea8d0b93df323af7557c9729ecb328a260c5389ed8869c21e1290726d3"
699
+ "digest": "sha256:9a4fdc41e173bd8f98d12428c0ef0f03e00a62a588bedfb58ad52ef6b589317c"
637
700
  }
@@ -1,6 +1,6 @@
1
1
  schema: agent-graph.provider.v1
2
2
  id: c4a/context
3
- version: 0.6.2
3
+ version: 0.6.3
4
4
  name: Context workflow
5
5
  description: Internal work contract for Context knowledge workspaces.
6
6
  graphs:
@@ -0,0 +1,23 @@
1
+ ---
2
+ id: dialogue.repository-source-recovery
3
+ kind: procedure
4
+ mediaType: text/markdown
5
+ ---
6
+
7
+ # Repository source recovery dialogue
8
+
9
+ Explain that the Context project is intact: only Git-ignored source checkouts
10
+ or local links are missing. Show one choice per physical repository, not per
11
+ logical module.
12
+
13
+ For an existing checkout, ask for its path or ask the user to authorize a
14
+ specific parent directory for a bounded scan. Show matching candidates with
15
+ their origin, HEAD, dirty state, and required subpath coverage before the user
16
+ selects one. Do not modify, switch, clean, or pull the selected checkout.
17
+
18
+ For a clone, show the registered remote, pinned commit, target directory, and
19
+ the logical modules that will share it. The clone restores the recorded source
20
+ version; it does not silently advance to the latest branch.
21
+
22
+ After recovery, summarize reused and cloned checkouts, actual commits, restored
23
+ module links, and any remaining permission or missing-subpath blockers.
@@ -0,0 +1,121 @@
1
+ ---
2
+ id: context.sdk.lark-resources
3
+ kind: procedure
4
+ mediaType: text/markdown
5
+ ---
6
+
7
+ # Lark Resource Materialization
8
+
9
+ Lark documents can contain evidence that is not present in the readable text
10
+ body. Context handles these resources mechanically during `captureLark`; the
11
+ Agent does not download, summarize, or reconstruct them itself.
12
+
13
+ ## Resource policy
14
+
15
+ | Resource | Default capture behavior |
16
+ |---|---|
17
+ | Image and attachment | Download the original file and link it from the Markdown projection. |
18
+ | Sheet | Read the complete selected sheet, render a Markdown table, and retain a CSV snapshot. |
19
+ | Base | Read the selected table/view with pagination, render a Markdown table, and retain a canonical JSON snapshot. |
20
+ | Whiteboard and diagram | Retain a readable preview plus the raw structured export. |
21
+ | Synced block | Resolve the exact source block, project its body, and retain a Markdown evidence snapshot. |
22
+ | Poll | Preserve exported options and metadata as non-interactive Markdown; warn when the export omits them. |
23
+ | Bookmark, citation, sub-document, chat, and generic embed | Preserve a stable navigation reference and provenance. |
24
+ | Video | Preserve a stable reference by default; download only when `resources.videos` is `bundle`. |
25
+
26
+ Required inline resources fail closed when their stable identity, bytes, or
27
+ complete structured data cannot be obtained. When the remote API explicitly
28
+ confirms that a referenced whiteboard or diagram no longer exists, Context
29
+ preserves an unavailable-resource notice with the reason code
30
+ `document.resource.source-missing`, reports a warning, and continues capture;
31
+ it does not pretend that the deleted content was materialized. When the current
32
+ identity can read the document body but the API explicitly returns
33
+ `authorization/permission_denied` for an embedded resource, Context records
34
+ `document.resource.permission-denied`, keeps the stable resource identity in
35
+ the audit layer, renders the same unavailable-resource notice, and continues
36
+ with a warning. Missing scopes, transient network errors, malformed payloads,
37
+ and unclassified authorization failures still block capture. Reference-only
38
+ resources remain explicit in the capture report. Unknown non-empty XML blocks
39
+ stay auditable in the raw XML and receive a warning; the CLI does not infer
40
+ their meaning.
41
+
42
+ ## Storage lifecycle
43
+
44
+ Resources have three distinct locations:
45
+
46
+ ```text
47
+ sources/lark/<date>/
48
+ ├── <module>.md
49
+ ├── manifest.json
50
+ └── assets/<module>/
51
+ ├── source.xml
52
+ ├── capture-report.json
53
+ └── materialized/**
54
+ knowledge/assets/<resource-kind>/<content-sha256>.<ext>
55
+ dist/<package>/others/assets/<resource-kind>/<content-sha256>.<ext>
56
+ ```
57
+
58
+ - `sources/` is the captured source and audit layer. `source.xml` preserves the
59
+ structured source, one `capture-report.json` closes fidelity and resource
60
+ handling for the document, and `materialized/` contains downloaded files and
61
+ structured exports. Resource descriptors are consolidated in the report;
62
+ capture does not create one metadata file per embedded resource.
63
+ - The date-level `manifest.json` is a compact inventory. It records hashes,
64
+ asset roles, the report path, and status summaries without duplicating the
65
+ complete report.
66
+ - `knowledge/assets/` contains only resources referenced by approved pages.
67
+ Paths are content-addressed, so identical bytes are reused and changed bytes
68
+ produce a new identity. Review apply rewrites page links mechanically;
69
+ verification compares the underlying content identity, so this deterministic
70
+ path projection does not count as a change to a verbatim section.
71
+ Markdown files below `knowledge/assets/` remain evidence resources and are
72
+ never interpreted as approved knowledge pages or structure views.
73
+ - `others/assets/` is the portable package projection. Build copies only
74
+ resources referenced by selected package pages and rewrites their relative
75
+ links. Audit-only source files are not distributed.
76
+
77
+ Deleting an approved page allows unreferenced `knowledge/assets` files to be
78
+ cleaned. A missing approved or packaged resource is a verification error rather
79
+ than a silent broken link.
80
+
81
+ Source assets are part of the reproducible evidence snapshot and should not be
82
+ ignored when the workspace is versioned. Repositories with many binary source
83
+ assets can use Git LFS for `materialized/` while keeping Markdown, XML, JSON, and
84
+ CSV directly reviewable in Git. The workspace must remain private when the
85
+ captured source or screenshots are access-controlled.
86
+
87
+ ## SDK configuration
88
+
89
+ Defaults are suitable for ordinary documents:
90
+
91
+ ```ts
92
+ captureLark({ source: handbook });
93
+ ```
94
+
95
+ Projects can opt into bundled video and adjust deterministic byte limits:
96
+
97
+ ```ts
98
+ captureLark({
99
+ source: handbook,
100
+ resources: {
101
+ videos: "bundle",
102
+ maxBytesPerResource: 20 * 1024 * 1024,
103
+ maxTotalBytes: 200 * 1024 * 1024,
104
+ },
105
+ });
106
+ ```
107
+
108
+ The limits are capture constraints, not semantic filters. Context does not
109
+ decide which resources are important from their business content.
110
+
111
+ ## Agent behavior
112
+
113
+ Use the capture command returned by the current Route. Inspect the structured
114
+ resource summary and fidelity diagnostics; do not manually edit `sources/`,
115
+ `knowledge/assets/`, or package links. Required materialization failures other
116
+ than a confirmed source-side deletion or an explicit resource-level permission
117
+ denial must be resolved by recapturing after access or source problems are
118
+ fixed. Accepted failures remain visible as warnings and unavailable-resource
119
+ notices; they are never represented as downloaded evidence. Review shows
120
+ available previews, references, and warnings so the human or managed policy can
121
+ assess the page with its non-text evidence.
@@ -67,6 +67,7 @@ wikis/index.md
67
67
  guides/...
68
68
  rules/...
69
69
  feats/...
70
+ others/assets/...
70
71
  ```
71
72
 
72
73
  Do not ask for another distribution namespace. Older workspaces may still
@@ -94,6 +95,13 @@ package needs project-specific terminology, entry points, known limits, or
94
95
  task workflows. Authors may explicitly accept the generic default when it is
95
96
  intentionally sufficient.
96
97
 
98
+ When approved pages reference materialized document resources, Context keeps
99
+ their production copies in content-addressed `knowledge/assets/` paths. Build
100
+ copies only the resources selected by package pages to `others/assets/` and
101
+ rewrites relative Markdown links. Source audit XML and capture reports stay in
102
+ the production workspace; they are not distributed as reader assets. See
103
+ [Lark Resource Materialization](./lark-resources.md).
104
+
97
105
  The same inventory exposes `structure.relationship_coverage`. It records
98
106
  whether selected codegraph pages have current source-backed AST relationship
99
107
  metadata, how many codegraph views were selected, and how many package-visible