flower-trellis 0.4.8 → 0.4.10
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/enhancements/0.6/overrides/workflow-states/in_progress-inline.md +4 -3
- package/enhancements/0.6/overrides/workflow-states/in_progress.md +4 -3
- package/enhancements/0.6/overrides/workflow-states/no_task.md +1 -1
- package/enhancements/0.6/overrides/workflow-states/planning-inline.md +1 -1
- package/enhancements/0.6/overrides/workflow-states/planning.md +1 -1
- package/enhancements/MANIFEST.json +2 -2
- package/package.json +3 -3
- package/src/lib/self-check.js +54 -3
|
@@ -3,11 +3,12 @@ HIGHEST PRIORITY SKILL-GARDEN STATE GUARD (in_progress-inline):
|
|
|
3
3
|
Hub is source of truth for Task Brief, Routing, Post-Check, Commit, and Snapshot gates.
|
|
4
4
|
Before first implement route, restate `<task>/brief.md`; if missing, read artifacts and suggest backfill.
|
|
5
5
|
New work not plainly covered by active task title/brief: stop before route/edits; recommend new task; if declined, confirm untracked work; if it belongs here, update artifacts first.
|
|
6
|
-
At project-local knowledge boundaries, run `spec_router.py`; skip trivial/read-only turns unless local conventions may affect the approach.
|
|
6
|
+
At project-local knowledge boundaries, run `python3 ./.trellis/scripts/spec_router.py "<intended action>"`; read high-confidence matches before acting; read medium-confidence matches only when clearly relevant; skip trivial/read-only turns unless local conventions may affect the approach.
|
|
7
7
|
Inline workflow-state is not an inline route decision. Phase 2.1/2.2 must reuse explicit target-matched `route_decision`; otherwise invoke `trellis-route`. If unavailable, read local `trellis-route/SKILL.md`, show numbered choices, and wait.
|
|
8
8
|
Summaries, preferences, `codex-mode`, raw `.runtime`, and empty/stale prefs are not route evidence unless `trellis-route` validates them; user reselect/override wins.
|
|
9
9
|
Ignore lower direct-edit/check shortcuts. Do not default inline just because this state is inline or helper is unavailable. Dispatch subagents only when route selected subagent.
|
|
10
|
-
After check/check-all
|
|
11
|
-
|
|
10
|
+
After `trellis-check` / `trellis-check-all`, stop and report; point the user to Phase 3.4 `trellis-push` (or commit-only when needed). Do not run `/trellis:finish-work` unless the user explicitly asks after Phase 3.4 is complete.
|
|
11
|
+
This guard overrides any lower `Flow: ... -> /trellis:finish-work` line in this state block.
|
|
12
|
+
At Phase 3.4, code commit/push goes through `trellis-push` (commit-only mode for commit-without-push); never bare `git commit`/`git push` on code (hub: Code Commit Confirmation Gate).
|
|
12
13
|
Push snapshot recovery: follow the hub; use `push_snapshot.py status --json` only when needed.
|
|
13
14
|
<!-- END skill-garden workflow-state in_progress_inline v0.6 -->
|
|
@@ -3,11 +3,12 @@ HIGHEST PRIORITY SKILL-GARDEN STATE GUARD (in_progress):
|
|
|
3
3
|
Hub is source of truth for Task Brief, Routing, Post-Check, Commit, and Snapshot gates.
|
|
4
4
|
Before first implement route, restate `<task>/brief.md`; if missing, read artifacts and suggest backfill.
|
|
5
5
|
New work not plainly covered by active task title/brief: stop before route/edits; recommend new task; if declined, confirm untracked work; if it belongs here, update artifacts first.
|
|
6
|
-
At project-local knowledge boundaries, run `spec_router.py`; skip trivial/read-only turns unless local conventions may affect the approach.
|
|
6
|
+
At project-local knowledge boundaries, run `python3 ./.trellis/scripts/spec_router.py "<intended action>"`; read high-confidence matches before acting; read medium-confidence matches only when clearly relevant; skip trivial/read-only turns unless local conventions may affect the approach.
|
|
7
7
|
Phase 2.1/2.2: reuse only explicit target-matched `route_decision`; otherwise invoke `trellis-route`. If skill invocation is unavailable, read local `trellis-route/SKILL.md`, show numbered choices, and wait.
|
|
8
8
|
Summaries, preferences, `codex-mode`, raw `.runtime`, and empty/stale prefs are not route evidence unless `trellis-route` validates them; user reselect/override wins.
|
|
9
9
|
Ignore lower direct-dispatch shortcuts. Do not spawn `trellis-implement` or `trellis-check*` unless route selected subagent. If route cannot be resolved, do not default inline.
|
|
10
|
-
After check/check-all
|
|
11
|
-
|
|
10
|
+
After `trellis-check` / `trellis-check-all`, stop and report; point the user to Phase 3.4 `trellis-push` (or commit-only when needed). Do not run `/trellis:finish-work` unless the user explicitly asks after Phase 3.4 is complete.
|
|
11
|
+
This guard overrides any lower `Flow: ... -> /trellis:finish-work` line in this state block.
|
|
12
|
+
At Phase 3.4, code commit/push goes through `trellis-push` (commit-only mode for commit-without-push); never bare `git commit`/`git push` on code (hub: Code Commit Confirmation Gate).
|
|
12
13
|
Push snapshot recovery: follow the hub; use `push_snapshot.py status --json` only when needed.
|
|
13
14
|
<!-- END skill-garden workflow-state in_progress v0.6 -->
|
|
@@ -3,7 +3,7 @@ HIGHEST PRIORITY SKILL-GARDEN STATE GUARD (no_task):
|
|
|
3
3
|
Creating or resuming a task is not implementation permission.
|
|
4
4
|
After PRD is ready and the task is started, the next implementation action is Phase 2.1 `trellis-route(implement)` unless a valid current-task implement route decision already exists.
|
|
5
5
|
If no active task exists, use `push_snapshot.py status --json` once per session; if it returns candidates, relay them and suggest rebinding before resuming.
|
|
6
|
-
At project-local knowledge boundaries, run `spec_router.py`; skip trivial/read-only turns unless local conventions may affect the approach.
|
|
6
|
+
At project-local knowledge boundaries, run `python3 ./.trellis/scripts/spec_router.py "<intended action>"`; read high-confidence matches before acting; read medium-confidence matches only when clearly relevant; skip trivial/read-only turns unless local conventions may affect the approach.
|
|
7
7
|
Do NOT call the harness built-in plan mode (`EnterPlanMode` / `ExitPlanMode`) for Trellis planning. It is not a substitute for Trellis task-creation consent, Trellis planning, or the route gate. For new, complex, or unclear work, classify the turn, ask for task-creation consent, then use `trellis-brainstorm`; `task.py create` and the default `prd.md` are not sufficient planning.
|
|
8
8
|
For lightweight Trellis meta edits, ask/confirm skipping Trellis tracking before edits.
|
|
9
9
|
<!-- END skill-garden workflow-state no_task v0.6 -->
|
|
@@ -6,6 +6,6 @@ A created task or existing `prd.md` is not enough to start implementation.
|
|
|
6
6
|
Complete prd.md + required context first.
|
|
7
7
|
If the active workflow later routes to sub-agent execution, required context includes real curated entries in both `implement.jsonl` and `check.jsonl`; the seed `_example` row alone is not ready.
|
|
8
8
|
Before `task.py start`, use `trellis-task-brief` to refresh `brief.md` from the latest task artifacts and display it in chat for review.
|
|
9
|
-
At project-local knowledge boundaries, run `spec_router.py`; skip trivial/read-only turns unless local conventions may affect the approach.
|
|
9
|
+
At project-local knowledge boundaries, run `python3 ./.trellis/scripts/spec_router.py "<intended action>"`; read high-confidence matches before acting; read medium-confidence matches only when clearly relevant; skip trivial/read-only turns unless local conventions may affect the approach.
|
|
10
10
|
After status becomes in_progress, next action = `trellis-route(implement)`, not direct edits.
|
|
11
11
|
<!-- END skill-garden workflow-state planning_inline v0.6 -->
|
|
@@ -6,6 +6,6 @@ A created task or existing `prd.md` is not enough to start implementation.
|
|
|
6
6
|
Complete prd.md + required context first.
|
|
7
7
|
For sub-agent-dispatch platforms, required context includes real curated entries in both `implement.jsonl` and `check.jsonl`; the seed `_example` row alone is not ready.
|
|
8
8
|
Before `task.py start`, use `trellis-task-brief` to refresh `brief.md` from the latest task artifacts and display it in chat for review.
|
|
9
|
-
At project-local knowledge boundaries, run `spec_router.py`; skip trivial/read-only turns unless local conventions may affect the approach.
|
|
9
|
+
At project-local knowledge boundaries, run `python3 ./.trellis/scripts/spec_router.py "<intended action>"`; read high-confidence matches before acting; read medium-confidence matches only when clearly relevant; skip trivial/read-only turns unless local conventions may affect the approach.
|
|
10
10
|
After status becomes in_progress, next action = `trellis-route(implement)`, not direct edits.
|
|
11
11
|
<!-- END skill-garden workflow-state planning v0.6 -->
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"syncedAt": "2026-07-
|
|
2
|
+
"syncedAt": "2026-07-08T03:53:14.101Z",
|
|
3
3
|
"syncedFrom": "vendor/skill-garden",
|
|
4
|
-
"sourceCommit": "
|
|
4
|
+
"sourceCommit": "6ecfb1b46320d82aeb3e83442235f271d92aa398",
|
|
5
5
|
"common": {
|
|
6
6
|
"codexSkills": [
|
|
7
7
|
"craft-rpa",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flower-trellis",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.10",
|
|
4
4
|
"description": "一键安装/升级 Trellis 并自动融合 skill-garden 强化包(默认 Claude + agents)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"commit-and-tag-version": "^12.7.3"
|
|
59
59
|
},
|
|
60
60
|
"flowerReleaseNotes": {
|
|
61
|
-
"version": "0.4.
|
|
61
|
+
"version": "0.4.10",
|
|
62
62
|
"source": "CHANGELOG.md",
|
|
63
|
-
"body": "###
|
|
63
|
+
"body": "### 🐛 修复 Bug Fixes\n\n* **flower:** 项目侧待更新提示会显示对应版本更新摘要 ([cc98c02](https://github.com/SilentFlower/flower-trellis/commit/cc98c021eb0536f693f50651854093a4795d9e93))",
|
|
64
64
|
"truncated": false
|
|
65
65
|
}
|
|
66
66
|
}
|
package/src/lib/self-check.js
CHANGED
|
@@ -119,6 +119,46 @@ function releaseNotesFromMetadata(metadata, range) {
|
|
|
119
119
|
return buildReleaseNotesSummary(metadata?.releaseNotesByVersion, range);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
/**
|
|
123
|
+
* 安全执行 npm metadata 拉取。
|
|
124
|
+
*
|
|
125
|
+
* 默认 fetcher 已经吞掉网络错误;这里再兜底测试注入的 fetcher,确保 release notes
|
|
126
|
+
* 补拉失败不会破坏 self-check 主流程。
|
|
127
|
+
*
|
|
128
|
+
* @param {() => Promise<object|null>} fetchMetadata npm metadata 拉取函数
|
|
129
|
+
* @returns {Promise<object|null>} registry metadata,失败时为 null
|
|
130
|
+
*/
|
|
131
|
+
async function safeFetchPackageUpdateMetadata(fetchMetadata) {
|
|
132
|
+
try {
|
|
133
|
+
return await fetchMetadata();
|
|
134
|
+
} catch {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 缓存命中但缺少摘要时,主动补拉 release notes。
|
|
141
|
+
*
|
|
142
|
+
* 这个补拉只服务当前 actionable 提示的摘要展示,不能把失败写成新的远程版本证据;
|
|
143
|
+
* 成功时也只写回 lastReleaseNotes,保持 lastRemote 仍只记录 dist-tags。
|
|
144
|
+
*
|
|
145
|
+
* @param {string} target 目标项目根
|
|
146
|
+
* @param {object|null} manifest 目标项目 manifest
|
|
147
|
+
* @param {boolean} writeCache 是否允许写缓存
|
|
148
|
+
* @param {object|null} range release notes 范围
|
|
149
|
+
* @param {() => Promise<object|null>} fetchMetadata npm metadata 拉取函数
|
|
150
|
+
* @returns {Promise<object|null>} release notes 摘要;范围有效但不可用时返回 unavailable 摘要
|
|
151
|
+
*/
|
|
152
|
+
async function fetchMissingReleaseNotes(target, manifest, writeCache, range, fetchMetadata) {
|
|
153
|
+
if (!range) return null;
|
|
154
|
+
const metadata = await safeFetchPackageUpdateMetadata(fetchMetadata);
|
|
155
|
+
const releaseNotes = releaseNotesFromMetadata(metadata, range);
|
|
156
|
+
if (releaseNotes && !releaseNotes.unavailable && writeCache && manifest) {
|
|
157
|
+
writeUpdateCheck(target, { lastReleaseNotes: releaseNotes });
|
|
158
|
+
}
|
|
159
|
+
return releaseNotes;
|
|
160
|
+
}
|
|
161
|
+
|
|
122
162
|
/** 检查目标目录 git 工作区是否 clean。 */
|
|
123
163
|
function gitSafety(target) {
|
|
124
164
|
const common = {
|
|
@@ -312,12 +352,15 @@ export function safetyState(target, status, command) {
|
|
|
312
352
|
* 构建启动自更新检查结果。
|
|
313
353
|
*
|
|
314
354
|
* @param {string} target 目标项目根
|
|
315
|
-
* @param {{writeCache?: boolean, forceRemote?: boolean}} options 检查选项
|
|
355
|
+
* @param {{writeCache?: boolean, forceRemote?: boolean, fetchMetadata?: () => Promise<object|null>}} options 检查选项
|
|
316
356
|
* @returns {Promise<object>} 结构化检查结果
|
|
317
357
|
*/
|
|
318
358
|
export async function buildSelfCheck(target, options = {}) {
|
|
319
359
|
const writeCache = options.writeCache !== false;
|
|
320
360
|
const forceRemote = options.forceRemote === true;
|
|
361
|
+
const fetchMetadata = typeof options.fetchMetadata === "function"
|
|
362
|
+
? options.fetchMetadata
|
|
363
|
+
: fetchPackageUpdateMetadata;
|
|
321
364
|
const now = new Date();
|
|
322
365
|
const absoluteTarget = path.resolve(target);
|
|
323
366
|
const trellisDir = path.join(absoluteTarget, ".trellis");
|
|
@@ -404,11 +447,19 @@ export async function buildSelfCheck(target, options = {}) {
|
|
|
404
447
|
}
|
|
405
448
|
if (projectOutOfSync) {
|
|
406
449
|
const releaseNotesRange = projectReleaseNotesRange(projectFlower, currentFlower);
|
|
450
|
+
const releaseNotes = cachedReleaseNotes(updateCheck, releaseNotesRange) ||
|
|
451
|
+
await fetchMissingReleaseNotes(
|
|
452
|
+
absoluteTarget,
|
|
453
|
+
manifest,
|
|
454
|
+
writeCache,
|
|
455
|
+
releaseNotesRange,
|
|
456
|
+
fetchMetadata,
|
|
457
|
+
);
|
|
407
458
|
return projectOutOfSyncResult(base, absoluteTarget, {
|
|
408
459
|
tags,
|
|
409
460
|
fromCache: true,
|
|
410
461
|
skipped: true,
|
|
411
|
-
},
|
|
462
|
+
}, releaseNotes);
|
|
412
463
|
}
|
|
413
464
|
return {
|
|
414
465
|
...base,
|
|
@@ -418,7 +469,7 @@ export async function buildSelfCheck(target, options = {}) {
|
|
|
418
469
|
};
|
|
419
470
|
}
|
|
420
471
|
|
|
421
|
-
const metadata = await
|
|
472
|
+
const metadata = await safeFetchPackageUpdateMetadata(fetchMetadata);
|
|
422
473
|
if (!metadata) {
|
|
423
474
|
if (writeCache && manifest) {
|
|
424
475
|
writeUpdateCheck(absoluteTarget, {
|