thoth-agents 0.3.10 → 0.3.11

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.
@@ -1,12 +1,39 @@
1
1
  # Implement contract
2
2
 
3
- **Owner**: root, designer, quick, or deep; exactly one writer per mutable surface
3
+ **Owner**: adaptive root, `designer`, `quick`, or `deep` in every route; exactly
4
+ one writer per mutable surface
4
5
 
5
- Root marks selected artifact-backed tasks `[~]`, then assigns exact paths,
6
- accepted FR/buildable-SC scope, non-goals, and verification commands. Use the
7
- mandatory `tdd` skill for behavior changes and work in vertical red/green
8
- slices. Child writers never edit task state; root marks `[x]` only after checking
9
- task-specific evidence.
6
+ SDD routes govern artifacts and gates, not implementation ownership. Before
7
+ implementation or dispatch, root records the decided owner, task-shape/net-gain
8
+ rationale, exact paths, accepted FR/buildable-SC scope, non-goals, and
9
+ verification commands. Route, file count, or cheaper model price alone is not an
10
+ ownership rationale.
11
+
12
+ Root may retain implementation when short or sequential work, shared mutable
13
+ state, accumulated context, rediscovery, or coordination overhead outweighs
14
+ delegation benefit. Delegate when specialization, context isolation, independent
15
+ bounded work, quality, latency, or total cost creates demonstrated net gain. If
16
+ root owns the surface, do not dispatch a writer. If a specialist owns it, send a
17
+ bounded handoff with the exact surface, requirements, and checks.
18
+
19
+ Root marks selected artifact-backed tasks `[~]`; Direct or no-artifact work has
20
+ no task state. Use the mandatory `tdd` skill for behavior changes and work in
21
+ vertical red/green slices. Child writers never edit task state; root marks `[x]`
22
+ only after checking task-specific evidence.
23
+
24
+ After deciding delegation creates net gain, select deterministically:
25
+
26
+ - `designer` for user-facing UI/UX, interaction, accessibility, responsive, or
27
+ visual-quality work;
28
+ - `quick` for a known narrow mechanical low-risk surface with exact targets;
29
+ - `deep` for coupled multi-file, shared-contract, migration, concurrency,
30
+ edge-case-heavy, or high-risk work.
31
+
32
+ Proven independent surfaces may use different writers only with non-overlapping
33
+ ownership. Overlapping or compatibility-coupled work uses one `deep` writer and
34
+ ordered handoffs. A writer escalates before expanding beyond its routing
35
+ boundary. The implementation writer never performs final verification; root
36
+ hands the unchanged candidate to a fresh Oracle.
10
37
 
11
38
  Implementation evidence may refine an artifact without restarting the workflow:
12
39
 
