kanbo-cli 0.1.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/LICENSE +21 -0
- package/README.md +79 -0
- package/dist/better-sqlite3-fU3G4xnX.cjs +2254 -0
- package/dist/better-sqlite3-fU3G4xnX.cjs.map +1 -0
- package/dist/cli.cjs +42949 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/dist-Cd6wg8pp.cjs +942 -0
- package/dist/dist-Cd6wg8pp.cjs.map +1 -0
- package/dist/drizzle-postgres/0000_board.sql +135 -0
- package/dist/drizzle-postgres/0001_history_order.sql +2 -0
- package/dist/drizzle-postgres/0002_issue_pull_requests.sql +16 -0
- package/dist/drizzle-postgres/0003_milestone_start_date.sql +1 -0
- package/dist/drizzle-postgres/0004_status_entry_rules.sql +1 -0
- package/dist/drizzle-postgres/0005_run_external_session_ref.sql +1 -0
- package/dist/drizzle-postgres/README.md +61 -0
- package/dist/drizzle-postgres/meta/0000_snapshot.json +1078 -0
- package/dist/drizzle-postgres/meta/0001_snapshot.json +1090 -0
- package/dist/drizzle-postgres/meta/0002_snapshot.json +1239 -0
- package/dist/drizzle-postgres/meta/0003_snapshot.json +1245 -0
- package/dist/drizzle-postgres/meta/0004_snapshot.json +1251 -0
- package/dist/drizzle-postgres/meta/0005_snapshot.json +1257 -0
- package/dist/drizzle-postgres/meta/_journal.json +48 -0
- package/dist/drizzle-sqlite/0000_board.sql +133 -0
- package/dist/drizzle-sqlite/0001_issue_pull_requests.sql +15 -0
- package/dist/drizzle-sqlite/0002_milestone_start_date.sql +1 -0
- package/dist/drizzle-sqlite/0003_status_entry_rules.sql +1 -0
- package/dist/drizzle-sqlite/0004_run_external_session_ref.sql +1 -0
- package/dist/drizzle-sqlite/README.md +67 -0
- package/dist/drizzle-sqlite/meta/0000_snapshot.json +946 -0
- package/dist/drizzle-sqlite/meta/0001_snapshot.json +1054 -0
- package/dist/drizzle-sqlite/meta/0002_snapshot.json +1061 -0
- package/dist/drizzle-sqlite/meta/0003_snapshot.json +1068 -0
- package/dist/drizzle-sqlite/meta/0004_snapshot.json +1075 -0
- package/dist/drizzle-sqlite/meta/_journal.json +41 -0
- package/dist/lib/board-store-B16YarvX.d.mts +281 -0
- package/dist/lib/board-store-BHHo_ZlR.d.cts +281 -0
- package/dist/lib/index.cjs +340 -0
- package/dist/lib/index.cjs.map +1 -0
- package/dist/lib/index.d.cts +1608 -0
- package/dist/lib/index.d.mts +1608 -0
- package/dist/lib/index.mjs +284 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/manifest-C0EcwwgO.mjs +7866 -0
- package/dist/lib/manifest-C0EcwwgO.mjs.map +1 -0
- package/dist/lib/manifest-CpZOcB_6.cjs +8272 -0
- package/dist/lib/manifest-CpZOcB_6.cjs.map +1 -0
- package/dist/lib/mcp/index.cjs +184 -0
- package/dist/lib/mcp/index.cjs.map +1 -0
- package/dist/lib/mcp/index.d.cts +346 -0
- package/dist/lib/mcp/index.d.mts +346 -0
- package/dist/lib/mcp/index.mjs +173 -0
- package/dist/lib/mcp/index.mjs.map +1 -0
- package/dist/lib/migrate-BhYi9cXw.mjs +656 -0
- package/dist/lib/migrate-BhYi9cXw.mjs.map +1 -0
- package/dist/lib/migrate-DnMjTCvu.cjs +709 -0
- package/dist/lib/migrate-DnMjTCvu.cjs.map +1 -0
- package/dist/lib/migrations-path-CZxVOgeD.cjs +109 -0
- package/dist/lib/migrations-path-CZxVOgeD.cjs.map +1 -0
- package/dist/lib/migrations-path-Ciwan537.mjs +80 -0
- package/dist/lib/migrations-path-Ciwan537.mjs.map +1 -0
- package/dist/lib/postgres/index.cjs +56 -0
- package/dist/lib/postgres/index.cjs.map +1 -0
- package/dist/lib/postgres/index.d.cts +3403 -0
- package/dist/lib/postgres/index.d.mts +3403 -0
- package/dist/lib/postgres/index.mjs +35 -0
- package/dist/lib/postgres/index.mjs.map +1 -0
- package/dist/lib/roles.sql-B9rt-x4o.cjs +1033 -0
- package/dist/lib/roles.sql-B9rt-x4o.cjs.map +1 -0
- package/dist/lib/roles.sql-CvyCGt38.mjs +920 -0
- package/dist/lib/roles.sql-CvyCGt38.mjs.map +1 -0
- package/dist/lib/schema-epoch-ZyumVL_A.d.cts +16 -0
- package/dist/lib/schema-epoch-ZyumVL_A.d.mts +16 -0
- package/dist/lib/schema-fsHqNAip.d.cts +3612 -0
- package/dist/lib/schema-fsHqNAip.d.mts +3612 -0
- package/dist/lib/sqlite/index.cjs +23 -0
- package/dist/lib/sqlite/index.d.cts +175 -0
- package/dist/lib/sqlite/index.d.mts +175 -0
- package/dist/lib/sqlite/index.mjs +4 -0
- package/dist/lib/sqlite/schema.cjs +266 -0
- package/dist/lib/sqlite/schema.cjs.map +1 -0
- package/dist/lib/sqlite/schema.d.cts +2 -0
- package/dist/lib/sqlite/schema.d.mts +2 -0
- package/dist/lib/sqlite/schema.mjs +256 -0
- package/dist/lib/sqlite/schema.mjs.map +1 -0
- package/dist/lib/tool-names-9cmCn0gP.d.cts +112 -0
- package/dist/lib/tool-names-Dxg1UTUl.d.mts +112 -0
- package/dist/page/board.css +477 -0
- package/dist/page/board.js +2 -0
- package/drizzle-postgres/0000_board.sql +135 -0
- package/drizzle-postgres/0001_history_order.sql +2 -0
- package/drizzle-postgres/0002_issue_pull_requests.sql +16 -0
- package/drizzle-postgres/0003_milestone_start_date.sql +1 -0
- package/drizzle-postgres/0004_status_entry_rules.sql +1 -0
- package/drizzle-postgres/0005_run_external_session_ref.sql +1 -0
- package/drizzle-postgres/README.md +61 -0
- package/drizzle-postgres/meta/0000_snapshot.json +1078 -0
- package/drizzle-postgres/meta/0001_snapshot.json +1090 -0
- package/drizzle-postgres/meta/0002_snapshot.json +1239 -0
- package/drizzle-postgres/meta/0003_snapshot.json +1245 -0
- package/drizzle-postgres/meta/0004_snapshot.json +1251 -0
- package/drizzle-postgres/meta/0005_snapshot.json +1257 -0
- package/drizzle-postgres/meta/_journal.json +48 -0
- package/drizzle-sqlite/0000_board.sql +133 -0
- package/drizzle-sqlite/0001_issue_pull_requests.sql +15 -0
- package/drizzle-sqlite/0002_milestone_start_date.sql +1 -0
- package/drizzle-sqlite/0003_status_entry_rules.sql +1 -0
- package/drizzle-sqlite/0004_run_external_session_ref.sql +1 -0
- package/drizzle-sqlite/README.md +67 -0
- package/drizzle-sqlite/meta/0000_snapshot.json +946 -0
- package/drizzle-sqlite/meta/0001_snapshot.json +1054 -0
- package/drizzle-sqlite/meta/0002_snapshot.json +1061 -0
- package/drizzle-sqlite/meta/0003_snapshot.json +1068 -0
- package/drizzle-sqlite/meta/0004_snapshot.json +1075 -0
- package/drizzle-sqlite/meta/_journal.json +41 -0
- package/package.json +147 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!-- Once this directory changes, update this README.md -->
|
|
2
|
+
|
|
3
|
+
# Board migrations for an external Postgres
|
|
4
|
+
|
|
5
|
+
The board schema for an external Postgres database. `drizzle-sqlite/` is the
|
|
6
|
+
other half: the same logical board, at the same `BOARD_SCHEMA_EPOCH`, for a
|
|
7
|
+
SQLite file. **A change to the board is a migration in each chain, written
|
|
8
|
+
together**, or a board that moves between the two engines stops being the same
|
|
9
|
+
board.
|
|
10
|
+
|
|
11
|
+
Generated with `npm run generate:postgres` from `src/postgres/schema.ts`, and
|
|
12
|
+
applied by `kanbo migrate` (`migrateBoardDatabase`) and by nothing else.
|
|
13
|
+
|
|
14
|
+
## Files
|
|
15
|
+
|
|
16
|
+
- **0000_board.sql**: the whole board at epoch 1 — eight tables, their indexes
|
|
17
|
+
and the foreign keys that point inside the board. The two `INSERT … ON CONFLICT
|
|
18
|
+
DO NOTHING` statements at the end seed `kanban_meta` with `board` revision `0`
|
|
19
|
+
and `schema_epoch` `1` (the generation `assertBoardSchema` demands). They are
|
|
20
|
+
hand-written, because `drizzle-kit` generates structure, not rows: regenerating
|
|
21
|
+
this file drops them, and they have to be put back.
|
|
22
|
+
- **0001_history_order.sql**: `seq` on `issue_comments` and `issue_field_changes`
|
|
23
|
+
— the `bigserial` this dialect orders same-second rows by, because Postgres
|
|
24
|
+
has no `rowid` and its heap order is not insertion order. It changes nothing
|
|
25
|
+
above the store, so `BOARD_SCHEMA_EPOCH` stays 1 and there is no SQLite half
|
|
26
|
+
to write: a file already orders those two by `rowid`. A database still at
|
|
27
|
+
0000 therefore carries the right stamp and the wrong columns, which is why
|
|
28
|
+
`assertBoardSchema` asks `information_schema.columns` for every column by
|
|
29
|
+
name — that board reads as `board_schema_outdated` until `kanbo migrate`
|
|
30
|
+
has been run again.
|
|
31
|
+
- **0002_issue_pull_requests.sql**: `issue_pull_requests`, the pull requests a
|
|
32
|
+
card names (ruling 4-1), with the same `seq` `bigserial` the history tables
|
|
33
|
+
carry, so a card's links list in the order they were made. The epoch stays 1;
|
|
34
|
+
a database still at 0001 reads as `board_schema_outdated`
|
|
35
|
+
(`missingAddedTables`) until `kanbo migrate` has run, and `kanbo roles apply`
|
|
36
|
+
has to run after it for the agent's grant on the new table and its sequence.
|
|
37
|
+
- **0003_milestone_start_date.sql**: `issue_milestones.start_date` (`bigint`
|
|
38
|
+
unix seconds, nullable), the day a milestone read as a sprint begins (ruling
|
|
39
|
+
5x-3) — a plain `ADD COLUMN`, no new sequence, so no new grant. The epoch
|
|
40
|
+
stays 1; a database still at 0002 reads as `board_schema_outdated`
|
|
41
|
+
(`missingColumns`) until `kanbo migrate` has run.
|
|
42
|
+
- **0004_status_entry_rules.sql**: `issue_statuses.entry_rules` (text, a JSON
|
|
43
|
+
array of `ENTRY_RULES`, nullable), what a card must satisfy before an agent
|
|
44
|
+
may put it in the column (ruling 6-1) — a plain `ADD COLUMN`, no new
|
|
45
|
+
sequence, so no new grant. The epoch stays 1; a database still at 0003 reads
|
|
46
|
+
as `board_schema_outdated` (`missingColumns`) until `kanbo migrate` has run.
|
|
47
|
+
- **0005_run_external_session_ref.sql**: `issue_runs.external_session_ref`
|
|
48
|
+
(text, nullable), where an external agent's own log of a run lives, once it
|
|
49
|
+
has said (ruling 7-1): `claude:<id>` (a Claude Code session id) or
|
|
50
|
+
`codex:<id>` (a Codex session id — the one in the rollout's `session_meta`); `null` while it never has — a plain
|
|
51
|
+
`ADD COLUMN`, no new sequence, so no new grant. The epoch stays 1; a
|
|
52
|
+
database still at 0004 reads as `board_schema_outdated` (`missingColumns`)
|
|
53
|
+
until `kanbo migrate` has run.
|
|
54
|
+
- **meta/**: the drizzle journal and schema snapshots. JSON only, or
|
|
55
|
+
`drizzle-kit generate` fails to parse the directory.
|
|
56
|
+
|
|
57
|
+
Generating a second migration takes a name of its own — the package script
|
|
58
|
+
carries `--name board` for the first one — so it is
|
|
59
|
+
`npx drizzle-kit generate --config drizzle.postgres.config.ts --name <what it does>`.
|
|
60
|
+
`kanbo roles apply` grants `usage` on the sequences these columns draw from,
|
|
61
|
+
so it is run *after* `kanbo migrate` and again whenever a migration adds one.
|