compose-application 0.1.0a1__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.
@@ -0,0 +1,93 @@
1
+ """Real-process checked editing acceptance for the optional table profile."""
2
+
3
+ import asyncio
4
+ from dataclasses import asdict, replace
5
+ import json
6
+ from pathlib import Path
7
+ import sys
8
+ from tempfile import TemporaryDirectory
9
+
10
+ from .tabular import dependencies, tabular_application, transport
11
+
12
+
13
+ async def edit_phase(database, phase):
14
+ from expose_api import serve
15
+ checks = 0
16
+ def check(value):
17
+ nonlocal checks
18
+ if not value:
19
+ raise RuntimeError("Editable table acceptance failed.")
20
+ checks += 1
21
+ async with tabular_application(database, seed=phase == "write", editable=True) as service:
22
+ async with serve(service.app, port=0) as server:
23
+ client = transport(f"http://127.0.0.1:{server.sockets[0].getsockname()[1]}")
24
+ async def request(path, data):
25
+ return await asyncio.to_thread(client.request, "POST", "/work-items/_table/" + path, data=data)
26
+ def edit(**values):
27
+ return dict(table_id="work_items", key="item-055", column_id="title", expected_revision="1", value="Edited durable row", **values)
28
+ async def query(**values):
29
+ data = dict(generation=1, columns=["title", "done", "rank", "score", "key"], order=[], search=None, cursor=None, limit=50)
30
+ data.update(values)
31
+ return await request("query", data)
32
+ if phase == "write":
33
+ original = await service.store.get_row("item-055")
34
+ visible = await query(order=[dict(column_id="title", descending=True)], search=dict(fields=["title"], term="%_"))
35
+ check(visible.status == 200 and [r["key"] for r in visible.data["rows"]] == ["item-055"])
36
+ saved = await request("cell", edit())
37
+ check(saved.status == 200 and saved.data["row"]["revision"] == "2" and saved.data["row"]["values"]["title"] == "Edited durable row")
38
+ current = await service.store.get_row("item-055")
39
+ check(asdict(current.value) == {**asdict(original.value), "title": "Edited durable row"})
40
+ all_rows = await query(limit=1000)
41
+ check(next(r for r in all_rows.data["rows"] if r["key"] == "item-055")["revision"] == "2")
42
+ stale = await request("cell", {**edit(), "column_id": "done", "value": True})
43
+ check(stale.status == 409 and stale.data["error"]["code"] == "revision_conflict")
44
+ for patch, status in [({"value": ""}, 422), ({"column_id": "key", "value": "other"}, 422),
45
+ ({"column_id": "owner", "value": "bob"}, 422), ({"value": "policy-denied"}, 403),
46
+ ({"column_id": "rank", "value": True}, 422), ({"column_id": "rank", "value": -1}, 422)]:
47
+ response = await request("cell", {**edit(), "expected_revision": "2", **patch})
48
+ check(response.status == status)
49
+ check(await service.store.get_row("item-055") == current)
50
+ denied = await request("cell", {**edit(), "key": "item-000", "expected_revision": "9"})
51
+ check(denied.status == 404)
52
+ await service.store.update_checked("item-055", expected_revision="2", transform=lambda value: replace(value, owner="bob"))
53
+ changed_policy = await request("cell", {**edit(), "expected_revision": "2"})
54
+ check(changed_policy.status == 404)
55
+ await service.store.update_checked("item-055", expected_revision="3", transform=lambda value: replace(value, owner="alice"))
56
+ # Simultaneous different-cell writes use one row revision.
57
+ results = await asyncio.gather(request("cell", {**edit(), "key": "item-056", "value": "Concurrent winner"}),
58
+ request("cell", {**edit(), "key": "item-056", "column_id": "done", "value": False}))
59
+ check(sorted(r.status for r in results) == [200, 409])
60
+ independent = await request("cell", {**edit(), "key": "item-057", "column_id": "rank", "value": None})
61
+ check(independent.status == 200)
62
+ elif phase == "reopen":
63
+ row = await service.store.get_row("item-055")
64
+ check((row.value.title, row.value.owner, row.revision) == ("Edited durable row", "alice", "4"))
65
+ page = await query(filters=[dict(column_id="key", operator="eq", value="item-055")])
66
+ check(page.status == 200 and page.data["rows"][0]["revision"] == "4")
67
+ check((await service.store.get_row("item-056")).revision == "2")
68
+ check((await service.store.get_row("item-057")).value.rank is None)
69
+ else:
70
+ raise ValueError("Unknown edit acceptance phase.")
71
+ check(not service.store._backend._thread.is_alive())
72
+ return dict(phase=phase, checks=checks, passed=True, closed=True)
73
+
74
+
75
+ async def accept_edits():
76
+ dependencies()
77
+ receipts = []
78
+ code = "import asyncio,json,sys; from compose_application.tabular_edits import edit_phase; print(json.dumps(asyncio.run(edit_phase(sys.argv[1],sys.argv[2]))))"
79
+ with TemporaryDirectory(prefix="editable-tabular-") as directory:
80
+ for phase in ("write", "reopen"):
81
+ process = await asyncio.create_subprocess_exec(sys.executable, "-I", "-c", code, str(Path(directory) / "items.sqlite"), phase,
82
+ stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
83
+ try:
84
+ output, errors = await asyncio.wait_for(process.communicate(), 30)
85
+ if process.returncode:
86
+ raise RuntimeError("Editable acceptance process failed: " + errors.decode(errors="replace")[-2000:])
87
+ receipts.append(json.loads(output))
88
+ finally:
89
+ if process.returncode is None:
90
+ process.kill()
91
+ await process.communicate()
92
+ return dict(profile="cpython-tabular/1", checks=sum(r["checks"] for r in receipts), phases=receipts,
93
+ process_restart=True, editable=True, passed=True)
@@ -0,0 +1,191 @@
1
+ """Application-owned terminal source; runtime libraries remain independent."""
2
+ from dataclasses import dataclass
3
+ import json
4
+
5
+ CARET_SOURCE = 'pypi:carets==0.2.0'
6
+ INTERFACE_SOURCE = 'pypi:expose-interface==0.1.0'
7
+
8
+
9
+ @dataclass(frozen=True)
10
+ class TerminalProjectSpec:
11
+ """An explicit terminal profile selecting two independent library sources."""
12
+ name: str
13
+
14
+ def __post_init__(self):
15
+ from .projects import ProjectSpec
16
+ ProjectSpec(self.name, 'service') # Reuse the existing safe name policy.
17
+ if self.module in ('carets', 'expose_interface'):
18
+ raise ValueError('Choose a project name that does not shadow a terminal dependency.')
19
+
20
+ @property
21
+ def module(self):
22
+ return self.name.replace('-', '_')
23
+
24
+ @property
25
+ def profile(self):
26
+ return 'terminal'
27
+
28
+ @property
29
+ def dependencies(self):
30
+ return ('carets==0.2.0',
31
+ 'expose-interface==0.1.0')
32
+
33
+ def selection(self):
34
+ return {'format': 'terminal-project/1', 'name': self.name, 'profile': self.profile,
35
+ 'sources': {'carets': CARET_SOURCE, 'expose-interface': INTERFACE_SOURCE}}
36
+
37
+
38
+ APP = '''"""Owned domain model and Carets presentation for a finite offline workflow."""
39
+ import asyncio
40
+ from dataclasses import dataclass
41
+ import sys
42
+
43
+ from carets import (CellDiffRenderer, Command, CommandErrorMsg, KeyMsg, Msg, Program,
44
+ TerminalOptions, TerminalSession, WindowSizeMsg, truncate_ansi)
45
+ from carets.testing import SnapshotRenderer
46
+
47
+
48
+ @dataclass(frozen=True)
49
+ class Progress(Msg):
50
+ stage: str
51
+
52
+
53
+ async def stages():
54
+ # Replace this explicit finite source with your application service.
55
+ for stage in ('prepare', 'run', 'completed'):
56
+ yield Progress(stage)
57
+ await asyncio.sleep(0)
58
+
59
+
60
+ class Application:
61
+ def __init__(self, *, exit_on_completion=False):
62
+ self.status, self.width, self.height = 'ready', 80, 24
63
+ self.program = None
64
+ self.exit_on_completion = exit_on_completion
65
+
66
+ def update(self, message):
67
+ if isinstance(message, WindowSizeMsg):
68
+ self.width, self.height = max(1, message.width), max(1, message.height)
69
+ elif isinstance(message, Progress):
70
+ self.status = message.stage
71
+ if self.status == 'completed' and self.exit_on_completion:
72
+ self.program.stop()
73
+ elif isinstance(message, CommandErrorMsg):
74
+ self.status = 'failed'
75
+ if self.exit_on_completion:
76
+ self.program.stop()
77
+ elif isinstance(message, KeyMsg) and message.key in ('q', 'ctrl-c'):
78
+ self.program.stop()
79
+
80
+ def view(self):
81
+ lines = ['__PROJECT_NAME__', 'Status: ' + self.status, 'q quit']
82
+ return '\\n'.join(truncate_ansi(line, self.width) for line in lines[:self.height])
83
+
84
+
85
+ class Renderer:
86
+ def __init__(self, model):
87
+ self.model, self.size, self.renderer = model, None, None
88
+
89
+ def render(self, view):
90
+ size = self.model.width, self.model.height
91
+ if self.size != size:
92
+ self.size, self.renderer = size, CellDiffRenderer(*size)
93
+ return self.renderer.render(view)
94
+
95
+
96
+ async def check():
97
+ model = Application(exit_on_completion=True)
98
+ renderer = SnapshotRenderer()
99
+ import io
100
+ program = model.program = Program(model, renderer=renderer, output_stream=io.StringIO(), stream_buffer=2)
101
+ await asyncio.wait_for(program.run([], stop_on_eof=False, commands=[Command.stream(stages)]), 2)
102
+ if model.status != 'completed' or 'completed' not in renderer.latest:
103
+ raise RuntimeError('Terminal reference did not reach verified completion')
104
+ return {'schema': 1, 'status': model.status, 'frames': len(renderer.frames)}
105
+
106
+
107
+ async def terminal():
108
+ session = TerminalSession(sys.stdin.buffer, sys.stderr, options=TerminalOptions(alternate_screen=True))
109
+ if not session.capabilities.tty or not session.capabilities.raw:
110
+ raise ValueError('Interactive mode requires a supported POSIX TTY')
111
+ model = Application()
112
+ program = model.program = Program(model, renderer=Renderer(model), terminal=session,
113
+ input_stream=sys.stdin.buffer, output_stream=sys.stderr, stream_buffer=32)
114
+ await program.run(commands=[Command.stream(stages)])
115
+ return {'schema': 1, 'status': model.status}
116
+ '''
117
+
118
+ COMMAND = '''"""Typed Expose Interface commands over the same application."""
119
+ import contextlib
120
+ import json
121
+ import sys
122
+
123
+ from expose_interface import Interface, UsageError
124
+ from . import app as application
125
+
126
+
127
+ def main():
128
+ interface = Interface('__PROJECT_NAME__', description='Application-owned terminal reference.')
129
+ interface.command(name='check')(application.check)
130
+ interface.command(name='terminal')(application.terminal)
131
+ try:
132
+ with contextlib.redirect_stdout(sys.stderr):
133
+ result = interface.invoke()
134
+ if result is not None:
135
+ print(json.dumps(result, allow_nan=False))
136
+ if result.get('status') != 'completed':
137
+ raise SystemExit(1)
138
+ except Exception as error:
139
+ print(json.dumps({'schema': 1, 'status': 'failed', 'error': type(error).__name__}), file=sys.stderr)
140
+ raise SystemExit(2 if isinstance(error, UsageError) else 1) from None
141
+
142
+
143
+ if __name__ == '__main__':
144
+ main()
145
+ '''
146
+
147
+
148
+ def render_terminal_project(spec):
149
+ metadata = f'''[project]
150
+ name = "{spec.name}"
151
+ version = "0.1.0"
152
+ requires-python = ">=3.14"
153
+ dependencies = {json.dumps(list(spec.dependencies))}
154
+
155
+ [project.scripts]
156
+ {spec.name} = "{spec.module}.__main__:main"
157
+
158
+ [build-system]
159
+ requires = ["uv_build>=0.12.19,<0.13.0"]
160
+ build-backend = "uv_build"
161
+ '''
162
+ readme = f'''# {spec.name}
163
+
164
+ An application-owned terminal project using Expose Interface plus Carets.
165
+ Python 3.14+ and uv are required. Library versions are selected explicitly in
166
+ `reference-project.json`; no umbrella composition runtime is required.
167
+
168
+ ```sh
169
+ uv sync
170
+ uv run {spec.name} check
171
+ uv run {spec.name} terminal
172
+ ```
173
+
174
+ `check` runs the real message/model/renderer loop headlessly and prints one JSON
175
+ result. `terminal` opens a supported POSIX terminal, streams three finite offline
176
+ stages and waits for q to quit. One Program/TerminalSession owns input/output and
177
+ cleanup. Windows is qualified for headless behavior only. The domain source,
178
+ commands and presentation are yours in `src/{spec.module}/`; replace the finite
179
+ source with explicit application services and handle their outcomes/authority.
180
+
181
+ Generation installs nothing. A matching repeat preserves your edits and data;
182
+ a mismatched existing destination is refused. Existing service/ui/live project
183
+ profiles keep their qualified sources. Package publication and deployment are
184
+ separate concrete operations.
185
+ '''
186
+ return {'pyproject.toml': metadata, 'README.md': readme,
187
+ '.gitignore': '.venv/\n__pycache__/\n*.py[cod]\n.env\n',
188
+ 'reference-project.json': json.dumps(spec.selection(), sort_keys=True, indent=2) + '\n',
189
+ f'src/{spec.module}/__init__.py': '"""Application-owned terminal project."""\n',
190
+ f'src/{spec.module}/app.py': APP.replace('__PROJECT_NAME__', spec.name),
191
+ f'src/{spec.module}/__main__.py': COMMAND.replace('__PROJECT_NAME__', spec.name)}
@@ -0,0 +1,178 @@
1
+ """Optional loopback typed UI over the persistent checked work-item reference."""
2
+
3
+ import argparse
4
+ import asyncio
5
+ from importlib import metadata
6
+ import json
7
+ from pathlib import Path
8
+ import sys
9
+ from tempfile import TemporaryDirectory
10
+ import threading
11
+
12
+ from .service import ProfileError
13
+
14
+ STYLESHEET = """* { box-sizing: border-box; }
15
+ body { margin: 0; color: #15243b; background: #f4f6fa; font: 16px/1.5 system-ui, sans-serif; }
16
+ main { max-width: 1100px; margin: auto; padding: 1.25rem; }
17
+ .workspace { display: grid; gap: 1.25rem; }
18
+ section { background: white; border: 1px solid #d5deea; border-radius: .75rem; padding: 1rem; min-width: 0; }
19
+ form { display: grid; gap: .6rem; }
20
+ form > div { display: grid; gap: .25rem; }
21
+ input, select, textarea, button { font: inherit; max-width: 100%; }
22
+ input[type=text], textarea, select { width: 100%; padding: .5rem; border: 1px solid #718096; border-radius: .3rem; }
23
+ button { padding: .6rem 1rem; background: #193f7b; color: white; border: 0; border-radius: .3rem; cursor: pointer; }
24
+ :focus-visible { outline: 3px solid #bc5e00; outline-offset: 3px; }
25
+ [aria-invalid=true] { outline: 2px solid #a32020; }
26
+ li, dd { overflow-wrap: anywhere; }
27
+ dd { margin-bottom: .5rem; }
28
+ @media (min-width: 760px) { .workspace { grid-template-columns: 2fr 1fr; align-items: start; } }
29
+ @media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
30
+ """
31
+
32
+
33
+ def _ui_dependencies():
34
+ try:
35
+ if metadata.version("spatial-ui") != "0.1.1":
36
+ raise ProfileError("The UI package version does not match the qualified profile.")
37
+ from spatial_ui import App, Component, Field, FormSchema, Session, html
38
+ from spatial_ui.resource_form import ResourceForm
39
+ from spatial_ui.rest import HTTPTransport, ResourceClient, ResourceSpec, TransportError
40
+ except (ImportError, metadata.PackageNotFoundError):
41
+ raise ProfileError("Install compose-application[ui] with its qualified development revisions.") from None
42
+ return App, Component, Field, FormSchema, Session, html, ResourceForm, HTTPTransport, ResourceClient, ResourceSpec, TransportError
43
+
44
+
45
+ def resource_client(origin):
46
+ """Build the explicit scalar work-item wire profile without ambient credentials."""
47
+ _, _, Field, FormSchema, _, _, _, HTTPTransport, ResourceClient, ResourceSpec, _ = _ui_dependencies()
48
+ schema = FormSchema((Field("key"), Field("title"), Field("done", "checkbox", False, False)))
49
+ return ResourceClient(HTTPTransport(origin), ResourceSpec("/work-items", schema, ("key", "title", "done")))
50
+
51
+
52
+ def make_ui(origin, *, client=None, live=None):
53
+ """Return a fresh-session loopback App; the caller owns the API's lifecycle."""
54
+ App, Component, _, _, _, html, ResourceForm, _, _, _, TransportError = _ui_dependencies()
55
+ client = resource_client(origin) if client is None else client
56
+
57
+ class Workspace(Component):
58
+ def __init__(self):
59
+ self.editor = ResourceForm(client, title="Edit a work item", **({"live": live} if live is not None else {}))
60
+ self.items, self.message = (), ""
61
+ self.refresh()
62
+
63
+ def refresh(self):
64
+ try:
65
+ self.items = client.list(limit=50)
66
+ self.message = "List refreshed."
67
+ except TransportError:
68
+ self.message = "List unavailable. Refresh to try again."
69
+
70
+ def render(self):
71
+ rows = [html(t'<li><strong>{item["key"]}</strong>: {item["title"]} — {"Done" if item["done"] else "Open"}</li>') for item in self.items]
72
+ return html(t'''<main><h1>Work items</h1>
73
+ <p>Save a record, then load it in another browser to edit the same data.</p>
74
+ <div class="workspace">{self.editor}<section key="list"><h2>Saved items</h2>
75
+ <button type="button" on_click={self.refresh}>Refresh list</button>
76
+ <p role="status">{self.message}</p><ul>{rows}</ul>
77
+ </section></div></main>''')
78
+ return App(Workspace, title="Work items", stylesheet=STYLESHEET)
79
+
80
+
81
+ async def _accept_ui_phase(database, phase):
82
+ from .reference import reference_application
83
+ from expose_api import serve
84
+ _, _, _, _, Session, _, ResourceForm, *_ = _ui_dependencies()
85
+ async with reference_application(database) as service:
86
+ async with serve(service.app, port=0) as server:
87
+ client = resource_client(f"http://127.0.0.1:{server.sockets[0].getsockname()[1]}")
88
+ checks = 0
89
+ def check(value):
90
+ nonlocal checks
91
+ if not value:
92
+ raise RuntimeError(f"Typed UI acceptance failed during {phase}.")
93
+ checks += 1
94
+ async def submit(session, **values):
95
+ snapshot = session.render()
96
+ fields = {**session.component.binding.draft, "operation": "save", **values}
97
+ return await asyncio.to_thread(session.dispatch, snapshot.event_ids[0], snapshot.version,
98
+ {"kind": "submit", "fields": fields})
99
+ first, second = Session(ResourceForm(client)), Session(ResourceForm(client))
100
+ if phase == "write":
101
+ invalid = await submit(first, key="item-001", title="")
102
+ check(invalid.form_result.status == "invalid" and invalid.form_result.as_dict()["focus"] == "title")
103
+ check((await submit(first, key="item-001", title="Garden 🌱")).form_result.status == "saved")
104
+ check((await submit(second, key="item-001", operation="load")).form_result.status == "loaded")
105
+ check((await submit(first, title="Changed remotely")).form_result.status == "saved")
106
+ check((await submit(second, title="Local merge")).form_result.status == "conflict")
107
+ check(second.component.binding.draft["title"] == "Local merge")
108
+ check((await submit(second, operation="load")).form_result.status == "loaded")
109
+ check(second.component.binding.draft["title"] == "Local merge" and second.component.binding.committed["title"] == "Changed remotely")
110
+ check((await submit(second)).form_result.status == "saved")
111
+ check((await submit(second, title="x" * 201)).form_result.status == "invalid")
112
+ check((await asyncio.to_thread(client.list))[0]["title"] == "Local merge")
113
+ elif phase == "reload":
114
+ check((await submit(first, key="item-001", operation="load")).form_result.status == "loaded")
115
+ check(first.component.binding.committed["title"] == "Local merge" and first.component.binding.revision == "3")
116
+ check((await submit(first, operation="delete")).form_result.status == "deleted")
117
+ check(await asyncio.to_thread(client.list) == ())
118
+ else:
119
+ raise ValueError("Select a known acceptance phase.")
120
+ return {"phase": phase, "checks": checks, "passed": True}
121
+
122
+
123
+ async def accept_ui():
124
+ """Qualify public forms/REST in two processes over a dedicated temporary DB."""
125
+ _ui_dependencies()
126
+ receipts = []
127
+ code = "import asyncio,json,sys; from compose_application.ui import _accept_ui_phase; print(json.dumps(asyncio.run(_accept_ui_phase(sys.argv[1],sys.argv[2]))))"
128
+ with TemporaryDirectory(prefix="typed-ui-acceptance-") as directory:
129
+ for phase in ("write", "reload"):
130
+ process = await asyncio.create_subprocess_exec(sys.executable, "-I", "-c", code,
131
+ str(Path(directory) / "items.sqlite3"), phase, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
132
+ try:
133
+ output, errors = await asyncio.wait_for(process.communicate(), 30)
134
+ if process.returncode:
135
+ raise RuntimeError(f"UI acceptance process failed during {phase}: " + errors.decode("utf-8", errors="replace")[-4000:])
136
+ receipts.append(json.loads(output))
137
+ finally:
138
+ if process.returncode is None:
139
+ process.kill()
140
+ await process.communicate()
141
+ return {"profile": "cpython-ui/1", "checks": sum(item["checks"] for item in receipts),
142
+ "phases": receipts, "process_restart": True}
143
+
144
+
145
+ def main():
146
+ parser = argparse.ArgumentParser(description=__doc__)
147
+ commands = parser.add_subparsers(dest="command", required=True)
148
+ commands.add_parser("check", help="verify typed form/REST persistence across processes")
149
+ server = commands.add_parser("serve", help="run the local persistent work-item UI")
150
+ server.add_argument("--database", type=Path, required=True)
151
+ server.add_argument("--port", type=int, default=8000)
152
+ args = parser.parse_args()
153
+ async def run():
154
+ if args.command == "check":
155
+ print(json.dumps(await accept_ui(), sort_keys=True))
156
+ return
157
+ from .reference import reference_application
158
+ from expose_api import serve
159
+ async with reference_application(args.database) as service:
160
+ async with serve(service.app, port=0) as api:
161
+ origin = f"http://127.0.0.1:{api.sockets[0].getsockname()[1]}"
162
+ with make_ui(origin).make_server(args.port) as ui:
163
+ thread = threading.Thread(target=ui.serve_forever, kwargs={"poll_interval": 0.05}, daemon=True)
164
+ thread.start()
165
+ try:
166
+ print(f"Work items: http://127.0.0.1:{ui.server_port}", flush=True)
167
+ await asyncio.Event().wait()
168
+ finally:
169
+ await asyncio.to_thread(ui.shutdown)
170
+ thread.join(5)
171
+ try:
172
+ asyncio.run(run())
173
+ except KeyboardInterrupt:
174
+ pass
175
+
176
+
177
+ if __name__ == "__main__":
178
+ main()
@@ -0,0 +1,161 @@
1
+ Metadata-Version: 2.4
2
+ Name: compose-application
3
+ Version: 0.1.0a1
4
+ Summary: Optional composition of typed storage, APIs and spatial interfaces.
5
+ Author: ellainng
6
+ License-Expression: MIT
7
+ License-File: LICENSE.md
8
+ Requires-Dist: expose-api[backpack]==0.2.0 ; extra == 'live'
9
+ Requires-Dist: spatial-ui==0.1.1 ; extra == 'live'
10
+ Requires-Dist: expose-api[backpack]==0.2.0 ; extra == 'service'
11
+ Requires-Dist: expose-api[backpack]==0.2.0 ; extra == 'tabular'
12
+ Requires-Dist: spatial-ui==0.1.1 ; extra == 'tabular'
13
+ Requires-Dist: headless-spreadsheets==0.1.1 ; extra == 'tabular'
14
+ Requires-Dist: expose-api[backpack]==0.2.0 ; extra == 'ui'
15
+ Requires-Dist: spatial-ui==0.1.1 ; extra == 'ui'
16
+ Requires-Dist: expose-api[backpack,enforce-type]==0.2.0 ; extra == 'validation'
17
+ Requires-Python: >=3.14
18
+ Project-URL: Source, https://github.com/wispsy/compose_application
19
+ Project-URL: Issues, https://github.com/wispsy/compose_application/issues
20
+ Project-URL: Project, https://github.com/orgs/wispsy/projects/18
21
+ Provides-Extra: live
22
+ Provides-Extra: service
23
+ Provides-Extra: tabular
24
+ Provides-Extra: ui
25
+ Provides-Extra: validation
26
+ Description-Content-Type: text/markdown
27
+
28
+ # compose_application
29
+
30
+ Initial PyPI preview: **0.1.0a1**. Optional profiles use published independent
31
+ packages; generated projects select exact package-index versions.
32
+ [Wispsy Releases](https://github.com/orgs/wispsy/projects/31) distinguishes
33
+ published artifacts from main development. Historical qualification manifests
34
+ remain unchanged; index qualification uses docs/release-sources-v1.json.
35
+
36
+ The optional [compiled validation reference](docs/validation-reference.md)
37
+ selects the expose-api Enforce Type adapter explicitly and qualifies it through
38
+ persistent checked HTTP and independent process restart.
39
+
40
+ Optional composition of typed storage, APIs and spatial interfaces.
41
+
42
+ `compose_application` is the application integration home for **Cohesion Block A**.
43
+ It coordinates optional use of `backpack-store`, `expose-api` and `spatial-ui`,
44
+ with `enforce-type` validation and a pocket-python Track B application target.
45
+
46
+ - Repository: `wispsy/compose_application`
47
+ - Distribution: `compose-application`
48
+ - Import: `compose_application`
49
+ - Python: 3.14 or newer
50
+ - Runtime dependencies: none in the initial package foundation
51
+
52
+ The component libraries remain independently useful and independently released.
53
+ Application profiles explicitly select integrations and dependencies. The source
54
+ provides owned persistent REST and typed UI references. Track B browser-local
55
+ runtime support retains its separate application gates.
56
+
57
+ ## Plan and development queue
58
+
59
+ - [Tabular Interfaces plan](IMPLEMENTATION_PLAN.md) and
60
+ [cross-repository Project](https://github.com/orgs/wispsy/projects/19)
61
+ - [Cohesion Block A Project](https://github.com/orgs/wispsy/projects/18)
62
+ - [Architecture charter](docs/cohesion-block-a.md)
63
+ - [Shared contract register](docs/contracts.md)
64
+ - [Track B workload and prerequisite probes](docs/track-b-workload.md)
65
+ - [Roadmap and owning issues](docs/roadmap.md)
66
+
67
+ Issues hold scope, acceptance criteria and dependencies. The organization Project
68
+ coordinates the repositories without replacing their existing development queues.
69
+ The initial batch establishes contracts, canonical storage naming, the validation
70
+ adapter and an extraction inventory of Pretty Notebook's storage behavior.
71
+
72
+ ## Development
73
+
74
+ ```sh
75
+ uv sync --locked
76
+ uv run --locked python scripts/check_contracts.py
77
+ uv run --locked python -m unittest discover -s tests
78
+ uv run --locked python scripts/check_distribution.py
79
+ ```
80
+
81
+ The distribution check builds and installs both wheel and source distributions
82
+ into independent temporary environments outside the checkout. CI runs it on
83
+ Linux, macOS and Windows using Python 3.14.
84
+
85
+ No release has been published for this project. Package publication and hosted
86
+ deployment require their own selected scope and authorization. License terms
87
+ will be selected before publication.
88
+ ## Service composition
89
+
90
+ The optional [CPython service profile](docs/service-profile.md) provides explicit
91
+ configuration and an asynchronous application context owning validated storage,
92
+ the typed resource and the ASGI app. Install with `uv sync --extra service`;
93
+ base imports remain independent of the integration packages.
94
+
95
+ The [persistent REST reference](docs/rest-reference.md) adds synthetic work-item
96
+ CRUD with checked revisions and real HTTP/process-restart acceptance. Run
97
+ `python -m compose_application.reference check` in the selected service environment.
98
+
99
+ The [compatibility matrix](docs/compatibility.md) qualifies immutable minimum
100
+ and current development profiles, installed artifacts and code-upgrade recovery.
101
+ CI retains exact per-platform receipts; browser application acceptance remains
102
+ separate from CPython service support.
103
+
104
+ ## Typed UI reference
105
+
106
+ The optional [persistent typed UI](docs/ui-reference.md) combines public spatial_ui
107
+ forms with the checked REST reference. Use `uv sync --locked --extra ui`, then
108
+ `uv run --locked --extra ui python -m compose_application.ui serve --database ./work-items.sqlite3`.
109
+ The preview remains on loopback, with independent browser drafts, checked edits,
110
+ explicit conflict/merge choices and durable SQLite records. The `check` command
111
+ provides 15 form/REST checks across process restart; CI also exercises the actual
112
+ UI in Chromium and the optional profile in installed wheel/source environments.
113
+
114
+ The optional [protected native live reference](docs/live-reference.md) adds
115
+ same-origin cookie verification, per-principal native UI sessions and persistent
116
+ single-record WebSocket snapshots. Install with `uv sync --locked --extra live`.
117
+ The caller supplies existing credentials and a WebSocket-capable ASGI host;
118
+ publication and public hosting remain separate.
119
+
120
+ ## Reference projects
121
+
122
+ Create a small application-owned reference with an explicit profile:
123
+
124
+ ```sh
125
+ python -m compose_application.projects ./garden-board --name garden-board --profile ui
126
+ cd garden-board
127
+ uv sync
128
+ uv run garden-board check
129
+ uv run garden-board serve --database ./work-items.sqlite3
130
+ ```
131
+
132
+ Select `service` for checked REST, `ui` for the loopback typed workspace, or
133
+ `live` for a protected native ASGI factory with caller-supplied credentials,
134
+ origin and host. Each project pins the accepted immutable composition source.
135
+ Generation installs nothing. Matching repeat requests leave owner edits and
136
+ data untouched. See the [layout, setup and acceptance](docs/reference-projects.md).
137
+
138
+ The optional [persistent read-only and editable table reference](docs/tabular-reference.md)
139
+ provides dataset sorting, literal search, column controls and pagination over
140
+ protected registered records without changing stored values or revisions.
141
+ Explicit editable mode adds checked scalar saves, preserved conflict drafts
142
+ and process-restart acceptance; a separate headless example uses the same rows.
143
+
144
+ ## Terminal applications
145
+
146
+ Generate an application-owned Expose Interface + Carets project with:
147
+
148
+ ```sh
149
+ uv run python -m compose_application.projects ./progress-desk --name progress-desk --profile terminal
150
+ cd progress-desk
151
+ uv sync
152
+ uv run progress-desk check
153
+ uv run progress-desk terminal
154
+ ```
155
+
156
+ `TerminalProjectSpec` selects independent immutable library sources and reuses
157
+ the existing exclusive creation/repeat-preservation behavior. Generated source
158
+ owns the finite application service, Carets model and typed commands; it does
159
+ not require a Compose Application runtime. `check` is headless; interactive
160
+ terminal input currently requires POSIX. Existing service/ui/live source
161
+ selections remain compatible. See [terminal projects](docs/terminal-projects.md).
@@ -0,0 +1,16 @@
1
+ compose_application/__init__.py,sha256=Aun7iI_LuOc5M6GJOMlwRQRa2_oC3ESA4Mc2OicdvuM,297
2
+ compose_application/headless_tabular.py,sha256=TXvhF0A5krVGLEu2syJM1INFkyPIkjMkphadt0oRsAI,3583
3
+ compose_application/live.py,sha256=ScKG56E8Od8bYdwANB2glhffU6yjAZTAfvHFv57g8-k,16877
4
+ compose_application/project_templates.py,sha256=oqRKLHyQAoq4VhXAYeCOZQvyRKgMXttOM5SCI5oGOVg,17544
5
+ compose_application/projects.py,sha256=ZSkdlIQji-ZcsWLfW1K2zobsc_cRxlLEfwchyfdb6LY,11707
6
+ compose_application/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
7
+ compose_application/reference.py,sha256=6bWPxtx4fshYtxscDimK3oyAqQ6ftZvk69AWZIW7kII,12069
8
+ compose_application/service.py,sha256=j8FyjC7HS5kg6QKwJHiQu8qTmKAsBAvwdx7BkwmnBjs,6015
9
+ compose_application/tabular.py,sha256=QStBwyO_9KXIgLH1fPqUZa7EVOc2nb3xQMrs7Ai1peQ,12983
10
+ compose_application/tabular_edits.py,sha256=IcPSWickD0ayBQTYvum3NdntAeIfgXkALkGB5Mow_wA,6078
11
+ compose_application/terminal_templates.py,sha256=P7D5LCJC9mKvnAYrIe6Gk49nKOCGl8_OuBtlyWAqBKc,7182
12
+ compose_application/ui.py,sha256=KvP1LBShNQSA9evgf8MK1OrwROfSxG6Fdh8aN-4HqaQ,9770
13
+ compose_application-0.1.0a1.dist-info/licenses/LICENSE.md,sha256=dJjxPlUliHO6iuJiKxsIn0HSnRRb-dp_8lpVtAunRj8,1063
14
+ compose_application-0.1.0a1.dist-info/WHEEL,sha256=G_-rrEibZr7OEM7zdH1dSO6s-VdjfnS5PA4CLAdI9Vw,80
15
+ compose_application-0.1.0a1.dist-info/METADATA,sha256=I1a_9WiUL2J8X_yrdgAHo2ISBewTsFvSJfmNUS0taGc,7596
16
+ compose_application-0.1.0a1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.13.9
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any