teddy-cli 0.2.3.dev1538__py3-none-any.whl → 0.2.4.dev1541__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.
- {teddy_cli-0.2.3.dev1538.dist-info → teddy_cli-0.2.4.dev1541.dist-info}/METADATA +1 -1
- {teddy_cli-0.2.3.dev1538.dist-info → teddy_cli-0.2.4.dev1541.dist-info}/RECORD +15 -15
- teddy_executor/adapters/inbound/textual_plan_reviewer_helpers.py +12 -20
- teddy_executor/adapters/inbound/textual_plan_reviewer_logic.py +60 -8
- teddy_executor/core/services/templates/execution_report.md.j2 +5 -0
- teddy_executor/resources/MRP.md +10 -3
- teddy_executor/resources/config/prompts/architect.md +2 -2
- teddy_executor/resources/config/prompts/developer.md +4 -4
- teddy_executor/resources/config/prompts/pathfinder.md +1 -1
- teddy_executor/resources/config/prompts/prototyper.md +7 -5
- teddy_executor/resources/templates/ARCHITECTURE.md +2 -2
- teddy_executor/resources/templates/vertical-slice.md +7 -3
- {teddy_cli-0.2.3.dev1538.dist-info → teddy_cli-0.2.4.dev1541.dist-info}/WHEEL +0 -0
- {teddy_cli-0.2.3.dev1538.dist-info → teddy_cli-0.2.4.dev1541.dist-info}/entry_points.txt +0 -0
- {teddy_cli-0.2.3.dev1538.dist-info → teddy_cli-0.2.4.dev1541.dist-info}/licenses/LICENSE +0 -0
|
@@ -11,8 +11,8 @@ teddy_executor/adapters/inbound/textual_plan_reviewer.py,sha256=lJHoqaJShuvTVz7S
|
|
|
11
11
|
teddy_executor/adapters/inbound/textual_plan_reviewer_app.py,sha256=ipOw8QLoOfoGcZdo3R4-zaMBQ2RuHilk2dXsMGoYrBc,15209
|
|
12
12
|
teddy_executor/adapters/inbound/textual_plan_reviewer_editor.py,sha256=LbYlIXSoEc3PQ8o28O4lzybMBig9r0QKYFNKg90iso0,22235
|
|
13
13
|
teddy_executor/adapters/inbound/textual_plan_reviewer_execution.py,sha256=QjkAB4aP7URG1lAOShHrojtAbLWEXZINIHfIrAM8lIA,7322
|
|
14
|
-
teddy_executor/adapters/inbound/textual_plan_reviewer_helpers.py,sha256=
|
|
15
|
-
teddy_executor/adapters/inbound/textual_plan_reviewer_logic.py,sha256=
|
|
14
|
+
teddy_executor/adapters/inbound/textual_plan_reviewer_helpers.py,sha256=iRMYg_A714zDUPPLT7gHBPxmDf3lSGeN1JuHvLWtolE,11750
|
|
15
|
+
teddy_executor/adapters/inbound/textual_plan_reviewer_logic.py,sha256=EbVGGRYOge9DGK5PBLJxZ0U6xxFsDRFyXnXb5q4oUNA,13523
|
|
16
16
|
teddy_executor/adapters/inbound/textual_plan_reviewer_previews.py,sha256=lNg0drAVGkQ40fmlK-IcDKh4tLCKzsSsXFq2gdjPBW0,12017
|
|
17
17
|
teddy_executor/adapters/inbound/textual_plan_reviewer_widgets.py,sha256=_-pfFY_71m0s3tDKzqH_l28fF563V0h3cZXYPKvS2kI,7356
|
|
18
18
|
teddy_executor/adapters/outbound/__init__.py,sha256=YN-oxkFQlMVrj3YdAJoLKXA_uo91cSU4llc3UHJ1Ckg,157
|
|
@@ -111,7 +111,7 @@ teddy_executor/core/services/session_replanner.py,sha256=-6r0wGSz9TMOPZi9rKe2OWM
|
|
|
111
111
|
teddy_executor/core/services/session_repository.py,sha256=vgcXOrHQ0xoUVvLE-t_QNpxXIDe3vM0eWwbJTcSBbeQ,9356
|
|
112
112
|
teddy_executor/core/services/session_service.py,sha256=kPblB3N4zlNz7Rgc4PCx7gAeeuwjHhfjK0DqnV081Sw,25859
|
|
113
113
|
teddy_executor/core/services/update_checker.py,sha256=rdH8NhF6ndICEij6Stb3E4GDUQ5HUoWXH1tJS8EJaoQ,7223
|
|
114
|
-
teddy_executor/core/services/templates/execution_report.md.j2,sha256=
|
|
114
|
+
teddy_executor/core/services/templates/execution_report.md.j2,sha256=kYPeOOca0b_-u-VDP5xYSbG5sTiXRKeDITV7Ay86r3c,13290
|
|
115
115
|
teddy_executor/core/services/validation_rules/__init__.py,sha256=Pe0dCWgssakypne3Yi0R1UK_T7gn6WZjjAk7YHcLUT8,128
|
|
116
116
|
teddy_executor/core/services/validation_rules/edit.py,sha256=uVHrbmxXQXQuVXDCR-1fsEsdyCpkjL5kau0HWf2d7bA,7712
|
|
117
117
|
teddy_executor/core/services/validation_rules/edit_matcher.py,sha256=QHqi7jr6msgzqnUHnvqo8MXDvCbIZMg1-51zA128_ig,11858
|
|
@@ -138,18 +138,18 @@ teddy_executor/registries/__init__.py,sha256=Y9luGTza-JjAZCHGX7VJpyj55ijfrSJFrwY
|
|
|
138
138
|
teddy_executor/registries/infrastructure.py,sha256=D9oBgmFMOIbYwGhOJjYWTjyzSFT_J3H7LNnzjqvkwoA,5862
|
|
139
139
|
teddy_executor/registries/reviewer.py,sha256=rKDcFmrHRm_66IsNHTn2E8QQsIimO0puiWYGlHToBBs,1370
|
|
140
140
|
teddy_executor/registries/validators.py,sha256=82SNpawuzWV2dtJcMAVP7wOpjoJ0hViR2a3kOwgIyIA,1907
|
|
141
|
-
teddy_executor/resources/MRP.md,sha256=
|
|
141
|
+
teddy_executor/resources/MRP.md,sha256=cNWZ54r1L3adNMygYAGqSX4napW1KjUemLJJEnsAVEQ,16744
|
|
142
142
|
teddy_executor/resources/__init__.py,sha256=h835ykuoc9Xv0E4UIaHmi8iVnhPKYqhwkLzHV5jRQEs,45
|
|
143
143
|
teddy_executor/resources/config/__init__.py,sha256=R96a_JS3GOty_5vsGg8AcR3cQYotYXCELrIzWFhn4kE,61
|
|
144
144
|
teddy_executor/resources/config/config.yaml,sha256=FXHC_Bg1GGzVD6qH6E3pdehXg-5xooeCfJm6w6HoPYU,3577
|
|
145
145
|
teddy_executor/resources/config/init.context,sha256=9J70exhvHAzqHX8kin2PuVtPi2JZp-TAzZr-PV8EYSg,87
|
|
146
|
-
teddy_executor/resources/config/prompts/architect.md,sha256=
|
|
146
|
+
teddy_executor/resources/config/prompts/architect.md,sha256=tMqFfsZAzCEqXFbiCPmrm14qq7CHURiYaiAgg7CKRfs,7854
|
|
147
147
|
teddy_executor/resources/config/prompts/assistant.md,sha256=GKlQ-JJ08zTcb-gWjuZtv2TDK8AqbIlEiS4Ov4r1J1A,2466
|
|
148
148
|
teddy_executor/resources/config/prompts/debugger.md,sha256=UkS5ReAnIJIfp3YqHo87EZu24DtN4C3SrNDXVRxEsxI,8864
|
|
149
|
-
teddy_executor/resources/config/prompts/developer.md,sha256=
|
|
150
|
-
teddy_executor/resources/config/prompts/pathfinder.md,sha256=
|
|
151
|
-
teddy_executor/resources/config/prompts/prototyper.md,sha256=
|
|
152
|
-
teddy_executor/resources/templates/ARCHITECTURE.md,sha256=
|
|
149
|
+
teddy_executor/resources/config/prompts/developer.md,sha256=fhSEmMDcB0SwNXOXqdWQ-1IPWcunMu88QZOwVfBlLUg,17246
|
|
150
|
+
teddy_executor/resources/config/prompts/pathfinder.md,sha256=C7NWaTijNbCnuLeEi-RDZezYXc-XuT_8-roRG1wR5rc,5098
|
|
151
|
+
teddy_executor/resources/config/prompts/prototyper.md,sha256=gBvltDDtzqGQy0MpEzMavfsdCPsFUysg_S69BqmjZUA,5609
|
|
152
|
+
teddy_executor/resources/templates/ARCHITECTURE.md,sha256=hpopUc0R8UWEtM5RBCvNdH6vWvtrVk1hG4ZiXt4efC0,8311
|
|
153
153
|
teddy_executor/resources/templates/PROJECT.md,sha256=qKsGRipdQmFjBy3j_L5tnjZj9kaT48xopJmE-1hDbsU,6537
|
|
154
154
|
teddy_executor/resources/templates/case-file.md,sha256=gKhoFCum2c4Fk4E3lKGcmfV9_IOYVygjWXNu076TL1Q,1578
|
|
155
155
|
teddy_executor/resources/templates/ci.md,sha256=TRVHJ3VjDA-CB4xvAL0BcD9bs4tykpVtiJ5iQOvBpwU,10151
|
|
@@ -158,9 +158,9 @@ teddy_executor/resources/templates/makefile.md,sha256=0OmQVTLbUk8XIkb7OJDDCWH_qd
|
|
|
158
158
|
teddy_executor/resources/templates/milestone.md,sha256=PwHedgzqRQnKQq4M4GILmmv7YHBsDJCaC8rxD2MDMBE,863
|
|
159
159
|
teddy_executor/resources/templates/pre-commit.md,sha256=NqllfAw8Z0yvt51QJ6OBW18dccrJniLGibSylkatvRM,7684
|
|
160
160
|
teddy_executor/resources/templates/specification-document.md,sha256=skYPZ7E0m2n2STEWOKCHeiuqNtsshYzI49rmsNSKAuA,671
|
|
161
|
-
teddy_executor/resources/templates/vertical-slice.md,sha256=
|
|
162
|
-
teddy_cli-0.2.
|
|
163
|
-
teddy_cli-0.2.
|
|
164
|
-
teddy_cli-0.2.
|
|
165
|
-
teddy_cli-0.2.
|
|
166
|
-
teddy_cli-0.2.
|
|
161
|
+
teddy_executor/resources/templates/vertical-slice.md,sha256=8M8eIs6PKnOaloegH2SaAkU3Mzk-16y3sZb8mIR93UI,6239
|
|
162
|
+
teddy_cli-0.2.4.dev1541.dist-info/METADATA,sha256=kFfvwV-ribYF4e5ad8ztkgFUNquzKrrBUxUI8S-v7LI,32472
|
|
163
|
+
teddy_cli-0.2.4.dev1541.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
164
|
+
teddy_cli-0.2.4.dev1541.dist-info/entry_points.txt,sha256=3KaK1-CWsscLZeHduI6Jgime9aw_gfmdQZ7AUkA0QDg,54
|
|
165
|
+
teddy_cli-0.2.4.dev1541.dist-info/licenses/LICENSE,sha256=HBL2C3ynq_mk-EYtJI7aXEc6gXnXgKJ-K6KZ13N0Ojs,35270
|
|
166
|
+
teddy_cli-0.2.4.dev1541.dist-info/RECORD,,
|
|
@@ -216,29 +216,21 @@ def handle_mount_logic(app: Any, update_detail_fn: Any) -> None:
|
|
|
216
216
|
from teddy_executor.adapters.inbound.textual_plan_reviewer_logic import (
|
|
217
217
|
RATIONALE_ROOT,
|
|
218
218
|
ACTION_PLAN_ROOT,
|
|
219
|
-
|
|
219
|
+
RATIONALE_FALLBACK_TITLE,
|
|
220
|
+
rationale_entries,
|
|
220
221
|
)
|
|
221
222
|
|
|
222
223
|
rat_root = tree.root.add("[bold]Rationale[/]", data=RATIONALE_ROOT, expand=True)
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
title = re.sub(r"^###\s*", "", lines[0]).strip()
|
|
234
|
-
if title in ALLOWED_RATIONALE_SECTIONS:
|
|
235
|
-
content = "\n".join(lines[1:]).strip()
|
|
236
|
-
current_node = rat_root.add_leaf(
|
|
237
|
-
title,
|
|
238
|
-
data={"type": "RATIONALE_SECTION", "title": title, "content": content},
|
|
239
|
-
)
|
|
240
|
-
elif current_node:
|
|
241
|
-
current_node.data["content"] += "\n\n" + section
|
|
224
|
+
for title, content in rationale_entries(app.plan.rationale):
|
|
225
|
+
label = title
|
|
226
|
+
if title == RATIONALE_FALLBACK_TITLE:
|
|
227
|
+
# The whole-block fallback is secondary: keep it visually quieter so
|
|
228
|
+
# it does not read as one of the protocol sections.
|
|
229
|
+
label = f"[#888888 italic]{title}[/]"
|
|
230
|
+
rat_root.add_leaf(
|
|
231
|
+
label,
|
|
232
|
+
data={"type": "RATIONALE_SECTION", "title": title, "content": content},
|
|
233
|
+
)
|
|
242
234
|
|
|
243
235
|
# 3. Action Plan Section
|
|
244
236
|
act_root = tree.root.add("[bold]Action Plan[/]", data=ACTION_PLAN_ROOT, expand=True)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
import re
|
|
4
5
|
from typing import TYPE_CHECKING, Any, cast
|
|
5
6
|
|
|
6
7
|
from teddy_executor.adapters.inbound.textual_plan_reviewer_execution import (
|
|
@@ -24,6 +25,10 @@ ALLOWED_RATIONALE_SECTIONS = [
|
|
|
24
25
|
"Notes",
|
|
25
26
|
]
|
|
26
27
|
|
|
28
|
+
# Label for the whole-block node shown when a rationale carries none of the
|
|
29
|
+
# allowed section headings.
|
|
30
|
+
RATIONALE_FALLBACK_TITLE = "Raw"
|
|
31
|
+
|
|
27
32
|
# Tree Node Identifiers
|
|
28
33
|
CONTEXT_ROOT = "CONTEXT_ROOT"
|
|
29
34
|
SYSTEM_LABEL = "SYSTEM_LABEL"
|
|
@@ -37,6 +42,46 @@ ACTION_PLAN_ROOT = "ACTION_PLAN_ROOT"
|
|
|
37
42
|
# Summary logic moved to textual_plan_reviewer_helpers.py
|
|
38
43
|
|
|
39
44
|
|
|
45
|
+
def recognized_rationale_sections(rationale: str) -> list[tuple[str, str]]:
|
|
46
|
+
"""Splits a rationale into its recognized `###` sections.
|
|
47
|
+
|
|
48
|
+
Only a `### ` heading whose title is in ``ALLOWED_RATIONALE_SECTIONS`` opens
|
|
49
|
+
a section. Any other chunk, including a numeric `1. Section` marker, merges
|
|
50
|
+
into the preceding section as body text; text before the first recognized
|
|
51
|
+
heading is dropped. A rationale with no recognized heading yields an empty
|
|
52
|
+
list, which the caller turns into a single ``Raw`` block.
|
|
53
|
+
"""
|
|
54
|
+
titles: list[str] = []
|
|
55
|
+
contents: list[str] = []
|
|
56
|
+
for chunk in re.split(r"\n(?=### )", "\n" + rationale):
|
|
57
|
+
chunk = chunk.strip()
|
|
58
|
+
if not chunk:
|
|
59
|
+
continue
|
|
60
|
+
lines = chunk.split("\n")
|
|
61
|
+
title = re.sub(r"^###\s*", "", lines[0]).strip()
|
|
62
|
+
if title in ALLOWED_RATIONALE_SECTIONS:
|
|
63
|
+
titles.append(title)
|
|
64
|
+
contents.append("\n".join(lines[1:]).strip())
|
|
65
|
+
elif contents:
|
|
66
|
+
contents[-1] += "\n\n" + chunk
|
|
67
|
+
return list(zip(titles, contents))
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def rationale_entries(rationale: str) -> list[tuple[str, str]]:
|
|
71
|
+
"""Returns the rationale tree entries, falling back to one raw block.
|
|
72
|
+
|
|
73
|
+
A rationale written before the section contract carries none of the
|
|
74
|
+
recognized headings, so it yields no sections. Render it as a single
|
|
75
|
+
``Raw`` entry instead of losing it, so stored plans and resumed sessions
|
|
76
|
+
stay reviewable. A blank rationale yields no entry at all.
|
|
77
|
+
"""
|
|
78
|
+
sections = recognized_rationale_sections(rationale)
|
|
79
|
+
if sections:
|
|
80
|
+
return sections
|
|
81
|
+
raw = rationale.strip()
|
|
82
|
+
return [(RATIONALE_FALLBACK_TITLE, raw)] if raw else []
|
|
83
|
+
|
|
84
|
+
|
|
40
85
|
def on_tree_node_highlighted(app: "ReviewerApp", event: Any) -> None:
|
|
41
86
|
"""Handle node highlighting to update the detail view."""
|
|
42
87
|
# event is Tree.NodeHighlighted
|
|
@@ -62,10 +107,11 @@ def _update_detail_view(app: ReviewerApp, data: Any):
|
|
|
62
107
|
if not pane.is_attached:
|
|
63
108
|
return
|
|
64
109
|
|
|
110
|
+
rationale = _rationale_content(data)
|
|
65
111
|
if _is_context_data(data):
|
|
66
112
|
_update_context_detail(app, switcher, pane, data)
|
|
67
|
-
elif
|
|
68
|
-
_update_rationale_detail(app, switcher,
|
|
113
|
+
elif rationale is not None:
|
|
114
|
+
_update_rationale_detail(app, switcher, rationale)
|
|
69
115
|
else:
|
|
70
116
|
_update_action_detail(app, switcher, pane, data)
|
|
71
117
|
|
|
@@ -81,9 +127,15 @@ def _is_context_data(data: Any) -> bool:
|
|
|
81
127
|
)
|
|
82
128
|
|
|
83
129
|
|
|
84
|
-
def
|
|
85
|
-
"""
|
|
86
|
-
|
|
130
|
+
def _rationale_content(data: Any) -> str | None:
|
|
131
|
+
"""Returns the rationale Markdown a section node renders, or ``None``.
|
|
132
|
+
|
|
133
|
+
The whole-block fallback is itself a section node, so every node that
|
|
134
|
+
carries rationale content uses the same dict shape.
|
|
135
|
+
"""
|
|
136
|
+
if isinstance(data, dict) and data.get("type") == "RATIONALE_SECTION":
|
|
137
|
+
return str(data["content"])
|
|
138
|
+
return None
|
|
87
139
|
|
|
88
140
|
|
|
89
141
|
def _update_context_detail(app: ReviewerApp, switcher: Any, pane: Any, data: Any):
|
|
@@ -97,12 +149,12 @@ def _update_context_detail(app: ReviewerApp, switcher: Any, pane: Any, data: Any
|
|
|
97
149
|
populate_context_detail(app, pane, data)
|
|
98
150
|
|
|
99
151
|
|
|
100
|
-
def _update_rationale_detail(app: ReviewerApp, switcher: Any,
|
|
101
|
-
"""Render
|
|
152
|
+
def _update_rationale_detail(app: ReviewerApp, switcher: Any, content: str):
|
|
153
|
+
"""Render rationale Markdown in the detail pane."""
|
|
102
154
|
from textual.widgets import Markdown
|
|
103
155
|
|
|
104
156
|
switcher.current = "rationale-view"
|
|
105
|
-
app.query_one("#rationale-content", Markdown).update(
|
|
157
|
+
app.query_one("#rationale-content", Markdown).update(content)
|
|
106
158
|
|
|
107
159
|
|
|
108
160
|
def _update_action_detail(app: ReviewerApp, switcher: Any, pane: Any, data: Any):
|
|
@@ -103,6 +103,11 @@
|
|
|
103
103
|
{% if report.validation_ast -%}
|
|
104
104
|
{{ report.validation_ast }}
|
|
105
105
|
{% endif -%}
|
|
106
|
+
{# The `-%}` markers above strip every following whitespace character up to the
|
|
107
|
+
next non-whitespace one, and the gap between the validation blocks and
|
|
108
|
+
`## Action Log` holds nothing but block tags. Emit the separator explicitly
|
|
109
|
+
so the heading never abuts the last error line or the validation AST dump. #}
|
|
110
|
+
{% if report.validation_result or report.validation_ast %}{{ '\n' }}{% endif -%}
|
|
106
111
|
{# Classify content-bearing logs ONCE — the single source of truth deciding
|
|
107
112
|
where each log's content renders:
|
|
108
113
|
- resource_logs: rendered under `## Resource Contents` (non-session only)
|
teddy_executor/resources/MRP.md
CHANGED
|
@@ -113,7 +113,7 @@ Encapsulate code blocks using a fence of at least 4 tildes (~~~~) or 4 backticks
|
|
|
113
113
|
|
|
114
114
|
The Message section provides Markdown content for user communication. Use Messages sparingly, reserved for workflow gates or decision-critical questions that cannot be resolved autonomously. Handoffs are user-mediated with clear mission instructions. Provide all reference files as root-relative paths and include them in the context flag. To start a new session with another agent, instruct the user to run:
|
|
115
115
|
|
|
116
|
-
~~~~
|
|
116
|
+
~~~~shell
|
|
117
117
|
teddy start -a <agent_name> -m '<mission_instruction>' -c 'path/to/ref1.ext,path/to/ref2.ext'
|
|
118
118
|
~~~~
|
|
119
119
|
|
|
@@ -144,8 +144,12 @@ A validation failure occurs when an Execution Report returns "Validation Failed"
|
|
|
144
144
|
|
|
145
145
|
### Progress
|
|
146
146
|
Goal: [The objective of the current task/session]
|
|
147
|
-
Reference Files: [Root-relative paths to the key artifacts guiding this work]
|
|
148
147
|
|
|
148
|
+
Reference Files:
|
|
149
|
+
- `[Root-relative path 1]`
|
|
150
|
+
- `[Root-relative path 2]`
|
|
151
|
+
|
|
152
|
+
Workflow:
|
|
149
153
|
- [✓ | ▶ | ] [Phase 1]
|
|
150
154
|
- [✓ | ▶ | ] [Phase 2]
|
|
151
155
|
- [✓ | ▶ | ] [Phase 3]
|
|
@@ -268,8 +272,11 @@ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
|
|
|
268
272
|
|
|
269
273
|
### Progress
|
|
270
274
|
Goal: Lorem ipsum dolor sit amet.
|
|
271
|
-
Reference Files: `docs/project/PROJECT.md`
|
|
272
275
|
|
|
276
|
+
Reference Files:
|
|
277
|
+
- `docs/project/PROJECT.md`
|
|
278
|
+
|
|
279
|
+
Workflow:
|
|
273
280
|
- [✓] Lorem
|
|
274
281
|
- [▶] Ipsum
|
|
275
282
|
- [ ] Dolor
|
|
@@ -31,9 +31,9 @@ Follow these phases and steps in order to systematically deliver verified progre
|
|
|
31
31
|
Decompose the milestone into end-to-end Vertical Slices. Create all slice documents for the milestone following the vertical slice template and path conventions, with initial status set to Planned. Define each slice's goal, context, scenarios, edge cases, and deliverable order; leave the `Impact` map and `Component Docs` for the Finalize Slices step. Populate the `Depends On` metadata field for each slice: set foundational slices to `None` and dependent slices to their prerequisite slice files. Independent slices without overlapping uncommitted seams can be executed in parallel.
|
|
32
32
|
Place Interface first (preceded by Env if tooling prerequisites exist), followed by harness, wiring as the tracer bullet deliverable, core, adapter, migration, refactor, and cleanup in continuous-green dependency order.
|
|
33
33
|
4. **Impact Analysis:**
|
|
34
|
-
Use `git grep` and file inspection on every component, interface, and DTO targeted by the drafted slices. Catalog the delta: skip work that already exists, note remaining work for partially implemented pieces, and add only truly missing pieces as deliverables. Partition any deliverable that spans more than one consumer or layer into smaller atomic items; a component with multiple consumers is a Shared Seam, resolved by extending the interface, migrating consumers, then pruning obsolete code. Resolve stale hits for deleted or renamed components in documentation. Verify that all seam changes have matching harness deliverables.
|
|
34
|
+
Use `git grep` and file inspection on every component, interface, and DTO targeted by the drafted slices. For any new capability or cross-cutting outcome, also run a forward surface scan: grep for the domain artifact/payload and the incumbent primitive being replaced across all layers, adapters, and execution modes. Treat multiple sibling emitters of the same artifact as a Shared Seam. Catalog the delta: skip work that already exists, note remaining work for partially implemented pieces, and add only truly missing pieces as deliverables. Partition any deliverable that spans more than one consumer or layer into smaller atomic items; a component with multiple consumers is a Shared Seam, resolved by extending the interface, migrating consumers, then pruning obsolete code. Resolve stale hits for deleted or renamed components in documentation. Verify that all seam changes have matching harness deliverables.
|
|
35
35
|
5. **Component Design:**
|
|
36
|
-
Create or edit component design docs for every component surfaced by the Impact Analysis, following the component design template and path conventions. For new components, set status to `Planned`. For modified, extended, or migrated components, transition status to `Refactoring`. Focus strictly on strategic intent, purpose, conceptual Port responsibilities, operations, and invariants, and avoid leaky abstractions. Specify the boundary contract in full: DTO fields with their types and constraints, error base classes, and each operation's signature with its preconditions, postconditions, and error modes. Model discrete states and constrained values as enumerations, unions, or value objects rather than boolean flags or raw primitives. Specify every dependency as a constructor-injected outbound Port so tests can substitute in-memory fakes without global patching. Ensure all custom domain and boundary exceptions inherit from the project root base exception rather than bare `Exception` or generic built-in exceptions for domain-level rejections or boundary translations.
|
|
36
|
+
Create or edit component design docs for every component surfaced by the Impact Analysis, following the component design template and path conventions. For new components, set status to `Planned`. For modified, extended, or migrated components, transition status to `Refactoring`. Focus strictly on strategic intent, purpose, conceptual Port responsibilities, operations, and invariants, and avoid leaky abstractions. Specify the boundary contract in full: DTO fields with their types and constraints, error base classes, and each operation's signature with its preconditions, postconditions, and error modes. Model discrete states and constrained values as enumerations, unions, or value objects rather than boolean flags or raw primitives. Specify every dependency as a constructor-injected outbound Port or composition-root dependency so tests can substitute in-memory fakes and drive every branch without global patching. Ensure all custom domain and boundary exceptions inherit from the project root base exception rather than bare `Exception` or generic built-in exceptions for domain-level rejections or boundary translations.
|
|
37
37
|
6. **Architecture Maintenance:**
|
|
38
38
|
If needed, update the Ubiquitous Language, Component and Boundary Map, and Key Architectural Decisions in `docs/architecture/ARCHITECTURE.md` to reflect the design.
|
|
39
39
|
7. **Finalize Slices:**
|
|
@@ -17,9 +17,9 @@ Follow these phases and steps in order to systematically deliver verified progre
|
|
|
17
17
|
2. **Discovery:**
|
|
18
18
|
Use `git grep`, file inspection, and targeted research to gather codebase context and artifacts required for implementation. Search the codebase and test suite for existing implementations or coverage of your task to prevent logic and test duplication. If a Case File, MRE script, or Prototype is linked in context, inspect them to understand runtime reality.
|
|
19
19
|
3. **Plan Initialization / Audit:**
|
|
20
|
-
If no slice exists, create one following the vertical slice template and path conventions informed by discovery findings, linking any reference files, placing Interface first (or preceded only by prerequisite Env), followed by Harness and Wiring as the tracer bullet, and run `make commit` to version control the new plan.
|
|
20
|
+
If no slice exists, create one following the vertical slice template and path conventions informed by discovery findings, linking any reference files, scanning all entry points, execution modes, and code paths where the target behavior or replaced mechanism occurs, placing Interface first (or preceded only by prerequisite Env), followed by Harness and Wiring as the tracer bullet, and run `make commit` to version control the new plan.
|
|
21
21
|
|
|
22
|
-
If a slice already exists, audit target components via `git grep`. Verify that all deliverables keep all tests passing at every commit. If a deliverable attempts a breaking signature change to a Shared Seam (git grep count greater than 1) without a migration plan, immediately edit the slice to re-partition the work into non-breaking steps (extend -> migrate -> prune). Decompose any item touching more than one logical change into smaller atomic deliverables. Verify Interface is placed first (or preceded only by prerequisite Env), followed by Harness and Wiring. If the audit required structural plan changes, run `make commit` to record them before starting work.
|
|
22
|
+
If a slice already exists, audit target components (and, for new capabilities replacing inline behavior, any sibling surfaces or execution modes emitting the same artifact) via `git grep`. Verify that all deliverables keep all tests passing at every commit. If a deliverable attempts a breaking signature change to a Shared Seam (git grep count greater than 1) without a migration plan, immediately edit the slice to re-partition the work into non-breaking steps (extend -> migrate -> prune). Decompose any item touching more than one logical change into smaller atomic deliverables. Verify Interface is placed first (or preceded only by prerequisite Env), followed by Harness and Wiring. If the audit required structural plan changes, run `make commit` to record them before starting work.
|
|
23
23
|
4. **Activate Slice & Mark Deliverable:**
|
|
24
24
|
Set slice Status to In Progress. Identify the next uncompleted deliverable in the vertical slice and mark it in progress using `[▶]`. Do not commit this status change separately; commit it alongside the deliverable in the Delivery phase. Batching deliverables into one cycle execution is strictly forbidden.
|
|
25
25
|
|
|
@@ -40,7 +40,7 @@ Follow these phases and steps in order to systematically deliver verified progre
|
|
|
40
40
|
8. Cleanup: Pruning shared seams, deprecated methods, dead code, or temporary shims once callers have migrated. Do not write new tests; delete superseded tests and confirm the remaining suite passes.
|
|
41
41
|
9. Env (Declarative / Tooling): For purely declarative files (Makefile, CI workflows, hooks, .gitignore), do not write test scripts. The Red step executes the command directly to observe failure or absence; the Green step applies the declarative change and confirms success.
|
|
42
42
|
|
|
43
|
-
For deliverables requiring tests (Wiring, Interface, Harness, Core, Adapter), create or locate the appropriate test file. Set up the test function using the Test Harness (Setup: Fixtures and Arrange, Driver: Act, Observer: Assert). Use parameterized tests for data permutations and invariant-shaped checks (roundtrip parsing, serialization, arithmetic, state transitions), deriving the cases from the slice's `Edge Cases`.
|
|
43
|
+
For deliverables requiring tests (Wiring, Interface, Harness, Core, Adapter), create or locate the appropriate test file. Set up the test function using the Test Harness (Setup: Fixtures and Arrange, Driver: Act, Observer: Assert). Use parameterized tests for data permutations and invariant-shaped checks (roundtrip parsing, serialization, arithmetic, state transitions), deriving the cases from the slice's `Edge Cases`. When a scenario or edge case is gated on an ambient environment condition, tests MUST deterministically exercise both the active and fallback branches through the real adapter or composition boundary instead of relying on the test runner's default state.
|
|
44
44
|
|
|
45
45
|
Enforce Test Double Integrity (Ban Global Patching): global `mock.patch` and bare `MagicMock` are strictly forbidden; inject all test doubles via Constructor Injection. Use In-Memory Fakes for internal state (databases, caches). Use strictly bound mocks (such as `register_mock` or `autospec=True`) ONLY for un-fakeable external side-effects (APIs, SMTP) to prevent signature drift.
|
|
46
46
|
|
|
@@ -133,7 +133,7 @@ Follow these phases and steps in order to systematically deliver verified progre
|
|
|
133
133
|
- **Production Double Audit:**
|
|
134
134
|
verify that NO skeleton responses, hardcoded mock values, or temporary stubs remain in `src/`. All outputs must derive from production logic.
|
|
135
135
|
- **Upstream & Downstream Audit:**
|
|
136
|
-
run EXECUTE `git grep` to audit upstream callers (verifying all callers, test files, and harness fixtures use updated contracts) and downstream dependencies (pruning orphaned helper methods, unused parameters, or dead functions).
|
|
136
|
+
run EXECUTE `git grep` to audit upstream callers (verifying all callers, test files, and harness fixtures use updated contracts) and downstream dependencies (pruning orphaned helper methods, unused parameters, or dead functions). For new capabilities replacing inline or ad-hoc behavior, also grep for the domain artifact and incumbent primitive across all execution modes to verify no sibling surface still bypasses the new contract.
|
|
137
137
|
- **Test Suite Hygiene & Shared Harness Audit:**
|
|
138
138
|
audit test suites for redundant test coverage. Consolidate tests that assert identical execution paths with no variation in invariant coverage. Delete obsolete unit tests superseded by broader regression suites. Verify tests consistently use shared test harness fixtures (drivers, observers, fakes) instead of ad-hoc mocks or duplicated setup logic; extract repeated test infrastructure into the shared harness.
|
|
139
139
|
- **Immediate or slice-scoped:**
|
|
@@ -20,7 +20,7 @@ Follow these phases and steps in order to systematically deliver verified progre
|
|
|
20
20
|
**Goal:** Explore codebase reality and de-risk technical feasibility.
|
|
21
21
|
|
|
22
22
|
1. **Context Exploration:**
|
|
23
|
-
Use `git grep`, file inspection, and targeted research across existing code, specs in `docs/project/specs/`, and existing milestones to map dependencies and blast radius.
|
|
23
|
+
Use `git grep`, file inspection, and targeted research across existing code, specs in `docs/project/specs/`, and existing milestones to map dependencies and blast radius. Identify every entry point, execution mode, and code path where the target behavior or the mechanism it replaces currently occurs, so the Roadmap item, Spec, or Ad-hoc Slice covers all of them or explicitly marks exclusions as out of scope.
|
|
24
24
|
2. **Feasibility Check:**
|
|
25
25
|
If system feasibility or external behavior is uncertain, create minimal probes in `spikes/` and run them to validate assumptions before specifying requirements.
|
|
26
26
|
3. **Greenfield Baseline:**
|
|
@@ -9,26 +9,28 @@ Mission: De-risk vertical slices by empirically validating technical and functio
|
|
|
9
9
|
Follow these phases and steps in order to systematically deliver verified progress.
|
|
10
10
|
|
|
11
11
|
### Triage
|
|
12
|
-
**Goal:** Assess the problem space, catalog unknowns, and verify
|
|
12
|
+
**Goal:** Assess the problem space, catalog unknowns, and verify production integration and test-harness feasibility.
|
|
13
13
|
|
|
14
14
|
1. **Exploration and Triage:**
|
|
15
15
|
Read the assigned Vertical Slice and linked Component Design Docs. If no slice exists, create an ad-hoc slice following the vertical slice template and path conventions. Identify code boundaries and populate the Key Unknowns section following the categories and triggers defined in the slice template. Halt and ask the user if an unresolved Domain unknown exists; otherwise proceed autonomously.
|
|
16
16
|
2. **Integration Feasibility:**
|
|
17
17
|
Inspect constructor signatures and system interfaces required for integration using file inspection and `git grep`. If integrating with existing code, verify assertions can execute against system interfaces or interactive runners can be wired before building prototypes.
|
|
18
|
+
3. **Test-Harness Feasibility:**
|
|
19
|
+
Inspect existing Test Harness drivers, fakes, and test-runner constraints against every `Scenarios` precondition and ambient environmental gate. If existing harness capabilities cover a precondition, record that under `Context`; otherwise log a `[Harness]` unknown to prove test-suite observability during Prototyping.
|
|
18
20
|
|
|
19
21
|
### Prototyping
|
|
20
22
|
**Goal:** Build minimal prototypes to empirically validate behaviors and resolve unknowns.
|
|
21
23
|
|
|
22
24
|
1. **Build and Verify Spikes:**
|
|
23
|
-
CREATE prototypes in `spikes/prototypes/{scope-slug}/`. For Technical unknowns, build assertion-based probes proving system contracts and runtime behavior. For Functional unknowns, build interactive scenario runners exposing configurable knobs. You are strictly forbidden from modifying `src/` or `tests/`. Run scripts via EXECUTE to empirically observe behavior and verify that interactive runners complete without errors before presenting them to the user.
|
|
25
|
+
CREATE prototypes in `spikes/prototypes/{scope-slug}/`. For Technical unknowns, build assertion-based probes proving system contracts and runtime behavior. For Functional unknowns, build interactive scenario runners exposing configurable knobs. For Harness unknowns, build probes executed under the automated test runner's constraints proving how the test suite will drive and observe every branch without global patching. You are strictly forbidden from modifying `src/` or `tests/`. Run scripts via EXECUTE to empirically observe behavior and verify that interactive runners complete without errors before presenting them to the user.
|
|
24
26
|
2. **Iteration Loop:**
|
|
25
|
-
Iterate until internal workings are deeply understood and all Technical and
|
|
27
|
+
Iterate until internal workings are deeply understood and all Technical, Functional, and Harness unknowns are resolved. If an unexpected failure occurs, isolate it using a focused sub-prototype. Update Key Unknowns with any emerging uncertainties.
|
|
26
28
|
|
|
27
29
|
### Alignment
|
|
28
30
|
**Goal:** Present prototype findings and demo to the user for explicit validation and approval.
|
|
29
31
|
|
|
30
32
|
1. **Showcase Presentation:**
|
|
31
|
-
Message the user to present findings in clear prose. For Technical unknowns, provide raw assertion evidence or
|
|
33
|
+
Message the user to present findings in clear prose. For Technical and Harness unknowns, provide raw assertion evidence, benchmarks, or test-runner observability proof. For Functional unknowns, provide copy-pasteable execution commands and list adjustable knobs. Present the updated slice deliverables and component specifications.
|
|
32
34
|
2. **Approval Gate:**
|
|
33
35
|
Await explicit user approval before proceeding to the Conclusion phase. If the user requests changes, refine the prototypes and artifacts, re-run verification, and re-align.
|
|
34
36
|
|
|
@@ -36,7 +38,7 @@ Follow these phases and steps in order to systematically deliver verified progre
|
|
|
36
38
|
**Goal:** Translate verified findings into buildable slices, component designs, and specifications.
|
|
37
39
|
|
|
38
40
|
1. **Impact and Debt Audit:**
|
|
39
|
-
Run EXECUTE `git grep` on target components. If a modified component has more than one consumer, treat it as a Shared Seam and structure deliverables as non-breaking steps: extend the interface, migrate consumers, then prune obsolete code. Verify that all contract changes include matching harness deliverables.
|
|
41
|
+
Run EXECUTE `git grep` on target components. For new capabilities replacing inline or ad-hoc behavior, also grep for the domain artifact and incumbent primitive across all execution modes to confirm no sibling surface is left unmigrated. If a modified component or shared artifact has more than one consumer or emitter, treat it as a Shared Seam and structure deliverables as non-breaking steps: extend the interface, migrate consumers/emitters, then prune obsolete code. Verify that all contract changes include matching harness deliverables.
|
|
40
42
|
2. **Artifact Updates:**
|
|
41
43
|
EDIT the Vertical Slice to reflect validated scenarios, edge cases, implementation deliverables, and verification steps. Place Interface first (preceded by Env if tooling prerequisites exist), followed by harness, wiring as the tracer bullet deliverable, core, adapter, migration, refactor, and cleanup deliverables. Mark resolved unknowns as completed, link the prototype directory in the slice metadata, and set status to Planned. EDIT Component Design Docs for all components listed in the slice's `Impact` section to reflect as-tested contracts, parameters, and invariants discovered during prototyping. Ensure any new domain or boundary exceptions inherit from the project root base exception rather than bare `Exception` or generic built-in types.
|
|
42
44
|
|
|
@@ -11,9 +11,9 @@ This section defines foundational engineering practices. Each entry MUST be a sp
|
|
|
11
11
|
- **Run Environment:** Designated runner (e.g., `uv run`, `poetry run`).
|
|
12
12
|
- **Failure Transparency:** Error handling policy — specific exceptions only, no silent suppression.
|
|
13
13
|
- **Custom Exceptions:** All custom domain and boundary exceptions MUST inherit from a single project-level root base exception (e.g. `{{Project Name}}Error`). Generic built-in exceptions (`ValueError`, `RuntimeError`) MUST NOT be used for domain-specific rejections or boundary errors. Outer adapters catch the root exception to handle known application failures cleanly, while letting unexpected programming defects (`AttributeError`, `IndexError`, contract assertion failures) fail-fast with full tracebacks.
|
|
14
|
-
- **Testing Strategy:** Define test types across three suites: Unit (`tests/suites/unit/` for isolated core domain logic and schemas), Integration (`tests/suites/integration/` for infrastructure adapters and stateful fakes running against local isolated resources), and Acceptance (`tests/suites/acceptance/` for outer boundary user journeys). Tests must be fast, deterministic, hermetic, and offline with zero real network calls or sleep statements. Mandate Test Double Integrity: ban global patching, use in-memory fakes for state-managing outbound ports, and use strictly autospec-bound mocks only for external side-effects.
|
|
14
|
+
- **Testing Strategy:** Define test types across three suites: Unit (`tests/suites/unit/` for isolated core domain logic and schemas), Integration (`tests/suites/integration/` for infrastructure adapters and stateful fakes running against local isolated resources), and Acceptance (`tests/suites/acceptance/` for outer boundary user journeys). Tests must be fast, deterministic, hermetic, and offline with zero real network calls or sleep statements. Mandate Test Double Integrity: ban global patching, use in-memory fakes for state-managing outbound ports, and use strictly autospec-bound mocks only for external side-effects. Ensure environmental gates are explicitly drivable by the test harness via composition-root injection or isolated pseudo-resources so tests never silently exercise only the runner's default fallback branch.
|
|
15
15
|
- **Runtime Contract Assertions:** Enforce Design-by-Contract with native `assert condition, "message"` for pre/post-conditions and invariants (strippable via `python -O`); never custom exceptions for contract checks.
|
|
16
|
-
- **Dependency Injection:** Constructor injection mandate; forbid Service Locator and global containers.
|
|
16
|
+
- **Dependency Injection:** Constructor injection mandate (including ambient environment capabilities at the composition root); forbid Service Locator and global containers.
|
|
17
17
|
- **Centralized Configuration:** Config file location, prohibition of magic numbers.
|
|
18
18
|
- **Continuous Integration:** Parallel CI jobs: 1) Blocking OS matrix test suite. 2) Blocking static-analysis job on the same OS matrix running deterministic, diff-actionable checks (formatters, linters, security scanners, type checkers, and structural checkers), so a platform-conditional type or lint verdict surfaces instead of hiding behind a single runner. 3) Non-blocking (`continue-on-error: true`) quality-metrics job on the same OS matrix for aggregate, repository-wide checks (test-pyramid ratios, file-length caps, duplication thresholds) that no single commit can satisfy. Every matrix job sets `fail-fast: false` and a bash default shell. Platform-specific and CI-only issues are investigated via the Remote Probing Protocol (`make probe REASON="<reason>"`). See [docs/templates/ci.md](docs/templates/ci.md).
|
|
19
19
|
- **Local Quality Gates:** Local pre-commit hooks MUST stay fast, checking only staged files (formatters, secret detection, merge conflict markers). Heavier static analysis runs in the blocking static-analysis CI job, keeping the local commit loop fast. The full test suite runs via the post-commit hook (`.githooks/post-commit.py`) as an unskippable safety net, reverting automatically on failure. See [docs/templates/pre-commit.md](docs/templates/pre-commit.md).
|
|
@@ -42,23 +42,27 @@ Boundary conditions, errors, and validation edge cases. These drive granular Uni
|
|
|
42
42
|
|
|
43
43
|
**Taxonomy:**
|
|
44
44
|
- `[Domain]` = Ambiguities in business rules, policy decisions, domain definitions, or scope boundaries. Resolve by asking the user directly.
|
|
45
|
-
- `[Technical]` = External dependencies, third-party libraries, APIs, internal state machines, complex algorithms, concurrency, performance, or data storage. Resolve via works-like prototypes.
|
|
45
|
+
- `[Technical]` = External dependencies, third-party libraries, APIs, internal state machines, complex algorithms, concurrency, performance, or data storage. Resolve via works-like prototypes.
|
|
46
46
|
- `[Functional]` = User-facing ergonomics, CLI flags, terminal rendering, interactive flows, or layout aesthetics. Resolve via looks-like prototypes.
|
|
47
|
+
- `[Harness]` = Uncertainties about how the automated test suite can deterministically trigger, isolate, and observe a `Scenarios` precondition or environmental gate without global patching. Resolve via test-runner probes.
|
|
47
48
|
|
|
48
49
|
**Mandatory De-risking Triggers (must include, but are not limited to):**
|
|
49
50
|
1. Log any new or modified integration with an external system, library, API, or storage layer as `[Technical]`.
|
|
50
51
|
2. Log any new or modified user interaction, CLI flags, terminal formatting, or interactive UX flow as `[Functional]`.
|
|
51
52
|
3. Log any business rule, policy, or scope ambiguity as `[Domain]`.
|
|
53
|
+
4. Log any `Scenarios` precondition or behavior gated on ambient runtime/environment state as `[Harness]`, proving how the test suite will deterministically drive and observe every branch.
|
|
54
|
+
|
|
55
|
+
**Exclusion:** Do not log unknowns that can be verified by reading existing code, library docs, or the existing Test Harness; resolve and record those under `Context` instead.
|
|
52
56
|
|
|
53
57
|
**Design Sensitivity:** For every unknown, record a one-line Design Sensitivity stating how the design reacts to each resolution (e.g., "if this resolves as X → contracts hold; if Y → this port/DTO changes").
|
|
54
58
|
|
|
55
59
|
## Impact
|
|
56
|
-
Map affected components using non-breaking steps (extend -> migrate -> prune) to protect existing consumers.
|
|
60
|
+
Map affected components using non-breaking steps (extend -> migrate -> prune) to protect existing consumers. For `[NEW]` capabilities replacing inline behavior, enumerate all surfaces and execution modes producing that artifact, marking each as migrated or explicitly excluded.
|
|
57
61
|
|
|
58
62
|
**Format:**
|
|
59
63
|
1. `[NEW]` `ComponentOrModule` — Create new boundary or component.
|
|
60
64
|
2. `[EXTEND]` `ComponentOrModule.method` — Additive, non-breaking contract extension alongside existing code.
|
|
61
|
-
3. `[MIGRATE]` `ConsumerComponent` — Transition consumers
|
|
65
|
+
3. `[MIGRATE]` `ConsumerComponent` — Transition consumers or ad-hoc/inline emitters across all matching execution modes to use the new or extended contract.
|
|
62
66
|
4. `[PRUNE]` `ObsoleteComponentOrMethod` — Safely prune deprecated methods, shims, or dead code once all callers have migrated.
|
|
63
67
|
|
|
64
68
|
## Deliverables
|
|
File without changes
|
|
File without changes
|
|
File without changes
|