amsd-pipeline-shared 0.5.11 → 0.5.13

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.
Files changed (135) hide show
  1. package/README.md +13 -0
  2. package/docs/gateway-baseline-2.0.80.md5 +130 -0
  3. package/docs/gateway-files.txt +131 -0
  4. package/orchestrations/prompts/templates/ac-classification.json +32 -0
  5. package/orchestrations/prompts/templates/ac-elaboration.json +22 -0
  6. package/orchestrations/prompts/templates/ac-gate-codeline-assignment.json +27 -0
  7. package/orchestrations/prompts/templates/agent-name-refusal.json +15 -0
  8. package/orchestrations/prompts/templates/agent-plan-mode.json +22 -0
  9. package/orchestrations/prompts/templates/agent-proposal.json +40 -0
  10. package/orchestrations/prompts/templates/agent-retry-prefix.json +47 -0
  11. package/orchestrations/prompts/templates/assign-agent-roles.json +22 -0
  12. package/orchestrations/prompts/templates/bug-fix-story.json +33 -0
  13. package/orchestrations/prompts/templates/change-reviewer.json +30 -0
  14. package/orchestrations/prompts/templates/code-graph-detective.json +41 -0
  15. package/orchestrations/prompts/templates/codeline-bridge.json +20 -0
  16. package/orchestrations/prompts/templates/content-retry-correction.json +28 -0
  17. package/orchestrations/prompts/templates/coordinator-amendment.json +37 -0
  18. package/orchestrations/prompts/templates/corrective-note.json +24 -0
  19. package/orchestrations/prompts/templates/cpa-inference.json +29 -0
  20. package/orchestrations/prompts/templates/cpa-system.json +20 -0
  21. package/orchestrations/prompts/templates/declared-packages.json +14 -0
  22. package/orchestrations/prompts/templates/detective-extract.json +16 -0
  23. package/orchestrations/prompts/templates/detective-overall-plan-given.json +19 -0
  24. package/orchestrations/prompts/templates/detective-overall-plan.json +26 -0
  25. package/orchestrations/prompts/templates/detective-prescription.json +22 -0
  26. package/orchestrations/prompts/templates/detective-retry-note.json +20 -0
  27. package/orchestrations/prompts/templates/detective-shared-package.json +28 -0
  28. package/orchestrations/prompts/templates/discovery-vocabulary.json +23 -0
  29. package/orchestrations/prompts/templates/e2e-route-check.json +22 -0
  30. package/orchestrations/prompts/templates/estate-survey.json +32 -0
  31. package/orchestrations/prompts/templates/estimation-assessment.json +26 -0
  32. package/orchestrations/prompts/templates/fix-plan-shared.json +19 -0
  33. package/orchestrations/prompts/templates/guard-vocabulary-codegraph.json +25 -0
  34. package/orchestrations/prompts/templates/guard-vocabulary-documentation.json +21 -0
  35. package/orchestrations/prompts/templates/guard-vocabulary.json +34 -0
  36. package/orchestrations/prompts/templates/hybrid-prephase-coordinator.json +16 -0
  37. package/orchestrations/prompts/templates/inference-ladder-coordinator.json +27 -0
  38. package/orchestrations/prompts/templates/kb-enforcement-synthesis.json +28 -0
  39. package/orchestrations/prompts/templates/lint-ac-remediator.json +20 -0
  40. package/orchestrations/prompts/templates/lint-fixer.json +19 -0
  41. package/orchestrations/prompts/templates/manifest-analysis.json +13 -0
  42. package/orchestrations/prompts/templates/mint-existing-roster.json +25 -0
  43. package/orchestrations/prompts/templates/new-dependency-directive.json +28 -0
  44. package/orchestrations/prompts/templates/new-dependency-lockfile-note.json +20 -0
  45. package/orchestrations/prompts/templates/phase-assessment-header.json +19 -0
  46. package/orchestrations/prompts/templates/pipeline-tools-command.json +13 -0
  47. package/orchestrations/prompts/templates/pipeline-tools-hosted.json +12 -0
  48. package/orchestrations/prompts/templates/plan-corrective.json +21 -0
  49. package/orchestrations/prompts/templates/plan-producer.json +24 -0
  50. package/orchestrations/prompts/templates/plan-reviewer.json +20 -0
  51. package/orchestrations/prompts/templates/prd-change-reviewer-mode-rules.json +28 -0
  52. package/orchestrations/prompts/templates/prd-change-reviewer-spec.json +33 -0
  53. package/orchestrations/prompts/templates/prd-change-reviewer.json +27 -0
  54. package/orchestrations/prompts/templates/prd-change-summarizer-text.json +19 -0
  55. package/orchestrations/prompts/templates/prd-change-summarizer-tool.json +21 -0
  56. package/orchestrations/prompts/templates/prd-configuration-block.json +24 -0
  57. package/orchestrations/prompts/templates/prd-generation.json +16 -0
  58. package/orchestrations/prompts/templates/prd-model-coordinator.json +24 -0
  59. package/orchestrations/prompts/templates/previous-refusal.json +15 -0
  60. package/orchestrations/prompts/templates/profile-augmentor.json +24 -0
  61. package/orchestrations/prompts/templates/project-prompt-generation.json +54 -0
  62. package/orchestrations/prompts/templates/project-roster-review.json +11 -0
  63. package/orchestrations/prompts/templates/prompt-claim-adjudication.json +21 -0
  64. package/orchestrations/prompts/templates/prompt-review.json +48 -0
  65. package/orchestrations/prompts/templates/qa-brownfield-scope.json +36 -0
  66. package/orchestrations/prompts/templates/qa-evidence-labels.json +28 -0
  67. package/orchestrations/prompts/templates/qa-fuzz-weaver.json +35 -0
  68. package/orchestrations/prompts/templates/qa-mutant-hunter.json +28 -0
  69. package/orchestrations/prompts/templates/qa-oracle-evidence.json +35 -0
  70. package/orchestrations/prompts/templates/qa-perf-sentinel.json +30 -0
  71. package/orchestrations/prompts/templates/qa-review-ranger.json +28 -0
  72. package/orchestrations/prompts/templates/qa-sast-sentinel.json +35 -0
  73. package/orchestrations/prompts/templates/qa-spec-validator.json +30 -0
  74. package/orchestrations/prompts/templates/release-line-port.json +22 -0
  75. package/orchestrations/prompts/templates/repro-feedback.json +31 -0
  76. package/orchestrations/prompts/templates/repro-role.json +32 -0
  77. package/orchestrations/prompts/templates/repro-test-writer.json +55 -0
  78. package/orchestrations/prompts/templates/retry-extension-coordinator.json +22 -0
  79. package/orchestrations/prompts/templates/review-ac-remediator.json +24 -0
  80. package/orchestrations/prompts/templates/review-finding-routing.json +17 -0
  81. package/orchestrations/prompts/templates/review-scope-block.json +18 -0
  82. package/orchestrations/prompts/templates/roster-review.json +46 -0
  83. package/orchestrations/prompts/templates/roster-specialisation-one.json +14 -0
  84. package/orchestrations/prompts/templates/roster-specialisation-plan.json +12 -0
  85. package/orchestrations/prompts/templates/roster-specialisation.json +24 -0
  86. package/orchestrations/prompts/templates/roster-tool-grant.json +20 -0
  87. package/orchestrations/prompts/templates/runtime-boundary-review.json +30 -0
  88. package/orchestrations/prompts/templates/shared-file-ownership.json +24 -0
  89. package/orchestrations/prompts/templates/skill-assessment-postphase.json +22 -0
  90. package/orchestrations/prompts/templates/skill-assessment-prephase.json +35 -0
  91. package/orchestrations/prompts/templates/skills-coordinator.json +19 -0
  92. package/orchestrations/prompts/templates/spec-agent-openspec.brownfield.json +67 -0
  93. package/orchestrations/prompts/templates/spec-agent-openspec.json +63 -0
  94. package/orchestrations/prompts/templates/spec-agent-speckit-refine.json +30 -0
  95. package/orchestrations/prompts/templates/spec-agent-speckit.json +28 -0
  96. package/orchestrations/prompts/templates/spec-authoring-rules.json +25 -0
  97. package/orchestrations/prompts/templates/spec-brownfield-mode.json +33 -0
  98. package/orchestrations/prompts/templates/spec-context-fragments.json +39 -0
  99. package/orchestrations/prompts/templates/spec-coordinator-review.json +29 -0
  100. package/orchestrations/prompts/templates/spec-coordinator.json +26 -0
  101. package/orchestrations/prompts/templates/spec-model-review.json +23 -0
  102. package/orchestrations/prompts/templates/spec-review-criteria.json +23 -0
  103. package/orchestrations/prompts/templates/spec-shared-consumer.json +20 -0
  104. package/orchestrations/prompts/templates/spec-story-block.json +42 -0
  105. package/orchestrations/prompts/templates/speckit-split-rules.json +20 -0
  106. package/orchestrations/prompts/templates/squad-coder.json +19 -0
  107. package/orchestrations/prompts/templates/squad-leader.json +19 -0
  108. package/orchestrations/prompts/templates/squad-security-auditor.json +19 -0
  109. package/orchestrations/prompts/templates/squad-tester.json +19 -0
  110. package/orchestrations/prompts/templates/story-ac-remediator.json +29 -0
  111. package/orchestrations/prompts/templates/story-diff-not-inlined.json +16 -0
  112. package/orchestrations/prompts/templates/story-file-generation.json +28 -0
  113. package/orchestrations/prompts/templates/story-implementation.json +25 -0
  114. package/orchestrations/prompts/templates/story-kind-hint-defect.json +18 -0
  115. package/orchestrations/prompts/templates/story-kind-hint-other.json +20 -0
  116. package/orchestrations/prompts/templates/story-plan-agent.json +31 -0
  117. package/orchestrations/prompts/templates/story-writer-main.json +96 -0
  118. package/orchestrations/prompts/templates/story-writer.json +28 -0
  119. package/orchestrations/prompts/templates/survey-review.json +38 -0
  120. package/orchestrations/prompts/templates/tc-writer.json +36 -0
  121. package/orchestrations/prompts/templates/test-gate-finding.json +27 -0
  122. package/orchestrations/prompts/templates/test-ownership.json +38 -0
  123. package/orchestrations/prompts/templates/tools-coordinator.json +18 -0
  124. package/orchestrations/prompts/templates/topology-router.json +30 -0
  125. package/orchestrations/prompts/templates/update-invalidated-tests.json +33 -0
  126. package/orchestrations/prompts/templates/vc-coverage.json +20 -0
  127. package/orchestrations/prompts/templates/vc-regenerate.json +33 -0
  128. package/orchestrations/prompts/templates/vc-review.json +27 -0
  129. package/orchestrations/prompts/templates/worktree-autocommit-message.json +27 -0
  130. package/orchestrations/prompts/templates/writer-codegraph-block.json +25 -0
  131. package/orchestrations/prompts/templates/writer-plan-section.json +28 -0
  132. package/orchestrations/prompts/templates/writer-string-invariants.json +17 -0
  133. package/orchestrations/scripts/lib/project-prompt-contract.js +414 -0
  134. package/orchestrations/scripts/refresh-project-prompts.js +96 -0
  135. package/package.json +1 -1
