taskcarry 0.3.2__py3-none-any.whl

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 (105) hide show
  1. taskcarry/__init__.py +3 -0
  2. taskcarry/__main__.py +4 -0
  3. taskcarry/adapter_contracts.py +166 -0
  4. taskcarry/agy_turns.py +282 -0
  5. taskcarry/api.py +111 -0
  6. taskcarry/board.py +313 -0
  7. taskcarry/board_assets/board.css +1087 -0
  8. taskcarry/board_assets/board.js +1187 -0
  9. taskcarry/board_assets/browse.js +214 -0
  10. taskcarry/board_assets/index.html +43 -0
  11. taskcarry/board_assets/taskcarry-icon.ico +0 -0
  12. taskcarry/board_assets/taskcarry-mark.svg +28 -0
  13. taskcarry/board_data.py +466 -0
  14. taskcarry/chat_joins.py +157 -0
  15. taskcarry/cli.py +119 -0
  16. taskcarry/codex_capture.py +184 -0
  17. taskcarry/codex_host.py +293 -0
  18. taskcarry/collaboration_exchange.py +316 -0
  19. taskcarry/connection.py +159 -0
  20. taskcarry/continuity.py +300 -0
  21. taskcarry/contracts.py +165 -0
  22. taskcarry/conversation_capture.py +669 -0
  23. taskcarry/core.py +896 -0
  24. taskcarry/cycle_contracts.py +73 -0
  25. taskcarry/discovery.py +434 -0
  26. taskcarry/discovery_contracts.py +52 -0
  27. taskcarry/exchange_contracts.py +67 -0
  28. taskcarry/exchange_endpoint.py +377 -0
  29. taskcarry/exchange_packets.py +142 -0
  30. taskcarry/experience_contracts.py +129 -0
  31. taskcarry/experience_exchange.py +214 -0
  32. taskcarry/experience_notes.py +433 -0
  33. taskcarry/experience_storage.py +125 -0
  34. taskcarry/experience_tools.py +26 -0
  35. taskcarry/feishu/__init__.py +1 -0
  36. taskcarry/feishu/display.py +122 -0
  37. taskcarry/feishu/project_watch.py +145 -0
  38. taskcarry/feishu/review_sets.py +80 -0
  39. taskcarry/feishu/sender.py +42 -0
  40. taskcarry/feishu/subscription.py +193 -0
  41. taskcarry/feishu/windows_agent.py +287 -0
  42. taskcarry/feishu/windows_secret.py +34 -0
  43. taskcarry/gitops.py +170 -0
  44. taskcarry/governance.py +88 -0
  45. taskcarry/governance_cycle.py +775 -0
  46. taskcarry/identification.py +82 -0
  47. taskcarry/integration.py +663 -0
  48. taskcarry/maintenance.py +118 -0
  49. taskcarry/mcp.py +183 -0
  50. taskcarry/member_join.py +184 -0
  51. taskcarry/member_routing.py +145 -0
  52. taskcarry/onboarding.py +272 -0
  53. taskcarry/onboarding_complete.py +252 -0
  54. taskcarry/path_batches.py +19 -0
  55. taskcarry/preservation.py +257 -0
  56. taskcarry/project_collaboration.py +453 -0
  57. taskcarry/project_history.py +166 -0
  58. taskcarry/project_identity.py +51 -0
  59. taskcarry/project_recovery.py +824 -0
  60. taskcarry/recovery_contracts.py +25 -0
  61. taskcarry/recovery_files.py +153 -0
  62. taskcarry/recovery_git.py +234 -0
  63. taskcarry/remote_capture.py +89 -0
  64. taskcarry/remote_transfer.py +356 -0
  65. taskcarry/role_connection.py +215 -0
  66. taskcarry/setup.py +597 -0
  67. taskcarry/shared_workbench.py +480 -0
  68. taskcarry/skill_data/taskcarry-experience-recovery/SKILL.md +37 -0
  69. taskcarry/skill_data/taskcarry-governance-reconcile/SKILL.md +47 -0
  70. taskcarry/skill_data/taskcarry-governance-reconcile/references/daily-governance.md +72 -0
  71. taskcarry/skill_data/taskcarry-project-setup/SKILL.md +48 -0
  72. taskcarry/skill_data/taskcarry-project-setup/references/onboarding.md +198 -0
  73. taskcarry/skill_data/taskcarry-task-delivery/SKILL.md +32 -0
  74. taskcarry/skill_data/taskcarry-task-delivery/references/conditional-experience.md +93 -0
  75. taskcarry/skill_data/taskcarry-task-delivery/references/worker-channel.md +41 -0
  76. taskcarry/source_review_set.py +80 -0
  77. taskcarry/state_format.py +47 -0
  78. taskcarry/store.py +472 -0
  79. taskcarry/task_context.py +141 -0
  80. taskcarry/text_handback.py +98 -0
  81. taskcarry/transfer_contracts.py +18 -0
  82. taskcarry/updates.py +351 -0
  83. taskcarry/workbench.py +625 -0
  84. taskcarry/workbench_contracts.py +32 -0
  85. taskcarry/workbuddy_capture.py +451 -0
  86. taskcarry/workbuddy_setup.py +212 -0
  87. taskcarry/worker_channel.py +859 -0
  88. taskcarry/worker_contracts.py +190 -0
  89. taskcarry/worker_storage.py +60 -0
  90. taskcarry/worker_tools.py +111 -0
  91. taskcarry-0.3.2.dist-info/METADATA +203 -0
  92. taskcarry-0.3.2.dist-info/RECORD +105 -0
  93. taskcarry-0.3.2.dist-info/WHEEL +5 -0
  94. taskcarry-0.3.2.dist-info/entry_points.txt +5 -0
  95. taskcarry-0.3.2.dist-info/licenses/LICENSE +21 -0
  96. taskcarry-0.3.2.dist-info/licenses/LICENSE_SCOPE.md +31 -0
  97. taskcarry-0.3.2.dist-info/top_level.txt +2 -0
  98. taskcarry_https/__init__.py +1 -0
  99. taskcarry_https/consent.py +207 -0
  100. taskcarry_https/reader.py +132 -0
  101. taskcarry_https/review.py +116 -0
  102. taskcarry_https/server.py +163 -0
  103. taskcarry_https/team.py +335 -0
  104. taskcarry_https/team_host.py +109 -0
  105. taskcarry_https/web_host.py +82 -0
