@gluecharm-lab/easyspecs-cli 0.3.4 → 0.3.6
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.
- package/commands.md +5 -5
- package/dist/main.cjs +1797 -548
- package/dist/main.cjs.map +4 -4
- package/package.json +1 -1
- package/resources/opencode-agents/agent-list-infrastructure-components.md +187 -0
- package/resources/opencode-agents/agent-list-infrastructure.md +222 -0
- package/resources/opencode-agents/agent-list-qa-test-cases.md +187 -0
- package/resources/opencode-agents/agent-list-qa.md +222 -0
- package/resources/opencode-agents/agent-md-infrastructure-component-detail.md +165 -0
- package/resources/opencode-agents/agent-md-infrastructure-detail.md +95 -0
- package/resources/opencode-agents/agent-md-qa-detail.md +95 -0
- package/resources/opencode-agents/agent-md-qa-test-case-detail.md +165 -0
- package/resources/opencode-agents/agent-review-infrastructure-components-list.md +34 -0
- package/resources/opencode-agents/agent-review-infrastructure-list.md +60 -0
- package/resources/opencode-agents/agent-review-qa-list.md +60 -0
- package/resources/opencode-agents/agent-review-qa-test-cases-list.md +34 -0
- package/resources/schemas/context-lists/features-list.schema.json +2 -2
- package/resources/schemas/context-lists/infrastructure-components-list.schema.json +175 -0
- package/resources/schemas/context-lists/infrastructure-list.schema.json +179 -0
- package/resources/schemas/context-lists/qa-list.schema.json +187 -0
- package/resources/schemas/context-lists/qa-test-cases-list.schema.json +180 -0
- package/resources/schemas/context-lists/zero-reference-classifier-record.schema.json +2 -0
- package/resources/schemas/context-lists/zero-reference-routing.schema.json +2 -0
- package/resources/schemas/context-lists/zero-reference-triage-record.schema.json +4 -4
- package/resources/schemas/index-application-context.schema.json +9 -3
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Agent: Use case detail (markdown)
|
|
2
|
+
|
|
3
|
+
| Field | Value |
|
|
4
|
+
| ----- | ----- |
|
|
5
|
+
| **AGENT_ID** | `ctx-md-qa-test-case-detail` |
|
|
6
|
+
| **Display name** | Use case detail |
|
|
7
|
+
| **SRS-8** | §4.4 `QA-<nn>_TC-<uu>.md`; §6.2 Feature spine; **R7**, **R21** |
|
|
8
|
+
| **Output** | `<worktree>/.gluecharm/context/QA-<nn>_TC-<uu>.md` |
|
|
9
|
+
| **Input (coordination)** | `<worktree>/.gluecharm/context/QA-<nn>-test cases-list.json` (repo-relative: `.gluecharm/context/QA-<nn>-test cases-list.json`) |
|
|
10
|
+
| **Pattern** | §3.5.1 — Markdown detail |
|
|
11
|
+
|
|
12
|
+
## Responsibility
|
|
13
|
+
|
|
14
|
+
**`.opencode/` exclusion:** The worktree may contain **`.opencode/`** (materialized OpenCode agents, schemas, and tooling). It is **not** part of the analyzed product codebase. **Do not** use it to infer application behavior. **Never** cite paths under **`.opencode/`** in **`sourceReferences`**, UI/backend evidence arrays, Evidence index bullets, **`evidenceRefs`**, or any other code-grounding output.
|
|
15
|
+
|
|
16
|
+
Narrative for **one test case** under a feature: **concrete** actors, **actual** inputs (fields, types, mandatory vs optional), **where and how** validation runs, **what** is persisted or mutated, **what** is returned or surfaced, and **ordered implementation steps** from entrypoint through to outcome—not a generic “the user registers” paragraph.
|
|
17
|
+
|
|
18
|
+
**Spine context:** Non-trivial test cases **typically** have **multiple** scenarios in **`QA-<nn>_TC-<uu>-scenarios-list.json`** (happy path, errors, permissions, data variants). **`## Related scenarios`** should list **several** `SC-*` rows when they exist; if the list has only one scenario, double-check that branches were not folded into this document instead of separate SC rows.
|
|
19
|
+
|
|
20
|
+
The matching row in **`.gluecharm/context/QA-<nn>-test cases-list.json`** **must** include **`sourceReferences`** (`minItems: 1`); seed the **Evidence index** from those anchors (each **`path`** is a file, not a directory), then **extend** with every module you cite in **Code flow**.
|
|
21
|
+
|
|
22
|
+
**Coordination JSON** for this agent lives **only** under **`.gluecharm/context/`**, not at the worktree root. Read that path first; if it is missing, **glob** `.gluecharm/context/**/QA-<nn>-test cases-list.json` before failing.
|
|
23
|
+
|
|
24
|
+
## Task (for `{{TASK_DESCRIPTION}}`)
|
|
25
|
+
|
|
26
|
+
Document **test case {{UC_CODE}}** under **feature {{FE_CODE}}** per the corresponding test cases list entry. Do not change stable codes.
|
|
27
|
+
|
|
28
|
+
### Depth (mandatory)
|
|
29
|
+
|
|
30
|
+
1. **Trace the real implementation** — From the test case’s intent, locate the **actual** route, command, handler, service method, or job that starts this flow; follow **calls, validations, repositories, DTOs/mappers, and responses** in the worktree until the success and failure paths are clear.
|
|
31
|
+
2. **Name specifics** — Use **real** identifiers: HTTP paths/methods, function or method names, class/module filenames, validation schemas, DB tables or ORM entities, error codes or messages the code returns. Avoid vague wording (“the system validates”) without saying **which** validator and **where**.
|
|
32
|
+
3. **Data and conditions** — Spell out **which fields** are required, **what** rules apply (length, format, auth, rate limits, feature flags), **what** happens when a rule fails (HTTP status, exception type, user-visible message if encoded), and **what** data shape is stored or emitted on success.
|
|
33
|
+
4. **Code flow** — Write **`## Code flow`** as an **implementation-order** pipeline: e.g. entrypoint → auth/authorization check → input binding/parsing → per-field or schema validation → business rules → persistence transaction → side effects (events, emails) → response mapping. **Each step** must reference **concrete** code locations (you will mirror those in **Evidence index**).
|
|
34
|
+
5. **Mermaid** — Under **`## Code flow`**, add **at least one** fenced **`mermaid`** block when the implementation has **two or more** meaningful stages (validation, persistence, external call, etc.). Follow **[MERMAID.md](./MERMAID.md)**: **Mermaid 11.13**, **neutral** theme (`%%{init: {'theme':'neutral'}}%%` as first line inside the fence). Use **`flowchart`** or **`sequenceDiagram`** with nodes/actors labeled to match **real** modules or functions (not “Frontend” / “Backend” placeholders unless the repo truly has no finer structure). Skip Mermaid only if the flow is a single trivial call **and** you state why in one line.
|
|
35
|
+
|
|
36
|
+
### Evidence vs Code flow (mandatory)
|
|
37
|
+
|
|
38
|
+
- **Entry point alone is insufficient.** The **Evidence index** must cite **implementation** for: the **primary entrypoint**, **validation** (schema, guards, domain checks), **core business logic** touched by this test case, **persistence** (save/update/query), and **response / error mapping**—each with `path:line` or `path:start-end` (or tight ranges), aligned with the steps in **`## Code flow`**.
|
|
39
|
+
- Prefer **one Evidence bullet per major Code flow stage** (or a small table in **Code flow** with a matching Evidence bullet list)—readers must see **which files** justify **which** part of the narrative.
|
|
40
|
+
- Do **not** cite only the outer controller/route if all substantive logic lives in services, validators, or repositories; those **must** appear too.
|
|
41
|
+
|
|
42
|
+
## Non-empty chapters and Evidence index (mandatory)
|
|
43
|
+
|
|
44
|
+
- **`## Evidence index`** is the **references / code-grounding** chapter. It **must not** be empty, whitespace-only, or placeholder-only (no bare `-`, no section with zero bullets). A generated `.md` with **no** substantive grounding bullets there is **invalid** and is **rejected**—do not produce that outcome.
|
|
45
|
+
- **Preferred:** concrete `path:line` or `path:start-end` cites from the worktree (implementation, config, tests, schemas—not README-style narrative files).
|
|
46
|
+
- **`## Code flow`** must not be a generic checklist; it must reflect **this** test case’s **actual** call chain and data path. If a section is thin after search, say what is missing and cite the closest evidence.
|
|
47
|
+
- **If grounding is impossible** after reasonable search: set **`Status: hallucination?`** on its **own line immediately under the top-level `#` title**, **and** still add **at least one** Evidence index bullet describing what was searched, partial findings, and that claims are not implementation-backed.
|
|
48
|
+
- **Other `##` sections:** do not leave them empty; if unknown, add a short note under that heading explaining why.
|
|
49
|
+
- **Banned:** never list any path whose **basename** is `readme.md` in **any** casing (`README.md`, `readme.md`, etc.) in the Evidence index. **Never** list paths under **`.opencode/`** either (tooling copy, not product source).
|
|
50
|
+
|
|
51
|
+
### Revision log (mandatory)
|
|
52
|
+
|
|
53
|
+
- **`## Revision`** sits **immediately before** **`## Evidence index`**. **Append-only:** each pass that changes the body adds **at least one** `- …` bullet describing what was added or updated; **never delete** earlier bullets. **First write:** include an initial bullet (e.g. **Initial draft**).
|
|
54
|
+
|
|
55
|
+
## Output template
|
|
56
|
+
|
|
57
|
+
Basename e.g. **`QA-<nn>_TC-<uu>.md`** (optional slug per PLAN). **R21:** cite behaviour and rules; **Code flow** and **Evidence index** must stay consistent.
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
# Use case {{UC_CODE}} — <name> (Feature {{FE_CODE}})
|
|
61
|
+
|
|
62
|
+
## Summary
|
|
63
|
+
|
|
64
|
+
<!-- One tight paragraph: goal, primary actor, success outcome — no generic filler. -->
|
|
65
|
+
|
|
66
|
+
## Actors and stakeholders
|
|
67
|
+
|
|
68
|
+
## Preconditions
|
|
69
|
+
|
|
70
|
+
<!-- What must be true before this test case can start (auth, state, feature flags) — cite checks in code if present. -->
|
|
71
|
+
|
|
72
|
+
## Data inputs and validation
|
|
73
|
+
|
|
74
|
+
<!--
|
|
75
|
+
Concrete inputs for THIS test case:
|
|
76
|
+
- Field or parameter names, mandatory vs optional, types.
|
|
77
|
+
- Validation rules (schema, decorators, manual checks) and where they run.
|
|
78
|
+
- Failure behaviour (status codes, errors) with code cites in Evidence.
|
|
79
|
+
-->
|
|
80
|
+
|
|
81
|
+
## Main flow (user- or operator-visible)
|
|
82
|
+
|
|
83
|
+
<!--
|
|
84
|
+
Short numbered steps from the actor’s perspective (can mirror Code flow at a higher level).
|
|
85
|
+
Each step should be traceable to ## Code flow.
|
|
86
|
+
-->
|
|
87
|
+
|
|
88
|
+
## Code flow
|
|
89
|
+
|
|
90
|
+
<!--
|
|
91
|
+
IMPLEMENTATION ORDER — not marketing prose. Numbered steps:
|
|
92
|
+
- What runs (function/handler/method), in which file.
|
|
93
|
+
- What data moves (DTO, entity, query).
|
|
94
|
+
- Branching: validation failure → which path; success → next step.
|
|
95
|
+
|
|
96
|
+
When 2+ stages: add a ### heading, then open a fenced block with language tag mermaid (flowchart TD or sequenceDiagram)
|
|
97
|
+
whose node/participant labels match real modules or symbols from the repo.
|
|
98
|
+
-->
|
|
99
|
+
|
|
100
|
+
### <!-- e.g. Request path (implementation) -->
|
|
101
|
+
|
|
102
|
+
<!-- Numbered list: 1. … 2. … each tied to files named in Evidence index. -->
|
|
103
|
+
|
|
104
|
+
### <!-- Mermaid — required when flow has 2+ stages -->
|
|
105
|
+
|
|
106
|
+
<!--
|
|
107
|
+
```mermaid
|
|
108
|
+
%%{init: {'theme':'neutral'}}%%
|
|
109
|
+
flowchart TD
|
|
110
|
+
...
|
|
111
|
+
```
|
|
112
|
+
or sequenceDiagram with real handler/service/repository names (see MERMAID.md).
|
|
113
|
+
-->
|
|
114
|
+
|
|
115
|
+
## Alternate flows
|
|
116
|
+
|
|
117
|
+
## Postconditions
|
|
118
|
+
|
|
119
|
+
## Errors and edge cases
|
|
120
|
+
|
|
121
|
+
<!-- Map error paths to code (guards, catch blocks, HTTP errors) — cite in Evidence. -->
|
|
122
|
+
|
|
123
|
+
## Technical mapping
|
|
124
|
+
|
|
125
|
+
<!--
|
|
126
|
+
Optional: cross-cutting helpers, shared validators, infra (queue, cache) if not fully covered above.
|
|
127
|
+
Do not duplicate ## Code flow; add only extra touchpoints.
|
|
128
|
+
-->
|
|
129
|
+
|
|
130
|
+
## Related scenarios
|
|
131
|
+
|
|
132
|
+
<!-- List SC-* from scenarios list when known. -->
|
|
133
|
+
|
|
134
|
+
## Revision
|
|
135
|
+
|
|
136
|
+
<!--
|
|
137
|
+
Append-only: after each substantive edit, add one bullet (newest at bottom, or consistent ISO-8601 date prefixes).
|
|
138
|
+
-->
|
|
139
|
+
|
|
140
|
+
- <!-- e.g. Initial draft: data inputs, code flow, and Evidence tied to handlers and services. -->
|
|
141
|
+
|
|
142
|
+
## Evidence index
|
|
143
|
+
|
|
144
|
+
<!--
|
|
145
|
+
Multiple substantive bullets — at minimum: entrypoint, validation, core logic, persistence/IO, response/errors.
|
|
146
|
+
Each bullet should map to a stage in ## Code flow. Never only the route file if logic lives elsewhere.
|
|
147
|
+
-->
|
|
148
|
+
|
|
149
|
+
- <!-- `path:line` — entrypoint -->
|
|
150
|
+
- <!-- `path:start-end` — validation -->
|
|
151
|
+
- <!-- `path:start-end` — persistence / domain logic -->
|
|
152
|
+
- <!-- `path:start-end` — response or error mapping -->
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Evidence (**R21**)
|
|
156
|
+
|
|
157
|
+
Follow **Non-empty chapters and Evidence index** and **Evidence vs Code flow** above. Citations required per §3.5.1. Basename must match §4.4 composite pattern.
|
|
158
|
+
|
|
159
|
+
## Prerequisites
|
|
160
|
+
|
|
161
|
+
**`.gluecharm/context/QA-<nn>-test cases-list.json`** includes this test case.
|
|
162
|
+
|
|
163
|
+
## OpenCode wiring
|
|
164
|
+
|
|
165
|
+
§3.5.1; orchestration supplies FE/UC codes and exact **`{{OUTPUT_FILE_ABSOLUTE}}`**.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: SRS-34 — semantic normalization of per-feature components list JSON after listUseCases; UC codes; JSON only; .gluecharm/context.
|
|
3
|
+
mode: primary
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent: Infrastructure components list — semantic review (coordination JSON)
|
|
7
|
+
|
|
8
|
+
| Field | Value |
|
|
9
|
+
| ----- | ----- |
|
|
10
|
+
| **AGENT_ID** | `ctx-review-components-list` |
|
|
11
|
+
| **Display name** | Infrastructure components list — semantic review |
|
|
12
|
+
| **Output** | `<worktree>/.gluecharm/context/IN-*-components-list.json` (overwrite) |
|
|
13
|
+
|
|
14
|
+
## Responsibility
|
|
15
|
+
|
|
16
|
+
**`.opencode/` exclusion:** The worktree may contain **`.opencode/`** (materialized OpenCode agents, schemas, and tooling). It is **not** part of the analyzed product codebase. **Do not** use it to infer application behavior. **Never** cite paths under **`.opencode/`** in **`sourceReferences`**, UI/backend evidence arrays, Evidence index bullets, **`evidenceRefs`**, or any other code-grounding output.
|
|
17
|
+
|
|
18
|
+
Read the components list for the scoped feature. Merge duplicate UCs, remove false infrastructure components, fix split/merge; each surviving row **must** keep **`sourceReferences`** with **`minItems: 1`** (add evidence or **drop** the row). Stable **IC-*** codes matching **infrastructureCode** in JSON.
|
|
19
|
+
|
|
20
|
+
**Cardinality:** After normalization, **one** remaining UC is **suspicious** for a non-trivial feature—re-check that distinct goals or entry paths were not over-merged. If the feature truly has a single linear journey, note that in **`revisionLog`**; otherwise split or add UCs so the list reflects multiple meaningful journeys.
|
|
21
|
+
|
|
22
|
+
## SRS-50 (stable coordination list writes)
|
|
23
|
+
|
|
24
|
+
- **Append-only** — net-new `IC-*` only **after** existing rows; **do not reorder** survivors.
|
|
25
|
+
- **Logged deletes** — **`revisionLog[].droppedCodes`** for every removed `code`.
|
|
26
|
+
- **Slug rename auth** — **`revisionLog[].slugRenames`** when changing `slug` for a fixed `code`.
|
|
27
|
+
|
|
28
|
+
## Task
|
|
29
|
+
|
|
30
|
+
Valid JSON at **`{{OUTPUT_FILE_ABSOLUTE}}`** per **`{{LIST_SCHEMA_REF}}`**.
|
|
31
|
+
|
|
32
|
+
## OpenCode wiring
|
|
33
|
+
|
|
34
|
+
**`{{LIST_SCHEMA_REF}}`**, **`{{WORKTREE_ROOT}}`**, **`{{OUTPUT_FILE_ABSOLUTE}}`**, **`{{OUTPUT_BASENAME}}`**.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: SRS-27 — semantic normalization of infrastructure-list.json after listFeatures; duplicates, splits, infrastructureKind (product/infrastructure/testing); JSON only; .gluecharm/context.
|
|
3
|
+
mode: primary
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent: Infrastructure list — semantic review (coordination JSON)
|
|
7
|
+
|
|
8
|
+
| Field | Value |
|
|
9
|
+
| ----- | ----- |
|
|
10
|
+
| **AGENT_ID** | `ctx-review-infrastructure-list` |
|
|
11
|
+
| **Display name** | Infrastructure list — semantic review |
|
|
12
|
+
| **SRS-27** | Gate before feature-detail markdown and `listRepoSurface` fan-out |
|
|
13
|
+
| **Output** | `<worktree>/.gluecharm/context/infrastructure-list.json` (overwrite) |
|
|
14
|
+
| **Pattern** | §3.5.2 — JSON list (coordination) |
|
|
15
|
+
|
|
16
|
+
## Responsibility
|
|
17
|
+
|
|
18
|
+
**`.opencode/` exclusion:** The worktree may contain **`.opencode/`** (materialized OpenCode agents, schemas, and tooling). It is **not** part of the analyzed product codebase. **Do not** use it to infer application behavior. **Never** cite paths under **`.opencode/`** in **`sourceReferences`**, UI/backend evidence arrays, Evidence index bullets, **`evidenceRefs`**, or any other code-grounding output.
|
|
19
|
+
|
|
20
|
+
**Read** the **existing** `infrastructure-list.json` (already schema-valid from **listFeatures**). **Rewrite** it as the **single canonical** list downstream agents will use. You **do not** re-discover the repo from scratch; you **normalize** semantics:
|
|
21
|
+
|
|
22
|
+
1. **Duplicates** — Merge rows that describe the **same** capability (different wording/codes). Keep **one** canonical row; **drop** the duplicate codes. Prefer keeping the **lower** `IN-<nn>` when ties are arbitrary. **Append** `revisionLog` explaining merges.
|
|
23
|
+
2. **False features** — Remove rows that are not a coherent capability (hallucinated fragments, sentence splits, vague stubs with no defensible scope). **revisionLog** each removal.
|
|
24
|
+
3. **Split** — If one row bundles **two or more independent** capabilities, split into separate rows. Assign **new** `IN-<nn>` codes using the **next** unused integers (max existing + 1, +2, …). Update `slug`/`name`/`description` accordingly. **revisionLog** splits. (Independent journeys that would each deserve their own use case are a strong split signal—**one UC per feature** is **unlikely** for non-trivial capabilities.)
|
|
25
|
+
4. **Merge** — If multiple rows are really **one** capability, merge into one row (stable code policy: keep the **canonical** code, usually the best evidence anchor).
|
|
26
|
+
5. **Testing vs product** — If **“test login”** (or similar) duplicates **“login”**, **merge** into the product feature and describe test hooks in `description`, **or** keep one row with `infrastructureKind`: `testing` **only** when it is a **pure** harness with **no** user-facing counterpart. Do **not** leave two product rows for the same capability.
|
|
27
|
+
6. **Infrastructure** — Rows that are primarily **ops/deployment/platform** (not a user story) **must** set `infrastructureKind`: `infrastructure`. Ordinary capabilities use `infrastructureKind`: `product` or omit (treated as product).
|
|
28
|
+
7. **infrastructureKind** — Every surviving row **should** explicitly set **`product`**, **`infrastructure`**, or **`testing`** (schema enum). Omit only when clearly product-equivalent.
|
|
29
|
+
8. **`sourceReferences`** — Every surviving feature row **must** have **`minItems: 1`** valid evidence; add from manifests/code if missing. Drop or fix entries that violate schema (no directories, no `.gluecharm/` paths, no `.opencode/` paths, no README basenames).
|
|
30
|
+
9. **`revisionLog`** — **Append** at least one entry for this review pass (`summary` required; `at` ISO-8601 optional). **Never delete** prior `revisionLog` entries.
|
|
31
|
+
|
|
32
|
+
## SRS-50 (stable coordination list writes)
|
|
33
|
+
|
|
34
|
+
Prefer output that already respects EasySpecs merge rules (the extension post-processes the file):
|
|
35
|
+
|
|
36
|
+
- **Append-only** — net-new `IN-*` rows only **after** all existing rows; **do not reorder** surviving rows.
|
|
37
|
+
- **Logged deletes** — every removed `code` must appear in **`revisionLog[].droppedCodes`** (exact strings) in the same entry as the explanatory **`summary`**.
|
|
38
|
+
- **Slug rename auth** — changing `slug` without changing `code` requires **`revisionLog[].slugRenames`** entries `{ "code", "from", "to" }`.
|
|
39
|
+
|
|
40
|
+
## Stable codes
|
|
41
|
+
|
|
42
|
+
- When **merging** duplicates: keep **one** `IN-*` code (prefer the row with stronger evidence).
|
|
43
|
+
- When **splitting**: add **new** codes only; do **not** renumber unrelated existing rows.
|
|
44
|
+
- **`slug`** must remain kebab-case and match `^IN-<nn>-<slug>.md` detail file convention.
|
|
45
|
+
|
|
46
|
+
## Task (for `{{LIST_TASK_DESCRIPTION}}`)
|
|
47
|
+
|
|
48
|
+
Execute the normalization above. Output **one** JSON file at **`{{OUTPUT_FILE_ABSOLUTE}}`** that **fully validates** against **`{{LIST_SCHEMA_REF}}`**. Do **not** output markdown.
|
|
49
|
+
|
|
50
|
+
## JSON Schema
|
|
51
|
+
|
|
52
|
+
Use the same bundled schema as **listFeatures** (`infrastructure-list.schema.json`), including optional **`infrastructureKind`**: `product` | `infrastructure` | `testing`.
|
|
53
|
+
|
|
54
|
+
## Barriers
|
|
55
|
+
|
|
56
|
+
- Downstream orchestration runs **only** after this file passes EasySpecs validation (schema + forbidden `sourceReferences` paths).
|
|
57
|
+
|
|
58
|
+
## OpenCode wiring
|
|
59
|
+
|
|
60
|
+
Supply **`{{LIST_SCHEMA_REF}}`**, **`{{WORKTREE_ROOT}}`**, **`{{OUTPUT_FILE_ABSOLUTE}}`**, **`{{OUTPUT_BASENAME}}`**. Do **not** write `index-application-context.json`.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: SRS-27 — semantic normalization of qa-list.json after listFeatures; duplicates, splits, infrastructureKind (product/infrastructure/testing); JSON only; .gluecharm/context.
|
|
3
|
+
mode: primary
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent: QA list — semantic review (coordination JSON)
|
|
7
|
+
|
|
8
|
+
| Field | Value |
|
|
9
|
+
| ----- | ----- |
|
|
10
|
+
| **AGENT_ID** | `ctx-review-qa-list` |
|
|
11
|
+
| **Display name** | QA list — semantic review |
|
|
12
|
+
| **SRS-27** | Gate before feature-detail markdown and `listRepoSurface` fan-out |
|
|
13
|
+
| **Output** | `<worktree>/.gluecharm/context/qa-list.json` (overwrite) |
|
|
14
|
+
| **Pattern** | §3.5.2 — JSON list (coordination) |
|
|
15
|
+
|
|
16
|
+
## Responsibility
|
|
17
|
+
|
|
18
|
+
**`.opencode/` exclusion:** The worktree may contain **`.opencode/`** (materialized OpenCode agents, schemas, and tooling). It is **not** part of the analyzed product codebase. **Do not** use it to infer application behavior. **Never** cite paths under **`.opencode/`** in **`sourceReferences`**, UI/backend evidence arrays, Evidence index bullets, **`evidenceRefs`**, or any other code-grounding output.
|
|
19
|
+
|
|
20
|
+
**Read** the **existing** `qa-list.json` (already schema-valid from **listFeatures**). **Rewrite** it as the **single canonical** list downstream agents will use. You **do not** re-discover the repo from scratch; you **normalize** semantics:
|
|
21
|
+
|
|
22
|
+
1. **Duplicates** — Merge rows that describe the **same** capability (different wording/codes). Keep **one** canonical row; **drop** the duplicate codes. Prefer keeping the **lower** `QA-<nn>` when ties are arbitrary. **Append** `revisionLog` explaining merges.
|
|
23
|
+
2. **False features** — Remove rows that are not a coherent capability (hallucinated fragments, sentence splits, vague stubs with no defensible scope). **revisionLog** each removal.
|
|
24
|
+
3. **Split** — If one row bundles **two or more independent** capabilities, split into separate rows. Assign **new** `QA-<nn>` codes using the **next** unused integers (max existing + 1, +2, …). Update `slug`/`name`/`description` accordingly. **revisionLog** splits. (Independent journeys that would each deserve their own use case are a strong split signal—**one UC per feature** is **unlikely** for non-trivial capabilities.)
|
|
25
|
+
4. **Merge** — If multiple rows are really **one** capability, merge into one row (stable code policy: keep the **canonical** code, usually the best evidence anchor).
|
|
26
|
+
5. **Testing vs product** — If **“test login”** (or similar) duplicates **“login”**, **merge** into the product feature and describe test hooks in `description`, **or** keep one row with `infrastructureKind`: `testing` **only** when it is a **pure** harness with **no** user-facing counterpart. Do **not** leave two product rows for the same capability.
|
|
27
|
+
6. **Infrastructure** — Rows that are primarily **ops/deployment/platform** (not a user story) **must** set `infrastructureKind`: `infrastructure`. Ordinary capabilities use `infrastructureKind`: `product` or omit (treated as product).
|
|
28
|
+
7. **infrastructureKind** — Every surviving row **should** explicitly set **`product`**, **`infrastructure`**, or **`testing`** (schema enum). Omit only when clearly product-equivalent.
|
|
29
|
+
8. **`sourceReferences`** — Every surviving feature row **must** have **`minItems: 1`** valid evidence; add from manifests/code if missing. Drop or fix entries that violate schema (no directories, no `.gluecharm/` paths, no `.opencode/` paths, no README basenames).
|
|
30
|
+
9. **`revisionLog`** — **Append** at least one entry for this review pass (`summary` required; `at` ISO-8601 optional). **Never delete** prior `revisionLog` entries.
|
|
31
|
+
|
|
32
|
+
## SRS-50 (stable coordination list writes)
|
|
33
|
+
|
|
34
|
+
Prefer output that already respects EasySpecs merge rules (the extension post-processes the file):
|
|
35
|
+
|
|
36
|
+
- **Append-only** — net-new `QA-*` rows only **after** all existing rows; **do not reorder** surviving rows.
|
|
37
|
+
- **Logged deletes** — every removed `code` must appear in **`revisionLog[].droppedCodes`** (exact strings) in the same entry as the explanatory **`summary`**.
|
|
38
|
+
- **Slug rename auth** — changing `slug` without changing `code` requires **`revisionLog[].slugRenames`** entries `{ "code", "from", "to" }`.
|
|
39
|
+
|
|
40
|
+
## Stable codes
|
|
41
|
+
|
|
42
|
+
- When **merging** duplicates: keep **one** `QA-*` code (prefer the row with stronger evidence).
|
|
43
|
+
- When **splitting**: add **new** codes only; do **not** renumber unrelated existing rows.
|
|
44
|
+
- **`slug`** must remain kebab-case and match `^QA-<nn>-<slug>.md` detail file convention.
|
|
45
|
+
|
|
46
|
+
## Task (for `{{LIST_TASK_DESCRIPTION}}`)
|
|
47
|
+
|
|
48
|
+
Execute the normalization above. Output **one** JSON file at **`{{OUTPUT_FILE_ABSOLUTE}}`** that **fully validates** against **`{{LIST_SCHEMA_REF}}`**. Do **not** output markdown.
|
|
49
|
+
|
|
50
|
+
## JSON Schema
|
|
51
|
+
|
|
52
|
+
Use the same bundled schema as **listFeatures** (`qa-list.schema.json`), including optional **`infrastructureKind`**: `product` | `infrastructure` | `testing`.
|
|
53
|
+
|
|
54
|
+
## Barriers
|
|
55
|
+
|
|
56
|
+
- Downstream orchestration runs **only** after this file passes EasySpecs validation (schema + forbidden `sourceReferences` paths).
|
|
57
|
+
|
|
58
|
+
## OpenCode wiring
|
|
59
|
+
|
|
60
|
+
Supply **`{{LIST_SCHEMA_REF}}`**, **`{{WORKTREE_ROOT}}`**, **`{{OUTPUT_FILE_ABSOLUTE}}`**, **`{{OUTPUT_BASENAME}}`**. Do **not** write `index-application-context.json`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: SRS-34 — semantic normalization of per-feature test cases list JSON after listUseCases; UC codes; JSON only; .gluecharm/context.
|
|
3
|
+
mode: primary
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent: QA test cases list — semantic review (coordination JSON)
|
|
7
|
+
|
|
8
|
+
| Field | Value |
|
|
9
|
+
| ----- | ----- |
|
|
10
|
+
| **AGENT_ID** | `ctx-review-test cases-list` |
|
|
11
|
+
| **Display name** | QA test cases list — semantic review |
|
|
12
|
+
| **Output** | `<worktree>/.gluecharm/context/QA-*-test cases-list.json` (overwrite) |
|
|
13
|
+
|
|
14
|
+
## Responsibility
|
|
15
|
+
|
|
16
|
+
**`.opencode/` exclusion:** The worktree may contain **`.opencode/`** (materialized OpenCode agents, schemas, and tooling). It is **not** part of the analyzed product codebase. **Do not** use it to infer application behavior. **Never** cite paths under **`.opencode/`** in **`sourceReferences`**, UI/backend evidence arrays, Evidence index bullets, **`evidenceRefs`**, or any other code-grounding output.
|
|
17
|
+
|
|
18
|
+
Read the test cases list for the scoped feature. Merge duplicate UCs, remove false test cases, fix split/merge; each surviving row **must** keep **`sourceReferences`** with **`minItems: 1`** (add evidence or **drop** the row). Stable **TC-*** codes matching **qaCode** in JSON.
|
|
19
|
+
|
|
20
|
+
**Cardinality:** After normalization, **one** remaining UC is **suspicious** for a non-trivial feature—re-check that distinct goals or entry paths were not over-merged. If the feature truly has a single linear journey, note that in **`revisionLog`**; otherwise split or add UCs so the list reflects multiple meaningful journeys.
|
|
21
|
+
|
|
22
|
+
## SRS-50 (stable coordination list writes)
|
|
23
|
+
|
|
24
|
+
- **Append-only** — net-new `TC-*` only **after** existing rows; **do not reorder** survivors.
|
|
25
|
+
- **Logged deletes** — **`revisionLog[].droppedCodes`** for every removed `code`.
|
|
26
|
+
- **Slug rename auth** — **`revisionLog[].slugRenames`** when changing `slug` for a fixed `code`.
|
|
27
|
+
|
|
28
|
+
## Task
|
|
29
|
+
|
|
30
|
+
Valid JSON at **`{{OUTPUT_FILE_ABSOLUTE}}`** per **`{{LIST_SCHEMA_REF}}`**.
|
|
31
|
+
|
|
32
|
+
## OpenCode wiring
|
|
33
|
+
|
|
34
|
+
**`{{LIST_SCHEMA_REF}}`**, **`{{WORKTREE_ROOT}}`**, **`{{OUTPUT_FILE_ABSOLUTE}}`**, **`{{OUTPUT_BASENAME}}`**.
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"order": { "type": "integer" },
|
|
73
73
|
"featureKind": {
|
|
74
74
|
"type": "string",
|
|
75
|
-
"enum": ["product"
|
|
76
|
-
"description": "SRS-27:
|
|
75
|
+
"enum": ["product"],
|
|
76
|
+
"description": "SRS-27 / SRS-74: optional product marker; infrastructure and testing rows belong in infrastructure-list.json and qa-list.json."
|
|
77
77
|
},
|
|
78
78
|
"sourceReferences": {
|
|
79
79
|
"type": "array",
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://easyspecs.ai/schemas/context-lists/infrastructure-components-list.schema.json",
|
|
4
|
+
"title": "infrastructure-components-list",
|
|
5
|
+
"$defs": {
|
|
6
|
+
"sourceReference": {
|
|
7
|
+
"type": "object",
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"required": [
|
|
10
|
+
"path",
|
|
11
|
+
"startLine",
|
|
12
|
+
"endLine"
|
|
13
|
+
],
|
|
14
|
+
"properties": {
|
|
15
|
+
"path": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"minLength": 1,
|
|
18
|
+
"pattern": "^[^/]+(/[^/]+)*$",
|
|
19
|
+
"description": "Repo-relative path to a single file (forward slashes). Not a directory: no trailing slash; list each file in a folder as its own sourceReferences entry."
|
|
20
|
+
},
|
|
21
|
+
"startLine": {
|
|
22
|
+
"type": "integer",
|
|
23
|
+
"minimum": 1,
|
|
24
|
+
"description": "1-based inclusive start line."
|
|
25
|
+
},
|
|
26
|
+
"endLine": {
|
|
27
|
+
"type": "integer",
|
|
28
|
+
"minimum": 1,
|
|
29
|
+
"description": "1-based inclusive end line; should be >= startLine."
|
|
30
|
+
},
|
|
31
|
+
"note": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "Optional short label for this evidence span."
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"type": "object",
|
|
39
|
+
"additionalProperties": false,
|
|
40
|
+
"required": [
|
|
41
|
+
"infrastructureCode",
|
|
42
|
+
"components"
|
|
43
|
+
],
|
|
44
|
+
"properties": {
|
|
45
|
+
"kind": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"const": "easyspecs.infrastructure-components-list"
|
|
48
|
+
},
|
|
49
|
+
"version": {
|
|
50
|
+
"type": "integer",
|
|
51
|
+
"minimum": 1
|
|
52
|
+
},
|
|
53
|
+
"infrastructureCode": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"pattern": "^IN-[0-9]+$"
|
|
56
|
+
},
|
|
57
|
+
"components": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"items": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"additionalProperties": true,
|
|
62
|
+
"required": [
|
|
63
|
+
"code",
|
|
64
|
+
"name",
|
|
65
|
+
"sourceReferences"
|
|
66
|
+
],
|
|
67
|
+
"properties": {
|
|
68
|
+
"code": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"pattern": "^IC-[0-9]+$"
|
|
71
|
+
},
|
|
72
|
+
"name": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"minLength": 1
|
|
75
|
+
},
|
|
76
|
+
"slug": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
|
|
79
|
+
},
|
|
80
|
+
"description": {
|
|
81
|
+
"type": "string"
|
|
82
|
+
},
|
|
83
|
+
"order": {
|
|
84
|
+
"type": "integer"
|
|
85
|
+
},
|
|
86
|
+
"sourceReferences": {
|
|
87
|
+
"type": "array",
|
|
88
|
+
"minItems": 1,
|
|
89
|
+
"items": {
|
|
90
|
+
"$ref": "#/$defs/sourceReference"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"kind": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"enum": [
|
|
96
|
+
"job",
|
|
97
|
+
"stage",
|
|
98
|
+
"step",
|
|
99
|
+
"resource",
|
|
100
|
+
"module",
|
|
101
|
+
"service",
|
|
102
|
+
"volume",
|
|
103
|
+
"secret",
|
|
104
|
+
"network",
|
|
105
|
+
"other"
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"revisionLog": {
|
|
112
|
+
"type": "array",
|
|
113
|
+
"description": "Append-only log of substantive edits; add an entry whenever this pass changes rows, merges, or refines the coordination file.",
|
|
114
|
+
"items": {
|
|
115
|
+
"type": "object",
|
|
116
|
+
"additionalProperties": false,
|
|
117
|
+
"required": [
|
|
118
|
+
"summary"
|
|
119
|
+
],
|
|
120
|
+
"properties": {
|
|
121
|
+
"at": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"description": "ISO-8601 timestamp when known."
|
|
124
|
+
},
|
|
125
|
+
"summary": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"minLength": 1,
|
|
128
|
+
"maxLength": 2000,
|
|
129
|
+
"description": "What was added, changed, or refined in this write."
|
|
130
|
+
},
|
|
131
|
+
"droppedCodes": {
|
|
132
|
+
"type": "array",
|
|
133
|
+
"description": "SRS-50: coordination row codes removed in this pass (explicit intent).",
|
|
134
|
+
"items": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"minLength": 1
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"slugRenames": {
|
|
140
|
+
"type": "array",
|
|
141
|
+
"description": "SRS-50: authorized slug changes for stable detail markdown basenames.",
|
|
142
|
+
"items": {
|
|
143
|
+
"type": "object",
|
|
144
|
+
"additionalProperties": false,
|
|
145
|
+
"required": [
|
|
146
|
+
"code",
|
|
147
|
+
"from",
|
|
148
|
+
"to"
|
|
149
|
+
],
|
|
150
|
+
"properties": {
|
|
151
|
+
"code": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"minLength": 1
|
|
154
|
+
},
|
|
155
|
+
"from": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"minLength": 1
|
|
158
|
+
},
|
|
159
|
+
"to": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"minLength": 1
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"stableWriteDiff": {
|
|
167
|
+
"type": "object",
|
|
168
|
+
"description": "SRS-50: machine-readable summary of merge-by-code pass (EasySpecs extension).",
|
|
169
|
+
"additionalProperties": true
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|