code-coordinator 0.5.366__py3-none-any.whl → 0.5.367__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.
- {code_coordinator-0.5.366.dist-info → code_coordinator-0.5.367.dist-info}/METADATA +1 -1
- {code_coordinator-0.5.366.dist-info → code_coordinator-0.5.367.dist-info}/RECORD +8 -8
- coord/codegen.py +3 -0
- coord/dashboard/server.py +175 -1
- {code_coordinator-0.5.366.dist-info → code_coordinator-0.5.367.dist-info}/WHEEL +0 -0
- {code_coordinator-0.5.366.dist-info → code_coordinator-0.5.367.dist-info}/entry_points.txt +0 -0
- {code_coordinator-0.5.366.dist-info → code_coordinator-0.5.367.dist-info}/licenses/LICENSE +0 -0
- {code_coordinator-0.5.366.dist-info → code_coordinator-0.5.367.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
code_coordinator-0.5.
|
|
1
|
+
code_coordinator-0.5.367.dist-info/licenses/LICENSE,sha256=851BVZZwf_pEv2ydSlMmcZrwnwSS5YJ98wdLze7lyL8,4212
|
|
2
2
|
coord/__init__.py,sha256=3FN2qrrxtW87xSsSD557YcMwHLDahnFK8LvqQI7Wlf4,9783
|
|
3
3
|
coord/_board_mapping.py,sha256=SGq8hC-gsyXHEZe2L58qy6pyOVQvswTpQ5FzPa_vZ8w,11012
|
|
4
4
|
coord/acceptance.py,sha256=v7k1e_shUIjWKolKDQ9oJv67o0O8L659El3grvcF8ns,75452
|
|
@@ -24,7 +24,7 @@ coord/ci_store.py,sha256=LndYzd-wkojjHS6GS_fOaS9JbLuYPX371YPAR7ZOHvQ,30416
|
|
|
24
24
|
coord/claim.py,sha256=3Mxl6nJ8g9exaqYeXqUQIrhx1JqziyIbzvr1pF1qvEY,14389
|
|
25
25
|
coord/cli.py,sha256=pZGKnYbFe0dgGv0io2AOTscnsBnXU0IOCPdkZDwiCuk,20414
|
|
26
26
|
coord/client.py,sha256=P2vc8w86fA4qeyjV3rzpEw1UZiByxCMfAJjl_6h3vs8,47574
|
|
27
|
-
coord/codegen.py,sha256=
|
|
27
|
+
coord/codegen.py,sha256=PByCQ0eiAV7hUHbbRx0Y_NSIcY_aQvcRwZYUJhsYRVg,92953
|
|
28
28
|
coord/comments.py,sha256=89J5IFRHzqkmyCZEE5k-L9mgrvUIX9fStGCOF5rZ9DY,32398
|
|
29
29
|
coord/config.py,sha256=wkCoZ1N29DHZiAjpsJb_T0w2iqLcBWT5AGlAvcnGwho,214696
|
|
30
30
|
coord/config_reload.py,sha256=PK46TMsOTECI-U8OLmgYGCJVn6dsixCEuKe28hcY1S8,4830
|
|
@@ -169,7 +169,7 @@ coord/commands/tui.py,sha256=GX4LsgMk08itlURCgkOKqWgjnv38uIfFSWM3xrz9T_A,18193
|
|
|
169
169
|
coord/dashboard/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
170
170
|
coord/dashboard/fixture.py,sha256=UZVwPNwKq1QCNbcldxUsZ4711hfR9IlDXpbpAPx1pEs,29220
|
|
171
171
|
coord/dashboard/index.html,sha256=XzipoURZAP46Tggas-pSMq8Fb1ETX9TyAJy2ItNVigc,31463
|
|
172
|
-
coord/dashboard/server.py,sha256=
|
|
172
|
+
coord/dashboard/server.py,sha256=RaAxHEf8fSLov5qunMKtpqzsg9hFbF84iQRza-PVnZE,224804
|
|
173
173
|
coord/dashboard/terminal.py,sha256=wR5rfWQCZ0yO5bXCkqa0t-a1g5YAQ-20LC6icZdGWHM,14647
|
|
174
174
|
coord/deploy/README.md,sha256=DG_q36KeW0LQ32ElU11wjfjULO7xGUoiPIFEGPW41k0,1391
|
|
175
175
|
coord/deploy/coord-agent.service,sha256=GSo_2iqCx4zv4-85LGnaINsu-BdPHpG64I8xfULKcUk,6392
|
|
@@ -256,8 +256,8 @@ coord/skills/review-verdict-recovery/SKILL.md,sha256=Grg8GWkJLK20ct2YiigbTFfNOki
|
|
|
256
256
|
coord/skills/tui-quadraui-workflow/SKILL.md,sha256=4hUZza9wSSnPhf0eRAOh2r_MQZxK2pXYO5g-kxmJq-U,3832
|
|
257
257
|
coord/skills/update-issue/SKILL.md,sha256=VrPinEmLZrCSNDrnz96hQomyO403o5c4i0RdsnUnWA0,3642
|
|
258
258
|
coord/templates/deploy-cloudflare.node.yml,sha256=icsTiWn2ziQJnpZODhhFKYlnqjt2xAXsbwlQufdxhuM,2078
|
|
259
|
-
code_coordinator-0.5.
|
|
260
|
-
code_coordinator-0.5.
|
|
261
|
-
code_coordinator-0.5.
|
|
262
|
-
code_coordinator-0.5.
|
|
263
|
-
code_coordinator-0.5.
|
|
259
|
+
code_coordinator-0.5.367.dist-info/METADATA,sha256=Q_yi_12MhAvRNS2S1WJnfWl_SefF6e_7q1pWkQ8RONY,27178
|
|
260
|
+
code_coordinator-0.5.367.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
261
|
+
code_coordinator-0.5.367.dist-info/entry_points.txt,sha256=o-Hq8pvG7ReGePvN_4iOKjLNqiq-MJ43HbPurqjNPZo,41
|
|
262
|
+
code_coordinator-0.5.367.dist-info/top_level.txt,sha256=w5sTrXesTCebhXyYv2qufOZGo0PoD1Lxgn0Q3MAXjh4,6
|
|
263
|
+
code_coordinator-0.5.367.dist-info/RECORD,,
|
coord/codegen.py
CHANGED
|
@@ -244,6 +244,9 @@ SCHEMA_DISPLAY_ORDER: tuple[str, ...] = (
|
|
|
244
244
|
"MilestoneEntryWire",
|
|
245
245
|
"MilestoneGateColumnsWire",
|
|
246
246
|
"MilestoneGateAWire",
|
|
247
|
+
"JournalResponse",
|
|
248
|
+
"JournalEntryWire",
|
|
249
|
+
"JournalLinkWire",
|
|
247
250
|
)
|
|
248
251
|
|
|
249
252
|
# (schema name, field name) -> literal TS type, bypassing the mechanical
|
coord/dashboard/server.py
CHANGED
|
@@ -13,7 +13,7 @@ import time
|
|
|
13
13
|
from concurrent.futures import ThreadPoolExecutor
|
|
14
14
|
from html import escape as _html_escape
|
|
15
15
|
from pathlib import Path
|
|
16
|
-
from typing import TYPE_CHECKING
|
|
16
|
+
from typing import TYPE_CHECKING, Any
|
|
17
17
|
|
|
18
18
|
import httpx
|
|
19
19
|
from starlette.applications import Starlette
|
|
@@ -775,6 +775,91 @@ async def _poll_once(
|
|
|
775
775
|
return possibly_stuck
|
|
776
776
|
|
|
777
777
|
|
|
778
|
+
# ── Journal (#3091) ──────────────────────────────────────────────────────────
|
|
779
|
+
#
|
|
780
|
+
# ``GET /api/journal/{submission_id}`` — the one view that renders a piece of
|
|
781
|
+
# work as a NARRATIVE rather than current state, served to someone who is not
|
|
782
|
+
# at a terminal (a client mid-screen-share, a phone). Built directly on
|
|
783
|
+
# #3071's aggregator (:func:`coord.portal_store.render_journal_payload`) —
|
|
784
|
+
# the same read ``coord journal --json`` prints — so the CLI and this
|
|
785
|
+
# endpoint can never disagree about what happened. A second aggregation
|
|
786
|
+
# would drift, and the drift would be invisible because both would look
|
|
787
|
+
# plausible.
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
def _journal_title(mirror: dict[str, Any]) -> str:
|
|
791
|
+
"""Best-effort display name for a submission (#3091).
|
|
792
|
+
|
|
793
|
+
Mirrors :mod:`coord.approved_work`'s ``project_label`` alias convention
|
|
794
|
+
as a tiny local copy rather than importing its private alias table
|
|
795
|
+
across the module boundary (the same convention
|
|
796
|
+
``coord.commands.portal._issue_title_for_display`` documents for itself).
|
|
797
|
+
coord-portal does not send a human-readable title today (coord-portal#146)
|
|
798
|
+
— this renders ``""`` until/unless a future portal change adds one.
|
|
799
|
+
"""
|
|
800
|
+
for key in ("project_label", "projectLabel"):
|
|
801
|
+
value = mirror.get(key)
|
|
802
|
+
if isinstance(value, str) and value.strip():
|
|
803
|
+
return value.strip()
|
|
804
|
+
return ""
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
@dataclasses.dataclass(frozen=True)
|
|
808
|
+
class JournalEntryWire:
|
|
809
|
+
"""One timeline entry — the exact shape
|
|
810
|
+
:func:`coord.portal_store.render_journal_payload` (#3071) produces for
|
|
811
|
+
each of ``entries``, field-for-field. ``artifact`` is ``null`` or a URL,
|
|
812
|
+
never a bare object key (see that function's docstring)."""
|
|
813
|
+
|
|
814
|
+
ts: float
|
|
815
|
+
kind: str
|
|
816
|
+
actor: str
|
|
817
|
+
text: str
|
|
818
|
+
artifact: str | None
|
|
819
|
+
source: str
|
|
820
|
+
details: dict[str, Any]
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
@dataclasses.dataclass(frozen=True)
|
|
824
|
+
class JournalLinkWire:
|
|
825
|
+
"""The submission's repo/milestone (or repo/issue) link, when one is on
|
|
826
|
+
file — a plain mirror of :meth:`coord.portal_store.PortalLink.to_dict`.
|
|
827
|
+
Exactly one of ``milestone_number``/``issue_number`` is set."""
|
|
828
|
+
|
|
829
|
+
repo_name: str
|
|
830
|
+
milestone_number: int | None
|
|
831
|
+
issue_number: int | None
|
|
832
|
+
submission_id: str
|
|
833
|
+
linked_at: float
|
|
834
|
+
actor: str
|
|
835
|
+
schema: int
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
@dataclasses.dataclass(frozen=True)
|
|
839
|
+
class JournalResponse:
|
|
840
|
+
"""``GET /api/journal/{submission_id}`` (#3091).
|
|
841
|
+
|
|
842
|
+
``entries`` and ``gaps`` are #3071's ``render_journal_payload`` output,
|
|
843
|
+
untouched — the CLI and this endpoint read the identical aggregation.
|
|
844
|
+
``title``/``customer_status`` are the submission-identity fields the CLI
|
|
845
|
+
doesn't need (it already has the id on its command line): ``title`` is
|
|
846
|
+
best-effort (see :func:`_journal_title`) and ``customer_status`` is the
|
|
847
|
+
submission's ``last_status`` (``""`` for a submission coord has never
|
|
848
|
+
seen — the same "unknown is not an error" posture as an empty timeline).
|
|
849
|
+
|
|
850
|
+
**Never raises.** An unlinked or unknown ``submission_id`` comes back
|
|
851
|
+
``200`` with ``entries: []`` and a gap explaining why, exactly like
|
|
852
|
+
``coord journal`` — never a 404, never a 500.
|
|
853
|
+
"""
|
|
854
|
+
|
|
855
|
+
submission_id: str
|
|
856
|
+
title: str
|
|
857
|
+
customer_status: str
|
|
858
|
+
link: JournalLinkWire | None
|
|
859
|
+
gaps: list[str]
|
|
860
|
+
entries: list[JournalEntryWire]
|
|
861
|
+
|
|
862
|
+
|
|
778
863
|
def openapi_spec() -> dict:
|
|
779
864
|
"""#757: the dashboard's OpenAPI 3 document.
|
|
780
865
|
|
|
@@ -1018,6 +1103,9 @@ def openapi_spec() -> dict:
|
|
|
1018
1103
|
# response cannot drift.
|
|
1019
1104
|
milestone_list_ref = dataclass_schema(MilestoneListResponse, components)
|
|
1020
1105
|
milestone_detail_ref = dataclass_schema(MilestoneDetail, components)
|
|
1106
|
+
# #3091: GET /api/journal/{submission_id} — same plain `dataclass_schema`
|
|
1107
|
+
# walk; the handler returns a literal `dataclasses.asdict(JournalResponse)`.
|
|
1108
|
+
journal_response_ref = dataclass_schema(JournalResponse, components)
|
|
1021
1109
|
# #3027: the four `/api/machines*` endpoints (#3021-#3026) went out
|
|
1022
1110
|
# carrying a bare `{"200": {"description": "OK"}}` stub — every other
|
|
1023
1111
|
# surface here has a real `content` schema, this milestone's own
|
|
@@ -1899,6 +1987,39 @@ def openapi_spec() -> dict:
|
|
|
1899
1987
|
},
|
|
1900
1988
|
}
|
|
1901
1989
|
},
|
|
1990
|
+
"/api/journal/{submission_id}": {
|
|
1991
|
+
"get": {
|
|
1992
|
+
"summary": (
|
|
1993
|
+
"#3091: SUBMISSION_ID's whole run as one ordered "
|
|
1994
|
+
"timeline — the served counterpart to `coord journal "
|
|
1995
|
+
"--json`"
|
|
1996
|
+
),
|
|
1997
|
+
"description": (
|
|
1998
|
+
"Built directly on #3071's aggregator "
|
|
1999
|
+
"(coord.portal_store.render_journal_payload) — the "
|
|
2000
|
+
"SAME read `coord journal --json` prints — so this "
|
|
2001
|
+
"endpoint and the CLI can never disagree about what "
|
|
2002
|
+
"happened. `entries` carries `ts`/`kind`/`actor`/"
|
|
2003
|
+
"`text`/`artifact` (null or a URL, never a bare "
|
|
2004
|
+
"object key) plus `source`/`details`. Never raises: "
|
|
2005
|
+
"an unlinked or unknown submission_id comes back 200 "
|
|
2006
|
+
"with an empty `entries` and a `gaps` entry explaining "
|
|
2007
|
+
"why, never a 404 or 500. A partially readable run "
|
|
2008
|
+
"returns the entries it could read plus the gaps."
|
|
2009
|
+
),
|
|
2010
|
+
"parameters": [
|
|
2011
|
+
_dashboard_path_param("submission_id", "portal submission id"),
|
|
2012
|
+
],
|
|
2013
|
+
"responses": {
|
|
2014
|
+
"200": {
|
|
2015
|
+
"description": "OK — always, even for an unknown submission_id",
|
|
2016
|
+
"content": {
|
|
2017
|
+
"application/json": {"schema": journal_response_ref}
|
|
2018
|
+
},
|
|
2019
|
+
},
|
|
2020
|
+
},
|
|
2021
|
+
}
|
|
2022
|
+
},
|
|
1902
2023
|
"/events": {
|
|
1903
2024
|
"get": {
|
|
1904
2025
|
"summary": "Server-sent-event stream of board/assignment events",
|
|
@@ -4483,6 +4604,58 @@ def build_app(
|
|
|
4483
4604
|
)
|
|
4484
4605
|
return JSONResponse(dataclasses.asdict(detail))
|
|
4485
4606
|
|
|
4607
|
+
async def api_journal(request: Request) -> JSONResponse:
|
|
4608
|
+
"""GET /api/journal/{submission_id} — one submission's whole run as
|
|
4609
|
+
an ordered timeline, served (#3091).
|
|
4610
|
+
|
|
4611
|
+
Reuses #3071's aggregator (:func:`coord.portal_store.
|
|
4612
|
+
render_journal_payload`) wholesale — the exact read ``coord journal
|
|
4613
|
+
--json`` prints — so this endpoint and the CLI can never disagree
|
|
4614
|
+
about what happened. A second aggregation would drift, and the
|
|
4615
|
+
drift would be invisible because both would look plausible.
|
|
4616
|
+
|
|
4617
|
+
Inherits that function's never-raises posture, belt and braces: an
|
|
4618
|
+
unlinked or unknown ``submission_id`` comes back ``200`` with an
|
|
4619
|
+
empty ``entries`` and a ``gaps`` entry saying why — never a 404,
|
|
4620
|
+
never a 500 — and a broken local read (e.g. an unreadable
|
|
4621
|
+
``portal_submissions`` row) degrades the identity fields to their
|
|
4622
|
+
empty defaults rather than failing the whole response.
|
|
4623
|
+
"""
|
|
4624
|
+
from coord import portal_store # noqa: PLC0415
|
|
4625
|
+
|
|
4626
|
+
submission_id = request.path_params["submission_id"]
|
|
4627
|
+
|
|
4628
|
+
try:
|
|
4629
|
+
payload = portal_store.render_journal_payload(submission_id)
|
|
4630
|
+
except Exception as exc: # noqa: BLE001 — never raise, #3071's own posture
|
|
4631
|
+
payload = {
|
|
4632
|
+
"link": None,
|
|
4633
|
+
"gaps": [f"journal unreadable: {exc}"],
|
|
4634
|
+
"entries": [],
|
|
4635
|
+
}
|
|
4636
|
+
|
|
4637
|
+
try:
|
|
4638
|
+
record = portal_store.get_submission(submission_id)
|
|
4639
|
+
except Exception: # noqa: BLE001 — an unreadable identity is not a 500
|
|
4640
|
+
record = None
|
|
4641
|
+
|
|
4642
|
+
mirror = (
|
|
4643
|
+
record.customer
|
|
4644
|
+
if record is not None and isinstance(record.customer, dict)
|
|
4645
|
+
else {}
|
|
4646
|
+
)
|
|
4647
|
+
link_dict = payload.get("link")
|
|
4648
|
+
|
|
4649
|
+
response = JournalResponse(
|
|
4650
|
+
submission_id=submission_id,
|
|
4651
|
+
title=_journal_title(mirror),
|
|
4652
|
+
customer_status=record.last_status if record is not None else "",
|
|
4653
|
+
link=JournalLinkWire(**link_dict) if link_dict else None,
|
|
4654
|
+
gaps=list(payload.get("gaps") or []),
|
|
4655
|
+
entries=[JournalEntryWire(**e) for e in payload.get("entries") or []],
|
|
4656
|
+
)
|
|
4657
|
+
return JSONResponse(dataclasses.asdict(response))
|
|
4658
|
+
|
|
4486
4659
|
async def terminal_ws(websocket: WebSocket) -> None:
|
|
4487
4660
|
"""Human-attended PTY<->WebSocket bridge for a live tmux session (#1065).
|
|
4488
4661
|
|
|
@@ -4617,6 +4790,7 @@ def build_app(
|
|
|
4617
4790
|
Route(
|
|
4618
4791
|
"/api/milestones/{repo}/{number}", api_milestone_detail, methods=["GET"]
|
|
4619
4792
|
),
|
|
4793
|
+
Route("/api/journal/{submission_id}", api_journal, methods=["GET"]),
|
|
4620
4794
|
build_events_route(event_source),
|
|
4621
4795
|
WebSocketRoute("/ws/terminal/{session_id}", terminal_ws),
|
|
4622
4796
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|