borgmcp 0.7.7 → 0.8.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/dist/claude.d.ts CHANGED
@@ -12,6 +12,8 @@
12
12
  * borg setup → Re-route to the setup wizard
13
13
  * borg spawn <name> → Create a sibling git worktree + launch a
14
14
  * fresh drone inside it (see spawn.ts)
15
+ * borg sync → Advance the current worktree across the 5
16
+ * lifecycle states (see sync.ts, gh#33)
15
17
  */
16
18
  export {};
17
19
  //# sourceMappingURL=claude.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../src/claude.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG"}
1
+ {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../src/claude.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;GAeG"}
package/dist/claude.js CHANGED
@@ -12,6 +12,8 @@
12
12
  * borg setup → Re-route to the setup wizard
13
13
  * borg spawn <name> → Create a sibling git worktree + launch a
14
14
  * fresh drone inside it (see spawn.ts)
15
+ * borg sync → Advance the current worktree across the 5
16
+ * lifecycle states (see sync.ts, gh#33)
15
17
  */
16
18
  import { spawn } from 'child_process';
17
19
  import { basename } from 'node:path';
@@ -19,6 +21,7 @@ import chalk from 'chalk';
19
21
  import { getActiveCube, inboxPathForDrone } from './cubes.js';
20
22
  import { handleVersionFlag } from './version.js';
21
23
  import { parseSpawnArgs, runSpawn } from './spawn.js';
24
+ import { parseSyncArgs, runSync } from './sync.js';
22
25
  import { setTerminalTitle } from './terminal-title.js';
23
26
  async function main() {
24
27
  // Honor `--version` / `-v` before any other work.
@@ -37,6 +40,15 @@ async function main() {
37
40
  const code = await runSpawn(parsed.args);
38
41
  process.exit(code);
39
42
  }
43
+ if (process.argv[2] === 'sync') {
44
+ const parsed = parseSyncArgs(process.argv.slice(3));
45
+ if (!parsed.ok) {
46
+ process.stderr.write(chalk.red(`◼ borg sync: ${parsed.error}\n`));
47
+ process.exit(1);
48
+ }
49
+ const code = await runSync();
50
+ process.exit(code);
51
+ }
40
52
  // Forward any user-supplied flags (e.g. --resume <id>, --cwd, etc.) to
41
53
  // claude unchanged.
42
54
  //
@@ -1 +1 @@
1
- {"version":3,"file":"claude.js","sourceRoot":"","sources":["../src/claude.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,KAAK,UAAU,IAAI;IACjB,kDAAkD;IAClD,iBAAiB,EAAE,CAAC;IAEpB,wBAAwB;IACxB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;QAChC,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;QAC3B,OAAO;IACT,CAAC;IACD,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,iBAAiB,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;YACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,MAA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3
  *
4
- * Addresses consensus finding: Last-write-wins causes silent data loss
5
- * Solution: Track both local and remote timestamps, detect conflicts explicitly
6
- */
7
- import type { FileMetadata, ConflictInfo } from './types.js';
8
- /**
9
- * Calculate SHA-256 hash of file content
10
- */
11
- export declare function hashContent(content: string): string;
12
- /**
13
- * Load sync metadata from disk
14
- */
15
- export declare function loadMetadata(): Promise<FileMetadata | null>;
16
- /**
17
- * Save sync metadata to disk
18
- */
19
- export declare function saveMetadata(metadata: FileMetadata): Promise<void>;
20
- /**
21
- * Read local CLAUDE.md file
22
- */
23
- export declare function readLocalFile(): Promise<string | null>;
24
- /**
25
- * Write content to local CLAUDE.md file
26
- */
27
- export declare function writeLocalFile(content: string): Promise<void>;
28
- /**
29
- * Get local file modification time
30
- */
31
- export declare function getLocalMtime(): Promise<number | null>;
32
- /**
33
- * Detect if there's a sync conflict
4
+ * Detects the current state of the operator's git worktree and either
5
+ * advances it (fast-forward main, merge origin/main into a feature
6
+ * branch, switch to main after a feature branch was merged + deleted
7
+ * on origin) or refuses cleanly (dirty tree, network failure).
8
+ *
9
+ * Five lifecycle states:
10
+ * 1. dirty — uncommitted changes present; refuse + tell
11
+ * operator to commit/stash/restore first.
12
+ * 2. idle — on main, clean, up-to-date with origin/main
13
+ * (or fast-forwarded). Nothing to sync.
14
+ * 3. mid-sprint-noop — on a feature branch; origin/main has not
15
+ * advanced since the branch's merge base.
16
+ * Nothing to do.
17
+ * 4. mid-sprint-merge on a feature branch; origin/main advanced.
18
+ * Merge origin/main into the feature branch
19
+ * (no rebase, per cube workflow rule (a)).
20
+ * 5. post-merge — on a local branch whose remote was deleted
21
+ * (typical post-PR-merge state); switch to
22
+ * main and pull. Local merged branch is left
23
+ * intact for the operator to delete manually.
34
24
  *
35
- * Conflict occurs when:
36
- * 1. Both local and remote have changed since last sync
37
- * 2. Changes are different (different content hashes)
25
+ * The subcommand mirrors `borg spawn`'s dependency-injection shape so
26
+ * tests can stub every external interaction (git, filesystem, output).
27
+ *
28
+ * Anti-features (intentional):
29
+ * - No auto-stash, no auto-commit, no auto-discard on dirty tree.
30
+ * Fail-loud per cube discipline.
31
+ * - No force-push, no rebase, no --force-with-lease (cube rules a, b).
32
+ * - No local-branch deletion (operator decides; sync just announces).
33
+ * - No remote-branch deletion (Coordinator owns merge actions, not
34
+ * this subcommand).
38
35
  */
39
- export declare function detectConflict(localContent: string, remoteContent: string, metadata: FileMetadata | null): Promise<ConflictInfo | null>;
36
+ export type SyncState = {
37
+ kind: 'dirty';
38
+ files: string[];
39
+ } | {
40
+ kind: 'idle';
41
+ branch: string;
42
+ head: string;
43
+ } | {
44
+ kind: 'mid-sprint-noop';
45
+ branch: string;
46
+ head: string;
47
+ } | {
48
+ kind: 'mid-sprint-merge';
49
+ branch: string;
50
+ commits: number;
51
+ } | {
52
+ kind: 'post-merge';
53
+ branch: string;
54
+ mergedSha: string;
55
+ };
56
+ export interface SyncDeps {
57
+ /** Synchronous spawn — used for `git ...` invocations. */
58
+ runSync?: (cmd: string, args: string[], cwd?: string) => SpawnSyncResult;
59
+ /** Inject for tests; defaults to `process.cwd()`. */
60
+ cwd?: () => string;
61
+ /** stderr sink — overridable for tests. */
62
+ stderr?: (line: string) => void;
63
+ /** stdout sink — overridable for tests. */
64
+ stdout?: (line: string) => void;
65
+ }
66
+ export interface SpawnSyncResult {
67
+ status: number | null;
68
+ stdout: string;
69
+ stderr: string;
70
+ }
40
71
  /**
41
- * Handle sync conflict by creating a conflict file
72
+ * Detect the worktree's current lifecycle state. Read-only — performs
73
+ * a `git fetch origin` before measuring so origin/main reflects the
74
+ * latest remote tip.
42
75
  *
43
- * Strategy: Create CLAUDE.md.conflict with remote content
44
- * Keep local file unchanged, let user resolve manually
76
+ * Returns an error variant if the worktree is not a git repository
77
+ * OR if the remote fetch fails.
45
78
  */
46
- export declare function handleConflict(conflict: ConflictInfo): Promise<void>;
79
+ export declare function detectState(deps: Required<SyncDeps>): SyncState | {
80
+ kind: 'error';
81
+ reason: string;
82
+ };
47
83
  /**
48
- * Determine sync action based on file states
49
- *
50
- * Returns: 'push' | 'pull' | 'conflict' | 'skip'
84
+ * Run the `borg sync` flow. Returns the desired process exit code.
51
85
  */
52
- export declare function determineSyncAction(localContent: string | null, remoteContent: string | null, metadata: FileMetadata | null): Promise<'push' | 'pull' | 'conflict' | 'skip'>;
86
+ export declare function runSync(deps?: SyncDeps): Promise<number>;
87
+ export type ParseResult = {
88
+ ok: true;
89
+ } | {
90
+ ok: false;
91
+ error: string;
92
+ };
53
93
  /**
54
- * Update metadata after successful sync
94
+ * Parse args passed after `borg sync`. No positional args, no flags
95
+ * today; reject anything that looks like one to keep room for future
96
+ * extensions (e.g., --dry-run).
55
97
  */
56
- export declare function updateMetadataAfterSync(content: string): Promise<void>;
98
+ export declare function parseSyncArgs(rawArgs: string[]): ParseResult;
57
99
  //# sourceMappingURL=sync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK7D;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAUD;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAUjE;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxE;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAS5D;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAInE;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAU5D;AAED;;;;;;GAMG;AACH,wB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AAQ;IACvB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,eAAe,CAAC;IACzE,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,2CAA2C;IAC3C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAoBD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,GACvB,SAAS,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAyG/C;AAMD;;GAEG;AACH,wBAAsB,OAAO,CAAC,IAAI,GAAE,QAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CA6HlE;AAMD,MAAM,MAAM,WAAW,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,WAAW,CAM5D"}
package/dist/sync.js CHANGED
@@ -1,196 +1,240 @@
1
1
  /**
2
- * File sync logic with conflict detection
2
+ * `borg sync` worktree lifecycle management subcommand (gh#33).
3
3
  *
4
- * Addresses consensus finding: Last-write-wins causes silent data loss
5
- * Solution: Track both local and remote timestamps, detect conflicts explicitly
6
- */
7
- import * as crypto from 'crypto';
8
- import * as fs from 'fs/promises';
9
- import * as path from 'path';
10
- import { homedir } from 'os';
11
- const METADATA_FILE = path.join(homedir(), '.borg-mcp', 'sync-metadata.json');
12
- const CLAUDE_MD_PATH = path.join(homedir(), '.claude', 'CLAUDE.md');
13
- /**
14
- * Calculate SHA-256 hash of file content
15
- */
16
- export function hashContent(content) {
17
- return crypto.createHash('sha256').update(content, 'utf8').digest('hex');
18
- }
19
- /**
20
- * Ensure metadata directory exists
4
+ * Detects the current state of the operator's git worktree and either
5
+ * advances it (fast-forward main, merge origin/main into a feature
6
+ * branch, switch to main after a feature branch was merged + deleted
7
+ * on origin) or refuses cleanly (dirty tree, network failure).
8
+ *
9
+ * Five lifecycle states:
10
+ * 1. dirty — uncommitted changes present; refuse + tell
11
+ * operator to commit/stash/restore first.
12
+ * 2. idle — on main, clean, up-to-date with origin/main
13
+ * (or fast-forwarded). Nothing to sync.
14
+ * 3. mid-sprint-noop — on a feature branch; origin/main has not
15
+ * advanced since the branch's merge base.
16
+ * Nothing to do.
17
+ * 4. mid-sprint-merge — on a feature branch; origin/main advanced.
18
+ * Merge origin/main into the feature branch
19
+ * (no rebase, per cube workflow rule (a)).
20
+ * 5. post-merge — on a local branch whose remote was deleted
21
+ * (typical post-PR-merge state); switch to
22
+ * main and pull. Local merged branch is left
23
+ * intact for the operator to delete manually.
24
+ *
25
+ * The subcommand mirrors `borg spawn`'s dependency-injection shape so
26
+ * tests can stub every external interaction (git, filesystem, output).
27
+ *
28
+ * Anti-features (intentional):
29
+ * - No auto-stash, no auto-commit, no auto-discard on dirty tree.
30
+ * Fail-loud per cube discipline.
31
+ * - No force-push, no rebase, no --force-with-lease (cube rules a, b).
32
+ * - No local-branch deletion (operator decides; sync just announces).
33
+ * - No remote-branch deletion (Coordinator owns merge actions, not
34
+ * this subcommand).
21
35
  */
22
- async function ensureMetadataDir() {
23
- const dir = path.dirname(METADATA_FILE);
24
- await fs.mkdir(dir, { recursive: true });
25
- }
36
+ import { spawnSync } from 'node:child_process';
37
+ import chalk from 'chalk';
38
+ const defaultDeps = {
39
+ runSync: (cmd, args, cwd) => {
40
+ const r = spawnSync(cmd, args, { cwd, encoding: 'utf-8' });
41
+ return {
42
+ status: r.status,
43
+ stdout: r.stdout ?? '',
44
+ stderr: r.stderr ?? '',
45
+ };
46
+ },
47
+ cwd: () => process.cwd(),
48
+ stderr: (line) => process.stderr.write(line),
49
+ stdout: (line) => process.stdout.write(line),
50
+ };
51
+ // ------------------------------------------------------------------
52
+ // State detection (pure of side effects beyond git reads)
53
+ // ------------------------------------------------------------------
26
54
  /**
27
- * Load sync metadata from disk
55
+ * Detect the worktree's current lifecycle state. Read-only — performs
56
+ * a `git fetch origin` before measuring so origin/main reflects the
57
+ * latest remote tip.
58
+ *
59
+ * Returns an error variant if the worktree is not a git repository
60
+ * OR if the remote fetch fails.
28
61
  */
29
- export async function loadMetadata() {
30
- try {
31
- const data = await fs.readFile(METADATA_FILE, 'utf8');
32
- return JSON.parse(data);
33
- }
34
- catch (error) {
35
- if (error.code === 'ENOENT') {
36
- return null; // File doesn't exist yet
37
- }
38
- throw error;
62
+ export function detectState(deps) {
63
+ const { runSync, cwd } = deps;
64
+ const cwdValue = cwd();
65
+ // (1) Confirm we're in a git repo.
66
+ const topLevel = runSync('git', ['rev-parse', '--show-toplevel'], cwdValue);
67
+ if (topLevel.status !== 0) {
68
+ return {
69
+ kind: 'error',
70
+ reason: `not in a git repository (cwd: ${cwdValue})`,
71
+ };
39
72
  }
40
- }
41
- /**
42
- * Save sync metadata to disk
43
- */
44
- export async function saveMetadata(metadata) {
45
- await ensureMetadataDir();
46
- await fs.writeFile(METADATA_FILE, JSON.stringify(metadata, null, 2), 'utf8');
47
- }
48
- /**
49
- * Read local CLAUDE.md file
50
- */
51
- export async function readLocalFile() {
52
- try {
53
- return await fs.readFile(CLAUDE_MD_PATH, 'utf8');
73
+ // (2) Dirty-tree check FIRST so we never act on a worktree with
74
+ // uncommitted changes. `git status --porcelain` returns empty
75
+ // string when the worktree is clean; any line is a dirty file.
76
+ const status = runSync('git', ['status', '--porcelain'], cwdValue);
77
+ if (status.status !== 0) {
78
+ return {
79
+ kind: 'error',
80
+ reason: `git status failed: ${status.stderr.trim()}`,
81
+ };
54
82
  }
55
- catch (error) {
56
- if (error.code === 'ENOENT') {
57
- return null; // File doesn't exist
58
- }
59
- throw error;
83
+ const dirtyLines = status.stdout
84
+ .split('\n')
85
+ .map((l) => l.trim())
86
+ .filter((l) => l.length > 0);
87
+ if (dirtyLines.length > 0) {
88
+ return { kind: 'dirty', files: dirtyLines };
60
89
  }
61
- }
62
- /**
63
- * Write content to local CLAUDE.md file
64
- */
65
- export async function writeLocalFile(content) {
66
- const dir = path.dirname(CLAUDE_MD_PATH);
67
- await fs.mkdir(dir, { recursive: true });
68
- await fs.writeFile(CLAUDE_MD_PATH, content, 'utf8');
69
- }
70
- /**
71
- * Get local file modification time
72
- */
73
- export async function getLocalMtime() {
74
- try {
75
- const stats = await fs.stat(CLAUDE_MD_PATH);
76
- return stats.mtimeMs;
77
- }
78
- catch (error) {
79
- if (error.code === 'ENOENT') {
80
- return null;
81
- }
82
- throw error;
90
+ // (3) Current branch.
91
+ const branch = runSync('git', ['rev-parse', '--abbrev-ref', 'HEAD'], cwdValue);
92
+ if (branch.status !== 0) {
93
+ return {
94
+ kind: 'error',
95
+ reason: `cannot resolve current branch: ${branch.stderr.trim()}`,
96
+ };
83
97
  }
84
- }
85
- /**
86
- * Detect if there's a sync conflict
87
- *
88
- * Conflict occurs when:
89
- * 1. Both local and remote have changed since last sync
90
- * 2. Changes are different (different content hashes)
91
- */
92
- export async function detectConflict(localContent, remoteContent, metadata) {
93
- // No conflict if no metadata (first sync)
94
- if (!metadata) {
95
- return null;
96
- }
97
- const localHash = hashContent(localContent);
98
- const remoteHash = hashContent(remoteContent);
99
- // No conflict if content is identical
100
- if (localHash === remoteHash) {
101
- return null;
102
- }
103
- // Check if both have changed since last sync
104
- const localChanged = localHash !== metadata.lastSyncHash;
105
- const remoteChanged = remoteHash !== metadata.lastSyncHash;
106
- if (localChanged && remoteChanged) {
107
- // CONFLICT: Both local and remote changed since last sync
108
- const localMtime = await getLocalMtime();
98
+ const branchName = branch.stdout.trim();
99
+ if (branchName === 'HEAD') {
109
100
  return {
110
- localContent,
111
- remoteContent,
112
- localMtime: localMtime || Date.now(),
113
- remoteMtime: Date.now(), // Remote doesn't track mtime, use current time
101
+ kind: 'error',
102
+ reason: 'detached HEAD; cannot sync (checkout a branch first)',
114
103
  };
115
104
  }
116
- // No conflict - only one side changed
117
- return null;
118
- }
119
- /**
120
- * Handle sync conflict by creating a conflict file
121
- *
122
- * Strategy: Create CLAUDE.md.conflict with remote content
123
- * Keep local file unchanged, let user resolve manually
124
- */
125
- export async function handleConflict(conflict) {
126
- const conflictPath = `${CLAUDE_MD_PATH}.conflict`;
127
- // Write remote content to conflict file
128
- await fs.writeFile(conflictPath, conflict.remoteContent, 'utf8');
129
- // Log conflict to stderr for user visibility
130
- console.error('\n◼ SYNC CONFLICT DETECTED');
131
- console.error('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
132
- console.error('Both local and remote CLAUDE.md have been modified.');
133
- console.error(`Local file: ${CLAUDE_MD_PATH}`);
134
- console.error(`Remote backup: ${conflictPath}\n`);
135
- console.error('Please resolve manually by choosing one version or merging them.');
136
- console.error('Delete the .conflict file once resolved.\n');
105
+ // (4) Fetch from origin so remote state is current. Failure here is
106
+ // fatal — we can't reason about lifecycle without a fresh remote
107
+ // view. --prune so the local view of remote-tracking branches
108
+ // reflects deletions on origin (load-bearing for post-merge state).
109
+ const fetch = runSync('git', ['fetch', 'origin', '--prune'], cwdValue);
110
+ if (fetch.status !== 0) {
111
+ return {
112
+ kind: 'error',
113
+ reason: `git fetch origin failed: ${fetch.stderr.trim()}`,
114
+ };
115
+ }
116
+ // (5) Current HEAD short sha.
117
+ const head = runSync('git', ['rev-parse', '--short', 'HEAD'], cwdValue);
118
+ const headSha = head.stdout.trim();
119
+ // (6) Branch-class detection.
120
+ if (branchName === 'main') {
121
+ return { kind: 'idle', branch: 'main', head: headSha };
122
+ }
123
+ // (7) Feature-branch sub-states. Check whether origin/<branch>
124
+ // still exists; if not, we're in post-merge state.
125
+ const remoteBranchProbe = runSync('git', ['rev-parse', '--verify', '--quiet', `refs/remotes/origin/${branchName}`], cwdValue);
126
+ if (remoteBranchProbe.status !== 0) {
127
+ return { kind: 'post-merge', branch: branchName, mergedSha: headSha };
128
+ }
129
+ // (8) Remote branch exists — check whether origin/main advanced past
130
+ // the merge-base with our feature branch.
131
+ const mergeBase = runSync('git', ['merge-base', 'HEAD', 'origin/main'], cwdValue);
132
+ if (mergeBase.status !== 0) {
133
+ return {
134
+ kind: 'error',
135
+ reason: `cannot compute merge-base with origin/main: ${mergeBase.stderr.trim()}`,
136
+ };
137
+ }
138
+ const mergeBaseSha = mergeBase.stdout.trim();
139
+ const originMainTip = runSync('git', ['rev-parse', 'origin/main'], cwdValue);
140
+ if (mergeBaseSha === originMainTip.stdout.trim()) {
141
+ return { kind: 'mid-sprint-noop', branch: branchName, head: headSha };
142
+ }
143
+ const commitCount = runSync('git', ['rev-list', '--count', `${mergeBaseSha}..origin/main`], cwdValue);
144
+ const n = parseInt(commitCount.stdout.trim(), 10) || 0;
145
+ return { kind: 'mid-sprint-merge', branch: branchName, commits: n };
137
146
  }
147
+ // ------------------------------------------------------------------
148
+ // State-action dispatcher (side-effecting)
149
+ // ------------------------------------------------------------------
138
150
  /**
139
- * Determine sync action based on file states
140
- *
141
- * Returns: 'push' | 'pull' | 'conflict' | 'skip'
151
+ * Run the `borg sync` flow. Returns the desired process exit code.
142
152
  */
143
- export async function determineSyncAction(localContent, remoteContent, metadata) {
144
- // Case 1: Neither exists - skip
145
- if (!localContent && !remoteContent) {
146
- return 'skip';
147
- }
148
- // Case 2: Only remote exists - pull
149
- if (!localContent && remoteContent) {
150
- return 'pull';
151
- }
152
- // Case 3: Only local exists - push
153
- if (localContent && !remoteContent) {
154
- return 'push';
155
- }
156
- // Case 4: Both exist - check for conflicts
157
- if (localContent && remoteContent) {
158
- const conflict = await detectConflict(localContent, remoteContent, metadata);
159
- if (conflict) {
160
- return 'conflict';
153
+ export async function runSync(deps = {}) {
154
+ const merged = { ...defaultDeps, ...deps };
155
+ const { runSync: runSyncCmd, cwd, stderr, stdout } = merged;
156
+ const state = detectState(merged);
157
+ if (state.kind === 'error') {
158
+ stderr(chalk.red(`◼ borg sync: ${state.reason}\n`));
159
+ return 1;
160
+ }
161
+ if (state.kind === 'dirty') {
162
+ stderr(chalk.yellow(`◼ Working tree has uncommitted changes.\n`));
163
+ const preview = state.files.slice(0, 5);
164
+ for (const line of preview) {
165
+ stderr(chalk.gray(` ${line}\n`));
166
+ }
167
+ if (state.files.length > 5) {
168
+ stderr(chalk.gray(` ... and ${state.files.length - 5} more\n`));
161
169
  }
162
- // No conflict - determine direction based on content hash
163
- const localHash = hashContent(localContent);
164
- const remoteHash = hashContent(remoteContent);
165
- if (localHash === remoteHash) {
166
- return 'skip'; // Identical content
170
+ stderr(chalk.yellow(`◼ Commit, stash, or restore before running \`borg sync\`.\n`));
171
+ return 1;
172
+ }
173
+ if (state.kind === 'idle') {
174
+ const ahead = runSyncCmd('git', ['rev-list', '--count', 'HEAD..origin/main'], cwd());
175
+ const n = parseInt(ahead.stdout.trim(), 10) || 0;
176
+ if (n === 0) {
177
+ stdout(chalk.blue(`◼ On main; up to date with origin (@${state.head}).\n`));
178
+ return 0;
179
+ }
180
+ const pull = runSyncCmd('git', ['pull', '--ff-only', 'origin', 'main'], cwd());
181
+ if (pull.status !== 0) {
182
+ stderr(chalk.red(`◼ borg sync: git pull --ff-only failed:\n${pull.stderr.trim()}\n`));
183
+ return 1;
184
+ }
185
+ const newHead = runSyncCmd('git', ['rev-parse', '--short', 'HEAD'], cwd());
186
+ stdout(chalk.blue(`◼ On main; fast-forwarded ${n} commit${n === 1 ? '' : 's'} → @${newHead.stdout.trim()}.\n`));
187
+ return 0;
188
+ }
189
+ if (state.kind === 'mid-sprint-noop') {
190
+ stdout(chalk.blue(`◼ On \`${state.branch}\` @${state.head}; up to date with origin (no upstream changes).\n`));
191
+ stdout(chalk.gray(`◼ Continue your sprint, or post REVIEW-READY when complete.\n`));
192
+ return 0;
193
+ }
194
+ if (state.kind === 'mid-sprint-merge') {
195
+ // Merge origin/main into feature branch. No rebase (cube rule a).
196
+ const merge = runSyncCmd('git', ['merge', '--no-edit', 'origin/main'], cwd());
197
+ if (merge.status !== 0) {
198
+ stderr(chalk.red(`◼ borg sync: git merge origin/main failed (likely conflict). Resolve manually:\n${merge.stderr.trim()}\n`));
199
+ return 1;
200
+ }
201
+ const newHead = runSyncCmd('git', ['rev-parse', '--short', 'HEAD'], cwd());
202
+ stdout(chalk.blue(`◼ On \`${state.branch}\`; merged ${state.commits} commit${state.commits === 1 ? '' : 's'} from origin/main → @${newHead.stdout.trim()}.\n`));
203
+ stdout(chalk.gray(`◼ Re-run tests; continue your sprint.\n`));
204
+ return 0;
205
+ }
206
+ if (state.kind === 'post-merge') {
207
+ const checkout = runSyncCmd('git', ['checkout', 'main'], cwd());
208
+ if (checkout.status !== 0) {
209
+ stderr(chalk.red(`◼ borg sync: git checkout main failed:\n${checkout.stderr.trim()}\n`));
210
+ return 1;
167
211
  }
168
- // One side changed - sync in that direction
169
- if (metadata) {
170
- const localChanged = localHash !== metadata.lastSyncHash;
171
- const remoteChanged = remoteHash !== metadata.lastSyncHash;
172
- if (localChanged) {
173
- return 'push';
174
- }
175
- if (remoteChanged) {
176
- return 'pull';
177
- }
212
+ const pull = runSyncCmd('git', ['pull', '--ff-only', 'origin', 'main'], cwd());
213
+ if (pull.status !== 0) {
214
+ stderr(chalk.red(`◼ borg sync: git pull --ff-only failed:\n${pull.stderr.trim()}\n`));
215
+ return 1;
178
216
  }
179
- // No metadata - default to push (local is source of truth for first sync)
180
- return 'push';
217
+ const newHead = runSyncCmd('git', ['rev-parse', '--short', 'HEAD'], cwd());
218
+ stdout(chalk.blue(`◼ Branch \`${state.branch}\` was merged on origin; switched to main @${newHead.stdout.trim()}.\n`));
219
+ stdout(chalk.gray(`◼ Local branch \`${state.branch}\` retained; delete with \`git branch -d ${state.branch}\` when ready.\n`));
220
+ return 0;
181
221
  }
182
- return 'skip';
222
+ // Exhaustiveness — unreachable.
223
+ const _exhaustive = state;
224
+ stderr(chalk.red(`◼ borg sync: unhandled state\n`));
225
+ return 1;
183
226
  }
184
227
  /**
185
- * Update metadata after successful sync
228
+ * Parse args passed after `borg sync`. No positional args, no flags
229
+ * today; reject anything that looks like one to keep room for future
230
+ * extensions (e.g., --dry-run).
186
231
  */
187
- export async function updateMetadataAfterSync(content) {
188
- const metadata = {
189
- localMtime: await getLocalMtime() || Date.now(),
190
- remoteMtime: Date.now(),
191
- lastSyncHash: hashContent(content),
192
- lastSyncTime: Date.now(),
232
+ export function parseSyncArgs(rawArgs) {
233
+ if (rawArgs.length === 0)
234
+ return { ok: true };
235
+ return {
236
+ ok: false,
237
+ error: `unexpected argument: ${rawArgs[0]}. Usage: borg sync (no arguments)`,
193
238
  };
194
- await saveMetadata(metadata);
195
239
  }
196
240
  //# sourceMappingURL=sync.js.map
package/dist/sync.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sync.js","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAG7B,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,oBAAoB,CAAC,CAAC;AAC9E,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;AAEpE;;GAEG;AACH,MAAM,UAAU,WA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ACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CAMzB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;AAoMD,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAE9C,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAEzD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAE5C"}
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CAMzB;AA6DD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;AAoMD,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAE9C,CAAC;AAEF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAEzD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAE5C"}
package/dist/templates.js CHANGED
@@ -25,6 +25,62 @@
25
25
  * schema-allowed; in practice, software-dev cubes ship exactly one
26
26
  * (Coordinator).
27
27
  */
28
+ // ====================================================================
29
+ // Shared workflow-discipline content (gh#31 + gh#32, productized in
30
+ // 0.8.0 per Sprint A of 2026-05-13). The cube directive + role
31
+ // descriptions weave these constants in so new cubes inherit the
32
+ // session-codified discipline automatically. Source-of-truth is the
33
+ // cube log entries enumerated in drone-1's 17:06:58 reconstruction
34
+ // note; these strings are faithful paraphrases trimmed to template
35
+ // scale. Update both the cube-log canonical post AND these constants
36
+ // together — keep them in sync.
37
+ // ====================================================================
38
+ /**
39
+ * gh#32 — escalation hierarchy. Universal clause for every non-
40
+ * Coordinator role. Source: cube-log entries 2026-05-13T10:11:47Z
41
+ * (PROCESS REMINDER) + 2026-05-13T10:13:22Z (AskUserQuestion
42
+ * addendum).
43
+ */
44
+ const ESCALATION_DISCIPLINE = `
45
+
46
+ **Escalation discipline (gh#32):**
47
+ - The cube hierarchy is Drones ↔ Coordinator ↔ Queen. Address Coordinator (typically \`drone-1:\`) when blocked; **never** address Queen directly via cube messages.
48
+ - When blocked — missing context, ambiguous scope, harness rejection, environment issue, anything — post to cube log with structured frame: "drone-1: blocker X, options A/B/C, my pick is B." Coordinator either resolves in-lane OR escalates to Queen if the decision is genuinely Queen-class.
49
+ - **Do NOT use the \`AskUserQuestion\` tool for in-cube decisions.** That tool surfaces the question directly to the human at their terminal (Queen) and bypasses the Coordinator-routing the cube relies on. \`AskUserQuestion\` is reserved for genuinely user-only-knowable info in solo work (preferences, config values, etc.) — never for "should I deploy?" / "should I skip E2E?" / "which option?" — those are Coordinator decisions posted to cube log.
50
+ - User-facing text output: same rule. Framing should be "drone-1: blocker X, options A/B/C, my pick is B" — never "Queen: which of A/B/C?" The cube log is the channel; how the harness displays your output is incidental.
51
+ - If Coordinator is silent >10 min on a blocker, PING via \`borg:roster since=<dispatch-entry-id>\` or post a follow-up — don't bypass to Queen.
52
+ - Autonomous-mode default: if you can resolve a question by reading the cube log + your role playbook + the codebase, do so without escalating. Escalate only when you genuinely need a decision Coordinator (or higher) holds.`;
53
+ /**
54
+ * gh#31 + Queen rule (d) — git workflow rules + full release cycle.
55
+ * Coordinator-only clause; only the Coordinator role enacts merges,
56
+ * deploys, and release-housekeeping. Source: cube-log entries
57
+ * 2026-05-13T08:45:40Z (rules codified) + 2026-05-13T14:05Z
58
+ * (full-release-cycle discipline correction).
59
+ */
60
+ const COORDINATOR_WORKFLOW_RULES = `
61
+
62
+ **Codified git workflow rules (gh#31):**
63
+ - **(a) No rebases, ever, on any branch.** Includes \`--interactive\` and \`gh pr merge --rebase\`. Upstream pull-in into a feature branch is \`git fetch origin && git merge origin/main\`. Feature-branch-into-main uses \`gh pr merge --merge\` (explicit merge commit).
64
+ - **(b) No force-pushes, ever.** Includes \`--force-with-lease\`. The audit-trail commit-hash stability property is load-bearing — every SECURITY-* / REVIEW-* entry anchors on hashes; rewriting them dangles the references. Recovery for a half-rebased feature branch is \`git reset --hard origin/<branch>\` (resets local to remote without destructive remote push) then \`git merge origin/main\`.
65
+ - **(c) Coordinator owns ALL merges into main AND all deploys for code-bearing PRs.** Other roles never run \`gh pr merge\` or \`git push origin main\`. Coordinator verifies all required gates pass before merging. **No fallback when Coordinator unavailable — cube halts on merge actions until Coordinator returns.** Per gh#31: Coordinator also runs all test-env and prod deploys for QA-gated PRs and code-bearing PRs touching workers/ or landing-page/ — drones lack user-level shared-infra auth.
66
+ - **(d) Merge commit body encodes gate entry IDs:**
67
+ \`\`\`
68
+ Reviewed-by: drone-2 (entry <uuid>)
69
+ Security-Approved-by: drone-8 (entry <uuid>)
70
+ QA-Passed-by: drone-3 (entry <uuid>)
71
+ UX-Approved-by: drone-4 (entry <uuid>)
72
+ \`\`\`
73
+ Format makes the multi-lens approval chain durable in git log independent of cube-log retention.
74
+ - **(e) Fetch-before-push discipline.** Always \`git fetch origin && git log HEAD..origin/main --oneline\` before \`git push origin main\` to detect any commits that landed during local work.
75
+
76
+ **Full release cycle (5 steps for code-bearing PRs):**
77
+ 1. Merge PR → main (Coordinator runs \`gh pr merge --merge\` with the gate-ID trailer above)
78
+ 2. npm publish (Queen — Coordinator stages the commit, hands off the \`cd client && npm publish\` command)
79
+ 3. Tag + push (Coordinator runs \`git tag -a vX.Y.Z -m "..."\` + \`git push origin vX.Y.Z\` **immediately** after Queen confirms publish; don't let the cleanup step slip)
80
+ 4. Prod deploy worker + frontend (Coordinator-class, Queen-authorized) — code-bearing PRs touching \`workers/\` or \`landing-page/\` need this step. Library-only PRs (changes ONLY in \`client/\`) skip this step.
81
+ 5. PM ALIGNMENT verifies deployed surface (not just npm/tag claim) — catches the claimed-vs-shipped gap class
82
+
83
+ **In-lane decision discipline:** when a drone escalates, make the call IN YOUR LANE: deploy from your session if the drone can't, pick A/B/C on tactical splits, authorize anti-scope clarifications, resolve cross-drone NIT disagreements. Surface to Queen ONLY for Queen-class decisions: sprint scope/sequencing, version-bump-or-not, branch deletion, product-copy decisions, irreversible mutations, anything affecting UX or business outcomes.`;
28
84
  const SOFTWARE_DEV = {
29
85
  name: 'software-dev',
30
86
  description: 'Multi-agent software development. Coordinator (held by the human Queen) directs Builders, a Code Reviewer, a QA Tester, a UX Expert, a Visionary, a Product Manager, and a Security Auditor. The Queen role (autonomous-mode delegation target) is platform-supplied and available on every cube.',
@@ -63,7 +119,7 @@ Log conventions you use:
63
119
 
64
120
  Read the log first on every regen. Act only on actionable signals.
65
121
 
66
- **Elevation to the Queen role (autonomous variant):** When the human Queen authorizes autonomous operation (a few hours, overnight, etc.), your role is reassigned to Queen via \`borg:reassign-drone\`. Same base responsibilities documented here; the Queen role adds autonomous-mode behaviors (ship-on-consensus, ~2h STATE-SUMMARY cadence, sustained-idle stop, operator-credentialed deferral) documented in its own \`detailed_description\`. On the human Queen's return, you're reassigned back to this role. Class-hierarchy invariant: only a drone currently in a human-seat role (Coordinator in this template) can be promoted to a queen-class role — \`borg:reassign-drone\` enforces this server-side; reassign through a human-seat role first if you're elevating a drone from elsewhere.`,
122
+ **Elevation to the Queen role (autonomous variant):** When the human Queen authorizes autonomous operation (a few hours, overnight, etc.), your role is reassigned to Queen via \`borg:reassign-drone\`. Same base responsibilities documented here; the Queen role adds autonomous-mode behaviors (ship-on-consensus, ~2h STATE-SUMMARY cadence, sustained-idle stop, operator-credentialed deferral) documented in its own \`detailed_description\`. On the human Queen's return, you're reassigned back to this role. Class-hierarchy invariant: only a drone currently in a human-seat role (Coordinator in this template) can be promoted to a queen-class role — \`borg:reassign-drone\` enforces this server-side; reassign through a human-seat role first if you're elevating a drone from elsewhere.${COORDINATOR_WORKFLOW_RULES}`,
67
123
  },
68
124
  {
69
125
  name: 'Builder',
@@ -80,7 +136,7 @@ Workflow:
80
136
  Project conventions:
81
137
  - TDD where it applies (DB methods, business logic). Skip TDD for migrations and UI.
82
138
  - Always commit specific file paths (\`git add path/to/file\`), never \`-A\`.
83
- - Tests must pass and any build-verification or deploy-dry-run gate the cube specifies must succeed before claiming DONE.`,
139
+ - Tests must pass and any build-verification or deploy-dry-run gate the cube specifies must succeed before claiming DONE.${ESCALATION_DISCIPLINE}`,
84
140
  },
85
141
  {
86
142
  name: 'Code Reviewer',
@@ -96,7 +152,7 @@ Workflow:
96
152
  - For each finding worth flagging, post \`REVIEW-FEEDBACK: <branch> <observation>\` — high-confidence issues only. Sort blockers from nits explicitly.
97
153
  - When done, post either \`REVIEW-APPROVED: <branch>\` (clean) or expect the Builder to address feedback and re-post \`REVIEW-READY:\`. Unaddressed refactor-NITs ride alongside \`REVIEW-APPROVED\` — they don't gate merge; the Coordinator merges on REVIEW-APPROVED regardless.
98
154
 
99
- Don't merge yourself — \`REVIEW-APPROVED\` is the signal; the Coordinator does the actual merge to main.`,
155
+ Don't merge yourself — \`REVIEW-APPROVED\` is the signal; the Coordinator does the actual merge to main.${ESCALATION_DISCIPLINE}`,
100
156
  },
101
157
  {
102
158
  name: 'QA Tester',
@@ -111,7 +167,7 @@ Workflow:
111
167
  - For each defect, post \`QA-FAIL: <branch> <one-line symptom> — repro: <steps>\`. Be specific enough that the Builder can reproduce without asking. Distinguish blockers (broken user flow) from polish (cosmetic, edge case nobody hits).
112
168
  - When the change passes, post \`QA-PASS: <branch> <what you exercised>\`. List the scenarios you actually ran so reviewers can see coverage.
113
169
 
114
- You don't gate merges directly and you don't perform them — \`QA-PASS\` is the green-light signal, the Coordinator does the actual merge. Your job is to make sure no one ships something they only think works.`,
170
+ You don't gate merges directly and you don't perform them — \`QA-PASS\` is the green-light signal, the Coordinator does the actual merge. Your job is to make sure no one ships something they only think works.${ESCALATION_DISCIPLINE}`,
115
171
  },
116
172
  {
117
173
  name: 'UX Expert',
@@ -124,7 +180,7 @@ Workflow:
124
180
  - Use the Playwright MCP if available to actually exercise the flows in a browser, not just read the diff.
125
181
  - Post findings as \`UX-FEEDBACK: <branch> <observation>\` and approvals as \`UX-APPROVED: <branch>\`.
126
182
 
127
- You don't gate merges and you don't perform them — \`UX-APPROVED\` is informational signal, the Coordinator does the actual merge. Your job is to make the signal visible.`,
183
+ You don't gate merges and you don't perform them — \`UX-APPROVED\` is informational signal, the Coordinator does the actual merge. Your job is to make the signal visible.${ESCALATION_DISCIPLINE}`,
128
184
  },
129
185
  {
130
186
  name: 'Product Manager',
@@ -154,7 +210,7 @@ Operating principles:
154
210
  - Respect the strategic-horizon stated by the Queen + Visionary. Coherence findings are present-tense; if you spot something that should be on the roadmap but isn't, flag it as a VISION-CHECK and let the Visionary + Queen weigh whether to extend the horizon.
155
211
  - The PM seat is distinct from the Visionary seat: Visionary is generative future-facing ("what should EXIST that doesn't?"), Product Manager is integrative present-facing ("does the thing-that-exists hang together?"). The same drone can hold both at different times, but they're different lenses on different time horizons.
156
212
 
157
- Read the log first on every regen — including older entries that may have surfaced drift you can confirm or close.`,
213
+ Read the log first on every regen — including older entries that may have surfaced drift you can confirm or close.${ESCALATION_DISCIPLINE}`,
158
214
  },
159
215
  {
160
216
  name: 'Visionary',
@@ -184,7 +240,7 @@ Operating principles:
184
240
  - Don't bypass dispatch. You propose; the Queen and Coordinator triage. Don't directly tell Builders to do things.
185
241
  - Respect the cube's current focus. Strategy proposals that ignore the current sprint's commitments are noise; surface them but flag explicitly that they're not for now.
186
242
 
187
- Read the log first on every regen — including older entries that may have surfaced retrospectives you can build on.`,
243
+ Read the log first on every regen — including older entries that may have surfaced retrospectives you can build on.${ESCALATION_DISCIPLINE}`,
188
244
  },
189
245
  {
190
246
  name: 'Security Auditor',
@@ -212,7 +268,7 @@ When done, post \`SECURITY-APPROVED: <branch>\` (clean), or \`SECURITY-DEFER: <b
212
268
 
213
269
  Don't merge yourself — \`SECURITY-APPROVED\` is the signal; the Coordinator does the actual merge. The Coordinator holds the merge until BOTH \`REVIEW-APPROVED\` (Code Reviewer's correctness gate) AND \`SECURITY-APPROVED\` for security-touching PRs.
214
270
 
215
- You DON'T do: correctness review (Code Reviewer's lane), QA testing (QA Tester's lane), UX evaluation (UX Expert's lane), merging, or releasing. Your output is \`SECURITY-FINDING:\` / \`SECURITY-APPROVED:\` / \`SECURITY-DEFER:\` / \`SECURITY-SWEEP:\` signals on the log.`,
271
+ You DON'T do: correctness review (Code Reviewer's lane), QA testing (QA Tester's lane), UX evaluation (UX Expert's lane), merging, or releasing. Your output is \`SECURITY-FINDING:\` / \`SECURITY-APPROVED:\` / \`SECURITY-DEFER:\` / \`SECURITY-SWEEP:\` signals on the log.${ESCALATION_DISCIPLINE}`,
216
272
  },
217
273
  ],
218
274
  };
@@ -1 +1 @@
1
- {"version":3,"file":"templates.js","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAqBH,MAAM,YAAY,GAAa;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,mSAAmS;IACrS,KAAK,EAAE;QACL;YACE,IAAI,EAAE,aAAa;YACnB,aAAa,EAAE,IAAI;YACnB,iBAAiB,EACf,oNAAoN;YACtN,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+wBA8BmvB;SAC1wB;QACD;YACE,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,IAAI;YAChB,iBAAiB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AE;SACvI;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,iBAAiB,EAAE,8KAA8K;YACjM,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;gRAuBoP,qBAAqB,EAAE;SAClS;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAA6B;IACjD,cAAc,EAAE,YAAY;CAC7B,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAChC,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,23 +1,6 @@
1
1
  /**
2
2
  * Type definitions for Borg MCP Client
3
3
  */
4
- export interface FileMetadata {
5
- localMtime: number;
6
- remoteMtime: number;
7
- lastSyncHash: string;
8
- lastSyncTime: number;
9
- }
10
- export interface SyncState {
11
- inProgress: boolean;
12
- lastSync: number;
13
- pendingChanges: PendingChange[];
14
- }
15
- export interface PendingChange {
16
- operation: 'set' | 'delete';
17
- content?: string;
18
- timestamp: number;
19
- retryCount: number;
20
- }
21
4
  export interface GoogleOAuthTokens {
22
5
  id_token: string;
23
6
  refresh_token?: string;
@@ -28,10 +11,4 @@ export interface RemoteResponse {
28
11
  data?: any;
29
12
  error?: string;
30
13
  }
31
- export interface ConflictInfo {
32
- localContent: string;
33
- remoteContent: string;
34
- localMtime: number;
35
- remoteMtime: number;
36
- }
37
14
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "borgmcp",
3
- "version": "0.7.7",
3
+ "version": "0.8.0",
4
4
  "description": "Multi-agent coordination for Claude Code — cubes, drones, and a shared activity log.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",