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.
- taskcarry/__init__.py +3 -0
- taskcarry/__main__.py +4 -0
- taskcarry/adapter_contracts.py +166 -0
- taskcarry/agy_turns.py +282 -0
- taskcarry/api.py +111 -0
- taskcarry/board.py +313 -0
- taskcarry/board_assets/board.css +1087 -0
- taskcarry/board_assets/board.js +1187 -0
- taskcarry/board_assets/browse.js +214 -0
- taskcarry/board_assets/index.html +43 -0
- taskcarry/board_assets/taskcarry-icon.ico +0 -0
- taskcarry/board_assets/taskcarry-mark.svg +28 -0
- taskcarry/board_data.py +466 -0
- taskcarry/chat_joins.py +157 -0
- taskcarry/cli.py +119 -0
- taskcarry/codex_capture.py +184 -0
- taskcarry/codex_host.py +293 -0
- taskcarry/collaboration_exchange.py +316 -0
- taskcarry/connection.py +159 -0
- taskcarry/continuity.py +300 -0
- taskcarry/contracts.py +165 -0
- taskcarry/conversation_capture.py +669 -0
- taskcarry/core.py +896 -0
- taskcarry/cycle_contracts.py +73 -0
- taskcarry/discovery.py +434 -0
- taskcarry/discovery_contracts.py +52 -0
- taskcarry/exchange_contracts.py +67 -0
- taskcarry/exchange_endpoint.py +377 -0
- taskcarry/exchange_packets.py +142 -0
- taskcarry/experience_contracts.py +129 -0
- taskcarry/experience_exchange.py +214 -0
- taskcarry/experience_notes.py +433 -0
- taskcarry/experience_storage.py +125 -0
- taskcarry/experience_tools.py +26 -0
- taskcarry/feishu/__init__.py +1 -0
- taskcarry/feishu/display.py +122 -0
- taskcarry/feishu/project_watch.py +145 -0
- taskcarry/feishu/review_sets.py +80 -0
- taskcarry/feishu/sender.py +42 -0
- taskcarry/feishu/subscription.py +193 -0
- taskcarry/feishu/windows_agent.py +287 -0
- taskcarry/feishu/windows_secret.py +34 -0
- taskcarry/gitops.py +170 -0
- taskcarry/governance.py +88 -0
- taskcarry/governance_cycle.py +775 -0
- taskcarry/identification.py +82 -0
- taskcarry/integration.py +663 -0
- taskcarry/maintenance.py +118 -0
- taskcarry/mcp.py +183 -0
- taskcarry/member_join.py +184 -0
- taskcarry/member_routing.py +145 -0
- taskcarry/onboarding.py +272 -0
- taskcarry/onboarding_complete.py +252 -0
- taskcarry/path_batches.py +19 -0
- taskcarry/preservation.py +257 -0
- taskcarry/project_collaboration.py +453 -0
- taskcarry/project_history.py +166 -0
- taskcarry/project_identity.py +51 -0
- taskcarry/project_recovery.py +824 -0
- taskcarry/recovery_contracts.py +25 -0
- taskcarry/recovery_files.py +153 -0
- taskcarry/recovery_git.py +234 -0
- taskcarry/remote_capture.py +89 -0
- taskcarry/remote_transfer.py +356 -0
- taskcarry/role_connection.py +215 -0
- taskcarry/setup.py +597 -0
- taskcarry/shared_workbench.py +480 -0
- taskcarry/skill_data/taskcarry-experience-recovery/SKILL.md +37 -0
- taskcarry/skill_data/taskcarry-governance-reconcile/SKILL.md +47 -0
- taskcarry/skill_data/taskcarry-governance-reconcile/references/daily-governance.md +72 -0
- taskcarry/skill_data/taskcarry-project-setup/SKILL.md +48 -0
- taskcarry/skill_data/taskcarry-project-setup/references/onboarding.md +198 -0
- taskcarry/skill_data/taskcarry-task-delivery/SKILL.md +32 -0
- taskcarry/skill_data/taskcarry-task-delivery/references/conditional-experience.md +93 -0
- taskcarry/skill_data/taskcarry-task-delivery/references/worker-channel.md +41 -0
- taskcarry/source_review_set.py +80 -0
- taskcarry/state_format.py +47 -0
- taskcarry/store.py +472 -0
- taskcarry/task_context.py +141 -0
- taskcarry/text_handback.py +98 -0
- taskcarry/transfer_contracts.py +18 -0
- taskcarry/updates.py +351 -0
- taskcarry/workbench.py +625 -0
- taskcarry/workbench_contracts.py +32 -0
- taskcarry/workbuddy_capture.py +451 -0
- taskcarry/workbuddy_setup.py +212 -0
- taskcarry/worker_channel.py +859 -0
- taskcarry/worker_contracts.py +190 -0
- taskcarry/worker_storage.py +60 -0
- taskcarry/worker_tools.py +111 -0
- taskcarry-0.3.2.dist-info/METADATA +203 -0
- taskcarry-0.3.2.dist-info/RECORD +105 -0
- taskcarry-0.3.2.dist-info/WHEEL +5 -0
- taskcarry-0.3.2.dist-info/entry_points.txt +5 -0
- taskcarry-0.3.2.dist-info/licenses/LICENSE +21 -0
- taskcarry-0.3.2.dist-info/licenses/LICENSE_SCOPE.md +31 -0
- taskcarry-0.3.2.dist-info/top_level.txt +2 -0
- taskcarry_https/__init__.py +1 -0
- taskcarry_https/consent.py +207 -0
- taskcarry_https/reader.py +132 -0
- taskcarry_https/review.py +116 -0
- taskcarry_https/server.py +163 -0
- taskcarry_https/team.py +335 -0
- taskcarry_https/team_host.py +109 -0
- taskcarry_https/web_host.py +82 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""Inspect a selected state location without creating SQLite journals or locks."""
|
|
2
|
+
from contextlib import closing
|
|
3
|
+
import hashlib
|
|
4
|
+
import os
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
import sqlite3
|
|
7
|
+
|
|
8
|
+
from .store import GovernanceError, _linked
|
|
9
|
+
from .state_format import inspect_state
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def source(root, config=None):
|
|
13
|
+
root = str(Path(root).expanduser().resolve())
|
|
14
|
+
legacy = 'local-' + hashlib.sha256(os.path.normcase(root).encode('utf-8')).hexdigest()
|
|
15
|
+
if config and config.get('project_id'):
|
|
16
|
+
return {'source_id': config['project_id'], 'control': root,
|
|
17
|
+
'identity_scope': 'persistent_project', 'replica_id': config.get('replica_id'),
|
|
18
|
+
'aliases': list(dict.fromkeys([*config.get('source_aliases', []), legacy])),
|
|
19
|
+
'record_identity': ['source_id', 'collection', 'local_id'],
|
|
20
|
+
'writer_state': config.get('recovery_writer_state', 'active')}
|
|
21
|
+
return {'source_id': legacy,
|
|
22
|
+
'control': root, 'identity_scope': 'resolved_local_path',
|
|
23
|
+
'record_identity': ['source_id', 'collection', 'local_id']}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def identify(project, initializing=False):
|
|
27
|
+
raw = Path(project).expanduser().absolute()
|
|
28
|
+
result = {'source': source(raw), 'read_only': True, 'effects_executed': False}
|
|
29
|
+
def finish(state, **details):
|
|
30
|
+
return {**result, 'state': state, **details}
|
|
31
|
+
if any(_linked(path) for path in (raw, *raw.parents)):
|
|
32
|
+
return finish('unsafe', reason='linked_project_path')
|
|
33
|
+
if not raw.exists():
|
|
34
|
+
return finish('absent')
|
|
35
|
+
if not raw.is_dir():
|
|
36
|
+
return finish('unknown', reason='project_not_directory')
|
|
37
|
+
directory = raw / '.taskcarry'
|
|
38
|
+
path = directory / 'state.sqlite3'
|
|
39
|
+
if _linked(directory) or _linked(path):
|
|
40
|
+
return finish('unsafe', reason='linked_metadata')
|
|
41
|
+
if not directory.exists():
|
|
42
|
+
return finish('uninitialized')
|
|
43
|
+
if not directory.is_dir():
|
|
44
|
+
return finish('unknown', reason='metadata_not_directory')
|
|
45
|
+
if not path.exists():
|
|
46
|
+
names = {item.name for item in directory.iterdir()}
|
|
47
|
+
if not names or (initializing and names == {'mutation.lock'}):
|
|
48
|
+
return finish('uninitialized')
|
|
49
|
+
return finish('unknown', reason='unrecognized_metadata_without_database')
|
|
50
|
+
if not path.is_file():
|
|
51
|
+
return finish('unknown', reason='database_not_file')
|
|
52
|
+
# immutable mode is deliberately used only when no WAL has pending data.
|
|
53
|
+
# It cannot create -shm/-wal files. Never ignore an existing WAL and guess
|
|
54
|
+
# compatibility from an older database page image.
|
|
55
|
+
wal = path.with_name(path.name + '-wal')
|
|
56
|
+
if _linked(wal):
|
|
57
|
+
return finish('unsafe', reason='linked_journal')
|
|
58
|
+
if wal.exists() and wal.stat().st_size:
|
|
59
|
+
return finish('busy', reason='wal_snapshot_requires_writer_close',
|
|
60
|
+
next_step='Let the current writer close, then inspect again; do not remove its journal.')
|
|
61
|
+
before = (path.stat().st_ino, path.stat().st_size, path.stat().st_mtime_ns)
|
|
62
|
+
try:
|
|
63
|
+
with closing(sqlite3.connect(path.as_uri() + '?mode=ro&immutable=1', uri=True, timeout=0)) as db:
|
|
64
|
+
inspected = inspect_state(db)
|
|
65
|
+
if inspected['state'] not in ('compatible', 'unsupported'):
|
|
66
|
+
return finish(inspected['state'], reason=inspected['reason'])
|
|
67
|
+
config, state = inspected['config'], inspected['state']
|
|
68
|
+
except (sqlite3.DatabaseError, ValueError, TypeError, UnicodeError):
|
|
69
|
+
return finish('corrupt', reason='unreadable_state_format')
|
|
70
|
+
after = (path.stat().st_ino, path.stat().st_size, path.stat().st_mtime_ns)
|
|
71
|
+
if before != after or (wal.exists() and wal.stat().st_size):
|
|
72
|
+
return finish('busy', reason='source_changed_during_inspection')
|
|
73
|
+
result['source'] = source(raw, config)
|
|
74
|
+
return finish(state, schema_version=config['schema_version'], project_name=config.get('name'))
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def require_initializable(result):
|
|
78
|
+
if result['state'] in ('absent', 'uninitialized', 'compatible', 'incomplete'):
|
|
79
|
+
return
|
|
80
|
+
code = {'unsupported': 'SCHEMA_VERSION_UNSUPPORTED', 'unknown': 'STATE_UNRECOGNIZED',
|
|
81
|
+
'corrupt': 'STATE_CORRUPT', 'unsafe': 'UNSAFE_METADATA', 'busy': 'BUSY'}[result['state']]
|
|
82
|
+
raise GovernanceError(code, 'Initialization left this location unchanged; inspect the existing state before continuing.', result)
|