Skip to content

fix(pm-stack backup): pmp_links backup source resolution and offsite assertions (#5315 follow-up) #7096

Closed

Description

@developing-today

fix(pm-stack backup): pmp_links backup source resolution and offsite assertions — follow-up to merged PR #5315 (for #1744)

Bounded follow-up to unresolved review findings on merged PR #5315, filed by triage task 11960 (issue #1744) so the fix has a fresh dedupe key.

Problem

The merged PR #5315 pmp_links archive path still has unresolved source-selection and verification gaps:

  • DATABASE_URL handling may select the wrong entry or local database (last-assignment parsing, CR/edge-whitespace and quote handling).
  • Remote/unsupported non-file URLs can silently fall through to a local default instead of failing explicitly; file: URL paths are not decoded before existence checks.
  • Relative/default DB resolution can miss the active projector file under PM_PROJECTOR_DIR before falling back to the state directory.
  • The upload test can pass when only one offsite destination (R2 or Drive) was called — it must require both.

This weakens the backup evidence needed for issue #1744 criterion 3 (one backup target covers the stack's data).

Evidence

Acceptance criteria

  • Resolve DATABASE_URL using the last matching environment-file assignment; trim CR/edge whitespace plus one matching quote pair without altering interior path characters.
  • Decode file: URL paths before existence checks; do not silently fall back to a local database for an unsupported non-file DATABASE_URL (fail explicitly unless remote export is implemented).
  • Resolve the active relative/default projector database under PM_PROJECTOR_DIR before using the existing state-directory fallback.
  • The with-database archive test passes only when the stub log records copyto calls to both R2 and Drive.
  • Targeted tests pass: nixos/home/pm-dashboard-backup-pmp-links.test.sh and nixos/home/pm-dashboard-backup-manifest.test.sh.
  • Out of scope: re-implementing the merged pmp_links export, migrating service data, changing issue pm stack: centralize all service data as shared tables in one database schema #1744's architecture or criteria.

Refs: issue #1744, PR #5315, PR #6183, task 11960.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    priority/normalOrdinary priority (the default)
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 8, 2026
  2. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 8, 2026
  3. dezren39 commented on Nov 8, 2026

    @dezren39
    Member

    agent-note:v1 picked up — queue task 12738 (lane 7b47536b, worker repo-worker-code).
    Revalidated fresh: #7096 OPEN, #1744 OPEN (criterion 3 still unchecked), #5315 MERGED at c002ae6. No competing branch or PR exists for this follow-up. Starting from origin/main b5ddb39; worktree on the laptop, branch queue/12738-7096-pmp-links-backup-source. Scope: DATABASE_URL last-assignment/quoted parsing, file: URL decoding + explicit failure for unsupported non-file URLs, PM_PROJECTOR_DIR-relative active DB resolution, and requiring both R2 and Drive copyto calls in the pmp-links test.

  4. dezren39 commented on Nov 8, 2026

    @dezren39
    Member

    agent-note:v1 pr opened — PR #7363 (queue/12738-7096-pmp-links-backup-source, head 4f1908f) implements all five acceptance items: last env-file assignment + edge-only trimming/quotes, file: URL percent-decode with explicit failure for remote DSNs (scheme only, no credential leak), PM_PROJECTOR_DIR-relative/default resolution before the state-dir fallback, and a with-db test that passes only when both R2 and Drive copyto calls are recorded. Local: pmp-links suite 21/21, manifest/copy/date/prune/record/base suites all rc=0. Awaiting basic CI tier.

  5. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 8, 2026
  6. dezren39 commented on Nov 8, 2026

    @dezren39
    Member

    agent-note:v1 parked (30m) — PR #7363 is open and mergeable (MERGEABLE) with all five acceptance items implemented and the pmp-links suite green locally (21/21) plus manifest/copy/date/prune/record/base. The basic PR-tier checks were still queued with no runner after ~6 minutes (fleet-search-parity-guard, proxy port fallbacks, scripts-test 3.12/3.14), so a fresh lane will re-read CI, merge on green, and close the task. Resume artifacts: branch queue/12738-7096-pmp-links-backup-source, head 4f1908f, worktree ~/git/fleet/12738. The pmp_links fix is NOT yet in main; do not treat #1744 criterion 3 as satisfied until #7363 merges.

  7. added a commit that references this issue on Nov 8, 2026
  8. removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 8, 2026
  9. dezren39 commented on Nov 8, 2026

    @dezren39
    Member

    🤖 Agent note · done

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-stackpm-stack (Pad/Grist) in developing-today/codekind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions