swarm.db reader queries are not repo-scoped, but the db is shared per host #36

Closed
opened 2026-08-23 15:25:31 +00:00 by matou-build-agent · 5 comments

Follow-up from #3 / ADR 0004 point 5, which RULED that swarm.db is one shared db per host (confirming the shipped default ~/swarm/state/swarm.db) and that this repo owns its schema.

That ruling makes an existing latent gap concrete: issue numbers are per-repo, but the reader's issue query is not.

swarm-db.py's q_issue filters attempts/events/spend on issue=? alone. Only runs carries a repo column; the other three tables reach it through run_id. So on a host carrying several repos, swarm-db.sh issue 3 conflates every repo's issue 3.

Evidence from the live host db today (/home/dev/swarm/state/swarm.db):

runs by repo: Matou/ourcloud 665, Matou/idss 362, Matou/matou-app 75, Matou/dev-factory 11
issues appearing under >1 repo: none (yet)

So it is latent, not yet manifest — dev-factory has only 11 runs and no number has collided. It will: three repos all number issues from 1.

What's needed

  • Join attempts/events/spend to runs and filter by repo in q_issue (and check the other canned queries — open-processes, red-by-stage, spend-weekly are host-scoped by design and probably want an OPTIONAL repo filter, not a mandatory one).
  • Decide the default: read the repo from the caller's own swarm-identity.sh (REPO_SLUG) so swarm-db.sh issue N in a checkout means that checkout's issue N, with an explicit --repo/all escape hatch.
  • Schema changes stay additive (ADR 0004 point 5): a mixed-pin host has several writers at different FACTORY_REFs, so never rename or drop a column a shipped pin still writes.
  • Update tests/swarm-db-test.sh in the same commit (two repos' rows, same issue number, each query returning only its own).
Follow-up from #3 / ADR 0004 point 5, which RULED that `swarm.db` is one shared db per host (confirming the shipped default `~/swarm/state/swarm.db`) and that this repo owns its schema. That ruling makes an existing latent gap concrete: **issue numbers are per-repo, but the reader's issue query is not.** `swarm-db.py`'s `q_issue` filters `attempts`/`events`/`spend` on `issue=?` alone. Only `runs` carries a `repo` column; the other three tables reach it through `run_id`. So on a host carrying several repos, `swarm-db.sh issue 3` conflates every repo's issue 3. Evidence from the live host db today (`/home/dev/swarm/state/swarm.db`): ``` runs by repo: Matou/ourcloud 665, Matou/idss 362, Matou/matou-app 75, Matou/dev-factory 11 issues appearing under >1 repo: none (yet) ``` So it is **latent, not yet manifest** — dev-factory has only 11 runs and no number has collided. It will: three repos all number issues from 1. ## What's needed - Join `attempts`/`events`/`spend` to `runs` and filter by repo in `q_issue` (and check the other canned queries — `open-processes`, `red-by-stage`, `spend-weekly` are host-scoped by design and probably want an OPTIONAL repo filter, not a mandatory one). - Decide the default: read the repo from the caller's own `swarm-identity.sh` (`REPO_SLUG`) so `swarm-db.sh issue N` in a checkout means that checkout's issue N, with an explicit `--repo`/`all` escape hatch. - Schema changes stay additive (ADR 0004 point 5): a mixed-pin host has several writers at different `FACTORY_REF`s, so never rename or drop a column a shipped pin still writes. - Update `tests/swarm-db-test.sh` in the same commit (two repos' rows, same issue number, each query returning only its own).
Author
Member

This was generated by AI during triage.

Triage: bug + ready-for-agent

Reproduced. Built a scratch db from this repo's own swarm-db.py with two repos and one shared issue number:

$ python3 swarm-db.py --db /tmp/dbrepro/swarm.db run-start --run R_A --repo Matou/idss        --trigger cron --started 1000
$ python3 swarm-db.py --db /tmp/dbrepro/swarm.db run-start --run R_B --repo Matou/dev-factory --trigger cron --started 2000
$ python3 swarm-db.py --db /tmp/dbrepro/swarm.db attempt --run R_A --issue 3 --status success --started 1001
$ python3 swarm-db.py --db /tmp/dbrepro/swarm.db attempt --run R_B --issue 3 --status failed  --started 2001
$ SWARM_DB=/tmp/dbrepro/swarm.db bash swarm-db.sh issue 3
== attempts ==
run     iter    status  commits close   started ended
R_A     1       success                 1001
R_B     1       failed                  2001

swarm-db.sh issue 3 run from a dev-factory checkout returns idss's issue 3 alongside dev-factory's. Confirmed at swarm-db.py:258 (q_issue) — all three queries filter on issue=? alone, and only runs carries repo (swarm-db.py:40).

Latency confirmed on the live host db (/home/dev/swarm/state/swarm.db, read today):

runs by repo: Matou/ourcloud 665, Matou/idss 362, Matou/matou-app 75, Matou/dev-factory 13
issues appearing under >1 repo: none

Still latent, and the dev-factory figure has already moved 11 → 13 since filing. Four repos all numbering from 1 makes the collision a matter of time, and the symptom is silent — a wrong history, never an error.

Redundancy check: searched for any existing repo scoping on the reader — grep -n "repo" swarm-db.py finds it only in the runs DDL, the run-start upsert, and the --repo argument of run-start. No reader filters by it. Nothing to reuse; not already implemented.

Agent brief

Goal. swarm-db.sh issue N in a checkout means that checkout's issue N.

Change.

  1. q_issue (swarm-db.py:258) — join attempts, events, spend to runs on run_id and filter runs.repo = ?. Default the repo from the caller's identity; add an explicit escape hatch for the cross-repo view.
  2. swarm-db.sh (swarm-db.sh:28) — source swarm-identity.sh for REPO_SLUG and pass it through. Accept --repo <slug> and --repo all to override; all restores today's host-wide behaviour.
  3. The other canned queries (open-processes, red-by-stage, spend-weekly) are host-scoped by design — give them an optional --repo filter, never a mandatory one. Do not change their defaults.

Constraints.

  • Schema changes stay additive (ADR 0004 pt 5 / #3): a mixed-pin host has several writers at different FACTORY_REFs. Never rename or drop a column a shipped pin still writes. This fix should need no schema change at all — the join already reaches repo through run_id.
  • Rows whose run_id has no runs row (a writer that recorded an attempt before run-start, as the repro above did) must not silently vanish under an inner join. Decide and test the orphan behaviour explicitly — a LEFT JOIN with repo IS NULL OR repo = ?, or a documented drop. Silently losing history is worse than the conflation being fixed.
  • swarm-db.py is a root harness file vendored into every consumer (onboarding/vendor-manifest:55). Per GOTCHAS 4 the running self-copy only picks this up at a pin bump — do not edit .sandcastle/swarm-db.py.

Acceptance — tests/swarm-db-test.sh updated in the same commit (CLAUDE.md: every lib change updates its test in the same commit):

  • Two repos' runs, both with an attempt/event/spend row on the same issue number; issue N under each repo returns only that repo's rows, across all three sections.
  • --repo all returns both.
  • The host-scoped queries still return host-wide totals with no --repo given.
  • Orphan-run_id rows behave as decided.

Full offline suite before close:
for t in tests/*.sh onboarding/tests/*.sh; do case "$t" in *fakebin*|*fixtures*) continue;; esac; bash "$t" || echo "FAIL: $t"; done

Not blocked on #3. ADR 0004 pt 5 only confirmed the shipped default (~/swarm/state/swarm.db, swarm-db.sh:17) — which is already what ships. Nothing here waits on the host-state move.

> *This was generated by AI during triage.* ## Triage: `bug` + `ready-for-agent` **Reproduced.** Built a scratch db from this repo's own `swarm-db.py` with two repos and one shared issue number: ``` $ python3 swarm-db.py --db /tmp/dbrepro/swarm.db run-start --run R_A --repo Matou/idss --trigger cron --started 1000 $ python3 swarm-db.py --db /tmp/dbrepro/swarm.db run-start --run R_B --repo Matou/dev-factory --trigger cron --started 2000 $ python3 swarm-db.py --db /tmp/dbrepro/swarm.db attempt --run R_A --issue 3 --status success --started 1001 $ python3 swarm-db.py --db /tmp/dbrepro/swarm.db attempt --run R_B --issue 3 --status failed --started 2001 $ SWARM_DB=/tmp/dbrepro/swarm.db bash swarm-db.sh issue 3 == attempts == run iter status commits close started ended R_A 1 success 1001 R_B 1 failed 2001 ``` `swarm-db.sh issue 3` run from a dev-factory checkout returns **idss's** issue 3 alongside dev-factory's. Confirmed at `swarm-db.py:258` (`q_issue`) — all three queries filter on `issue=?` alone, and only `runs` carries `repo` (`swarm-db.py:40`). **Latency confirmed on the live host db** (`/home/dev/swarm/state/swarm.db`, read today): ``` runs by repo: Matou/ourcloud 665, Matou/idss 362, Matou/matou-app 75, Matou/dev-factory 13 issues appearing under >1 repo: none ``` Still latent, and the dev-factory figure has already moved 11 → 13 since filing. Four repos all numbering from 1 makes the collision a matter of time, and the symptom is silent — a wrong history, never an error. **Redundancy check:** searched for any existing repo scoping on the reader — `grep -n "repo" swarm-db.py` finds it only in the `runs` DDL, the `run-start` upsert, and the `--repo` argument of `run-start`. No reader filters by it. Nothing to reuse; not already implemented. ## Agent brief **Goal.** `swarm-db.sh issue N` in a checkout means *that checkout's* issue N. **Change.** 1. `q_issue` (`swarm-db.py:258`) — join `attempts`, `events`, `spend` to `runs` on `run_id` and filter `runs.repo = ?`. Default the repo from the caller's identity; add an explicit escape hatch for the cross-repo view. 2. `swarm-db.sh` (`swarm-db.sh:28`) — source `swarm-identity.sh` for `REPO_SLUG` and pass it through. Accept `--repo <slug>` and `--repo all` to override; `all` restores today's host-wide behaviour. 3. The other canned queries (`open-processes`, `red-by-stage`, `spend-weekly`) are **host-scoped by design** — give them an *optional* `--repo` filter, never a mandatory one. Do not change their defaults. **Constraints.** - Schema changes stay **additive** (ADR 0004 pt 5 / #3): a mixed-pin host has several writers at different `FACTORY_REF`s. Never rename or drop a column a shipped pin still writes. This fix should need **no** schema change at all — the join already reaches `repo` through `run_id`. - Rows whose `run_id` has no `runs` row (a writer that recorded an attempt before `run-start`, as the repro above did) must not silently vanish under an inner join. Decide and **test** the orphan behaviour explicitly — a LEFT JOIN with `repo IS NULL OR repo = ?`, or a documented drop. Silently losing history is worse than the conflation being fixed. - `swarm-db.py` is a root harness file vendored into every consumer (`onboarding/vendor-manifest:55`). Per GOTCHAS 4 the running self-copy only picks this up at a pin bump — do not edit `.sandcastle/swarm-db.py`. **Acceptance — `tests/swarm-db-test.sh` updated in the same commit** (CLAUDE.md: every lib change updates its test in the same commit): - Two repos' runs, both with an attempt/event/spend row on the **same issue number**; `issue N` under each repo returns only that repo's rows, across all three sections. - `--repo all` returns both. - The host-scoped queries still return host-wide totals with no `--repo` given. - Orphan-`run_id` rows behave as decided. Full offline suite before close: `for t in tests/*.sh onboarding/tests/*.sh; do case "$t" in *fakebin*|*fixtures*) continue;; esac; bash "$t" || echo "FAIL: $t"; done` **Not blocked on #3.** ADR 0004 pt 5 only *confirmed* the shipped default (`~/swarm/state/swarm.db`, `swarm-db.sh:17`) — which is already what ships. Nothing here waits on the host-state move.
Author
Member

swarm-claim host=matou-dev-server-01 run=237
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=237 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: repo-scope q_issue's three joins (attempts/events/spend →
runs.repo) unconditionally — issue numbers collide across repos sharing
one host db, so an unscoped q_issue is a correctness bug, not a style
choice. Keep open-processes, spend-weekly, and red-by-stage host-wide
by default (they're host-scoped by design per the ticket) but add an
optional repo filter to each rather than making repo-scoping mandatory
there.

Why two-way door: a pure query-layer change, revertible by editing the
SQL/args in a follow-up commit; runs.repo and attempts.run_id/
events.run_id/spend.run_id already exist today, no schema migration
needed to prove or revert it.

What proves it: tests/swarm-db-test.sh gets two repos' rows sharing an
issue number, and swarm-db.sh issue N returns only the caller's own rows —
the acceptance criterion the ticket itself names. Verified the bug live
before ruling: q_issue (swarm-db.py) filters attempts/events/spend
on issue=? alone with no join to runs.repo; runs is the only table
carrying repo.

Agent Brief

Category: bug
Summary: swarm-db issue N conflates every repo's issue N on a host that shares one db across several repos

Current behavior:
The issue-history query joins attempts, events, and spend to an issue
number alone. Only the runs table carries a repo column; the other
three tables reach it only through run_id. On a host recording runs for
several repos in one shared db, swarm-db issue 3 returns rows from every
repo's issue 3, not just the caller's. Latent today (no host has two repos
colliding on the same issue number yet) but guaranteed to manifest — every
repo numbers issues from 1.

Desired behavior:
The issue-history query returns only the calling repo's rows by default.
The repo is resolved from the caller's own identity config unless the
caller explicitly asks for a different repo or for all repos. The three
host-scoped summary queries (open processes, weekly spend, red-by-stage)
stay host-wide by default — they're host-scoped by design — but gain an
optional repo filter rather than a mandatory one.

Key interfaces:

  • The issue-history query's repo resolution: default to the caller's own
    repo identity (the same REPO_SLUG convention swarm-identity.sh
    already establishes for this repo), with an explicit escape hatch to
    name a different repo or request all repos unfiltered.
  • The three host-scoped summary queries each gain an optional repo-filter
    argument; omitting it preserves today's host-wide behavior exactly.
  • Any schema change must be additive only — a host running a mix of pinned
    versions has writers at different refs still writing today's shape;
    never rename or drop a column an older writer still uses.

Acceptance criteria:

  • Two repos recording the same issue number in one shared db: querying
    one repo's issue history returns only that repo's attempts/events/
    spend rows
  • Omitting the repo filter on the issue-history query resolves to the
    caller's own repo (via its identity config), not "all repos"
  • An explicit "all repos" / other-repo escape hatch still works for
    cross-repo inspection
  • The three host-scoped summary queries are byte-for-byte unchanged in
    output when their new repo filter is omitted
  • A test exercises two repos' rows sharing the same issue number and
    confirms each query returns only its own

Out of scope:

  • Changing where swarm.db lives or how many repos share one host db
    (that's #3/#6, not this ticket)
  • Any change to the writer side (run-start/attempt/etc.) — this is a
    reader-only fix
> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** Ruling: repo-scope `q_issue`'s three joins (`attempts`/`events`/`spend` → `runs.repo`) unconditionally — issue numbers collide across repos sharing one host db, so an unscoped `q_issue` is a correctness bug, not a style choice. Keep `open-processes`, `spend-weekly`, and `red-by-stage` host-wide by default (they're host-scoped by design per the ticket) but add an *optional* repo filter to each rather than making repo-scoping mandatory there. Why two-way door: a pure query-layer change, revertible by editing the SQL/args in a follow-up commit; `runs.repo` and `attempts.run_id`/ `events.run_id`/`spend.run_id` already exist today, no schema migration needed to prove or revert it. What proves it: `tests/swarm-db-test.sh` gets two repos' rows sharing an issue number, and `swarm-db.sh issue N` returns only the caller's own rows — the acceptance criterion the ticket itself names. Verified the bug live before ruling: `q_issue` (`swarm-db.py`) filters `attempts`/`events`/`spend` on `issue=?` alone with no join to `runs.repo`; `runs` is the only table carrying `repo`. ## Agent Brief **Category:** bug **Summary:** `swarm-db issue N` conflates every repo's issue N on a host that shares one db across several repos **Current behavior:** The issue-history query joins `attempts`, `events`, and `spend` to an issue number alone. Only the `runs` table carries a `repo` column; the other three tables reach it only through `run_id`. On a host recording runs for several repos in one shared db, `swarm-db issue 3` returns rows from every repo's issue 3, not just the caller's. Latent today (no host has two repos colliding on the same issue number yet) but guaranteed to manifest — every repo numbers issues from 1. **Desired behavior:** The issue-history query returns only the calling repo's rows by default. The repo is resolved from the caller's own identity config unless the caller explicitly asks for a different repo or for all repos. The three host-scoped summary queries (open processes, weekly spend, red-by-stage) stay host-wide by default — they're host-scoped by design — but gain an optional repo filter rather than a mandatory one. **Key interfaces:** - The issue-history query's repo resolution: default to the caller's own repo identity (the same `REPO_SLUG` convention `swarm-identity.sh` already establishes for this repo), with an explicit escape hatch to name a different repo or request all repos unfiltered. - The three host-scoped summary queries each gain an optional repo-filter argument; omitting it preserves today's host-wide behavior exactly. - Any schema change must be additive only — a host running a mix of pinned versions has writers at different refs still writing today's shape; never rename or drop a column an older writer still uses. **Acceptance criteria:** - [ ] Two repos recording the same issue number in one shared db: querying one repo's issue history returns only that repo's attempts/events/ spend rows - [ ] Omitting the repo filter on the issue-history query resolves to the caller's own repo (via its identity config), not "all repos" - [ ] An explicit "all repos" / other-repo escape hatch still works for cross-repo inspection - [ ] The three host-scoped summary queries are byte-for-byte unchanged in output when their new repo filter is omitted - [ ] A test exercises two repos' rows sharing the same issue number and confirms each query returns only its own **Out of scope:** - Changing where `swarm.db` lives or how many repos share one host db (that's #3/#6, not this ticket) - Any change to the writer side (`run-start`/`attempt`/etc.) — this is a reader-only fix
Author
Member

This was generated by AI during triage.

Agent Brief

Category: bug
Summary: swarm-db.py's q_issue (and the other per-issue lookups it drives) conflate issue numbers across repos sharing one host db.

Current behavior: swarm.db is one shared SQLite db per host (confirmed default, ADR 0004 point 5 — runs.repo already exists and is populated). attempts, events, and spend reach the repo only indirectly through run_id; q_issue filters them on issue=? alone, with no join back to runs.repo. Issue numbers are assigned per repo, not globally, so on a host carrying more than one repo swarm-db.sh issue N returns every repo's issue N merged together.

Desired behavior: Querying a single issue's history returns only that issue's rows for one target repo — by default the repo the caller is running from (REPO_SLUG, already read from that repo's swarm-identity.sh), with an explicit escape hatch to name a different repo or all repos. The other canned queries that are inherently host-scoped by design (open-processes, red-by-stage, spend-weekly) should gain an OPTIONAL repo filter, not a mandatory one — they keep answering host-wide questions when no repo is given.

Key interfaces:

  • q_issue(conn, args) — join attempts/events/spend to runs via run_id and filter on runs.repo in addition to issue.
  • The query subcommand's argument handling — thread a --repo <owner/repo> / --repo all option through, defaulting to the value read from the caller's swarm-identity.sh REPO_SLUG when omitted.
  • q_open_processes, q_spend_weekly, q_red_by_stage — add an optional repo filter without changing their default (host-wide) behavior when unset.

Acceptance criteria:

  • With two repos' rows in the db sharing the same issue number, swarm-db.sh issue N (run from a checkout whose swarm-identity.sh sets REPO_SLUG) returns only that repo's attempts/events/spend for issue N.
  • An explicit --repo <owner/repo> overrides the default; --repo all restores today's cross-repo behavior.
  • open-processes, spend-weekly, red-by-stage still return host-wide results by default; an optional repo filter narrows them.
  • Any schema change is additive only (CREATE TABLE IF NOT EXISTS / ALTER TABLE ... ADD COLUMN) — a mixed-pin host has writers at several FACTORY_REFs (ADR 0004 point 5).
  • tests/swarm-db-test.sh gains coverage: two repos' rows carrying the same issue number, each query returning only its own repo's rows by default.

Out of scope:

  • Splitting swarm.db into one db per repo (ADR 0004 point 5 rules this out deliberately).
  • Changing how runs.repo is populated.

Verification: Confirmed by reading swarm-db.py directly — q_issue's attempts/events/spend queries filter on issue=? alone with no join to runs; DEFAULT_DB is the single shared ~/swarm/state/swarm.db; REPO_SLUG already exists in swarm-identity.sh, so the proposed default is available today. Latent, not yet manifest, exactly as filed — no colliding issue numbers in the live db yet.

> *This was generated by AI during triage.* ## Agent Brief **Category:** bug **Summary:** `swarm-db.py`'s `q_issue` (and the other per-issue lookups it drives) conflate issue numbers across repos sharing one host db. **Current behavior:** `swarm.db` is one shared SQLite db per host (confirmed default, ADR 0004 point 5 — `runs.repo` already exists and is populated). `attempts`, `events`, and `spend` reach the repo only indirectly through `run_id`; `q_issue` filters them on `issue=?` alone, with no join back to `runs.repo`. Issue numbers are assigned per repo, not globally, so on a host carrying more than one repo `swarm-db.sh issue N` returns every repo's issue N merged together. **Desired behavior:** Querying a single issue's history returns only that issue's rows for one target repo — by default the repo the caller is running from (`REPO_SLUG`, already read from that repo's `swarm-identity.sh`), with an explicit escape hatch to name a different repo or all repos. The other canned queries that are inherently host-scoped by design (`open-processes`, `red-by-stage`, `spend-weekly`) should gain an OPTIONAL repo filter, not a mandatory one — they keep answering host-wide questions when no repo is given. **Key interfaces:** - `q_issue(conn, args)` — join `attempts`/`events`/`spend` to `runs` via `run_id` and filter on `runs.repo` in addition to `issue`. - The query subcommand's argument handling — thread a `--repo <owner/repo>` / `--repo all` option through, defaulting to the value read from the caller's `swarm-identity.sh` `REPO_SLUG` when omitted. - `q_open_processes`, `q_spend_weekly`, `q_red_by_stage` — add an optional repo filter without changing their default (host-wide) behavior when unset. **Acceptance criteria:** - [ ] With two repos' rows in the db sharing the same issue number, `swarm-db.sh issue N` (run from a checkout whose `swarm-identity.sh` sets `REPO_SLUG`) returns only that repo's attempts/events/spend for issue N. - [ ] An explicit `--repo <owner/repo>` overrides the default; `--repo all` restores today's cross-repo behavior. - [ ] `open-processes`, `spend-weekly`, `red-by-stage` still return host-wide results by default; an optional repo filter narrows them. - [ ] Any schema change is additive only (`CREATE TABLE IF NOT EXISTS` / `ALTER TABLE ... ADD COLUMN`) — a mixed-pin host has writers at several `FACTORY_REF`s (ADR 0004 point 5). - [ ] `tests/swarm-db-test.sh` gains coverage: two repos' rows carrying the same issue number, each query returning only its own repo's rows by default. **Out of scope:** - Splitting `swarm.db` into one db per repo (ADR 0004 point 5 rules this out deliberately). - Changing how `runs.repo` is populated. **Verification:** Confirmed by reading `swarm-db.py` directly — `q_issue`'s `attempts`/`events`/`spend` queries filter on `issue=?` alone with no join to `runs`; `DEFAULT_DB` is the single shared `~/swarm/state/swarm.db`; `REPO_SLUG` already exists in `swarm-identity.sh`, so the proposed default is available today. Latent, not yet manifest, exactly as filed — no colliding issue numbers in the live db yet.
Author
Member

close-report for #36 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 36,
  "status": "success",
  "commits": [
    "66ca49c"
  ],
  "changed_files": [
    "swarm-db.py",
    "swarm-db.sh",
    "tests/swarm-db-test.sh",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "bash tests/swarm-db-test.sh",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\" || echo FAIL; done",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Join attempts/events/spend to runs and filter by repo in q_issue": "swarm-db.py q_issue LEFT JOINs each of attempts/events/spend to runs and filters on r.repo when a repo is given",
    "Check other canned queries; OPTIONAL (not mandatory) repo filter on open-processes/red-by-stage/spend-weekly": "swarm-db.py q_open_processes/q_red_by_stage/q_spend_weekly gain an optional r.repo filter, host-wide by default (repo=None); swarm-db.sh passes --repo only when supplied",
    "Default: read repo from caller's swarm-identity.sh REPO_SLUG with explicit --repo/all escape hatch": "swarm-db.sh 'issue' resolves REPO_SLUG (env, else sibling swarm-identity.sh), refuses when unresolvable, and accepts --repo <slug> / --repo all",
    "Schema changes stay additive": "no schema change made — runs.repo already existed; only reader SQL joins added",
    "Update tests/swarm-db-test.sh (two repos' rows, same issue number, each query returning only its own)": "tests/swarm-db-test.sh adds two repos (Matou/idss, Matou/dev-factory) sharing issue 555, asserting each repo-scoped read returns only its own rows, plus --repo override, --repo all, refuse-when-unresolvable, sibling fallback, and host-scoped optional filter"
  },
  "summary": "swarm.db reader queries are now repo-scoped via runs.repo, defaulting to the caller's repo with --repo/all escape hatches; no schema change.",
  "blockers": []
}
**close-report** for #36 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 36, "status": "success", "commits": [ "66ca49c" ], "changed_files": [ "swarm-db.py", "swarm-db.sh", "tests/swarm-db-test.sh", "STATUS.md" ], "tests": [ { "command": "bash tests/swarm-db-test.sh", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\" || echo FAIL; done", "exit_code": 0 } ], "criteria": { "Join attempts/events/spend to runs and filter by repo in q_issue": "swarm-db.py q_issue LEFT JOINs each of attempts/events/spend to runs and filters on r.repo when a repo is given", "Check other canned queries; OPTIONAL (not mandatory) repo filter on open-processes/red-by-stage/spend-weekly": "swarm-db.py q_open_processes/q_red_by_stage/q_spend_weekly gain an optional r.repo filter, host-wide by default (repo=None); swarm-db.sh passes --repo only when supplied", "Default: read repo from caller's swarm-identity.sh REPO_SLUG with explicit --repo/all escape hatch": "swarm-db.sh 'issue' resolves REPO_SLUG (env, else sibling swarm-identity.sh), refuses when unresolvable, and accepts --repo <slug> / --repo all", "Schema changes stay additive": "no schema change made — runs.repo already existed; only reader SQL joins added", "Update tests/swarm-db-test.sh (two repos' rows, same issue number, each query returning only its own)": "tests/swarm-db-test.sh adds two repos (Matou/idss, Matou/dev-factory) sharing issue 555, asserting each repo-scoped read returns only its own rows, plus --repo override, --repo all, refuse-when-unresolvable, sibling fallback, and host-scoped optional filter" }, "summary": "swarm.db reader queries are now repo-scoped via runs.repo, defaulting to the caller's repo with --repo/all escape hatches; no schema change.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory#36
No description provided.