From a96a54ec7f81c33103668a612265b165e2bc91a8 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Tue, 21 Apr 2026 17:28:10 +0200 Subject: [PATCH] add Python stopgap planning tooling under tools/scripts/plan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ports settled-reach's decisions_sync.py + ticket + decision scripts, Scrum-stripped. Writes to .pql/pql.db (gitignored). Verb shape mirrors the eventual `pql` subcommands so migration is a call-site find-replace once pql ships feature parity (D-040, R-011). Ticket IDs are T-NNN (TEXT PKs) — reshape from settled-reach's integer auto-increment so the stopgap's writes are compatible with pql's future reads without a data migration. No `sprints` table; the pyramid is kanban / waterfall (D-035). Verified end-to-end: sync parses 71 records (39 confirmed, 23 open questions, 9 rejected) with 62 cross-refs and zero broken links; `ticket new`, `ticket status`, `ticket board`, and `decisions show --with-refs` all round-trip correctly. Co-Authored-By: Claude --- .gitignore | 7 +- CHANGELOG.md | 13 ++ tools/scripts/README.md | 49 +++++ tools/scripts/plan | 62 ++++++ tools/scripts/planning/__init__.py | 5 + tools/scripts/planning/cmd_decisions.py | 104 ++++++++++ tools/scripts/planning/cmd_ticket.py | 178 ++++++++++++++++ tools/scripts/planning/db.py | 34 ++++ tools/scripts/planning/format.py | 77 +++++++ tools/scripts/planning/parser.py | 202 ++++++++++++++++++ tools/scripts/planning/repo_decisions.py | 129 ++++++++++++ tools/scripts/planning/repo_tickets.py | 249 +++++++++++++++++++++++ tools/scripts/planning/schema.py | 93 +++++++++ 13 files changed, 1201 insertions(+), 1 deletion(-) create mode 100644 tools/scripts/README.md create mode 100755 tools/scripts/plan create mode 100644 tools/scripts/planning/__init__.py create mode 100644 tools/scripts/planning/cmd_decisions.py create mode 100644 tools/scripts/planning/cmd_ticket.py create mode 100644 tools/scripts/planning/db.py create mode 100644 tools/scripts/planning/format.py create mode 100644 tools/scripts/planning/parser.py create mode 100644 tools/scripts/planning/repo_decisions.py create mode 100644 tools/scripts/planning/repo_tickets.py create mode 100644 tools/scripts/planning/schema.py diff --git a/.gitignore b/.gitignore index a0d70ed6..e68934dd 100644 --- a/.gitignore +++ b/.gitignore @@ -48,9 +48,14 @@ coverage.* /tmp/ # -- pql per-repo state (clide dogfoods against itself; pql's index lands -# here when running queries locally). Mirror what `pql init` writes. +# here when running queries locally). `pql.db` is also where the +# `tools/scripts/plan` stopgap writes decisions + tickets (D-040). /.pql/ +# -- Python stopgap tooling under tools/scripts/plan ------------------ +tools/scripts/__pycache__/ +tools/scripts/planning/__pycache__/ + # -- SQLite index files (defensive; should never land at repo root) ---- *.sqlite *.sqlite-journal diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d3b301d..900eae23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,19 @@ heading, and (b) bumping `project.yaml` `version:` in the same commit. - `DECISIONS.md` one-line pointer at the repo root (matches settled-reach's convention). +- `tools/scripts/plan` — Python stopgap entrypoint for `decisions` + and `ticket` subcommands, writing to `.pql/pql.db` (gitignored). + Supports `decisions sync | validate | claim | list | show | coverage` + and `ticket new | list | show | status | assign | team | block | + unblock | label | search | board`, plus `sqlite-query`. Verb shape + and output format mirror the eventual `pql` subcommands so migration + when pql ships feature parity is a call-site find-replace + (`tools/scripts/plan ` → `pql `). Ported from settled-reach with + the Scrum layer stripped; ticket IDs are `T-NNN` (TEXT PKs) and + there's no `sprints` table. Time-limited per + [`D-040`](decisions/process.md#d-040-python-stopgap-under-toolsscriptsplan) + / [`R-011`](decisions/rejected.md#r-011-permanent-stopgap). + ### Removed - `docs/ADRs/` directory — content lifted into `decisions/` as D/R diff --git a/tools/scripts/README.md b/tools/scripts/README.md new file mode 100644 index 00000000..2d084e85 --- /dev/null +++ b/tools/scripts/README.md @@ -0,0 +1,49 @@ +# STOPGAP — Planning tooling + +This directory is a **time-limited stopgap**. The Python scripts here +port settled-reach's `decisions_sync.py` + `ticket` + `decision` +scripts, Scrum-stripped, and write to `.pql/pql.db` (gitignored). + +## Sunset clause + +Per [`D-040`](../../decisions/process.md#d-040-python-stopgap-under-toolsscriptsplan) +and [`R-011`](../../decisions/rejected.md#r-011-permanent-stopgap), +this stopgap deletes when pql ships: + +- `pql decisions sync | validate | list | show | claim | coverage` +- `pql ticket new | list | show | status | assign | block | board` + +with feature parity on the same `.pql/pql.db` file this stopgap wrote. + +Migration is a call-site find-replace: + +``` +tools/scripts/plan decisions sync → pql decisions sync +tools/scripts/plan ticket new task "…" → pql ticket new task "…" +tools/scripts/plan ticket board → pql ticket board +``` + +See [`Q-021`](../../decisions/questions-architecture.md#q-021-pql-absorbs-planning-vs-keeps-separate) +for the open gate on whether pql absorbs planning long-term. + +## Entrypoint + +`plan` is a Python executable. Support modules live under `planning/`. + +``` +plan decisions sync | validate | claim D|Q|R [title] | list | show | coverage +plan ticket new "title" | list | show | status | assign +plan ticket block --by | unblock --from +plan ticket team | label add|rm