@@ -0,0 +1,63 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of spec-mode-runner.js runSpecAgent on 2026-08-16.",
4
+ "",
5
+ "The openspec agent writes the specification every later stage is judged against. Every",
6
+ "one of its seventeen inputs is a NAMED BLOCK computed above the literal — nothing branches",
7
+ "inside the prompt itself, which is why this one migrates cleanly where the VC prompts did",
8
+ "not: there is no conditional here for a fixture to leave unexercised.",
9
+ "",
10
+ "Its seven ADJACENT blocks on the opening line are what exposed a greedy-matching bug in the",
11
+ "renderer: __A____B__ was read as one placeholder, so this template declared a token nobody",
12
+ "supplies and threw on every render. The pattern is lazy now; substitution by key was always",
13
+ "adjacency-safe."
14
+ ],
15
+ "body": "__FORCED_RETRY_BLOCK__You are the __AGENT__ specification agent for EPAM CLI. Phase __PHASE__, story __STORY_ID__.__SPLIT_WARNING____PRIOR_GAPS_BLOCK____SEMBLE_CONTEXT____REFERENCED_DOCS_EVIDENCE____ESTIMATION_ASSESSMENT____FIX_SITE_BLOCK____DECLARED_FILE_BLOCK____SHARED_FILE_OWNERSHIP_BLOCK____BROWNFIELD_ARCHAEOLOGY_BLOCK__\n__GENERATE_INSTRUCTION__\n{\n \"storyId\":\"__STORY_ID__\",\n \"agent\":\"__AGENT__\",\n \"notes\":\"context\",\n \"acceptanceCriteria\":[\"...\"],\n \"description\":\"...\",\n \"title\":\"...\",__LOCATION_HINT_SCHEMA_LINE____SPLIT_SCHEMA_FIELD__\n}\nUse existing text when no change is needed.__SPLIT_RULES_BLOCK__\n__PRD_CONFIGURATION_BLOCK__\nStory context:\n__STORY_PAYLOAD____PUBLISHED_CONTRACTS__\n",
16
+ "description": "Produce or revise the specification for one story, as the openspec agent.",
17
+ "id": "spec-agent-openspec",
18
+ "placeholders": [
19
+ "__ESTIMATION_ASSESSMENT__",
20
+ "__AGENT__",
21
+ "__BROWNFIELD_ARCHAEOLOGY_BLOCK__",
22
+ "__DECLARED_FILE_BLOCK__",
23
+ "__FIX_SITE_BLOCK__",
24
+ "__FORCED_RETRY_BLOCK__",
25
+ "__GENERATE_INSTRUCTION__",
26
+ "__LOCATION_HINT_SCHEMA_LINE__",
27
+ "__PHASE__",
28
+ "__PRD_CONFIGURATION_BLOCK__",
29
+ "__PRIOR_GAPS_BLOCK__",
30
+ "__PUBLISHED_CONTRACTS__",
31
+ "__REFERENCED_DOCS_EVIDENCE__",
32
+ "__SEMBLE_CONTEXT__",
33
+ "__SHARED_FILE_OWNERSHIP_BLOCK__",
34
+ "__SPLIT_RULES_BLOCK__",
35
+ "__SPLIT_SCHEMA_FIELD__",
36
+ "__SPLIT_WARNING__",
37
+ "__STORY_ID__",
38
+ "__STORY_PAYLOAD__"
39
+ ],
40
+ "version": 2,
41
+ "seams": [
42
+ "spec-agent"
43
+ ],
44
+ "mayBeEmpty": [
45
+ "__ESTIMATION_ASSESSMENT__",
46
+ "__BROWNFIELD_ARCHAEOLOGY_BLOCK__",
47
+ "__DECLARED_FILE_BLOCK__",
48
+ "__FIX_SITE_BLOCK__",
49
+ "__FORCED_RETRY_BLOCK__",
50
+ "__LOCATION_HINT_SCHEMA_LINE__",
51
+ "__PRIOR_GAPS_BLOCK__",
52
+ "__PRD_CONFIGURATION_BLOCK__",
53
+ "__PUBLISHED_CONTRACTS__",
54
+ "__REFERENCED_DOCS_EVIDENCE__",
55
+ "__SEMBLE_CONTEXT__",
56
+ "__SPLIT_RULES_BLOCK__",
57
+ "__SPLIT_SCHEMA_FIELD__",
58
+ "__SPLIT_WARNING__",
59
+ "__SHARED_FILE_OWNERSHIP_BLOCK__"
60
+ ],
61
+ "$whyEstimationAssessmentMayBeEmpty": "__ESTIMATION_ASSESSMENT__ (2026-09-28): the estimation application's assessment of this story's ticket (EPAM_ESTIMATION_MANIFEST, rendered by lib/handlers/estimation-manifest.js with this agent's framing from the engine template estimation-assessment). Absent is the ordinary state: a run with no manifest, or a ticket the manifest does not cover. It sits directly beside its neighbour with no separator of its own, so an absent assessment renders the prompt byte-for-byte as before.",
62
+ "$whyMayBeEmpty": "Declared 2026-08-27 after run 20260827T125654Z aborted here. Each of these is a CONDITIONAL INSERT: the story is not being split, no earlier pass left gaps, no documentation was fetched, no contract has been published yet and attempt one carries no forced-retry note. The renderer's own rule is that absence must be a real state rather than a failed lookup — and a first pass having no prior gaps is exactly that. All ten rendered empty during normal operation and the render refused, three times per story, with no model involved; both lanes halted at the specification pass. __FIX_SITE_BLOCK__ is the one to watch: empty is legitimate before discovery has run, but it is ALSO what an unavailable code-graph-detective produces, and that failure is reported separately rather than inferred from this blank. __BROWNFIELD_ARCHAEOLOGY_BLOCK__ and __LOCATION_HINT_SCHEMA_LINE__ added 2026-09-13: both come from buildBrownfieldArchaeologyBlock, which produces nothing for a project declaring EPAM_BROWNFIELD=0 — there is no existing code to locate a fix site in. Undeclared, the £0 greenfield run refused its own spec prompt three times per story with no model involved and aborted at the specification pass."
63
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of spec-mode-runner.js runSpeckitAgent on 2026-08-16.",
4
+ "",
5
+ "The REFINE branch, taken only when validateMidExecutionSplits has already created the",
6
+ "children. It is a separate template from the other branch rather than one prompt with a",
7
+ "condition, because the two ask for different work from different starting material —",
8
+ "and a single prompt with a branch hides which one an agent received."
9
+ ],
10
+ "body": "__FORCED_RETRY_BLOCK__You are the speckit specification agent for EPAM CLI. Phase __PHASE__, story __STORY_ID__.\n\nThis story was ALREADY split into the children listed below (openspec's decision, already applied — you are not creating or removing any child). Your job: review and refine EACH CHILD's acceptanceCriteria for testability and completeness, exactly as you would for an unsplit story.\n1. For each child, review its acceptanceCriteria for testability and completeness\n2. Add missing edge-case, error-handling, security, and accessibility criteria per child\n3. Flag any AC that are vague, untestable, or overlapping\n4. Do NOT add, remove, or rename any child — return one entry per child id below, using the SAME ids\n5. Do NOT remove or duplicate the existing work — build on it\n\n━━━ WHAT-NOT-HOW RULE (MANDATORY) ━━━\nEvery AC must describe an OBSERVABLE OUTCOME (what a test can verify from outside the code),\nNOT an implementation instruction. If an AC names vi.mock, jest.fn, mockReturnValue,\nmockResolvedValue, import statements, or require() calls, REPLACE it with a\nGiven/When/Then behaviour statement. Never tell the implementer which library or mock pattern to use.\n\nTHE EXISTING CHILDREN (your input to review):\n__EXISTING_CHILDREN__\n\nORIGINAL PARENT STORY CONTEXT:\n__STORY_PAYLOAD__\n__SHARED_BLOCK__\n\nProduce your refined output as raw JSON only (no XML tags, no markdown fences, no preamble):\n- \"splitStories\": array of {\"id\": \"<same child id>\", \"acceptanceCriteria\": [...], \"notes\": \"what you changed and why\"} — one entry per child id above, same ids, no new/removed ids.\n- \"notes\": overall summary of what you changed and why.\n\nYou may have read-only tools (read_file, list_files, search) available this turn for a\nbrownfield story with a real codeline — if so, USE them for real to verify a file's actual\ncontents before relying on it; do not invent what a tool would return. For a greenfield\nstory with no existing codeline, you have none — answer from what is already in this\nprompt rather than guessing at file contents. Either way, never emit tool-call syntax\n(<tool_call>, <tool_use>, <function_call>) narrating an imagined result — a fabricated\n\"tool_result\" is worse than an honest \"I don't know.\"\n",
11
+ "description": "Refine acceptance criteria for split children that already exist.",
12
+ "id": "spec-agent-speckit-refine",
13
+ "placeholders": [
14
+ "__EXISTING_CHILDREN__",
15
+ "__FORCED_RETRY_BLOCK__",
16
+ "__PHASE__",
17
+ "__SHARED_BLOCK__",
18
+ "__STORY_ID__",
19
+ "__STORY_PAYLOAD__"
20
+ ],
21
+ "version": 1,
22
+ "seams": [
23
+ "spec-agent"
24
+ ],
25
+ "mayBeEmpty": [
26
+ "__FORCED_RETRY_BLOCK__",
27
+ "__SHARED_BLOCK__"
28
+ ],
29
+ "$whyMayBeEmpty": "Declared 2026-08-27 by sweeping the CLASS rather than the instance, after three runs died on it one placeholder at a time. Every call site for these writes an explicit empty branch — the story is not being split, attempt one carries no forced-retry note, no documentation was fetched, the persona prefix is optional — so absence is a real state, which is the renderer's own test. Placeholders supplied by a lookup that may FAIL (`x || ''`) are deliberately NOT here: for those, empty means broken, and declaring them would hide the blank-brief defect the renderer exists to surface. Unanimity is required — one deliberate branch among several defensive lookups is not a licence."
30
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of spec-mode-runner.js runSpeckitAgent on 2026-08-16.",
4
+ "",
5
+ "The COLLABORATIVE branch: speckit is not starting from scratch, it is building on what",
6
+ "openspec produced. See the refine branch for why these stayed two templates."
7
+ ],
8
+ "body": "__FORCED_RETRY_BLOCK__You are the speckit specification agent for EPAM CLI. Phase __PHASE__, story __STORY_ID__.\n\nYou are reviewing and building on the openspec agent's output for this story.\nYour role is COLLABORATIVE — you are NOT starting from scratch. Instead:\n1. Review openspec's proposed acceptance criteria for testability and completeness\n2. Add missing edge-case, error-handling, security, and accessibility criteria\n3. Flag any AC that are vague, untestable, or overlapping\n4. Splitting is openspec's decision alone — you do NOT split stories. If openspec already split\n this story, do NOT include a \"splitStories\" field in your output at all (it will be ignored if\n you do). Review and refine the acceptanceCriteria openspec gave you for the UNSPLIT story as\n normal; per-child refinement of an already-split story's children happens on a later turn, not\n here.\n5. Do NOT remove or duplicate openspec's good work — build on it\n\n━━━ WHAT-NOT-HOW RULE (MANDATORY) ━━━\nEvery AC must describe an OBSERVABLE OUTCOME (what a test can verify from outside the code),\nNOT an implementation instruction. If an AC names vi.mock, jest.fn, mockReturnValue,\nmockResolvedValue, import statements, or require() calls, REPLACE it with a\nGiven/When/Then behaviour statement. Never tell the implementer which library or mock pattern to use.\n\nOPENSPEC'S OUTPUT (your input to review — ACs and split proposals only):\n__OPENSPEC_OUTPUT__\n\nORIGINAL STORY CONTEXT:\n__STORY_PAYLOAD__\n__SHARED_BLOCK__\n\nProduce your refined output as raw JSON only (no XML tags, no markdown fences, no preamble). Include:\n- \"acceptanceCriteria\": The FULL merged list (openspec's criteria + your additions/refinements). Every item MUST be an observable outcome, not an implementation instruction.\n- \"notes\": What you changed and why (be specific — cite which criteria you added/modified/replaced)\n- \"splitStories\": ALWAYS omit this field. Splitting is openspec's decision alone — never propose\n split children of your own, even if openspec already split this story.\n- \"acAddedBySpeckit\": Array of criteria YOU added that were not in openspec's output\n- \"acModifiedBySpeckit\": Array of {\"original\":\"...\",\"revised\":\"...\"} for criteria you reworded\n- \"acFlagged\": Array of {\"criterion\":\"...\",\"flag\":\"...\"} for criteria that need human attention\n\nFor a brownfield story with a real codeline, you may have read-only tools (read_file,\nlist_files, search) available this turn — if so, USE them for real to check a file's\nactual contents before relying on it; do not invent what a tool would return. For a\ngreenfield story with no existing codeline, you have none — give your best answer from\nthe description, title and paths you were given, and say so in \"notes\" if the file\ncontents would have changed your answer. Either way, never narrate an imagined tool\nresult: a real answer with an honest caveat is worth everything; fabricated tool-call\nsyntax (<tool_call>, <tool_use>, <function_call>) is worth nothing — it is discarded in\nfull and the work is lost (observed live, 2026-07-28: exactly this, on an empty-criteria\nstory that got no answer at all).\n",
9
+ "description": "Review and build on the openspec agent's output for a story.",
10
+ "id": "spec-agent-speckit",
11
+ "placeholders": [
12
+ "__FORCED_RETRY_BLOCK__",
13
+ "__OPENSPEC_OUTPUT__",
14
+ "__PHASE__",
15
+ "__SHARED_BLOCK__",
16
+ "__STORY_ID__",
17
+ "__STORY_PAYLOAD__"
18
+ ],
19
+ "version": 1,
20
+ "seams": [
21
+ "spec-agent"
22
+ ],
23
+ "mayBeEmpty": [
24
+ "__FORCED_RETRY_BLOCK__",
25
+ "__SHARED_BLOCK__"
26
+ ],
27
+ "$whyMayBeEmpty": "Declared 2026-08-27 by sweeping the CLASS rather than the instance, after three runs died on it one placeholder at a time. Every call site for these writes an explicit empty branch — the story is not being split, attempt one carries no forced-retry note, no documentation was fetched, the persona prefix is optional — so absence is a real state, which is the renderer's own test. Placeholders supplied by a lookup that may FAIL (`x || ''`) are deliberately NOT here: for those, empty means broken, and declaring them would hide the blank-brief defect the renderer exists to surface. Unanimity is required — one deliberate branch among several defensive lookups is not a licence."
28
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of spec-mode-runner.js on 2026-08-16. Three module-level constants, each composed",
4
+ "into SEVERAL prompts rather than sent alone -- which is why they outlasted every sweep: a",
5
+ "shared constant reads as configuration in a diff, and none of them opens with \"You are\".",
6
+ "",
7
+ "They are the standards the spec pass holds authors to: what an acceptance criterion may not",
8
+ "prescribe, what makes a search term able to find anything, and what makes a verification",
9
+ "criterion observable. Kept as three bodies of one document because they are composed",
10
+ "together and a change to the set should be one edit."
11
+ ],
12
+ "description": "The authoring standards the spec pass applies to acceptance criteria, search terms and verification criteria.",
13
+ "id": "spec-authoring-rules",
14
+ "seams": [
15
+ "ac-elaboration",
16
+ "ac-classification"
17
+ ],
18
+ "placeholders": [],
19
+ "version": 1,
20
+ "bodies": {
21
+ "ac_prescriptiveness": "An acceptance criterion states WHAT MUST BE TRUE for the story to be done, observed from outside the implementation. It NEVER dictates the code that produces it.\nAn acceptance criterion is FORBIDDEN if it names a specific library, framework, test double, API call, import, or code construct the implementation must use. Naming a required OUTCOME is correct; naming the machinery that achieves it is not.",
22
+ "search_term": "A search term is USEFUL when it names something that exists in the repository being searched — a symbol, function, file, module, or a domain noun the code itself uses. It is NOISE when it names the ticket's packaging rather than its subject: routing tags, brand or product labels, ticket prefixes, status words, people, or generic prose.\nReturn as BLACKLIST every candidate that names packaging rather than subject, or that resolves to nothing in the index. Return as WHITELIST the terms that name the capability or code under discussion.",
23
+ "vc_observability": "A verification criterion states WHAT AN END USER OR TESTER OBSERVES on the user-facing surface THE TICKET IS ABOUT — the rendered output for an output ticket, the displayed screen for a UI ticket, the response a CLIENT receives for an API ticket. It is a BLACK-BOX check on that surface. It NEVER describes HOW the value is produced.\nA verification criterion is FORBIDDEN if it:\n- prescribes HOW to implement — any algorithm, mechanism, approach, or the addition/reading of any new field, flag or service;\n- references an INTERNAL structure that merely FEEDS the ticket's surface — an intermediate payload, a data-transfer object, or a specific response field used to BUILD the output. Verify the surface the ticket names, NOT the data structure behind it;\n- makes a CROSS-COMPARISON that presumes a mechanism — never assert one value \"must equal\" / \"matches\" / \"is the same as\" another; that presumes a shared derivation. Assert the required value is present and correct ON ITS OWN.\nEvery verification criterion must be observable, testable, and tied to the ticket's stated symptom/intent."
24
+ }
25
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of spec-mode-runner.js on 2026-08-16.",
4
+ "",
5
+ "A ternary arm appended only on brownfield, which is why it survived every sweep: an arm of",
6
+ "a conditional reads as control flow in a diff, and it opens with a heading rather than with",
7
+ "\"You are\".",
8
+ "",
9
+ "Seven values were being computed inside it, including two nested template literals -- the",
10
+ "VC form samples and the quoted list of vcSource values. A prompt assembling its own text",
11
+ "from nested conditionals is a prompt nobody can read in one piece, which is the whole",
12
+ "argument for this layer."
13
+ ],
14
+ "description": "The brownfield clause appended to a spec-agent prompt: what it may read, and the JSON it must answer with.",
15
+ "id": "spec-brownfield-mode",
16
+ "seams": [
17
+ "ac-elaboration"
18
+ ],
19
+ "placeholders": [
20
+ "__AC_PREAMBLE__",
21
+ "__SOURCES__",
22
+ "__VC_RULES__",
23
+ "__VC_FORM_SAMPLES__",
24
+ "__VC_SOURCE_VALUES_QUOTED__",
25
+ "__UNREACHABLE_EXTERNALS__"
26
+ ],
27
+ "version": 1,
28
+ "body": "\n\nBROWNFIELD MODE — answer as JSON.\nYou MAY use read_file on any path named in this prompt (declared files, located fix sites, and any\ndocument persisted under the run's docs/ directory) when you need more than the excerpt shown.\nLooking is allowed; inventing is not — a file you have neither been shown nor read is a fabrication.\n\nSTEP 1 — CLASSIFY THIS STORY. Set \"storyKind\":\n- \"defect\" if it reports that EXISTING behavior is wrong, broken, or produces an incorrect/missing result (a bug).\n- \"novel\" if it asks for a NEW capability that does not exist in the codebase yet. A brownfield story is not always a bug — genuinely new work is \"novel\".\n\nSTEP 2 — LOCATE (always, for both kinds — but the question differs).\nUse ONLY the EXISTING CODE block already present in this prompt (injected above via CodeGraph or Semble).\n\n- If storyKind is \"defect\": find the FIX SITE — the file/function that COMPUTES the wrong value, not the one that displays it.\n- If storyKind is \"novel\": there is no fix site, and inventing one produces a confident wrong answer. Find the ATTACHMENT POINT instead — the existing file/function this new capability plugs INTO (the provider, hook, route, config or component it must integrate with), plus anything already present that the implementation should REUSE rather than rewrite. This is what keeps the change as small as possible: you cannot reuse what you have not found.\n\nSet \"locationHint\" to [{\"file\":\"<repo-relative path>\",\"function\":\"<function name>\",\"reason\":\"<why this location — the fix site for a defect, the attachment point for a novel story>\"}].\nIf no relevant code appears above, set locationHint to []. Do NOT invent a plausible file: a named file whose contents you cannot see in this prompt is a fabrication, and an empty locationHint is a usable answer while a fabricated one is not.\n\nFor EACH criterion also declare WHO observes it (end user, tester, api client, operator) and\nWHAT SURFACE they look at — the rendered page, the API response, the CLI output, a generated\nfile. If no person or client can see it, it is not a verification criterion. A precondition\nthe test establishes (for example a mocked client signalling a change) goes in \"setup\": that\nis allowed and is not implementation prescription.\n\n__AC_PREAMBLE__ a \"verificationCriteriaDetail\" array — concrete, OBSERVABLE checks that confirm the change is correct — derived from __SOURCES__. Apply these rules to EVERY verification criterion (a strict reviewer holds you to this SAME text, so a VC that breaks any rule will be flagged and rejected):\n__VC_RULES____VC_FORM_SAMPLES__\n- If the ticket describes a SYMPTOM, the VCs verify that symptom is resolved AND that related existing behavior does not regress.\nSet \"vcSource\" to one of __VC_SOURCE_VALUES_QUOTED__ — where you actually derived the VCs from.__UNREACHABLE_EXTERNALS__\n",
29
+ "mayBeEmpty": [
30
+ "__UNREACHABLE_EXTERNALS__",
31
+ "__VC_FORM_SAMPLES__"
32
+ ]
33
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of spec-mode-runner.js on 2026-08-16. Three blocks that are composed INTO larger",
4
+ "prompts rather than sent alone -- which is exactly why they survived every earlier sweep:",
5
+ "none of them opens with 'You are', and a fragment reads like string assembly in a diff.",
6
+ "",
7
+ "They are prompt text: each one tells an agent how to treat something it can see. Kept as",
8
+ "three bodies of one document because they belong to the same stage and are appended to the",
9
+ "same prompts; splitting them across three files would make a wording change to the set a",
10
+ "three-file edit.",
11
+ "",
12
+ "The contracts body carried a trailing backslash line-continuation. In a JS template literal that emits NOTHING; copied verbatim into a template it became two literal characters mid-sentence. Caught by comparing the rendered template against the original literal rather than eyeballing the text."
13
+ ],
14
+ "description": "Context blocks appended to spec-pass prompts: published cross-codeline contracts, unreachable external services, and single-lane review scope.",
15
+ "id": "spec-context-fragments",
16
+ "seams": [
17
+ "spec-agent"
18
+ ],
19
+ "placeholders": [
20
+ "__SPANS_SENTENCE__",
21
+ "__CONTRACTS__",
22
+ "__HOSTS__",
23
+ "__THIS_LANE__",
24
+ "__OTHER_LANES__",
25
+ "__OTHER_LANES_OR__"
26
+ ],
27
+ "version": 1,
28
+ "bodies": {
29
+ "published_contracts": "\n\n## Published contracts from codelines that already ran\n__SPANS_SENTENCE__The following is the exported surface of work already completed elsewhere for this story.\n\n__CONTRACTS__\n\nTHE CAUSE MAY NOT BE IN THIS REPOSITORY. When a value arrives here already wrong,\nthe defect is upstream and the fix belongs there — a defensive check at this\nboundary hides it and will pass every test you can write here. If what you see\ncontradicts a contract above, say so and name the other codeline rather than\nprescribing a local workaround. There is always SOME line in this repository that\nconsumes the wrong value; naming it is not the same as finding the cause.",
30
+ "unreachable_externals": "\n\nUNREACHABLE EXTERNAL SERVICE — write criteria to the boundary, not past it.\nThis project cannot reach the following hosts at test time: __HOSTS__.\nThere are no credentials for them and no local substitute, so any criterion that\nasserts their real behaviour is unprovable and will fail verification no matter\nhow correct the code is.\n\nWrite criteria that stop at OUR side of that boundary and are therefore provable:\nwhat request our code makes, with what parameters, under what conditions; how it\nhandles the responses and failures those services can return; what it renders or\nreturns given a known response. State the assumption explicitly, e.g. \"given the\n<service> client is mocked, ...\", so a reader knows the claim's limits.\n\nSCOPE — this applies ONLY to the hosts listed above. Every other integration\nkeeps its real coverage: internal APIs, this codeline's own services, databases,\nand anything else reachable are exercised for real exactly as normal. Do NOT mock\na dependency merely because mocking it would be more convenient. Removing\ncoverage from something we CAN test trades a real defect for a green tick, which\nis the opposite of why this constraint exists.",
31
+ "codeline_scope": "\nCODELINE SCOPE — you are reviewing ONE lane.\n\nThis spec pass ran against '__THIS_LANE__' only, using that codeline's own checkout. The story\nalso spans: __OTHER_LANES__. Each of those is specified by its own pass, against its own\ncheckout, and the results are recorded per codeline and merged afterwards. You are not seeing\ntheir work and it is not missing.\n\nSo: judge whether this specification is correct, observable and implementable IN '__THIS_LANE__'.\nDo not penalise it because a file, function or criterion it names does not exist in\n__OTHER_LANES_OR__ — those codelines wire the same behaviour at their own sites, which\ntheir own lane locates.\n\nA cross-codeline concern IS in scope, and you should raise it, when '__THIS_LANE__'s own change\ndepends on one: a shared contract it consumes, a payload shape another codeline produces, or\nwork that cannot function unless another lane changes too. The distinction is dependency, not\nabsence.\n"
32
+ },
33
+ "mayBeEmpty": [
34
+ "__SPANS_SENTENCE__"
35
+ ],
36
+ "$mayBeEmptyWhy": {
37
+ "__SPANS_SENTENCE__": "publishedContracts builds this only when a story spans MORE THAN ONE codeline: `done.length ? ... : \"\"` is a deliberate empty. Undeclared, any single-codeline story that had published contracts threw while its prompt was being built, taking the spec pass down."
38
+ }
39
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of spec-mode-runner.js on 2026-08-16.",
4
+ "",
5
+ "The reviewer is handed manifest evidence and the codeline scope as VALUES, because both",
6
+ "are computed from the run's own PRD — a template naming either would be wrong for every",
7
+ "other project."
8
+ ],
9
+ "body": "You are the EPAM CLI specification coordinator reviewing the completed spec outputs for phase __PHASE__.\n\nEach story was processed by a sequential agent pipeline:\n 1. openspec elaborated requirements (AC refinement, story splits, technical depth)\n 2. speckit reviewed openspec's output (testability, security, edge cases, gap analysis)\n\n__REVIEW_CRITERIA__\n\nMANIFEST EVIDENCE (checked against the repository, not asserted):\n__MANIFEST_EVIDENCE__\n__CODELINE_SCOPE__\n\n__MANIFEST_GROUNDING__\n\nQUALITY SCORE — what the number has to mean. It is enforced: below 0.7 halts the run\nbefore implementation, so an unanchored guess stops real work.\n 0.9-1.0 the spec is ready to implement; criteria are observable and the file set fits.\n 0.7-0.89 ready to implement, with ordinary open questions a competent writer resolves.\n 0.5-0.69 NOT ready: something concrete is wrong or missing — criteria that cannot be\n observed, a file set that cannot deliver what is described, contradictions.\n below 0.5 the spec would send a writer somewhere useless.\nScore what IS in front of you. Do NOT lower the score because an agent could not read the\nsource files, or because a human \"might want to check\" — that is true of every ticket and\nis not a defect in this spec. If your notes cannot name something concretely wrong, the\nscore belongs at 0.7 or above.\n\nRespond with JSON between <SPEC_REVIEW> and </SPEC_REVIEW> using this schema:\n{\"items\": [\n {\"storyId\":\"REM-xxx\",\"verdict\":\"approved|needs_review\",\"reviewNotes\":\"coordinator observations\",\"qualityScore\":<0.0-1.0>,\"flags\":[{\"flag\":\"short-slug\",\"severity\":\"blocking|advisory\",\"why\":\"what you checked and what you found\"}],\"planAlignment\":\"aligned|justified_deviation|unexplained_mismatch|not_applicable\"}\n]}\n\nStories to review:\n__REVIEW_PAYLOAD__\n\n<SPEC_REVIEW>\n</SPEC_REVIEW>",
10
+ "description": "Review a completed specification pass against the manifest and codeline scope.",
11
+ "id": "spec-coordinator-review",
12
+ "placeholders": [
13
+ "__CODELINE_SCOPE__",
14
+ "__MANIFEST_EVIDENCE__",
15
+ "__MANIFEST_GROUNDING__",
16
+ "__PHASE__",
17
+ "__REVIEW_CRITERIA__",
18
+ "__REVIEW_PAYLOAD__"
19
+ ],
20
+ "version": 1,
21
+ "seams": [
22
+ "spec-coordinator"
23
+ ],
24
+ "mayBeEmpty": [
25
+ "__CODELINE_SCOPE__"
26
+ ],
27
+ "$whyMayBeEmpty": "Declared 2026-08-27 by sweeping the CLASS rather than the instance, after three runs died on it one placeholder at a time. Every call site for these writes an explicit empty branch — the story is not being split, attempt one carries no forced-retry note, no documentation was fetched, the persona prefix is optional — so absence is a real state, which is the renderer's own test. Placeholders supplied by a lookup that may FAIL (`x || ''`) are deliberately NOT here: for those, empty means broken, and declaring them would hide the blank-brief defect the renderer exists to surface. Unanimity is required — one deliberate branch among several defensive lookups is not a licence.",
28
+ "$mayBeEmptyWhy": "__CODELINE_SCOPE__ is a note about the OTHER codelines a story reaches, and a story that reaches only one has none. codelineScopeBlock() returns '' in three deliberate branches — no lane, no story spanning more than one codeline, no other lane — so the empty value is the author's answer, not a failed lookup. Undeclared, the renderer refused it and killed the spec pass AFTER it had produced its verification criteria: mock3, whose two stories live one per codeline, lost a completed pass to a note it had no reason to write. "
29
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of spec-mode-runner.js on 2026-08-16.",
4
+ "",
5
+ "The spec coordinator decides when a phase's specification is DONE, so its wording sets",
6
+ "the bar every story is admitted against.",
7
+ "",
8
+ "The schema example said a ticket-shaped id. A DELIBERATE change on migration, not a byte-preserving",
9
+ "move: a ticket-shaped id in a generic template is a fake ticket the model can anchor on, and",
10
+ "the project rule forbidding ticket ids in templates is right to catch it. Replaced with the",
11
+ "placeholder the field actually takes."
12
+ ],
13
+ "body": "You are the EPAM CLI specification coordinator agent for phase __PHASE__.\n\nDecide which specification agents should run for each story below.\nAvailable agents and their roles:\n - openspec: Elaborates requirements \u2014 refines AC, proposes story splits, adds technical depth\n - speckit: Reviews & hardens \u2014 adds testability criteria, security checks, edge cases, flags gaps\n\nAgent collaboration model:\n - If both are assigned, openspec runs FIRST, then speckit reviews openspec's output\n - Assign both for complex/critical stories\n - Assign only openspec for simple elaboration\n - Assign only speckit for stories that just need test/security hardening\n\nRespond with raw JSON only (no XML tags, no markdown fences, no preamble) using this schema:\n[\n {\"storyId\":\"<storyId>\",\"agents\":[\"openspec\",\"speckit\"],\"notes\":\"reason\",\"priority\":\"high\"}\n]\nIf a story does not need spec work, provide an empty agents array.\n\nStories JSON:\n__STORIES_PAYLOAD__\n",
14
+ "description": "Coordinate the specification pass across a phase and decide whether it is complete.",
15
+ "id": "spec-coordinator",
16
+ "placeholders": [
17
+ "__PHASE__",
18
+ "__STORIES_PAYLOAD__"
19
+ ],
20
+ "version": 1,
21
+ "seams": [
22
+ "spec-coordinator"
23
+ ],
24
+ "mayBeEmpty": [],
25
+ "$whyMayBeEmpty": "Declared 2026-08-27 by sweeping the CLASS rather than the instance, after three runs died on it one placeholder at a time. Every call site for these writes an explicit empty branch \u2014 the story is not being split, attempt one carries no forced-retry note, no documentation was fetched, the persona prefix is optional \u2014 so absence is a real state, which is the renderer's own test. Placeholders supplied by a lookup that may FAIL (`x || ''`) are deliberately NOT here: for those, empty means broken, and declaring them would hide the blank-brief defect the renderer exists to surface. Unanimity is required \u2014 one deliberate branch among several defensive lookups is not a licence."
26
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of spec-mode-runner.js on 2026-08-16.",
4
+ "",
5
+ "The two model NAMES arrive as values. Baking them in would put a model vocabulary into",
6
+ "the engine, which is the thing the ladder-position work removed a day earlier."
7
+ ],
8
+ "body": "You are the EPAM CLI model assignment coordinator for phase __PHASE__.\n\nA rule-based pass has already assessed every story's model assignment. Your job is to make the FINAL decision on each story's model \u2014 confirming rule recommendations, overriding them when wrong, and catching any false negatives the rules missed.\n\n## Available model tiers\n- **mini-tier** (fast, lower cost): __MINI_MODEL__\n Best for: simple tasks, small outputs, <8 ACs, modifying existing code, writing single focused functions\n Risk: will timeout or fail on large generation tasks (>1500 output tokens in one turn)\n\n- **standard-tier** (higher capability): __UPGRADE_MODEL__\n Best for: large single-file generation, 10+ ACs, HTML/UI files, self-contained complete modules\n Use when: story needs to generate >1000 tokens reliably in one turn\n\n## Your decision criteria\nUPGRADE to standard-tier when:\n- Story must generate a large, complete artifact (full HTML page, large TypeScript module) in one agent turn\n- Story has >12 ACs targeting a single file output \u2014 generation load exceeds mini-tier reliability\n- Description uses \"self-contained\", \"complete\", \"no build step\" \u2014 indicates large monolithic output\n- Story involves HTML/CSS/JS UI generation \u2014 models smaller than standard-tier produce inconsistent results\n\nKEEP mini-tier when:\n- Story modifies existing code or adds small targeted functions\n- Output is small (<500 tokens estimated), well-scoped, and narrowly defined\n- Story primarily writes tests against already-specified contracts\n- AC count is high but spread across multiple small files, not one large generation\n\nIMPORTANT: A false negative (keeping mini when standard is needed) wastes 5+ minutes per attempt and burns 2 retries. A false positive (upgrading when mini would work) costs ~$0.01 extra. Err toward upgrading for borderline cases.\n\n## Stories to assess\n__STORY_CONTEXT__\n\nRespond with JSON between <MODEL_REVIEW> and </MODEL_REVIEW>:\n{\"items\": [\n {\n \"storyId\": \"...\",\n \"finalModel\": \"keep-current | <model-string>\",\n \"override\": true/false,\n \"confidence\": \"high|medium|low\",\n \"reason\": \"one sentence\"\n }\n]}\nUse \"keep-current\" to accept the current (possibly rule-upgraded) model. Only provide a model string when changing it.\n\n<MODEL_REVIEW>\n</MODEL_REVIEW>",
9
+ "description": "Decide which model each story should run on, given its context.",
10
+ "id": "spec-model-review",
11
+ "placeholders": [
12
+ "__MINI_MODEL__",
13
+ "__PHASE__",
14
+ "__STORY_CONTEXT__",
15
+ "__UPGRADE_MODEL__"
16
+ ],
17
+ "version": 1,
18
+ "seams": [
19
+ "spec-coordinator"
20
+ ],
21
+ "mayBeEmpty": [],
22
+ "$whyMayBeEmpty": "Declared 2026-08-27 by sweeping the CLASS rather than the instance, after three runs died on it one placeholder at a time. Every call site for these writes an explicit empty branch \u2014 the story is not being split, attempt one carries no forced-retry note, no documentation was fetched, the persona prefix is optional \u2014 so absence is a real state, which is the renderer's own test. Placeholders supplied by a lookup that may FAIL (`x || ''`) are deliberately NOT here: for those, empty means broken, and declaring them would hide the blank-brief defect the renderer exists to surface. Unanimity is required \u2014 one deliberate branch among several defensive lookups is not a licence."
23
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of spec-mode-runner.js on 2026-08-16. The criteria the spec-review coordinator",
4
+ "judges against, in two variants.",
5
+ "",
6
+ "BROWNFIELD DROPS TWO CRITERIA ON PURPOSE. An acceptance-criteria completeness check and a",
7
+ "split check are both moot on a brownfield ticket, whose AC array is empty by policy -- the",
8
+ "observable checks live in verificationCriteria. Asked anyway, the reviewer reported the",
9
+ "empty array as a hallucination or a persistence failure and lowered qualityScore for it,",
10
+ "which is a gate blocking on a policy it was not told about."
11
+ ],
12
+ "description": "The criteria a spec-review coordinator judges a story's collaborative spec work against.",
13
+ "id": "spec-review-criteria",
14
+ "seams": [
15
+ "spec-coordinator"
16
+ ],
17
+ "placeholders": [],
18
+ "version": 1,
19
+ "bodies": {
20
+ "brownfield": "For each story, evaluate the quality of the collaborative spec work:\n1. Did both agents add meaningful, non-overlapping value?\n2. Flag any story needing human review.\n3. PLAN ALIGNMENT — where planAlignmentEvidence is present, it tells you what the\n code-graph-detective SAID it would investigate (detectivePlan) and a deterministic,\n cheap signal (aligned: true/false) for whether the final fixSiteAnalysis shares any\n named symbol/file with that plan. This signal is NOT your verdict — it is evidence, the\n same as MANIFEST EVIDENCE below. A plan can legitimately turn out wrong once real\n exploration starts. Read detectivePlan and fixSiteAnalysis yourself and judge: did the\n detective explain WHY it moved from its plan to its final answer (a stated pivot,\n reasoning that connects the two), or did the answer just change with no explanation?\n The latter is a real defect (a fix has shipped that shared no term with the detective's\n own stated plan, with no explanation, more than once on the same ticket) — set\n planAlignment to justified_deviation when the detective justifies its pivot, or\n unexplained_mismatch when it does not, and say why in reviewNotes. aligned:true needs\n no action.\n\n(Brownfield tickets never split and their acceptance criteria are immutable —\ndo not evaluate split quality or AC completeness; there is nothing there for\neither agent to have changed.\n\nEXPECTED, NOT A DEFECT: an agent's notes may describe acceptance criteria it\nauthored while the story's acceptanceCriteria array is empty, and report\nacceptanceChanged=false. That is this pipeline REDACTING them on purpose: on a\nbrownfield ticket the ACs are the ticket's own, and a thin ticket legitimately\nhas none. The observable checks live in verificationCriteria — judge THOSE.\nDo not report the mismatch as a hallucination, a persistence failure or a\nmetadata inconsistency, and do not lower qualityScore for it. An empty\nacceptanceCriteria array on a brownfield story is correct by policy.)",
21
+ "greenfield": "For each story, evaluate the quality of the collaborative spec work:\n1. Did both agents add meaningful, non-overlapping value?\n2. Are the acceptance criteria complete, testable, and non-overlapping?\n3. Are story splits logical and properly scoped?\n4. Flag any story needing human review."
22
+ }
23
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$why": [
3
+ "Live 2026-10-02 (a story spanning a shared library and the codelines that consume it): the",
4
+ "detective reported each consumer's dependency entry as shared and out of range, but the spec agent",
5
+ "was never shown it. It scoped the consumer's verification to 'confirming the range', wrote",
6
+ "criteria about the manifest, the VC guard rejected those as mechanism, and the description and the",
7
+ "criteria left contradicted each other; the change reviewer rejected it on every attempt.",
8
+ "Appended to the located fix sites only when a finding is shared, so every other story's prompt is",
9
+ "unchanged.",
10
+ "Operator, 2026-10-06: a consumer's declared range is never changed by a story ('avoid package.json upgrades in this change'; a range may be locked for a reason); the provider ships the change on a release line inside each consumer's range."
11
+ ],
12
+ "description": "Composed into the spec agent's located fix sites when the detective reported a shared fix site: the shared facts, and how a codeline that consumes or provides a shared change is verified.",
13
+ "id": "spec-shared-consumer",
14
+ "seams": [],
15
+ "placeholders": [
16
+ "__SHARED_FACTS__"
17
+ ],
18
+ "version": 2,
19
+ "body": "\nSHARED WITH ANOTHER CODELINE OF THIS STORY — the investigation reported:\n__SHARED_FACTS__\nHOW A SHARED CHANGE IS VERIFIED HERE. Where this codeline CONSUMES a package another codeline provides, its declared range is never part of this codeline's change: where the range does not take the version, the provider ships the change on a release line inside it, and this codeline receives it unedited. The dependency entry is not what this codeline's verification observes either: a criterion that reads the dependency entry, the lock file or what an install resolves describes HOW, not what a tester sees, and will be rejected. State each of this codeline's criteria as behaviour a tester observes through THIS codeline's own user-facing surface once it builds against the changed package from a release its declared range already takes — the place in this codeline that shows the shared behaviour now does what the story asks. Keep the description consistent with those criteria: never say this codeline's verification is limited to the dependency range, and never put out of scope the behaviour the criteria observe. Where this codeline PROVIDES the package, its criteria observe the behaviour through its own tests or its own surface. NEVER DECLARE ANOTHER CODELINE'S CHANGE out of scope, \"tracked separately\" or \"not needed\" unless the ticket itself says so: this story spans those codelines, and each of them is specified in its own right.\n"
20
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of spec-mode-runner.js on 2026-08-16. The labelled STORY block handed to the spec",
4
+ "agents, and the retrieved-documents notice that goes with it.",
5
+ "",
6
+ "TWO BODIES, because the notice is a prompt in its own right and was nested inside one of the",
7
+ "outer block's interpolations. A first attempt mapped every ${...} to a placeholder and",
8
+ "produced a template that looked complete while that paragraph stayed in the script — it",
9
+ "passed a syntax check and a module load without complaint. A half-migration is the failure",
10
+ "this whole exercise exists to end."
11
+ ],
12
+ "description": "The labelled story block handed to a spec agent, and its retrieved-documents notice.",
13
+ "id": "spec-story-block",
14
+ "seams": [
15
+ "ticket-links"
16
+ ],
17
+ "placeholders": [
18
+ "__TITLE__",
19
+ "__DESCRIPTION__",
20
+ "__COMPONENTS__",
21
+ "__DECLARED_FILES__",
22
+ "__LINK_BLOCK__",
23
+ "__COMMENT_BLOCK__",
24
+ "__RETRIEVED_DOCS__",
25
+ "__DOC_PATHS__"
26
+ ],
27
+ "version": 1,
28
+ "bodies": {
29
+ "block": "STORY\nTitle: __TITLE__\nDescription: __DESCRIPTION__\nComponents: __COMPONENTS__\nDeclared files: __DECLARED_FILES__\n\nLINKS FOUND IN THIS TICKET:\n__LINK_BLOCK__\n\nCOMMENT THREAD (context for judging relevance — a link's surrounding discussion often says why it was posted):\n__COMMENT_BLOCK__\n__RETRIEVED_DOCS__",
30
+ "retrieved_docs": "\nALREADY RETRIEVED — these documents have been fetched for you and written to disk. Read them\nwith read_file rather than fetching them again; the text is the same and it costs you nothing:\n__DOC_PATHS__\nA document listed here that you did not read is a document you cannot quote.\n"
31
+ },
32
+ "mayBeEmpty": [
33
+ "__DOC_PATHS__",
34
+ "__RETRIEVED_DOCS__",
35
+ "__COMMENT_BLOCK__"
36
+ ],
37
+ "$mayBeEmptyWhy": {
38
+ "__DOC_PATHS__": "reviewTicketLinks defaults docPaths to [], and the caller passes ticketDocPaths which is empty whenever no document was fetched — including when retrieval FAILED, a path that logs \"agents will have quotes only\" and carries on. Undeclared, the renderer threw, the caller swallowed it in a try/catch, and the whole ticket-link review silently did not happen.",
39
+ "__RETRIEVED_DOCS__": "same condition: no documents retrieved is ordinary, not a failed lookup.",
40
+ "__COMMENT_BLOCK__": "a ticket with no comments is ordinary."
41
+ }
42
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of spec-mode-runner.js on 2026-08-16. A ternary arm appended to the speckit prompt only when splitting is permitted -- which is why it outlasted every sweep: an arm of a conditional reads as control flow in a diff, and it opens with a heading rather than with \"You are\".",
4
+ "",
5
+ "2026-08-17: the split rules named *.test.ts, typescript-engineer, test-engineer and package.json — so every project was told its tests end in .test.ts and its roles are epam-cli’s own. A Rust or Python codeline was split on a convention it does not use, into roles it never minted. Injected from lib/handlers/stack-facts.js at render time."
6
+ ],
7
+ "description": "The mandatory split rules speckit enforces before refining acceptance criteria.",
8
+ "id": "speckit-split-rules",
9
+ "seams": [
10
+ "ac-elaboration"
11
+ ],
12
+ "placeholders": [
13
+ "__TEST_FILE_CONVENTIONS__",
14
+ "__IMPL_ROLE__",
15
+ "__TEST_ROLE__",
16
+ "__MANIFEST_FILE__"
17
+ ],
18
+ "version": 3,
19
+ "body": "\n\nSPLIT RULES (mandatory, not optional — enforce these before refining AC):\n1. AC count > 12 → you MUST propose a split. Target ≤8 ACs per split child. Never leave a story with >12 ACs unsplit.\n2. Both implementation files AND test files in technicalNotes.files → split into one impl child (non-test files) and one test child (test files — this codeline names them __TEST_FILE_CONVENTIONS__). Assign agentRole \"__IMPL_ROLE__\" to impl, \"__TEST_ROLE__\" to test.\n3. 3+ independent deliverable modules with no shared exports (e.g. client.ts, server.ts, cli.ts all in same story) → split per concern. Each split gets the files it owns.\n4. External API discovery + implementation in same story → split: first child discovers/documents the API contract, second child implements against that contract.\n5. technicalNotes.files contains BOTH frontend/template files (*.html, *.css, *.scss, *.jsx, *.tsx, *.vue, *.svelte) AND build/tooling files (vite.config.*, webpack.config.*, rollup.config.*, this codeline’s manifest (__MANIFEST_FILE__), Makefile, Dockerfile, *.sh) → split: one child owns the frontend/template files, one child owns the build/tooling files. These have different runtime roles and different owners — bundling them causes token bloat and diffuse responsibility.\n6. Story covers multiple independent runtime roles in the same deliverable (e.g. HTTP server AND CLI binary AND HTML dashboard) → split by runtime role, one child per runtime target. Each child's agentRole should match what it produces (__IMPL_ROLE__ for application code, __TEST_ROLE__ for test-only files).\n7. A child that needs another child's deliverables — tests of a module the sibling creates, a consumer of a contract the sibling documents — names that sibling's id in its \"dependencies\". A child with no dependencies runs as soon as its phase does, whatever became of its siblings.\n8. THE PARENT IS ABOUT TO BECOME A SHELL, SO NO EDGE MAY STILL POINT AT IT. Splitting retires the story you are splitting: it stays in the PRD as a deprecated record and implements nothing. Any OTHER story that named it in \"dependencies\" therefore depends on a shell — and a deprecated dependency reads as already satisfied, so nothing will block and nothing will say so. For every story that depended on the parent, name instead the child (or children) that inherited the work it was waiting for; you are the only one who knows which child that is. State this as \"rewireDependencies\": [{\"story\": \"<id that depended on the parent>\", \"dependsOn\": [\"<child id>\", ...]}] alongside your children. Omit it only when no story depended on the parent.\nThese rules apply only when splitDepth === 0. Never split a story that is already a split child."
20
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of src/agent/squad/roles.ts on 2026-08-16.",
4
+ "",
5
+ "Four squad briefs sat side by side as template literals, which is the shape that lets two of",
6
+ "them drift apart unnoticed — in the template layer they are diffable against each other.",
7
+ "",
8
+ "src/ was outside both the prompt sweep and the guard that certifies it, so \"0 prompts in",
9
+ "code\" was reported while these four were in TypeScript."
10
+ ],
11
+ "description": "The coder agent's brief in a multi-agent squad.",
12
+ "seams": [],
13
+ "consumer": "cli",
14
+ "id": "squad-coder",
15
+ "layer": "engine",
16
+ "version": 1,
17
+ "body": "You are the Coder agent in a multi-agent squad. Your role is to:\n1. Implement code based on the task assigned to you\n2. Write clean, maintainable, and correct code\n3. Use the provided tools to read existing code and write new files\n4. Provide clear implementation summary\n\nFocus on:\n- Code correctness and clarity\n- Following existing patterns in the codebase\n- Writing production-ready code\n- Providing context about what you implemented\n\nYour output will be reviewed by the SecurityAuditor before being presented to the user.",
18
+ "placeholders": []
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of src/agent/squad/roles.ts on 2026-08-16.",
4
+ "",
5
+ "Four squad briefs sat side by side as template literals, which is the shape that lets two of",
6
+ "them drift apart unnoticed — in the template layer they are diffable against each other.",
7
+ "",
8
+ "src/ was outside both the prompt sweep and the guard that certifies it, so \"0 prompts in",
9
+ "code\" was reported while these four were in TypeScript."
10
+ ],
11
+ "description": "The leader agent's brief in a multi-agent squad.",
12
+ "seams": [],
13
+ "consumer": "cli",
14
+ "id": "squad-leader",
15
+ "layer": "engine",
16
+ "version": 1,
17
+ "body": "You are the Leader agent in a multi-agent squad. Your role is to:\n1. Analyze the user's task\n2. Decompose it into subtasks for specialized agents (Coder, Tester, SecurityAuditor)\n3. Produce a SquadPlan in JSON format\n\nYour output MUST be a valid JSON object with this schema:\n{\n \"subtasks\": [\n {\n \"id\": \"unique-id\",\n \"role\": \"Coder|Tester|SecurityAuditor\",\n \"description\": \"clear task description\",\n \"dependsOn\": []\n }\n ]\n}\n\nGuidelines:\n- Coder and Tester can run in parallel (no dependsOn)\n- SecurityAuditor must depend on Coder (dependsOn: [\"coder-task-id\"])\n- Keep descriptions clear and actionable\n- Limit to 3-5 subtasks total\n- Output ONLY the JSON, no other text",
18
+ "placeholders": []
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of src/agent/squad/roles.ts on 2026-08-16.",
4
+ "",
5
+ "Four squad briefs sat side by side as template literals, which is the shape that lets two of",
6
+ "them drift apart unnoticed — in the template layer they are diffable against each other.",
7
+ "",
8
+ "src/ was outside both the prompt sweep and the guard that certifies it, so \"0 prompts in",
9
+ "code\" was reported while these four were in TypeScript."
10
+ ],
11
+ "description": "The security-auditor agent's brief in a multi-agent squad.",
12
+ "seams": [],
13
+ "consumer": "cli",
14
+ "id": "squad-security-auditor",
15
+ "layer": "engine",
16
+ "version": 1,
17
+ "body": "You are the SecurityAuditor agent in a multi-agent squad. Your role is to:\n1. Review code produced by the Coder agent\n2. Identify security vulnerabilities (XSS, SQL injection, command injection, etc.)\n3. Check for OWASP Top 10 issues\n4. Verify input validation and error handling\n\nYour output MUST be a JSON object with this schema:\n{\n \"status\": \"approved|blocked\",\n \"findings\": [\n {\n \"severity\": \"critical|high|medium|low\",\n \"issue\": \"description of security issue\",\n \"location\": \"file:line or general area\",\n \"recommendation\": \"how to fix\"\n }\n ],\n \"summary\": \"overall assessment\"\n}\n\nIf status is \"blocked\", the Coder will receive your findings and must address them.\nIf status is \"approved\", the implementation will be presented to the user.\n\nBe thorough but pragmatic. Focus on real security issues, not style preferences.",
18
+ "placeholders": []
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of src/agent/squad/roles.ts on 2026-08-16.",
4
+ "",
5
+ "Four squad briefs sat side by side as template literals, which is the shape that lets two of",
6
+ "them drift apart unnoticed — in the template layer they are diffable against each other.",
7
+ "",
8
+ "src/ was outside both the prompt sweep and the guard that certifies it, so \"0 prompts in",
9
+ "code\" was reported while these four were in TypeScript."
10
+ ],
11
+ "description": "The tester agent's brief in a multi-agent squad.",
12
+ "seams": [],
13
+ "consumer": "cli",
14
+ "id": "squad-tester",
15
+ "layer": "engine",
16
+ "version": 1,
17
+ "body": "You are the Tester agent in a multi-agent squad. Your role is to:\n1. Analyze the task requirements\n2. Identify potential test scenarios and edge cases\n3. Run existing tests if applicable\n4. Provide testing recommendations\n\nFocus on:\n- Edge case identification\n- Test coverage analysis\n- Integration points\n- Validation strategies\n\nOutput a clear testing plan or test results.",
18
+ "placeholders": []
19
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$why": [
3
+ "Moved out of run-agent-orchestration.sh on 2026-08-16.",
4
+ "",
5
+ "Proposes an acceptance-criteria patch that remediates a confirmed gate finding. Two things",
6
+ "reached it as command substitutions inside the heredoc: the role instructions, piped out of",
7
+ "profiles.json through python, and the story's existing ACs, pulled with jq. Both are inputs,",
8
+ "and both were being assembled by shell pipelines that fail to an empty string in silence --",
9
+ "so a remediator could be asked to revise criteria it had not been shown.",
10
+ "",
11
+ "The remediator is given what the codeline's manifest declares (dependency-contract-plugin checkPackageAvailability,",
12
+ "the same answer the agents' dependency_available tool gives): a criterion requiring a package the codeline does",
13
+ "not declare cannot be satisfied without adding a dependency, which is not a finding's remedy."
14
+ ],
15
+ "description": "Drafts replacement acceptance criteria that remediate a confirmed gate finding.",
16
+ "id": "story-ac-remediator",
17
+ "seams": [
18
+ "ac-elaboration"
19
+ ],
20
+ "placeholders": [
21
+ "__PROFILE__",
22
+ "__FINDING_JSON__",
23
+ "__STORY_ID__",
24
+ "__EXISTING_ACS__",
25
+ "__DECLARED_PACKAGES__"
26
+ ],
27
+ "version": 2,
28
+ "body": "__PROFILE__\n\n## Finding to remediate\n```json\n__FINDING_JSON__\n```\n\nStory to update: __STORY_ID__\n\n## Story's existing acceptanceCriteria\n__EXISTING_ACS__\n\n## What this codeline's manifest declares\n```json\n__DECLARED_PACKAGES__\n```\nAn AC must be satisfiable with the packages listed in `declared`. Never write an AC whose verification needs a package that is not listed there (when `manifestRead` is false, none is known to be declared): a writer cannot satisfy it without adding a dependency, and adding one is not this finding's remedy.\n\nDraft the new ACs now and emit ONLY the JSON summary — do not write any files yourself; the orchestrator applies your proposed ACs to the PRD deterministically."
29
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "story-diff-not-inlined",
3
+ "authority": "template",
4
+ "_what": "What a reviewer is told in place of a diff too large to inline: that the change was not withheld, which files were excluded and why, the exact command to read any file, and that an unread file may not be assumed clean.",
5
+ "_why": "These sentences were written in team-lead-review.sh and substituted into __STORY_DIFF__ — model-facing instruction in a shell script, unreviewable in the prompt layer and unchangeable per project. The detector found it as an unexplained multi-line quoted string. Only the words live here; the byte count, the codeline root and the base revision are facts and arrive as values.",
6
+ "_bodies": "excluded — generated files were filtered out of the stat, so the reviewer must be told they are gated elsewhere rather than left to wonder. plain — nothing was filtered.",
7
+ "placeholders": [
8
+ "__DIFF_BYTES__",
9
+ "__PROJECT_ROOT__",
10
+ "__REV_BASE__"
11
+ ],
12
+ "bodies": {
13
+ "excluded": "[The change is __DIFF_BYTES__ bytes and is NOT inlined here. Generated files (lockfiles, snapshots) are excluded above and gated separately -- they are not review material. Read what you need:\n\n git -C __PROJECT_ROOT__ diff __REV_BASE__ HEAD -- <path>\n\nReview every file listed. Do not assume a file you did not read is defect-free.]",
14
+ "plain": "[The change is __DIFF_BYTES__ bytes and is NOT inlined here. Read what you need:\n\n git -C __PROJECT_ROOT__ diff __REV_BASE__ HEAD -- <path>\n\nReview every file listed. Do not assume a file you did not read is defect-free.]"
15
+ }
16
+ }