@mriekki/project-forge 4.13.0 → 4.13.1
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/assets/components.json +2 -2
- package/assets/generated/ASSEMBLY.json +9 -9
- package/assets/generated/core/core/instructions/project-forge-workflow.instructions.md +7 -5
- package/assets/generated/core/core/process/HUMAN_GATES.md +21 -4
- package/assets/generated/core/core/process/INTERACTIVE_SESSION_GUIDE.md +15 -6
- package/assets/generated/core/core/skills/start-work/SKILL.md +15 -6
- package/assets/generated/core/tools/vscode_work_item_status/extension/README.md +8 -4
- package/assets/generated/core/tools/vscode_work_item_status/extension/extension.js +79 -21
- package/assets/generated/core/tools/vscode_work_item_status/extension/package.json +26 -2
- package/package.json +1 -1
package/assets/components.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@mriekki/project-forge",
|
|
4
|
-
"version": "4.13.
|
|
4
|
+
"version": "4.13.1",
|
|
5
5
|
"defaultProfile": "greenfield-project",
|
|
6
6
|
"profiles": {
|
|
7
7
|
"greenfield-project": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"components": {
|
|
15
15
|
"core": {
|
|
16
|
-
"revision": "
|
|
16
|
+
"revision": "a88c33ec1c93e120c70018a01c018f59dc2f74f2",
|
|
17
17
|
"version": "4.0.0",
|
|
18
18
|
"distribution": "greenfield-workspace",
|
|
19
19
|
"descriptor": "assets/core/distribution.json",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@mriekki/project-forge",
|
|
4
|
-
"version": "4.13.
|
|
4
|
+
"version": "4.13.1",
|
|
5
5
|
"components": {
|
|
6
6
|
"core": {
|
|
7
|
-
"revision": "
|
|
7
|
+
"revision": "a88c33ec1c93e120c70018a01c018f59dc2f74f2",
|
|
8
8
|
"version": "4.0.0",
|
|
9
9
|
"distribution": "greenfield-workspace",
|
|
10
10
|
"files": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
{
|
|
22
22
|
"source": "core/instructions/project-forge-workflow.instructions.md",
|
|
23
23
|
"destination": ".github/instructions/project-forge-workflow.instructions.md",
|
|
24
|
-
"sha256": "
|
|
24
|
+
"sha256": "3bb0abb63dd2e7a151c432d08eca85fe604cb043a865bfa337024ebd1c372301"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"source": "core/instructions/project-forge-local-development.instructions.md",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
{
|
|
52
52
|
"source": "core/skills/start-work/SKILL.md",
|
|
53
53
|
"destination": ".github/skills/start-work/SKILL.md",
|
|
54
|
-
"sha256": "
|
|
54
|
+
"sha256": "8a1213e59c5452feb5c8820530f6131115f88419299e42462ee5d32361d62fb6"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
"source": "core/skills/setup/SKILL.md",
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
{
|
|
187
187
|
"source": "core/process/HUMAN_GATES.md",
|
|
188
188
|
"destination": "docs/process/HUMAN_IN_LOOP_GATES.md",
|
|
189
|
-
"sha256": "
|
|
189
|
+
"sha256": "d884eccd7e9e04d7c81868792adebcdc7f376206786ced37d467f81fca6dbd7f"
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
192
|
"source": "core/process/GUIDED_NEXT_STEPS.md",
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
{
|
|
197
197
|
"source": "core/process/INTERACTIVE_SESSION_GUIDE.md",
|
|
198
198
|
"destination": "docs/process/INTERACTIVE_SESSION_GUIDE.md",
|
|
199
|
-
"sha256": "
|
|
199
|
+
"sha256": "f7573b9926878da3db4353db7297b66c9d907844142ae6486c7fd7580f187e3b"
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
"source": "core/process/COACHING_GUIDE.md",
|
|
@@ -336,17 +336,17 @@
|
|
|
336
336
|
{
|
|
337
337
|
"source": "tools/vscode_work_item_status/extension/package.json",
|
|
338
338
|
"destination": "tools/project-forge-vscode/work-item-status/extension/package.json",
|
|
339
|
-
"sha256": "
|
|
339
|
+
"sha256": "1dd1f7bba7f6e519ad73f1ee8ad67900cabec2ef475b1b6bc5db931ab9cd615b"
|
|
340
340
|
},
|
|
341
341
|
{
|
|
342
342
|
"source": "tools/vscode_work_item_status/extension/extension.js",
|
|
343
343
|
"destination": "tools/project-forge-vscode/work-item-status/extension/extension.js",
|
|
344
|
-
"sha256": "
|
|
344
|
+
"sha256": "2688291de42fab15edd3487cc17410bf57d8358e9f606e292dc44c9cb0439009"
|
|
345
345
|
},
|
|
346
346
|
{
|
|
347
347
|
"source": "tools/vscode_work_item_status/extension/README.md",
|
|
348
348
|
"destination": "tools/project-forge-vscode/work-item-status/extension/README.md",
|
|
349
|
-
"sha256": "
|
|
349
|
+
"sha256": "54963b69bef2d9f763a6c92ad2c2b3105d3f10dd69542f72167de7e57db18982"
|
|
350
350
|
},
|
|
351
351
|
{
|
|
352
352
|
"source": "tools/package/check_baseline.py",
|
|
@@ -14,13 +14,15 @@ Use proportional rigor: `LIGHT`, `STANDARD`, `ELEVATED`.
|
|
|
14
14
|
|
|
15
15
|
Keep explicit human gates for material requirements, substantive plans, meaningful implementation acceptance, the final merge/delivery decision, and production deployment.
|
|
16
16
|
|
|
17
|
-
Before any substantive approval gate, identify the exact PRIMARY review subject and put the best available review surface in front of the human when the host supports it. Treat supporting documents as CONTEXT or TRACEABILITY instead of opening everything. For Markdown prefer rendered preview, for structured approval artifacts prefer formatted source plus a concise summary, for implementation acceptance prefer the meaningful diff/Source Control surface, and for plans prefer the native plan surface or durable plan document. Opening or foregrounding a review surface is read-only presentation and never implies approval.
|
|
17
|
+
Before any substantive approval gate, identify the exact PRIMARY review subject for the current work item/scope and put the best available review surface in front of the human when the host supports it. Treat supporting documents as CONTEXT or TRACEABILITY instead of opening everything. For Markdown prefer rendered preview, for structured approval artifacts prefer formatted source plus a concise summary, for implementation acceptance prefer the meaningful diff/Source Control surface, and for plans prefer the native plan surface or durable plan document. Opening or foregrounding a review surface is read-only presentation and never implies approval.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Every artifact-backed approval question must carry its own work-item/scope identity, approval purpose, exact PRIMARY artifact link/path, truthful presentation status, and consequence labels. Do not rely on links in earlier commentary, editor focus, a global plan, or another work item's artifact. The artifact named in the gate must be the same artifact requested/opened for review. If automatic opening is unavailable or fails, say so inside the gate and provide the exact link/path plus a deterministic manual fallback rather than fabricating success.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
In VS Code, when the Project Forge companion extension is installed, use the exact-path `projectForge.openReviewArtifact` command or Project Forge language-model review tool when the current host can invoke it. The helper is read-only, workspace-confined, must fail on ambiguous multi-root matches instead of guessing from editor focus, and should report actual presentation mode when available. Use a stronger native host review/diff surface when available.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
For STANDARD/ELEVATED work, invoking `/start-work` authorizes context resolution, risk assessment, and planning only. It does **not** authorize substantive implementation or implementation branch setup by itself. Produce the final proposed plan, resolve the exact work-item-specific PRIMARY artifact when one exists, foreground that exact review surface, state that implementation has not started, include the same exact artifact link/path and presentation status inside the approval question, and require an explicit `Approve plan and begin implementation [PLAN APPROVAL + CODE WRITE]` action before code writes or routine implementation branch setup. For ELEVATED work, Reviewer challenges the plan and material findings are reconciled before the human reviews the final proposed plan.
|
|
24
|
+
|
|
25
|
+
If implementation later requires a material change to the approved architecture, scope, schema/data handling, security model, externally visible behavior, major dependencies, or verification strategy, reopen the implementation-plan gate with the revised PRIMARY plan presented and linked before continuing. Stale approval does not authorize a materially changed plan.
|
|
24
26
|
|
|
25
27
|
Once a bounded action is authorized, routine mechanics inside that scope should proceed without repeated ceremonial confirmation.
|
|
26
28
|
|
|
@@ -32,7 +34,7 @@ During interactive questioning, prefer concise choice-first options for genuinel
|
|
|
32
34
|
|
|
33
35
|
When an authorized action requires a developer-owned interactive terminal prompt, follow the interactive-terminal handoff in `INTERACTIVE_SESSION_GUIDE.md`: collect any distinct bounded authorization first through the host-native structured control, then immediately provide the exact command in a standalone fenced code block, state the working directory when relevant, explain the local prompt briefly, keep passphrases/passwords/tokens/private keys local to the terminal, and say what result to report back for deterministic verification. Do not make the inability to inject terminal keystrokes the main response when a copyable command is sufficient. If the host can insert terminal text, insert only the non-secret command for human review/execution rather than silently executing the interactive step.
|
|
34
36
|
|
|
35
|
-
Make a recommendation only when current evidence, repository policy, or a clear engineering tradeoff supports one. Mark exactly one supported choice with the host's `recommended` indicator when available and give a brief rationale. When the host does not expose recommendation metadata, append `[RECOMMENDED]` to exactly one option label and keep the rationale visible. A default/preselected option may match the recommendation, but a default alone must never communicate advice or human approval. If no option is clearly better, do not mark any option recommended and do not use a default that implies
|
|
37
|
+
Make a recommendation only when current evidence, repository policy, or a clear engineering tradeoff supports one. Mark exactly one supported choice with the host's `recommended` indicator when available and give a brief rationale. When the host does not expose recommendation metadata, append `[RECOMMENDED]` to exactly one option label and keep the rationale visible. A default/preselected option may match the recommendation, but a default alone must never communicate advice or human approval. If no option is clearly better, do not mark any option recommended and do not use a default that implies preference. A recommendation is advice, not approval: record only the human's selected/confirmed answer. If the human asks for no recommendation on one decision, honor that for that decision only; later questions may still include evidence-backed recommendations.
|
|
36
38
|
|
|
37
39
|
Keep factual/environment-specific values and questions intended to elicit the human's own framing, reasoning, debugging approach, design rationale, or understanding open-ended unless options are later useful as scaffolding.
|
|
38
40
|
|
|
@@ -41,10 +41,22 @@ When the current host supports opening or foregrounding the PRIMARY review surfa
|
|
|
41
41
|
|
|
42
42
|
Do not open every supporting document and steal focus. Open the PRIMARY surface; name CONTEXT and TRACEABILITY material explicitly and make it easy to open when needed.
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Every artifact-backed approval question must be self-contained. The gate itself must identify:
|
|
45
|
+
|
|
46
|
+
- the specific work item or approval scope;
|
|
47
|
+
- the exact approval purpose/subject;
|
|
48
|
+
- the exact PRIMARY artifact path or clickable link that is being approved;
|
|
49
|
+
- presentation status when an automatic open was attempted (`rendered Markdown opened`, `editor fallback opened`, `automatic opening unavailable/failed`, or equivalent truthful evidence);
|
|
50
|
+
- the consequence labels for each action.
|
|
51
|
+
|
|
52
|
+
Do not rely on an artifact link in earlier commentary, the active editor, a global plan, or another work item's document. The PRIMARY artifact named in the gate must be the same artifact that was requested/opened for presentation.
|
|
53
|
+
|
|
54
|
+
If the host cannot open the review surface automatically, provide the exact path/link inside the approval question and a deterministic manual fallback. For Markdown in VS Code on Windows, the fallback may say to open that exact file and press `Ctrl+Shift+V`. Never imply that a path reference alone is equivalent to review.
|
|
45
55
|
|
|
46
56
|
Opening, previewing, foregrounding, or navigating to a review surface is **read-only presentation**. It never communicates approval, authorization, or acceptance. Only the explicit gate choice does that.
|
|
47
57
|
|
|
58
|
+
If the PRIMARY artifact changes materially after approval, present and link the revised PRIMARY artifact before asking again. Navigation, preview, cancellation, or a `where is it?` question never preserves or creates approval for a materially changed subject.
|
|
59
|
+
|
|
48
60
|
Do not gate routine mechanics individually after a bounded action is already authorized.
|
|
49
61
|
|
|
50
62
|
Missing access to GitHub admin policy metadata is not itself a human gate. Use configured workflow/check results, PR mergeability, repository documentation, and any observable enforced policy as evidence. Do not ask the human to open GitHub Settings and transcribe branch-protection/ruleset check names merely to continue; ask only when unavailable policy information creates a material unresolved decision at merge, release, or another consequential action.
|
|
@@ -64,13 +76,18 @@ requirements/context ready
|
|
|
64
76
|
→ substantive implementation
|
|
65
77
|
```
|
|
66
78
|
|
|
67
|
-
Before the approval choice, state unambiguously that implementation has **not** started. The gate should identify the work item, risk level, review subject, key plan coverage, and any unresolved material decisions.
|
|
79
|
+
Before the approval choice, state unambiguously that implementation has **not** started. The gate should identify the work item, risk level, exact review subject/artifact, presentation status, key plan coverage, and any unresolved material decisions.
|
|
68
80
|
|
|
69
81
|
Use an explicit action set equivalent to:
|
|
70
82
|
|
|
71
83
|
```text
|
|
72
84
|
IMPLEMENTATION PLAN REVIEW REQUIRED
|
|
73
85
|
|
|
86
|
+
Work item: <ID / key / concise change>
|
|
87
|
+
Approval subject: final proposed implementation plan
|
|
88
|
+
Primary artifact: <exact clickable plan link/path | native plan surface>
|
|
89
|
+
Presentation: <rendered Markdown opened | editor fallback opened | automatic opening unavailable/failed | native plan foregrounded>
|
|
90
|
+
|
|
74
91
|
Implementation has NOT started.
|
|
75
92
|
|
|
76
93
|
1. Approve plan and begin implementation [PLAN APPROVAL + CODE WRITE]
|
|
@@ -79,11 +96,11 @@ Implementation has NOT started.
|
|
|
79
96
|
4. Stop [NO ACTION]
|
|
80
97
|
```
|
|
81
98
|
|
|
82
|
-
When the host exposes structured choice UI, render these as a single-select decision instead of a numbered menu while preserving the consequence labels.
|
|
99
|
+
When the host exposes structured choice UI, render these as a single-select decision instead of a numbered menu while preserving the consequence labels and the same work-item/artifact context in the question itself.
|
|
83
100
|
|
|
84
101
|
For ELEVATED work, Reviewer challenges the proposed plan before the human gate. Reconcile material Reviewer findings into the final proposed plan, then put that final plan in front of the human. Do not ask the human to approve an initial plan while separate Reviewer objections remain unresolved.
|
|
85
102
|
|
|
86
|
-
After approval, routine implementation details may evolve without ceremonial re-approval. Reopen the plan gate when evidence requires a **material** change to approved architecture, scope, schema/data handling, security model, externally visible behavior, major dependencies, or verification strategy. Show what changed, why it changed, and the revised plan before implementation continues.
|
|
103
|
+
After approval, routine implementation details may evolve without ceremonial re-approval. Reopen the plan gate when evidence requires a **material** change to approved architecture, scope, schema/data handling, security model, externally visible behavior, major dependencies, or verification strategy. Show what changed, why it changed, and the revised plan before implementation continues. The renewed gate must link/present the revised PRIMARY artifact rather than relying on the stale approved plan.
|
|
87
104
|
|
|
88
105
|
## Implementation branch setup
|
|
89
106
|
|
|
@@ -49,10 +49,11 @@ Presentation rules:
|
|
|
49
49
|
|
|
50
50
|
Before a substantive approval gate, follow the review-surface contract in `HUMAN_GATES.md`.
|
|
51
51
|
|
|
52
|
-
1. Identify the exact PRIMARY review subject.
|
|
52
|
+
1. Identify the exact PRIMARY review subject for the current work item/gate.
|
|
53
53
|
2. Separate supporting CONTEXT and TRACEABILITY material when useful.
|
|
54
54
|
3. Put the best available PRIMARY review surface in front of the human before asking for approval.
|
|
55
|
-
4.
|
|
55
|
+
4. Capture the actual presentation result when the host reports one.
|
|
56
|
+
5. Render the explicit approval/action choice with the same exact work-item/artifact identity inside the question itself.
|
|
56
57
|
|
|
57
58
|
Use the host's native surface when it is stronger than prose:
|
|
58
59
|
|
|
@@ -62,16 +63,24 @@ Use the host's native surface when it is stronger than prose:
|
|
|
62
63
|
- implementation acceptance → Source Control / meaningful diff review;
|
|
63
64
|
- PR acceptance → exact PR/diff surface at the observed head.
|
|
64
65
|
|
|
65
|
-
In VS Code, when the Project Forge companion extension is installed and the host can invoke VS Code commands, `projectForge.openReviewArtifact` is the preferred Project Forge-owned action for repository artifacts. Pass the exact workspace-relative artifact path. The command is presentation-only and must reject targets outside the open workspace
|
|
66
|
+
In VS Code, when the Project Forge companion extension is installed and the host can invoke VS Code commands, `projectForge.openReviewArtifact` is the preferred Project Forge-owned action for repository artifacts. Pass the exact workspace-relative artifact path. The command is presentation-only and must reject targets outside the open workspace and ambiguous multi-root matches rather than guessing from editor focus.
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
On hosts that expose the Project Forge language-model review tool, use it only with the exact already-resolved PRIMARY artifact path. Its result is presentation evidence, not approval. The result should distinguish resolved artifact URI, requested presentation mode, actual opened mode, cancellation, and failure/unavailable state. For Markdown, distinguish rendered Markdown from ordinary editor-preview fallback.
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
If the host exposes its own safe resource-opening or diff-opening capability, it may use that directly instead. Do not require the Project Forge command/tool when the host already provides a stronger native review surface.
|
|
70
71
|
|
|
71
|
-
|
|
72
|
+
Do not automatically open every supporting document. Foreground only the PRIMARY review subject and list supporting context explicitly.
|
|
73
|
+
|
|
74
|
+
For every artifact-backed gate, put the exact artifact path/link inside the approval question itself. Do not make the human hunt through earlier commentary for the link. The question should also identify the work item, approval purpose, and truthful presentation status.
|
|
75
|
+
|
|
76
|
+
If automatic opening is unavailable or fails, say so briefly in the gate and provide a deterministic fallback. For Markdown in VS Code on Windows, tell the human to open the exact linked file and press `Ctrl+Shift+V`. Do not block planning merely because automatic opening is unavailable, and never fabricate a successful open.
|
|
77
|
+
|
|
78
|
+
Opening a review surface is never approval. A preview event, editor focus, file read, diff display, navigation action, cancellation, or `where is it?` question is read-only presentation and must not advance a gate.
|
|
72
79
|
|
|
73
80
|
For an implementation-plan gate, explicitly state that implementation has **not** started before offering approval. The approval action must be distinct from plan revision/read-only review actions.
|
|
74
81
|
|
|
82
|
+
When the approval subject changes materially, present and link the revised PRIMARY artifact before asking again. Do not reuse stale presentation evidence or stale approval for the revised subject.
|
|
83
|
+
|
|
75
84
|
### Recommendations inside choices
|
|
76
85
|
|
|
77
86
|
A recommendation is optional advice, not a required field and not an accepted decision.
|
|
@@ -165,7 +165,11 @@ PRIMARY review subject is the final proposed implementation plan. Prefer:
|
|
|
165
165
|
2. a durable plan document when one exists and is useful;
|
|
166
166
|
3. otherwise the full substantive plan in the conversation.
|
|
167
167
|
|
|
168
|
-
If a durable plan is a repository artifact
|
|
168
|
+
If a durable plan is a repository artifact, resolve its exact work-item-specific path from the current work-item authority/gate state before opening it. Do not select a global plan, another work item's artifact, or a focus-derived file.
|
|
169
|
+
|
|
170
|
+
In VS Code, when the Project Forge companion review command/tool is available, request presentation of that exact artifact. Record the actual presentation outcome when the host reports one, including rendered Markdown vs editor fallback vs unavailable/failed. If the host exposes a stronger native plan/review surface, use that instead.
|
|
171
|
+
|
|
172
|
+
If automatic opening is unavailable or fails, keep the gate usable: include the exact plan link/path inside the question and provide a deterministic manual fallback. For Markdown in VS Code on Windows, tell the human to open the exact linked file and press `Ctrl+Shift+V`.
|
|
169
173
|
|
|
170
174
|
Before rendering the gate, state explicitly:
|
|
171
175
|
|
|
@@ -180,7 +184,9 @@ IMPLEMENTATION PLAN REVIEW REQUIRED
|
|
|
180
184
|
|
|
181
185
|
Work item: <ID / key / concise change>
|
|
182
186
|
Risk: <STANDARD | ELEVATED>
|
|
183
|
-
|
|
187
|
+
Approval subject: final proposed implementation plan
|
|
188
|
+
Primary artifact: <exact clickable work-item plan link/path | native plan surface>
|
|
189
|
+
Presentation: <rendered Markdown opened | editor fallback opened | automatic opening unavailable/failed | native plan foregrounded>
|
|
184
190
|
|
|
185
191
|
Plan covers:
|
|
186
192
|
- approach
|
|
@@ -200,9 +206,11 @@ Implementation has NOT started.
|
|
|
200
206
|
4. Stop [NO ACTION]
|
|
201
207
|
```
|
|
202
208
|
|
|
203
|
-
|
|
209
|
+
The exact PRIMARY artifact link/path must be present in the approval question itself; do not rely on a link in earlier commentary. The artifact named in the gate must be the same artifact requested/opened for presentation.
|
|
210
|
+
|
|
211
|
+
When the host exposes structured choice UI, render the actions as a single-select control rather than a numbered menu while preserving the consequence labels and the same work-item/artifact context in the question. Do not preselect or infer `Approve plan and begin implementation` merely because the plan exists, was opened, or the human invoked `/start-work`.
|
|
204
212
|
|
|
205
|
-
Only option 1 (or equivalent explicit free-text authorization) authorizes substantive implementation. Options 2-4 do not.
|
|
213
|
+
Only option 1 (or equivalent explicit free-text authorization) authorizes substantive implementation. Options 2-4 do not. Preview, navigation, cancellation, or a question asking where the plan is never counts as approval.
|
|
206
214
|
|
|
207
215
|
### Material plan changes after approval
|
|
208
216
|
|
|
@@ -222,10 +230,11 @@ APPROVED PLAN CHANGED
|
|
|
222
230
|
|
|
223
231
|
Material change: ...
|
|
224
232
|
Reason: ...
|
|
225
|
-
Revised
|
|
233
|
+
Revised PRIMARY artifact: <exact revised plan link/path | native plan surface>
|
|
234
|
+
Presentation: <actual presentation evidence>
|
|
226
235
|
```
|
|
227
236
|
|
|
228
|
-
Foreground the revised PRIMARY plan review surface when supported, then require renewed plan approval. Do not silently continue implementation under stale authorization.
|
|
237
|
+
Foreground the revised PRIMARY plan review surface when supported, then require renewed plan approval using the revised exact link/path inside the question. Do not silently continue implementation under stale authorization or reuse stale presentation evidence.
|
|
229
238
|
|
|
230
239
|
## 6. Working branch setup
|
|
231
240
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Project Forge Work Item Status
|
|
2
2
|
|
|
3
|
-
This optional local VS Code extension decorates Project Forge work-item folders in the Explorer from repository evidence and provides
|
|
3
|
+
This optional local VS Code extension decorates Project Forge work-item folders in the Explorer from repository evidence and provides read-only helpers for Project Forge human-review surfaces.
|
|
4
4
|
|
|
5
5
|
## Work-item status
|
|
6
6
|
|
|
@@ -18,12 +18,16 @@ Project Forge workflows may use **Project Forge: Open Review Artifact** immediat
|
|
|
18
18
|
|
|
19
19
|
The command accepts an exact workspace-relative repository artifact path when invoked programmatically. When run manually from the Command Palette without a path, it asks for the workspace-relative path.
|
|
20
20
|
|
|
21
|
+
On VS Code hosts that support the Language Model Tool API, the extension also contributes the read-only `projectForge_openReviewArtifact` tool so an agent can request the same exact presentation operation without arbitrary command execution. Older supported VS Code hosts keep the command/manual fallback.
|
|
22
|
+
|
|
21
23
|
Behavior:
|
|
22
24
|
|
|
23
|
-
- Markdown files
|
|
25
|
+
- Markdown files request rendered Markdown Preview first;
|
|
26
|
+
- when Markdown Preview is unavailable, the helper reports that fact and falls back to normal editor preview;
|
|
24
27
|
- other repository artifacts open in the normal VS Code editor preview;
|
|
25
28
|
- targets outside the currently open workspace are rejected;
|
|
26
|
-
- missing or ambiguous multi-root targets are reported rather than guessed;
|
|
29
|
+
- missing or ambiguous multi-root targets are reported rather than guessed from active editor focus;
|
|
30
|
+
- the presentation result distinguishes the resolved URI, requested mode, actual opened mode, cancellation, and failure;
|
|
27
31
|
- opening/previewing an artifact is read-only presentation and never records approval.
|
|
28
32
|
|
|
29
|
-
Project Forge should foreground only the PRIMARY review subject automatically. Supporting CONTEXT and TRACEABILITY documents remain available without stealing focus unless the human chooses to open them.
|
|
33
|
+
Project Forge should foreground only the exact PRIMARY review subject automatically. Supporting CONTEXT and TRACEABILITY documents remain available without stealing focus unless the human chooses to open them. The approval question itself must still identify and link the same artifact; a successful open is presentation evidence only.
|
|
@@ -13,6 +13,7 @@ const ID_FROM_NAME = /^([A-Za-z][A-Za-z0-9]*-\d+)(?:-|$)/;
|
|
|
13
13
|
const ID_FROM_BRANCH = /(?:^|\/)([A-Za-z][A-Za-z0-9]*-\d+)(?:-|\/|$)/i;
|
|
14
14
|
const MARKER = /<!--\s*project-forge-work-item:\s*([A-Za-z][A-Za-z0-9]*-\d+)\s*-->/gi;
|
|
15
15
|
const REFRESH_INTERVAL_MS = 120000;
|
|
16
|
+
const REVIEW_TOOL_NAME = 'projectForge_openReviewArtifact';
|
|
16
17
|
|
|
17
18
|
function normalizeId(value) {
|
|
18
19
|
return value ? value.toUpperCase() : undefined;
|
|
@@ -242,32 +243,42 @@ async function resolveReviewUri(target) {
|
|
|
242
243
|
throw new Error(`Review artifact was not found in the open workspace: ${requested}`);
|
|
243
244
|
}
|
|
244
245
|
|
|
245
|
-
const activeEditor = vscode.window.activeTextEditor;
|
|
246
|
-
const activeFolder = activeEditor
|
|
247
|
-
? vscode.workspace.getWorkspaceFolder(activeEditor.document.uri)
|
|
248
|
-
: undefined;
|
|
249
|
-
const activeMatch = activeFolder
|
|
250
|
-
? matches.find((entry) => entry.folder.uri.fsPath === activeFolder.uri.fsPath)
|
|
251
|
-
: undefined;
|
|
252
|
-
if (activeMatch) {
|
|
253
|
-
return activeMatch.uri;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
246
|
throw new Error(`Review artifact path is ambiguous across workspace folders: ${requested}`);
|
|
257
247
|
}
|
|
258
248
|
|
|
259
|
-
|
|
249
|
+
function requestedReviewMode(uri) {
|
|
250
|
+
const extension = path.extname(uri.fsPath).toLowerCase();
|
|
251
|
+
return extension === '.md' || extension === '.markdown'
|
|
252
|
+
? 'markdown-preview'
|
|
253
|
+
: 'editor-preview';
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
async function presentReviewArtifact(target, options = {}) {
|
|
257
|
+
const notify = options.notify !== false;
|
|
258
|
+
let uri;
|
|
260
259
|
try {
|
|
261
|
-
|
|
260
|
+
uri = await resolveReviewUri(target);
|
|
262
261
|
if (!uri) {
|
|
263
|
-
return
|
|
262
|
+
return {
|
|
263
|
+
status: 'cancelled',
|
|
264
|
+
uri: null,
|
|
265
|
+
requestedMode: null,
|
|
266
|
+
openedMode: null,
|
|
267
|
+
message: 'No review artifact was selected.',
|
|
268
|
+
};
|
|
264
269
|
}
|
|
265
270
|
|
|
266
|
-
const
|
|
267
|
-
if (
|
|
271
|
+
const requestedMode = requestedReviewMode(uri);
|
|
272
|
+
if (requestedMode === 'markdown-preview') {
|
|
268
273
|
try {
|
|
269
274
|
await vscode.commands.executeCommand('markdown.showPreview', uri);
|
|
270
|
-
return
|
|
275
|
+
return {
|
|
276
|
+
status: 'opened',
|
|
277
|
+
uri: uri.toString(),
|
|
278
|
+
requestedMode,
|
|
279
|
+
openedMode: 'rendered-markdown',
|
|
280
|
+
message: 'Rendered Markdown preview opened.',
|
|
281
|
+
};
|
|
271
282
|
} catch {
|
|
272
283
|
// Fall back to the normal editor preview surface when Markdown preview is unavailable.
|
|
273
284
|
}
|
|
@@ -277,11 +288,40 @@ async function openReviewArtifact(target) {
|
|
|
277
288
|
preview: true,
|
|
278
289
|
preserveFocus: false,
|
|
279
290
|
});
|
|
280
|
-
return
|
|
291
|
+
return {
|
|
292
|
+
status: 'opened',
|
|
293
|
+
uri: uri.toString(),
|
|
294
|
+
requestedMode,
|
|
295
|
+
openedMode: 'editor-preview',
|
|
296
|
+
message: requestedMode === 'markdown-preview'
|
|
297
|
+
? 'Rendered Markdown preview was unavailable; editor preview opened instead.'
|
|
298
|
+
: 'Editor preview opened.',
|
|
299
|
+
};
|
|
281
300
|
} catch (error) {
|
|
282
301
|
const message = error && error.message ? error.message : String(error);
|
|
283
|
-
|
|
284
|
-
|
|
302
|
+
if (notify) {
|
|
303
|
+
await vscode.window.showWarningMessage(`Project Forge review artifact: ${message}`);
|
|
304
|
+
}
|
|
305
|
+
return {
|
|
306
|
+
status: 'failed',
|
|
307
|
+
uri: uri ? uri.toString() : null,
|
|
308
|
+
requestedMode: uri ? requestedReviewMode(uri) : null,
|
|
309
|
+
openedMode: null,
|
|
310
|
+
message,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
async function openReviewArtifact(target) {
|
|
316
|
+
return presentReviewArtifact(target, { notify: true });
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
class OpenReviewArtifactTool {
|
|
320
|
+
async invoke(options) {
|
|
321
|
+
const result = await presentReviewArtifact(options && options.input, { notify: false });
|
|
322
|
+
return new vscode.LanguageModelToolResult([
|
|
323
|
+
new vscode.LanguageModelTextPart(JSON.stringify(result)),
|
|
324
|
+
]);
|
|
285
325
|
}
|
|
286
326
|
}
|
|
287
327
|
|
|
@@ -373,6 +413,18 @@ function activate(context) {
|
|
|
373
413
|
context.subscriptions.push(
|
|
374
414
|
vscode.commands.registerCommand('projectForge.openReviewArtifact', openReviewArtifact),
|
|
375
415
|
);
|
|
416
|
+
|
|
417
|
+
if (
|
|
418
|
+
vscode.lm &&
|
|
419
|
+
typeof vscode.lm.registerTool === 'function' &&
|
|
420
|
+
typeof vscode.LanguageModelToolResult === 'function' &&
|
|
421
|
+
typeof vscode.LanguageModelTextPart === 'function'
|
|
422
|
+
) {
|
|
423
|
+
context.subscriptions.push(
|
|
424
|
+
vscode.lm.registerTool(REVIEW_TOOL_NAME, new OpenReviewArtifactTool()),
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
|
|
376
428
|
context.subscriptions.push(
|
|
377
429
|
vscode.window.onDidChangeWindowState((event) => {
|
|
378
430
|
if (event.focused) {
|
|
@@ -406,4 +458,10 @@ function activate(context) {
|
|
|
406
458
|
|
|
407
459
|
function deactivate() {}
|
|
408
460
|
|
|
409
|
-
module.exports = {
|
|
461
|
+
module.exports = {
|
|
462
|
+
activate,
|
|
463
|
+
deactivate,
|
|
464
|
+
openReviewArtifact,
|
|
465
|
+
presentReviewArtifact,
|
|
466
|
+
resolveReviewUri,
|
|
467
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "project-forge-work-item-status",
|
|
3
3
|
"displayName": "Project Forge Work Item Status",
|
|
4
4
|
"description": "Shows evidence-backed Project Forge work-item status badges and provides read-only review-surface helpers in VS Code.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.3.0",
|
|
6
6
|
"publisher": "project-forge",
|
|
7
7
|
"license": "UNLICENSED",
|
|
8
8
|
"engines": {
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
],
|
|
20
20
|
"activationEvents": [
|
|
21
21
|
"workspaceContains:docs/work-items/*",
|
|
22
|
-
"onCommand:projectForge.openReviewArtifact"
|
|
22
|
+
"onCommand:projectForge.openReviewArtifact",
|
|
23
|
+
"onLanguageModelTool:projectForge_openReviewArtifact"
|
|
23
24
|
],
|
|
24
25
|
"main": "./extension.js",
|
|
25
26
|
"extensionKind": [
|
|
@@ -41,6 +42,29 @@
|
|
|
41
42
|
"command": "projectForge.openReviewArtifact",
|
|
42
43
|
"title": "Project Forge: Open Review Artifact"
|
|
43
44
|
}
|
|
45
|
+
],
|
|
46
|
+
"languageModelTools": [
|
|
47
|
+
{
|
|
48
|
+
"name": "projectForge_openReviewArtifact",
|
|
49
|
+
"displayName": "Open Project Forge Review Artifact",
|
|
50
|
+
"canBeReferencedInPrompt": true,
|
|
51
|
+
"toolReferenceName": "projectForgeReviewArtifact",
|
|
52
|
+
"userDescription": "Open an exact workspace review artifact using the safest read-only review surface available.",
|
|
53
|
+
"modelDescription": "Use immediately before a Project Forge artifact-based human approval gate when the exact review artifact path is already known. Opens only that exact workspace-contained file and returns structured presentation evidence. It never approves, edits, commits, or guesses an ambiguous target.",
|
|
54
|
+
"inputSchema": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"properties": {
|
|
57
|
+
"path": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "Exact workspace-relative or absolute workspace-contained path of the PRIMARY review artifact. Do not infer it from editor focus."
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"required": [
|
|
63
|
+
"path"
|
|
64
|
+
],
|
|
65
|
+
"additionalProperties": false
|
|
66
|
+
}
|
|
67
|
+
}
|
|
44
68
|
]
|
|
45
69
|
}
|
|
46
70
|
}
|