pi-usereq 0.11.0 → 0.12.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 +48 -0
- package/README.md +6 -6
- package/package.json +1 -1
- package/pi-usereq/docs/REFERENCES.md +818 -691
- package/pi-usereq/docs/REQUIREMENTS.md +131 -77
- package/pi-usereq/docs/WORKFLOW.md +185 -51
- package/scripts/lib/extension-debug-harness.ts +2 -2
- package/scripts/tool-args-to-params.ts +2 -2
- package/src/cli.ts +12 -12
- package/src/core/extension-status.ts +69 -12
- package/src/core/pi-notify.ts +5 -5
- package/src/core/pi-usereq-tools.ts +4 -2
- package/src/core/prompt-command-catalog.ts +4 -5
- package/src/core/prompt-command-runtime.ts +183 -44
- package/src/core/prompts.ts +0 -2
- package/src/core/req-references-command.ts +175 -0
- package/src/core/req-reset-command.ts +323 -0
- package/src/core/resources.ts +6 -23
- package/src/core/settings-menu.ts +85 -28
- package/src/core/tool-runner.ts +26 -6
- package/src/index.ts +523 -85
- package/tests/attended-results-scenarios.ts +5 -5
- package/tests/cli-command-option-parity.test.ts +25 -25
- package/tests/debug-extension-harness.test.ts +1 -1
- package/tests/extension-registration.test.ts +1029 -82
- package/tests/oracle-project.test.ts +4 -4
- package/tests/oracle-standalone.test.ts +5 -5
- package/src/core/reference-payload.ts +0 -752
- package/src/resources/prompts/references.md +0 -64
- /package/tests/fixtures_attended_results/project/{references.json → summarize.json} +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_c.c.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_cpp.cpp.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_csharp.cs.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_elixir.ex.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_go.go.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_haskell.hs.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_java.java.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_javascript.js.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_kotlin.kt.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_lua.lua.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_perl.pl.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_php.php.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_python.py.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_ruby.rb.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_rust.rs.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_scala.scala.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_shell.sh.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_swift.swift.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_typescript.ts.json +0 -0
- /package/tests/fixtures_attended_results/standalone/{files-references → files-summarize}/fixture_zig.zig.json +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "PI-useReq Requirements"
|
|
3
3
|
description: Software requirements specification
|
|
4
|
-
version: "0.0.
|
|
5
|
-
date: "2026-04-
|
|
4
|
+
version: "0.0.65"
|
|
5
|
+
date: "2026-04-25"
|
|
6
6
|
author: "OpenAI Codex"
|
|
7
7
|
scope:
|
|
8
8
|
paths:
|
|
@@ -41,13 +41,14 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
41
41
|
## 2. Project Requirements
|
|
42
42
|
|
|
43
43
|
### 2.1 Project Functions
|
|
44
|
-
- **PRJ-001**: MUST expose
|
|
45
|
-
- **PRJ-002**: MUST expose CLI and agent-tool interfaces for token counting,
|
|
44
|
+
- **PRJ-001**: MUST expose bundled prompt-backed slash commands with configuration-derived path substitutions plus a dedicated `req-references` slash command for direct reference-file regeneration.
|
|
45
|
+
- **PRJ-002**: MUST expose CLI and agent-tool interfaces for token counting, source summarization, compression, construct search, and static-check execution, plus an agent-tool interface for reference-file generation.
|
|
46
46
|
- **PRJ-003**: MUST provide an interactive pi configuration surface for project paths, git automation, static-check entries, active-tool enablement, notifications, and debug logging controls.
|
|
47
|
-
- **PRJ-004**: MUST provide slash-command-owned git validation plus
|
|
47
|
+
- **PRJ-004**: MUST provide slash-command-owned git validation plus bundled-prompt worktree orchestration and dedicated `req-references` direct reference-file commit orchestration using runtime project and git paths.
|
|
48
48
|
- **PRJ-005**: MUST install bundled prompts, git execution instructions, documentation templates, and guidelines under the extension installation path and expose them through shared runtime path context.
|
|
49
49
|
- **PRJ-006**: MUST expose a standalone debug surface that inventories extension commands and tools, replays handlers offline, captures registration and UI metadata, provides a bash wrapper, and optionally compares the contract against the official pi SDK runtime.
|
|
50
50
|
- **PRJ-007**: MUST intercept pi CLI lifecycle hooks to maintain context telemetry, prompt workflow state, session timing, and selected debug logging for prompt orchestration and tool execution.
|
|
51
|
+
- **PRJ-008**: MUST expose a dedicated `req-reset` slash command for non-agentic prompt-orchestration recovery, base-path session restoration, and force cleanup of generated worktrees plus branches.
|
|
51
52
|
|
|
52
53
|
### 2.2 Project Constraints
|
|
53
54
|
- **CTN-001**: MUST persist project configuration only at `<base-path>/.pi-usereq.json` with default `docs-dir=pi-usereq/docs`, `tests-dir=tests`, `src-dir=["src"]`, `AUTO_GIT_COMMIT=enable`, `GIT_WORKTREE_ENABLED=enable`, and `GIT_WORKTREE_PREFIX=PI-useReq-`.
|
|
@@ -72,11 +73,13 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
72
73
|
|
|
73
74
|
### 3.1 Design and Implementation
|
|
74
75
|
- **DES-001**: MUST implement the standalone executable in `src/cli.ts` as flag parsing plus dispatch to `tool-runner.ts` or `runStaticCheck`.
|
|
75
|
-
- **DES-002**: MUST implement extension activation in `src/index.ts` by registering prompt commands
|
|
76
|
+
- **DES-002**: MUST implement extension activation in `src/index.ts` by registering bundled prompt commands, dedicated `req-references` command orchestration, agent tools, config commands, and shared pi CLI lifecycle-hook wrappers.
|
|
76
77
|
- **DES-003**: MUST represent parsed source constructs as `SourceElement` instances produced by `SourceAnalyzer` and enriched with signatures, hierarchy, visibility, inheritance, body annotations, and Doxygen fields.
|
|
77
|
-
- **DES-012**: MUST implement prompt-command git validation and worktree lifecycle logic in `src/core/prompt-command-runtime.ts` without invoking extension custom-tool executors from `src/core/tool-runner.ts`.
|
|
78
|
+
- **DES-012**: MUST implement bundled prompt-command git validation and worktree lifecycle logic in `src/core/prompt-command-runtime.ts` without invoking extension custom-tool executors from `src/core/tool-runner.ts`.
|
|
79
|
+
- **DES-013**: MUST implement dedicated `req-references` git-validation, reference-write, staging, commit, and clean-repository verification logic in `src/core/req-references-command.ts` without starting an LLM session or creating a worktree.
|
|
80
|
+
- **DES-014**: MUST implement dedicated `req-reset` recovery and cleanup orchestration in `src/core/req-reset-command.ts`, reusing shared base-path restoration helpers without starting an LLM session or creating a worktree.
|
|
78
81
|
- **DES-004**: MUST implement modular static-check execution through debug-capable `StaticCheckBase` and user-facing `StaticCheckCommand`, selected by `dispatchStaticCheckForFile`.
|
|
79
|
-
- **DES-005**: MUST centralize project file collection, token
|
|
82
|
+
- **DES-005**: MUST centralize project file collection, token counting, summary generation, reference-file generation, compression, construct search, and static-check execution in `src/core/tool-runner.ts`.
|
|
80
83
|
- **DES-006**: MUST reuse shared markdown and text renderers for CLI and agent-tool compression plus construct-search outputs, preserving source-leading tabs in emitted excerpts instead of dedicated agent-tool JSON payload builders.
|
|
81
84
|
- **DES-007**: MUST implement the standalone debug surface in `scripts/debug-extension.ts`, `scripts/pi-usereq-debug.sh`, and `scripts/lib/` recording and SDK-probe modules without altering extension runtime control flow.
|
|
82
85
|
- **DES-008**: MUST wrap affected agent-tool executions as one monolithic content text block plus minimal execution-only details instead of mirrored structured JSON payloads.
|
|
@@ -89,12 +92,18 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
89
92
|
- **REQ-002**: MUST replace `%%DOC_PATH%%`, `%%GUIDELINES_*%%`, `%%TEMPLATE_PATH%%`, `%%SRC_PATHS%%`, and `%%TEST_PATH%%` when rendering prompts.
|
|
90
93
|
- **REQ-266**: MUST replace `%%PROJECT_BASE%%`, `%%CONTEXT_PATH%%`, `%%INSTALLATION_PATH%%`, `%%CONFIG_PATH%%`, and `%%ARGS%%` when rendering prompts.
|
|
91
94
|
- **REQ-003**: MUST rewrite legacy `req --...` prompt text references to surviving internal tool names and slash-command-owned runtime behaviors.
|
|
92
|
-
- **REQ-004**: MUST register `req-<prompt>` commands
|
|
95
|
+
- **REQ-004**: MUST register bundled prompt-backed `req-<prompt>` commands using the first Markdown `# ` heading as description, run prompt preflight/worktree orchestration, and send rendered prompt content as a user message.
|
|
96
|
+
- **REQ-298**: MUST register `req-references` as a dedicated extension command with description `Write a REFERENCES.md using the project's source code` and MUST NOT depend on a bundled prompt Markdown file.
|
|
93
97
|
- **REQ-211**: MUST replace `%%PROMPT%%` with the current prompt name without the `req-` prefix when rendering bundled prompts and bundled commit instructions.
|
|
94
98
|
- **REQ-213**: MUST replace prompt token `%%COMMIT%%` with rendered `<installation-path>/resources/instructions/git_commit.md` when `AUTO_GIT_COMMIT=enable`, and with rendered `<installation-path>/resources/instructions/git_read-only.md` when `AUTO_GIT_COMMIT=disable`.
|
|
95
99
|
- **REQ-214**: MUST preprocess bundled `git_commit.md` and `git_read-only.md` with the same runtime token-replacement rules used for prompts before injecting them through `%%COMMIT%%`.
|
|
96
|
-
- **REQ-005**: MUST expose `files-tokens`, `files-
|
|
97
|
-
- **REQ-044**: MUST expose `references`, `compress`, `search`, `tokens`, `files-static-check`, and `static-check` only through agent-tool registration.
|
|
100
|
+
- **REQ-005**: MUST expose `files-tokens`, `files-summarize`, `files-compress`, and `files-search` only through agent-tool registration.
|
|
101
|
+
- **REQ-044**: MUST expose `summarize`, `references`, `compress`, `search`, `tokens`, `files-static-check`, and `static-check` only through agent-tool registration.
|
|
102
|
+
- **REQ-293**: MUST make `references` scan configured `src-dir` files, generate the same file-structure-plus-summary markdown as `summarize`, and overwrite `<base-path>/<docs-dir>/REFERENCES.md`.
|
|
103
|
+
- **REQ-294**: MUST make `references` return `success` through `content[0].text` after `REFERENCES.md` is overwritten and MUST NOT return generated reference markdown to the LLM.
|
|
104
|
+
- **REQ-295**: MUST make `references` return `error: <diagnostic>` through `content[0].text` when source discovery, markdown generation, or `REFERENCES.md` writing fails.
|
|
105
|
+
- **REQ-296**: MUST preserve `references` `details` as `execution` metadata only, with numeric `code` and optional normalized residual diagnostics.
|
|
106
|
+
- **REQ-297**: MUST register `references` with machine-oriented descriptions describing configured `src-dir` plus `docs-dir` scope, overwrite behavior, status-only text contract, and stable failure conditions.
|
|
98
107
|
- **REQ-046**: MUST implement a recording extension API supporting `registerCommand`, `registerTool`, `on`, `getAllTools`, `getActiveTools`, `setActiveTools`, and `sendUserMessage`, and preserve stable registration order in serialized snapshots.
|
|
99
108
|
- **REQ-047**: MUST implement a recording command context UI supporting `select`, `input`, `notify`, `setStatus`, and `setEditorText`, and serialize queued inputs plus emitted UI side effects.
|
|
100
109
|
- **REQ-048**: MUST load the target extension via its default export, invoke it as a black box, and execute offline replays only through registered `session_start`, command, and tool handlers.
|
|
@@ -125,7 +134,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
125
134
|
- **REQ-242**: MUST derive per-tool debug rows from `PI_USEREQ_CUSTOM_TOOL_NAMES` and `PI_USEREQ_EMBEDDED_TOOL_NAMES`.
|
|
126
135
|
- **REQ-243**: MUST derive per-prompt debug rows from `PROMPT_COMMAND_NAMES` as `req-*` names.
|
|
127
136
|
- **REQ-244**: MUST append one JSON entry to `DEBUG_LOG_FILE` for each selected custom or embedded tool execution, including tool name, workflow state, input, result, and error flag.
|
|
128
|
-
- **REQ-245**: MUST append JSON debug entries from selected `req-*` commands for required-doc checks, worktree creation,
|
|
137
|
+
- **REQ-245**: MUST append JSON debug entries from selected `req-*` commands for required-doc checks, worktree creation, merge finalization, worktree deletion, and workflow events when `DEBUG_WORKFLOW_EVENTS=enable`.
|
|
129
138
|
- **REQ-255**: MUST append `workflow_state` debug entries for every actual prompt-orchestration state transition only when `DEBUG_STATUS_CHANGES=enable`.
|
|
130
139
|
- **REQ-276**: MUST complete orchestrated session closure when pi lifecycle events expose non-command contexts without `switchSession()`, while keeping the client attached to the original `base-path` session.
|
|
131
140
|
- **REQ-278**: MUST preserve the in-memory prompt workflow state plus pending or active prompt request across switch-triggered `session_shutdown` events until the initiating handler or replacement-session lifecycle hooks complete prompt orchestration.
|
|
@@ -139,10 +148,10 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
139
148
|
- **REQ-231**: MUST order non-`files-*` custom-tool toggles alphabetically, append `files-*` custom-tool toggles alphabetically, and place default-disabled custom-tool toggles after default-enabled custom-tool toggles inside each custom subgroup.
|
|
140
149
|
- **REQ-232**: MUST order embedded-tool toggles alphabetically and place default-disabled embedded-tool toggles after default-enabled embedded-tool toggles.
|
|
141
150
|
- **REQ-063**: MUST derive configurable embedded pi CLI tools from runtime builtin tools named `read`, `bash`, `edit`, `write`, `find`, `grep`, and `ls`.
|
|
142
|
-
- **REQ-064**: MUST default `files-tokens`, `files-
|
|
151
|
+
- **REQ-064**: MUST default `files-tokens`, `files-summarize`, `files-compress`, `files-search`, `summarize`, `references`, `compress`, `search`, `tokens`, `files-static-check`, `static-check`, plus embedded `read`, `bash`, `edit`, and `write` to enabled.
|
|
143
152
|
- **REQ-066**: MUST omit `reset-context` and `context-reset` fields from persisted project configuration.
|
|
144
|
-
- **REQ-067**: MUST send every
|
|
145
|
-
- **REQ-068**: MUST use one prompt-delivery path that sends
|
|
153
|
+
- **REQ-067**: MUST send every bundled prompt-backed `req-<prompt>` payload into the current active session.
|
|
154
|
+
- **REQ-068**: MUST use one prompt-delivery path that sends bundled prompt-backed `req-<prompt>` payloads through the forked execution session by using only the replacement-session context for post-switch session-bound operations.
|
|
146
155
|
- **REQ-008**: MUST provide a `Language static code checkers` submenu that adds Command entries by guided language flow, removes configured language entries, toggles per-language enablement, and resets the static-check configuration.
|
|
147
156
|
- **REQ-160**: MUST hardcode `Command` as the only user-configurable static-check module and omit module-selection UI from static-check configuration menus.
|
|
148
157
|
- **REQ-161**: MUST hide `Dummy` from user-configurable static-check menus while preserving existing-config parsing and debug-driver support for `Dummy` entries.
|
|
@@ -170,14 +179,17 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
170
179
|
- **REQ-123**: MUST render `elapsed` immediately after `context` as `⏱︎ <active> ⚑ <last> ⌛︎<total>`.
|
|
171
180
|
- **REQ-124**: MUST render `⏱︎ --:--` when no prompt is active, and `⚑ --:--` plus `⌛︎--:--` until the corresponding timers receive a normally completed prompt duration.
|
|
172
181
|
- **REQ-125**: MUST render timed `elapsed` segments as `M:SS`, keep minutes unbounded above 59, zero-pad seconds to two digits, and preserve `⚑` plus `⌛︎` when escape-triggered cancellation ends the active run.
|
|
173
|
-
- **REQ-126**: MUST render `context` gauge icons
|
|
182
|
+
- **REQ-126**: MUST render `context` gauge icons below 90 percent with the same non-error theme token used by `status`, and theme `error` at 90 percent or above.
|
|
174
183
|
- **REQ-127**: MUST render `context` as non-blinking theme `error` `▕█▏` when normalized usage is `>=90-<100` percent.
|
|
175
184
|
- **REQ-233**: MUST render `context` as blinking theme `error` `▕█▏` when normalized usage is `>=100` percent and terminal blink control is supported.
|
|
176
185
|
- **REQ-128**: MUST render `context` as theme `error` `▕█▏` when normalized usage is `>=100` percent and terminal blink control is unavailable.
|
|
177
|
-
- **REQ-131**: MUST persist a sound level with allowed values `none`, `low`, `mid`, and `high`, defaulting to `none`.
|
|
178
|
-
- **REQ-132**: MUST execute the configured sound command when the corresponding prompt-end sound event toggle is enabled and the sound level is not `none`.
|
|
186
|
+
- **REQ-131**: MUST persist a boot sound level with allowed values `none`, `low`, `mid`, and `high`, defaulting to `none`.
|
|
187
|
+
- **REQ-132**: MUST execute the configured sound command when the corresponding prompt-end sound event toggle is enabled and the active runtime sound level is not `none`.
|
|
179
188
|
- **REQ-133**: MUST persist configurable shell-command strings for sound levels `low`, `mid`, and `high`, and MUST substitute `%%INSTALLATION_PATH%%` with the runtime extension installation path before execution.
|
|
180
|
-
- **REQ-134**: MUST persist a configurable sound-level toggle shortcut, defaulting to `alt+s
|
|
189
|
+
- **REQ-134**: MUST persist a configurable sound-level toggle shortcut, defaulting to `alt+s`.
|
|
190
|
+
- **REQ-285**: MUST load the active runtime sound level from persisted `notify-sound` during `session_start`.
|
|
191
|
+
- **REQ-286**: MUST cycle only the active runtime sound level when the configured shortcut fires.
|
|
192
|
+
- **REQ-287**: MUST NOT update `.pi-usereq.json` when the configured shortcut fires.
|
|
181
193
|
- **REQ-137**: MUST make the `Notifications` menu render contiguous command-notify, sound, and Pushover configuration blocks in that order.
|
|
182
194
|
- **REQ-163**: MUST persist a global Pushover enable flag defaulting to disabled.
|
|
183
195
|
- **REQ-164**: MUST expose a `Pushover events` submenu and MUST keep non-event Pushover settings directly in `Notifications`.
|
|
@@ -193,10 +205,12 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
193
205
|
- **REQ-175**: MUST persist `PI_NOTIFY_CMD` defaulting to `notify-send -i %%INSTALLATION_PATH%%/resources/images/pi.dev.png -a "PI-useReq" "%%PROMT%% @ %%BASE%% [%%TIME%%]" "%%RESULT%%"`.
|
|
194
206
|
- **REQ-176**: MUST implement command-notify exclusively by executing `PI_NOTIFY_CMD` when command-notify is globally enabled and the corresponding prompt-end notify event toggle is enabled.
|
|
195
207
|
- **REQ-178**: MUST persist sound event toggles in keys `notify-sound-on-completed`, `notify-sound-on-interrupted`, and `notify-sound-on-failed`, defaulting to completed enabled and interrupted plus failed disabled.
|
|
196
|
-
- **REQ-179**: MUST label sound rows as `Enable sound` and `Sound command (low vol.)`, `Sound command (mid vol.)`, and `Sound command (high vol.)`.
|
|
197
|
-
- **REQ-180**: MUST render `sound` immediately after `elapsed`, showing
|
|
208
|
+
- **REQ-179**: MUST label sound rows as `Enable sound (boot value)` and `Sound command (low vol.)`, `Sound command (mid vol.)`, and `Sound command (high vol.)`.
|
|
209
|
+
- **REQ-180**: MUST render `sound` immediately after `elapsed`, showing the active runtime sound level as `none`, `low`, `mid`, or `high`.
|
|
198
210
|
- **REQ-181**: MUST make the `Notifications` menu expose `Enable notification`, `Notification events`, and `Notify command` before sound rows.
|
|
199
|
-
- **REQ-183**: MUST make the `Notifications` menu expose `Sound events` immediately after `Enable sound` and before sound hotkey plus command rows.
|
|
211
|
+
- **REQ-183**: MUST make the `Notifications` menu expose `Sound events` immediately after `Enable sound (boot value)` and before sound hotkey plus command rows.
|
|
212
|
+
- **REQ-288**: MUST persist menu-selected `notify-sound` changes to `.pi-usereq.json` without changing the active runtime sound level.
|
|
213
|
+
- **REQ-289**: MUST render configuration-menu sound values from persisted `notify-sound`, even when the active runtime sound level differs.
|
|
200
214
|
- **REQ-184**: MUST persist Pushover event toggles in keys `notify-pushover-on-completed`, `notify-pushover-on-interrupted`, and `notify-pushover-on-failed`, defaulting to completed enabled and interrupted plus failed disabled.
|
|
201
215
|
- **REQ-185**: MUST persist `Pushover title` defaulting to `%%PROMT%% @ %%BASE%% [%%TIME%%]` and `Pushover text` defaulting to `%%RESULT%%\n%%ARGS%%`.
|
|
202
216
|
- **REQ-186**: MUST substitute `%%PROMT%%`, `%%BASE%%`, `%%TIME%%`, `%%ARGS%%`, and `%%RESULT%%` at runtime inside `Pushover title` and `Pushover text`.
|
|
@@ -212,29 +226,47 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
212
226
|
- **REQ-197**: MUST summarize top-level `Notifications` as `notification:<state> • sound:<level> • pushover:<state>`.
|
|
213
227
|
- **REQ-198**: MUST render `Notification events`, `Sound events`, and `Pushover events` as identical submenu lists with right-aligned `on|off` values for `Prompt completed`, `Prompt interrupted`, and `Prompt failed`.
|
|
214
228
|
- **REQ-199**: MUST render `%%RESULT%%` as `successed`, `aborted`, or `failed` for completed, interrupted, and failed prompt-end outcomes.
|
|
215
|
-
- **REQ-200**: MUST run slash-command-owned git validation immediately after the `idle` gate at the start of every `req
|
|
229
|
+
- **REQ-200**: MUST run slash-command-owned git validation immediately after the `idle` gate at the start of every `req-*` slash command except `req-reset` and abort before command execution on failure.
|
|
216
230
|
- **REQ-201**: MUST require `REQUIREMENTS.md`, `WORKFLOW.md`, and `REFERENCES.md` before `analyze`, `change`, `check`, `cover`, `fix`, `flowchart`, `new`, `readme`, `recreate`, `refactor`, and `renumber`.
|
|
217
|
-
- **REQ-202**: MUST require `REQUIREMENTS.md` before `implement
|
|
218
|
-
- **REQ-203**: MUST abort a `req-<prompt>` command before worktree creation and prompt dispatch when any prompt-required doc is missing
|
|
231
|
+
- **REQ-202**: MUST require `REQUIREMENTS.md` before `implement`, and MUST skip required-doc prechecks for `create`, `references`, `workflow`, and `write`.
|
|
232
|
+
- **REQ-203**: MUST abort a bundled prompt-backed `req-<prompt>` command before worktree creation and prompt dispatch when any prompt-required doc is missing, surfacing the missing canonical path plus remediation prompt command.
|
|
219
233
|
- **REQ-212**: MUST persist `AUTO_GIT_COMMIT` with allowed values `enable` and `disable`, defaulting to `enable`.
|
|
220
234
|
- **REQ-204**: MUST persist `GIT_WORKTREE_ENABLED` with allowed values `enable` and `disable`, defaulting to `enable`.
|
|
221
235
|
- **REQ-205**: MUST persist `GIT_WORKTREE_PREFIX` as the configurable prefix used by `worktree-dir` generation, defaulting to `PI-useReq-`.
|
|
222
236
|
- **REQ-215**: MUST force the effective `GIT_WORKTREE_ENABLED` value to `disable` whenever `AUTO_GIT_COMMIT=disable`.
|
|
223
237
|
- **REQ-216**: MUST render `Git worktree` and `Worktree prefix` as dimmed non-editable rows whenever `AUTO_GIT_COMMIT=disable`.
|
|
224
238
|
- **REQ-206**: MUST derive `worktree-dir` as `<prefix><project>-<sanitized-branch>-<YYYYMMDDHHMMSS>` and `worktree-path` as `<parent-path>/<worktree-dir>/<base-dir>` when worktrees are enabled.
|
|
225
|
-
- **REQ-271**: MUST create one dedicated worktree under `parent-path`, fork the current active session
|
|
239
|
+
- **REQ-271**: MUST make bundled prompt-backed `req-<prompt>` commands create one dedicated worktree under `parent-path`, fork the current active session, and switch the active pi CLI session before agent start.
|
|
226
240
|
- **REQ-207**: MUST keep `context-path`, `ctx.cwd`, and `process.cwd()` at `base-path` when worktree creation is disabled.
|
|
227
|
-
- **REQ-208**: MUST restore the original session-backed `base-path`,
|
|
241
|
+
- **REQ-208**: MUST restore the original session-backed `base-path`, merge the successful worktree branch from `base-path`, and delete the worktree plus branch after successful closure.
|
|
242
|
+
- **REQ-290**: MUST preserve the successful worktree execution transcript in the restored client-visible session after successful closure.
|
|
243
|
+
- **REQ-291**: MUST detect staged or unstaged `base-path` changes before successful closure merge and execute `git stash`, merge, and `git stash pop` in that order when changes exist.
|
|
244
|
+
- **REQ-292**: MUST complete successful stash-assisted closure without surfacing an error and MUST emit a warning that the restored `base-path` is not clean after merge.
|
|
228
245
|
- **REQ-209**: MUST restore the original session-backed `base-path`, notify the pi CLI of closure failure, and retain the worktree plus branch when orchestrated session closure is interrupted, failed, aborted, or incomplete.
|
|
229
246
|
- **REQ-221**: MUST maintain one prompt-orchestration state machine with states `idle`, `checking`, `running`, `merging`, and `error`.
|
|
230
247
|
- **REQ-222**: MUST render `status` as the first single-line status field and refresh it on every internal or pi CLI state transition.
|
|
231
248
|
- **REQ-223**: MUST render `status:error` with theme `error` plus terminal blink when supported, and other `status` values with the existing non-error status-bar convention.
|
|
232
|
-
- **REQ-224**: MUST reject
|
|
233
|
-
- **REQ-225**: MUST transition workflow state to `checking` after the `idle` gate and keep it there through required-doc checks, worktree
|
|
234
|
-
- **REQ-226**: MUST transition workflow state to `error` when required-doc checks or worktree creation fails during `req-<prompt>` preflight.
|
|
235
|
-
- **REQ-227**: MUST transition workflow state to `running` only after required-doc checks, worktree
|
|
249
|
+
- **REQ-224**: MUST reject every `req-*` slash command except `req-reset` before any operation when workflow state is not `idle`, surface the error to pi CLI, and transition workflow state to `error`.
|
|
250
|
+
- **REQ-225**: MUST make bundled prompt-backed `req-<prompt>` commands transition workflow state to `checking` after the `idle` gate and keep it there through required-doc checks, worktree preparation, and prompt handoff preparation.
|
|
251
|
+
- **REQ-226**: MUST transition workflow state to `error` when required-doc checks or worktree creation fails during bundled prompt-backed `req-<prompt>` preflight.
|
|
252
|
+
- **REQ-227**: MUST make bundled prompt-backed `req-<prompt>` commands transition workflow state to `running` only after required-doc checks, worktree preparation, worktree verification, and prompt-session handoff succeed.
|
|
253
|
+
- **REQ-299**: MUST make `req-references`, after passing the shared `idle` gate, transition workflow state to `checking`, validate slash-command-owned git state, and transition directly to `running` without worktree creation, session switching, or LLM-session initialization.
|
|
254
|
+
- **REQ-300**: MUST make `req-references` execute the same reference-generation and overwrite logic as `references`, writing configured-source reference markdown to `<base-path>/<docs-dir>/REFERENCES.md`.
|
|
255
|
+
- **REQ-301**: MUST make `req-references` stage only updated `<docs-dir>/REFERENCES.md` and create one git commit with exact message `docs(references): Update REFERENCES.md document. [useReq]`.
|
|
256
|
+
- **REQ-302**: MUST make successful `req-references` completion verify repository cleanliness, notify pi CLI success, and transition workflow state to `idle` before the command handler returns.
|
|
257
|
+
- **REQ-303**: MUST make failing `req-references` execution notify pi CLI, transition workflow state to `error`, and surface git or reference-generation failures without LLM-session initialization.
|
|
258
|
+
- **REQ-304**: MUST register `req-reset` as a dedicated extension command with description `Reset req workflow state, restore base-path, and remove generated worktrees` and MUST NOT depend on a bundled prompt Markdown file.
|
|
259
|
+
- **REQ-305**: MUST make `req-reset` execute without prompt dispatch, LLM-session initialization, or worktree creation.
|
|
260
|
+
- **REQ-306**: MUST allow `req-reset` invocation from any current workflow state and MUST NOT reject it when workflow state is not `idle`.
|
|
261
|
+
- **REQ-307**: MUST make `req-reset` preserve the visible execution transcript while restoring the original session-backed `base-path`.
|
|
262
|
+
- **REQ-308**: MUST make `req-reset` restore the original session-backed `base-path` when persisted prompt-orchestration state targets a worktree-backed execution session.
|
|
263
|
+
- **REQ-309**: MUST make `req-reset` force-remove every sibling worktree under `parent-path` whose name matches `<prefix><project>-<sanitized-branch>-<YYYYMMDDHHMMSS>`.
|
|
264
|
+
- **REQ-310**: MUST make `req-reset` force-remove every local branch under `git-path` whose name matches `<prefix><project>-<sanitized-branch>-<YYYYMMDDHHMMSS>`.
|
|
265
|
+
- **REQ-311**: MUST derive `req-reset` cleanup matchers from the same prefix, project, and branch-sanitization rules used by prompt-command worktree generation.
|
|
266
|
+
- **REQ-312**: MUST make successful `req-reset` clear persisted prompt-orchestration state, transition workflow state to `idle`, and notify pi success after cleanup completes.
|
|
267
|
+
- **REQ-313**: MUST make failing `req-reset` surface restoration or cleanup failures, transition workflow state to `error`, and preserve already-completed cleanup effects.
|
|
236
268
|
- **REQ-228**: MUST transition workflow state to `merging` immediately before merge and worktree/branch deletion begin during successful orchestrated session closure.
|
|
237
|
-
- **REQ-229**: MUST transition workflow state to `error` and notify the pi CLI when base-path restoration,
|
|
269
|
+
- **REQ-229**: MUST transition workflow state to `error` and notify the pi CLI when base-path restoration, merge, or worktree/branch deletion verification fails during orchestrated session closure.
|
|
238
270
|
- **REQ-230**: MUST transition workflow state to `idle` before the orchestrated session-closure handler returns.
|
|
239
271
|
- **REQ-219**: MUST verify created worktree registration via `git worktree list`, branch presence via `git branch` list, and filesystem path existence before changing the prompt execution path or dispatching a prompt message.
|
|
240
272
|
- **REQ-256**: MUST store `base-path`, `context-path`, `git-path`, `parent-path`, `base-dir`, `worktree-dir`, `worktree-path`, branch name, original session file, and execution session file inside prompt-orchestration runtime state.
|
|
@@ -247,10 +279,10 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
247
279
|
- **REQ-217**: MUST reset `⚑` plus `⌛︎` only during `session_start` with reason `startup` or `reload`.
|
|
248
280
|
- **REQ-173**: MUST optimize every affected agent-tool response by reusing Python-compatible monolithic renderer structure, preserving source-leading tabs in source-derived text, and omitting mirrored JSON bodies, duplicate facts, and caller-known request echoes.
|
|
249
281
|
- **REQ-010**: MUST count tokens with `js-tiktoken` `cl100k_base`, count characters and lines, and make `files-tokens` return the Python-compatible pack-summary text through `content[0].text`.
|
|
250
|
-
- **REQ-011**: MUST make `files-
|
|
282
|
+
- **REQ-011**: MUST make `files-summarize` analyze supported source files and return the Python-compatible summary markdown through `content[0].text`.
|
|
251
283
|
- **REQ-012**: MUST compress supported source files by removing comments and blank lines, preserving full indentation for Python, Haskell, and Elixir, preserving leading-tab indentation for other languages, and optionally preserving original line numbers.
|
|
252
284
|
- **REQ-013**: MUST search explicit files by tag filter and name regex, then return Python-compatible markdown matches with signatures, line ranges, Doxygen bullets, and stripped code excerpts.
|
|
253
|
-
- **REQ-014**: MUST make `
|
|
285
|
+
- **REQ-014**: MUST make `summarize` scan configured `src-dir` files and return the Python-compatible file-structure-plus-summary markdown through `content[0].text`.
|
|
254
286
|
- **REQ-015**: MUST make CLI project-scope compression scan configured `src-dir` files and emit Python-compatible compressed markdown blocks for every supported file.
|
|
255
287
|
- **REQ-016**: MUST make `find` scan configured `src-dir` files using the requested tag filter and regular expression, then emit Python-compatible markdown matches.
|
|
256
288
|
- **REQ-017**: MUST make `tokens` count only existing canonical docs `REQUIREMENTS.md`, `WORKFLOW.md`, and `REFERENCES.md`, reuse the `files-tokens` pack-summary text contract, and fail when none exist.
|
|
@@ -261,11 +293,11 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
261
293
|
- **REQ-073**: MUST omit caller-known request echoes, mirrored file tables, and duplicate metrics from `files-tokens` and `tokens` runtime payloads.
|
|
262
294
|
- **REQ-074**: MUST reserve `files-tokens` and `tokens` `details` for execution metadata and MUST NOT mirror content text or derived guidance there.
|
|
263
295
|
- **REQ-075**: MUST surface `files-tokens` and `tokens` skip or read-error observations through `details.execution` diagnostics instead of structured runtime file entries.
|
|
264
|
-
- **REQ-076**: MUST make `files-
|
|
265
|
-
- **REQ-077**: MUST keep `files-
|
|
266
|
-
- **REQ-078**: MUST prepend project-scope `
|
|
267
|
-
- **REQ-079**: MUST omit mirrored JSON structures and request echoes from `files-
|
|
268
|
-
- **REQ-080**: MUST register `files-
|
|
296
|
+
- **REQ-076**: MUST make `files-summarize` and `summarize` pass exactly one monolithic markdown document to the LLM through `content[0].text`.
|
|
297
|
+
- **REQ-077**: MUST keep `files-summarize` markdown aligned to the Python summary renderer in section ordering and non-source formatting while preserving leading tabs in source-derived lines.
|
|
298
|
+
- **REQ-078**: MUST prepend project-scope `summarize` output with the file-structure markdown block before the per-file summary markdown.
|
|
299
|
+
- **REQ-079**: MUST omit mirrored JSON structures and request echoes from `files-summarize` and `summarize` runtime payloads.
|
|
300
|
+
- **REQ-080**: MUST register `files-summarize` and `summarize` with machine-oriented descriptions describing scope, monolithic markdown contract, and stable failure conditions.
|
|
269
301
|
- **REQ-081**: MUST make `files-compress` and `compress` pass exactly one monolithic markdown document to the LLM through `content[0].text`.
|
|
270
302
|
- **REQ-082**: MUST keep `files-compress` and `compress` content aligned to the Python compression renderer in headers, line-range metadata, code fences, and file ordering while preserving leading tabs in retained source lines.
|
|
271
303
|
- **REQ-083**: MUST make `enableLineNumbers` for `files-compress` and `compress` toggle original source line prefixes inside emitted fenced code blocks without changing header or line-range formatting.
|
|
@@ -316,12 +348,12 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
316
348
|
- **REQ-253**: MUST set `static-check.<language>.enabled=enable` whenever guided or CLI `--enable-static-check` entry creation targets that language.
|
|
317
349
|
- **REQ-036**: MUST preserve existing `static-check` entries, append non-duplicate `--enable-static-check` entries in argument order, and treat canonical language, module, cmd, and params as the duplicate identity.
|
|
318
350
|
- **REQ-037**: MUST reject `--enable-static-check` `Command` entries whose executable is unavailable on `PATH` and MUST NOT modify persisted project configuration when validation fails.
|
|
319
|
-
- **REQ-038**: MUST honor `--verbose` only for `files-
|
|
351
|
+
- **REQ-038**: MUST honor `--verbose` only for `files-summarize`, `files-compress`, `files-find`, `summarize`, `compress`, and `find`, emitting command progress to stderr while leaving stdout payload format unchanged.
|
|
320
352
|
- **REQ-039**: MUST support `--enable-line-numbers` only for `files-compress`, `compress`, `files-find`, and `find`, and MUST leave corresponding outputs unnumbered when the flag is absent.
|
|
321
353
|
- **REQ-040**: MUST store canonical expected CLI result fixtures as UTF-8 text files under `tests/fixtures_attended_results/`, preserving normalized exit code, stdout, and stderr for each archived scenario.
|
|
322
354
|
- **REQ-041**: MUST canonicalize environment-dependent path and timestamp segments in archived and observed CLI results with stable placeholder tokens before exact comparison.
|
|
323
|
-
- **REQ-042**: MUST archive explicit-file scenarios for `files-tokens`, `files-
|
|
324
|
-
- **REQ-043**: MUST archive repository scenarios for `
|
|
355
|
+
- **REQ-042**: MUST archive explicit-file scenarios for `files-tokens`, `files-summarize`, `files-compress`, `files-find`, and `test-static-check` across every file under `tests/fixtures/`.
|
|
356
|
+
- **REQ-043**: MUST archive repository scenarios for `summarize`, `compress`, `find`, `tokens`, `enable-static-check`, `files-static-check`, and `static-check`.
|
|
325
357
|
- **REQ-138**: MUST make `.github/workflows/release-npm.yml` trigger release automation from pushed tags matched by the existing workflow filter `v[0-9]+.[0-9]+.[0-9]+`.
|
|
326
358
|
- **REQ-139**: MUST skip downstream release work unless `check-branch` confirms the tagged commit is contained in `origin/master`.
|
|
327
359
|
- **REQ-140**: MUST configure Node.js plus npm registry authentication, run `npm ci`, remove manifest `private`, and publish with provenance and public access using `secrets.NPM_TOKEN`.
|
|
@@ -334,7 +366,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
334
366
|
- **REQ-144**: MUST default `PI_NOTIFY_SOUND_HIGH_CMD` to `paplay --volume=65535 %%INSTALLATION_PATH%%/resources/sounds/Soft-high-tech-notification-sound-effect.mp3`.
|
|
335
367
|
- **REQ-145**: MUST derive static `git-path` during bootstrap from `base-path` and repository ancestry rules, ignoring project-configuration JSON values.
|
|
336
368
|
- **REQ-146**: MUST NOT read or persist `base-path` or `git-path` in project-configuration JSON.
|
|
337
|
-
- **REQ-149**: MUST label notification settings actions as `Notify command`, `Enable sound`, `Sound toggle hotkey bind`, `Sound command (low|mid|high vol.)`, `Pushover User Key/Delivery Group Key`, and `Pushover Token/API Token Key`.
|
|
369
|
+
- **REQ-149**: MUST label notification settings actions as `Notify command`, `Enable sound (boot value)`, `Sound toggle hotkey bind`, `Sound command (low|mid|high vol.)`, `Pushover User Key/Delivery Group Key`, and `Pushover Token/API Token Key`.
|
|
338
370
|
- **REQ-150**: MUST omit overview rows and reference-only actions from the main, notification, startup-tool, and static-check configuration menus.
|
|
339
371
|
- **REQ-151**: MUST render `pi-usereq`, notification, static-check, and startup-tool menus with left-aligned labels and right-aligned current values using the active CLI settings-list theme semantics.
|
|
340
372
|
- **REQ-156**: MUST restrict extension-owned status and settings rendering to CLI-supported theme APIs and documented theme tokens.
|
|
@@ -346,8 +378,8 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
346
378
|
- **TST-001**: MUST verify extension activation registers every documented prompt command, agent tool, and configuration command while omitting tool-name slash commands, `test-static-check`, and the removed standalone config-viewer command.
|
|
347
379
|
- **TST-002**: MUST verify installed bundled prompt, commit-instruction, template, and guideline resources remain readable from `installation-path`.
|
|
348
380
|
- **TST-060**: MUST verify prompt rendering replaces `%%PROMPT%%` and expands `%%COMMIT%%` from rendered `git_commit.md` or `git_read-only.md` according to `AUTO_GIT_COMMIT`.
|
|
349
|
-
- **TST-003**: MUST verify standalone `files-tokens` outputs match the Python oracle, `--test-static-check` dummy or command outputs match archived fixtures, and `files-
|
|
350
|
-
- **TST-004**: MUST verify project `tokens` outputs match the Python oracle, verify `files-static-check` plus `static-check` against archived fixtures, and verify `
|
|
381
|
+
- **TST-003**: MUST verify standalone `files-tokens` outputs match the Python oracle, `--test-static-check` dummy or command outputs match archived fixtures, and `files-summarize`, `files-compress`, plus `files-find` preserve leading source tabs.
|
|
382
|
+
- **TST-004**: MUST verify project `tokens` outputs match the Python oracle, verify `files-static-check` plus `static-check` against archived fixtures, and verify `summarize`, `compress`, plus `find` preserve leading source tabs.
|
|
351
383
|
- **TST-005**: MUST verify the configuration menu saves `docs-dir`, `AUTO_GIT_COMMIT`, `GIT_WORKTREE_ENABLED`, and `GIT_WORKTREE_PREFIX` immediately after each change, preserves toggle ordering, and omits prompt-delivery controls plus `Save and close`.
|
|
352
384
|
- **TST-084**: MUST verify configuration persistence trims trailing `/` and keeps `docs-dir`, `tests-dir`, and `src-dir` relative.
|
|
353
385
|
- **TST-046**: MUST verify `Language static code checkers` omits module selection, raw-spec actions, supported-language reference actions, and hides `Dummy`, `Pylance`, and `Ruff` from user-configurable actions.
|
|
@@ -358,8 +390,10 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
358
390
|
- **TST-031**: MUST verify the status bar renders `status` before `branch`, omits `current-path`, `base`, `docs`, `src`, `tests`, `git`, and `tools`, and preserves documented field-value theme separation.
|
|
359
391
|
- **TST-032**: MUST verify extension registration installs wrappers for all documented lifecycle hooks and routes replayed hook payloads through `updateExtensionStatus`.
|
|
360
392
|
- **TST-033**: MUST verify the status bar renders ordered `status`, `branch`, `context`, `elapsed`, and `sound` fields plus the documented icon-based `context` gauge thresholds.
|
|
361
|
-
- **TST-037**: MUST verify the `Notifications` menu persists notification and sound settings through `Notification events` and `Sound events` submenus using the documented labels, order, reset-confirmation flows, immediate-save behavior, and no `Save and close` rows.
|
|
362
|
-
- **TST-038**: MUST verify the sound-toggle shortcut cycles
|
|
393
|
+
- **TST-037**: MUST verify the `Notifications` menu persists notification and boot-sound settings through `Notification events` and `Sound events` submenus using the documented labels, order, reset-confirmation flows, immediate-save behavior, and no `Save and close` rows.
|
|
394
|
+
- **TST-038**: MUST verify the sound-toggle shortcut cycles only the active runtime sound level, leaves `.pi-usereq.json` unchanged, and refreshes the status bar with the updated `sound` field.
|
|
395
|
+
- **TST-097**: MUST verify `session_start` loads the active runtime sound level from persisted `notify-sound`.
|
|
396
|
+
- **TST-098**: MUST verify menu-selected boot sound changes persist to `.pi-usereq.json` without changing the active runtime sound level.
|
|
363
397
|
- **TST-047**: MUST verify the `Notifications` menu exposes `Pushover events` before direct Pushover settings, keeps `Enable pushover` dimmed and locked until both credential fields are non-empty, and persists Pushover event and credential values.
|
|
364
398
|
- **TST-072**: MUST verify `Pushover text` displays escaped control sequences in menus and decodes the documented escape sequences from input before persistence.
|
|
365
399
|
- **TST-048**: MUST verify native Pushover requests honor global enable, completed/interrupted/failed Pushover toggles, credentials, priority, title, and text placeholder substitution including `%%RESULT%%` for enabled prompt-end outcomes.
|
|
@@ -369,9 +403,9 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
369
403
|
- **TST-062**: MUST verify `Show configuration` saves pending config, closes the active configuration menu tree, and writes the persisted `.pi-usereq.json` file text into the editor.
|
|
370
404
|
- **TST-063**: MUST verify `⚑` plus `⌛︎` survive `session_start` reason `new` and reset on `session_start` reason `reload`.
|
|
371
405
|
- **TST-045**: MUST verify default configuration enables auto git commit, disables debug, notify, and Pushover globally, initializes sound to `none`, sets `DEBUG_LOG_FILE=/tmp/PI-useReq.json`, and persists the documented notify and Pushover templates.
|
|
372
|
-
- **TST-051**: MUST verify sound routing honors the
|
|
373
|
-
- **TST-035**: MUST verify unavailable or 0-percent context usage renders `▕_▏` with
|
|
374
|
-
- **TST-096**: MUST verify context usage `>0-<25`, `>=25-<50`, `>=50-<75`, and `>=75-<90` render `▕▂▏`, `▕▄▏`, `▕▆▏`, and `▕█▏`
|
|
406
|
+
- **TST-051**: MUST verify sound routing honors the active runtime sound state and completed/interrupted/failed sound toggles.
|
|
407
|
+
- **TST-035**: MUST verify unavailable or 0-percent context usage renders `▕_▏` with the same non-error theme token used by `status`.
|
|
408
|
+
- **TST-096**: MUST verify context usage `>0-<25`, `>=25-<50`, `>=50-<75`, and `>=75-<90` render `▕▂▏`, `▕▄▏`, `▕▆▏`, and `▕█▏` with the same non-error theme token used by `status`.
|
|
375
409
|
- **TST-036**: MUST verify context usage `>=90-<100` renders non-blinking error `▕█▏`, and `>=100` renders blinking error `▕█▏` or non-blinking error `▕█▏` when blink control is unavailable.
|
|
376
410
|
- **TST-095**: MUST verify status-bar `branch` resolves from current `context-path` git HEAD and refreshes across worktree switches plus base-path restoration.
|
|
377
411
|
- **TST-043**: MUST verify configuration menus reuse the active CLI settings-list theme semantics for labels, values, descriptions, cursor, and hints.
|
|
@@ -381,8 +415,8 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
381
415
|
- **TST-030**: MUST verify pi.dev-aware prompt rendering injects an explicit interface-contract mandate covering `docs/pi.dev/coding-agent-docs/` and documents referenced by `docs/pi.dev/agent-document-manifest.json`.
|
|
382
416
|
- **TST-087**: MUST verify pi.dev-aware prompt rendering requires `pi.dev-src/pi-mono` validation when manifest or `docs/pi.dev/coding-agent-docs/` guidance is ambiguous for extension-to-pi-client behavior.
|
|
383
417
|
- **TST-088**: MUST verify pi.dev-aware prompt rendering requires `pi.dev-src/pi-mono` validation for bug fixes or problem resolution influenced by extension-to-pi-client interface implementations.
|
|
384
|
-
- **TST-012**: MUST verify TypeScript CLI parity for standalone command-option regressions covering `--files-tokens`, `--files-
|
|
385
|
-
- **TST-013**: MUST verify TypeScript CLI parity for project-scoped command-option regressions covering `--
|
|
418
|
+
- **TST-012**: MUST verify TypeScript CLI parity for standalone command-option regressions covering `--files-tokens`, `--files-summarize`, `--files-compress`, `--files-find`, `--test-static-check`, `--enable-line-numbers`, `--enable-static-check`, and `--verbose`.
|
|
419
|
+
- **TST-013**: MUST verify TypeScript CLI parity for project-scoped command-option regressions covering `--summarize`, `--compress`, `--find`, `--tokens`, `--files-static-check`, and `--static-check`.
|
|
386
420
|
- **TST-014**: MUST maintain an executable mapping from each imported command-option regression case to one TypeScript test case identifier and fail verification when any mapped case is missing.
|
|
387
421
|
- **TST-015**: MUST verify archive-backed standalone CLI scenarios load expected results from `tests/fixtures_attended_results/standalone` and compare exact normalized exit code, stdout, and stderr for every file under `tests/fixtures/`.
|
|
388
422
|
- **TST-016**: MUST verify archive-backed repository CLI scenarios load expected results from `tests/fixtures_attended_results/project` and compare exact normalized exit code, stdout, and stderr for the archived command set.
|
|
@@ -391,8 +425,17 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
391
425
|
- **TST-019**: MUST verify offline harness command and tool replay invoke registered handlers, preserve requested cwd semantics, and capture prompt payloads, tool results, and UI side effects.
|
|
392
426
|
- **TST-020**: MUST verify SDK parity comparison reports aligned inventories as clean, reports requested mismatch categories, and `package.json` declares the `debug:ext*` harness scripts.
|
|
393
427
|
- **TST-021**: MUST verify `scripts/pi-usereq-debug.sh tool` forwards `--params` unchanged and converts `--args` text into the JSON object forwarded through `--params`.
|
|
394
|
-
- **TST-022**: MUST verify `files-
|
|
395
|
-
- **TST-023**: MUST verify harness inspection surfaces `files-
|
|
428
|
+
- **TST-022**: MUST verify `files-summarize` and `summarize` agent-tool outputs place monolithic summary markdown with preserved leading tabs in `content[0].text` and restrict `details` to execution metadata.
|
|
429
|
+
- **TST-023**: MUST verify harness inspection surfaces `files-summarize` and `summarize` descriptions covering scope, monolithic markdown output, and failure details.
|
|
430
|
+
- **TST-099**: MUST verify extension activation and tool menus include `references` with the documented agent-tool-only registration and default-enabled ordering.
|
|
431
|
+
- **TST-100**: MUST verify `references` overwrites configured `docs-dir`/`REFERENCES.md`, returns only `success` in `content[0].text`, and restricts `details` to execution metadata.
|
|
432
|
+
- **TST-101**: MUST verify `references` returns `error: <diagnostic>` plus failing execution metadata when source discovery, markdown generation, or `REFERENCES.md` writing fails.
|
|
433
|
+
- **TST-102**: MUST verify `req-references` registers outside the bundled prompt inventory and retains description `Write a REFERENCES.md using the project's source code`.
|
|
434
|
+
- **TST-103**: MUST verify successful `req-references` runs create no worktree or LLM message, overwrite configured `REFERENCES.md`, stage only that file, commit exact message, notify success, and restore workflow state `idle`.
|
|
435
|
+
- **TST-104**: MUST verify failing `req-references` runs transition workflow state to `error`, notify pi CLI, create no worktree or LLM message, and surface git or reference-generation failures.
|
|
436
|
+
- **TST-105**: MUST verify extension activation registers `req-reset` outside the bundled prompt inventory with its dedicated fixed description.
|
|
437
|
+
- **TST-106**: MUST verify successful `req-reset` accepts non-`idle` workflow state, preserves execution transcript, restores `base-path`, removes matching generated worktrees plus branches, and returns workflow state `idle` without LLM messages.
|
|
438
|
+
- **TST-107**: MUST verify failing `req-reset` surfaces restoration or cleanup failures, transitions workflow state to `error`, and starts no worktree or LLM session.
|
|
396
439
|
- **TST-024**: MUST verify `files-search` and `search` agent-tool outputs place monolithic search markdown with preserved leading tabs in `content[0].text` and restrict `details` to execution metadata.
|
|
397
440
|
- **TST-025**: MUST verify harness inspection surfaces `files-search` and `search` descriptions covering parameters, regex semantics, supported tags, monolithic markdown output, and failure details.
|
|
398
441
|
- **TST-026**: MUST verify `files-compress` and `compress` agent-tool outputs place monolithic compression markdown with preserved leading tabs in `content[0].text` and restrict `details` to execution metadata.
|
|
@@ -409,7 +452,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
409
452
|
- **TST-075**: MUST verify selected `req-*` debug toggles append JSON entries for required-doc checks, worktree creation, fast-forward merge, worktree deletion, `workflow_state`, and `DEBUG_WORKFLOW_EVENTS`-gated workflow events across successful and failing prompt runs.
|
|
410
453
|
- **TST-076**: MUST verify Debug submenu tool and prompt rows derive from `PI_USEREQ_CUSTOM_TOOL_NAMES`, `PI_USEREQ_EMBEDDED_TOOL_NAMES`, and `PROMPT_COMMAND_NAMES`.
|
|
411
454
|
- **TST-085**: MUST verify the `Debug` submenu orders `Log on status` before `Status changes` and preserves the documented immediate-save plus focus-preserving re-render behavior.
|
|
412
|
-
- **TST-080**: MUST verify each `req-*` command description is loaded at runtime from the bundled prompt
|
|
455
|
+
- **TST-080**: MUST verify each bundled prompt-backed `req-*` command description is loaded at runtime from the first bundled prompt Markdown `# ` heading with the prefix removed.
|
|
413
456
|
- **TST-081**: MUST verify worktree-backed prompt execution verifies worktree registration and branch presence, switches active-session cwd, `ctx.cwd`, and `process.cwd()` to `worktree-path` before agent start, and restores them to `base-path` before session-closure handling returns.
|
|
414
457
|
- **TST-082**: MUST verify worktree-backed successful runs enter `running` only after prompt handoff succeeds, merge with `--ff-only` from `base-path`, and delete the worktree only after deletion verification passes.
|
|
415
458
|
- **TST-083**: MUST verify worktree merge failures notify the pi CLI, transition through `error`, retain the worktree checkout for manual recovery, and keep `base-path` active after session-closure handling.
|
|
@@ -422,32 +465,32 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
422
465
|
- **TST-052**: MUST verify toggling or editing a settings entry preserves focus on the affected row when the menu re-renders.
|
|
423
466
|
- **TST-053**: MUST verify top-level reset restores the full menu tree and submenu reset restores only the targeted recursive subtree.
|
|
424
467
|
- **TST-054**: MUST verify every `req-<prompt>` command aborts when slash-command-owned git validation fails and dispatches no prompt message.
|
|
425
|
-
- **TST-055**: MUST verify `req-<prompt>` commands enforce the documented required-doc matrix, create no worktree, and dispatch no prompt when a required doc is missing.
|
|
468
|
+
- **TST-055**: MUST verify bundled prompt-backed `req-<prompt>` commands enforce the documented required-doc matrix, create no worktree, and dispatch no prompt when a required doc is missing.
|
|
426
469
|
- **TST-056**: MUST verify worktree-backed `req-<prompt>` commands derive `worktree-dir` from persisted `GIT_WORKTREE_PREFIX` for both default and override values.
|
|
427
470
|
- **TST-057**: MUST verify `req-<prompt>` commands create `worktree-path`, dispatch prompts through the replacement-session context of the switched execution session, and run tool executions against prepared `context-path`.
|
|
428
471
|
- **TST-058**: MUST verify worktree-backed `req-<prompt>` commands skip merge plus worktree/branch deletion, restore `base-path`, and notify pi CLI of closure failure when the matched run ends interrupted, failed, or aborted.
|
|
429
472
|
- **TST-061**: MUST verify `req-<prompt>` commands skip worktree creation when `AUTO_GIT_COMMIT=disable`, even if persisted `GIT_WORKTREE_ENABLED=enable`.
|
|
430
473
|
- **TST-064**: MUST verify worktree-backed `req-<prompt>` commands confirm created worktree directory plus branch existence before prompt dispatch and abort without dispatch when verification fails.
|
|
431
474
|
- **TST-067**: MUST verify `status:error` renders with blinking error styling and non-error `status` values follow the documented status-bar theme convention.
|
|
432
|
-
- **TST-068**: MUST verify every `req
|
|
433
|
-
- **TST-069**: MUST verify `req-<prompt>` commands transition workflow state through `checking`, `error`, and `running` for documented preflight and prompt-handoff paths.
|
|
475
|
+
- **TST-068**: MUST verify every `req-*` slash command except `req-reset` rejects non-`idle` workflow state before checks, worktree operations, or direct references execution, surfaces an error, and transitions workflow state to `error`.
|
|
476
|
+
- **TST-069**: MUST verify bundled prompt-backed `req-<prompt>` commands transition workflow state through `checking`, `error`, and `running` for documented preflight and prompt-handoff paths.
|
|
434
477
|
- **TST-070**: MUST verify prompt-end handling ignores unrelated or non-success completions and performs cleanup only for the matched successful prompt.
|
|
435
478
|
- **TST-071**: MUST verify matched successful cleanup transitions workflow state through `merging` to `idle` and transitions to `error` on merge or deletion failure.
|
|
436
479
|
- **TST-065**: MUST verify default startup-tool enablement matches the documented enabled and disabled tool matrix.
|
|
437
480
|
- **TST-066**: MUST verify `req-<prompt>` commands keep working when extension custom-tool registrations are removed from the runtime inventory.
|
|
438
481
|
- **TST-059**: MUST verify every agent-tool registration defines custom `renderResult` and that compact rendering shows essential invocation parameters while expanded rendering avoids fallback raw-content display.
|
|
439
|
-
- **TST-086**: MUST verify `req-<prompt>` commands abort before prompt dispatch when the persisted execution-session header cwd or `process.cwd()` differs from the expected execution path, and abort before merge when persisted execution-session header metadata or verified worktree artifacts diverge, while stale pre-switch context probes alone do not abort.
|
|
482
|
+
- **TST-086**: MUST verify bundled prompt-backed `req-<prompt>` commands abort before prompt dispatch when the persisted execution-session header cwd or `process.cwd()` differs from the expected execution path, and abort before merge when persisted execution-session header metadata or verified worktree artifacts diverge, while stale pre-switch context probes alone do not abort.
|
|
440
483
|
|
|
441
484
|
## 5. Observed Component Model
|
|
442
485
|
|
|
443
486
|
### 5.1 Runtime Surfaces
|
|
444
487
|
- `src/cli.ts` parses CLI flags, repairs config for project-scoped commands, and dispatches to `tool-runner.ts` or `runStaticCheck`.
|
|
445
|
-
- `src/index.ts` activates the pi extension, registers commands and agent tools, and manages interactive menu/status behavior through `ctx.ui`.
|
|
488
|
+
- `src/index.ts` activates the pi extension, registers bundled prompt-backed commands plus specialized `req-references` orchestration and agent tools, and manages interactive menu/status behavior through `ctx.ui`.
|
|
446
489
|
- `src/core/tool-runner.ts` orchestrates project file collection, markdown generation, compression, construct search, and static-check execution.
|
|
447
490
|
- `src/core/source-analyzer.ts` defines `SourceElement`, language specs, extraction heuristics, Doxygen attachment, and Markdown rendering support.
|
|
448
491
|
- `src/core/generate-markdown.ts`, `src/core/compress.ts`, and `src/core/find-constructs.ts` share analyzer and compressor logic to produce reusable Markdown outputs.
|
|
449
492
|
- `src/core/static-check.ts` maps languages/extensions, parses Command-only enable specs, preserves debug `Dummy` handling, resolves inputs, and dispatches modular checker classes.
|
|
450
|
-
- `src/core/config.ts`, `src/core/resources.ts`, and `src/core/
|
|
493
|
+
- `src/core/config.ts`, `src/core/resources.ts`, `src/core/prompts.ts`, and `src/core/req-references-command.ts` provide config persistence, home-resource synchronization, bundled-prompt rendering, and direct `req-references` slash-command orchestration.
|
|
451
494
|
- `src/core/doxygen-parser.ts` normalizes Doxygen tags reused by source references and construct search output.
|
|
452
495
|
- `scripts/debug-extension.ts`, `scripts/pi-usereq-debug.sh`, and `scripts/lib/*.ts` provide the standalone extension debug harness, bash wrapper, recording adapters, offline replay, SDK parity probing, and usage-manual rendering.
|
|
453
496
|
|
|
@@ -460,7 +503,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
460
503
|
- `fast-glob` provides wildcard expansion for static-check inputs evidence in `src/core/static-check.ts`, `package.json`, and `package-lock.json`.
|
|
461
504
|
- `tsx` is the manifest-declared TypeScript execution runner for tests and CLI scripts evidenced by `package.json` and `package-lock.json`.
|
|
462
505
|
- `typescript` is the manifest-declared compiler and type-checker evidenced by `package.json`, `package-lock.json`, and `tsconfig.json`.
|
|
463
|
-
- `git` CLI is a runtime dependency for repository discovery, source-file collection,
|
|
506
|
+
- `git` CLI is a runtime dependency for repository discovery, source-file collection, bundled prompt-command worktree orchestration, and direct `req-references` commit orchestration evidenced in `src/core/tool-runner.ts`, `src/core/prompt-command-runtime.ts`, and `src/core/req-references-command.ts`.
|
|
464
507
|
|
|
465
508
|
### 5.3 Packaging and Tooling Surface
|
|
466
509
|
- `package.json` declares `type: "module"`, `pi.extensions: ["./src/index.ts"]`, and the scripts `test`, `test:watch`, `cli`, `debug:ext`, `debug:ext:inspect`, `debug:ext:session`, `debug:ext:command`, `debug:ext:tool`, and `debug:ext:sdk`.
|
|
@@ -491,6 +534,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
491
534
|
│ │ ├── generate-markdown.ts
|
|
492
535
|
│ │ ├── pi-usereq-tools.ts
|
|
493
536
|
│ │ ├── prompts.ts
|
|
537
|
+
│ │ ├── req-references-command.ts
|
|
494
538
|
│ │ ├── resources.ts
|
|
495
539
|
│ │ ├── source-analyzer.ts
|
|
496
540
|
│ │ ├── static-check.ts
|
|
@@ -500,7 +544,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
500
544
|
│ └── resources/
|
|
501
545
|
│ ├── templates/{Requirements_Template.md,HDT_Test_Authoring_Guide.md,Document_Source_Code_in_Doxygen_Style.md}
|
|
502
546
|
│ ├── guidelines/{Google_Python_Style_Guide.md,Google_C++_Style_Guide.md}
|
|
503
|
-
│ └── prompts/{analyze.md,change.md,check.md,cover.md,create.md,fix.md,flowchart.md,implement.md,new.md,readme.md,recreate.md,refactor.md,
|
|
547
|
+
│ └── prompts/{analyze.md,change.md,check.md,cover.md,create.md,fix.md,flowchart.md,implement.md,new.md,readme.md,recreate.md,refactor.md,renumber.md,workflow.md,write.md}
|
|
504
548
|
├── tests/
|
|
505
549
|
│ ├── extension-registration.test.ts
|
|
506
550
|
│ ├── helpers.ts
|
|
@@ -531,7 +575,7 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
531
575
|
## 7. Test Evidence Summary
|
|
532
576
|
|
|
533
577
|
### 7.1 Covered Behaviors
|
|
534
|
-
- `tests/extension-registration.test.ts` covers extension registration, config-menu persistence, startup-tool enablement, static-check menu mutation flows,
|
|
578
|
+
- `tests/extension-registration.test.ts` covers extension registration, config-menu persistence, startup-tool enablement, static-check menu mutation flows, bundled prompt-command worktree orchestration, and specialized `req-references` direct commit orchestration.
|
|
535
579
|
- `tests/prompt-rendering.test.ts` covers home-resource synchronization and placeholder replacement in rendered prompts.
|
|
536
580
|
- `tests/oracle-standalone.test.ts` compares non-tab-sensitive standalone `files-*` outputs against the Python `usereq.cli` oracle, asserts Go-fixture tab preservation, and compares `--test-static-check` dummy/command outputs against archived fixtures.
|
|
537
581
|
- `tests/oracle-project.test.ts` compares non-tab-sensitive project commands against the Python oracle, asserts Go-source tab preservation for project extraction commands, and verifies archived `files-static-check` plus `static-check` outputs.
|
|
@@ -543,10 +587,10 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
543
587
|
### 8.1 PRJ and CTN Evidence
|
|
544
588
|
| ID | Evidence |
|
|
545
589
|
| --- | --- |
|
|
546
|
-
| PRJ-001 | `src/index.ts` :: `registerPromptCommands` :: `
|
|
547
|
-
| PRJ-002 | `src/index.ts` :: `registerAgentTools` :: tool names include `files-tokens`, `
|
|
590
|
+
| PRJ-001 | `src/index.ts` :: `registerPromptCommands` plus `registerReqReferencesCommand` :: registers bundled prompt-backed commands and the dedicated `req-references` command; `src/core/prompts.ts` :: `renderPrompt` :: adapts bundled prompt payloads. |
|
|
591
|
+
| PRJ-002 | `src/index.ts` :: `registerAgentTools` :: tool names include `files-tokens`, `summarize`, `compress`, `search`, `files-static-check`, and `static-check`. |
|
|
548
592
|
| PRJ-003 | `src/index.ts` :: `buildPiUsereqMenuChoices`, `configurePiUsereq`, and `configureDebugMenu` :: expose project paths, git automation, static-check, startup tools, notifications, and debug logging controls. |
|
|
549
|
-
| PRJ-004 | `src/core/prompt-command-runtime.ts` :: `validatePromptGitState`, `buildPromptWorktreeName`, `createPromptWorktree`, and `finalizePromptCommandExecution` ::
|
|
593
|
+
| PRJ-004 | `src/core/prompt-command-runtime.ts` :: `validatePromptGitState`, `buildPromptWorktreeName`, `createPromptWorktree`, and `finalizePromptCommandExecution`; `src/core/req-references-command.ts` :: `prepareReqReferencesCommandExecution` and `executeReqReferencesCommandExecution` :: keep git orchestration internal to slash-command execution. |
|
|
550
594
|
| PRJ-005 | `src/core/resources.ts` :: `ensureHomeResources` :: copies bundled resources; bundled tree exists under `src/resources/{prompts,templates,guidelines}`. |
|
|
551
595
|
| CTN-001 | `src/core/config.ts` :: `getProjectConfigPath` and `getDefaultConfig` :: returns `.pi/pi-usereq/config.json`, `pi-usereq/docs`, `tests`, and `["src"]`. |
|
|
552
596
|
| CTN-002 | `src/core/tool-runner.ts` :: `collectSourceFiles` :: executes `git -C <projectBase> ls-files --cached --others --exclude-standard` and fails on non-zero status. |
|
|
@@ -562,11 +606,12 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
562
606
|
### 8.2 DES Evidence
|
|
563
607
|
| ID | Evidence |
|
|
564
608
|
| --- | --- |
|
|
565
|
-
| DES-001 | `src/cli.ts` :: `parseArgs` and `main` :: parses flags then dispatches with branches such as `
|
|
566
|
-
| DES-002 | `src/index.ts` :: `piUsereqExtension` :: calls `
|
|
609
|
+
| DES-001 | `src/cli.ts` :: `parseArgs` and `main` :: parses flags then dispatches with branches such as `runSummarize`, `runCompress`, `runSearch`, `runProjectStaticCheck`, and `runStaticCheck`. |
|
|
610
|
+
| DES-002 | `src/index.ts` :: `piUsereqExtension` :: calls `registerReqReferencesCommand`, `registerPromptCommands`, `registerAgentTools`, `registerConfigCommands`, then installs shared lifecycle hooks. |
|
|
567
611
|
| DES-003 | `src/core/source-analyzer.ts` :: `class SourceElement`; `SourceAnalyzer.enrich` :: invokes `extractSignatures`, `detectHierarchy`, `extractVisibility`, `extractInheritance`, `extractBodyAnnotations`, and `extractDoxygenFields`. |
|
|
612
|
+
| DES-013 | `src/core/req-references-command.ts` :: `prepareReqReferencesCommandExecution` and `executeReqReferencesCommandExecution` :: implement the dedicated no-worktree `req-references` git-write workflow. |
|
|
568
613
|
| DES-004 | `src/core/static-check.ts` :: `StaticCheckBase` and `StaticCheckCommand`; `dispatchStaticCheckForFile` switch selects the modular implementation by module name. |
|
|
569
|
-
| DES-005 | `src/core/tool-runner.ts` :: exports `runFilesTokens`, `
|
|
614
|
+
| DES-005 | `src/core/tool-runner.ts` :: exports `runFilesTokens`, `runFilesSummarize`, `runSummarize`, `runCompress`, `runSearch`, `runFilesStaticCheck`, and `runProjectStaticCheck`. |
|
|
570
615
|
| DES-006 | `src/core/compress.ts` :: `normalizeRetainedLineIndentation`; `src/core/source-analyzer.ts` :: `normalizeSourceLineForExtraction`; `src/core/compress-files.ts` and `src/core/find-constructs.ts` reuse shared markdown emitters with preserved source tabs. |
|
|
571
616
|
| DES-011 | `.github/workflows/release-npm.yml` :: release jobs validate semver tags and `origin/master`, publish with npm authentication, and create the GitHub Release. |
|
|
572
617
|
|
|
@@ -576,7 +621,13 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
576
621
|
| REQ-001 | `src/core/resources.ts` :: `copyDirectoryContents` :: skips dotfiles, recurses into directories, and uses `fs.copyFileSync(sourcePath, destinationPath)`. |
|
|
577
622
|
| REQ-002 | `src/core/config.ts` :: `buildPromptReplacementPaths` :: emits `%%TEMPLATE_PATH%%` plus docs/guideline/source/test tokens; `src/core/prompts.ts` :: `renderPrompt` merges them with `"%%ARGS%%": args`. |
|
|
578
623
|
| REQ-003 | `src/core/prompts.ts` :: `TOOL_REFERENCE_REPLACEMENTS` and `adaptPromptForInternalTools` :: replaces ``req --find`` style text with `search tool` style text. |
|
|
579
|
-
| REQ-004 | `src/index.ts` :: `registerPromptCommands` :: each handler
|
|
624
|
+
| REQ-004 | `src/index.ts` :: `registerPromptCommands` :: each handler renders the bundled prompt and dispatches it through `deliverPromptCommand(...)`. |
|
|
625
|
+
| REQ-298 | `src/core/prompt-command-catalog.ts` :: `PROMPT_COMMAND_NAMES` omits `references`; `src/index.ts` :: `registerReqReferencesCommand` registers `req-references` with `REQ_REFERENCES_COMMAND_DESCRIPTION`. |
|
|
626
|
+
| REQ-299 | `src/index.ts` :: `registerReqReferencesCommand` :: transitions `checking` then `running`; `src/core/req-references-command.ts` :: `prepareReqReferencesCommandExecution` reuses `validatePromptGitState(...)` without worktree or session switching. |
|
|
627
|
+
| REQ-300 | `src/core/req-references-command.ts` :: `executeReqReferencesCommandExecution` calls `runReferences(...)`; `src/core/tool-runner.ts` :: `runReferences` overwrites configured `REFERENCES.md`. |
|
|
628
|
+
| REQ-301 | `src/core/req-references-command.ts` :: `REQ_REFERENCES_COMMIT_MESSAGE`, `getGitAddTargetPath(...)`, and `executeReqReferencesCommandExecution(...)` :: stage only `REFERENCES.md` and create the fixed commit. |
|
|
629
|
+
| REQ-302 | `src/index.ts` :: `registerReqReferencesCommand` :: restores workflow state `idle` and emits success notification after direct execution; `src/core/req-references-command.ts` :: `listResidualGitStatusLines(...)` verifies clean repository state. |
|
|
630
|
+
| REQ-303 | `src/index.ts` :: `registerReqReferencesCommand` :: transitions to `error` and notifies on failure; `src/core/req-references-command.ts` :: throws deterministic `ReqError` failures for generation, staging, commit, and cleanliness errors. |
|
|
580
631
|
| REQ-005 | `src/index.ts` :: `runToolCommand`, `formatResultForEditor`, `showToolResult` :: writes combined output into the editor and notifies `completed` or `failed`. |
|
|
581
632
|
| REQ-006 | `src/index.ts` :: `buildPiUsereqMenuChoices` and `configurePiUsereq` :: expose directories, git automation, static-check, tools, notifications, debug settings, reset, save, and `Show configuration`. |
|
|
582
633
|
| REQ-236 | `src/core/config.ts` :: `getDefaultConfig`, `loadConfig`, and `buildPersistedConfig` :: persist `DEBUG_ENABLED` with default `disable`. |
|
|
@@ -604,10 +655,10 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
604
655
|
| REQ-161 | `src/core/static-check.ts` :: `dispatchStaticCheckForFile` and `runStaticCheck` :: keep `Dummy` only for existing config entries and the debug driver. |
|
|
605
656
|
| REQ-009 | `src/index.ts` :: `pi.on("session_start", ...)` :: calls `ensureHomeResources()`, `applyConfiguredPiUsereqTools`, and `ctx.ui.setStatus(...)`. |
|
|
606
657
|
| REQ-010 | `src/core/token-counter.ts` :: `new TokenCounter("cl100k_base")`; `formatPackSummary`; `src/core/tool-runner.ts` :: `runFilesTokens` validates files and returns summary plus warnings. |
|
|
607
|
-
| REQ-011 | `src/core/tool-runner.ts` :: `
|
|
658
|
+
| REQ-011 | `src/core/tool-runner.ts` :: `runFilesSummarize` :: returns `generateMarkdown(...)`; `src/core/source-analyzer.ts` :: `formatMarkdown` renders source-derived lines with preserved leading tabs. |
|
|
608
659
|
| REQ-012 | `src/core/compress.ts` :: `INDENT_SIGNIFICANT`, `normalizeRetainedLineIndentation`, and `compressSourceDetailed` :: preserve full indentation for indentation-significant languages and preserve leading tabs for other languages. |
|
|
609
660
|
| REQ-013 | `src/core/find-constructs.ts` :: `searchConstructsInFiles` and `formatConstruct` :: filters by tags/regex and emits signature, lines, Doxygen bullets, and stripped code with preserved leading tabs. |
|
|
610
|
-
| REQ-014 | `src/core/tool-runner.ts` :: `
|
|
661
|
+
| REQ-014 | `src/core/tool-runner.ts` :: `runSummarize` :: prepends file structure and returns `generateMarkdown(...)`; `src/core/source-analyzer.ts` :: `formatMarkdown` preserves source-derived leading tabs. |
|
|
611
662
|
| REQ-015 | `src/core/tool-runner.ts` :: `runCompress` :: collects configured project files then returns `compressFiles(files, enableLineNumbers, verbose, base)`. |
|
|
612
663
|
| REQ-016 | `src/core/tool-runner.ts` :: `runSearch` :: collects configured project files and executes `searchConstructsInFiles(files, tagFilter, pattern, ...)`. |
|
|
613
664
|
| REQ-017 | `src/core/tool-runner.ts` :: `runTokens` :: `canonicalNames = ["REQUIREMENTS.md", "WORKFLOW.md", "REFERENCES.md"]` and fails if no canonical docs exist. |
|
|
@@ -629,8 +680,8 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
629
680
|
| --- | --- |
|
|
630
681
|
| TST-001 | `tests/extension-registration.test.ts` :: `extension registers all required prompt commands, tool wrappers, and agent tools` validates command and tool registration sets. |
|
|
631
682
|
| TST-002 | `tests/prompt-rendering.test.ts` :: `embedded resources are copied ...` and `prompt rendering replaces all dynamic placeholders ...`. |
|
|
632
|
-
| TST-003 | `tests/oracle-standalone.test.ts` :: preserves Python-oracle coverage for non-tab-sensitive fixtures, asserts Go-fixture tab preservation for `files-
|
|
633
|
-
| TST-004 | `tests/oracle-project.test.ts` :: preserves Python-oracle coverage for non-tab-sensitive project fixtures, asserts Go-source tab preservation for `
|
|
683
|
+
| TST-003 | `tests/oracle-standalone.test.ts` :: preserves Python-oracle coverage for non-tab-sensitive fixtures, asserts Go-fixture tab preservation for `files-summarize`, `files-compress`, and `files-find`, and keeps archived `test-static-check` coverage. |
|
|
684
|
+
| TST-004 | `tests/oracle-project.test.ts` :: preserves Python-oracle coverage for non-tab-sensitive project fixtures, asserts Go-source tab preservation for `summarize`, `compress`, and `find`, and keeps archived static-check coverage. |
|
|
634
685
|
| TST-005 | `tests/extension-registration.test.ts` :: `configuration menu saves updated docs-dir`, `configuration menu can disable ... tools`, and `configuration menu can add guided static-check entries ...`. |
|
|
635
686
|
| TST-046 | `tests/extension-registration.test.ts` :: `configuration menu hides removed static-check modules from user-facing actions`. |
|
|
636
687
|
| TST-073 | `tests/extension-registration.test.ts` :: `debug menu dims locked rows and persists debug settings with focus-preserving re-renders` validates `DEBUG_WORKFLOW_EVENTS` alongside the existing Debug fields. |
|
|
@@ -641,11 +692,14 @@ PI-useReq is a TypeScript pi extension plus companion Node CLI and standalone ex
|
|
|
641
692
|
| TST-092 | `tests/extension-registration.test.ts` :: `stale replacement contexts do not break workflow-state rendering` verifies stale replacement-session render contexts are ignored without throwing. |
|
|
642
693
|
| TST-093 | `tests/extension-registration.test.ts` :: `replacement-session prompt delivery persists running before async sendUserMessage resolves` verifies async prompt-delivery completion does not delay merge-eligible `running` state. |
|
|
643
694
|
| TST-094 | `tests/extension-registration.test.ts` :: `worktree-backed closure merges from base-path when end-of-session timing already moved the persisted context` verifies closure merges successfully without worktree-session reactivation. |
|
|
695
|
+
| TST-102 | `tests/extension-registration.test.ts` :: `req-references registers outside the bundled prompt inventory and keeps its dedicated description` verifies dedicated registration independent from the bundled prompt inventory. |
|
|
696
|
+
| TST-103 | `tests/extension-registration.test.ts` :: `req-references updates REFERENCES.md with a direct commit workflow and no LLM session` verifies overwrite, fixed commit message, clean repo, and idle restoration without worktree or prompt dispatch. |
|
|
697
|
+
| TST-104 | `tests/extension-registration.test.ts` :: `req-references surfaces git-validation and reference-generation failures without session handoff` verifies error reporting without worktree creation, prompt dispatch, or git-history mutation. |
|
|
644
698
|
| TST-006 | `tests/extension-registration.test.ts` :: `session_start applies configured pi-usereq startup tools`. |
|
|
645
699
|
| TST-009 | `package.json` :: `"type": "module"`, `"pi": { "extensions": ["./src/index.ts"] }`, and `"scripts"` entries for `test`, `test:watch`, and `cli`. |
|
|
646
700
|
| TST-010 | `tsconfig.json` :: `"module": "NodeNext"`, `"moduleResolution": "NodeNext"`, `"strict": true`, `"noEmit": true`, and `"include": ["src/**/*.ts", "tests/**/*.ts"]`. |
|
|
647
|
-
| TST-022 | `tests/extension-registration.test.ts` :: `source-extraction agent tools preserve leading tabs in emitted content` plus the explicit `files-
|
|
648
|
-
| TST-023 | `tests/extension-registration.test.ts` :: `
|
|
701
|
+
| TST-022 | `tests/extension-registration.test.ts` :: `source-extraction agent tools preserve leading tabs in emitted content` plus the explicit `files-summarize` and `summarize` monolithic-output tests. |
|
|
702
|
+
| TST-023 | `tests/extension-registration.test.ts` :: `summary tools register agent-oriented descriptions and schema details`. |
|
|
649
703
|
| TST-024 | `tests/extension-registration.test.ts` :: `source-extraction agent tools preserve leading tabs in emitted content` plus the explicit `files-search` and `search` monolithic-output tests. |
|
|
650
704
|
| TST-026 | `tests/extension-registration.test.ts` :: `source-extraction agent tools preserve leading tabs in emitted content` plus the explicit `files-compress` and `compress` monolithic-output tests. |
|
|
651
705
|
| TST-039 | `tests/release-workflow.test.ts` :: workflow-content assertions cover semver gating, `origin/master` containment, npm publication, and GitHub release generation. |
|