@rsaglobaltech/specgate 0.12.1 → 0.13.0
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/CHANGELOG.md +91 -0
- package/README.md +66 -58
- package/bin/specgate.ts +35 -0
- package/dist/bin/specgate.js +31 -0
- package/dist/bin/specgate.js.map +1 -1
- package/dist/packages/core/src/application/ArchiveChangeUseCase.js +22 -0
- package/dist/packages/core/src/application/ArchiveChangeUseCase.js.map +1 -1
- package/dist/packages/core/src/domain/DeltaFeature.js +39 -0
- package/dist/packages/core/src/domain/DeltaFeature.js.map +1 -0
- package/dist/packages/core/src/domain/DerivedMatrix.js +25 -19
- package/dist/packages/core/src/domain/DerivedMatrix.js.map +1 -1
- package/dist/packages/core/test/unit/delta-feature.test.js +74 -0
- package/dist/packages/core/test/unit/delta-feature.test.js.map +1 -0
- package/dist/packages/mcp-spec-driven/src/native-tools.js +256 -0
- package/dist/packages/mcp-spec-driven/src/native-tools.js.map +1 -0
- package/dist/packages/mcp-spec-driven/src/server.js +276 -0
- package/dist/packages/mcp-spec-driven/src/server.js.map +1 -0
- package/dist/packages/mcp-spec-driven/src/tools.js +667 -0
- package/dist/packages/mcp-spec-driven/src/tools.js.map +1 -0
- package/dist/scripts/agents/init.js +1 -1
- package/dist/scripts/agents/init.js.map +1 -1
- package/dist/scripts/alm/cli.js +4 -0
- package/dist/scripts/alm/cli.js.map +1 -1
- package/dist/scripts/change/instructions.js +5 -4
- package/dist/scripts/change/instructions.js.map +1 -1
- package/dist/scripts/cli/commands/config/CiInitCommand.js +47 -3
- package/dist/scripts/cli/commands/config/CiInitCommand.js.map +1 -1
- package/dist/scripts/cli/commands/harness/RunCommand.js +3 -2
- package/dist/scripts/cli/commands/harness/RunCommand.js.map +1 -1
- package/dist/scripts/cli/commands/mcp/McpInstallCommand.js +7 -1
- package/dist/scripts/cli/commands/mcp/McpInstallCommand.js.map +1 -1
- package/dist/scripts/cli/commands/mcp/index.js +52 -0
- package/dist/scripts/cli/commands/mcp/index.js.map +1 -1
- package/dist/scripts/cli/commands/pack/ExpandDomainPackCommand.js +38 -0
- package/dist/scripts/cli/commands/pack/ExpandDomainPackCommand.js.map +1 -1
- package/dist/scripts/cli/commands/quality/ValidateSpecsCommand.js +11 -3
- package/dist/scripts/cli/commands/quality/ValidateSpecsCommand.js.map +1 -1
- package/dist/scripts/cli/commands/spec/DoneCommand.js +20 -6
- package/dist/scripts/cli/commands/spec/DoneCommand.js.map +1 -1
- package/dist/scripts/docs/nav.js +5 -0
- package/dist/scripts/docs/nav.js.map +1 -1
- package/dist/scripts/gen_mcp_tools.js +17 -4
- package/dist/scripts/gen_mcp_tools.js.map +1 -1
- package/dist/scripts/lib/derived-writes.js +21 -6
- package/dist/scripts/lib/derived-writes.js.map +1 -1
- package/dist/scripts/lib/surface.js +10 -7
- package/dist/scripts/lib/surface.js.map +1 -1
- package/package.json +12 -3
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,97 @@ The release process is in [`docs/release-process.md`](docs/release-process.md).
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [0.13.0] — 2026-10-07
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- **The README teaches the five-command loop** — the test mention as the link,
|
|
16
|
+
`done` gating, `ci init` detection, the MCP server in the package — and
|
|
17
|
+
points to the first-PR guide. npm shows it from this release, with a link to
|
|
18
|
+
the documentation site.
|
|
19
|
+
- **[Your team's first pull request](docs/first-pr.md)** — what the author
|
|
20
|
+
writes, what the reviewer reads (and skips), and every failure a first PR
|
|
21
|
+
meets with its fix.
|
|
22
|
+
- **`ci init` detects the provider** from the repository's CI files or its
|
|
23
|
+
`origin` remote. `init` ends by suggesting `specgate ci init`, which answered
|
|
24
|
+
"--provider is required".
|
|
25
|
+
|
|
26
|
+
- **The E2E suite covers every command** (61/61): ALM against a stand-in Jira
|
|
27
|
+
server, and MCP from `mcp install` to a tool call over stdio.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- **`done` runs the gate before it writes.** Closing a requirement as
|
|
32
|
+
`Implemented`, `Verified` or `Released` now runs what `check` runs and writes
|
|
33
|
+
nothing when it fails. Plain `done` used to print ✔ over a scenario of
|
|
34
|
+
unfilled `<placeholders>` and no test, and the next `check` — the one in CI —
|
|
35
|
+
failed on the same requirement. `--no-check` writes the status without it;
|
|
36
|
+
`--check`/`--strict` still work and are now the default for those statuses.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- **Fix lines and agent rules speak the generated matrix.** On a generated
|
|
41
|
+
matrix, `[TDD-1]`–`[TDD-3]` no longer tell you to edit a matrix column, and
|
|
42
|
+
`change instructions apply` no longer names an `In Dev` status that does not
|
|
43
|
+
exist or `req link`: mention the requirement in the test, close it with
|
|
44
|
+
`done`, run `check`.
|
|
45
|
+
- **The daily loop over MCP.** `check` and `new` were not MCP tools, so an
|
|
46
|
+
MCP-only client (Claude Desktop, Cursor) could not add a requirement or run
|
|
47
|
+
the gate; they are now `specgate_check` and `specgate_new`. Every tool that
|
|
48
|
+
takes an argument besides the project directory — `new`'s title, `done`'s
|
|
49
|
+
requirement, a change id — declares it in its schema; it used to be passed
|
|
50
|
+
only if an agent guessed to send it.
|
|
51
|
+
- **The MCP server starts.** `mcp install`, `agents init` and the Claude plugin
|
|
52
|
+
configured clients to run `npx -y @specgate/mcp-server`, a package that was
|
|
53
|
+
never published: every client set up that way started nothing. The server now
|
|
54
|
+
ships inside the CLI package as `specgate mcp serve`, its tools call the CLI
|
|
55
|
+
that serves them, and it announces that CLI's version. Re-run `mcp install`
|
|
56
|
+
(or `agents init`) to rewrite an existing config.
|
|
57
|
+
- **`change archive` writes the feature file the delta describes.** It only
|
|
58
|
+
copied `.feature` files an author had placed inside the change folder — which
|
|
59
|
+
neither the template nor `change instructions` asks for — so the documented
|
|
60
|
+
cycle archived a matrix row naming a feature file that never existed. When
|
|
61
|
+
the change brings none, the delta's scenarios are rendered as Gherkin, tagged
|
|
62
|
+
`@REQ-NNN` (and `@SCN-NNN` when the scenario has one). An author's file still
|
|
63
|
+
wins.
|
|
64
|
+
- **A requirement archived into a capability spec can be closed.** On a
|
|
65
|
+
generated matrix, `done` and `req link` wrote only to `spec.md`, so an archived
|
|
66
|
+
requirement got "has no section in spec.md" and a pointer to `req add`. They
|
|
67
|
+
now write its `csda:trace` comment in the capability spec, and archived
|
|
68
|
+
requirements link tests and code by mention like any other.
|
|
69
|
+
- **A freshly installed pack no longer fails its own lock gate.** `expand`
|
|
70
|
+
wrote matrix rows per scenario, so a requirement the pack declares without a
|
|
71
|
+
scenario yet — the multi-tenant pack's REQ-004 — never reached the matrix,
|
|
72
|
+
and `validate --against-lock` failed right after `specops add` with
|
|
73
|
+
`pack_requirement_missing`. The `specops sync` it suggested re-expanded the
|
|
74
|
+
same matrix. With a lockfile, `ci init`'s workflow runs that gate, so every
|
|
75
|
+
project installing such a pack had a red CI from the first commit. The
|
|
76
|
+
requirement now gets a `Draft` row with no scenario. Found by the new E2E
|
|
77
|
+
packs journey.
|
|
78
|
+
- **Asking any command for help is never an error.** `specgate ci --help`,
|
|
79
|
+
`pack`, `specops`, `harness`, `config`, `agents`, `alm` and `mcp` answered
|
|
80
|
+
"Unknown … sub-command: --help" over the global usage; `expand`,
|
|
81
|
+
`harness prompt` and `mcp install` refused `--help` as an unknown argument or
|
|
82
|
+
a missing value. A group now lists its sub-commands with their summaries, and
|
|
83
|
+
each of the three answers with its own usage. Found by a new E2E journey that
|
|
84
|
+
asks every command on the surface.
|
|
85
|
+
|
|
86
|
+
### Added
|
|
87
|
+
|
|
88
|
+
- **E2E coverage is measured and can only grow.** The end-to-end suite is split
|
|
89
|
+
by area (`e2e/journeys/*.mjs`) and runs its files in parallel; each journey
|
|
90
|
+
declares the commands it covers. `npm run e2e:coverage` compares them with
|
|
91
|
+
the command surface and with `e2e/uncovered.json` — commands not covered yet,
|
|
92
|
+
a list that can only shrink — and fails a new command that has neither. A
|
|
93
|
+
unit test and the E2E workflow run it. Journeys for the utilities — `doctor`,
|
|
94
|
+
`fix`, `plan`, `report`, `req list/done/rm`, `config`, `schema`,
|
|
95
|
+
`completion`, `studio`, `onboard` — take it from 14 to 34 of 60 commands, and
|
|
96
|
+
offline journeys for packs — `specops add/diff/sync/remove` against a local
|
|
97
|
+
git remote with tags, `pack bundle` for an air-gapped install, `pack
|
|
98
|
+
init/lint/infer`, `expand` — to 43, and the change cycle (`new` → `archive`
|
|
99
|
+
→ delivered with `done`), `change author` reverting an agent's write outside
|
|
100
|
+
the change, `harness init/prompt/run/report` and `specops contribute` to 55.
|
|
101
|
+
|
|
11
102
|
## [0.12.1] — 2026-10-07
|
|
12
103
|
|
|
13
104
|
**Java builds run the current CLI.** The Maven and Gradle plugins were running
|
package/README.md
CHANGED
|
@@ -24,19 +24,42 @@
|
|
|
24
24
|
> unscoped name ([ADR-0024](docs/specs/adr/0024-the-tool-is-renamed-the-format-is-not.md)). You type `specgate`; `csda` still works too.
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
npm i -g @rsaglobaltech/specgate # or prefix every command with npx @rsaglobaltech/specgate@latest
|
|
28
|
+
|
|
29
|
+
cd your-repo # or an empty directory
|
|
30
|
+
specgate init # adopts the code that is there, touching none of it;
|
|
31
|
+
# scaffolds a new project where there is none
|
|
32
|
+
specgate ci init # the gate as a CI job — GitHub, GitLab, Azure or Jenkins,
|
|
33
|
+
# detected from the repository
|
|
34
|
+
specgate check # the gate, locally
|
|
31
35
|
```
|
|
32
36
|
|
|
33
37
|
Requires **Node.js ≥ 22** — or none at all with the Docker image:
|
|
34
38
|
|
|
35
39
|
```bash
|
|
36
|
-
docker run --rm -v "$PWD:/workspace" ghcr.io/rsaglobaltech/specgate
|
|
40
|
+
docker run --rm -v "$PWD:/workspace" ghcr.io/rsaglobaltech/specgate check
|
|
37
41
|
```
|
|
38
42
|
|
|
39
|
-
→ [Getting started](docs/getting-started.md) · [Quickstart for joiners](docs/quickstart.md)
|
|
43
|
+
→ [Getting started](docs/getting-started.md) · [Your team's first pull request](docs/first-pr.md) · [Quickstart for joiners](docs/quickstart.md)
|
|
44
|
+
|
|
45
|
+
## 🔁 The daily loop — five commands
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
specgate status # what is open, and the next command to run
|
|
49
|
+
specgate new "Customers download invoices as PDF" # requirement + scenario, in one step
|
|
50
|
+
# rewrite the scenario's <placeholders>, then write a test that mentions REQ-007:
|
|
51
|
+
# // REQ-007 — a paid invoice downloads as a PDF
|
|
52
|
+
specgate done REQ-007 # runs the gate for it, then marks it Implemented
|
|
53
|
+
specgate check # the whole gate — the same one CI runs
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
That is all most of a team ever types. **Mentioning `REQ-NNN` in a test is the
|
|
57
|
+
link** — there is nothing else to declare. The traceability matrix is
|
|
58
|
+
generated from `spec.md`, the scenario tags and your tests; nobody edits it,
|
|
59
|
+
and CI fails when the committed copy is out of date. `done` writes nothing
|
|
60
|
+
while the gate fails, so a requirement it closes is one CI will not reopen.
|
|
61
|
+
|
|
62
|
+
Everything else — packs, changes, the harness, ALM sync — is in `specgate --help --all`.
|
|
40
63
|
|
|
41
64
|
## 🪜 Adopt one level at a time
|
|
42
65
|
|
|
@@ -44,57 +67,47 @@ Each level is useful on its own and never requires the ones above it.
|
|
|
44
67
|
|
|
45
68
|
| Level | You get | Commands | Cost |
|
|
46
69
|
| --- | --- | --- | --- |
|
|
47
|
-
| **L1** | Traceable specs in your repo | `init`, `new` | ~1 hour |
|
|
70
|
+
| **L1** | Traceable specs in your repo | `init`, `new`, `done` | ~1 hour |
|
|
48
71
|
| **L2** | A PR gate enforcing spec and test coverage | `check`, `ci init` | ~1 hour |
|
|
49
72
|
| **L3** | Versioned, reusable domain requirements | `specops add / sync / diff` | ~1 day |
|
|
50
73
|
| **L4** | Agent-driven delivery, one requirement at a time | `agents init`, `harness run` | ~1 week |
|
|
51
74
|
|
|
52
75
|
## 🛠️ What it does
|
|
53
76
|
|
|
54
|
-
**A
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
→ [
|
|
59
|
-
|
|
60
|
-
**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
77
|
+
**A gate that does not lie.** `specgate check` fails when a delivered
|
|
78
|
+
requirement has no scenario, template steps, no test that mentions it, or
|
|
79
|
+
points at a file that is gone. A Draft owes nothing yet: green on day one,
|
|
80
|
+
stricter with every delivery. Given a test command, it runs your suite too.
|
|
81
|
+
→ [Writing specs](docs/writing-specs.md) · [Validating](docs/validating.md) · [Command reference](docs/commands.md)
|
|
82
|
+
|
|
83
|
+
**Reviews that read intent.** The reviewer reads the requirement, its
|
|
84
|
+
scenario and the test that names it — the gate has already proved the
|
|
85
|
+
mechanical part. A spec that already shipped changes through a reviewable
|
|
86
|
+
delta: only what moves, never a copy. Archiving merges it into the spec tree
|
|
87
|
+
and writes the feature files, so a merged proposal cannot quietly become
|
|
88
|
+
undone work.
|
|
89
|
+
→ [Your team's first pull request](docs/first-pr.md) · [Reviewing changes](docs/reviewing-changes.md)
|
|
90
|
+
|
|
91
|
+
**Your agent works the same loop.** `specgate agents init` gives Claude Code,
|
|
92
|
+
Cursor, Copilot, Windsurf, Aider, Gemini, Cline, Codex or Antigravity the five
|
|
93
|
+
steps as slash commands (`/specgate:new`, `/specgate:done`, …) from one
|
|
94
|
+
definition. Every daily command speaks JSON with stable codes and a `fix` on
|
|
95
|
+
each. The MCP server ships in the package: `specgate mcp install --client claude`.
|
|
96
|
+
→ [Agents](docs/agents.md) · [The agent contract](docs/specs/agent-contract.md) · [Automation and MCP](docs/automation.md)
|
|
70
97
|
|
|
71
98
|
**Domain knowledge as a dependency.** A pack is a versioned, schema-validated
|
|
72
99
|
domain model. Install it, pin it, upgrade it deliberately — and review the
|
|
73
100
|
upgrade as intent with `specops diff --as-change`, not as a file diff.
|
|
74
|
-
→ [Domain packs](docs/domain-packs.md)
|
|
75
|
-
|
|
76
|
-
**
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
→ [
|
|
81
|
-
|
|
82
|
-
**
|
|
83
|
-
|
|
84
|
-
`specgate ci init` generates the gate for GitHub, GitLab, Azure or Jenkins, and
|
|
85
|
-
`specgate alm sync` keeps Jira or Azure Boards in step.
|
|
86
|
-
|
|
87
|
-
**Any agent CLI.** No agent runtime, no SDK dependency: the agent is any shell
|
|
88
|
-
command containing `{prompt_file}` — `claude -p < {prompt_file}`, `aider --yes
|
|
89
|
-
--message-file {prompt_file}`, or `my-wrapper.sh {prompt_file}` for anything
|
|
90
|
-
else. Commit your team's commands in `.harness/profiles.yaml` and pick one by
|
|
91
|
-
name.
|
|
92
|
-
→ [Automation](docs/automation.md) · [The harness](docs/harness.md) · [Jira and Azure Boards](docs/alm.md)
|
|
93
|
-
|
|
94
|
-
**It stays current.** `specgate update` refreshes the generated agent files after an
|
|
95
|
-
upgrade, three-way merging your edits rather than clobbering them. `specgate doctor`
|
|
96
|
-
reports what has drifted, with a fix per finding.
|
|
97
|
-
→ [Command reference](docs/commands.md)
|
|
101
|
+
→ [Domain packs](docs/domain-packs.md) · [Supply chain](docs/supply-chain.md)
|
|
102
|
+
|
|
103
|
+
**Unattended delivery.** `specgate harness run` drives plan → agent → verify →
|
|
104
|
+
done for every pending requirement, each in its own git worktree; it never
|
|
105
|
+
merges. The agent is any shell command with `{prompt_file}` — no runtime or SDK.
|
|
106
|
+
`specgate alm sync` keeps Jira, Azure Boards or GitHub Issues in step.
|
|
107
|
+
→ [The harness](docs/harness.md) · [Jira, Azure Boards and GitHub Issues](docs/alm.md)
|
|
108
|
+
|
|
109
|
+
**Tested as you install it.** Every release runs an end-to-end suite over every
|
|
110
|
+
command, against the packed tarball, on Linux, macOS and Windows.
|
|
98
111
|
|
|
99
112
|
## 🆚 How it compares
|
|
100
113
|
|
|
@@ -105,7 +118,7 @@ reports what has drifted, with a fix per finding.
|
|
|
105
118
|
| Traceability matrix + CI gate | ✅ | ❌ | ⚠️ | ❌ | ❌ |
|
|
106
119
|
| Agent JSON contract | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
107
120
|
| Vendor-neutral | ✅ | ✅ | ✅ | ❌ | ✅ |
|
|
108
|
-
| Smaller surface to learn | ⚠️ five daily
|
|
121
|
+
| Smaller surface to learn | ⚠️ five daily commands | ✅ | ✅ | ✅ | ✅ |
|
|
109
122
|
|
|
110
123
|
OpenSpec is the closest tool and the honest comparison: if you want the change
|
|
111
124
|
loop without versioned packs or an enforced matrix, theirs is the better fit.
|
|
@@ -113,20 +126,15 @@ loop without versioned packs or an enforced matrix, theirs is the better fit.
|
|
|
113
126
|
|
|
114
127
|
## 📚 Documentation
|
|
115
128
|
|
|
116
|
-
- [
|
|
117
|
-
- [How-to guides](docs/how-to.md)
|
|
118
|
-
- [Tutorial](docs/tutorial.md) — long-form, on a real public pack
|
|
119
|
-
- [Supply chain](docs/supply-chain.md) — pack pinning, digests, signing, air-gapped installs, SBOM
|
|
120
|
-
- [Architecture](docs/specs/architecture.md) — three repos, three lifecycles
|
|
121
|
-
- [Bootstrap prompt](docs/bootstrap-prompt.md) — the one freeform-AI step
|
|
129
|
+
- [Getting started](docs/getting-started.md) · [Your team's first pull request](docs/first-pr.md) · [Command reference](docs/commands.md)
|
|
130
|
+
- [How-to guides](docs/how-to.md) · [Tutorial](docs/tutorial.md) · [Supply chain](docs/supply-chain.md) · [Architecture](docs/specs/architecture.md)
|
|
122
131
|
- [Case study](docs/case-studies/case-1.md) · [ADRs](docs/specs/adr/README.md) · [Docs site](https://rsaglobaltech.github.io/specgate/) · [Spec coverage report](https://rsaglobaltech.github.io/specgate/report.html)
|
|
123
132
|
|
|
124
133
|
## 🧰 Companion tools
|
|
125
134
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
plugins** for teams that do not want Node on the build agent.
|
|
135
|
+
[Language server](packages/lsp-spec-driven) · [VS Code extension](packages/vscode-spec-driven) ·
|
|
136
|
+
[Maven](packages/maven-plugin) and [Gradle](packages/gradle-plugin) plugins for builds
|
|
137
|
+
without Node · Docker image `ghcr.io/rsaglobaltech/specgate`
|
|
130
138
|
|
|
131
139
|
## 🤝 Contributing
|
|
132
140
|
|
package/bin/specgate.ts
CHANGED
|
@@ -175,6 +175,17 @@ function helpProfile(): string {
|
|
|
175
175
|
return "core";
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
function groupUsage(row: any) {
|
|
179
|
+
let out = `\n ${c.bold}specgate ${row.name}${c.reset} <sub-command> [options]\n`;
|
|
180
|
+
out += section("SUB-COMMANDS");
|
|
181
|
+
for (const s of row.subcommands) {
|
|
182
|
+
const summary = (s.help && s.help.summary) || (row.help && row.help.summary) || "";
|
|
183
|
+
out += cmd((s.help && s.help.icon) || "·", `${row.name} ${s.name}`, summary, 20);
|
|
184
|
+
}
|
|
185
|
+
out += `\n ${c.dim}Run ‘specgate ${row.name} <sub-command> --help’ for its own options.${c.reset}\n\n`;
|
|
186
|
+
process.stdout.write(out);
|
|
187
|
+
}
|
|
188
|
+
|
|
178
189
|
function usage(opts?: { all?: boolean }) {
|
|
179
190
|
if (opts && opts.all) return usageFull();
|
|
180
191
|
if (helpProfile() === "full") return usageFull();
|
|
@@ -250,6 +261,22 @@ export class CreateSpecDrivenAppCommand implements ICommand {
|
|
|
250
261
|
process.exit(2);
|
|
251
262
|
}
|
|
252
263
|
|
|
264
|
+
// `ci --help`, `pack`, `harness -h`…: a command that groups sub-commands
|
|
265
|
+
// answered "Unknown ci sub-command: --help" and the global usage, so
|
|
266
|
+
// asking what a group does was an error. The answer is the group's own
|
|
267
|
+
// sub-commands, from the same registry the top-level help reads.
|
|
268
|
+
// A row with its own script (`req`, `mcp`) answers for its sub-commands.
|
|
269
|
+
if (row.subcommands && !row.script && (args[1] === "--help" || args[1] === "-h")) {
|
|
270
|
+
groupUsage(row);
|
|
271
|
+
process.exit(0);
|
|
272
|
+
}
|
|
273
|
+
if (row.subcommands && !row.script && args.length === 1) {
|
|
274
|
+
const expected = row.subcommands.map((s: any) => s.name).join(", ");
|
|
275
|
+
error(`Unknown ${command} sub-command: (none). Expected: ${expected}`);
|
|
276
|
+
groupUsage(row);
|
|
277
|
+
process.exit(2);
|
|
278
|
+
}
|
|
279
|
+
|
|
253
280
|
// Three commands need more than a table row. Each is a genuine parsing
|
|
254
281
|
// decision, not a route, which is why it lives here and not in the registry.
|
|
255
282
|
if (command === "init") return dispatchInit(args.slice(1));
|
|
@@ -361,6 +388,14 @@ function dispatchValidate(validateArgs: string[]): void {
|
|
|
361
388
|
* agent and no gate.
|
|
362
389
|
*/
|
|
363
390
|
function dispatchHarnessPrompt(args: string[]): void {
|
|
391
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
392
|
+
process.stdout.write(
|
|
393
|
+
"\n specgate harness prompt <REQ-id> [--project-dir <path>]\n\n" +
|
|
394
|
+
" Prints the prompt `harness run` would hand an agent for one requirement,\n" +
|
|
395
|
+
" and runs nothing.\n\n"
|
|
396
|
+
);
|
|
397
|
+
process.exit(0);
|
|
398
|
+
}
|
|
364
399
|
const reqId = args[2];
|
|
365
400
|
if (!reqId || !/^REQ-\d+$/.test(reqId)) {
|
|
366
401
|
error("`harness prompt` expects a REQ-id, e.g. `specgate harness prompt REQ-001`.");
|
package/dist/bin/specgate.js
CHANGED
|
@@ -156,6 +156,16 @@ function helpProfile() {
|
|
|
156
156
|
}
|
|
157
157
|
return "core";
|
|
158
158
|
}
|
|
159
|
+
function groupUsage(row) {
|
|
160
|
+
let out = `\n ${c.bold}specgate ${row.name}${c.reset} <sub-command> [options]\n`;
|
|
161
|
+
out += section("SUB-COMMANDS");
|
|
162
|
+
for (const s of row.subcommands) {
|
|
163
|
+
const summary = (s.help && s.help.summary) || (row.help && row.help.summary) || "";
|
|
164
|
+
out += cmd((s.help && s.help.icon) || "·", `${row.name} ${s.name}`, summary, 20);
|
|
165
|
+
}
|
|
166
|
+
out += `\n ${c.dim}Run ‘specgate ${row.name} <sub-command> --help’ for its own options.${c.reset}\n\n`;
|
|
167
|
+
process.stdout.write(out);
|
|
168
|
+
}
|
|
159
169
|
function usage(opts) {
|
|
160
170
|
if (opts && opts.all)
|
|
161
171
|
return usageFull();
|
|
@@ -219,6 +229,21 @@ class CreateSpecDrivenAppCommand {
|
|
|
219
229
|
usage();
|
|
220
230
|
process.exit(2);
|
|
221
231
|
}
|
|
232
|
+
// `ci --help`, `pack`, `harness -h`…: a command that groups sub-commands
|
|
233
|
+
// answered "Unknown ci sub-command: --help" and the global usage, so
|
|
234
|
+
// asking what a group does was an error. The answer is the group's own
|
|
235
|
+
// sub-commands, from the same registry the top-level help reads.
|
|
236
|
+
// A row with its own script (`req`, `mcp`) answers for its sub-commands.
|
|
237
|
+
if (row.subcommands && !row.script && (args[1] === "--help" || args[1] === "-h")) {
|
|
238
|
+
groupUsage(row);
|
|
239
|
+
process.exit(0);
|
|
240
|
+
}
|
|
241
|
+
if (row.subcommands && !row.script && args.length === 1) {
|
|
242
|
+
const expected = row.subcommands.map((s) => s.name).join(", ");
|
|
243
|
+
error(`Unknown ${command} sub-command: (none). Expected: ${expected}`);
|
|
244
|
+
groupUsage(row);
|
|
245
|
+
process.exit(2);
|
|
246
|
+
}
|
|
222
247
|
// Three commands need more than a table row. Each is a genuine parsing
|
|
223
248
|
// decision, not a route, which is why it lives here and not in the registry.
|
|
224
249
|
if (command === "init")
|
|
@@ -319,6 +344,12 @@ function dispatchValidate(validateArgs) {
|
|
|
319
344
|
* agent and no gate.
|
|
320
345
|
*/
|
|
321
346
|
function dispatchHarnessPrompt(args) {
|
|
347
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
348
|
+
process.stdout.write("\n specgate harness prompt <REQ-id> [--project-dir <path>]\n\n" +
|
|
349
|
+
" Prints the prompt `harness run` would hand an agent for one requirement,\n" +
|
|
350
|
+
" and runs nothing.\n\n");
|
|
351
|
+
process.exit(0);
|
|
352
|
+
}
|
|
322
353
|
const reqId = args[2];
|
|
323
354
|
if (!reqId || !/^REQ-\d+$/.test(reqId)) {
|
|
324
355
|
error("`harness prompt` expects a REQ-id, e.g. `specgate harness prompt REQ-001`.");
|
package/dist/bin/specgate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specgate.js","sourceRoot":"","sources":["../../bin/specgate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,uCAAyB;AACzB,2CAA6B;AAC7B,iDAA0C;AAE1C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACpD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;AAC1D,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;AAChE,MAAM,OAAO,GAAW,WAAW,CAAC,OAAO,IAAI,OAAO,CAAC;AAEvD,oDAA6F;AAE7F,+EAA+E;AAC/E,SAAS,aAAa,CAAC,QAAkB;IACvC,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAED,qFAAqF;AAErF,MAAM,aAAa,GACjB,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC;AAE5F,MAAM,CAAC,GAAG;IACR,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;IACrC,IAAI,EAAE,aAAa,CAAC,CA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AAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACnD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,iEAAiE;YAC/D,8EAA8E;YAC9E,yBAAyB,CAC5B,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACtB,IAAI,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACvC,KAAK,CAAC,4EAA4E,CAAC,CAAC;QACpF,KAAK,EAAE,CAAC;QACR,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IACpD,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzB,aAAa,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,YAAY,GAChB,OAAO,CAAC,IAAI,KAAK,MAAM;IACvB,CAAC,OAAO,CAAC,IAAI;QACX,CAAC,CAAC,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/E,CAAC,CAAC,KAAK,CAAC,CAAC;AAEb,IAAI,YAAY,EAAE,CAAC;IACjB,IAAI,0BAA0B,EAAE,CAAC,OAAO,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.ArchiveChangeUseCase = void 0;
|
|
37
37
|
const path = __importStar(require("node:path"));
|
|
38
|
+
const DeltaFeature_1 = require("../domain/DeltaFeature");
|
|
38
39
|
const ArchivePlan_1 = require("../domain/ArchivePlan");
|
|
39
40
|
const DeltaSpec_1 = require("../domain/DeltaSpec");
|
|
40
41
|
const TraceabilityMatrix_1 = require("../domain/TraceabilityMatrix");
|
|
@@ -145,6 +146,27 @@ class ArchiveChangeUseCase {
|
|
|
145
146
|
kind: "feature",
|
|
146
147
|
});
|
|
147
148
|
}
|
|
149
|
+
// A requirement whose trace names a feature file that neither exists nor
|
|
150
|
+
// came with the change gets one rendered from the delta's own scenarios.
|
|
151
|
+
// An author's `.feature` in the change folder, or a file already in the
|
|
152
|
+
// project, always wins.
|
|
153
|
+
const featureTargets = new Set(plan.writes.filter((w) => w.kind === "feature").map((w) => w.file));
|
|
154
|
+
for (const { req, capability } of applied.upserts) {
|
|
155
|
+
const rel = String((req.trace || {}).feature || "")
|
|
156
|
+
.replace(/`/g, "")
|
|
157
|
+
.trim();
|
|
158
|
+
if (!rel.endsWith(".feature") || !(req.scenarios || []).length)
|
|
159
|
+
continue;
|
|
160
|
+
const target = path.join(p.root, rel);
|
|
161
|
+
if (featureTargets.has(target) || this.repo.readFile(target) !== null)
|
|
162
|
+
continue;
|
|
163
|
+
plan.writes.push({
|
|
164
|
+
file: target,
|
|
165
|
+
contents: (0, DeltaFeature_1.renderDeltaFeature)(req, capability),
|
|
166
|
+
kind: "feature",
|
|
167
|
+
});
|
|
168
|
+
featureTargets.add(target);
|
|
169
|
+
}
|
|
148
170
|
let traceTotals = { added: 0, updated: 0, removed: 0, legacyDropped: 0 };
|
|
149
171
|
if (applied.upserts.length > 0 || applied.removals.length > 0) {
|
|
150
172
|
const existingContent = this.repo.readFile(p.traceability);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArchiveChangeUseCase.js","sourceRoot":"","sources":["../../../../../packages/core/src/application/ArchiveChangeUseCase.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;
|
|
1
|
+
{"version":3,"file":"ArchiveChangeUseCase.js","sourceRoot":"","sources":["../../../../../packages/core/src/application/ArchiveChangeUseCase.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAClC,yDAA4D;AAE5D,uDAAoD;AACpD,mDAAgD;AAChD,qEAAkE;AAClE,qDAAkD;AAClD,qDAAsD;AAEtD,MAAa,oBAAoB;IACX;IAApB,YAAoB,IAAwB;QAAxB,SAAI,GAAJ,IAAI,CAAoB;IAAG,CAAC;IAEzC,OAAO,CAAC,QAAgB,EAAE,IAAU;QACzC,MAAM,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,GAAG,IAAI,yBAAW,EAAE,CAAC;QAE/B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;YACtC,IAAI,CAAC,WAAW,CAAC,IAAI,CACnB,IAAA,kBAAK,EAAC,0BAA0B,EAAE,WAAW,QAAQ,mBAAmB,EAAE;gBACxE,MAAM,EAAE,QAAQ;gBAChB,GAAG,EAAE,qDAAqD;aAC3D,CAAC,CACH,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC;YACxC,IAAI,CAAC,WAAW,CAAC,IAAI,CACnB,IAAA,kBAAK,EAAC,wBAAwB,EAAE,WAAW,QAAQ,sCAAsC,EAAE;gBACzF,MAAM,EAAE,QAAQ;gBAChB,GAAG,EAAE,4CAA4C;aAClD,CAAC,CACH,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC9C,MAAM,QAAQ,GA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;QACJ,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,eAAe,CAAC,UAAkB;QACxC,OAAO,MAAM,CAAC,UAAU,CAAC;aACtB,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;aACrF,IAAI,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAEO,UAAU,CAAC,GAAU;QAC3B,MAAM,CAAC,GAAG,GAAG,YAAY,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;QACjD,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACtD,OAAO,GAAG,CAAC,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;IAC3E,CAAC;CACF;AArND,oDAqNC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* A delta's scenarios as a Gherkin feature file (phase-3 E2E finding).
|
|
4
|
+
*
|
|
5
|
+
* `change archive` promised to materialise the feature files, and did — but
|
|
6
|
+
* only the `.feature` files an author had placed inside the change folder,
|
|
7
|
+
* which neither the template nor `change instructions` ever asks for. An
|
|
8
|
+
* author who followed the documented cycle wrote the scenario as
|
|
9
|
+
* `- GIVEN / - WHEN / - THEN` bullets in the delta, pointed `feature=` at a
|
|
10
|
+
* path, and archived into a matrix row naming a file that did not exist.
|
|
11
|
+
*
|
|
12
|
+
* The delta already says everything the file needs: the scenario's name, its
|
|
13
|
+
* steps, and the requirement it belongs to.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.renderDeltaFeature = renderDeltaFeature;
|
|
17
|
+
const KEYWORD = /^(GIVEN|WHEN|THEN|AND|BUT)\b\s*/i;
|
|
18
|
+
/** `GIVEN an order` → `Given an order`. A step with no keyword is kept as written. */
|
|
19
|
+
function step(raw) {
|
|
20
|
+
const m = KEYWORD.exec(raw.trim());
|
|
21
|
+
if (!m)
|
|
22
|
+
return raw.trim();
|
|
23
|
+
const kw = m[1].toLowerCase();
|
|
24
|
+
return `${kw[0].toUpperCase()}${kw.slice(1)} ${raw.trim().slice(m[0].length)}`;
|
|
25
|
+
}
|
|
26
|
+
function renderDeltaFeature(req, capability) {
|
|
27
|
+
const lines = [`Feature: ${req.name || capability}`, ""];
|
|
28
|
+
for (const sc of req.scenarios || []) {
|
|
29
|
+
const tags = [req.id ? `@${req.id}` : null, sc.id ? `@${sc.id}` : null].filter(Boolean);
|
|
30
|
+
if (tags.length > 0)
|
|
31
|
+
lines.push(` ${tags.join(" ")}`);
|
|
32
|
+
lines.push(` Scenario: ${sc.name || sc.heading}`);
|
|
33
|
+
for (const s of sc.steps || [])
|
|
34
|
+
lines.push(` ${step(s)}`);
|
|
35
|
+
lines.push("");
|
|
36
|
+
}
|
|
37
|
+
return `${lines.join("\n").replace(/\n+$/, "")}\n`;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=DeltaFeature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeltaFeature.js","sourceRoot":"","sources":["../../../../../packages/core/src/domain/DeltaFeature.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAcH,gDAaC;AAvBD,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAEnD,sFAAsF;AACtF,SAAS,IAAI,CAAC,GAAW;IACvB,MAAM,C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,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC7D,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC;AACrD,CAAC"}
|
|
@@ -56,7 +56,9 @@ exports.DERIVED_MARKER = "<!-- specgate:derived — generated from spec.md, feat
|
|
|
56
56
|
function isDerivedMatrix(content) {
|
|
57
57
|
return String(content || "").includes("<!-- specgate:derived");
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
// `## REQ-002 — title` in spec.md, or `### Requirement: REQ-002 — title` in a
|
|
60
|
+
// capability spec, where `change archive` writes.
|
|
61
|
+
const SECTION_HEADING = /^(#{2,4})\s+(?:Requirement:\s*)?(REQ-[A-Za-z0-9.]+)\b\s*[—–:-]?\s*(.*)$/;
|
|
60
62
|
const TRACE_LINE = /^\s*<!--\s*csda:trace\b/;
|
|
61
63
|
/** Every `## REQ-NNN — title` section in `spec.md`, in document order. */
|
|
62
64
|
function requirementsIn(spec) {
|
|
@@ -100,6 +102,23 @@ function taggedScenarios(features, id) {
|
|
|
100
102
|
}
|
|
101
103
|
return out;
|
|
102
104
|
}
|
|
105
|
+
/** A test or source file that names the requirement is its link. */
|
|
106
|
+
function linkByMention(trace, id, sources) {
|
|
107
|
+
const named = (files) => files
|
|
108
|
+
.filter((f) => mentions(f.source, id))
|
|
109
|
+
.map((f) => f.path)
|
|
110
|
+
.sort();
|
|
111
|
+
if (!trace.test) {
|
|
112
|
+
const tests = named(sources.tests);
|
|
113
|
+
if (tests.length > 0)
|
|
114
|
+
trace.test = tests.join(", ");
|
|
115
|
+
}
|
|
116
|
+
if (!trace.artifact) {
|
|
117
|
+
const code = named(sources.code || []);
|
|
118
|
+
if (code.length > 0)
|
|
119
|
+
trace.artifact = code.join(", ");
|
|
120
|
+
}
|
|
121
|
+
}
|
|
103
122
|
/** The matrix rows the sources imply. */
|
|
104
123
|
function deriveRows(sources) {
|
|
105
124
|
const rows = [];
|
|
@@ -107,22 +126,7 @@ function deriveRows(sources) {
|
|
|
107
126
|
const trace = { ...req.trace };
|
|
108
127
|
if (!trace.uc && req.title)
|
|
109
128
|
trace.uc = req.title;
|
|
110
|
-
|
|
111
|
-
const tests = sources.tests
|
|
112
|
-
.filter((t) => mentions(t.source, req.id))
|
|
113
|
-
.map((t) => t.path)
|
|
114
|
-
.sort();
|
|
115
|
-
if (tests.length > 0)
|
|
116
|
-
trace.test = tests.join(", ");
|
|
117
|
-
}
|
|
118
|
-
if (!trace.artifact) {
|
|
119
|
-
const code = (sources.code || [])
|
|
120
|
-
.filter((t) => mentions(t.source, req.id))
|
|
121
|
-
.map((t) => t.path)
|
|
122
|
-
.sort();
|
|
123
|
-
if (code.length > 0)
|
|
124
|
-
trace.artifact = code.join(", ");
|
|
125
|
-
}
|
|
129
|
+
linkByMention(trace, req.id, sources);
|
|
126
130
|
const scenarios = trace.scn || trace.feature ? [] : taggedScenarios(sources.features, req.id);
|
|
127
131
|
const variants = scenarios.length > 0
|
|
128
132
|
? scenarios.map((s) => ({ ...trace, scn: s.scn, feature: s.feature }))
|
|
@@ -148,8 +152,10 @@ function deriveRows(sources) {
|
|
|
148
152
|
for (const req of parsed.requirements || []) {
|
|
149
153
|
if (!req.id || fromSpec.has(req.id))
|
|
150
154
|
continue;
|
|
151
|
-
const
|
|
152
|
-
|
|
155
|
+
const trace = { ...(req.trace || {}) };
|
|
156
|
+
// Archived requirements link the same way: by being named.
|
|
157
|
+
linkByMention(trace, req.id, sources);
|
|
158
|
+
const row = TraceabilityMatrix_1.TraceabilityMatrix.traceRow({ ...req, trace });
|
|
153
159
|
if (trace.depends)
|
|
154
160
|
row.dependsOn = String(trace.depends).split(",").filter(Boolean);
|
|
155
161
|
if (trace.context)
|