@blxzer/cursor-trellis 0.4.2 → 0.4.3
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 +24 -0
- package/README.md +23 -14
- package/README.zh-CN.md +14 -10
- package/bin/smart-search.js +10 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +36 -15
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +42 -153
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.d.ts +10 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +38 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/update.d.ts +5 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +137 -40
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/cursor.d.ts +2 -1
- package/dist/configurators/cursor.d.ts.map +1 -1
- package/dist/configurators/cursor.js +4 -2
- package/dist/configurators/cursor.js.map +1 -1
- package/dist/configurators/index.js +4 -4
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/shared.d.ts +8 -0
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +27 -1
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/workflow.d.ts +0 -9
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +2 -4
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/constants/paths.d.ts +9 -0
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +13 -0
- package/dist/constants/paths.js.map +1 -1
- package/dist/migrations/manifests/0.3.0.json +1 -1
- package/dist/templates/common/bundled-skills/cstl-meta/references/platform-files/skills-and-commands.md +2 -4
- package/dist/templates/common/bundled-skills/cstl-skill-creator/SKILL.md +10 -7
- package/dist/templates/common/bundled-skills/cstl-skill-creator/references/authoring-rules.md +93 -19
- package/dist/templates/common/bundled-skills/cstl-skill-creator/references/general-authoring.md +189 -0
- package/dist/templates/common/bundled-skills/cstl-skill-creator/references/review-checklist.md +10 -5
- package/dist/templates/common/commands/continue.md +5 -4
- package/dist/templates/common/index.d.ts +20 -0
- package/dist/templates/common/index.d.ts.map +1 -1
- package/dist/templates/common/index.js +21 -2
- package/dist/templates/common/index.js.map +1 -1
- package/dist/templates/common/optional-skills/chrome-cdp/SKILL.md +179 -0
- package/dist/templates/common/optional-skills/chrome-cdp/examples/fetch-hook-api-capture.md +149 -0
- package/dist/templates/common/optional-skills/chrome-cdp/scripts/cdp.mjs +903 -0
- package/dist/templates/cursor/agents/cstl-research.md +1 -1
- package/dist/templates/cursor/fixtures/expected-rules.d.ts +1 -1
- package/dist/templates/cursor/fixtures/expected-rules.d.ts.map +1 -1
- package/dist/templates/cursor/fixtures/expected-rules.js +7 -24
- package/dist/templates/cursor/fixtures/expected-rules.js.map +1 -1
- package/dist/templates/cursor/hooks.json +4 -0
- package/dist/templates/cursor/index.d.ts +1 -1
- package/dist/templates/cursor/index.js +1 -1
- package/dist/templates/cursor/rules/cstl-bootstrap.mdc +17 -0
- package/dist/templates/markdown/agents.md +15 -10
- package/dist/templates/markdown/framework/cursor-native-modes-guide.md.txt +12 -9
- package/dist/templates/markdown/framework/cursor-subagent-policy.md.txt +62 -126
- package/dist/templates/markdown/framework/dogfood-only-surfaces.md.txt +4 -6
- package/dist/templates/markdown/framework/execution-strategy.md.txt +2 -0
- package/dist/templates/markdown/framework/index.md.txt +4 -0
- package/dist/templates/markdown/framework/internal-skills-cursor-reachability.md.txt +4 -3
- package/dist/templates/markdown/framework/middleware-protocol.md.txt +83 -0
- package/dist/templates/markdown/framework/parallel-first-execution.md.txt +78 -0
- package/dist/templates/markdown/framework/release-boundary.md.txt +30 -0
- package/dist/templates/markdown/framework/retrieval-daily-guide.md.txt +1 -1
- package/dist/templates/markdown/framework/upgrade.md.txt +15 -0
- package/dist/templates/markdown/index.d.ts +4 -0
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +17 -0
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/spec/guides/index.md.txt +0 -6
- package/dist/templates/shared-hooks/event-bridge.py +60 -0
- package/dist/templates/shared-hooks/index.d.ts +1 -1
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +1 -0
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/session-start.py +18 -1
- package/dist/templates/trellis/CONTEXT.md +63 -3
- package/dist/templates/trellis/gitignore.txt +39 -39
- package/dist/templates/trellis/index.d.ts +12 -0
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +73 -15
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/pool/README.md +12 -3
- package/dist/templates/trellis/pool/plan.md +24 -5
- package/dist/templates/trellis/scripts/common/adapter_middleware.py +158 -0
- package/dist/templates/trellis/scripts/common/artifact_locale.py +12 -3
- package/dist/templates/trellis/scripts/common/cursor_retrieval_env.py +5 -2
- package/dist/templates/trellis/scripts/common/full_quality.py +237 -0
- package/dist/templates/trellis/scripts/common/git.py +6 -0
- package/dist/templates/trellis/scripts/common/git_context.py +17 -5
- package/dist/templates/trellis/scripts/common/kernel_command.py +367 -0
- package/dist/templates/trellis/scripts/common/lite_context.py +280 -0
- package/dist/templates/trellis/scripts/common/ondemand_topology.py +225 -0
- package/dist/templates/trellis/scripts/common/parent_orchestration.py +1 -1
- package/dist/templates/trellis/scripts/common/pool_store.py +16 -4
- package/dist/templates/trellis/scripts/common/retrieval_agent_instructions.py +2 -2
- package/dist/templates/trellis/scripts/common/session_context.py +28 -2
- package/dist/templates/trellis/scripts/common/task_gates.py +73 -12
- package/dist/templates/trellis/scripts/common/task_map.py +42 -9
- package/dist/templates/trellis/scripts/common/task_store.py +286 -56
- package/dist/templates/trellis/scripts/common/test_adapter_middleware.py +56 -0
- package/dist/templates/trellis/scripts/common/test_depends_mode_block.py +9 -0
- package/dist/templates/trellis/scripts/common/test_full_quality.py +197 -0
- package/dist/templates/trellis/scripts/common/test_kernel_command.py +326 -0
- package/dist/templates/trellis/scripts/common/test_lite_path.py +190 -0
- package/dist/templates/trellis/scripts/common/test_ondemand_topology.py +122 -0
- package/dist/templates/trellis/scripts/common/test_pool_store.py +17 -0
- package/dist/templates/trellis/scripts/common/test_task_store_kernel_patch.py +163 -0
- package/dist/templates/trellis/scripts/common/workflow_phase.py +3 -0
- package/dist/templates/trellis/scripts/get_context.py +1 -0
- package/dist/templates/trellis/scripts/pool.py +5 -0
- package/dist/templates/trellis/scripts/task.py +83 -7
- package/dist/templates/trellis/workflow.md +100 -18
- package/dist/utils/cursor-retrieval-env.d.ts +2 -1
- package/dist/utils/cursor-retrieval-env.d.ts.map +1 -1
- package/dist/utils/cursor-retrieval-env.js +3 -2
- package/dist/utils/cursor-retrieval-env.js.map +1 -1
- package/dist/utils/cursor2plus-residue-cleanup.d.ts +38 -0
- package/dist/utils/cursor2plus-residue-cleanup.d.ts.map +1 -0
- package/dist/utils/cursor2plus-residue-cleanup.js +145 -0
- package/dist/utils/cursor2plus-residue-cleanup.js.map +1 -0
- package/dist/utils/manifest-prune.d.ts.map +1 -1
- package/dist/utils/manifest-prune.js +7 -2
- package/dist/utils/manifest-prune.js.map +1 -1
- package/dist/utils/p36-upgrade.d.ts +62 -0
- package/dist/utils/p36-upgrade.d.ts.map +1 -0
- package/dist/utils/p36-upgrade.js +160 -0
- package/dist/utils/p36-upgrade.js.map +1 -0
- package/dist/utils/project-capabilities.d.ts +1 -12
- package/dist/utils/project-capabilities.d.ts.map +1 -1
- package/dist/utils/project-capabilities.js +3 -100
- package/dist/utils/project-capabilities.js.map +1 -1
- package/dist/utils/readiness.d.ts +10 -0
- package/dist/utils/readiness.d.ts.map +1 -1
- package/dist/utils/readiness.js +58 -26
- package/dist/utils/readiness.js.map +1 -1
- package/dist/utils/retrieval-agent-instructions.js +1 -1
- package/dist/utils/retrieval-agent-instructions.js.map +1 -1
- package/dist/utils/template-hash.d.ts.map +1 -1
- package/dist/utils/template-hash.js +11 -1
- package/dist/utils/template-hash.js.map +1 -1
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
- package/dist/utils/uninstall-scrubbers.js +52 -14
- package/dist/utils/uninstall-scrubbers.js.map +1 -1
- package/dist/utils/update-rollout-report.d.ts +14 -0
- package/dist/utils/update-rollout-report.d.ts.map +1 -1
- package/dist/utils/update-rollout-report.js +1 -0
- package/dist/utils/update-rollout-report.js.map +1 -1
- package/dist/utils/workflow-ownership.d.ts +1 -1
- package/dist/utils/workflow-ownership.js +4 -4
- package/dist/utils/workflow-ownership.js.map +1 -1
- package/package.json +5 -4
- package/scripts/postinstall.js +6 -7
- package/dist/commands/campaign/canvas-render.d.ts +0 -68
- package/dist/commands/campaign/canvas-render.d.ts.map +0 -1
- package/dist/commands/campaign/canvas-render.js +0 -414
- package/dist/commands/campaign/canvas-render.js.map +0 -1
- package/dist/commands/campaign/compose.d.ts +0 -15
- package/dist/commands/campaign/compose.d.ts.map +0 -1
- package/dist/commands/campaign/compose.js +0 -110
- package/dist/commands/campaign/compose.js.map +0 -1
- package/dist/commands/campaign/index.d.ts +0 -13
- package/dist/commands/campaign/index.d.ts.map +0 -1
- package/dist/commands/campaign/index.js +0 -134
- package/dist/commands/campaign/index.js.map +0 -1
- package/dist/commands/campaign/kind-map.d.ts +0 -6
- package/dist/commands/campaign/kind-map.d.ts.map +0 -1
- package/dist/commands/campaign/kind-map.js +0 -21
- package/dist/commands/campaign/kind-map.js.map +0 -1
- package/dist/commands/campaign/mcp-server.d.ts +0 -6
- package/dist/commands/campaign/mcp-server.d.ts.map +0 -1
- package/dist/commands/campaign/mcp-server.js +0 -167
- package/dist/commands/campaign/mcp-server.js.map +0 -1
- package/dist/commands/campaign/render.d.ts +0 -5
- package/dist/commands/campaign/render.d.ts.map +0 -1
- package/dist/commands/campaign/render.js +0 -103
- package/dist/commands/campaign/render.js.map +0 -1
- package/dist/commands/campaign/trellis-load.d.ts +0 -13
- package/dist/commands/campaign/trellis-load.d.ts.map +0 -1
- package/dist/commands/campaign/trellis-load.js +0 -122
- package/dist/commands/campaign/trellis-load.js.map +0 -1
- package/dist/commands/campaign/types.d.ts +0 -61
- package/dist/commands/campaign/types.d.ts.map +0 -1
- package/dist/commands/campaign/types.js +0 -3
- package/dist/commands/campaign/types.js.map +0 -1
- package/dist/commands/goal/index.d.ts +0 -3
- package/dist/commands/goal/index.d.ts.map +0 -1
- package/dist/commands/goal/index.js +0 -159
- package/dist/commands/goal/index.js.map +0 -1
- package/dist/commands/goal/review.d.ts +0 -6
- package/dist/commands/goal/review.d.ts.map +0 -1
- package/dist/commands/goal/review.js +0 -28
- package/dist/commands/goal/review.js.map +0 -1
- package/dist/commands/rpc/client.d.ts +0 -51
- package/dist/commands/rpc/client.d.ts.map +0 -1
- package/dist/commands/rpc/client.js +0 -147
- package/dist/commands/rpc/client.js.map +0 -1
- package/dist/commands/rpc/index.d.ts +0 -10
- package/dist/commands/rpc/index.d.ts.map +0 -1
- package/dist/commands/rpc/index.js +0 -157
- package/dist/commands/rpc/index.js.map +0 -1
- package/dist/commands/rpc/serve.d.ts +0 -23
- package/dist/commands/rpc/serve.d.ts.map +0 -1
- package/dist/commands/rpc/serve.js +0 -60
- package/dist/commands/rpc/serve.js.map +0 -1
- package/dist/commands/rpc/smoke.d.ts +0 -16
- package/dist/commands/rpc/smoke.d.ts.map +0 -1
- package/dist/commands/rpc/smoke.js +0 -92
- package/dist/commands/rpc/smoke.js.map +0 -1
- package/dist/commands/sdk/index.d.ts +0 -9
- package/dist/commands/sdk/index.d.ts.map +0 -1
- package/dist/commands/sdk/index.js +0 -58
- package/dist/commands/sdk/index.js.map +0 -1
- package/dist/commands/sdk/run.d.ts +0 -42
- package/dist/commands/sdk/run.d.ts.map +0 -1
- package/dist/commands/sdk/run.js +0 -220
- package/dist/commands/sdk/run.js.map +0 -1
- package/dist/commands/sdk/status.d.ts +0 -14
- package/dist/commands/sdk/status.d.ts.map +0 -1
- package/dist/commands/sdk/status.js +0 -69
- package/dist/commands/sdk/status.js.map +0 -1
- package/dist/configurators/cursor2plus-local.d.ts +0 -6
- package/dist/configurators/cursor2plus-local.d.ts.map +0 -1
- package/dist/configurators/cursor2plus-local.js +0 -21
- package/dist/configurators/cursor2plus-local.js.map +0 -1
- package/dist/goal/action-packet.d.ts +0 -89
- package/dist/goal/action-packet.d.ts.map +0 -1
- package/dist/goal/action-packet.js +0 -113
- package/dist/goal/action-packet.js.map +0 -1
- package/dist/goal/audit.d.ts +0 -14
- package/dist/goal/audit.d.ts.map +0 -1
- package/dist/goal/audit.js +0 -12
- package/dist/goal/audit.js.map +0 -1
- package/dist/goal/constants.d.ts +0 -26
- package/dist/goal/constants.d.ts.map +0 -1
- package/dist/goal/constants.js +0 -24
- package/dist/goal/constants.js.map +0 -1
- package/dist/goal/paths.d.ts +0 -8
- package/dist/goal/paths.d.ts.map +0 -1
- package/dist/goal/paths.js +0 -36
- package/dist/goal/paths.js.map +0 -1
- package/dist/goal/preflight.d.ts +0 -21
- package/dist/goal/preflight.d.ts.map +0 -1
- package/dist/goal/preflight.js +0 -97
- package/dist/goal/preflight.js.map +0 -1
- package/dist/goal/review-seam.d.ts +0 -44
- package/dist/goal/review-seam.d.ts.map +0 -1
- package/dist/goal/review-seam.js +0 -153
- package/dist/goal/review-seam.js.map +0 -1
- package/dist/goal/reviewer-rules.d.ts +0 -13
- package/dist/goal/reviewer-rules.d.ts.map +0 -1
- package/dist/goal/reviewer-rules.js +0 -153
- package/dist/goal/reviewer-rules.js.map +0 -1
- package/dist/goal/reviewer.d.ts +0 -9
- package/dist/goal/reviewer.d.ts.map +0 -1
- package/dist/goal/reviewer.js +0 -54
- package/dist/goal/reviewer.js.map +0 -1
- package/dist/goal/runtime.d.ts +0 -32
- package/dist/goal/runtime.d.ts.map +0 -1
- package/dist/goal/runtime.js +0 -242
- package/dist/goal/runtime.js.map +0 -1
- package/dist/goal/sdk-client.d.ts +0 -10
- package/dist/goal/sdk-client.d.ts.map +0 -1
- package/dist/goal/sdk-client.js +0 -34
- package/dist/goal/sdk-client.js.map +0 -1
- package/dist/goal/state.d.ts +0 -40
- package/dist/goal/state.d.ts.map +0 -1
- package/dist/goal/state.js +0 -37
- package/dist/goal/state.js.map +0 -1
- package/dist/goal/task-triggers.d.ts +0 -15
- package/dist/goal/task-triggers.d.ts.map +0 -1
- package/dist/goal/task-triggers.js +0 -23
- package/dist/goal/task-triggers.js.map +0 -1
- package/dist/goal/walls.d.ts +0 -12
- package/dist/goal/walls.d.ts.map +0 -1
- package/dist/goal/walls.js +0 -65
- package/dist/goal/walls.js.map +0 -1
- package/dist/goal/worker-prompt.d.ts +0 -13
- package/dist/goal/worker-prompt.d.ts.map +0 -1
- package/dist/goal/worker-prompt.js +0 -41
- package/dist/goal/worker-prompt.js.map +0 -1
- package/dist/goal/worker.d.ts +0 -42
- package/dist/goal/worker.d.ts.map +0 -1
- package/dist/goal/worker.js +0 -180
- package/dist/goal/worker.js.map +0 -1
- package/dist/templates/common/bundled-skills/cstl-cursor2plus-setup/SKILL.md +0 -63
- package/dist/templates/cursor/commands/cursor2plus-setup.md +0 -82
- package/dist/templates/cursor/rules/cstl-cursor-modes.mdc +0 -32
- package/dist/templates/cursor/rules/cstl-session-rename.mdc +0 -31
- package/dist/templates/cursor/rules/cstl-subagent-dispatch.mdc +0 -34
- package/dist/templates/cursor/rules/cstl-triage.mdc +0 -36
- package/dist/templates/cursor/rules/retrieval-routing.mdc +0 -78
- package/dist/templates/trellis/local/README.md +0 -85
- package/dist/templates/trellis/local/config.local.json.example +0 -6
- package/dist/templates/trellis/local/index.d.ts +0 -8
- package/dist/templates/trellis/local/index.d.ts.map +0 -1
- package/dist/templates/trellis/local/index.js +0 -15
- package/dist/templates/trellis/local/index.js.map +0 -1
- package/dist/templates/trellis/local/patch_wpelc8.py +0 -421
- package/dist/templates/trellis/local/smoke.py +0 -94
- package/dist/templates/trellis/local/subagent-models.json.example +0 -4
- package/dist/templates/trellis/local/trellis-task-models.json.example +0 -10
- package/dist/templates/trellis/local/trellis-task-models.json5.example +0 -45
- package/dist/templates/trellis/local/trellis_task_models_config.py +0 -200
- package/dist/utils/cursor-sdk-gate.d.ts +0 -10
- package/dist/utils/cursor-sdk-gate.d.ts.map +0 -1
- package/dist/utils/cursor-sdk-gate.js +0 -32
- package/dist/utils/cursor-sdk-gate.js.map +0 -1
package/dist/commands/update.js
CHANGED
|
@@ -2,7 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import inquirer from "inquirer";
|
|
5
|
-
import { DIR_NAMES, FILE_NAMES, PATHS } from "../constants/paths.js";
|
|
5
|
+
import { DIR_NAMES, FILE_NAMES, PATHS, isUserMiddlewareOverlayPath, } from "../constants/paths.js";
|
|
6
6
|
import { VERSION, PACKAGE_NAME } from "../constants/version.js";
|
|
7
7
|
import { getMigrationsForVersion, getAllMigrations, getMigrationMetadata, getConfigSectionsAddedBetween, } from "../migrations/index.js";
|
|
8
8
|
import { assessCstlDirectoryMigrate } from "../utils/workflow-ownership.js";
|
|
@@ -11,11 +11,12 @@ import { loadHashes, saveHashes, updateHashes, isTemplateModified, removeHash, r
|
|
|
11
11
|
import { compareVersions } from "../utils/compare-versions.js";
|
|
12
12
|
import { toPosix } from "../utils/posix.js";
|
|
13
13
|
import { setupProxy } from "../utils/proxy.js";
|
|
14
|
-
import {
|
|
14
|
+
import { reportUpdateReadiness, snapshotReadinessForRollout, } from "../utils/readiness.js";
|
|
15
15
|
import { collectProjectCapabilityTemplates, loadProjectCapabilities, } from "../utils/project-capabilities.js";
|
|
16
|
+
import { applyArtifactMigration, applyKernelCreate, planArtifactMigration, planWaveC, scanContractMigration, writeWaveCConfirmed, } from "@blxzer/cursor-trellis-core/task";
|
|
16
17
|
import { emptyTaskJson } from "../utils/task-json.js";
|
|
18
|
+
import { applyOfficialRetire, composeP36Plan, officialWorkPending, planOfficialSurfaceA, printP36Vernacular, p36SummaryForRollout, waveCWorkPending, } from "../utils/p36-upgrade.js";
|
|
17
19
|
// Import templates for comparison
|
|
18
|
-
import { cursor2plusPatchScript, cursor2plusReadme, cursor2plusConfigExample, subagentModelsExample, trellisTaskModelsJson5Example, trellisTaskModelsConfigPy, } from "../templates/trellis/local/index.js";
|
|
19
20
|
import { getAllScripts, getAllPoolSkeleton,
|
|
20
21
|
// Configuration
|
|
21
22
|
configYamlTemplate, gitignoreTemplate, workflowMdTemplate, executionStrategyRulesJson, } from "../templates/trellis/index.js";
|
|
@@ -26,14 +27,14 @@ import { replacePythonCommandLiterals } from "../configurators/shared.js";
|
|
|
26
27
|
import { pruneOrphanManifestKeys } from "../utils/manifest-prune.js";
|
|
27
28
|
import { runPostUpdateSmoke } from "../utils/post-update-smoke.js";
|
|
28
29
|
import { assertCursorRulesValid } from "../utils/validate-rules.js";
|
|
30
|
+
import { cleanupCursor2plusResidue, hasCursor2plusBundleResidue, } from "../utils/cursor2plus-residue-cleanup.js";
|
|
29
31
|
import { buildFilePlanFromChanges, createBaseRolloutReport, emitRolloutReport, migrationResultToSummary, summarizeMigrationPlan, } from "../utils/update-rollout-report.js";
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const bundleDir = path.join(cwd, DIR_NAMES.WORKFLOW, "local", "cursor2plus");
|
|
33
|
-
if (!fs.existsSync(bundleDir)) {
|
|
32
|
+
function logCursor2plusRetiredResidueNotice(cwd) {
|
|
33
|
+
if (!hasCursor2plusBundleResidue(cwd)) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
console.log(chalk.
|
|
36
|
+
console.log(chalk.yellow("\nCursor++ path retired: leftover `.cstl/local/cursor2plus/` (or `.trellis/…`) is not an install surface."));
|
|
37
|
+
console.log(chalk.gray(" Do not run patch scripts. Unmodified managed residue is removed by update hash-safe cleanup; review and manually delete any user-modified leftover files if unused."));
|
|
37
38
|
}
|
|
38
39
|
const CSTL_BLOCK_START = "<!-- CSTL:START -->";
|
|
39
40
|
const CSTL_BLOCK_END = "<!-- CSTL:END -->";
|
|
@@ -48,6 +49,7 @@ const PROTECTED_PATHS = [
|
|
|
48
49
|
`${DIR_NAMES.WORKFLOW}/${DIR_NAMES.WORKSPACE}`, // workspace/
|
|
49
50
|
`${DIR_NAMES.WORKFLOW}/${DIR_NAMES.TASKS}`, // tasks/
|
|
50
51
|
`${DIR_NAMES.WORKFLOW}/${DIR_NAMES.SPEC}`, // spec/
|
|
52
|
+
PATHS.MIDDLEWARE, // user overlay — never write/delete/hash
|
|
51
53
|
`${DIR_NAMES.WORKFLOW}/.developer`,
|
|
52
54
|
`${DIR_NAMES.WORKFLOW}/.current-task`,
|
|
53
55
|
];
|
|
@@ -509,19 +511,8 @@ bypassUpdateSkip = false) {
|
|
|
509
511
|
files.set(`${DIR_NAMES.WORKFLOW}/config.yaml`, configYamlTemplate);
|
|
510
512
|
files.set(`${DIR_NAMES.WORKFLOW}/config/execution-strategy-rules.json`, executionStrategyRulesJson);
|
|
511
513
|
files.set(`${DIR_NAMES.WORKFLOW}/.gitignore`, gitignoreTemplate);
|
|
512
|
-
|
|
513
|
-
//
|
|
514
|
-
// when the project already has the directory (keep existing installs;
|
|
515
|
-
// never inject it into projects that declined the opt-in at init time).
|
|
516
|
-
const cursor2plusInstalled = fs.existsSync(path.join(cwd, localPrefix, "cursor2plus"));
|
|
517
|
-
if (cursor2plusInstalled) {
|
|
518
|
-
files.set(`${localPrefix}/cursor2plus/patch_wpelc8.py`, cursor2plusPatchScript);
|
|
519
|
-
files.set(`${localPrefix}/cursor2plus/trellis_task_models_config.py`, trellisTaskModelsConfigPy);
|
|
520
|
-
files.set(`${localPrefix}/cursor2plus/README.md`, cursor2plusReadme);
|
|
521
|
-
files.set(`${localPrefix}/cursor2plus/config.local.json.example`, cursor2plusConfigExample);
|
|
522
|
-
files.set(`${localPrefix}/subagent-models.json.example`, subagentModelsExample);
|
|
523
|
-
files.set(`${localPrefix}/trellis-task-models.json5.example`, trellisTaskModelsJson5Example);
|
|
524
|
-
}
|
|
514
|
+
// Cursor++ local bundle is retired — never refresh or inject
|
|
515
|
+
// `.cstl/local/cursor2plus/` (or sibling example files) on update.
|
|
525
516
|
// workflow.md is included here because it is runtime-parsed by
|
|
526
517
|
// get_context.py and shared hooks. Keep it on the normal template update
|
|
527
518
|
// path: if the installed file still matches the tracked hash, update the
|
|
@@ -572,6 +563,14 @@ bypassUpdateSkip = false) {
|
|
|
572
563
|
for (const [filePath, content] of files) {
|
|
573
564
|
files.set(filePath, replacePythonCommandLiterals(content));
|
|
574
565
|
}
|
|
566
|
+
// User overlay is never a template — strip even if a future collector
|
|
567
|
+
// accidentally adds it. Cursor++ residue cleanup is a separate allow-list
|
|
568
|
+
// and must not target this directory.
|
|
569
|
+
for (const [filePath] of [...files]) {
|
|
570
|
+
if (isUserMiddlewareOverlayPath(filePath)) {
|
|
571
|
+
files.delete(filePath);
|
|
572
|
+
}
|
|
573
|
+
}
|
|
575
574
|
return files;
|
|
576
575
|
}
|
|
577
576
|
/**
|
|
@@ -796,6 +795,7 @@ const BACKUP_EXCLUDE_PATTERNS = [
|
|
|
796
795
|
"/workspace/", // Developer workspace (user data)
|
|
797
796
|
"/tasks/", // Task data (user data)
|
|
798
797
|
"/spec/", // Spec files (user-customized content)
|
|
798
|
+
"/middleware/", // User middleware overlay (never managed)
|
|
799
799
|
"/backlog/", // Backlog data (user data)
|
|
800
800
|
"/agent-traces/", // Agent traces (user data, legacy name)
|
|
801
801
|
// Platform-native worktree dirs — these are full sub-repos the CLI
|
|
@@ -1433,6 +1433,7 @@ function rolloutOptionsFromUpdate(options) {
|
|
|
1433
1433
|
migrate: Boolean(options.migrate),
|
|
1434
1434
|
allowDowngrade: Boolean(options.allowDowngrade),
|
|
1435
1435
|
skipReadiness: Boolean(options.skipReadiness),
|
|
1436
|
+
writeArtifacts: Boolean(options.writeArtifacts),
|
|
1436
1437
|
};
|
|
1437
1438
|
}
|
|
1438
1439
|
function upgradeDirectionFromCompare(cliVsProject, projectVersion) {
|
|
@@ -1456,10 +1457,10 @@ function releaseBlockersFromReadiness(readiness, cliBehindNpm, cliVersion, lates
|
|
|
1456
1457
|
if (!readiness.skipped && !readiness.smartSearch.ok) {
|
|
1457
1458
|
blockers.push({
|
|
1458
1459
|
code: "smart_search_readiness",
|
|
1459
|
-
message: "Smart Search readiness
|
|
1460
|
+
message: "Smart Search readiness unverified (does not block Proceed?)",
|
|
1460
1461
|
recovery: [
|
|
1461
1462
|
"smart-search doctor --format json",
|
|
1462
|
-
"
|
|
1463
|
+
"Treat Smart Search as unverified; official files can still update after Proceed?",
|
|
1463
1464
|
],
|
|
1464
1465
|
});
|
|
1465
1466
|
}
|
|
@@ -1467,8 +1468,10 @@ function releaseBlockersFromReadiness(readiness, cliBehindNpm, cliVersion, lates
|
|
|
1467
1468
|
if (!cap.ok) {
|
|
1468
1469
|
blockers.push({
|
|
1469
1470
|
code: `capability_${cap.id}`,
|
|
1470
|
-
message: `Capability ${cap.id} readiness
|
|
1471
|
-
recovery: [
|
|
1471
|
+
message: `Capability ${cap.id} readiness unverified (does not block Proceed?)`,
|
|
1472
|
+
recovery: [
|
|
1473
|
+
"Treat this capability as unverified; official files can still update after Proceed?",
|
|
1474
|
+
],
|
|
1472
1475
|
});
|
|
1473
1476
|
}
|
|
1474
1477
|
}
|
|
@@ -1537,21 +1540,12 @@ export async function update(options) {
|
|
|
1537
1540
|
console.log(chalk.cyan("══════════════\n"));
|
|
1538
1541
|
// Set up proxy before any network calls (npm version check)
|
|
1539
1542
|
setupProxy();
|
|
1540
|
-
checkSmartSearchReadiness({
|
|
1541
|
-
skipReadiness: options.skipReadiness,
|
|
1542
|
-
skipReadinessCommand: "cstl update --skip-readiness",
|
|
1543
|
-
});
|
|
1544
|
-
checkProjectCapabilityReadiness({
|
|
1545
|
-
cwd,
|
|
1546
|
-
selected: loadProjectCapabilities(cwd),
|
|
1547
|
-
skipReadiness: options.skipReadiness,
|
|
1548
|
-
skipReadinessCommand: "cstl update --skip-readiness",
|
|
1549
|
-
});
|
|
1550
1543
|
readinessSnapshot = snapshotReadinessForRollout({
|
|
1551
1544
|
cwd,
|
|
1552
1545
|
selected: loadProjectCapabilities(cwd),
|
|
1553
1546
|
skipReadiness: options.skipReadiness,
|
|
1554
1547
|
});
|
|
1548
|
+
reportUpdateReadiness(readinessSnapshot);
|
|
1555
1549
|
// Get versions
|
|
1556
1550
|
projectVersion = getInstalledVersion(cwd);
|
|
1557
1551
|
cliVersion = VERSION;
|
|
@@ -1722,6 +1716,19 @@ export async function update(options) {
|
|
|
1722
1716
|
if (safeFileDeletes.length > 0) {
|
|
1723
1717
|
printSafeFileDeleteSummary(safeFileDeletes);
|
|
1724
1718
|
}
|
|
1719
|
+
// Preview Cursor++ residue cleanup (hash-safe; always considered)
|
|
1720
|
+
const cursor2plusResiduePreview = cleanupCursor2plusResidue(cwd, {
|
|
1721
|
+
dryRun: true,
|
|
1722
|
+
});
|
|
1723
|
+
if (cursor2plusResiduePreview.deleted.length > 0) {
|
|
1724
|
+
console.log(chalk.cyan("\nCursor++ residue cleanup (hash-safe):"));
|
|
1725
|
+
for (const rel of cursor2plusResiduePreview.deleted) {
|
|
1726
|
+
console.log(chalk.gray(` would delete: ${rel}`));
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
if (cursor2plusResiduePreview.preservedModified.length > 0) {
|
|
1730
|
+
console.log(chalk.yellow(` preserve (user-modified): ${cursor2plusResiduePreview.preservedModified.join(", ")}`));
|
|
1731
|
+
}
|
|
1725
1732
|
// Analyze changes (pass hashes for modification detection)
|
|
1726
1733
|
const changes = analyzeChanges(cwd, hashes, templates);
|
|
1727
1734
|
const missingAgentsMdHash = collectMissingAgentsMdHash(changes, hashes);
|
|
@@ -1739,6 +1746,7 @@ export async function update(options) {
|
|
|
1739
1746
|
userDeletedFiles: changes.userDeletedFiles,
|
|
1740
1747
|
safeDeletePaths,
|
|
1741
1748
|
});
|
|
1749
|
+
const p36State = {};
|
|
1742
1750
|
const emitRollout = (outcome, extra) => {
|
|
1743
1751
|
const readiness = readinessSnapshot ??
|
|
1744
1752
|
snapshotReadinessForRollout({
|
|
@@ -1765,11 +1773,32 @@ export async function update(options) {
|
|
|
1765
1773
|
apply: extra?.apply,
|
|
1766
1774
|
postUpdateSmoke: extra?.postUpdateSmoke,
|
|
1767
1775
|
releaseBlockers: releaseBlockersFromReadiness(readiness, cliVsNpm < 0 && latestNpmVersion !== null, cliVersion, latestNpmVersion),
|
|
1776
|
+
p36: extra?.p36 ?? p36State.report,
|
|
1768
1777
|
});
|
|
1769
1778
|
finishRollout(options, report);
|
|
1770
1779
|
};
|
|
1771
1780
|
// Print summary
|
|
1772
1781
|
printChangeSummary(changes);
|
|
1782
|
+
const officialPlan = planOfficialSurfaceA({
|
|
1783
|
+
cwd,
|
|
1784
|
+
hashes,
|
|
1785
|
+
refresh: changes.autoUpdateFiles.map((file) => file.relativePath),
|
|
1786
|
+
preserved: changes.changedFiles.map((file) => file.relativePath),
|
|
1787
|
+
added: changes.newFiles.map((file) => file.relativePath),
|
|
1788
|
+
});
|
|
1789
|
+
const artifactPlan = planArtifactMigration({ root: cwd });
|
|
1790
|
+
const waveCPlan = planWaveC({
|
|
1791
|
+
root: cwd,
|
|
1792
|
+
report: scanContractMigration({ root: cwd }),
|
|
1793
|
+
});
|
|
1794
|
+
const p36Plan = composeP36Plan({
|
|
1795
|
+
official: officialPlan,
|
|
1796
|
+
artifacts: artifactPlan,
|
|
1797
|
+
writeArtifacts: Boolean(options.writeArtifacts),
|
|
1798
|
+
waveC: waveCPlan,
|
|
1799
|
+
});
|
|
1800
|
+
p36State.report = p36SummaryForRollout(p36Plan);
|
|
1801
|
+
printP36Vernacular(p36Plan);
|
|
1773
1802
|
// First-time hash tracking hint
|
|
1774
1803
|
if (isFirstHashTracking && changes.changedFiles.length > 0) {
|
|
1775
1804
|
console.log(chalk.cyan("ℹ️ First update with hash tracking enabled."));
|
|
@@ -1785,11 +1814,17 @@ export async function update(options) {
|
|
|
1785
1814
|
classifiedMigrations &&
|
|
1786
1815
|
(classifiedMigrations.auto.length > 0 ||
|
|
1787
1816
|
classifiedMigrations.confirm.length > 0);
|
|
1817
|
+
const hasOfficialP36 = officialWorkPending(officialPlan);
|
|
1818
|
+
const hasMaintainerArtifactWrites = Boolean(options.writeArtifacts) && artifactPlan.writable.length > 0;
|
|
1819
|
+
const hasWaveCPending = waveCWorkPending(p36Plan);
|
|
1788
1820
|
if (changes.newFiles.length === 0 &&
|
|
1789
1821
|
changes.autoUpdateFiles.length === 0 &&
|
|
1790
1822
|
changes.changedFiles.length === 0 &&
|
|
1791
1823
|
!hasPendingMigrations &&
|
|
1792
|
-
!hasSafeDeletes
|
|
1824
|
+
!hasSafeDeletes &&
|
|
1825
|
+
!hasOfficialP36 &&
|
|
1826
|
+
!hasMaintainerArtifactWrites &&
|
|
1827
|
+
!hasWaveCPending) {
|
|
1793
1828
|
if (!options.dryRun && missingAgentsMdHash.size > 0) {
|
|
1794
1829
|
updateHashes(cwd, missingAgentsMdHash);
|
|
1795
1830
|
}
|
|
@@ -1859,6 +1894,10 @@ export async function update(options) {
|
|
|
1859
1894
|
emitRollout("would_apply", { files: buildRolloutFilePlan() });
|
|
1860
1895
|
return;
|
|
1861
1896
|
}
|
|
1897
|
+
// File-conflict flags (--force / --skip-all / --create-new) consent to apply
|
|
1898
|
+
// official A writes. They are not Wave C stop-read confirm. Only interactive
|
|
1899
|
+
// Proceed? yes writes `.cstl/.p36-wave-c.json`.
|
|
1900
|
+
let waveCInteractivelyConfirmed = false;
|
|
1862
1901
|
// Batch-resolution flags are explicit consent for non-interactive runs.
|
|
1863
1902
|
// Prompting here breaks CI and `node ... update --force --migrate` smoke tests.
|
|
1864
1903
|
if (!options.force && !options.skipAll && !options.createNew) {
|
|
@@ -1884,6 +1923,7 @@ export async function update(options) {
|
|
|
1884
1923
|
emitRollout("cancelled", { files: buildRolloutFilePlan() });
|
|
1885
1924
|
return;
|
|
1886
1925
|
}
|
|
1926
|
+
waveCInteractivelyConfirmed = true;
|
|
1887
1927
|
}
|
|
1888
1928
|
// Create complete backup of all managed platform/workflow directories
|
|
1889
1929
|
const backupDir = createFullBackup(cwd);
|
|
@@ -1891,6 +1931,10 @@ export async function update(options) {
|
|
|
1891
1931
|
if (backupDir) {
|
|
1892
1932
|
console.log(chalk.gray(`\nBackup created: ${path.relative(cwd, backupDir)}/`));
|
|
1893
1933
|
}
|
|
1934
|
+
const officialRetired = applyOfficialRetire(cwd, officialPlan);
|
|
1935
|
+
if (officialRetired > 0) {
|
|
1936
|
+
console.log(chalk.cyan(`\nStopped ${officialRetired} extra official always-on rule(s)`));
|
|
1937
|
+
}
|
|
1894
1938
|
// Execute migrations if --migrate flag is set
|
|
1895
1939
|
if (options.migrate && classifiedMigrations) {
|
|
1896
1940
|
const pendingRenameItems = [
|
|
@@ -1952,6 +1996,15 @@ export async function update(options) {
|
|
|
1952
1996
|
console.log(chalk.cyan(`\nCleaned up ${safeDeleted} deprecated command file(s)`));
|
|
1953
1997
|
}
|
|
1954
1998
|
}
|
|
1999
|
+
// Hash-safe Cursor++ residue cleanup (retired product surfaces)
|
|
2000
|
+
const cursor2plusCleanup = cleanupCursor2plusResidue(cwd);
|
|
2001
|
+
if (cursor2plusCleanup.deleted.length > 0) {
|
|
2002
|
+
safeDeleted += cursor2plusCleanup.deleted.length;
|
|
2003
|
+
console.log(chalk.cyan(`\nCleaned up ${cursor2plusCleanup.deleted.length} retired Cursor++ file(s)`));
|
|
2004
|
+
}
|
|
2005
|
+
if (cursor2plusCleanup.preservedModified.length > 0) {
|
|
2006
|
+
console.log(chalk.yellow(`Preserved user-modified Cursor++ residue: ${cursor2plusCleanup.preservedModified.join(", ")}`));
|
|
2007
|
+
}
|
|
1955
2008
|
// Track results
|
|
1956
2009
|
let added = 0;
|
|
1957
2010
|
let autoUpdated = 0;
|
|
@@ -2056,6 +2109,22 @@ export async function update(options) {
|
|
|
2056
2109
|
if (filesToHash.size > 0) {
|
|
2057
2110
|
updateHashes(cwd, filesToHash);
|
|
2058
2111
|
}
|
|
2112
|
+
let artifactApply = null;
|
|
2113
|
+
if (options.writeArtifacts && artifactPlan.writable.length > 0) {
|
|
2114
|
+
artifactApply = applyArtifactMigration({
|
|
2115
|
+
root: cwd,
|
|
2116
|
+
plan: artifactPlan,
|
|
2117
|
+
});
|
|
2118
|
+
if (artifactApply.ok) {
|
|
2119
|
+
console.log(chalk.cyan(`\nWrote ${artifactApply.written} artifact projection(s); business text kept.`));
|
|
2120
|
+
}
|
|
2121
|
+
else {
|
|
2122
|
+
console.log(chalk.yellow("产物写入失败,已回到双读。项目仍可用,可再跑 update。"));
|
|
2123
|
+
if (artifactApply.error) {
|
|
2124
|
+
console.log(chalk.gray(` ${artifactApply.error}`));
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2059
2128
|
// Print summary
|
|
2060
2129
|
console.log(chalk.cyan("\n--- Summary ---\n"));
|
|
2061
2130
|
if (added > 0) {
|
|
@@ -2079,12 +2148,36 @@ export async function update(options) {
|
|
|
2079
2148
|
if (configSectionsAppended > 0) {
|
|
2080
2149
|
console.log(` Config sections added: ${configSectionsAppended}`);
|
|
2081
2150
|
}
|
|
2151
|
+
if (officialRetired > 0) {
|
|
2152
|
+
console.log(` Official always-on stopped: ${officialRetired}`);
|
|
2153
|
+
}
|
|
2154
|
+
if (artifactApply?.ok && artifactApply.written > 0) {
|
|
2155
|
+
console.log(` Artifact projections written: ${artifactApply.written}`);
|
|
2156
|
+
}
|
|
2157
|
+
if (artifactApply && !artifactApply.ok) {
|
|
2158
|
+
console.log(" Artifact projections: rolled back to dual-read");
|
|
2159
|
+
}
|
|
2160
|
+
if (hasWaveCPending && waveCInteractivelyConfirmed) {
|
|
2161
|
+
try {
|
|
2162
|
+
writeWaveCConfirmed(cwd);
|
|
2163
|
+
console.log(" 已确认停读旧形状(leftover kind/mode/classification 不再当唯一真相)");
|
|
2164
|
+
}
|
|
2165
|
+
catch (err) {
|
|
2166
|
+
console.log(chalk.yellow("停读确认未写上。项目仍可用,旧字段仍双读,可再跑 update。"));
|
|
2167
|
+
if (err instanceof Error && err.message) {
|
|
2168
|
+
console.log(chalk.gray(` ${err.message}`));
|
|
2169
|
+
}
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
else if (hasWaveCPending) {
|
|
2173
|
+
console.log(chalk.yellow(" 旧字段仍双读。停读需要再跑一次交互式 `cstl update` 并确认 Proceed?(--force / --skip-all / --create-new 不算停读确认)。"));
|
|
2174
|
+
}
|
|
2082
2175
|
if (backupDir) {
|
|
2083
2176
|
console.log(` Backup: ${path.relative(cwd, backupDir)}/`);
|
|
2084
2177
|
}
|
|
2085
2178
|
const actionWord = isDowngrade ? "Downgrade" : "Update";
|
|
2086
2179
|
console.log(chalk.green(`\n✅ ${actionWord} complete! (${projectVersion} → ${cliVersion})`));
|
|
2087
|
-
|
|
2180
|
+
logCursor2plusRetiredResidueNotice(cwd);
|
|
2088
2181
|
if (createdNew > 0) {
|
|
2089
2182
|
console.log(chalk.gray("\nTip: Review .new files and merge changes manually if needed."));
|
|
2090
2183
|
}
|
|
@@ -2135,9 +2228,13 @@ export async function update(options) {
|
|
|
2135
2228
|
assignee: currentDeveloper,
|
|
2136
2229
|
createdAt: todayStr,
|
|
2137
2230
|
});
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2231
|
+
applyKernelCreate({
|
|
2232
|
+
taskDir,
|
|
2233
|
+
actor: "cstl update",
|
|
2234
|
+
idempotencyKey: `update:${taskSlug}`,
|
|
2235
|
+
record: taskJson,
|
|
2236
|
+
evidence: "cstl update migration skeleton",
|
|
2237
|
+
});
|
|
2141
2238
|
// Build PRD content
|
|
2142
2239
|
let prdContent = `# Migration Task: Upgrade to v${cliVersion}\n\n`;
|
|
2143
2240
|
prdContent += `**Created**: ${todayStr}\n`;
|