os-backlog: cache resolved Planka board id in .cc-os/config #22

Closed
opened 2026-07-12 20:10:55 +00:00 by jared · 3 comments
Owner

Every card operation re-resolves the configured board name via projects+boards listing (lib/backlog/cards.rb:109) — 1-2 avoidable API calls per command.

Approach (agreed 2026-07-12):

  • Name stays the source of truth (tracker=planka:<board>); id is a cache.
  • On first successful name resolve, write board_id=<id> alongside tracker= in .cc-os/config (key=value contract, 3b9c4fb).
  • Subsequent calls hit boards.get(id) directly.
  • On 404 or name mismatch on the returned board, fall back to name lookup and rewrite the cached id.
  • Minitest coverage with FakePlankaClient for hit, miss/rewrite, and rename cases.

Refs ADR-025 structure; follows #14.

Every card operation re-resolves the configured board name via projects+boards listing (lib/backlog/cards.rb:109) — 1-2 avoidable API calls per command. Approach (agreed 2026-07-12): - Name stays the source of truth (`tracker=planka:<board>`); id is a cache. - On first successful name resolve, write `board_id=<id>` alongside `tracker=` in `.cc-os/config` (key=value contract, 3b9c4fb). - Subsequent calls hit `boards.get(id)` directly. - On 404 or name mismatch on the returned board, fall back to name lookup and rewrite the cached id. - Minitest coverage with FakePlankaClient for hit, miss/rewrite, and rename cases. Refs ADR-025 structure; follows #14.
jared added the
ready-for-agent
label 2026-07-12 22:25:51 +00:00
Author
Owner

This was generated by AI during triage.

Agent Brief

Goal: Cache the resolved Planka board id in .cc-os/config so card operations skip the projects+boards listing round-trip.

Verified current state (2026-07-12): lib/backlog/cards.rb resolves board by name on every call; .cc-os/config carries tracker= and version= keys only — no board_id. Approach in the issue body was agreed 2026-07-12 and is current.

Steps: (1) on first successful name resolve, write board_id= via the existing key=value config contract (3b9c4fb); (2) subsequent calls use boards.get(id); (3) on 404 or name mismatch, fall back to name lookup and rewrite the cache; (4) minitest with FakePlankaClient covering hit, miss/rewrite, rename. Follow ADR-025 structure. Run bin/refresh-plugins after.

Autonomy: afk-ready — fully specified, deterministic, model-free tests.

> *This was generated by AI during triage.* ## Agent Brief **Goal:** Cache the resolved Planka board id in .cc-os/config so card operations skip the projects+boards listing round-trip. **Verified current state (2026-07-12):** lib/backlog/cards.rb resolves board by name on every call; .cc-os/config carries tracker= and version= keys only — no board_id. Approach in the issue body was agreed 2026-07-12 and is current. **Steps:** (1) on first successful name resolve, write board_id=<id> via the existing key=value config contract (3b9c4fb); (2) subsequent calls use boards.get(id); (3) on 404 or name mismatch, fall back to name lookup and rewrite the cache; (4) minitest with FakePlankaClient covering hit, miss/rewrite, rename. Follow ADR-025 structure. Run bin/refresh-plugins after. **Autonomy:** afk-ready — fully specified, deterministic, model-free tests.
Author
Owner

Codex review adjustments (2026-07-13), adopted:

  • Introduce a small BoardResolver (or cache object) with injected config read/write; Cards must not write files directly (Backlog::Config stays pure).
  • Only honor board_id when tracker is planka:.
  • Cached boards.get(id) success must ALSO confirm the returned board name matches the tracker name; mismatch -> name lookup + rewrite cache.
  • Cache writes must preserve comments/format of the shared .cc-os/config (mirror os-status's comment-preserving writer; do NOT use Config.merge naively).
  • FakePlankaClient extended for 404/missing-id and rename cases.
  • Any cache failure degrades to name lookup only — never fails the command.
Codex review adjustments (2026-07-13), adopted: - Introduce a small BoardResolver (or cache object) with injected config read/write; Cards must not write files directly (Backlog::Config stays pure). - Only honor board_id when tracker is planka:<board>. - Cached boards.get(id) success must ALSO confirm the returned board name matches the tracker name; mismatch -> name lookup + rewrite cache. - Cache writes must preserve comments/format of the shared .cc-os/config (mirror os-status's comment-preserving writer; do NOT use Config.merge naively). - FakePlankaClient extended for 404/missing-id and rename cases. - Any cache failure degrades to name lookup only — never fails the command.
Author
Owner

Shipped in commit 46b0584 per the adopted constraints. BoardResolver, planka-only board_id, name-validated id hits, comment-preserving Config.set, degrade-never-fail; 14 new tests, suite 90/0.

Shipped in commit 46b0584 per the adopted constraints. BoardResolver, planka-only board_id, name-validated id hits, comment-preserving Config.set, degrade-never-fail; 14 new tests, suite 90/0.
jared closed this issue 2026-07-13 13:19:11 +00:00
Sign in to join this conversation.
No description provided.