@wascartech/devbot 2.2.0 → 2.3.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.
@@ -9,7 +9,8 @@ export function initWorkItemBranchTable() {
9
9
  CREATE TABLE IF NOT EXISTS work_item_branch (
10
10
  work_item_id INTEGER PRIMARY KEY,
11
11
  branch TEXT NOT NULL,
12
- created_at INTEGER NOT NULL
12
+ created_at INTEGER NOT NULL,
13
+ adopted INTEGER NOT NULL DEFAULT 0
13
14
  )
14
15
  `);
15
16
  }
@@ -17,11 +18,11 @@ export function initWorkItemBranchTable() {
17
18
  // mention does not overwrite the stored name; runner.ts surfaces the ignore to
18
19
  // the user. The row is the single source of truth for the work branch across
19
20
  // every subsequent run.
20
- export function setWorkBranchIfUnset(workItemId, branch) {
21
+ export function setWorkBranchIfUnset(workItemId, branch, adopted = false) {
21
22
  db.prepare(`
22
- INSERT OR IGNORE INTO work_item_branch (work_item_id, branch, created_at)
23
- VALUES (?, ?, ?)
24
- `).run(workItemId, branch, Math.floor(Date.now() / 1000));
23
+ INSERT OR IGNORE INTO work_item_branch (work_item_id, branch, created_at, adopted)
24
+ VALUES (?, ?, ?, ?)
25
+ `).run(workItemId, branch, Math.floor(Date.now() / 1000), adopted ? 1 : 0);
25
26
  }
26
27
  export function getWorkBranch(workItemId) {
27
28
  const row = db
@@ -29,6 +30,14 @@ export function getWorkBranch(workItemId) {
29
30
  .get(workItemId);
30
31
  return row ? row.branch : null;
31
32
  }
33
+ // Whether the stored branch was adopted from the remote rather than created by
34
+ // DevBot. Adopted branches are fast-forward only: their history is shared.
35
+ export function isWorkBranchAdopted(workItemId) {
36
+ const row = db
37
+ .prepare("SELECT adopted FROM work_item_branch WHERE work_item_id = ?")
38
+ .get(workItemId);
39
+ return row?.adopted === 1;
40
+ }
32
41
  // Test-only: no production path clears a work-item's branch name. /reset and
33
42
  // close deliberately keep it (see migration 0018).
34
43
  export function deleteWorkBranch(workItemId) {
@@ -1 +1 @@
1
- {"version":3,"file":"work-item-branch-store.js","sourceRoot":"","sources":["../src/work-item-branch-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,yEAAyE;AACzE,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;AAC/E,yEAAyE;AACzE,MAAM,UAAU,uBAAuB;IACrC,EAAE,CAAC,IAAI,CAAC;;;;;;GAMP,CAAC,CAAC;AACL,CAAC;AAED,+EAA+E;AAC/E,+EAA+E;AAC/E,6EAA6E;AAC7E,wBAAwB;AACxB,MAAM,UAAU,oBAAoB,CAAC,UAAkB,EAAE,MAAc;IACrE,EAAE,CAAC,OAAO,CAAC;;;GAGV,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UAAkB;IAC9C,MAAM,GAAG,GAAG,EAAE;SACX,OAAO,CAAC,4DAA4D,CAAC;SACrE,GAAG,CAAC,UAAU,CAAmC,CAAC;IACrD,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,6EAA6E;AAC7E,mDAAmD;AACnD,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IACjD,EAAE,CAAC,OAAO,CAAC,qDAAqD,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACpF,CAAC"}
1
+ {"version":3,"file":"work-item-branch-store.js","sourceRoot":"","sources":["../src/work-item-branch-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,yEAAyE;AACzE,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;AAC/E,yEAAyE;AACzE,MAAM,UAAU,uBAAuB;IACrC,EAAE,CAAC,IAAI,CAAC;;;;;;;GAOP,CAAC,CAAC;AACL,CAAC;AAED,+EAA+E;AAC/E,+EAA+E;AAC/E,6EAA6E;AAC7E,wBAAwB;AACxB,MAAM,UAAU,oBAAoB,CAAC,UAAkB,EAAE,MAAc,EAAE,OAAO,GAAG,KAAK;IACtF,EAAE,CAAC,OAAO,CAAC;;;GAGV,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UAAkB;IAC9C,MAAM,GAAG,GAAG,EAAE;SACX,OAAO,CAAC,4DAA4D,CAAC;SACrE,GAAG,CAAC,UAAU,CAAmC,CAAC;IACrD,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,+EAA+E;AAC/E,2EAA2E;AAC3E,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IACpD,MAAM,GAAG,GAAG,EAAE;SACX,OAAO,CAAC,6DAA6D,CAAC;SACtE,GAAG,CAAC,UAAU,CAAoC,CAAC;IACtD,OAAO,GAAG,EAAE,OAAO,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED,6EAA6E;AAC7E,mDAAmD;AACnD,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IACjD,EAAE,CAAC,OAAO,CAAC,qDAAqD,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACpF,CAAC"}
@@ -0,0 +1,6 @@
1
+ -- Adopted-branch flag for /branch (work item #117).
2
+ --
3
+ -- A branch that already existed and was adopted keeps its shared history: it is
4
+ -- fast-forward only, never force-pushed or rebased. 0 means DevBot created the
5
+ -- branch (the historical behavior).
6
+ ALTER TABLE work_item_branch ADD COLUMN adopted INTEGER NOT NULL DEFAULT 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wascartech/devbot",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "author": "Adrien Jussak <adrien.jussak@wascar.tech>",
@@ -109,6 +109,7 @@
109
109
  "test:platform-parity": "node --experimental-sqlite --test --import tsx scripts/check-platform-parity.ts",
110
110
  "test:forgejo-access-gate": "node --experimental-sqlite --test --import tsx scripts/check-forgejo-access-gate.ts",
111
111
  "test:ci-adapter": "node --experimental-sqlite --test --import tsx scripts/check-ci-adapter.ts",
112
+ "test:ci-lint-guard": "node --experimental-sqlite --test --import tsx scripts/check-ci-lint-guard.ts",
112
113
  "test:ci-fail-report": "node --experimental-sqlite --test --import tsx scripts/check-ci-fail-report.ts",
113
114
  "test:mcp-ci-tools": "node --experimental-sqlite --test --import tsx scripts/check-mcp-ci-tools.ts",
114
115
  "test:gitlab-webhooks": "node --experimental-sqlite --test --import tsx scripts/check-gitlab-webhooks.ts",
@@ -121,6 +122,7 @@
121
122
  "test:podman-volume": "node --experimental-sqlite --test --import tsx scripts/check-podman-volume.ts",
122
123
  "test:podman-run": "node --experimental-sqlite --test --import tsx scripts/check-podman-run.ts",
123
124
  "test:nested-podman": "node --experimental-sqlite --test --import tsx scripts/check-nested-podman.ts",
125
+ "test:nested-podman-wiring": "node --experimental-sqlite --test --import tsx scripts/check-nested-podman-wiring.ts",
124
126
  "test:shell-sandbox": "node --experimental-sqlite --test --import tsx scripts/check-shell-sandbox.ts",
125
127
  "test:plan-agent": "node --experimental-sqlite --test --import tsx scripts/check-plan-agent.ts",
126
128
  "test:stats": "node --experimental-sqlite --test --import tsx scripts/check-stats.ts",