Skip to content

CF-7 (#14866): PM heavy surfaces over indexed projections (M7) #14947

Backlog

Description

@developing-today-fleet

CF-7 — PM heavy surfaces (#14107 M7).

/search, /sessions, /item/, /discuss/, and the /conflicts read side, served hosted over indexed projections in the tenant/fleet-platform stores. Hard rule from #14107 §9: the laptop's unbounded reads (the 33 s search, the 6.7 MB registry read — #14060) are never ported to the edge; the hosted shape is an indexed projection read, and #14060's read-shape work is either a prerequisite or this slice's first step — say which on this issue.

Acceptance: each surface answers hosted within its latency budget over projections whose rebuild procedure is recorded; /conflicts stays read-only (resolution waits on #1282's trust rulings, unchanged by placement).

Blocked by CF-5 (the projections build on the read-wave stores).

Child of #14866 (Cloudflare-first migration programme). Design of record: doc/2026-11-25_design_cloudflare-first-migration.md (PR #14940). Secrets by name only. Deploys follow the versions standard in design §4 unless this issue says otherwise.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-25T08:48:42Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "felix",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Acceptance criteria

  • The named PM heavy surfaces render from indexed projections instead of full scans, with the projection source named in the implementation.
  • Surface response behaviour (ordering, filtering, totals) matches the pre-change behaviour on a recorded comparison.
  • A measurement (query time or rows scanned, before/after) is recorded on this issue or its PR.

Activity

  1. added
    priority/high
    kind/infrastructure
    on Nov 25, 2026
  2. developing-today commented on Nov 25, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 25, 2026

    @dezren39
    Member

    Progress: I chose the #14060 search read-shape work as CF-7's first step, as #14947 explicitly requires that choice. PR #15036 adds in-process timings for the shared searchContext path and exposes them as Server-Timing on /search and /api/search.json. The source-read timings overlap because those reads run concurrently.

    The hosted projection read remains downstream of CF-5d #14970: its M5 endpoints need the pm-service substrate from CF-5c #14969. The current searchContext in pm-stack/aggregator/src/server.ts still reads the laptop source adapter, so this PR records the per-stage costs without claiming the hosted surface is complete.

    Fleet evidence: failing-first boot test developing-today-forks/fleet#45596698700 failed because the header was absent; developing-today-forks/fleet#45597936812 passed the fixture boot suite (19 pass). Typecheck run developing-today-forks/fleet#45597462931 stopped on the existing missing DashAction.clientToken fixture at test/store-remote-backends.test.ts:403.

    After this PR, cd pm-stack/aggregator && bun test test/boot.test.ts shows 19 passing tests and verifies stage timings on both search routes; the next slice can implement one indexed /api/search.json read after the CF-5d projection substrate lands.

  4. dezren39 commented on Nov 25, 2026

    @dezren39
    Member

    Claim (queue task 23739, worker oc-code-07, lane IW-354): shepherding the recorded CF-7 first step — PR #15036 (search stage timings) — to merge with fresh verification at its head against current main, then parking this slice on its remaining gate (CF-5d #14970) with the wake recorded. No competing slice will be started while #14970 is open.

  5. dezren39 commented on Nov 25, 2026

    @dezren39
    Member

    CF-7 first step landed (queue task 23739, lane IW-354 shepherd):

  6. added
    effort/m
    meta/enriched
    on Nov 25, 2026
  7. developing-today-fleet commented on Nov 25, 2026

    @developing-today-fleet
    ContributorAuthor

    Intake review

    🤖 Agent note · filed

    • Agent: fleet monitor
    • Session / ID: repo-fleet-monitor run 2026-11-25 07:14 CST
    • Found via: monitor reconciliation — Duty 2 intake enrichment
    • Task: Intake pass (protocol §5): verified the issue is still live, appended acceptance criteria where missing, normalized labels, added meta/enriched
    • Expectation: A worker or sweep can pick this up from the acceptance criteria without re-deriving scope
    • Links: related merged PRs explicitly referencing this issue: none found

    Notes: Still live — no merged PR explicitly resolves this issue (checked this run). Acceptance criteria were appended to the body (original text preserved verbatim above the new section).

    Risks: Scope is as stated in the body; if the underlying surface has moved since filing, the picker should re-validate against current main before implementing.

    Suggested approach: Work from the acceptance criteria top-down; verify each criterion with the cheapest decisive check (test, run, or read-back) and record the evidence on the closing PR.

  8. dezren39 commented on Nov 26, 2026

    @dezren39
    Member

    agent-note:v1
    state: blocked-on-gate — CF-7 remainder waits on CF-5d #14970 (itself waiting on CF-5c #14969); both confirmed OPEN this run
    task: 14947 CF-7 · lane: xaltha (general lane) · 2026-11-25 hourly loop ~19:24 CST

    Handed #14947 by fleet agent next (shortlist rung). Claim-check: the CF-7 first step already landed — PR #15036 merged (search stage timings), and lane IW-354 (queue task 23739) already shepherded it and parked this slice on its remaining gate with the wake recorded. No competing slice started.

    Gate re-verified this run: #14970 (CF-5d, M5 read waves over tenant-DB projections) OPEN; its prerequisite #14969 (CF-5c, pm-service serving substrate) OPEN. The hosted indexed-projection read for the heavy surfaces cannot start until that substrate lands. Nothing startable on #14947 itself this run; the blocker work belongs to #14969/#14970.

  9. developing-today-fleet commented on Nov 26, 2026

    @developing-today-fleet
    ContributorAuthor

    agent-note:v1 — felix lane (CF-7, #14866), 2026-11-26: supervised run under the owner ruling on #14866 (comment 7189808145 — D1 is the target for ALL fleet state, superseding design §2; PM board data and ledgers target D1 too). This note records (a) the #14060 choice this issue requires, (b) the per-surface projection design under the D1 ruling, and (c) the ROLLBACK NOTE, posted before any deploy or flip from this lane.

    The required choice

    #14060's read-shape work is CF-7's first step — already chosen and landed (PR #15036, merged 36b8dae: search stage timings as Server-Timing on /search and /api/search.json). This lane carries that choice forward: the hosted shape is an indexed projection read in pm-service, never a port of the laptop's unbounded reads. The projection substrate is the pm-service tenant store (CF-5c #14969, merged + Worker deployed); under the owner ruling its database target is D1 (SQLite — the existing DDL in pm-stack/pm-service/src/tenant-store/migrations/ is D1-compatible as written; the CF-5 lane owns the live D1 retarget/provisioning of pm-service).

    Per-surface projection design (D1 target)

    • /search — FTS5 full-text index over the item pool: migration 0002_pm_search_index.sql adds external-content FTS5 table pm_items_fts over pm_items(title, ref) kept in sync by triggers, plus the rebuild procedure recorded in the migration header (INSERT INTO pm_items_fts(pm_items_fts) VALUES('rebuild')). The hosted read is GET /api/search.json?q= in pm-service's async read API: a bounded FTS5 MATCH (bm25-ranked, LIMIT ≤ 200), never a pool scan. Bodies are not in the projection (the collector emits titles/refs, not issue bodies), so hosted search is title/ref search today; body search stays on the tunnel tier until the collector emits bodies — stated plainly, not papered over.
    • /item/ — already an indexed point read shape: pm_items_ref_idx on pm_items(ref). The current async handler loads the whole pool to find one ref (needed today for genealogy); the indexed point read is the follow-up once genealogy's ancestor walk is expressed over pm_links indexes (source/target indexes already exist). Not changed by this lane's PR.
    • /sessions — pm_item_metadata_session_idx covers items-by-session; the sessions surface itself reads the laptop's session store, which has NO hosted projection yet. Stays tunnel-served until a session projection exists (follow-up, not invented here).
    • /discuss/ — discussion/comment bodies are not in the tenant schema at all. Needs a comments projection before any hosted read; stays tunnel-served. (CF-5b's hosted /comments reads the fleet-platform ledger's comment records — a different, smaller set than per-item discussion.)
    • /conflicts (read side) — the projection already exists: pm_reconcile_findings with pm_reconcile_findings_board_idx. Read-only, per the issue body (feat(aggregator): source-conflict inbox — one resolvable queue for Project-vs-derived and Kaneo-vs-GitHub disagreements, with per-class trust rulings #1282's trust rulings unchanged).

    What this lane does on CF-7

    One PR (left unmerged for Felix): migration 0002 (FTS5 index + triggers + rebuild note), searchItemsAsync in a new pm-stack/pm-service/src/read-api/search.ts, the GET /api/search.json route in the async read API, and pm-stack/pm-service/test/read-api-search.test.ts (hand-computed oracle: ranking, bounds, empty/garbage queries, index freshness after a re-landed snapshot). Verified remotely via the fleet-command workflow (never compiled on this seat).

    Rollback (recorded before any deploy/flip)

    • The PR changes no serving path at pm.security.cab: pm-service is not the front door's search source today, and no route flip is made by this lane. Deploy rollback for pm-service = its versions pipeline (promote the previous version id back, per design §4).
    • Schema rollback: migration 0002 is additive (one virtual table + three triggers). Down-path: DROP TRIGGER pm_items_fts_ai/ad/au; DROP TABLE pm_items_fts; and delete the version-2 row from pm_schema_migrations — recorded here because the migration runner is forward-only. No existing table is altered; no data copy is involved (the FTS table is a rebuildable projection of pm_items).
    • Data-copy verification: none required for this PR (no data moves; the index derives from rows already in the store). When the CF-5 lane provisions the D1 tenant DB and copies the pool, counts must be recorded on CF-5c (#14945): pm-service serving substrate — async tenant store + Worker entry #14969/CF-5d (#14945): M5 read waves over tenant-DB projections #14970 before the pm-service cutover — that gate is theirs; this lane's search read must not be flipped to until their counts exist.

    Still blocked (honest)

    Live hosted /search at pm.security.cab waits on: CF-5c's tenant DB provisioning (today the pm-service read routes answer 503 — PM_TENANT_DB_URL/PM_TENANT_DB_TOKEN unprovisioned; under the ruling the CF-5 lane retargets this to D1) and CF-5d #14970 (PR #15154 still open). This lane does not touch CF-5 issues. The before/after measurement for the acceptance criteria: laptop /search's unbounded read is the 33 s / full-registry case from #14060 (stage timings now recorded by PR #15036); the hosted read's rows-scanned is bounded by the FTS index + LIMIT by construction, and the test suite asserts result bounds — the live latency number can only be recorded once the D1 tenant DB is provisioned and populated.

  10. 7 remaining items

  11. developing-today-fleet commented on Nov 27, 2026

    @developing-today-fleet
    ContributorAuthor

    CF-7 recheck — task 23739: #14970 remains OPEN with status/blocked and queue/blocked; its CF-5c prerequisite #14969 is also OPEN, with the serving tenant credentials still unprovisioned. PR #15724 (program grouping route) and PR #15547 (hosted FTS5 /search) are merged. The latest #14947 note remains accurate: the current projections do not supply the session registry, discussion threads, or orchestration/quota/ruling data required for the remaining /sessions, /item, /discuss, and /conflicts surfaces. This pickup made no code, branch, or build changes.

    Parked until CF-5d #14970 closes or records usable projection sources. Then recheck the projection shape and select a surface whose inputs exist, with the required behavior comparison and before/after measurement.

  12. developing-today-fleet commented on Nov 27, 2026

    @developing-today-fleet
    ContributorAuthor

    Lane code-j — CF-7 premise re-check, 2026-11-27 ~13:55Z. Handed #14947 by fleet agent next (shortlist rung).

    Gate re-verified fresh via gh: CF-5d #14970 OPEN (status/blocked, queue/blocked, updated 12:04Z); its prerequisite CF-5c #14969 OPEN (status/in-progress, updated 11:21Z). Landed slices unchanged: #14060 read-shape (#15036 merged) and hosted /search FTS5 projection (#15547 merged). The remainder (/sessions, /item, /discuss, /conflicts over indexed projections) still lacks its substrate — no startable slice, no competing slice started, no code/branch/build changes this pickup. Standing down until #14970 closes or records usable projection sources.

  13. developing-today-fleet commented on Nov 27, 2026

    @developing-today-fleet
    ContributorAuthor

    Lane oc-code-04 — CF-7 premise re-check, 2026-11-27 ~18:47Z. Handed #14947 by fleet agent next (shortlist rung).

    Gate re-verified fresh: CF-5d #14970 OPEN (status/blocked, queue/blocked, updated 12:04Z); CF-5c #14969 OPEN (status/in-progress, updated 15:33Z — new code-g verify note: D1 pm-service schema v1+v2 applied but every data table empty, snapshot sourcing/loading still blocking, versions-standard deploy path red). Landed slices unchanged: #15036 (read-shape timings) and #15547 (hosted /search FTS5; 0002 migration confirmed present on origin/main) merged. No new projection sources for /sessions, /item, /discuss, or /conflicts; D1 tenant store holds zero rows.

    No startable slice, no competing slice started, no code/branch/build changes this pickup. Standing down until #14970 closes or records usable projection sources.

  14. developing-today-fleet commented on Nov 28, 2026

    @developing-today-fleet
    ContributorAuthor

    Lane oc-code-02 — CF-7 premise re-check, 2026-11-28 ~00:10Z. Handed #14947 by fleet agent next (shortlist rung). Verified each remaining surface against code on origin/main (42f0f6c; local checkout was stale, so all reads below are git show origin/main:... / git grep origin/main).

    No code changed; no competing slice started. Wake: #14970 closes or records usable projection sources for sessions/discuss/conflicts/item-genealogy. — oc-code-02

  15. developing-today-fleet commented on Nov 28, 2026

    @developing-today-fleet
    ContributorAuthor

    Lane code-h — CF-7 premise re-check, 2026-11-28 ~04:25Z. Handed #14947 by fleet agent next (shortlist rung).

    Gate re-verified fresh: CF-5d #14970 OPEN (updated 2026-11-27T12:04Z); CF-5c #14969 OPEN (updated 2026-11-27T15:33Z). No open PR references #14970 or CF-7; landed slices unchanged (#15036 read-shape timings, #15547 hosted /search FTS5). Remaining surfaces (/sessions, /item, /discuss, /conflicts) still lack projection sources — no startable slice, no competing slice started, no code/branch/build changes this pickup. Standing down until #14970 closes or records usable projection sources.

  16. developing-today-fleet commented on Nov 28, 2026

    @developing-today-fleet
    ContributorAuthor

    Lane 0422-F — CF-7 premise re-check, 2026-11-28 (delta PRESS queue lane). Handed #14947 by fleet agent next (queue task 23739); read the issue + ALL 17 comments.

  17. dezren39 commented on Nov 28, 2026

    @dezren39
    Member

    Lane 1237-J (alpha DRIVE queue-draw, 2026-11-28 12:37 CST run) — queue task 23739 claimed 2026-11-28T18:54:46Z (re-served on park expiry), parked 24h. Gate re-verified firsthand this claim:

    Wake / ready condition (non-person): #14970 closes or records usable projection sources — then select one surface supported by the actual projections and implement it. No code changed by this lane.

  18. dezren39 commented on Nov 29, 2026

    @dezren39
    Member

    🤖 Census — lane CEN-C15, 2026-11-29 (full-census pass: body + all comments re-read firsthand; this comment is the current-state record for a cold pickup).

    Verdict: blocked. The hard rule (never port the laptop's unbounded reads to the edge) prevents the obvious wrong slice; latency-budget acceptance is stated per surface; /conflicts stays read-only pending #1282. Landed slices: PRs #15036, #15547.

    Blocker: projection sources from #14970, which is blocked on #14969's live tenant plane. Wake: #14970 closes or records usable projection sources.

    Labels/priorities were verified correct in the census — no label changes were needed. (priority high confirmed.)

  19. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    agent-note:v1 — felix lane 0640-Z re-verification (2026-11-29), resolving the standing "re-verify PR #15547" question: PR #15547 is MERGED (2026-11-26T22:04:25Z) — "pm-service: hosted search over an FTS5 projection of the pool". So the /search surface of this issue is delivered as an indexed-projection read, as designed. The issue correctly stays OPEN: /sessions, /item/, /discuss/ and the /conflicts read side have not landed, and the issue text gates the set on CF-5 (the projections build on the read-wave stores; #14969/#14970 tenant provisioning still open). No action taken; state confirmed for the CF programme record.

  20. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Census 2026-11-29 (Felix): rechecked in full (body, labels, comments, edges).

    STRENGTHS: The hard rule is stated as a rule (the laptop's unbounded reads — the 33s search, the 6.7MB registry read — are never ported to the edge; hosted means indexed-projection reads), /conflicts is pinned read-only pending #1282's trust rulings, and the blocked_by edge to CF-5 (#14945) EXISTS and is correct. kind/infrastructure + priority/high already set.

    GAPS: Slices are landing inside the gate where they can (PR #15036 search stage timings; the aggregator search-timing fix on #16785 / PR #16790 belongs to this family). The hosted /search surface itself waits on CF-5's tenant provisioning (#14969/#14970), so the acceptance's per-surface latency evidence cannot be produced yet. (An earlier record on my side wondered whether PR #15547 had merged; the issue's own comment record is the authority and shows the slice work proceeding in order — no discrepancy to resolve here.)

    FIXES I APPLIED: None — labels, priority, and the blocker edge verified correct.

    REMAINS: Nothing for Drewry.

  21. added
    status/blocked
    app/pm-stack
    on Nov 29, 2026
  22. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Issue census — 2026-11-29

    Gaps found

    • No status/* lifecycle label and no app//area/ label at census time — added status/blocked (the body states the CF-5 dependency; the 2026-11-28 lane note records a verified park on that gate) and app/pm-stack.

    Strengths

    Blocker recorded

    Actions taken by this census

    • Labels added: status/blocked, app/pm-stack.
  23. added
    queue/blocked
    on Nov 30, 2026
  24. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    ContributorAuthor

    🤖 Agent note · lane 0640-IF (Felix) — #14863 audit slice N29: pairing completed.

    This issue is verified-blocked: body states "Blocked by CF-5", the native blocked_by edge to #14945 (CF-5, OPEN) is live, and it carried status/blocked — but the queue half of the standard pairing was missing. Added queue/blocked (verified in the label response). No other change; priority/high concurred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/pm-stackeffort/mkind/infrastructuremeta/enrichedpriority/highqueue/blockedstatus/blocked

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions