@tacuchi/agent-workflow-cli 22.4.2 → 23.0.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/README.md +2 -2
- package/dist/adapters/git-cli.js +59 -17
- package/dist/adapters/git-cli.js.map +1 -1
- package/dist/adapters/node-file-system.js +55 -1
- package/dist/adapters/node-file-system.js.map +1 -1
- package/dist/application/artifacts-service.js +2 -2
- package/dist/application/artifacts-service.js.map +1 -1
- package/dist/application/capability/dispatcher.js +2 -2
- package/dist/application/capability/dispatcher.js.map +1 -1
- package/dist/application/capability/installed-inventory.js +2 -2
- package/dist/application/capability/installed-inventory.js.map +1 -1
- package/dist/application/capability/readiness.js +1 -1
- package/dist/application/capability/readiness.js.map +1 -1
- package/dist/application/check-branch-service.js +2 -2
- package/dist/application/check-branch-service.js.map +1 -1
- package/dist/application/checkpoint/files-touched.js +271 -0
- package/dist/application/checkpoint/files-touched.js.map +1 -0
- package/dist/application/checkpoint/markdown.js +61 -8
- package/dist/application/checkpoint/markdown.js.map +1 -1
- package/dist/application/checkpoint/state-reader.js +8 -2
- package/dist/application/checkpoint/state-reader.js.map +1 -1
- package/dist/application/checkpoint-write-service.js +16 -5
- package/dist/application/checkpoint-write-service.js.map +1 -1
- package/dist/application/claims-ledger.js +330 -0
- package/dist/application/claims-ledger.js.map +1 -0
- package/dist/application/claims-recovery.js +338 -0
- package/dist/application/claims-recovery.js.map +1 -0
- package/dist/application/dev-only-services.js +154 -44
- package/dist/application/dev-only-services.js.map +1 -1
- package/dist/application/elicitation-server.js +382 -0
- package/dist/application/elicitation-server.js.map +1 -0
- package/dist/application/elicitation-stdio.js +48 -0
- package/dist/application/elicitation-stdio.js.map +1 -0
- package/dist/application/flow/advance.js +86 -5
- package/dist/application/flow/advance.js.map +1 -1
- package/dist/application/flow/checkout-observation.js +152 -0
- package/dist/application/flow/checkout-observation.js.map +1 -0
- package/dist/application/flow/flow-service.js +72 -13
- package/dist/application/flow/flow-service.js.map +1 -1
- package/dist/application/flow/internal-actions.js +460 -1
- package/dist/application/flow/internal-actions.js.map +1 -1
- package/dist/application/flow/internal-drive.js +22 -9
- package/dist/application/flow/internal-drive.js.map +1 -1
- package/dist/application/flow/prove.js +205 -0
- package/dist/application/flow/prove.js.map +1 -0
- package/dist/application/flow/run-journey.js +15 -0
- package/dist/application/flow/run-journey.js.map +1 -0
- package/dist/application/flow/run-projection.js +15 -3
- package/dist/application/flow/run-projection.js.map +1 -1
- package/dist/application/flow/run-state-service.js +19 -4
- package/dist/application/flow/run-state-service.js.map +1 -1
- package/dist/application/flow/submit.js +250 -72
- package/dist/application/flow/submit.js.map +1 -1
- package/dist/application/generate-launch-service.js +4 -4
- package/dist/application/generate-launch-service.js.map +1 -1
- package/dist/application/git-flow-service.js +9 -0
- package/dist/application/git-flow-service.js.map +1 -1
- package/dist/application/local-proposal.js +9 -0
- package/dist/application/local-proposal.js.map +1 -1
- package/dist/application/lock-service.js +6 -3
- package/dist/application/lock-service.js.map +1 -1
- package/dist/application/mcp-doctor-service.js.map +1 -1
- package/dist/application/mcp-host-reader.js +30 -13
- package/dist/application/mcp-host-reader.js.map +1 -1
- package/dist/application/mcp-host-writer.js +136 -112
- package/dist/application/mcp-host-writer.js.map +1 -1
- package/dist/application/mcp-remove-service.js +7 -3
- package/dist/application/mcp-remove-service.js.map +1 -1
- package/dist/application/mcp-scope-common.js +1 -3
- package/dist/application/mcp-scope-common.js.map +1 -1
- package/dist/application/mcp-setup-service.js +7 -3
- package/dist/application/mcp-setup-service.js.map +1 -1
- package/dist/application/merge-state-service.js +10 -16
- package/dist/application/merge-state-service.js.map +1 -1
- package/dist/application/multiroot/claude.js +34 -15
- package/dist/application/multiroot/claude.js.map +1 -1
- package/dist/application/multiroot/codex.js +9 -5
- package/dist/application/multiroot/codex.js.map +1 -1
- package/dist/application/multiroot-service.js +20 -11
- package/dist/application/multiroot-service.js.map +1 -1
- package/dist/application/parsers/project-block.js +25 -2
- package/dist/application/parsers/project-block.js.map +1 -1
- package/dist/application/paths-service.js +30 -31
- package/dist/application/paths-service.js.map +1 -1
- package/dist/application/plan-exec-batch-service.js +549 -0
- package/dist/application/plan-exec-batch-service.js.map +1 -0
- package/dist/application/plan-exec-decision-service.js +273 -0
- package/dist/application/plan-exec-decision-service.js.map +1 -0
- package/dist/application/project-md-service.js +2 -2
- package/dist/application/project-md-service.js.map +1 -1
- package/dist/application/project-md-upsert-service.js +4 -4
- package/dist/application/project-md-upsert-service.js.map +1 -1
- package/dist/application/project-tab-data.js +12 -7
- package/dist/application/project-tab-data.js.map +1 -1
- package/dist/application/release-data-service.js +2 -2
- package/dist/application/release-data-service.js.map +1 -1
- package/dist/application/resume-service.js +32 -11
- package/dist/application/resume-service.js.map +1 -1
- package/dist/application/retirement/apply.js +84 -0
- package/dist/application/retirement/apply.js.map +1 -1
- package/dist/application/retirement/attribution.js +31 -1
- package/dist/application/retirement/attribution.js.map +1 -1
- package/dist/application/retirement/graph.js +19 -1
- package/dist/application/retirement/graph.js.map +1 -1
- package/dist/application/retirement/journal.js +11 -0
- package/dist/application/retirement/journal.js.map +1 -1
- package/dist/application/retirement/prepare.js +89 -3
- package/dist/application/retirement/prepare.js.map +1 -1
- package/dist/application/retirement/preview.js +16 -0
- package/dist/application/retirement/preview.js.map +1 -1
- package/dist/application/retirement/resolve.js +65 -0
- package/dist/application/retirement/resolve.js.map +1 -1
- package/dist/application/self/host-states.js +2 -0
- package/dist/application/self/host-states.js.map +1 -1
- package/dist/application/self/install-skill.js +53 -19
- package/dist/application/self/install-skill.js.map +1 -1
- package/dist/application/self/mcp-config.js +28 -30
- package/dist/application/self/mcp-config.js.map +1 -1
- package/dist/application/self/mcp-offer.js +96 -0
- package/dist/application/self/mcp-offer.js.map +1 -0
- package/dist/application/self/mcp-via-state.js +59 -0
- package/dist/application/self/mcp-via-state.js.map +1 -0
- package/dist/application/self/uninstall-skill.js +18 -3
- package/dist/application/self/uninstall-skill.js.map +1 -1
- package/dist/application/self/uninstall.js +37 -8
- package/dist/application/self/uninstall.js.map +1 -1
- package/dist/application/session-close-service.js +24 -1
- package/dist/application/session-close-service.js.map +1 -1
- package/dist/application/session-create-service.js +7 -0
- package/dist/application/session-create-service.js.map +1 -1
- package/dist/application/session-resume-service.js +2 -2
- package/dist/application/session-resume-service.js.map +1 -1
- package/dist/application/sessions-service.js +2 -4
- package/dist/application/sessions-service.js.map +1 -1
- package/dist/application/skills-resolver-service.js +4 -4
- package/dist/application/skills-resolver-service.js.map +1 -1
- package/dist/application/source-boundary-policy.js +18 -7
- package/dist/application/source-boundary-policy.js.map +1 -1
- package/dist/application/source-remove-service.js +12 -1
- package/dist/application/source-remove-service.js.map +1 -1
- package/dist/application/sources-service.js +2 -2
- package/dist/application/sources-service.js.map +1 -1
- package/dist/application/status-service.js +4 -0
- package/dist/application/status-service.js.map +1 -1
- package/dist/application/visibility-doctor-service.js +1 -1
- package/dist/application/visibility-doctor-service.js.map +1 -1
- package/dist/application/workline-index-service.js +182 -27
- package/dist/application/workline-index-service.js.map +1 -1
- package/dist/application/workspace-init-service.js +85 -265
- package/dist/application/workspace-init-service.js.map +1 -1
- package/dist/application/workspace-materialization-service.js +300 -0
- package/dist/application/workspace-materialization-service.js.map +1 -0
- package/dist/application/worktree-service.js +32 -3
- package/dist/application/worktree-service.js.map +1 -1
- package/dist/cli/commands/capability.js +4 -7
- package/dist/cli/commands/capability.js.map +1 -1
- package/dist/cli/commands/claims.js +72 -0
- package/dist/cli/commands/claims.js.map +1 -0
- package/dist/cli/commands/dev-only.js +73 -25
- package/dist/cli/commands/dev-only.js.map +1 -1
- package/dist/cli/commands/flow.js +145 -42
- package/dist/cli/commands/flow.js.map +1 -1
- package/dist/cli/commands/index.js +2 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/mcp.js +124 -35
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/multiroot.js +40 -7
- package/dist/cli/commands/multiroot.js.map +1 -1
- package/dist/cli/commands/resume.js +9 -3
- package/dist/cli/commands/resume.js.map +1 -1
- package/dist/cli/commands/retirement.js +9 -0
- package/dist/cli/commands/retirement.js.map +1 -1
- package/dist/cli/commands/session-create.js +1 -1
- package/dist/cli/commands/session-create.js.map +1 -1
- package/dist/cli/commands/skills.js +1 -1
- package/dist/cli/commands/skills.js.map +1 -1
- package/dist/cli/commands/status.js +72 -24
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/workspace-init.js +5 -5
- package/dist/cli/commands/workspace-init.js.map +1 -1
- package/dist/cli/help-groups.js +5 -0
- package/dist/cli/help-groups.js.map +1 -1
- package/dist/cli/main.js +112 -39
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/parser.js +3 -0
- package/dist/cli/parser.js.map +1 -1
- package/dist/cli/tui/app.js +3 -2
- package/dist/cli/tui/app.js.map +1 -1
- package/dist/cli/tui/components/host-admin-section.js +46 -2
- package/dist/cli/tui/components/host-admin-section.js.map +1 -1
- package/dist/cli/tui/components/workspace-init-form.js +7 -7
- package/dist/cli/tui/components/workspace-init-form.js.map +1 -1
- package/dist/cli/tui/data/workflow-content.js +2 -2
- package/dist/cli/tui/data/workflow-content.js.map +1 -1
- package/dist/cli/tui/tabs/config-tab.js +4 -3
- package/dist/cli/tui/tabs/config-tab.js.map +1 -1
- package/dist/cli/tui/tabs/mcp-tab-helpers.js +1 -1
- package/dist/cli/tui/tabs/mcp-tab-helpers.js.map +1 -1
- package/dist/cli/tui/tabs/project-tab.js +18 -21
- package/dist/cli/tui/tabs/project-tab.js.map +1 -1
- package/dist/cli/tui/workspace-root.js +13 -0
- package/dist/cli/tui/workspace-root.js.map +1 -0
- package/dist/domain/capability/protocol.js +2 -2
- package/dist/domain/capability/protocol.js.map +1 -1
- package/dist/domain/degradation-notice.js +60 -0
- package/dist/domain/degradation-notice.js.map +1 -0
- package/dist/domain/elicitation.js +152 -0
- package/dist/domain/elicitation.js.map +1 -0
- package/dist/domain/flow/answer.js +173 -42
- package/dist/domain/flow/answer.js.map +1 -1
- package/dist/domain/flow/authority.js +180 -127
- package/dist/domain/flow/authority.js.map +1 -1
- package/dist/domain/flow/directive.js +47 -1
- package/dist/domain/flow/directive.js.map +1 -1
- package/dist/domain/flow/rules.js +7 -4
- package/dist/domain/flow/rules.js.map +1 -1
- package/dist/domain/flow/run-state.js +636 -31
- package/dist/domain/flow/run-state.js.map +1 -1
- package/dist/domain/harnesses.js +16 -0
- package/dist/domain/harnesses.js.map +1 -1
- package/dist/domain/mcp-entry.js +36 -14
- package/dist/domain/mcp-entry.js.map +1 -1
- package/dist/domain/retirement/proposal.js +1 -0
- package/dist/domain/retirement/proposal.js.map +1 -1
- package/dist/domain/structured-choice-stamp.js +32 -4
- package/dist/domain/structured-choice-stamp.js.map +1 -1
- package/dist/domain/workline-mcp-entry.js +37 -0
- package/dist/domain/workline-mcp-entry.js.map +1 -0
- package/dist/runtime/namespace-resolver.js +104 -18
- package/dist/runtime/namespace-resolver.js.map +1 -1
- package/package.json +1 -1
- package/skills/w/README.md +2 -2
- package/skills/w/SKILL.md +9 -10
- package/skills/w/artifacts/README.md +1 -1
- package/skills/w/commands/README.md +3 -3
- package/skills/w/commands/persist.md +3 -1
- package/skills/w/commands/resume.md +1 -1
- package/skills/w/commands/spec-new.md +2 -2
- package/skills/w/commands/status.md +1 -1
- package/skills/w/commands/workspace-init.md +9 -10
- package/skills/w/context/MANIFEST.json +1 -4
- package/skills/w/harness/HARNESS.md +1 -1
- package/skills/w/loops/quick-loop/LOOP.md +1 -1
- package/skills/w/modules/PROMPT-CONTINUITY.md +1 -1
- package/skills/w/modules/WORKSPACE-SCAFFOLD.md +17 -20
- package/skills/w/schemas/capability-descriptor.schema.json +1 -1
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
2
|
import { NAMESPACE_REGEX, normalizeNamespace } from "./namespace.js";
|
|
3
|
+
export class WorklineDirectoryError extends Error {
|
|
4
|
+
root;
|
|
5
|
+
namespaces;
|
|
6
|
+
code = "WORKLINE_NAMESPACE_AMBIGUOUS";
|
|
7
|
+
constructor(root, namespaces) {
|
|
8
|
+
super(`More than one Workline namespace is materialized at ${root}: ${namespaces.join(", ")}. Pass --namespace <name> (or set AW_NAMESPACE) to select one.`);
|
|
9
|
+
this.root = root;
|
|
10
|
+
this.namespaces = namespaces;
|
|
11
|
+
this.name = "WorklineDirectoryError";
|
|
12
|
+
}
|
|
13
|
+
}
|
|
3
14
|
export const DEFAULT_NAMESPACE = "workflow";
|
|
4
15
|
export const ENV_VAR_NAMESPACE = "AW_NAMESPACE";
|
|
5
16
|
/**
|
|
@@ -18,49 +29,124 @@ export class NamespaceResolver {
|
|
|
18
29
|
this.env = env;
|
|
19
30
|
}
|
|
20
31
|
async resolve(flag) {
|
|
32
|
+
const directory = await this.resolveDirectory(flag);
|
|
33
|
+
return { namespace: directory.namespace, source: directory.namespaceSource };
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve both the namespace and the root it scopes. Explicit namespace
|
|
37
|
+
* selection is deliberately honoured before discovery; an explicit request
|
|
38
|
+
* for a different namespace must not be silently redirected by a neighbouring
|
|
39
|
+
* marker. Without an explicit selection, the closest ancestor with one
|
|
40
|
+
* canonical marker wins, while two markers at that same level are a real
|
|
41
|
+
* ambiguity rather than a reason to fall back to a global preference.
|
|
42
|
+
*/
|
|
43
|
+
async resolveDirectory(flag) {
|
|
44
|
+
const cwd = this.env.cwd();
|
|
21
45
|
if (flag !== undefined && flag.trim().length > 0) {
|
|
22
|
-
|
|
46
|
+
const namespace = normalizeNamespace(flag);
|
|
47
|
+
const root = await this.findMarkerForNamespace(cwd, namespace);
|
|
48
|
+
return {
|
|
49
|
+
root: root ?? cwd,
|
|
50
|
+
namespace,
|
|
51
|
+
namespaceSource: "flag",
|
|
52
|
+
materialized: root !== null,
|
|
53
|
+
};
|
|
23
54
|
}
|
|
24
55
|
const envVal = this.env.get(ENV_VAR_NAMESPACE);
|
|
25
56
|
if (envVal !== undefined && envVal.trim().length > 0) {
|
|
26
|
-
|
|
57
|
+
const namespace = normalizeNamespace(envVal);
|
|
58
|
+
const root = await this.findMarkerForNamespace(cwd, namespace);
|
|
59
|
+
return {
|
|
60
|
+
root: root ?? cwd,
|
|
61
|
+
namespace,
|
|
62
|
+
namespaceSource: "env",
|
|
63
|
+
materialized: root !== null,
|
|
64
|
+
};
|
|
27
65
|
}
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
return {
|
|
66
|
+
const workspace = await this.detectFromWorkspace(cwd);
|
|
67
|
+
if (workspace !== null) {
|
|
68
|
+
return {
|
|
69
|
+
root: workspace.root,
|
|
70
|
+
namespace: workspace.namespace,
|
|
71
|
+
namespaceSource: "workspace",
|
|
72
|
+
materialized: true,
|
|
73
|
+
};
|
|
31
74
|
}
|
|
32
75
|
const configPath = namespaceConfigFile(this.env.homeDir());
|
|
33
76
|
if (await this.fs.exists(configPath)) {
|
|
34
77
|
const raw = await this.fs.readText(configPath);
|
|
35
|
-
|
|
78
|
+
const namespace = normalizeNamespace(raw);
|
|
79
|
+
const root = await this.findMarkerForNamespace(cwd, namespace);
|
|
80
|
+
return {
|
|
81
|
+
root: root ?? cwd,
|
|
82
|
+
namespace,
|
|
83
|
+
namespaceSource: "config",
|
|
84
|
+
materialized: root !== null,
|
|
85
|
+
};
|
|
36
86
|
}
|
|
37
|
-
|
|
87
|
+
const namespace = normalizeNamespace(DEFAULT_NAMESPACE);
|
|
88
|
+
const root = await this.findMarkerForNamespace(cwd, namespace);
|
|
89
|
+
return {
|
|
90
|
+
root: root ?? cwd,
|
|
91
|
+
namespace,
|
|
92
|
+
namespaceSource: "default",
|
|
93
|
+
materialized: root !== null,
|
|
94
|
+
};
|
|
38
95
|
}
|
|
39
96
|
async detectFromWorkspace(cwd) {
|
|
97
|
+
let dir = cwd;
|
|
98
|
+
while (true) {
|
|
99
|
+
const matches = await this.namespacesAt(dir);
|
|
100
|
+
if (matches.length > 1)
|
|
101
|
+
throw new WorklineDirectoryError(dir, matches);
|
|
102
|
+
const [namespace] = matches;
|
|
103
|
+
if (namespace !== undefined)
|
|
104
|
+
return { root: dir, namespace };
|
|
105
|
+
const parent = dirname(dir);
|
|
106
|
+
if (parent === dir)
|
|
107
|
+
return null;
|
|
108
|
+
dir = parent;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async findMarkerForNamespace(cwd, namespace) {
|
|
112
|
+
let dir = cwd;
|
|
113
|
+
while (true) {
|
|
114
|
+
if (await this.isCanonicalMarker(join(dir, `.${namespace}`, "sessions")))
|
|
115
|
+
return dir;
|
|
116
|
+
const parent = dirname(dir);
|
|
117
|
+
if (parent === dir)
|
|
118
|
+
return null;
|
|
119
|
+
dir = parent;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async namespacesAt(dir) {
|
|
40
123
|
let entries;
|
|
41
124
|
try {
|
|
42
|
-
entries = await this.fs.list(
|
|
125
|
+
entries = await this.fs.list(dir);
|
|
43
126
|
}
|
|
44
127
|
catch {
|
|
45
|
-
return
|
|
128
|
+
return [];
|
|
46
129
|
}
|
|
47
130
|
const matches = [];
|
|
48
131
|
for (const entry of entries) {
|
|
49
|
-
if (entry.type !== "dir")
|
|
50
|
-
continue;
|
|
51
|
-
if (!entry.name.startsWith("."))
|
|
132
|
+
if (entry.type !== "dir" || !entry.name.startsWith("."))
|
|
52
133
|
continue;
|
|
53
134
|
const candidate = entry.name.slice(1);
|
|
54
135
|
if (!NAMESPACE_REGEX.test(candidate))
|
|
55
136
|
continue;
|
|
56
|
-
|
|
57
|
-
if (await this.fs.exists(sessionsPath)) {
|
|
137
|
+
if (await this.isCanonicalMarker(join(entry.path, "sessions"))) {
|
|
58
138
|
matches.push(candidate);
|
|
59
139
|
}
|
|
60
140
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
141
|
+
return matches.sort();
|
|
142
|
+
}
|
|
143
|
+
async isCanonicalMarker(path) {
|
|
144
|
+
try {
|
|
145
|
+
return (await this.fs.stat(path)).type === "dir";
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
64
150
|
}
|
|
65
151
|
}
|
|
66
152
|
//# sourceMappingURL=namespace-resolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"namespace-resolver.js","sourceRoot":"","sources":["../../src/runtime/namespace-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"namespace-resolver.js","sourceRoot":"","sources":["../../src/runtime/namespace-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAkB,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAyBrF,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAI7B;IACA;IAJT,IAAI,GAAG,8BAA8B,CAAC;IAE/C,YACkB,IAAY,EACZ,UAAgC;QAEhD,KAAK,CACH,uDAAuD,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,gEAAgE,CACtJ,CAAC;QALc,SAAI,GAAJ,IAAI,CAAQ;QACZ,eAAU,GAAV,UAAU,CAAsB;QAKhD,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAC5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAEhD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,OAAO,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,OAAO,iBAAiB;IAET;IACA;IAFnB,YACmB,EAAkB,EAClB,GAAY;QADZ,OAAE,GAAF,EAAE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,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAE,SAAS;YAClE,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACtC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC;gBAAE,SAAS;YAC/C,IAAI,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC;gBAC/D,OAAO,CAAC,IAAI,CAAC,SAAsB,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAAC,IAAY;QAC1C,IAAI,CAAC;YACH,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,KAAK,CAAC;QACnD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tacuchi/agent-workflow-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.0",
|
|
4
4
|
"description": "Runtime CLI for Workline — the stages + loops + artifacts system for agent work. Bundles the universal `w` skill set under `skills/w/` (slash commands `/w:*`: spec-new/spec-refine, plan-new/plan-exec, quick, persist, workspace-init, export-*); `self install --target <host>` copies SKILL + commands + hooks into the host. Pluggable capability skills resolve through `.workflow/skills.toml`. Namespace auto-detected from any `.<ns>/sessions/` dir in CWD; default `workflow`.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/skills/w/README.md
CHANGED
|
@@ -21,6 +21,6 @@ It implements the **stages + loops + artifacts** model. The design source lives
|
|
|
21
21
|
| [`hooks/`](hooks/) | — | Host hook template (branch-check, sql-mutation-guard, checkpoint, …) |
|
|
22
22
|
| [`SKILL.md`](SKILL.md) | overview | The `w` orientation skill (guide to the full model) |
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Workspace
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Every invoked directory is a usable implicit workspace. The closest `.<namespace>/sessions/` ancestor supplies its root; with none, the invoked directory itself is the root. [`/w:workspace-init`](commands/workspace-init.md) is optional: it materializes the small runtime early, or configures explicit sources and overrides.
|
package/skills/w/SKILL.md
CHANGED
|
@@ -27,9 +27,9 @@ Anyone needing orientation — a loop at start, a new agent in the workspace, or
|
|
|
27
27
|
|
|
28
28
|
## Knowledge
|
|
29
29
|
|
|
30
|
-
### Workspace (
|
|
30
|
+
### Workspace (implicit first)
|
|
31
31
|
|
|
32
|
-
A single concept: **workspace**. There is no project/hub split. The folder where the agent starts
|
|
32
|
+
A single concept: **workspace**. There is no project/hub split and no mandatory initialization. The nearest ancestor containing `.<namespace>/sessions/` is the root; with no marker, the folder where the agent starts is the **implicit workspace** root. A pure read never creates the marker. The first mutation materializes only the runtime and `/w:workspace-init` is an optional early materialization; explicit sources add configured metadata. `workspace` is the reserved source that points to the root, and any extra alias is explicit.
|
|
33
33
|
|
|
34
34
|
### The 3-layer architecture + `docs/` zone
|
|
35
35
|
|
|
@@ -77,14 +77,13 @@ Both authoring entry points can **split** with consent: `spec-new` may split a m
|
|
|
77
77
|
|
|
78
78
|
### Operating context — where everything lands
|
|
79
79
|
|
|
80
|
-
Before any loop, the AI resolves
|
|
80
|
+
Before any loop, the AI resolves the **workspace root** on every prompt (closest `.<ns>/sessions/` ancestor, otherwise the invoked directory) and then the session to continue. The marker is evidence of materialization, not permission to use Workline; pure reads stay byte-identical. That decides where artifacts land:
|
|
81
81
|
|
|
82
|
-
|
|
|
83
|
-
|
|
84
|
-
| **
|
|
85
|
-
| **
|
|
86
|
-
| **
|
|
87
|
-
| **No** | anything | **vanilla** — no workspace, no flow; the AI is free (native) |
|
|
82
|
+
| Trigger | → Behavior + routing |
|
|
83
|
+
|---|---|
|
|
84
|
+
| **flow command** (`quick`·`spec-*`·`plan-*`) | **new work line** → materializes if needed, creates a **new** session (except re-running the same flow over the same input: `create_or_resume` reopens the existing one), starts the loop → artifacts go to **that** session (`SCRIPTS.sql`, …) |
|
|
85
|
+
| **prompt with no command** (related) | **continues/reopens the most recent session** → scripts edit its `SCRIPTS.sql` (no new session) |
|
|
86
|
+
| **prompt with no command** (unrelated / no session) | **no flow**: direct work → writes into `docs/` by convention + numbering (`aw next-number`). To persist work already done in this conversation, `/w:persist` classifies and routes it (`docs/research` · spec draft · plan adoption) |
|
|
88
87
|
|
|
89
88
|
**Continuity rule** (single source — the chassis and the loops reference here):
|
|
90
89
|
|
|
@@ -103,7 +102,7 @@ The flows are **composable with host-native work, never exclusive**. The host is
|
|
|
103
102
|
|
|
104
103
|
### The commands (`/w:` namespace)
|
|
105
104
|
|
|
106
|
-
- `/w:workspace-init` —
|
|
105
|
+
- `/w:workspace-init` — materializes the runtime early, or configures explicit sources.
|
|
107
106
|
- `/w:spec-new` — generates an initial spec (single-pass, no loop; a bounded reconnaissance of the sources precedes the scope decision).
|
|
108
107
|
- `/w:spec-refine` — starts `spec-refine-loop` to refine the spec until it is `ready-for-plan`: the blocking functional decisions closed, the architecture/implementation ones declared for PLAN.
|
|
109
108
|
- `/w:plan-new` — starts `plan-new-loop` to derive an executable plan from the ready spec.
|
|
@@ -19,7 +19,7 @@ Central distinction of the model:
|
|
|
19
19
|
|
|
20
20
|
> An artifact may be **promoted** to a `docs/` document (e.g. `SCRIPTS.sql` → `docs/scripts/`) — but **only via dedicated `export-*` skills**, **never** automatically by the loops. The spec and the plan **are not** artifacts: they are documents.
|
|
21
21
|
|
|
22
|
-
> **Routing by operating context** (canonical rules: [`../SKILL.md`](../SKILL.md) § *Operating context*): inside a flow → the **active/continued** session (a prompt with no command edits the most recent session's artifacts);
|
|
22
|
+
> **Routing by operating context** (canonical rules: [`../SKILL.md`](../SKILL.md) § *Operating context*): inside a flow → the **active/continued** session (a prompt with no command edits the most recent session's artifacts); without a flow → `docs/` by convention + numbering (or explicitly via [`/w:persist`](../commands/persist.md), which classifies in-conversation work and routes it — `docs/research` · spec draft · plan adoption). Every invoked directory is an implicit root and reads create no marker. Session→`docs/` promotion is still **only** via `export-*`; persist is the **host→`docs/`** path (it never reads sessions).
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Workspace
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Every invoked directory is a usable implicit workspace. The closest ancestor with `.<namespace>/sessions/` is reused; otherwise the invoked directory is the root. [`/w:workspace-init`](workspace-init.md) is optional: without sources it materializes only the runtime, and with sources it configures metadata.
|
|
12
12
|
|
|
13
13
|
## Index
|
|
14
14
|
|
|
15
15
|
| Command | What it does | Mode |
|
|
16
16
|
|---|---|---|
|
|
17
|
-
| [`workspace-init`](workspace-init.md) |
|
|
17
|
+
| [`workspace-init`](workspace-init.md) | Materialize runtime or configure explicit sources | single-pass, interactive |
|
|
18
18
|
| [`spec-new`](spec-new.md) | Generates the spec draft (`docs/specs/NNN-spec-<slug>.md`) | single-pass, no loop |
|
|
19
19
|
| [`spec-refine`](spec-refine.md) | Refines the spec **in place** until it is `ready-for-plan` | starts `spec-refine-loop` |
|
|
20
20
|
| [`plan-new`](plan-new.md) | Derives the executable plan (`docs/plans/PPP-plan-<slug>.md`) from the spec | starts `plan-new-loop` |
|
|
@@ -38,7 +38,9 @@ Captures **work already produced in this conversation** — with or without host
|
|
|
38
38
|
|
|
39
39
|
Every rejection names its cause and one valid next action; nothing was written. Fix the answer and repeat from step 3.
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
The resolved **implicit workspace** is the managed surface (`docs/`). No prior
|
|
42
|
+
`/w:workspace-init` is needed: an approved apply writes only its declared
|
|
43
|
+
artifact and materializes the runtime as part of that first mutation.
|
|
42
44
|
|
|
43
45
|
## More context
|
|
44
46
|
|
|
@@ -28,7 +28,7 @@ No target → **every** pending item as `candidates` in the CLI's order, `propos
|
|
|
28
28
|
2. **One option per candidate** — only for CLI candidates, in its order — each with its re-entry command, plus the `flow` slot. Canonical [option shape](../loops/CHASSIS.md#structured-choice-design--batching) and [host binding](../harness/HARNESS.md#harness-binding-matrix): the title is the label, `Progreso` + `Siguiente` the sentence.
|
|
29
29
|
3. **Past the host's ceiling**, group by class into ≤3 questions; if a class still will not fit, present them **all** as labelled markdown and declare the degradation. Nothing trimmed, merged or dropped.
|
|
30
30
|
4. **Choosing invokes that command in the same turn.** The destination flow opens its own session and consent boundaries.
|
|
31
|
-
5. **No candidates** → nothing is pending: say it and stop, opening no choice; cheap host-memory may add a recent-focus note, never expensive or blocking.
|
|
31
|
+
5. **No candidates** → nothing is pending: say it and stop, opening no choice; cheap host-memory may add a recent-focus note, never expensive or blocking. An implicit workspace returns `idle` without creating files.
|
|
32
32
|
|
|
33
33
|
## What the CLI decides (do not re-derive)
|
|
34
34
|
|
|
@@ -25,8 +25,8 @@ Generates `docs/specs/NNN-spec-<slug>.md` in a single pass from the prompt in `$
|
|
|
25
25
|
|
|
26
26
|
1. **Reconnaissance** — one shallow look at the terrain before any scope decision: adopt what the conversation settled, identify the candidate sources (`aw sources --no-git`, or the `WORKSPACE` block), look at their surface, stop. **Budget: ≤5 reads + ≤3 searches** — a cap, never a target. Never run code, query a database or search the web. Full rules: module `RECONNAISSANCE`.
|
|
27
27
|
2. **Split gate** — before writing anything, judge whether the prompt bundles several **independent functional outcomes**. Borderline or thin evidence → **one spec, no question** (hypothesis to `## Assumptions`, doubt to `## Open questions`). Only clear signals earn the command's single structured-choice offer. Full rules: module `SPLIT-GATE`.
|
|
28
|
-
3. **
|
|
29
|
-
4. **
|
|
28
|
+
3. **Slug and draft** — derive `<slug>` from the Requirement: short kebab-case, only `[a-z0-9-]`, ≤ ~5 words / ≤ 40 chars. Then frame `$ARGUMENTS` into the draft schema below; reconnaissance findings land **only** where the filling notes allow.
|
|
29
|
+
4. **Publish it in one act** — `aw next-number docs/specs --publish spec-<slug>.md` with the finished draft on stdin: it assigns the correlative and writes the document atomically, and returns `published_path`. This command has no session, so it never leaves a reservation of nobody's — and an interruption leaves neither file nor consumed number. On an accepted split: repeat 3-4 per part.
|
|
30
30
|
5. **Report** the generated file(s) and the next step (`/w:spec-refine docs/specs/NNN-spec-<slug>.md`).
|
|
31
31
|
|
|
32
32
|
Steps 1-2 run **only on a raw user prompt** (direct invocation, or the `plan-new` mode-3 handoff). The reuse entries at the end skip them: their context arrives already established, and adopting it is transcription, not investigation.
|
|
@@ -26,7 +26,7 @@ Read-only single pass: no loop, no session, no writes. Transversal.
|
|
|
26
26
|
|
|
27
27
|
> **Automation reads JSON.** Piped or with `--json` / `--format json` it emits its envelope; `--detail` is human-only.
|
|
28
28
|
|
|
29
|
-
Nothing pending → one line, no empty section.
|
|
29
|
+
Nothing pending → one line, no empty section. In an implicit workspace that is genuinely "nothing pending"; this read creates no marker or other file.
|
|
30
30
|
|
|
31
31
|
## More context
|
|
32
32
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Use
|
|
2
|
+
description: "Use to materialize Workline runtime early, or configure explicit workspace sources. Flows work without a prior init. Backed by `aw workspace-init`."
|
|
3
3
|
argument-hint: --source alias:path[:branch] [--proyecto <name>] [--main-branch <branch>] [--dry-run]
|
|
4
4
|
allowed-tools:
|
|
5
5
|
[
|
|
@@ -8,22 +8,21 @@ allowed-tools:
|
|
|
8
8
|
]
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
# workspace-init —
|
|
11
|
+
# workspace-init — materialize or configure
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Workline already has an implicit workspace at the resolved root: the nearest ancestor with `.<namespace>/sessions/`, or exactly the invoked directory when none exists. It never guesses a Git root.
|
|
14
14
|
|
|
15
|
-
`aw workspace-init --source alias:path[:branch] [flags above] --format human`
|
|
15
|
+
`aw workspace-init [--source alias:path[:branch]] [flags above] --format human`
|
|
16
16
|
|
|
17
17
|
> **The CLI writes; this wrapper does not** — `Write` and `Edit` are absent from `allowed-tools` on purpose. `--dry-run` previews; re-run without it. Relay the output, never re-render it.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Modes
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
2. **Default skills** — present the catalog of capabilities (roles). Per role: `built-in default`, a third-party skill (`skills.sh`), or `off`; the result lands in `.workflow/skills.toml`. Cascade: `built-in → ~/.workflow/skills.toml (global) → .workflow/skills.toml (workspace)`. The template also ships a commented `[compaction]` section: the `mode` switch for the loops' context self-regulation (`confirm` default, `auto` opt-in).
|
|
23
|
-
3. **Minimal scaffold** — only the activation set: `.workflow/sessions/` (the marker that activates the operating context), `.workflow/skills.toml`, the `WORKSPACE` block in CLAUDE.md/AGENTS.md and the CLI-owned `.gitignore`. **Nothing else upfront**: each `docs/<category>` is born on demand at its first numbered write (`aw next-number docs/<cat>`), and `.workflow/launch/<alias>/` plus `docs/logs/` at the first launch.
|
|
24
|
-
4. **External sources** — one outside the workspace folder gets multi-root visibility (gitignored) and a reconcile.
|
|
21
|
+
Without sources, it only materializes the minimal runtime under the lock: the CLI-owned `.gitignore` block when the root belongs to Git, then `.<namespace>/sessions/` as the final marker. It does not create `docs/`, `skills.toml`, a WORKSPACE block, launch files, `HISTORY.md` or a Git repository.
|
|
25
22
|
|
|
26
|
-
|
|
23
|
+
With `--source`, it configures/reconciles the metadata, branches and multiroot visibility. `workspace` is the reserved implicit source pointing at the root and cannot be configured as an alias. A workspace `skills.toml` is created only when there is a real capability override.
|
|
24
|
+
|
|
25
|
+
Both modes are idempotent. A normal first mutation also materializes the same runtime automatically, so this command is optional rather than a gate.
|
|
27
26
|
|
|
28
27
|
Done → the user can run `/w:spec-new`, `/w:plan-new` or `/w:quick`.
|
|
29
28
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"web": "the run needs evidence from outside the workspace",
|
|
19
19
|
"reconnaissance": "a draft is being cut from a raw prompt over unfamiliar terrain",
|
|
20
20
|
"detection": "the CLI's automatic detection was wrong or ambiguous",
|
|
21
|
-
"scaffold": "the target
|
|
21
|
+
"scaffold": "the target has materialized runtime or needs its materialization/configuration contract",
|
|
22
22
|
"classification": "in-conversation work has to be classified before it is written",
|
|
23
23
|
"authoring": "the deliverable's own notation, structure or ordering is not obvious from the material"
|
|
24
24
|
},
|
|
@@ -61,9 +61,6 @@
|
|
|
61
61
|
"plan.escalation-adopted": "this refine consumed the escalation package an execution handed over, instead of re-deriving its diagnosis",
|
|
62
62
|
"plan.escalation-absent": "no escalation package reached this refine, so it starts from the document alone",
|
|
63
63
|
"chassis.context-pressure": "a fresh reader would need the CHECKPOINT to continue this run",
|
|
64
|
-
"plan.tasks-to-mark": "at least one task of the batch finished its local work and its checkbox is still open",
|
|
65
|
-
"plan.plan-closable": "every phase of the plan will be validated once this batch closes, so the plan can be sealed done",
|
|
66
|
-
"plan.commit-pending": "at least one affected source carries uncommitted changes from this batch",
|
|
67
64
|
"quick.db-touched": "the task read from or wrote to a database, so there is a statement to derive into the session script"
|
|
68
65
|
},
|
|
69
66
|
"commands": {
|
|
@@ -34,7 +34,7 @@ The capabilities the harness layer depends on, with their universal fallback (wh
|
|
|
34
34
|
|---|---|---|
|
|
35
35
|
| **command-invocation** | the user triggers a flow by name (`spec-new`, `plan-exec`, …) | the user writes "run the `<cmd>` procedure" and the AI reads its doc |
|
|
36
36
|
| **procedure-loading** | load a loop's/command's doctrine | the AI **reads the `.md`** of the loop and follows it (read-and-follow) |
|
|
37
|
-
| **structured-choice** | ask the human ≤3 content questions **+ always** a `flow` control (`Compactar`/`Cerrar`); every option has a semantic label + one-sentence functional explanation/example | **labeled markdown** in chat
|
|
37
|
+
| **structured-choice** | ask the human ≤3 content questions **+ always** a `flow` control (`Compactar`/`Cerrar`); every option has a semantic label + one-sentence functional explanation/example | the host's own tool when the turn offers it; else the **`structured_choice`** tool of Workline's own MCP server, which renders the host's native selector by elicitation (only where the catalog declares it with dated evidence); else **labeled markdown** in chat, answered by label or by ratifying all first options with `Aceptar recomendaciones` |
|
|
38
38
|
| **compaction** | shrink the context without losing the thread (+ a context-pressure **signal** for the chassis' self-regulation) | write `CHECKPOINT` and ask the user to restart the context and resume (resume keys off `CHECKPOINT`) |
|
|
39
39
|
| **subagent-dispatch** | *(optional)* parallelize research breadth | **inline sequential** research in the same session (the default anyway) |
|
|
40
40
|
| **persistent-context** | the `WORKSPACE` block + conventions always present | the repo's context file (standard **`AGENTS.md`**; `CLAUDE.md` on Claude Code) |
|
|
@@ -58,7 +58,7 @@ Read **[`../CHASSIS.md`](../CHASSIS.md)** — the loop's **full engine** — **a
|
|
|
58
58
|
- **`Recortar alcance`**, if chosen: propose the **sub-task that DOES fit** a quick (`SESSION.Objective` = the sub-task; the original prompt goes into `## Origin`) and defer the rest to `BACKLOG` ("trimmed at the gate — may warrant its own spec, `/w:spec-new`").
|
|
59
59
|
- **`Cambiar a SPEC`**, if chosen: **no quick session is created** — run the *Live transition to SPEC* (next bullet).
|
|
60
60
|
- **Live transition to SPEC** (shared by the gate and mid-loop escalation). On acceptance, the work line **moves to the SPEC flow**: the explicit consent in the structured-choice **equals invoking the destination command** (*consented exception* — rule 3 of the *Continuity rule*, [`../../SKILL.md`](../../SKILL.md) § *Operating context*). On the SPEC side:
|
|
61
|
-
1. **Materialize the draft** via the [`../../commands/spec-new.md`](../../commands/spec-new.md) procedure: `aw next-number docs/specs --
|
|
61
|
+
1. **Materialize the draft** via the [`../../commands/spec-new.md`](../../commands/spec-new.md) procedure: `aw next-number docs/specs --publish spec-<slug>.md` with the finished draft on stdin (number assigned and document written in one atomic act, no reservation left), schema, single-pass **NO RESEARCH** — its bounded reconnaissance does **not** re-fire (this run's context arrives adopted). `## Origin` = "escalated from `/w:quick`" + the original prompt (+ the origin quick session if it exists). The draft is born `status: draft`: only the SPEC gate promotes it to `ready-for-plan`.
|
|
62
62
|
2. **Load and execute** [`../spec-refine-loop/LOOP.md`](../spec-refine-loop/LOOP.md) — over that spec (trampoline pattern).
|
|
63
63
|
3. The run's session is that loop's **normal** `NNN-<slug>-spec-refine` (the CLI numbers it; its `## Origin` records the escalation). **Invariant 2 intact**: quick, while it is quick, never writes `docs/` — the draft is written by the SPEC flow, post-consent.
|
|
64
64
|
- **Mid-loop escalation + handoff**: if the task grows, declare the signals again — the CLI applies the same threshold and, if it fires, asks. If the user accepts moving up:
|
|
@@ -12,4 +12,4 @@ Loaded when a bare prompt continues an existing work line (signal `resume`).
|
|
|
12
12
|
|
|
13
13
|
> **Which line a prompt joins is not this document's call:** a command opens a new one through `aw session-create`, a bare prompt continues the most recent through `aw resume`. Both fire **before** a run exists, so no journey has a step for them. The reason stays: the **command** is the signal for "new work line", so nobody loses a thread by not typing one, or forks one by typing it twice.
|
|
14
14
|
|
|
15
|
-
Whether a prompt really belongs to the open line is judgment. Clearly unrelated → offer choosing (`continuar NNN` | `trabajo nuevo`) or fall to the **no-flow** branch (`docs/` by convention + numbering).
|
|
15
|
+
Whether a prompt really belongs to the open line is judgment. Clearly unrelated → offer choosing (`continuar NNN` | `trabajo nuevo`) or fall to the **no-flow** branch (`docs/` by convention + numbering). Every invoked directory has an implicit Workline root; a marker is created only by a mutation.
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
# WORKSPACE-SCAFFOLD —
|
|
1
|
+
# WORKSPACE-SCAFFOLD — runtime materialization and configuration
|
|
2
2
|
|
|
3
|
-
Loaded when the folder already has a workspace, or the user asks what
|
|
4
|
-
ignores or
|
|
3
|
+
Loaded when the folder already has a materialized workspace, or the user asks what
|
|
4
|
+
`workspace-init` writes, ignores or reconciles on a re-run (signal `scaffold`).
|
|
5
5
|
|
|
6
6
|
## Versioning policy (CLI-owned `.gitignore`)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
The first mutation (or `workspace-init` without sources) writes only the runtime set, under the
|
|
9
|
+
workspace lock. The sessions marker is created last.
|
|
9
10
|
|
|
10
|
-
- **Ignored** —
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
`.workflow/HISTORY.md`, the durable record: `aw session-close` upserts each closed session's
|
|
16
|
-
row there.
|
|
11
|
+
- **Ignored** — `.<namespace>/sessions/` (machine-local live log), `.<namespace>/.lock`,
|
|
12
|
+
`.<namespace>/processes.json`, `.<namespace>/launch/` and `docs/logs/`. The runtime block is
|
|
13
|
+
added only when the root belongs to Git.
|
|
14
|
+
- **Not created by materialization** — `docs/**`, `skills.toml`, a WORKSPACE block, launch
|
|
15
|
+
files, HISTORY and Git metadata. Those belong to their owning command.
|
|
17
16
|
|
|
18
|
-
## Re-run: reconcile
|
|
17
|
+
## Re-run: reconcile
|
|
19
18
|
|
|
20
|
-
A re-run adds no duplicate entries and overwrites no manual configuration.
|
|
21
|
-
|
|
19
|
+
A re-run adds no duplicate runtime entries and overwrites no manual configuration. When explicit
|
|
20
|
+
sources are supplied, it reconciles their metadata, branches and multiroot visibility; a
|
|
21
|
+
`workspace` alias is reserved for the implicit root. It creates `skills.toml` only for a real
|
|
22
|
+
override.
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- a released `.workflow/.lock` leftover.
|
|
26
|
-
|
|
27
|
-
The `.gitignore` is completed to the current set — entries merge under the existing header, never
|
|
28
|
-
duplicated.
|
|
24
|
+
The `.gitignore` runtime block merges idempotently; a read such as `status` or `resume` never
|
|
25
|
+
creates it or any other workspace file.
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"items": { "enum": ["direct", "compose"] }
|
|
79
79
|
},
|
|
80
80
|
"workspace": {
|
|
81
|
-
"description": "Whether the operation needs a Workline
|
|
81
|
+
"description": "Whether the operation needs a resolved Workline root. The CLI treats the invoked directory as an implicit root; a caller without one receives an explicit result and never materializes Workline by reading.",
|
|
82
82
|
"enum": ["required", "optional", "standalone"]
|
|
83
83
|
},
|
|
84
84
|
"interaction": {
|