@@ -300,16 +300,36 @@ function parseStoryScenarios(spec) {
300
300
  const covers =
301
301
  /^\*\*Covers\*\*:\s*(.+)$/im.exec(story)?.[1].match(/\bFR-\d{3}\b/g) ??
302
302
  [];
303
- const scenarios = [
304
- ...story.matchAll(
305
- /^\d+\.\s+\*\*Given\*\*\s+(.+?),\s+\*\*When\*\*\s+(.+?),\s+\*\*Then\*\*\s+(.+?)\.?\s*$/gim,
306
- ),
307
- ].map((scenario, scenarioIndex) => ({
308
- title: `US${storyMatch[1]} - ${storyMatch[2].trim()} ${scenarioIndex + 1}`,
309
- given: scenario[1].trim(),
310
- when: scenario[2].trim(),
311
- result: scenario[3].trim(),
312
- }));
303
+ const acceptanceMarker = /^\*\*Acceptance scenarios\*\*:\s*$/im.exec(story);
304
+ const acceptance = acceptanceMarker
305
+ ? story.slice((acceptanceMarker.index ?? 0) + acceptanceMarker[0].length)
306
+ : '';
307
+ const scenarioStarts = [
308
+ ...acceptance.matchAll(/^\d+\.\s+\*\*Given\*\*/gim),
309
+ ];
310
+ const scenarios = scenarioStarts.map((scenarioStart, scenarioIndex) => {
311
+ const start = scenarioStart.index ?? 0;
312
+ const end = scenarioStarts[scenarioIndex + 1]?.index ?? acceptance.length;
313
+ const normalized = acceptance
314
+ .slice(start, end)
315
+ .replace(/\s+/g, ' ')
316
+ .trim();
317
+ const scenario =
318
+ /^\d+\.\s+\*\*Given\*\*\s+(.+?),\s+\*\*When\*\*\s+(.+?),\s+\*\*Then\*\*\s+(.+?)\.?\s*$/i.exec(
319
+ normalized,
320
+ );
321
+ if (!scenario) {
322
+ throw new Error(
323
+ `US${storyMatch[1]} acceptance scenario ${scenarioIndex + 1} must use Given, When, and Then`,
324
+ );
325
+ }
326
+ return {
327
+ title: `US${storyMatch[1]} - ${storyMatch[2].trim()} ${scenarioIndex + 1}`,
328
+ given: scenario[1].trim(),
329
+ when: scenario[2].trim(),
330
+ result: scenario[3].trim(),
331
+ };
332
+ });
313
333
 
314
334
  for (const requirementId of covers) {
315
335
  const current = scenariosByRequirement.get(requirementId) ?? [];
@@ -31,7 +31,19 @@ Accelerated the minimum recommendation but does not force it.
31
31
 
32
32
  - Root owns sequential coordination artifacts, gate execution, and archive.
33
33
  - Explorer owns Full-route repository discovery.
34
- - Designer, quick, deep, or root may implement according to scope.
34
+ - SDD routes govern artifacts and gates, not implementation ownership. Root,
35
+ `designer`, `quick`, or `deep` may implement in Direct, Accelerated, or Full.
36
+ - Root decides ownership from explicit safe user direction and demonstrated net
37
+ gain. Delegation benefits include specialization, context isolation,
38
+ independent bounded work, quality, latency, or total cost; root continuity
39
+ benefits include short or sequential work, shared mutable state, accumulated
40
+ context, rediscovery, and coordination overhead. Route, file count, or cheaper
41
+ model price alone never selects an owner.
42
+ - Only after deciding to delegate implementation, select `designer` for UI/UX,
43
+ `quick` for known narrow low-risk work, or `deep` for coupled, edge-case-heavy,
44
+ migration, concurrency, shared-contract, or high-risk work.
45
+ - Each mutable surface has one writer; independent non-overlapping surfaces may
46
+ split, while coupled surfaces use one `deep` writer and ordered handoffs.
35
47
  - Oracle owns `plan-review` when the user selects it and **every** `verify`. The
36
48
  implementation writer never approves its own work.
37
49
 
@@ -1,12 +1,39 @@
1
1
  # Implement contract
2
2
 
3
- **Owner**: root, designer, quick, or deep; exactly one writer per mutable surface
3
+ **Owner**: adaptive root, `designer`, `quick`, or `deep` in every route; exactly
4
+ one writer per mutable surface
4
5
 
5
- Root marks selected artifact-backed tasks `[~]`, then assigns exact paths,
6
- accepted FR/buildable-SC scope, non-goals, and verification commands. Use the
7
- mandatory `tdd` skill for behavior changes and work in vertical red/green
8
- slices. Child writers never edit task state; root marks `[x]` only after checking
9
- task-specific evidence.
6
+ SDD routes govern artifacts and gates, not implementation ownership. Before
7
+ implementation or dispatch, root records the decided owner, task-shape/net-gain
8
+ rationale, exact paths, accepted FR/buildable-SC scope, non-goals, and
9
+ verification commands. Route, file count, or cheaper model price alone is not an
10
+ ownership rationale.
11
+
12
+ Root may retain implementation when short or sequential work, shared mutable
13
+ state, accumulated context, rediscovery, or coordination overhead outweighs
14
+ delegation benefit. Delegate when specialization, context isolation, independent
15
+ bounded work, quality, latency, or total cost creates demonstrated net gain. If
16
+ root owns the surface, do not dispatch a writer. If a specialist owns it, send a
17
+ bounded handoff with the exact surface, requirements, and checks.
18
+
19
+ Root marks selected artifact-backed tasks `[~]`; Direct or no-artifact work has
20
+ no task state. Use the mandatory `tdd` skill for behavior changes and work in
21
+ vertical red/green slices. Child writers never edit task state; root marks `[x]`
22
+ only after checking task-specific evidence.
23
+
24
+ After deciding delegation creates net gain, select deterministically:
25
+
26
+ - `designer` for user-facing UI/UX, interaction, accessibility, responsive, or
27
+ visual-quality work;
28
+ - `quick` for a known narrow mechanical low-risk surface with exact targets;
29
+ - `deep` for coupled multi-file, shared-contract, migration, concurrency,
30
+ edge-case-heavy, or high-risk work.
31
+
32
+ Proven independent surfaces may use different writers only with non-overlapping
33
+ ownership. Overlapping or compatibility-coupled work uses one `deep` writer and
34
+ ordered handoffs. A writer escalates before expanding beyond its routing
35
+ boundary. The implementation writer never performs final verification; root
36
+ hands the unchanged candidate to a fresh Oracle.
10
37
 
11
38
  Implementation evidence may refine an artifact without restarting the workflow:
12
39