sequant 2.2.0 → 2.3.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +73 -0
- package/dist/bin/cli.js +94 -9
- package/dist/src/commands/doctor.d.ts +25 -0
- package/dist/src/commands/doctor.js +36 -1
- package/dist/src/commands/locks.d.ts +67 -0
- package/dist/src/commands/locks.js +290 -0
- package/dist/src/commands/merge.js +11 -0
- package/dist/src/commands/prompt.d.ts +39 -0
- package/dist/src/commands/prompt.js +179 -0
- package/dist/src/commands/run-display.d.ts +11 -2
- package/dist/src/commands/run-display.js +62 -28
- package/dist/src/commands/run-progress.d.ts +32 -0
- package/dist/src/commands/run-progress.js +76 -0
- package/dist/src/commands/run.js +80 -18
- package/dist/src/commands/stats.d.ts +2 -0
- package/dist/src/commands/stats.js +94 -8
- package/dist/src/commands/status.js +12 -0
- package/dist/src/commands/watch.d.ts +16 -0
- package/dist/src/commands/watch.js +147 -0
- package/dist/src/lib/ac-linter.d.ts +1 -1
- package/dist/src/lib/ac-linter.js +81 -0
- package/dist/src/lib/assess-collision-detect.d.ts +91 -0
- package/dist/src/lib/assess-collision-detect.js +217 -0
- package/dist/src/lib/assess-comment-parser.d.ts +59 -1
- package/dist/src/lib/assess-comment-parser.js +124 -2
- package/dist/src/lib/cli-ui/format.d.ts +19 -0
- package/dist/src/lib/cli-ui/format.js +34 -0
- package/dist/src/lib/cli-ui/run-renderer-types.d.ts +181 -0
- package/dist/src/lib/cli-ui/run-renderer-types.js +7 -0
- package/dist/src/lib/cli-ui/run-renderer.d.ts +239 -0
- package/dist/src/lib/cli-ui/run-renderer.js +1173 -0
- package/dist/src/lib/heuristics/behavior-rule-detector.d.ts +94 -0
- package/dist/src/lib/heuristics/behavior-rule-detector.js +467 -0
- package/dist/src/lib/locks/index.d.ts +7 -0
- package/dist/src/lib/locks/index.js +5 -0
- package/dist/src/lib/locks/lock-manager.d.ts +168 -0
- package/dist/src/lib/locks/lock-manager.js +433 -0
- package/dist/src/lib/locks/types.d.ts +59 -0
- package/dist/src/lib/locks/types.js +31 -0
- package/dist/src/lib/qa/markdown-only-ci.d.ts +46 -0
- package/dist/src/lib/qa/markdown-only-ci.js +74 -0
- package/dist/src/lib/relay/activation.d.ts +60 -0
- package/dist/src/lib/relay/activation.js +122 -0
- package/dist/src/lib/relay/archive.d.ts +34 -0
- package/dist/src/lib/relay/archive.js +106 -0
- package/dist/src/lib/relay/frame.d.ts +20 -0
- package/dist/src/lib/relay/frame.js +76 -0
- package/dist/src/lib/relay/index.d.ts +13 -0
- package/dist/src/lib/relay/index.js +13 -0
- package/dist/src/lib/relay/paths.d.ts +43 -0
- package/dist/src/lib/relay/paths.js +59 -0
- package/dist/src/lib/relay/pid.d.ts +34 -0
- package/dist/src/lib/relay/pid.js +72 -0
- package/dist/src/lib/relay/reader.d.ts +35 -0
- package/dist/src/lib/relay/reader.js +115 -0
- package/dist/src/lib/relay/types.d.ts +68 -0
- package/dist/src/lib/relay/types.js +76 -0
- package/dist/src/lib/relay/writer.d.ts +48 -0
- package/dist/src/lib/relay/writer.js +113 -0
- package/dist/src/lib/settings.d.ts +31 -1
- package/dist/src/lib/settings.js +18 -3
- package/dist/src/lib/version-check.d.ts +60 -5
- package/dist/src/lib/version-check.js +97 -9
- package/dist/src/lib/workflow/batch-executor.d.ts +20 -1
- package/dist/src/lib/workflow/batch-executor.js +248 -175
- package/dist/src/lib/workflow/config-resolver.js +4 -0
- package/dist/src/lib/workflow/heartbeat.d.ts +71 -0
- package/dist/src/lib/workflow/heartbeat.js +194 -0
- package/dist/src/lib/workflow/phase-executor.d.ts +62 -8
- package/dist/src/lib/workflow/phase-executor.js +157 -16
- package/dist/src/lib/workflow/phase-mapper.d.ts +3 -2
- package/dist/src/lib/workflow/phase-mapper.js +17 -20
- package/dist/src/lib/workflow/platforms/github.d.ts +1 -1
- package/dist/src/lib/workflow/platforms/github.js +20 -3
- package/dist/src/lib/workflow/pr-status.d.ts +18 -2
- package/dist/src/lib/workflow/pr-status.js +41 -9
- package/dist/src/lib/workflow/qa-stagnation.d.ts +117 -0
- package/dist/src/lib/workflow/qa-stagnation.js +179 -0
- package/dist/src/lib/workflow/run-orchestrator.d.ts +39 -0
- package/dist/src/lib/workflow/run-orchestrator.js +340 -15
- package/dist/src/lib/workflow/run-reflect.js +1 -1
- package/dist/src/lib/workflow/run-state.d.ts +71 -0
- package/dist/src/lib/workflow/run-state.js +14 -0
- package/dist/src/lib/workflow/state-cleanup.d.ts +13 -5
- package/dist/src/lib/workflow/state-cleanup.js +17 -5
- package/dist/src/lib/workflow/state-manager.d.ts +12 -1
- package/dist/src/lib/workflow/state-manager.js +37 -0
- package/dist/src/lib/workflow/state-schema.d.ts +62 -0
- package/dist/src/lib/workflow/state-schema.js +35 -1
- package/dist/src/lib/workflow/types.d.ts +74 -1
- package/dist/src/lib/workflow/worktree-manager.d.ts +8 -1
- package/dist/src/lib/workflow/worktree-manager.js +15 -6
- package/dist/src/mcp/tools/run.d.ts +44 -0
- package/dist/src/mcp/tools/run.js +104 -13
- package/dist/src/ui/tui/App.d.ts +14 -0
- package/dist/src/ui/tui/App.js +41 -0
- package/dist/src/ui/tui/ElapsedTimer.d.ts +10 -0
- package/dist/src/ui/tui/ElapsedTimer.js +31 -0
- package/dist/src/ui/tui/Header.d.ts +6 -0
- package/dist/src/ui/tui/Header.js +15 -0
- package/dist/src/ui/tui/IssueBox.d.ts +16 -0
- package/dist/src/ui/tui/IssueBox.js +68 -0
- package/dist/src/ui/tui/Spinner.d.ts +9 -0
- package/dist/src/ui/tui/Spinner.js +18 -0
- package/dist/src/ui/tui/index.d.ts +15 -0
- package/dist/src/ui/tui/index.js +29 -0
- package/dist/src/ui/tui/theme.d.ts +29 -0
- package/dist/src/ui/tui/theme.js +52 -0
- package/dist/src/ui/tui/truncate.d.ts +11 -0
- package/dist/src/ui/tui/truncate.js +31 -0
- package/package.json +10 -3
- package/templates/agents/sequant-explorer.md +1 -0
- package/templates/agents/sequant-qa-checker.md +2 -1
- package/templates/agents/sequant-testgen.md +1 -0
- package/templates/hooks/post-tool.sh +11 -0
- package/templates/hooks/pre-tool.sh +18 -9
- package/templates/hooks/relay-check.sh +107 -0
- package/templates/relay/frame.txt +11 -0
- package/templates/scripts/cleanup-worktree.sh +25 -3
- package/templates/scripts/new-feature.sh +6 -0
- package/templates/skills/_shared/references/behavior-rule-detection.md +205 -0
- package/templates/skills/_shared/references/subagent-types.md +21 -8
- package/templates/skills/assess/SKILL.md +103 -49
- package/templates/skills/assess/references/predicted-collision-detection.md +109 -0
- package/templates/skills/docs/SKILL.md +141 -22
- package/templates/skills/exec/SKILL.md +10 -8
- package/templates/skills/fullsolve/SKILL.md +79 -5
- package/templates/skills/loop/SKILL.md +28 -0
- package/templates/skills/merger/SKILL.md +621 -0
- package/templates/skills/qa/SKILL.md +727 -8
- package/templates/skills/setup/SKILL.md +6 -0
- package/templates/skills/spec/SKILL.md +52 -0
- package/templates/skills/spec/references/parallel-groups.md +7 -0
- package/templates/skills/spec/references/recommended-workflow.md +4 -2
- package/templates/skills/testgen/SKILL.md +24 -17
|
@@ -190,6 +190,12 @@ Create `.sequant/settings.json` with sensible defaults:
|
|
|
190
190
|
}
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
+
> **Note:** `agents.model` is currently **inert** per
|
|
194
|
+
> [anthropics/claude-code#43869](https://github.com/anthropics/claude-code/issues/43869).
|
|
195
|
+
> Subagents inherit the parent session's model regardless of this value. The
|
|
196
|
+
> field is kept for forward compatibility so existing settings.json files
|
|
197
|
+
> continue to parse without error.
|
|
198
|
+
|
|
193
199
|
Use the Write tool to create `.sequant/settings.json` with the above content.
|
|
194
200
|
|
|
195
201
|
### 5. Detect Package Manager
|
|
@@ -86,6 +86,7 @@ Mark tier in HTML comment for downstream parsing: `<!-- SEQUANT_SPEC_TIER: [tier
|
|
|
86
86
|
| Unmeasurable | "fast", "performant" | No threshold defined |
|
|
87
87
|
| Incomplete | "handle errors", "edge cases" | Scenarios not enumerated |
|
|
88
88
|
| Open-ended | "etc.", "and more" | Scope undefined |
|
|
89
|
+
| Title/body tension | doc-noun title ("note", "comment", "snippet") + runtime-imperative body ("execute", "trigger", "capture", incl. inflections like `triggered`/`captured`, `run /<cmd>`); separators `.`/`\n`/`:`/`—` | Two different verification bars |
|
|
89
90
|
|
|
90
91
|
3. **Scope Assessment** (unless `--skip-scope-check`): Use `performScopeAssessment` from `./src/lib/scope/index.ts` with settings from `getSettings()`. Verdicts: SCOPE_OK (green), SCOPE_WARNING (yellow, auto-enables quality loop), SCOPE_SPLIT_RECOMMENDED (red). Store results in state.
|
|
91
92
|
|
|
@@ -142,6 +143,57 @@ Check for explicit dependencies: `gh issue view <issue> --json body,labels`. If
|
|
|
142
143
|
|
|
143
144
|
Check issue body/labels for feature branch references (`feature/`, `based on`, epic labels). If found, recommend `--base feature/<branch>` in the plan.
|
|
144
145
|
|
|
146
|
+
### Sibling-site Scan (Conditional)
|
|
147
|
+
|
|
148
|
+
**When to apply:** Focused AC + a localized fix where the same root-cause pattern likely exists at sibling sites in the same file (≥3 instances of the affected pattern in the same file — e.g. the regex blocks in `pre-tool.sh`).
|
|
149
|
+
|
|
150
|
+
**During planning**, scan the same file/module for sibling code matching the bug's root cause. If sibling sites are found, surface them as either: **(a)** an Open Question (in `## Open Questions`) proposing scope expansion (only when trivially co-located), or **(b)** a recommended follow-up issue (in `## Implementation Plan` or as a separate plan step). When findings mix trivial and non-trivial sites, surface each separately. **Don't silently widen scope — the user decides.**
|
|
151
|
+
|
|
152
|
+
This operationalizes the principle in `feedback_qa_second_look.md` (structured analysis biases positive on the literal AC; an adversarial re-read of adjacent code surfaces hidden scope) — `/spec` is the front line, `/qa` the safety net, so catching siblings here is strictly cheaper than at QA. Don't automate via grep — false-positive risk; this is a "look at adjacent code" planner prompt.
|
|
153
|
+
|
|
154
|
+
### Rule Touchpoints (Conditional)
|
|
155
|
+
|
|
156
|
+
**When to apply:** Any AC whose description matches the behavior-rule heuristic — i.e. >= 2 distinct keywords from `default | always | never | rule | behavior | skip` (case-insensitive), OR an explicit pattern like `always X unless Y` / `never X unless Y` / `default X when Y`.
|
|
157
|
+
|
|
158
|
+
**Why:** Behavior-rule ACs are routinely implemented at multiple touchpoints — typically a skill prompt (LLM-interpreted) AND runtime TypeScript that duplicates the same rule. Without this check, edits land at one site and the other goes stale. Motivating miss: issue #533 (default /assess spec phase ON) where the runtime CLI's `BUG_LABELS`/`DOCS_LABELS` short-circuit survived the SKILL.md edit and was caught only by manual user follow-up. See [behavior-rule-detection.md](../_shared/references/behavior-rule-detection.md).
|
|
159
|
+
|
|
160
|
+
**During context gathering**, run the detector on every AC. For each AC that triggers, list its touchpoints under a new `## Rule Touchpoints` section in the plan output.
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Per-AC touchpoint enumeration. Run once per AC in the issue body.
|
|
164
|
+
# Skip entirely when no AC triggers (cheap short-circuit).
|
|
165
|
+
SPEC_AC_ID="AC-1" \
|
|
166
|
+
SPEC_AC_TEXT="<verbatim AC description from the issue body>" \
|
|
167
|
+
npx tsx -e '
|
|
168
|
+
(async () => {
|
|
169
|
+
const m = await import("./src/lib/heuristics/behavior-rule-detector.ts");
|
|
170
|
+
const ac = {
|
|
171
|
+
id: process.env.SPEC_AC_ID,
|
|
172
|
+
description: process.env.SPEC_AC_TEXT,
|
|
173
|
+
verificationMethod: "manual",
|
|
174
|
+
status: "pending",
|
|
175
|
+
};
|
|
176
|
+
const detection = m.detectBehaviorRule(ac);
|
|
177
|
+
if (!detection.triggered) { console.log(JSON.stringify({ triggered: false })); return; }
|
|
178
|
+
const touchpoints = m.findTouchpoints(ac, process.cwd());
|
|
179
|
+
console.log(JSON.stringify({ triggered: true, keywords: detection.keywords, touchpoints }));
|
|
180
|
+
})();
|
|
181
|
+
'
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**If any AC triggers and `touchpoints` is non-empty**, add this section to the plan output (between **Implementation Plan** and **Design Review**):
|
|
185
|
+
|
|
186
|
+
```markdown
|
|
187
|
+
## Rule Touchpoints
|
|
188
|
+
|
|
189
|
+
| AC | Touchpoint | Snippet |
|
|
190
|
+
|----|------------|---------|
|
|
191
|
+
| AC-N | path/to/file.ts:LINE | `<one-line snippet>` |
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**If every AC short-circuits** (`triggered: false`) **or `touchpoints` is empty**, omit the section entirely — keeps cost cheap per the Performance budget in the reference doc.
|
|
195
|
+
|
|
196
|
+
|
|
145
197
|
## Verification Method Decision Framework
|
|
146
198
|
|
|
147
199
|
Use this table when assigning verification methods to each AC:
|
|
@@ -25,6 +25,13 @@ When the implementation involves 3+ independent tasks that could be parallelized
|
|
|
25
25
|
|
|
26
26
|
## Model Selection
|
|
27
27
|
|
|
28
|
+
> **Note:** Per anthropics/claude-code#43869, the `[model: ...]` annotation
|
|
29
|
+
> below and the `model=` parameter `/exec` passes to `Agent(...)` are currently
|
|
30
|
+
> ignored — every spawned subagent inherits the parent session's model. The
|
|
31
|
+
> guidance here reflects the *intended* tier for each task once upstream fixes
|
|
32
|
+
> ship; the parser in `exec/SKILL.md` is kept intact so it reactivates
|
|
33
|
+
> automatically.
|
|
34
|
+
|
|
28
35
|
Include a `[model: haiku]` or `[model: sonnet]` annotation at the end of each task line:
|
|
29
36
|
|
|
30
37
|
| Task Type | Recommended Model |
|
|
@@ -14,16 +14,18 @@ This document shows the expected output format for the `## Recommended Workflow`
|
|
|
14
14
|
|
|
15
15
|
## Examples
|
|
16
16
|
|
|
17
|
-
### Simple Bug Fix
|
|
17
|
+
### Simple Bug Fix (spec confirms straightforward scope)
|
|
18
18
|
|
|
19
19
|
```markdown
|
|
20
20
|
## Recommended Workflow
|
|
21
21
|
|
|
22
22
|
**Phases:** exec → qa
|
|
23
23
|
**Quality Loop:** disabled
|
|
24
|
-
**Reasoning:**
|
|
24
|
+
**Reasoning:** This spec pass confirmed a clear root cause and narrow scope — no testgen or additional phases required; proceed to exec.
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
*Note:* Since #533, spec always runs by default. `**Phases:**` lists phases **after** spec — use `exec → qa` here to indicate "spec is done; only exec and qa remain."
|
|
28
|
+
|
|
27
29
|
### Standard Feature
|
|
28
30
|
|
|
29
31
|
```markdown
|
|
@@ -39,9 +39,16 @@ When invoked as `/testgen <issue-number>`, your job is to:
|
|
|
39
39
|
- `/testgen 123` - Generate test stubs for issue #123 based on /spec comment
|
|
40
40
|
- `/testgen` - Generate stubs for the most recently discussed issue in conversation
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Sub-Agent Delegation for Stub Generation
|
|
43
43
|
|
|
44
|
-
**Purpose:** Test stub generation is highly mechanical and
|
|
44
|
+
**Purpose:** Test stub generation is highly mechanical and is delegated to `sequant-testgen` so the main agent focuses on orchestration.
|
|
45
|
+
|
|
46
|
+
> **Upstream caveat:** `sequant-testgen` declares `model: haiku`, but per
|
|
47
|
+
> anthropics/claude-code#43869 that declaration is currently ignored — the
|
|
48
|
+
> subagent inherits the parent session's model. Older versions of this doc
|
|
49
|
+
> claimed concrete token-cost savings from haiku. Those numbers are not
|
|
50
|
+
> achievable until the upstream fix ships; treat the haiku claim as the
|
|
51
|
+
> *intended* tier, not the runtime one.
|
|
45
52
|
|
|
46
53
|
**Pattern:** Use `Agent(subagent_type="sequant-testgen")` for:
|
|
47
54
|
1. Parsing verification criteria from /spec comments
|
|
@@ -49,13 +56,12 @@ When invoked as `/testgen <issue-number>`, your job is to:
|
|
|
49
56
|
3. Writing test file content
|
|
50
57
|
|
|
51
58
|
**Benefits:**
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
- Main agent focuses on orchestration and decisions
|
|
59
|
+
- Main agent focuses on orchestration and decisions, not stub templating
|
|
60
|
+
- Designated tier (`haiku`) will yield token savings once anthropics/claude-code#43869 is fixed; today subagents inherit the parent's model
|
|
55
61
|
|
|
56
62
|
### Sub-Agent Usage
|
|
57
63
|
|
|
58
|
-
**Step 1: Parse Verification Criteria (
|
|
64
|
+
**Step 1: Parse Verification Criteria (designated haiku — currently inert per anthropics/claude-code#43869)**
|
|
59
65
|
|
|
60
66
|
```javascript
|
|
61
67
|
Agent(subagent_type="sequant-testgen", prompt=`
|
|
@@ -87,7 +93,7 @@ ${specComment}
|
|
|
87
93
|
`)
|
|
88
94
|
```
|
|
89
95
|
|
|
90
|
-
**Step 2: Generate Test Stubs (
|
|
96
|
+
**Step 2: Generate Test Stubs (designated haiku — currently inert per anthropics/claude-code#43869)**
|
|
91
97
|
|
|
92
98
|
```javascript
|
|
93
99
|
// For each AC with Unit Test or Integration Test verification method
|
|
@@ -122,16 +128,16 @@ The main agent handles file operations to ensure proper coordination:
|
|
|
122
128
|
|
|
123
129
|
| Task | Agent | Reasoning |
|
|
124
130
|
|------|-------|-----------|
|
|
125
|
-
| Parse /spec comment | haiku | Mechanical text extraction |
|
|
126
|
-
| Generate test stub code | haiku | Templated generation |
|
|
127
|
-
| Identify failure scenarios | haiku | Pattern matching |
|
|
131
|
+
| Parse /spec comment | `sequant-testgen` (declared haiku, inert per #43869) | Mechanical text extraction |
|
|
132
|
+
| Generate test stub code | `sequant-testgen` (declared haiku, inert per #43869) | Templated generation |
|
|
133
|
+
| Identify failure scenarios | `sequant-testgen` (declared haiku, inert per #43869) | Pattern matching |
|
|
128
134
|
| Decide file locations | main | Requires codebase context |
|
|
129
135
|
| Write files | main | File system coordination |
|
|
130
136
|
| Post GitHub comment | main | Session context needed |
|
|
131
137
|
|
|
132
138
|
### Parallel Sub-Agent Execution
|
|
133
139
|
|
|
134
|
-
When multiple ACs need test stubs, spawn
|
|
140
|
+
When multiple ACs need test stubs, spawn `sequant-testgen` agents in parallel (declared haiku tier, currently inert per anthropics/claude-code#43869):
|
|
135
141
|
|
|
136
142
|
```javascript
|
|
137
143
|
// Spawn all stub generation agents in a single message
|
|
@@ -143,11 +149,12 @@ const stubPromises = criteria
|
|
|
143
149
|
// Main agent writes all files
|
|
144
150
|
```
|
|
145
151
|
|
|
146
|
-
**Cost savings
|
|
147
|
-
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
152
|
+
**Cost savings (when upstream lands):**
|
|
153
|
+
Once anthropics/claude-code#43869 is fixed and the declared haiku tier takes
|
|
154
|
+
effect, delegating mechanical stub generation to `sequant-testgen` will
|
|
155
|
+
substantially reduce token cost vs. having the main agent generate every stub.
|
|
156
|
+
Concrete savings are not measured here because the declaration is currently
|
|
157
|
+
inert.
|
|
151
158
|
|
|
152
159
|
## Workflow
|
|
153
160
|
|
|
@@ -626,7 +633,7 @@ Cannot generate test files - no feature worktree exists for Issue #<N>.
|
|
|
626
633
|
|
|
627
634
|
**Options:**
|
|
628
635
|
1. Run `/exec <issue>` first (creates worktree automatically)
|
|
629
|
-
2. Create worktree manually: `./scripts/
|
|
636
|
+
2. Create worktree manually: `./scripts/new-feature.sh <issue>`
|
|
630
637
|
3. Use the browser/manual test scenarios from this comment
|
|
631
638
|
```
|
|
632
639
|
|