@ambystech/ambykit 1.3.0 → 1.5.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/CHANGELOG.md +125 -1
- package/README.md +16 -4
- package/dist/cli/activity.d.ts +5 -1
- package/dist/cli/activity.js +22 -8
- package/dist/cli/activity.js.map +1 -1
- package/dist/cli/add.js +12 -5
- package/dist/cli/add.js.map +1 -1
- package/dist/cli/analyze.d.ts +1 -1
- package/dist/cli/analyze.js +83 -6
- package/dist/cli/analyze.js.map +1 -1
- package/dist/cli/base-command.js +12 -0
- package/dist/cli/base-command.js.map +1 -1
- package/dist/cli/check.js +36 -3
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/dashboard.js +3 -1
- package/dist/cli/dashboard.js.map +1 -1
- package/dist/cli/directive.d.ts +7 -0
- package/dist/cli/directive.js +43 -0
- package/dist/cli/directive.js.map +1 -0
- package/dist/cli/fleet.d.ts +16 -0
- package/dist/cli/fleet.js +472 -0
- package/dist/cli/fleet.js.map +1 -0
- package/dist/cli/graph.d.ts +13 -0
- package/dist/cli/graph.js +40 -0
- package/dist/cli/graph.js.map +1 -0
- package/dist/cli/index.js +12 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/io/fsops.d.ts +9 -0
- package/dist/cli/io/fsops.js +70 -1
- package/dist/cli/io/fsops.js.map +1 -1
- package/dist/cli/lane.d.ts +20 -0
- package/dist/cli/lane.js +396 -0
- package/dist/cli/lane.js.map +1 -0
- package/dist/cli/mcp.d.ts +21 -0
- package/dist/cli/mcp.js +27 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/sync.d.ts +9 -1
- package/dist/cli/sync.js +61 -7
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/trace.d.ts +14 -0
- package/dist/cli/trace.js +89 -0
- package/dist/cli/trace.js.map +1 -0
- package/dist/cli/ui/dashboard/feature-chart.js +15 -2
- package/dist/cli/ui/dashboard/feature-chart.js.map +1 -1
- package/dist/cli/ui/dashboard/feature-view.js +11 -1
- package/dist/cli/ui/dashboard/feature-view.js.map +1 -1
- package/dist/cli/ui/dashboard/graph-view.d.ts +44 -0
- package/dist/cli/ui/dashboard/graph-view.js +78 -0
- package/dist/cli/ui/dashboard/graph-view.js.map +1 -0
- package/dist/cli/ui/dashboard/help-overlay.d.ts +1 -1
- package/dist/cli/ui/dashboard/help-overlay.js +9 -0
- package/dist/cli/ui/dashboard/help-overlay.js.map +1 -1
- package/dist/cli/ui/dashboard/live-tokens.d.ts +221 -0
- package/dist/cli/ui/dashboard/live-tokens.js +221 -0
- package/dist/cli/ui/dashboard/live-tokens.js.map +1 -1
- package/dist/cli/ui/dashboard/quality-view.d.ts +8 -0
- package/dist/cli/ui/dashboard/quality-view.js +31 -0
- package/dist/cli/ui/dashboard/quality-view.js.map +1 -0
- package/dist/cli/ui/dashboard/story-detail.d.ts +1 -1
- package/dist/cli/ui/dashboard/story-detail.js +10 -3
- package/dist/cli/ui/dashboard/story-detail.js.map +1 -1
- package/dist/cli/ui/dashboard/tokens.d.ts +26 -0
- package/dist/cli/ui/dashboard/tokens.js +26 -0
- package/dist/cli/ui/dashboard/tokens.js.map +1 -1
- package/dist/cli/ui/dashboard/worktrees-panel.js +21 -3
- package/dist/cli/ui/dashboard/worktrees-panel.js.map +1 -1
- package/dist/cli/ui/interactive/live.js +3 -0
- package/dist/cli/ui/interactive/live.js.map +1 -1
- package/dist/cli/ui/interactive/overview.d.ts +13 -1
- package/dist/cli/ui/interactive/overview.js +62 -0
- package/dist/cli/ui/interactive/overview.js.map +1 -1
- package/dist/cli/ui/interactive/prompt.d.ts +17 -2
- package/dist/cli/ui/interactive/prompt.js +39 -9
- package/dist/cli/ui/interactive/prompt.js.map +1 -1
- package/dist/cli/ui/tool-options.d.ts +3 -2
- package/dist/cli/ui/tool-options.js +3 -3
- package/dist/cli/ui/tool-options.js.map +1 -1
- package/dist/cli/update.d.ts +1 -1
- package/dist/cli/update.js +8 -3
- package/dist/cli/update.js.map +1 -1
- package/dist/core/activity.d.ts +19 -2
- package/dist/core/activity.js +23 -7
- package/dist/core/activity.js.map +1 -1
- package/dist/core/agents.d.ts +1 -1
- package/dist/core/agents.js +9 -0
- package/dist/core/agents.js.map +1 -1
- package/dist/core/analyze.d.ts +86 -2
- package/dist/core/analyze.js +211 -63
- package/dist/core/analyze.js.map +1 -1
- package/dist/core/checkouts.d.ts +11 -0
- package/dist/core/checkouts.js +84 -10
- package/dist/core/checkouts.js.map +1 -1
- package/dist/core/config.d.ts +28 -1
- package/dist/core/config.js +44 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/dashboard.d.ts +17 -0
- package/dist/core/dashboard.js +29 -1
- package/dist/core/dashboard.js.map +1 -1
- package/dist/core/decisions.d.ts +60 -0
- package/dist/core/decisions.js +231 -0
- package/dist/core/decisions.js.map +1 -0
- package/dist/core/emit.d.ts +21 -1
- package/dist/core/emit.js +93 -4
- package/dist/core/emit.js.map +1 -1
- package/dist/core/features.js +6 -1
- package/dist/core/features.js.map +1 -1
- package/dist/core/fleet/claims.d.ts +45 -0
- package/dist/core/fleet/claims.js +85 -0
- package/dist/core/fleet/claims.js.map +1 -0
- package/dist/core/fleet/directives.d.ts +56 -0
- package/dist/core/fleet/directives.js +99 -0
- package/dist/core/fleet/directives.js.map +1 -0
- package/dist/core/fleet/flow-input.d.ts +6 -0
- package/dist/core/fleet/flow-input.js +35 -0
- package/dist/core/fleet/flow-input.js.map +1 -0
- package/dist/core/fleet/index.d.ts +9 -0
- package/dist/core/fleet/index.js +10 -0
- package/dist/core/fleet/index.js.map +1 -0
- package/dist/core/fleet/lane-status.d.ts +39 -0
- package/dist/core/fleet/lane-status.js +63 -0
- package/dist/core/fleet/lane-status.js.map +1 -0
- package/dist/core/fleet/lock.d.ts +23 -0
- package/dist/core/fleet/lock.js +103 -0
- package/dist/core/fleet/lock.js.map +1 -0
- package/dist/core/fleet/notes.d.ts +31 -0
- package/dist/core/fleet/notes.js +56 -0
- package/dist/core/fleet/notes.js.map +1 -0
- package/dist/core/fleet/run-flow.d.ts +157 -0
- package/dist/core/fleet/run-flow.js +205 -0
- package/dist/core/fleet/run-flow.js.map +1 -0
- package/dist/core/fleet/runs.d.ts +46 -0
- package/dist/core/fleet/runs.js +182 -0
- package/dist/core/fleet/runs.js.map +1 -0
- package/dist/core/fleet/types.d.ts +63 -0
- package/dist/core/fleet/types.js +11 -0
- package/dist/core/fleet/types.js.map +1 -0
- package/dist/core/graph-format.d.ts +51 -0
- package/dist/core/graph-format.js +99 -0
- package/dist/core/graph-format.js.map +1 -0
- package/dist/core/graph-paths.d.ts +27 -0
- package/dist/core/graph-paths.js +94 -0
- package/dist/core/graph-paths.js.map +1 -0
- package/dist/core/graph-scope.d.ts +7 -0
- package/dist/core/graph-scope.js +31 -0
- package/dist/core/graph-scope.js.map +1 -0
- package/dist/core/graph-types.d.ts +55 -0
- package/dist/core/graph-types.js +6 -0
- package/dist/core/graph-types.js.map +1 -0
- package/dist/core/graph.d.ts +14 -0
- package/dist/core/graph.js +144 -0
- package/dist/core/graph.js.map +1 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/lanes.d.ts +116 -0
- package/dist/core/lanes.js +225 -0
- package/dist/core/lanes.js.map +1 -0
- package/dist/core/legacy.d.ts +10 -0
- package/dist/core/legacy.js +35 -0
- package/dist/core/legacy.js.map +1 -0
- package/dist/core/markers.d.ts +44 -0
- package/dist/core/markers.js +139 -0
- package/dist/core/markers.js.map +1 -0
- package/dist/core/merge-json.d.ts +15 -0
- package/dist/core/merge-json.js +46 -0
- package/dist/core/merge-json.js.map +1 -0
- package/dist/core/moved-targets.d.ts +23 -0
- package/dist/core/moved-targets.js +23 -0
- package/dist/core/moved-targets.js.map +1 -0
- package/dist/core/overview-types.d.ts +42 -2
- package/dist/core/overview-types.js.map +1 -1
- package/dist/core/overview.d.ts +1 -1
- package/dist/core/overview.js +93 -74
- package/dist/core/overview.js.map +1 -1
- package/dist/core/path-guard.d.ts +5 -0
- package/dist/core/path-guard.js +9 -0
- package/dist/core/path-guard.js.map +1 -0
- package/dist/core/paths.d.ts +2 -0
- package/dist/core/paths.js +4 -0
- package/dist/core/paths.js.map +1 -1
- package/dist/core/query.d.ts +91 -0
- package/dist/core/query.js +197 -0
- package/dist/core/query.js.map +1 -0
- package/dist/core/report.d.ts +36 -0
- package/dist/core/report.js +62 -0
- package/dist/core/report.js.map +1 -0
- package/dist/core/rules.js +5 -2
- package/dist/core/rules.js.map +1 -1
- package/dist/core/scaffold.d.ts +2 -2
- package/dist/core/scaffold.js +3 -1
- package/dist/core/scaffold.js.map +1 -1
- package/dist/core/subagents.d.ts +29 -0
- package/dist/core/subagents.js +52 -0
- package/dist/core/subagents.js.map +1 -0
- package/dist/core/tasks-edit.d.ts +34 -0
- package/dist/core/tasks-edit.js +115 -0
- package/dist/core/tasks-edit.js.map +1 -0
- package/dist/core/test-design.d.ts +94 -0
- package/dist/core/test-design.js +325 -0
- package/dist/core/test-design.js.map +1 -0
- package/dist/core/trace-cite.d.ts +16 -0
- package/dist/core/trace-cite.js +24 -0
- package/dist/core/trace-cite.js.map +1 -0
- package/dist/core/trace-coverage.d.ts +8 -0
- package/dist/core/trace-coverage.js +40 -0
- package/dist/core/trace-coverage.js.map +1 -0
- package/dist/core/trace-design.d.ts +6 -0
- package/dist/core/trace-design.js +16 -0
- package/dist/core/trace-design.js.map +1 -0
- package/dist/core/trace-io.d.ts +14 -0
- package/dist/core/trace-io.js +97 -0
- package/dist/core/trace-io.js.map +1 -0
- package/dist/core/trace-requirements.d.ts +9 -0
- package/dist/core/trace-requirements.js +27 -0
- package/dist/core/trace-requirements.js.map +1 -0
- package/dist/core/trace-tests.d.ts +7 -0
- package/dist/core/trace-tests.js +27 -0
- package/dist/core/trace-tests.js.map +1 -0
- package/dist/core/trace-types.d.ts +81 -0
- package/dist/core/trace-types.js +3 -0
- package/dist/core/trace-types.js.map +1 -0
- package/dist/core/trace.d.ts +18 -0
- package/dist/core/trace.js +109 -0
- package/dist/core/trace.js.map +1 -0
- package/dist/core/types.d.ts +48 -1
- package/dist/core/worktree.d.ts +8 -0
- package/dist/core/worktree.js +19 -1
- package/dist/core/worktree.js.map +1 -1
- package/dist/emitters/antigravity-cli.d.ts +7 -2
- package/dist/emitters/antigravity-cli.js +11 -2
- package/dist/emitters/antigravity-cli.js.map +1 -1
- package/dist/emitters/antigravity.d.ts +14 -9
- package/dist/emitters/antigravity.js +16 -10
- package/dist/emitters/antigravity.js.map +1 -1
- package/dist/emitters/augment.d.ts +14 -0
- package/dist/emitters/augment.js +20 -0
- package/dist/emitters/augment.js.map +1 -0
- package/dist/emitters/base-emitter.d.ts +34 -0
- package/dist/emitters/base-emitter.js +50 -3
- package/dist/emitters/base-emitter.js.map +1 -1
- package/dist/emitters/claude.d.ts +12 -2
- package/dist/emitters/claude.js +34 -5
- package/dist/emitters/claude.js.map +1 -1
- package/dist/emitters/codex.d.ts +2 -9
- package/dist/emitters/codex.js +2 -19
- package/dist/emitters/codex.js.map +1 -1
- package/dist/emitters/copilot-cli.d.ts +7 -3
- package/dist/emitters/copilot-cli.js +12 -8
- package/dist/emitters/copilot-cli.js.map +1 -1
- package/dist/emitters/copilot.d.ts +5 -0
- package/dist/emitters/copilot.js +23 -1
- package/dist/emitters/copilot.js.map +1 -1
- package/dist/emitters/cursor.d.ts +3 -0
- package/dist/emitters/cursor.js +8 -1
- package/dist/emitters/cursor.js.map +1 -1
- package/dist/emitters/gemini.d.ts +14 -0
- package/dist/emitters/gemini.js +19 -0
- package/dist/emitters/gemini.js.map +1 -0
- package/dist/emitters/index.d.ts +28 -2
- package/dist/emitters/index.js +55 -4
- package/dist/emitters/index.js.map +1 -1
- package/dist/emitters/kilo.d.ts +14 -0
- package/dist/emitters/kilo.js +17 -0
- package/dist/emitters/kilo.js.map +1 -0
- package/dist/emitters/kiro.d.ts +12 -0
- package/dist/emitters/kiro.js +14 -0
- package/dist/emitters/kiro.js.map +1 -0
- package/dist/emitters/llxprt.d.ts +13 -0
- package/dist/emitters/llxprt.js +18 -0
- package/dist/emitters/llxprt.js.map +1 -0
- package/dist/emitters/opencode.d.ts +8 -0
- package/dist/emitters/opencode.js +23 -0
- package/dist/emitters/opencode.js.map +1 -1
- package/dist/emitters/qwen.d.ts +15 -0
- package/dist/emitters/qwen.js +23 -0
- package/dist/emitters/qwen.js.map +1 -0
- package/dist/emitters/skills-emitter.d.ts +21 -0
- package/dist/emitters/skills-emitter.js +39 -0
- package/dist/emitters/skills-emitter.js.map +1 -0
- package/dist/emitters/toml-command-emitter.d.ts +29 -0
- package/dist/emitters/toml-command-emitter.js +69 -0
- package/dist/emitters/toml-command-emitter.js.map +1 -0
- package/dist/emitters/windsurf.d.ts +16 -0
- package/dist/emitters/windsurf.js +21 -0
- package/dist/emitters/windsurf.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/protocol.d.ts +44 -0
- package/dist/mcp/protocol.js +114 -0
- package/dist/mcp/protocol.js.map +1 -0
- package/dist/mcp/registry.d.ts +40 -0
- package/dist/mcp/registry.js +44 -0
- package/dist/mcp/registry.js.map +1 -0
- package/dist/mcp/server.d.ts +7 -0
- package/dist/mcp/server.js +14 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/common.d.ts +12 -0
- package/dist/mcp/tools/common.js +12 -0
- package/dist/mcp/tools/common.js.map +1 -0
- package/dist/mcp/tools/fleet.d.ts +10 -0
- package/dist/mcp/tools/fleet.js +102 -0
- package/dist/mcp/tools/fleet.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +3 -0
- package/dist/mcp/tools/index.js +13 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/read.d.ts +6 -0
- package/dist/mcp/tools/read.js +62 -0
- package/dist/mcp/tools/read.js.map +1 -0
- package/dist/mcp/tools/write.d.ts +6 -0
- package/dist/mcp/tools/write.js +34 -0
- package/dist/mcp/tools/write.js.map +1 -0
- package/dist/plugins/api.d.ts +39 -0
- package/dist/plugins/api.js +28 -0
- package/dist/plugins/api.js.map +1 -0
- package/dist/plugins/index.d.ts +11 -0
- package/dist/plugins/index.js +9 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/loader.d.ts +35 -0
- package/dist/plugins/loader.js +117 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/manifest.d.ts +21 -0
- package/dist/plugins/manifest.js +53 -0
- package/dist/plugins/manifest.js.map +1 -0
- package/dist/plugins/registry.d.ts +36 -0
- package/dist/plugins/registry.js +30 -0
- package/dist/plugins/registry.js.map +1 -0
- package/dist/plugins/report.d.ts +9 -0
- package/dist/plugins/report.js +19 -0
- package/dist/plugins/report.js.map +1 -0
- package/dist/plugins/semver.d.ts +23 -0
- package/dist/plugins/semver.js +106 -0
- package/dist/plugins/semver.js.map +1 -0
- package/dist/plugins/session.d.ts +18 -0
- package/dist/plugins/session.js +22 -0
- package/dist/plugins/session.js.map +1 -0
- package/dist/testkit/contract.d.ts +33 -0
- package/dist/testkit/contract.js +118 -0
- package/dist/testkit/contract.js.map +1 -0
- package/dist/testkit/index.d.ts +15 -0
- package/dist/testkit/index.js +15 -0
- package/dist/testkit/index.js.map +1 -0
- package/docs/architecture.md +34 -6
- package/docs/artifacts/decision-record.md +54 -0
- package/docs/artifacts/tasks.md +37 -0
- package/docs/artifacts/tests.md +43 -0
- package/docs/cli-reference.md +224 -7
- package/docs/concepts/mcp-server.md +93 -0
- package/docs/contributing.md +9 -0
- package/docs/index.md +2 -2
- package/docs/plugin-api.md +124 -0
- package/docs/plugin-split.md +55 -0
- package/docs/plugin-trust.md +51 -0
- package/docs/tool-compatibility.md +155 -18
- package/docs/workflow.md +66 -5
- package/package.json +5 -2
- package/src/agents/worker.md +37 -0
- package/src/prompts/converge.md +8 -3
- package/src/prompts/decide.md +31 -0
- package/src/prompts/implement.md +17 -8
- package/src/prompts/revise.md +4 -2
- package/src/prompts/run.md +100 -0
- package/src/prompts/tasks.md +16 -4
- package/src/roles/security.md +17 -0
- package/src/templates/adr.md +29 -0
- package/src/templates/tasks.md +8 -1
- package/src/templates/tests.md +29 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature 023: the shared dependency graph (types). Pure data, no behaviour. See `graph.ts` for
|
|
3
|
+
* `buildGraph`, `graph-paths.ts` for buildable/critical-path, `graph-format.ts` for text/JSON/Mermaid.
|
|
4
|
+
*/
|
|
5
|
+
/** `depends-on` = needs that story done first; `blocked-by` = something external blocks it. A story may use both. */
|
|
6
|
+
export type EdgeKind = "depends-on" | "blocked-by";
|
|
7
|
+
/** Why a dependency does not resolve (FR-004). */
|
|
8
|
+
export type BrokenReason = "unknown-story" | "unknown-feature";
|
|
9
|
+
export interface StoryNode {
|
|
10
|
+
/** Collision-safe internal key: `<feature dir>:<canonical story id>`, e.g. `905-top:US1`. */
|
|
11
|
+
key: string;
|
|
12
|
+
/** Display ID qualified by the feature's display ref, e.g. `905:US-1` (the directory name when two features share a number). */
|
|
13
|
+
id: string;
|
|
14
|
+
/** Feature directory, e.g. `905-top`. */
|
|
15
|
+
feature: string;
|
|
16
|
+
/** Feature display ref, e.g. `905`. */
|
|
17
|
+
ref: string;
|
|
18
|
+
/** Story ID as written, e.g. `US-1`. */
|
|
19
|
+
story: string;
|
|
20
|
+
title: string;
|
|
21
|
+
status: string;
|
|
22
|
+
priority: string;
|
|
23
|
+
}
|
|
24
|
+
/** `from` depends on / is blocked by `to`. Both ends are node keys. */
|
|
25
|
+
export interface StoryEdge {
|
|
26
|
+
from: string;
|
|
27
|
+
to: string;
|
|
28
|
+
kind: EdgeKind;
|
|
29
|
+
}
|
|
30
|
+
/** Derived (FR-002): feature `from` depends on feature `to`; `via` records the story edges that cause it. Ends are feature dirs. */
|
|
31
|
+
export interface FeatureEdge {
|
|
32
|
+
from: string;
|
|
33
|
+
to: string;
|
|
34
|
+
via: StoryEdge[];
|
|
35
|
+
}
|
|
36
|
+
/** A dependency that names something that does not exist (FR-004): `from` is a node key, `to` is the reference as written. */
|
|
37
|
+
export interface BrokenEdge {
|
|
38
|
+
from: string;
|
|
39
|
+
to: string;
|
|
40
|
+
kind: EdgeKind;
|
|
41
|
+
reason: BrokenReason;
|
|
42
|
+
}
|
|
43
|
+
/** A dependency cycle (FR-005): node keys in dependency order; a self-dependency is a cycle of one. */
|
|
44
|
+
export interface GraphCycle {
|
|
45
|
+
stories: string[];
|
|
46
|
+
}
|
|
47
|
+
export interface DependencyGraph {
|
|
48
|
+
/** Sorted by feature directory, then story number. */
|
|
49
|
+
nodes: StoryNode[];
|
|
50
|
+
/** Grouped by `from` node (in node order), each node's edges in declaration order, depends-on before blocked-by. */
|
|
51
|
+
edges: StoryEdge[];
|
|
52
|
+
featureEdges: FeatureEdge[];
|
|
53
|
+
broken: BrokenEdge[];
|
|
54
|
+
cycles: GraphCycle[];
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-types.js","sourceRoot":"","sources":["../../src/core/graph-types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DependencyGraph } from "./graph-types.js";
|
|
2
|
+
import type { FeatureSnapshot } from "./overview-types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Parse a dependency as stored on a story (`US1`, or `014US2` for a cross-feature `014:US-2`).
|
|
5
|
+
* `ref` is the target feature's number, or null when the dependency stays inside the story's feature.
|
|
6
|
+
* The single definition of the cross-feature syntax; nothing else resolves dependencies.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseDependencyRef(dep: string): {
|
|
9
|
+
ref: string | null;
|
|
10
|
+
local: string;
|
|
11
|
+
};
|
|
12
|
+
/** Collision-safe node key: story ids restart per feature, and two features can share a number. */
|
|
13
|
+
export declare function nodeKey(featureDir: string, canonicalId: string): string;
|
|
14
|
+
export declare function buildGraph(features: FeatureSnapshot[]): DependencyGraph;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { canonicalStoryId } from "./dashboard.js";
|
|
2
|
+
import { compareFeatureDirs } from "./features.js";
|
|
3
|
+
/**
|
|
4
|
+
* Feature 023: the one place that turns the stories of every feature into a dependency graph (FR-001).
|
|
5
|
+
* Pure: a function of `FeatureSnapshot[]`, no filesystem, no mutation of its input, same output for the
|
|
6
|
+
* same specs whatever order the features arrive in (FR-006). `analyze`, the dashboard, `ambykit graph`
|
|
7
|
+
* and later the run scheduler and the MCP server all read dependencies from here (FR-011).
|
|
8
|
+
*/
|
|
9
|
+
const QUALIFIED = /^(\d+)[:/]?(US\d+)$/;
|
|
10
|
+
/**
|
|
11
|
+
* Parse a dependency as stored on a story (`US1`, or `014US2` for a cross-feature `014:US-2`).
|
|
12
|
+
* `ref` is the target feature's number, or null when the dependency stays inside the story's feature.
|
|
13
|
+
* The single definition of the cross-feature syntax; nothing else resolves dependencies.
|
|
14
|
+
*/
|
|
15
|
+
export function parseDependencyRef(dep) {
|
|
16
|
+
const canonical = canonicalStoryId(dep);
|
|
17
|
+
const m = QUALIFIED.exec(canonical);
|
|
18
|
+
return m ? { ref: m[1] ?? null, local: m[2] ?? canonical } : { ref: null, local: canonical };
|
|
19
|
+
}
|
|
20
|
+
/** Collision-safe node key: story ids restart per feature, and two features can share a number. */
|
|
21
|
+
export function nodeKey(featureDir, canonicalId) {
|
|
22
|
+
return `${featureDir}:${canonicalId}`;
|
|
23
|
+
}
|
|
24
|
+
export function buildGraph(features) {
|
|
25
|
+
const sorted = [...features].sort((a, b) => compareFeatureDirs(a.dir, b.dir));
|
|
26
|
+
const nodes = [];
|
|
27
|
+
const byKey = new Map();
|
|
28
|
+
for (const f of sorted) {
|
|
29
|
+
for (const s of f.stories) {
|
|
30
|
+
const key = nodeKey(f.dir, s.id);
|
|
31
|
+
if (byKey.has(key))
|
|
32
|
+
continue; // a story id written twice in one spec: the first one wins
|
|
33
|
+
const node = {
|
|
34
|
+
key,
|
|
35
|
+
id: `${f.displayRef}:${s.displayId}`,
|
|
36
|
+
feature: f.dir,
|
|
37
|
+
ref: f.displayRef,
|
|
38
|
+
story: s.displayId,
|
|
39
|
+
title: s.title,
|
|
40
|
+
status: s.status,
|
|
41
|
+
priority: s.priority,
|
|
42
|
+
};
|
|
43
|
+
nodes.push(node);
|
|
44
|
+
byKey.set(key, node);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// A `NNN:US-#` reference targets the first feature carrying that number (same rule the dashboard used).
|
|
48
|
+
const featureByRef = new Map();
|
|
49
|
+
for (const f of sorted)
|
|
50
|
+
if (!featureByRef.has(f.ref))
|
|
51
|
+
featureByRef.set(f.ref, f);
|
|
52
|
+
const edges = [];
|
|
53
|
+
const broken = [];
|
|
54
|
+
const done = new Set();
|
|
55
|
+
for (const f of sorted) {
|
|
56
|
+
for (const s of f.stories) {
|
|
57
|
+
const from = nodeKey(f.dir, s.id);
|
|
58
|
+
if (done.has(from))
|
|
59
|
+
continue;
|
|
60
|
+
done.add(from);
|
|
61
|
+
const declared = [
|
|
62
|
+
["depends-on", s.dependsOn],
|
|
63
|
+
["blocked-by", s.blockedBy],
|
|
64
|
+
];
|
|
65
|
+
for (const [kind, deps] of declared) {
|
|
66
|
+
const seen = new Set();
|
|
67
|
+
for (const dep of deps) {
|
|
68
|
+
if (seen.has(dep))
|
|
69
|
+
continue;
|
|
70
|
+
seen.add(dep);
|
|
71
|
+
const { ref, local } = parseDependencyRef(dep);
|
|
72
|
+
const target = ref === null ? f : featureByRef.get(ref);
|
|
73
|
+
if (!target) {
|
|
74
|
+
broken.push({ from, to: dep, kind, reason: "unknown-feature" });
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const to = nodeKey(target.dir, local);
|
|
78
|
+
if (byKey.has(to))
|
|
79
|
+
edges.push({ from, to, kind });
|
|
80
|
+
else
|
|
81
|
+
broken.push({ from, to: dep, kind, reason: "unknown-story" });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return { nodes, edges, featureEdges: featureEdgesOf(edges, byKey), broken, cycles: cyclesOf(nodes, edges) };
|
|
87
|
+
}
|
|
88
|
+
/** FR-002: feature A depends on feature B when a story of A has an edge to a story of B; both kinds count. */
|
|
89
|
+
function featureEdgesOf(edges, byKey) {
|
|
90
|
+
const grouped = new Map();
|
|
91
|
+
for (const e of edges) {
|
|
92
|
+
const from = byKey.get(e.from)?.feature;
|
|
93
|
+
const to = byKey.get(e.to)?.feature;
|
|
94
|
+
if (!from || !to || from === to)
|
|
95
|
+
continue;
|
|
96
|
+
const id = `${from}\u0000${to}`;
|
|
97
|
+
const entry = grouped.get(id) ?? { from, to, via: [] };
|
|
98
|
+
entry.via.push({ ...e });
|
|
99
|
+
grouped.set(id, entry);
|
|
100
|
+
}
|
|
101
|
+
return [...grouped.values()].sort((a, b) => compareFeatureDirs(a.from, b.from) || compareFeatureDirs(a.to, b.to));
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* FR-005: each dependency cycle as the ordered keys on it (a self-dependency is a cycle of one). One
|
|
105
|
+
* depth-first pass; a back edge to a node still on the stack closes a cycle.
|
|
106
|
+
*/
|
|
107
|
+
function cyclesOf(nodes, edges) {
|
|
108
|
+
const next = new Map();
|
|
109
|
+
for (const e of edges) {
|
|
110
|
+
const list = next.get(e.from) ?? [];
|
|
111
|
+
if (!list.includes(e.to))
|
|
112
|
+
list.push(e.to);
|
|
113
|
+
next.set(e.from, list);
|
|
114
|
+
}
|
|
115
|
+
const color = new Map(); // absent = unseen, 1 = on stack, 2 = finished
|
|
116
|
+
const stack = [];
|
|
117
|
+
const cycles = [];
|
|
118
|
+
const known = new Set();
|
|
119
|
+
const visit = (key) => {
|
|
120
|
+
color.set(key, 1);
|
|
121
|
+
stack.push(key);
|
|
122
|
+
for (const to of next.get(key) ?? []) {
|
|
123
|
+
const c = color.get(to);
|
|
124
|
+
if (c === 1) {
|
|
125
|
+
const stories = stack.slice(stack.indexOf(to));
|
|
126
|
+
const id = [...stories].sort().join("\u0000");
|
|
127
|
+
if (!known.has(id)) {
|
|
128
|
+
known.add(id);
|
|
129
|
+
cycles.push({ stories });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else if (c === undefined) {
|
|
133
|
+
visit(to);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
stack.pop();
|
|
137
|
+
color.set(key, 2);
|
|
138
|
+
};
|
|
139
|
+
for (const n of nodes)
|
|
140
|
+
if (!color.has(n.key))
|
|
141
|
+
visit(n.key);
|
|
142
|
+
return cycles;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../../src/core/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAYnD;;;;;GAKG;AAEH,MAAM,SAAS,GAAG,qBAAqB,CAAC;AAExC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,CAAC,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACpC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AAC/F,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,OAAO,CAAC,UAAkB,EAAE,WAAmB;IAC7D,OAAO,GAAG,UAAU,IAAI,WAAW,EAAE,CAA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AAI,CAAC,GAAG,CAAC,CAAC;QAChB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;YACrC,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBACZ,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC/C,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC9C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;oBACnB,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;oBACd,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;gBAC3B,CAAC;YACH,CAAC;iBAAM,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;gBAC3B,KAAK,CAAC,EAAE,CAAC,CAAC;YACZ,CAAC;QACH,CAAC;QACD,KAAK,CAAC,GAAG,EAAE,CAAC;QACZ,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;YAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC3D,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -6,6 +6,19 @@ export * from "./dashboard.js";
|
|
|
6
6
|
export * from "./rules.js";
|
|
7
7
|
export * from "./scaffold.js";
|
|
8
8
|
export * from "./analyze.js";
|
|
9
|
+
export * from "./test-design.js";
|
|
9
10
|
export * from "./git.js";
|
|
10
11
|
export * from "./worktree.js";
|
|
11
12
|
export * from "./roles.js";
|
|
13
|
+
export * from "./graph-types.js";
|
|
14
|
+
export * from "./graph.js";
|
|
15
|
+
export * from "./graph-paths.js";
|
|
16
|
+
export * from "./graph-scope.js";
|
|
17
|
+
export * from "./graph-format.js";
|
|
18
|
+
export * from "./trace-types.js";
|
|
19
|
+
export * from "./trace-requirements.js";
|
|
20
|
+
export * from "./trace-cite.js";
|
|
21
|
+
export * from "./trace-tests.js";
|
|
22
|
+
export * from "./trace-design.js";
|
|
23
|
+
export * from "./trace.js";
|
|
24
|
+
export * from "./trace-io.js";
|
package/dist/core/index.js
CHANGED
|
@@ -6,7 +6,20 @@ export * from "./dashboard.js";
|
|
|
6
6
|
export * from "./rules.js";
|
|
7
7
|
export * from "./scaffold.js";
|
|
8
8
|
export * from "./analyze.js";
|
|
9
|
+
export * from "./test-design.js";
|
|
9
10
|
export * from "./git.js";
|
|
10
11
|
export * from "./worktree.js";
|
|
11
12
|
export * from "./roles.js";
|
|
13
|
+
export * from "./graph-types.js";
|
|
14
|
+
export * from "./graph.js";
|
|
15
|
+
export * from "./graph-paths.js";
|
|
16
|
+
export * from "./graph-scope.js";
|
|
17
|
+
export * from "./graph-format.js";
|
|
18
|
+
export * from "./trace-types.js";
|
|
19
|
+
export * from "./trace-requirements.js";
|
|
20
|
+
export * from "./trace-cite.js";
|
|
21
|
+
export * from "./trace-tests.js";
|
|
22
|
+
export * from "./trace-design.js";
|
|
23
|
+
export * from "./trace.js";
|
|
24
|
+
export * from "./trace-io.js";
|
|
12
25
|
//# sourceMappingURL=index.js.map
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { TaskLine } from "./dashboard.js";
|
|
2
|
+
/**
|
|
3
|
+
* Lane analysis (feature 015) — decisions as pure functions over parsed `tasks.md`. No git, no
|
|
4
|
+
* model tokens (FR-013); worktree side effects live in `cli/lane.ts`. Only the manifest helpers at
|
|
5
|
+
* the bottom touch the filesystem.
|
|
6
|
+
*/
|
|
7
|
+
/** Normalize a declared path: `\` → `/`, collapse `//`, drop leading `./` and trailing `/`, lower-case. */
|
|
8
|
+
export declare function normalizePath(raw: string): string;
|
|
9
|
+
/** Two normalized paths overlap when equal or one is a `/`-prefix of the other (FR-005). */
|
|
10
|
+
export declare function overlaps(a: string, b: string): boolean;
|
|
11
|
+
/** Lane `k` of phase `p` for feature `NNN-slug` → `NNN-slug.lane-p-k` (directory and branch). */
|
|
12
|
+
export declare function laneName(feature: string, phase: number, index: number): string;
|
|
13
|
+
/** Inverse of `laneName`; null when `name` is not a lane name. */
|
|
14
|
+
export declare function parseLaneName(name: string): {
|
|
15
|
+
feature: string;
|
|
16
|
+
phase: number;
|
|
17
|
+
index: number;
|
|
18
|
+
} | null;
|
|
19
|
+
export interface Declaration {
|
|
20
|
+
feature: string;
|
|
21
|
+
task: string;
|
|
22
|
+
issue: "missing" | "glob";
|
|
23
|
+
}
|
|
24
|
+
export interface LaneConflict {
|
|
25
|
+
feature: string;
|
|
26
|
+
phase: number;
|
|
27
|
+
/** The shortest overlapping path. */
|
|
28
|
+
path: string;
|
|
29
|
+
/** Sorted task ids (≥ 2, at least one `[P]`). */
|
|
30
|
+
tasks: string[];
|
|
31
|
+
}
|
|
32
|
+
/** Open tasks that declare no usable path, or declare a glob (FR-002/015/016). A warning, never an error. */
|
|
33
|
+
export declare function declarations(feature: string, tasks: TaskLine[]): Declaration[];
|
|
34
|
+
/**
|
|
35
|
+
* Conflicts among open tasks of the same phase where at least one of the pair is `[P]`
|
|
36
|
+
* (FR-004/005/006/015). Findings are grouped per overlapping path: a path claimed by N tasks is one
|
|
37
|
+
* finding listing all N ids.
|
|
38
|
+
*/
|
|
39
|
+
export declare function laneConflicts(feature: string, tasks: TaskLine[]): LaneConflict[];
|
|
40
|
+
/** One-line human message for a conflict, ending with the fix. */
|
|
41
|
+
export declare function describeConflict(c: LaneConflict): string;
|
|
42
|
+
export interface PlannedLane {
|
|
43
|
+
name: string;
|
|
44
|
+
index: number;
|
|
45
|
+
tasks: {
|
|
46
|
+
id: string;
|
|
47
|
+
paths: string[];
|
|
48
|
+
}[];
|
|
49
|
+
}
|
|
50
|
+
export interface LanePlan {
|
|
51
|
+
feature: string;
|
|
52
|
+
phase: number;
|
|
53
|
+
status: "planned" | "complete" | "conflict" | "no-parallel";
|
|
54
|
+
lanes: PlannedLane[];
|
|
55
|
+
/** Open non-`[P]` task ids of the phase — they stay in the feature checkout. */
|
|
56
|
+
stays: string[];
|
|
57
|
+
conflicts: LaneConflict[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Deal a phase's open `[P]` tasks round-robin into `min(lanes, count)` lanes (FR-008/017). Refuses
|
|
61
|
+
* (`conflict`) when the phase has path conflicts (FR-009). `phase` defaults to the first phase with
|
|
62
|
+
* open `[P]` tasks; `lanes` defaults to 2.
|
|
63
|
+
*/
|
|
64
|
+
export declare function planLanes(feature: string, tasks: TaskLine[], opts?: {
|
|
65
|
+
phase?: number;
|
|
66
|
+
lanes?: number;
|
|
67
|
+
}): LanePlan;
|
|
68
|
+
/**
|
|
69
|
+
* Resolve a `tasks.md` conflict that is only about check-offs (FR-019): returns `ours` with every
|
|
70
|
+
* task ticked that either side ticked, preserving ours' line endings. Returns null when `ours` and
|
|
71
|
+
* `theirs` differ in anything but checkbox state (the caller then aborts the merge). `base` is
|
|
72
|
+
* accepted for the 3-way call shape; the union rule does not need it.
|
|
73
|
+
*/
|
|
74
|
+
export declare function mergeCheckoffs(_base: string, ours: string, theirs: string): string | null;
|
|
75
|
+
export interface LaneManifest {
|
|
76
|
+
version: 1;
|
|
77
|
+
feature: string;
|
|
78
|
+
phase: number;
|
|
79
|
+
lane: string;
|
|
80
|
+
/** The feature branch the lane was created from. */
|
|
81
|
+
base: string;
|
|
82
|
+
/** Feature-branch commit the lane started at; a lane still at this commit has no work to merge. */
|
|
83
|
+
baseHead?: string;
|
|
84
|
+
tasks: {
|
|
85
|
+
id: string;
|
|
86
|
+
paths: string[];
|
|
87
|
+
}[];
|
|
88
|
+
}
|
|
89
|
+
/** `<lane checkout>/.amby/lane/lane.json` — in a self-ignoring directory. */
|
|
90
|
+
export declare function manifestPath(laneRoot: string): string;
|
|
91
|
+
export declare function writeManifest(laneRoot: string, manifest: LaneManifest): void;
|
|
92
|
+
/** Read a lane's manifest; null when absent or malformed. */
|
|
93
|
+
export declare function readManifest(laneRoot: string): LaneManifest | null;
|
|
94
|
+
/** Manifest ids that are missing from the feature's current tasks, or whose paths changed (FR-020). */
|
|
95
|
+
export declare function manifestDrift(manifest: LaneManifest, current: TaskLine[]): string[];
|
|
96
|
+
/**
|
|
97
|
+
* clean / dirty / merged for a lane (FR-010). `merged` needs the lane to have moved past where it
|
|
98
|
+
* started — a fresh lane is trivially an ancestor of its feature branch but has nothing to merge.
|
|
99
|
+
*/
|
|
100
|
+
export declare function laneState(input: {
|
|
101
|
+
dirty: boolean;
|
|
102
|
+
tip: string;
|
|
103
|
+
baseHead?: string;
|
|
104
|
+
mergedIntoFeature: boolean;
|
|
105
|
+
}): "clean" | "dirty" | "merged";
|
|
106
|
+
/** Resolve `p-k`, `lane-p-k` or a full lane name against a feature's lane names; null when ambiguous/unknown. */
|
|
107
|
+
export declare function matchLane(feature: string, names: string[], arg: string): string | null;
|
|
108
|
+
/**
|
|
109
|
+
* Feature progress with lane work folded in (decision D5): a task counts done when it is checked in
|
|
110
|
+
* the feature's `tasks.md` or in the lane that owns it, so progress moves before lanes are merged.
|
|
111
|
+
* Returns new task objects; the input is untouched.
|
|
112
|
+
*/
|
|
113
|
+
export declare function unionLaneDone(tasks: TaskLine[], lanes: {
|
|
114
|
+
ids: string[];
|
|
115
|
+
tasks: TaskLine[];
|
|
116
|
+
}[]): TaskLine[];
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Lane analysis (feature 015) — decisions as pure functions over parsed `tasks.md`. No git, no
|
|
5
|
+
* model tokens (FR-013); worktree side effects live in `cli/lane.ts`. Only the manifest helpers at
|
|
6
|
+
* the bottom touch the filesystem.
|
|
7
|
+
*/
|
|
8
|
+
/** Normalize a declared path: `\` → `/`, collapse `//`, drop leading `./` and trailing `/`, lower-case. */
|
|
9
|
+
export function normalizePath(raw) {
|
|
10
|
+
return raw
|
|
11
|
+
.trim()
|
|
12
|
+
.replace(/[\\]/g, "/")
|
|
13
|
+
.replace(/\/{2,}/g, "/")
|
|
14
|
+
.replace(/^(\.\/)+/, "")
|
|
15
|
+
.replace(/\/+$/, "")
|
|
16
|
+
.toLowerCase();
|
|
17
|
+
}
|
|
18
|
+
/** Two normalized paths overlap when equal or one is a `/`-prefix of the other (FR-005). */
|
|
19
|
+
export function overlaps(a, b) {
|
|
20
|
+
return a === b || b.startsWith(`${a}/`) || a.startsWith(`${b}/`);
|
|
21
|
+
}
|
|
22
|
+
/** Lane `k` of phase `p` for feature `NNN-slug` → `NNN-slug.lane-p-k` (directory and branch). */
|
|
23
|
+
export function laneName(feature, phase, index) {
|
|
24
|
+
return `${feature}.lane-${phase}-${index}`;
|
|
25
|
+
}
|
|
26
|
+
const LANE_NAME = /^(\d{3}-[a-z0-9][a-z0-9-]*)\.lane-(\d+)-(\d+)$/;
|
|
27
|
+
/** Inverse of `laneName`; null when `name` is not a lane name. */
|
|
28
|
+
export function parseLaneName(name) {
|
|
29
|
+
const m = LANE_NAME.exec(name);
|
|
30
|
+
if (!m)
|
|
31
|
+
return null;
|
|
32
|
+
return { feature: m[1] ?? "", phase: Number(m[2]), index: Number(m[3]) };
|
|
33
|
+
}
|
|
34
|
+
/** Open tasks that declare no usable path, or declare a glob (FR-002/015/016). A warning, never an error. */
|
|
35
|
+
export function declarations(feature, tasks) {
|
|
36
|
+
return tasks
|
|
37
|
+
.filter((t) => !t.done && t.pathIssue !== undefined)
|
|
38
|
+
.map((t) => ({ feature, task: t.id, issue: t.pathIssue }));
|
|
39
|
+
}
|
|
40
|
+
/** The shortest overlapping path between two tasks' declarations, or null when they are disjoint. */
|
|
41
|
+
function sharedPath(a, b) {
|
|
42
|
+
let best = null;
|
|
43
|
+
for (const pa of a.paths) {
|
|
44
|
+
for (const pb of b.paths) {
|
|
45
|
+
if (!overlaps(pa, pb))
|
|
46
|
+
continue;
|
|
47
|
+
const shorter = pa.length <= pb.length ? pa : pb;
|
|
48
|
+
if (best === null || shorter.length < best.length || (shorter.length === best.length && shorter < best)) {
|
|
49
|
+
best = shorter;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return best;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Conflicts among open tasks of the same phase where at least one of the pair is `[P]`
|
|
57
|
+
* (FR-004/005/006/015). Findings are grouped per overlapping path: a path claimed by N tasks is one
|
|
58
|
+
* finding listing all N ids.
|
|
59
|
+
*/
|
|
60
|
+
export function laneConflicts(feature, tasks) {
|
|
61
|
+
const byPhase = new Map();
|
|
62
|
+
for (const t of tasks) {
|
|
63
|
+
if (t.done || t.paths.length === 0)
|
|
64
|
+
continue;
|
|
65
|
+
const list = byPhase.get(t.phase);
|
|
66
|
+
if (list)
|
|
67
|
+
list.push(t);
|
|
68
|
+
else
|
|
69
|
+
byPhase.set(t.phase, [t]);
|
|
70
|
+
}
|
|
71
|
+
const out = [];
|
|
72
|
+
for (const [phase, list] of [...byPhase].sort((x, y) => x[0] - y[0])) {
|
|
73
|
+
const byPath = new Map();
|
|
74
|
+
for (let i = 0; i < list.length; i++) {
|
|
75
|
+
const a = list[i];
|
|
76
|
+
for (let j = i + 1; j < list.length; j++) {
|
|
77
|
+
const b = list[j];
|
|
78
|
+
if (!a.parallel && !b.parallel)
|
|
79
|
+
continue;
|
|
80
|
+
const path = sharedPath(a, b);
|
|
81
|
+
if (path === null)
|
|
82
|
+
continue;
|
|
83
|
+
const ids = byPath.get(path) ?? new Set();
|
|
84
|
+
ids.add(a.id).add(b.id);
|
|
85
|
+
byPath.set(path, ids);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
for (const [path, ids] of [...byPath].sort((x, y) => (x[0] < y[0] ? -1 : 1))) {
|
|
89
|
+
out.push({ feature, phase, path, tasks: [...ids].sort() });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
94
|
+
/** One-line human message for a conflict, ending with the fix. */
|
|
95
|
+
export function describeConflict(c) {
|
|
96
|
+
return (`${c.feature} phase ${c.phase}: ${c.tasks.join(", ")} both touch \`${c.path}\` — ` +
|
|
97
|
+
"sequence them (drop `[P]` or move one to a later phase)");
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Deal a phase's open `[P]` tasks round-robin into `min(lanes, count)` lanes (FR-008/017). Refuses
|
|
101
|
+
* (`conflict`) when the phase has path conflicts (FR-009). `phase` defaults to the first phase with
|
|
102
|
+
* open `[P]` tasks; `lanes` defaults to 2.
|
|
103
|
+
*/
|
|
104
|
+
export function planLanes(feature, tasks, opts = {}) {
|
|
105
|
+
const wanted = Math.max(1, Math.floor(opts.lanes ?? 2));
|
|
106
|
+
const openParallel = tasks.filter((t) => !t.done && t.parallel);
|
|
107
|
+
const anyParallel = tasks.filter((t) => t.parallel);
|
|
108
|
+
let phase;
|
|
109
|
+
if (opts.phase !== undefined)
|
|
110
|
+
phase = opts.phase;
|
|
111
|
+
else if (openParallel.length > 0)
|
|
112
|
+
phase = Math.min(...openParallel.map((t) => t.phase));
|
|
113
|
+
else
|
|
114
|
+
phase = anyParallel.length > 0 ? Math.max(...anyParallel.map((t) => t.phase)) : 0;
|
|
115
|
+
const base = { feature, phase, lanes: [], stays: [], conflicts: [] };
|
|
116
|
+
const inPhase = tasks.filter((t) => t.phase === phase);
|
|
117
|
+
const open = inPhase.filter((t) => !t.done && t.parallel);
|
|
118
|
+
if (open.length === 0) {
|
|
119
|
+
return { ...base, status: inPhase.some((t) => t.parallel) ? "complete" : "no-parallel" };
|
|
120
|
+
}
|
|
121
|
+
const conflicts = laneConflicts(feature, tasks).filter((c) => c.phase === phase);
|
|
122
|
+
if (conflicts.length > 0)
|
|
123
|
+
return { ...base, status: "conflict", conflicts };
|
|
124
|
+
const n = Math.min(wanted, open.length);
|
|
125
|
+
const lanes = Array.from({ length: n }, (_, i) => ({
|
|
126
|
+
name: laneName(feature, phase, i + 1),
|
|
127
|
+
index: i + 1,
|
|
128
|
+
tasks: [],
|
|
129
|
+
}));
|
|
130
|
+
open.forEach((t, i) => lanes[i % n].tasks.push({ id: t.id, paths: t.paths }));
|
|
131
|
+
const stays = inPhase.filter((t) => !t.done && !t.parallel).map((t) => t.id);
|
|
132
|
+
return { ...base, status: "planned", lanes, stays };
|
|
133
|
+
}
|
|
134
|
+
// ── Check-off merge ─────────────────────────────────────────────────────────────────────────────
|
|
135
|
+
const CHECKBOX = /^(\s*-\s*)\[[ xX]\]/;
|
|
136
|
+
const stripBox = (line) => line.replace(/\r$/, "").replace(CHECKBOX, "$1[ ]");
|
|
137
|
+
const isTicked = (line) => /^\s*-\s*\[[xX]\]/.test(line);
|
|
138
|
+
/**
|
|
139
|
+
* Resolve a `tasks.md` conflict that is only about check-offs (FR-019): returns `ours` with every
|
|
140
|
+
* task ticked that either side ticked, preserving ours' line endings. Returns null when `ours` and
|
|
141
|
+
* `theirs` differ in anything but checkbox state (the caller then aborts the merge). `base` is
|
|
142
|
+
* accepted for the 3-way call shape; the union rule does not need it.
|
|
143
|
+
*/
|
|
144
|
+
export function mergeCheckoffs(_base, ours, theirs) {
|
|
145
|
+
const o = ours.split("\n");
|
|
146
|
+
const t = theirs.split("\n");
|
|
147
|
+
if (o.length !== t.length)
|
|
148
|
+
return null;
|
|
149
|
+
for (let i = 0; i < o.length; i++) {
|
|
150
|
+
if (stripBox(o[i]) !== stripBox(t[i]))
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
return o
|
|
154
|
+
.map((line, i) => (isTicked(t[i]) && !isTicked(line) ? line.replace(CHECKBOX, "$1[x]") : line))
|
|
155
|
+
.join("\n");
|
|
156
|
+
}
|
|
157
|
+
/** `<lane checkout>/.amby/lane/lane.json` — in a self-ignoring directory. */
|
|
158
|
+
export function manifestPath(laneRoot) {
|
|
159
|
+
return join(laneRoot, ".amby", "lane", "lane.json");
|
|
160
|
+
}
|
|
161
|
+
export function writeManifest(laneRoot, manifest) {
|
|
162
|
+
const file = manifestPath(laneRoot);
|
|
163
|
+
const dir = join(laneRoot, ".amby", "lane");
|
|
164
|
+
mkdirSync(dir, { recursive: true });
|
|
165
|
+
writeFileSync(join(dir, ".gitignore"), "*\n", "utf8");
|
|
166
|
+
writeFileSync(file, JSON.stringify(manifest, null, 2) + "\n", "utf8");
|
|
167
|
+
}
|
|
168
|
+
/** Read a lane's manifest; null when absent or malformed. */
|
|
169
|
+
export function readManifest(laneRoot) {
|
|
170
|
+
const file = manifestPath(laneRoot);
|
|
171
|
+
if (!existsSync(file))
|
|
172
|
+
return null;
|
|
173
|
+
try {
|
|
174
|
+
const m = JSON.parse(readFileSync(file, "utf8"));
|
|
175
|
+
if (m.version !== 1 || !m.feature || !m.lane || !Array.isArray(m.tasks))
|
|
176
|
+
return null;
|
|
177
|
+
return m;
|
|
178
|
+
}
|
|
179
|
+
catch {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/** Manifest ids that are missing from the feature's current tasks, or whose paths changed (FR-020). */
|
|
184
|
+
export function manifestDrift(manifest, current) {
|
|
185
|
+
const byId = new Map(current.map((t) => [t.id, t]));
|
|
186
|
+
const key = (paths) => [...paths].sort().join("|");
|
|
187
|
+
return manifest.tasks
|
|
188
|
+
.filter((m) => {
|
|
189
|
+
const t = byId.get(m.id);
|
|
190
|
+
return !t || key(t.paths) !== key(m.paths);
|
|
191
|
+
})
|
|
192
|
+
.map((m) => m.id);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* clean / dirty / merged for a lane (FR-010). `merged` needs the lane to have moved past where it
|
|
196
|
+
* started — a fresh lane is trivially an ancestor of its feature branch but has nothing to merge.
|
|
197
|
+
*/
|
|
198
|
+
export function laneState(input) {
|
|
199
|
+
if (input.dirty)
|
|
200
|
+
return "dirty";
|
|
201
|
+
if (input.mergedIntoFeature && input.baseHead !== undefined && input.tip !== input.baseHead)
|
|
202
|
+
return "merged";
|
|
203
|
+
return "clean";
|
|
204
|
+
}
|
|
205
|
+
/** Resolve `p-k`, `lane-p-k` or a full lane name against a feature's lane names; null when ambiguous/unknown. */
|
|
206
|
+
export function matchLane(feature, names, arg) {
|
|
207
|
+
const wanted = arg.startsWith(`${feature}.`) ? arg : `${feature}.${arg.startsWith("lane-") ? arg : `lane-${arg}`}`;
|
|
208
|
+
return names.includes(wanted) ? wanted : null;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Feature progress with lane work folded in (decision D5): a task counts done when it is checked in
|
|
212
|
+
* the feature's `tasks.md` or in the lane that owns it, so progress moves before lanes are merged.
|
|
213
|
+
* Returns new task objects; the input is untouched.
|
|
214
|
+
*/
|
|
215
|
+
export function unionLaneDone(tasks, lanes) {
|
|
216
|
+
const doneInLane = new Set();
|
|
217
|
+
for (const lane of lanes) {
|
|
218
|
+
const owned = new Set(lane.ids);
|
|
219
|
+
for (const t of lane.tasks)
|
|
220
|
+
if (t.done && owned.has(t.id))
|
|
221
|
+
doneInLane.add(t.id);
|
|
222
|
+
}
|
|
223
|
+
return tasks.map((t) => (!t.done && doneInLane.has(t.id) ? { ...t, done: true } : t));
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=lanes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lanes.js","sourceRoot":"","sources":["../../src/core/lanes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC;;;;GAIG;AAEH,2GAA2G;AAC3G,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,GAAG;SACP,IAAI,EAAE;SACN,OAAO,CAAC,OAAO,EAAE,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CAAC;IACrC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK;YAAE,IAAI,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAClF,CAAC;IACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AmbyConfig } from "./types.js";
|
|
2
|
+
/** Where the Antigravity targets wrote phase commands before feature 018 (workflows, retired 2026-10-19). */
|
|
3
|
+
export declare const LEGACY_WORKFLOW_DIR: string;
|
|
4
|
+
/**
|
|
5
|
+
* Stale, AmbyKit-generated Antigravity workflow files (feature 018, FR-005/FR-006): project-relative
|
|
6
|
+
* paths of `.agents/workflows/amby.<phase>.md` that exist **and** carry the generated notice. Empty
|
|
7
|
+
* unless an Antigravity target is selected, so other projects never see a message. A user's own
|
|
8
|
+
* workflow, a `.bak` left by Antigravity's migration, or a file with a non-phase name never matches.
|
|
9
|
+
*/
|
|
10
|
+
export declare function legacyWorkflowFiles(root: string, config: AmbyConfig): string[];
|