@@ -0,0 +1,480 @@
1
+ """Explicit shared-directory navigation; legacy v1 objects remain immutable."""
2
+ from __future__ import annotations
3
+
4
+ import base64
5
+ import json
6
+ import os
7
+ from pathlib import Path
8
+
9
+ from .core import _id, digest_bytes, validate_relative_path
10
+ from .store import GovernanceError, now
11
+ from .workbench import (Workbench, MAX_PLAN_BYTES, _hash, _links, _read, atomic_write,
12
+ canonical, codex_instructions, fail, git_snapshot, immutable,
13
+ managed_section, private_target)
14
+
15
+ ROUTER = '.codex/taskcarry-routing.json'
16
+ PLAN = 'taskcarry.workbench.plan.v2'
17
+
18
+
19
+ def archive_setup(root, control, manifest_sha256):
20
+ """Record exact managed preimages before explicit directory-mode conversion."""
21
+ values = {}
22
+ for name in ('.taskcarry/setup-manifest.json', '.taskcarry/workbench.json', '.taskcarry/workbench.md', '.codex/config.toml'):
23
+ content = _read(root / name, MAX_PLAN_BYTES)
24
+ if content is not None:
25
+ values[name] = {'sha256': digest_bytes(content), 'bytes': base64.b64encode(content).decode()}
26
+ saved_manifest = values.get('.taskcarry/setup-manifest.json', {})
27
+ if saved_manifest.get('sha256') != manifest_sha256:
28
+ fail('The original setup changed before its preimage was saved.', 'SETUP_MANIFEST_CHANGED')
29
+ manifest = json.loads(base64.b64decode(saved_manifest['bytes']))
30
+ for name in ('.taskcarry/workbench.json', '.taskcarry/workbench.md'):
31
+ if values.get(name, {}).get('sha256') != manifest['files'].get(name):
32
+ fail('The original binding changed before conversion; preserve it.', 'SETUP_CONFLICT')
33
+ record = {'schema': 'taskcarry.setup.preimage.v1', 'files': values}
34
+ body = canonical(record)
35
+ if len(body) > MAX_PLAN_BYTES:
36
+ fail('Setup preimage exceeds the bounded history limit.')
37
+ key = digest_bytes(body)
38
+ engine = Workbench(control)
39
+ with engine.store.transaction():
40
+ engine._object('workbench_setup_history', key, record)
41
+ immutable(root / '.taskcarry' / 'setup-history' / (key + '.json'), body)
42
+ return {'sha256': key, 'path': '.taskcarry/setup-history/' + key + '.json',
43
+ 'collection': 'workbench_setup_history', 'key': key}
44
+
45
+
46
+ def chat_key(thread_id):
47
+ _id(thread_id, 'Thread ID')
48
+ return digest_bytes(canonical({'thread_id': thread_id}))
49
+
50
+
51
+ def assert_chat_identity(engine, thread_id, workspace, task_id):
52
+ """Current entries own identity; historical receipts are only search indexes."""
53
+ current = SharedWorkbench(engine.root)._chat_pointer(thread_id)
54
+ if current and (current['workspace'], current['task_id']) != (workspace, task_id):
55
+ fail('Retain the original chat workspace and task.', 'WORKBENCH_BINDING_MISMATCH')
56
+ with engine.store._connect(readonly=True) as db:
57
+ rows = db.execute("""SELECT DISTINCT json_extract(value,'$.workspace') FROM records
58
+ WHERE collection='workbench_receipts' AND json_extract(value,'$.schema')='taskcarry.workbench.receipt.v1'
59
+ AND json_extract(value,'$.thread_id')=? LIMIT 101""", (thread_id,)).fetchall()
60
+ if len(rows) > 100:
61
+ fail('Review this chat\'s bounded legacy workspace history before publication.')
62
+ for (name,) in rows:
63
+ receipt = legacy_current_receipt(engine, _id(name, 'Workspace'))
64
+ if (receipt and receipt['thread_id'] == thread_id
65
+ and (receipt['workspace'], receipt['task_id']) != (workspace, task_id)):
66
+ fail('Another current legacy entry owns this original chat; retain its task and workspace.',
67
+ 'WORKBENCH_BINDING_MISMATCH')
68
+
69
+
70
+ def legacy_current_receipt(engine, workspace):
71
+ pointer = engine._pointer(workspace)
72
+ if pointer is None:
73
+ # Missing mirrors are not an implicit release of the original identity.
74
+ # The exact old plan may still repair its own missing finalization.
75
+ pointer = engine.store.get('workbench_current', workspace)
76
+ if pointer is None:
77
+ return None
78
+ receipt = engine.store.get('workbench_receipts', pointer.get('receipt_id', ''))
79
+ fields = ('workspace', 'task_id', 'plan_id', 'view_id', 'source_id')
80
+ if (pointer.get('schema') != 'taskcarry.workbench.current.v1' or not receipt
81
+ or pointer.get('workspace') != workspace or pointer.get('source_id') not in engine._source_ids()
82
+ or any(pointer.get(k) != receipt.get(k) for k in fields)):
83
+ fail('Retain the unresolved legacy current record for review.')
84
+ return receipt
85
+
86
+
87
+ class SharedWorkbench(Workbench):
88
+ def _directory_binding(self, workspace, task_id=None):
89
+ from .integration import Integration
90
+ from .setup import read_manifest, workbench_binding
91
+ if task_id is not None:
92
+ self._task(task_id)
93
+ root = _links(Integration(self.root)._ws(_id(workspace, 'Workspace')))
94
+ expected = workbench_binding(self.root, root, workspace, None, binding_mode='directory')
95
+ manifest = read_manifest(root)
96
+ if manifest.get('format') != 2 or manifest.get('binding') != expected:
97
+ fail('Preview and install explicit directory-mode connection materials first.', 'SHARED_SETUP_REQUIRED')
98
+ raw = _read(root / '.taskcarry/workbench.json')
99
+ try:
100
+ value = json.loads(raw) if raw is not None else {}
101
+ except ValueError:
102
+ value = {}
103
+ if (any(value.get(k) != v for k, v in expected.items())
104
+ or value.get('format') != 2
105
+ or manifest['files'].get('.taskcarry/workbench.json') != _hash(raw)):
106
+ fail('The shared directory materials changed; retain and review them.', 'WORKBENCH_BINDING_MISMATCH')
107
+ return root
108
+
109
+ def _directory_id(self, root):
110
+ return digest_bytes(os.path.normcase(str(root)).encode())
111
+
112
+ def _directory_current(self, root):
113
+ return self.store.get('workbench_directory_current', self._directory_id(root))
114
+
115
+ def _router(self, root, current):
116
+ raw = _read(private_target(root, ROUTER))
117
+ if current is None:
118
+ if raw is not None:
119
+ fail('An unmanaged shared router already exists; retain it for review.')
120
+ return {'schema': 'taskcarry.workbench.router.v2', 'source_id': self.source()['source_id'],
121
+ 'control': str(self.root), 'root': str(root), 'routes': []}
122
+ if raw is None or _hash(raw) != current['router_sha256']:
123
+ fail('The shared directory router changed; inspect actual effects before planning.')
124
+ try:
125
+ value = json.loads(raw)
126
+ except ValueError:
127
+ fail('Invalid shared directory router.')
128
+ if (raw != canonical(value) or value.get('schema') != 'taskcarry.workbench.router.v2'
129
+ or value.get('control') != str(self.root) or value.get('root') != str(root)
130
+ or value.get('source_id') not in self._source_ids()):
131
+ fail('Shared directory router belongs to another source or location.')
132
+ return value
133
+
134
+ def _chat_pointer(self, thread_id):
135
+ key = chat_key(thread_id)
136
+ raw = _read(self._path('chats', key + '.json'))
137
+ if raw is None:
138
+ if self.store.get('workbench_chat_current', key) is not None:
139
+ fail('The registered chat current file is missing; review it before publishing.')
140
+ return None
141
+ try:
142
+ pointer = json.loads(raw)
143
+ receipt = self.store.get('workbench_receipts', pointer['receipt_id'])
144
+ fields = ('workspace', 'task_id', 'thread_id', 'plan_id', 'view_id', 'source_id', 'binding_id')
145
+ if (raw != canonical(pointer) or pointer.get('schema') != 'taskcarry.workbench.current.v2'
146
+ or pointer.get('thread_id') != thread_id or pointer.get('binding_id') != key
147
+ or pointer.get('source_id') not in self._source_ids() or not receipt
148
+ or any(pointer.get(k) != receipt.get(k) for k in fields)):
149
+ fail('Shared chat pointer does not match its immutable receipt.')
150
+ return pointer
151
+ except (ValueError, KeyError, TypeError) as exc:
152
+ fail('Shared chat pointer is invalid: ' + str(exc))
153
+
154
+ def _shared_instructions(self, root):
155
+ return ('Read the TaskCarry shared-directory routing index at ' + str(root / ROUTER) + '.\n'
156
+ 'Use only your original chat ID verified by the host or your explicit activation card.\n'
157
+ 'Select its exact route, then read that current entry and view; retain its original task and workspace.\n'
158
+ 'If the current chat ID is unknown or has no exact route, report the missing binding; never choose the first entry, another chat or a task by title.\n'
159
+ 'The shared MCP connection uses control ' + str(self.root) + '. It does not select a task.\n'
160
+ 'Check the selected task and latest checkpoint through Core. Keep your responsibility, history and WIP.\n'
161
+ 'Publication alone is not consumption, native host loading, code adoption or business acceptance.')
162
+
163
+ def plan_shared(self, view_id, targets):
164
+ from .worker_channel import channel_epoch
165
+ self.store.assert_writable()
166
+ self._view(view_id)
167
+ if not isinstance(targets, list) or not 1 <= len(targets) <= 24:
168
+ fail('Plan requires 1-24 explicit chat bindings.', 'INVALID_ARGUMENT')
169
+ groups, rows, seen = {}, [], set()
170
+ with self.store.guard():
171
+ for target in targets:
172
+ allowed = {'workspace', 'task_id', 'thread_id', 'source_id', 'host', 'code_assessment', 'writes', 'replaces_thread_id'}
173
+ if not isinstance(target, dict) or set(target) - allowed:
174
+ fail('Unsupported shared target fields.', 'INVALID_ARGUMENT')
175
+ workspace, task_id, tid = (target.get(k) for k in ('workspace', 'task_id', 'thread_id'))
176
+ key = chat_key(tid)
177
+ if key in seen:
178
+ fail('Each original chat can occur only once in a plan.', 'INVALID_ARGUMENT')
179
+ seen.add(key)
180
+ root = self._directory_binding(workspace, task_id)
181
+ assert_chat_identity(self, tid, workspace, task_id)
182
+ if target.get('source_id', self.source()['source_id']) not in self._source_ids():
183
+ fail('Chat belongs to another governance source.', 'WORKBENCH_SOURCE_MISMATCH')
184
+ prior = self._chat_pointer(tid)
185
+ if prior and any(prior[k] != target[k] for k in ('workspace', 'task_id', 'thread_id')):
186
+ fail('Retain the original chat task and workspace; publication cannot rebind it.', 'WORKBENCH_BINDING_MISMATCH')
187
+ legacy = self._pointer(workspace)
188
+ if legacy:
189
+ old = self.store.get('workbench_receipts', legacy['receipt_id'])
190
+ if old['thread_id'] == tid and old['task_id'] != task_id:
191
+ fail('Retain the original legacy chat task.', 'WORKBENCH_BINDING_MISMATCH')
192
+ assessment = target.get('code_assessment')
193
+ if (not isinstance(assessment, dict) or set(assessment) != {'status', 'reason'}
194
+ or assessment['status'] not in {'NO_CODE_DEPENDENCY', 'ALREADY_CONTAINS', 'SEPARATE_CODE_PLAN_REQUIRED'}
195
+ or not isinstance(assessment['reason'], str) or not 1 <= len(assessment['reason'].strip()) <= 2000):
196
+ fail('Each chat needs a bounded code-dependency assessment.', 'INVALID_ARGUMENT')
197
+ host = target.get('host', 'codex')
198
+ if host not in ('codex', 'none'):
199
+ fail('Unsupported host.', 'INVALID_ARGUMENT')
200
+ did = self._directory_id(root)
201
+ if did not in groups:
202
+ current = self._directory_current(root)
203
+ router = self._router(root, current)
204
+ groups[did] = {'directory_id': did, 'root': str(root), 'workspace': workspace,
205
+ 'previous': current, 'router': router, 'git': git_snapshot(root), 'writes': [], 'codex': False}
206
+ group = groups[did]
207
+ if group['workspace'] != workspace:
208
+ fail('Use one registered workspace per shared directory; do not alias the same root.')
209
+ group['codex'] = group['codex'] or host == 'codex'
210
+ route = {'thread_id': tid, 'task_id': task_id, 'workspace': workspace, 'binding_id': key,
211
+ 'current_path': str(self._path('chats', key + '.json'))}
212
+ old_route = next((r for r in group['router']['routes'] if r['thread_id'] == tid), None)
213
+ if old_route and old_route != route:
214
+ fail('Existing original-chat routing identity differs.', 'WORKBENCH_BINDING_MISMATCH')
215
+ if old_route is None:
216
+ group['router']['routes'].append(route)
217
+ if len(group['router']['routes']) > 100:
218
+ fail('Shared directory routing is bounded to 100 chats.', 'INVALID_ARGUMENT')
219
+ row = {**route, 'source_id': self.source()['source_id'], 'root': str(root), 'host': host,
220
+ 'directory_id': did, 'previous': prior, 'code_assessment': assessment, 'writes': []}
221
+ if 'replaces_thread_id' in target:
222
+ old_id = target['replaces_thread_id']
223
+ chat_key(old_id)
224
+ old = self._chat_pointer(old_id) or legacy_current_receipt(self, workspace) or {}
225
+ capture = self.store.get('capture_sessions', old_id) or {}
226
+ incoming = self.store.get('capture_sessions', tid) or {}
227
+ epoch = channel_epoch(self.store)
228
+ verified_route = (old.get('thread_id'), old.get('workspace'), old.get('task_id')) == (old_id, workspace, task_id)
229
+ verified_capture = (capture.get('epoch'), capture.get('workspace_id'), capture.get('task_id')) == (epoch, workspace, task_id)
230
+ if not (verified_route or verified_capture) or (verified_capture and incoming and incoming.get('owner') != capture['owner']):
231
+ fail('Name the previous chat for this role, task and workspace.', 'WORKBENCH_BINDING_MISMATCH')
232
+ for chat in (old_id, tid):
233
+ if (self.store.get('capture_retirements', chat) or {}).get('epoch') == epoch:
234
+ fail('This chat already retired; read the current handoff.', 'WORKBENCH_BINDING_MISMATCH')
235
+ row['replaces_thread_id'] = old_id
236
+ specs = target.get('writes', [])
237
+ if not isinstance(specs, list) or len(specs) > 16:
238
+ fail('At most 16 explicit private writes per chat.', 'INVALID_ARGUMENT')
239
+ paths = set()
240
+ for spec in specs:
241
+ if not isinstance(spec, dict) or set(spec) - {'path', 'mode', 'section_id', 'text', 'expected_sha256'}:
242
+ fail('Unsupported write fields.', 'INVALID_ARGUMENT')
243
+ rel = spec.get('path')
244
+ path = private_target(root, rel)
245
+ if rel.casefold() in {'.codex/config.toml', ROUTER.casefold(), *paths}:
246
+ fail('A shared target cannot replace its router/config or duplicate a path.', 'INVALID_ARGUMENT')
247
+ paths.add(rel.casefold())
248
+ old, body = _read(path), spec.get('text')
249
+ if not isinstance(body, str) or len(body.encode()) > 256 * 1024:
250
+ fail('Navigation text must be bounded.', 'INVALID_ARGUMENT')
251
+ mode = spec.get('mode', 'managed_section')
252
+ if mode == 'managed_section':
253
+ new = managed_section(old, spec.get('section_id', 'navigation'), body)
254
+ elif mode == 'exact' and 'expected_sha256' in spec and spec['expected_sha256'] == _hash(old):
255
+ new = body.encode()
256
+ else:
257
+ fail('Exact writes need the actual expected hash.')
258
+ write = self._write_record(rel, old, new)
259
+ existing = next((w for w in group['writes'] if w['path'].casefold() == rel.casefold()), None)
260
+ if existing is not None and existing != write:
261
+ fail('Two chats propose conflicting bytes for the same directory file.')
262
+ if existing is None:
263
+ group['writes'].append(write)
264
+ row['writes'].append({'path': rel, 'sha256': write['after']})
265
+ rows.append(row)
266
+ replaced = [r['replaces_thread_id'] for r in rows if 'replaces_thread_id' in r]
267
+ if len(replaced) != len(set(replaced)) or set(replaced).intersection(r['thread_id'] for r in rows):
268
+ fail('A handoff must have distinct previous and incoming chats.', 'INVALID_ARGUMENT')
269
+ for group in groups.values():
270
+ root = Path(group['root'])
271
+ original = legacy_current_receipt(self, group['workspace'])
272
+ if group['previous'] is None and original:
273
+ handed_off = any(r.get('replaces_thread_id') == original['thread_id'] and
274
+ (r['workspace'], r['task_id']) == (group['workspace'], original['task_id']) for r in rows)
275
+ if not handed_off and not any(r['thread_id'] == original['thread_id'] and r['task_id'] == original['task_id']
276
+ for r in group['router']['routes']):
277
+ fail('Include the existing original chat in the first shared publication; retain its task and history.',
278
+ 'WORKBENCH_BINDING_MISMATCH')
279
+ group['router']['routes'].sort(key=lambda r: r['thread_id'])
280
+ router_path = private_target(root, ROUTER)
281
+ group['writes'].append(self._write_record(ROUTER, _read(router_path), canonical(group['router'])))
282
+ # Once enabled, future host-neutral publication must not remove the existing adapter.
283
+ if group['codex'] or (group['previous'] or {}).get('codex'):
284
+ group['codex'] = True
285
+ path = private_target(root, '.codex/config.toml')
286
+ old = _read(path)
287
+ group['writes'].append(self._write_record('.codex/config.toml', old,
288
+ codex_instructions(old, self._shared_instructions(root))))
289
+ del group['router']
290
+ plan = {'schema': PLAN, 'source': self.source(), 'view_id': view_id,
291
+ 'targets': rows, 'directories': list(groups.values())}
292
+ if len(canonical(plan)) > MAX_PLAN_BYTES:
293
+ fail('Split this shared plan into bounded batches.', 'INVALID_ARGUMENT')
294
+ pid = digest_bytes(canonical(plan))
295
+ with self.store.transaction():
296
+ self._object('workbench_plans', pid, plan)
297
+ immutable(self._path('plans', pid + '.json'), canonical(plan))
298
+ return {'plan_id': pid, 'view_id': view_id, 'routing': 'shared', 'effects_executed': False,
299
+ 'targets': [{k: r[k] for k in ('workspace', 'task_id', 'thread_id', 'binding_id', 'replaces_thread_id')
300
+ if k in r} for r in rows],
301
+ 'directories': [{'root': g['root'], 'writes': [{k:v for k,v in w.items() if k != 'content'} for w in g['writes']]} for g in groups.values()],
302
+ 'plan_path': str(self._path('plans', pid + '.json'))}
303
+
304
+ def _shared_plan(self, pid):
305
+ self._sha(pid, 'Plan ID')
306
+ plan = self.store.get('workbench_plans', pid)
307
+ if not plan or plan.get('schema') != PLAN or digest_bytes(canonical(plan)) != pid:
308
+ fail('Shared plan is missing, changed or unsupported.')
309
+ if not self._same_local_source(plan['source']):
310
+ fail('Shared plan belongs to another control/replica; make a new local plan.')
311
+ return plan
312
+
313
+ def execute_shared(self, pid):
314
+ results = []
315
+ self.store.assert_writable()
316
+ with self.store.guard():
317
+ plan = self._shared_plan(pid)
318
+ self._view(plan['view_id'])
319
+ for group in plan['directories']:
320
+ rows = [r for r in plan['targets'] if r['directory_id'] == group['directory_id']]
321
+ directory_results = []
322
+ try:
323
+ root = self._directory_binding(group['workspace'])
324
+ if str(root) != group['root']:
325
+ fail('The workspace location changed.')
326
+ before = self._directory_current(root)
327
+ expected = {'schema': 'taskcarry.workbench.directory.v2', 'directory_id': group['directory_id'],
328
+ 'source_id': self.source()['source_id'], 'workspace': group['workspace'], 'root': str(root),
329
+ 'plan_id': pid, 'codex': group['codex'],
330
+ 'router_sha256': next(w['after'] for w in group['writes'] if w['path'] == ROUTER),
331
+ 'config_sha256': next((w['after'] for w in group['writes'] if w['path'] == '.codex/config.toml'), None)}
332
+ if before not in (group['previous'], expected):
333
+ results.extend({'workspace': r['workspace'], 'thread_id': r['thread_id'], 'status': 'SUPERSEDED'} for r in rows)
334
+ continue
335
+ if git_snapshot(root) != group['git']:
336
+ fail('Git identity, HEAD or index changed after planning; retain WIP and re-plan.')
337
+ for row in rows:
338
+ self._task(row['task_id'])
339
+ assert_chat_identity(self, row['thread_id'], row['workspace'], row['task_id'])
340
+ pointer = self._chat_pointer(row['thread_id'])
341
+ if pointer != row['previous'] and (pointer or {}).get('plan_id') != pid:
342
+ fail('A chat acquired a newer publication; keep it and re-plan.')
343
+ acknowledged = before == expected or any(self.store.get('workbench_receipts', pid + '.' + r['binding_id']) for r in rows)
344
+ for write in group['writes']:
345
+ allowed = (write['after'],) if acknowledged else (write['before'], write['after'])
346
+ if _hash(_read(private_target(root, write['path']))) not in allowed:
347
+ fail('A shared target changed; preserve it and re-plan: ' + write['path'])
348
+ for write in group['writes']:
349
+ path = private_target(root, write['path'])
350
+ actual = _hash(_read(path))
351
+ if actual == write['after']:
352
+ continue
353
+ if actual != write['before']:
354
+ fail('A shared target changed during publication.')
355
+ atomic_write(path, base64.b64decode(write['content'], validate=True))
356
+ if (git_snapshot(root) != group['git'] or any(_hash(_read(private_target(root, w['path']))) != w['after'] for w in group['writes'])):
357
+ fail('Verify partial actual effects before resuming.')
358
+ for row in rows:
359
+ receipt_id = pid + '.' + row['binding_id']
360
+ pointer = {'schema': 'taskcarry.workbench.current.v2', 'plan_id': pid, 'view_id': plan['view_id'],
361
+ 'receipt_id': receipt_id, **{k: row[k] for k in ('workspace','task_id','thread_id','source_id','binding_id')}}
362
+ receipt = self.store.get('workbench_receipts', receipt_id)
363
+ if receipt is None:
364
+ receipt = {**pointer, 'schema': 'taskcarry.workbench.receipt.v2', 'status': 'PUBLISHED',
365
+ 'directory_id': group['directory_id'], 'root': str(root), 'writes': row['writes'],
366
+ 'published_at': now(), 'code_assessment': row['code_assessment'],
367
+ 'git_before': group['git'], 'git_after': group['git'], 'consumer_state': 'NOT_VERIFIED'}
368
+ with self.store.transaction():
369
+ self._object('workbench_receipts', receipt_id, receipt)
370
+ immutable(self._path('receipts', receipt_id + '.json'), canonical(receipt))
371
+ atomic_write(self._path('chats', row['binding_id'] + '.json'), canonical(pointer))
372
+ with self.store.transaction():
373
+ self.store.put('workbench_chat_current', row['binding_id'], pointer)
374
+ directory_results.append({'workspace': row['workspace'], 'thread_id': row['thread_id'], 'task_id': row['task_id'],
375
+ 'status': 'PUBLISHED', 'receipt_id': receipt_id, 'view_id': plan['view_id'], 'consumer_state': 'NOT_VERIFIED'})
376
+ with self.store.transaction():
377
+ for row in rows:
378
+ if 'replaces_thread_id' in row:
379
+ from .conversation_capture import retire_chat
380
+ retire_chat(self.store, row['replaces_thread_id'], row['thread_id'],
381
+ row['task_id'], row['workspace'])
382
+ self.store.put('workbench_directory_current', group['directory_id'], expected)
383
+ self.store.event('shared_workbench_published', expected)
384
+ results.extend(directory_results)
385
+ except (GovernanceError, OSError, ValueError) as exc:
386
+ results.extend({'workspace': r['workspace'], 'thread_id': r['thread_id'], 'status': 'CONFLICT',
387
+ 'code': getattr(exc, 'code', type(exc).__name__), 'error': str(exc)[:1000]} for r in rows)
388
+ return {'plan_id': pid, 'routing': 'shared', 'results': results,
389
+ 'status': 'COMPLETED' if all(r['status'] == 'PUBLISHED' for r in results) else 'PARTIAL', 'business_accepted': False}
390
+
391
+ def consume_shared(self, proof):
392
+ self.store.assert_writable()
393
+ keys = {'workspace','plan_id','view_id','task_id','source_id','thread_id','turn_id','evidence_path','evidence_sha256','reviewer','observed_at'}
394
+ if not isinstance(proof, dict) or set(proof) != keys or any(not isinstance(v,str) or not v.strip() or len(v)>1000 for v in proof.values()):
395
+ fail('Provide exact bounded original-chat consumption evidence.', 'INVALID_ARGUMENT')
396
+ with self.store.guard():
397
+ plan = self._shared_plan(proof['plan_id'])
398
+ key = chat_key(proof['thread_id'])
399
+ row = next((r for r in plan['targets'] if r['binding_id'] == key and r['workspace'] == proof['workspace']), None)
400
+ rid = proof['plan_id'] + '.' + key
401
+ receipt = self.store.get('workbench_receipts', rid)
402
+ if not row or not receipt or any(proof[k] != receipt[k] for k in ('workspace','view_id','task_id','source_id','thread_id')):
403
+ fail('Consumption must match this exact published chat, task and view.')
404
+ evidence = validate_relative_path(self.root, proof['evidence_path'], allow_missing=False)
405
+ if _hash(_read(evidence)) != self._sha(proof['evidence_sha256'], 'Evidence hash'):
406
+ fail('Reviewed evidence is missing or changed.')
407
+ record = {'schema': 'taskcarry.workbench.consumption.v2', **proof, 'receipt_id': rid,
408
+ 'meaning': 'Caller-reviewed evidence; not independently verified native loading.'}
409
+ cid = digest_bytes(canonical(record))
410
+ with self.store.transaction():
411
+ self._object('workbench_consumption', cid, record)
412
+ self.store.put('workbench_consumed', rid, {'consumption_id': cid})
413
+ immutable(self._path('consumption', cid + '.json'), canonical(record))
414
+ return {'consumption_id': cid, 'receipt_id': rid, 'consumer_state': 'REVIEWED_EVIDENCE_RECORDED',
415
+ 'current_view': (self._chat_pointer(proof['thread_id']) or {}).get('plan_id') == proof['plan_id'], 'native_acceptance_verified': False}
416
+
417
+ def _shared_item(self, pointer):
418
+ tid, workspace = pointer['thread_id'], pointer['workspace']
419
+ if self._chat_pointer(tid) != pointer:
420
+ fail('Current shared pointer finalization needs review.')
421
+ root = self._directory_binding(workspace, pointer['task_id'])
422
+ plan = self._shared_plan(pointer['plan_id'])
423
+ row = next(r for r in plan['targets'] if r['thread_id'] == tid)
424
+ if row['root'] != str(root):
425
+ fail('The original work directory moved.')
426
+ directory = self._directory_current(root)
427
+ group = next(g for g in plan['directories'] if g['directory_id'] == row['directory_id'])
428
+ pending = directory is None or directory == group['previous']
429
+ router = self._router(root, directory)
430
+ route = next((r for r in router['routes'] if r['thread_id'] == tid), None)
431
+ matches = (route is not None and all(route[k] == pointer[k] for k in ('workspace','task_id','thread_id','binding_id'))
432
+ and all(_hash(_read(private_target(root,w['path']))) == w['sha256'] for w in row['writes']))
433
+ if directory and directory.get('codex'):
434
+ raw = _read(private_target(root, '.codex/config.toml'))
435
+ matches = matches and _hash(raw) == directory['config_sha256']
436
+ chosen = self.store.get('workbench_consumed', pointer['receipt_id'], {})
437
+ evidence = self.store.get('workbench_consumption', chosen.get('consumption_id',''))
438
+ consumed = 'NOT_VERIFIED'
439
+ if evidence:
440
+ path = validate_relative_path(self.root, evidence['evidence_path'])
441
+ consumed = 'REVIEWED_EVIDENCE_RECORDED' if _hash(_read(path)) == evidence['evidence_sha256'] else 'EVIDENCE_CHANGED_OR_MISSING'
442
+ return {**pointer, 'state': 'PUBLISHED' if matches else 'ENTRY_CHANGED', 'consumer_state': consumed,
443
+ 'consumption_id': chosen.get('consumption_id'), 'finalization_pending': pending,
444
+ 'source_freshness': self._freshness(self._view(pointer['view_id'])),
445
+ 'view_path': str(self._path('views',pointer['view_id'],'view.md')),
446
+ 'current_path': str(self._path('chats',pointer['binding_id']+'.json')), 'native_acceptance_verified': False}
447
+
448
+ def status_shared(self, workspace=None, thread_id=None, limit=20, cursor=None):
449
+ if type(limit) is not int or not 1 <= limit <= 100 or (cursor is not None and (not isinstance(cursor,str) or len(cursor)>256)):
450
+ fail('Use a bounded shared status page.', 'INVALID_ARGUMENT')
451
+ if workspace is not None:
452
+ _id(workspace, 'Workspace')
453
+ if thread_id is not None:
454
+ chat_key(thread_id)
455
+ with self.store._connect(readonly=True) as db:
456
+ # Union retained v1 workspaces and v2 chat pointers; avoid double counting a shared directory.
457
+ sql = """SELECT locator, kind, value FROM (
458
+ SELECT 'c:'||key AS locator, 'chat' AS kind, value FROM records WHERE collection='workbench_chat_current'
459
+ UNION ALL
460
+ SELECT 'w:'||key, 'legacy', value FROM records w WHERE collection='workspaces'
461
+ AND NOT EXISTS (SELECT 1 FROM records d WHERE d.collection='workbench_directory_current'
462
+ AND json_extract(d.value,'$.workspace')=w.key)
463
+ ) WHERE locator>? AND (? IS NULL OR (kind='chat' AND json_extract(value,'$.workspace')=?)
464
+ OR (kind='legacy' AND json_extract(value,'$.name')=?))
465
+ AND (? IS NULL OR kind='legacy' OR json_extract(value,'$.thread_id')=?)
466
+ ORDER BY locator LIMIT ?"""
467
+ rows = db.execute(sql,(cursor or '',workspace,workspace,workspace,thread_id,thread_id,limit+1)).fetchall()
468
+ result = []
469
+ for locator, kind, raw in rows[:limit]:
470
+ value = json.loads(raw)
471
+ if kind == 'legacy':
472
+ old = super()._status(value['name'], 1, None)['items']
473
+ result.extend(r for r in old if thread_id is None or r.get('thread_id') == thread_id)
474
+ continue
475
+ try:
476
+ result.append(self._shared_item(value))
477
+ except (GovernanceError,OSError,ValueError,KeyError,StopIteration) as exc:
478
+ result.append({**value, 'state':'UNVERIFIED', 'error':str(exc)[:1000]})
479
+ return {'source': self.source(), 'items': result, 'next_cursor': rows[limit-1][0] if len(rows)>limit else None,
480
+ 'read_only': True, 'routing':'shared', 'meaning':'Exact chat routing; no task is inferred from directory or list order.'}
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: taskcarry-experience-recovery
3
+ description: Diagnose a concrete TaskCarry failure and apply or propose a condition-bound recovery. Use after an actual tool failure or interrupted operation, not for routine historical rechecking.
4
+ ---
5
+
6
+ # Conditional recovery / 条件经验恢复
7
+
8
+ The separate [conditional project experience](../taskcarry-task-delivery/references/conditional-experience.md)
9
+ tools store business lessons and natural outcomes. They never authorize a shell
10
+ command or an operation repair. Keep this skill's fixed technical recovery
11
+ actions and their effect verification separate from those project suggestions.
12
+
13
+ First distinguish a host-chat failure from lost project data or a failed Core operation. Repeated compaction errors may require an on-demand replacement chat using the [original-task handoff](../taskcarry-project-setup/references/onboarding.md#continue-an-original-task-when-its-chat-cannot-continue). Verify the old writer has stopped, retain error/effect evidence and the original task/control, then validate the new chat's native connection and useful continuation. Do not repeat complete setup or restore an intact project for a conversation failure. Saved project memory can support continuation; it does not repair the host's compaction service or reconstruct unsaved/unread history.
14
+
15
+ For a failed full governance cycle, inspect its exact owner/resource reservation and effect records; resume the same identity and verify effects before changing a receipt. Health is multidimensional and expires with its evidence. Unknown or stale is not healthy; one waiting item is not global failure. Question reminders count actual delivery receipts on distinct local dates, never retries or scan appearances. The default unanswered-date budget is two; preserve the question after the limit instead of repeatedly notifying.
16
+
17
+ For project-level recovery, use the separate `recovery` plan/execute/verify interface. A selected-file `restore` is not a full project restore. Preserve state plus referenced objects, selected history/index/WIP and required external materials in a sealed set. Restore to an independent standby copy, retain the original, inspect disabled host entries and rebind native access. Old executable plans/cycles are historical evidence, not replay instructions. Activate one writer only with an explicit handoff and exact old-replica declaration; the tool cannot independently fence another computer. Keep encryption keys and credentials outside the portable set.
18
+
19
+ For private publication or static media copying, use exact `transfer` plans. Verify remote effects after a transport failure before retrying; never force an old tag or expand to all refs. A verified copy into a sync folder proves local bytes only. Verify retrieval and isolated restoration before calling it offsite recovery. Tool/package rollback must use a compatible retained environment and current project state; do not restore an old database over decisions created after an update.
20
+
21
+ Start with the current error code, operation journal and actual Git/file effects. If an effect already happened, preserve that fact and repair only missing bookkeeping. Do not infer absence from a missing receipt, erase old evidence, or repeat the complete workflow.
22
+
23
+ For interrupted setup or restore, inspect that operation's saved intent and files, then use its own supported continuation contract. Receiving experience actions are not generic restore commands. Preserve user edits and candidate identity; a new package or changed target is not automatically the same retry. Missing host access is an onboarding gap until evidence shows a product failure.
24
+
25
+ TaskCarry's experience rules are data, not shell programs. `verify_and_finalize` lets the receiving executor verify an already-applied Git effect and finish its receipt. `refresh_plan` is planning advice: where a saved operation proves that no effect was applied and has no candidate or stash, the agenda can return a structured `plan_request` with `execute: false`. It never silently replaces or executes a plan. Review the original failure and changed conditions, request the new plan, then review its exact scope before execution. Bind rules to the observed code and operation; add task scope when the evidence is task-specific. Enabled/version checks and applicability must hold before use.
26
+
27
+ For receipt recovery, repeat the original bounded governance call so the engine verifies effects and uses an applicable rule. Inspect the returned experience-use and completion evidence. A matching rule, or reading its suggestion, is not proof of a repair. If the effect cannot be established or the condition changed, retain the actionable issue and identify the missing fact. Repeating an unchanged preparation failure is not progress; resolve its concrete conflict or retain its next condition. Do not discard the journal to restart a transaction.
28
+
29
+ Unknown defects can produce a candidate fix and synthetic regression scenario within authorized development scope. Validate the initial failure, the corrected outcome, replay safety and a negative non-applicable case before proposing a public rule/tool update. Never experiment on a user's live unrelated task. Record whether only scripts, simulated clients or an actual AI/host integration were tested.
30
+
31
+ For a defect that needs continuing maintenance, use `taskcarry_issue` with a stable condition fingerprint, then `taskcarry_fix` to link the tested fix, version and evidence references. A changed condition reopens review; closing an issue requires a reviewed resolution reference and cannot close an unfinished Git operation. Identical records are reused. The fix result compares actual project setup and disk fingerprints; an installed version match still does not prove that another running host process reloaded it. A shared fix belongs in the tool or Skill release so future work can prevent the failure, not only repair it repeatedly. `taskcarry_upgrade` repairs the derived current-work index for an older store; it does not upgrade the package, install Skills, or change business branches.
32
+
33
+ Keep fix development, reception, publication, installation, host reload and observed outcome as separate evidence. Record applicable version and actual adoption when available. Writing experience is not installing a fix. Public improvements remove private paths, transcripts and project-specific dependencies and reproduce the condition with synthetic material.
34
+
35
+ 中文:经验闭环应降低源头复现,也应帮助中断接续。条件经验不能扩大权限,不能把过期经验强套新任务。未知情况保留实际证据,形成可验证的修正候选,不让一个任务冻结全项目。
36
+
37
+ Use `governance` to inspect package, managed-method and user-rule content identities before maintenance. Retain project customizations and tie the review to exact fingerprints; a saved review does not attest host loading. The official `update_check` and explicit `update_assess` distinguish an available release from an applicable repair. A new release, recorded fix, local install and resolved original condition each need their own evidence. A failed network check is unverified, not proof that the installed release is latest.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: taskcarry-governance-reconcile
3
+ description: Give a read-only takeover briefing for an existing project (接手项目、接管项目、交接盘点), reconcile explicit deliveries, or run an authorized scheduled governance pass.
4
+ ---
5
+
6
+ # Governance reconciliation / 治理接收
7
+
8
+ If the user asks for a fresh window for an existing worker, give them a [filled-in same-role invitation](../taskcarry-project-setup/references/onboarding.md#switch-a-worker-to-a-fresh-chat-in-the-same-workspace). Read the current assignment, stopping point and exact relevant source revisions before handing it over.
9
+
10
+ Use [conditional project experience](../taskcarry-task-delivery/references/conditional-experience.md)
11
+ when a relevant experience or feedback changed. Review the exact revision,
12
+ current decisions and actual evidence. Project promotion and local pause are
13
+ explicit scoped plans; feedback alone must not stop a task. Include the resulting
14
+ reason and current version in the ordinary project update. Unchanged history
15
+ is not a new backlog, and this method does not require another schedule.
16
+
17
+ For a configured governor/worker channel, use the [member workflow](../taskcarry-task-delivery/references/worker-channel.md) and `worker_brief` pending handbacks. Read exact shared source revisions, then record `worker_disposition` for that exact handback version. A review draft may be submitted before finalization. Publishing it needs no additional governor approval within previously granted sharing scope. Keep pending work until actually handled; earlier received revisions cannot close later drafts. Update affected project views and share the resulting decision sources; only their actual authors report readback. The same bounded method works in a manual or user-enabled scheduled turn; never launch other AI chats merely to make validation pass. This supplements the legacy stage/reconcile workflow below.
18
+
19
+ When the user asks to take over an existing project, understand where it stands, or report what to do next, start with the [project assessment](references/daily-governance.md#read-only-project-takeover). Follow the intent in the user's own words. Use the selected project's evidence and deliver the briefing in this chat. Assess before onboarding, starting a cycle, join intake or scheduled reconciliation. A request only to assess remains read-only; an explicit request to migrate or take over integration also uses the [authorized migration route](references/daily-governance.md#authorized-project-migration). Carry forward authorization already given in the current session.
20
+
21
+ On each scheduled progress review or report, or when asked about new chats, follow [join intake](references/daily-governance.md#pick-up-chats-that-joined-this-project). An invited working chat leaves a receipt in this project. Review it once, record intake and include the role and next step in the next delivered report.
22
+
23
+ Use `cycle` for a complete bounded governance pass: retain owner/task/resource scope, reserve it once, and resume its exact unfinished effects. Ordinary MCP/CLI calls take an OS lock while executing and keep a durable reservation between calls; only a live Python `cycle_session` holds the OS lock for the whole session. Do not claim a database lock spans AI turns. `run` below remains the existing selected-delivery receipt aggregate and does not replace the wider cycle.
24
+
25
+ Keep source identity and revision through observed, understood, published and consumed phases. `source_scan` inventories only explicitly authorized local metadata with bounded pages and a durable continuation; host tools or the `codex` adapter supply authorized chat content separately. Metadata coverage does not prove understanding or deletion. Use `facts` for current, historical, disputed or superseded facts, decisions and relationships; retain source evidence separately from AI judgment, and use revision checks when content changes.
26
+
27
+ After understanding a change, assess rules/progress for every affected workbench. Use immutable `workbench` views, exact publication plans and separate consumption receipts; native host evidence is still required. Business/code adoption follows a real dependency, not merely a new governance view. A conflict in one workbench leaves others independently resumable. Do not overwrite professional instructions, staged files or user configuration.
28
+
29
+ Maintain governance and project memory for explicitly connected work. Preserve independent working chats; users may continue directly in their assigned scope. Offer a project assessment when requested or during onboarding, and coordinate ongoing priorities when the user chooses that role. One-time suggestions do not authorize permanent dispatch or scheduling. Reuse the same control and task identities when the working mode changes.
30
+
31
+ Review effective decisions, named tasks and source versions before requesting conversation history. Keep confirmed decisions, understanding candidates and suggestions separate; unconfirmed drafts do not replace the effective record. Report the coverage and time of reviewed evidence. Reconcile saved task progress and artifacts with project understanding, and make relevant effective references available for later work. This uses existing records and host capabilities, not automatic monitoring of all chats.
32
+
33
+ Start with `taskcarry_agenda` for a bounded current-work selection. Follow `next_cursor` while the input fingerprint remains valid; changed input requires a fresh selection. `changed: false` is a comparison, not proof that pending work is resolved. The agenda never executes, retries or starts another agent. Use `taskcarry_status` when full recorded detail is needed. Distinguish explicit deliveries from checkpoints and unchanged retained task state. Use task, artifact and commit evidence to understand relationships. Formatting differences or an old observation alone do not prove a current business fault. Missing evidence remains missing; do not fabricate author statements or approvals.
34
+
35
+ When relevant host evidence is available within the user's scope, use `taskcarry_observe` to preserve the reviewed source reference, source revision, task/workspace and explicit relationships. Read existing observations in `status.continuity` when needed; reuse unchanged evidence and use its `expected_revision` for updates. The engine validates record relationships, not the truth of chat content. A changed source or deliverable requires rechecking the affected relationship, not rescanning every conversation. Missing host access remains a concrete next condition, not proof that the material is unrelated.
36
+
37
+ For a multi-step delivery intake, use `taskcarry_run` to freeze the selected stage, operation and observation identities. Resume an unfinished recorded run before creating a duplicate. Keep the original frozen selection and note; do not rebuild its start payload from newer state. `mode: finish` checks durable terminal receipts for that selection and retains unfinished items; it does not execute Git or certify current external files again. Inspect changed observations separately. A completed run never closes the entire project or erases later deliveries. Initial project understanding is a real bounded governance cycle; an empty delivery queue needs no invented delivery or business task.
38
+
39
+ Call `taskcarry_reconcile` with the registered baseline, `execute: false` and a suitable `limit` (default 20, maximum 100). The count bounds selected receiving work, including unfinished receipts; an agenda page is not an execution scope. Inspect the actual returned plan, then execute that exact `plan_id` within existing user authorization. Plan completion only covers its frozen selection: inspect the separately reported remaining work before describing the current queue. A later delivery belongs to a later plan. First verify the actual effects of unfinished operations and resume applicable missing steps. When relevant inputs invalidate a plan and no applied effect requires continuation, inspect the error and request a fresh plan. Do not force an update, add unlisted paths, replay an accepted stage, push remotely, or declare business acceptance.
40
+
41
+ Use `taskcarry_adopt` only when a task needs the accepted business/code baseline, previewing and executing its exact plan. Preserve local commits, index, unstaged and new files. Updating toolkit Skills or reading shared progress does not require adopting a business branch. A specific conflict limits that workspace; unrelated tasks continue. The tools' own scope checks do not constrain arbitrary shell commands or grant new user permissions.
42
+
43
+ Report actual accepted stages, retained work, actionable failures and the next condition directly in the governance chat. For the first onboarding pass, also state the installed version, connection actually checked and registered workspaces/tasks. An empty project can be ready for work; do not invent tasks, commits or deliveries. Reuse that result for schedule setup instead of launching a demonstration Automation. The same Skill and tools support manual and scheduled turns; scheduling is configured separately in the host. Daily reports use existing records, without a separate reporting service.
44
+
45
+ For standard original-chat scheduling, follow [daily governance](references/daily-governance.md), including local Git saving and official release checking/assessment. Keep one writer per state source and receiving baseline; a real-world project can route to several existing sources. An optional observer only reads. Use bounded `context` before requesting chat history. Available host tools or the packaged `codex` adapter may read specifically selected context within their verified coverage; neither implies automatic all-chat monitoring. A scheduled turn need not scan every historical receipt or exhaust every page. Preserve an explicit next condition at a safe boundary. Separate deep product repairs from routine intake, and notify on meaningful change, failure or required action.
46
+
47
+ 中文:AI 依据实际任务和交付证据判断关联,内核验证并执行有限操作。先计划后执行,只续缺步。公共更新与成果接收不同,技术成功也不等于业务验收;不要用单一 PASS 代替这些状态。