@brainervirus/workit-core 0.6.1 → 0.7.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/package.json +3 -7
- package/scripts/doctor-check.ts +20 -0
- package/scripts/install-cursor-plugin.sh +51 -28
- package/scripts/install-opencode-plugin.sh +19 -21
- package/scripts/rewrite-workspace-deps.ts +15 -9
- package/scripts/sync-runtime.sh +71 -19
- package/scripts/vendor-assets.ts +37 -0
- package/skills/wk-implement/SKILL.md +2 -2
- package/skills/wk-pr/SKILL.md +1 -1
- package/src/core/boundary.ts +27 -0
- package/src/core/branch-policy.ts +63 -0
- package/src/core/branch.ts +30 -16
- package/src/core/config.ts +193 -31
- package/src/core/docs-layout.ts +251 -0
- package/src/core/docs-migration.ts +639 -0
- package/src/core/docs-repo.ts +11 -9
- package/src/core/docs-validate.ts +18 -6
- package/src/core/doctor.ts +801 -0
- package/src/core/flow-state.ts +1579 -141
- package/src/core/git.ts +22 -5
- package/src/{tools/handoff.ts → core/handoff-tools.ts} +5 -57
- package/src/core/hygiene.ts +26 -12
- package/src/core/init.ts +43 -11
- package/src/core/logger.ts +321 -0
- package/src/core/package-root.ts +28 -0
- package/src/core/ports/init-toolkit-status.ts +1 -1
- package/src/core/ports/vcs-verify-token.ts +1 -1
- package/src/core/ports/youtrack-api.ts +1 -1
- package/src/core/ports/youtrack-verify-token.ts +1 -1
- package/src/core/pr-create.ts +116 -21
- package/src/core/registration.ts +215 -0
- package/src/core/repo-context.ts +447 -0
- package/src/core/repo-tools.ts +23 -0
- package/src/core/safe-write.ts +22 -0
- package/src/core/scripts.ts +3 -44
- package/src/core/sdd.ts +45 -28
- package/src/core/setup-state.ts +54 -0
- package/src/core/setup.ts +1216 -0
- package/src/core/skill-manifests.ts +95 -0
- package/src/core/support-matrix.ts +12 -0
- package/src/core/sync-runtime.ts +348 -0
- package/src/core/templates.ts +2 -2
- package/src/core/vcs-config.ts +107 -37
- package/src/core/verify-project.ts +181 -0
- package/src/core/workspaces.ts +136 -17
- package/src/core/youtrack-tools.ts +228 -0
- package/src/core/youtrack.ts +125 -67
- package/templates/execution-contract.md +9 -7
- package/templates/superpowers-doc-contract.md +4 -3
- package/scripts/_shared/common.sh +0 -173
- package/scripts/changelog-context.sh +0 -42
- package/scripts/docs-refresh-context.sh +0 -40
- package/scripts/init/apply.sh +0 -5
- package/scripts/init/status.sh +0 -5
- package/scripts/init/toolkit-status.sh +0 -5
- package/scripts/pr-create.sh +0 -5
- package/scripts/pr-ready-context.sh +0 -88
- package/scripts/present/ascii-wireframe.sh +0 -5
- package/scripts/present/flow-diagram.sh +0 -5
- package/scripts/release-notes-context.sh +0 -40
- package/scripts/vcs/config.sh +0 -5
- package/scripts/vcs/merged-style.sh +0 -5
- package/scripts/vcs/token-create-urls.sh +0 -5
- package/scripts/vcs/verify-token.sh +0 -5
- package/scripts/verify-project.sh +0 -140
- package/scripts/youtrack/api.sh +0 -5
- package/scripts/youtrack/config.sh +0 -5
- package/scripts/youtrack/greeting.sh +0 -5
- package/scripts/youtrack/parse-duration.sh +0 -5
- package/scripts/youtrack/token-create-url.sh +0 -5
- package/scripts/youtrack/verify-token.sh +0 -5
- package/scripts/youtrack/work-date-ms.sh +0 -5
- package/src/tools/docs-repo.ts +0 -51
- package/src/tools/flow.ts +0 -99
- package/src/tools/index.ts +0 -22
- package/src/tools/present.ts +0 -49
- package/src/tools/repo.ts +0 -490
- package/src/tools/rules.ts +0 -30
- package/src/tools/sdd.ts +0 -216
- package/src/tools/templates.ts +0 -27
- package/src/tools/youtrack.ts +0 -423
|
@@ -2,6 +2,7 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
2
2
|
import { hygieneFiles } from "./hygiene";
|
|
3
3
|
import { execFileSync } from "node:child_process";
|
|
4
4
|
import path from "node:path";
|
|
5
|
+
import { resolveCanonicalLayout, resolveDocsPath } from "./docs-layout";
|
|
5
6
|
|
|
6
7
|
export type DocError = { code: string; message: string; path?: string };
|
|
7
8
|
|
|
@@ -107,9 +108,15 @@ export const docsValidate = ({
|
|
|
107
108
|
quality: QualityFinding[];
|
|
108
109
|
}
|
|
109
110
|
| { ok: false; errors: DocError[]; error: string } => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
// One shared contained path contract (DC-01, DC-02): absolute/traversal/
|
|
112
|
+
// symlink-escape/cross-slug/wrong-basename/legacy paths all fail here before
|
|
113
|
+
// any document bytes are read.
|
|
114
|
+
const resolved = resolveCanonicalLayout({ workspace_root, spec_path, plan_path });
|
|
115
|
+
if (!resolved.ok) return failValidate([err("path_contract", resolved.error)]);
|
|
116
|
+
const cwd = resolved.layout.workspace;
|
|
117
|
+
const specAbs = resolved.layout.spec;
|
|
118
|
+
const planAbs = resolved.layout.plan;
|
|
119
|
+
const slug = resolved.layout.slug;
|
|
113
120
|
const errors: DocError[] = [];
|
|
114
121
|
|
|
115
122
|
const read = (p: string): string | null => {
|
|
@@ -138,8 +145,14 @@ export const docsValidate = ({
|
|
|
138
145
|
errors.push(err("missing_spec_link", "**Spec:** link required in plan", plan_path));
|
|
139
146
|
} else {
|
|
140
147
|
const linked = (linkMatch[1] ?? linkMatch[2] ?? "").trim();
|
|
141
|
-
|
|
142
|
-
|
|
148
|
+
// The plan link is a path inside the workspace docs tree: canonicalize it
|
|
149
|
+
// under the same contained contract before comparing to the canonical spec.
|
|
150
|
+
const linkedResolved = resolveDocsPath({ workspace_root: cwd, path: linked });
|
|
151
|
+
if (!linkedResolved.ok) {
|
|
152
|
+
errors.push(
|
|
153
|
+
err("spec_link_escape", `plan **Spec:** ${linked} is not a contained docs path`, plan_path),
|
|
154
|
+
);
|
|
155
|
+
} else if (linkedResolved.path !== specAbs) {
|
|
143
156
|
errors.push(
|
|
144
157
|
err(
|
|
145
158
|
"spec_mismatch",
|
|
@@ -189,7 +202,6 @@ export const docsValidate = ({
|
|
|
189
202
|
const relSpec = path.isAbsolute(spec_path) ? path.relative(cwd, specAbs) : spec_path;
|
|
190
203
|
const relPlan = path.isAbsolute(plan_path) ? path.relative(cwd, planAbs) : plan_path;
|
|
191
204
|
const quality = qualitySpec(specText!);
|
|
192
|
-
const slug = path.basename(path.dirname(spec_path));
|
|
193
205
|
if (!sddIgnored(cwd, slug)) {
|
|
194
206
|
quality.push({
|
|
195
207
|
code: "sdd_not_ignored",
|