Skip to content

fix(aggregator): roadmap annotations store defaults into the checkout on the install.sh deployment (PR #4054 x PR #4050) #8763

Closed

Description

@dezren39

Finding

The roadmap-annotations store still lands inside the git checkout on the
install.sh deployment path. PR #4054 added roadmapAnnotationsFile with a
working-directory default and fixed the state location only for the NixOS
deployment; PR #4050's install.sh — which deploys the aggregator from the
primary checkout with all runtime state under
~/.local/state/pm-aggregator — never picked the variable up, and it is
still missing on current main. The first roadmap annotation posted against
an install.sh deployment therefore creates
pm-stack/aggregator/roadmap-annotations.json inside the checkout — the
exact failure PR #4054's Nix fix says blocks pm-git-sync.

Evidence

  • PR feat(aggregator): roadmap annotations (#1284) #4054 (merged, merge commit b56c85475422adc7e77f52a940f2db7c40c2af08):
    adds roadmapAnnotationsFile in pm-stack/aggregator/src/config.ts with
    default join(process.cwd(), "roadmap-annotations.json"), and sets
    PM_AGG_ROADMAP_ANNOTATIONS_FILE=${aggState}/roadmap-annotations.json
    only in nixos/services/pm-stack/default.nix, with the comment: "the
    first annotation would otherwise create roadmap-annotations.json inside
    this checkout and block pm-git-sync the same way (Codex P1 on PR feat(aggregator): roadmap annotations (#1284) #4054)".
    RoadmapAnnotationsStore.persist() (new
    pm-stack/aggregator/src/roadmap-annotations.ts) does
    mkdir(dirname(file)) + writeFile on the first add(), so the file
    really is created at the configured/default path.
  • PR fix(aggregator): deploy from checkout with stable state dir #4050 (merged, merge commit 3deda7785543e5d640f5c568f21589a1f5e23da1):
    rewrote pm-stack/aggregator/install.sh to deploy from
    ~/git/code/pm-stack/aggregator with runtime data under
    ~/.local/state/pm-aggregator; the .env it renders sets
    PM_AGG_FEED_FILE, PM_AGG_COMMENTS_FILE, PM_AGG_ACTIONS_FILE,
    PM_AGG_REGISTRY_FILE, PM_AGG_SNAPSHOTS_DIR,
    PM_AGG_QUOTA_CURRENT_FILE, and PM_AGG_COVERAGE_SNAPSHOT_FILE — no
    roadmap-annotations entry.
  • Verified on current main 703f0d6b6211d5ac4ae73a0b3a836d967243afbd
    (2026-11-11, contents API + code search, two independent reads):
    • pm-stack/aggregator/src/config.ts:159 —
      roadmapAnnotationsFile: s(env.PM_AGG_ROADMAP_ANNOTATIONS_FILE, join(process.cwd(), "roadmap-annotations.json"))
    • pm-stack/aggregator/install.sh (env block, lines 105–116) still has
      no PM_AGG_ROADMAP_ANNOTATIONS_FILE (later additions covered
      PM_AGG_EVENTS_FILE / PM_AGG_ACTIVITY_FILE; roadmap was missed).
    • Code search for PM_AGG_ROADMAP_ANNOTATIONS_FILE returns only
      config.ts, nixos/services/pm-stack/default.nix:234, and
      test/slice3.test.ts — nothing on the install.sh path.
    • pm-stack/systemd/pm-aggregator.service (the unit install.sh
      installs): WorkingDirectory=%h/git/code/pm-stack/aggregator,
      EnvironmentFile=%h/.local/state/pm-aggregator/.env, and its only
      inline state-path override is PM_AGG_DIGESTS_DIR. So under this
      deployment process.cwd() is the checkout and no source sets the
      roadmap path.
    • pm-stack/aggregator/test/install-rehearsal.sh asserts each rendered
      PM_AGG_* state path in .env (lines 101–107 on main) but has no
      roadmap assertion, so the gap is untested.
  • Related observation for triage: viewsFile (config.ts:161) has the
    same cwd default and is likewise absent from the install.sh list;
    freshnessFile was already moved to a state-dir default (pm-git-sync blocked: runtime state files land in the primary clone (.opencode/service-local.json, pm-stack/aggregator/activity-ingestion.json) #5389).
    Triage may scope views in or split it — the filed defect is roadmap
    annotations.
  • Dedupe (2026-11-11): searches for "roadmap-annotations install",
    PM_AGG_ROADMAP_ANNOTATIONS_FILE, and "roadmap annotations checkout"
    return no open issue; only the closed feature issue feat(aggregator): roadmap annotations — dated decision/outcome notes on roadmap items and epics, rendered on the timeline #1284 matches.

Why it matters

Two supported deployments of the same service diverge: NixOS keeps
annotations in the state dir, install.sh writes them into the primary
checkout as an untracked runtime file. That dirties the checkout the
service itself runs from and recreates the pm-git-sync blockage PR #4054
already identified and fixed for the other path — it just has not fired
yet because it waits for the first annotation on an install.sh deployment.

Acceptance criteria

  • On an install.sh deployment, the roadmap annotations store resolves
    under ~/.local/state/pm-aggregator (via the rendered .env, the
    shipped unit, or a state-dir config default in the pm-git-sync blocked: runtime state files land in the primary clone (.opencode/service-local.json, pm-stack/aggregator/activity-ingestion.json) #5389 pattern —
    triage picks one and keeps both deployments consistent).
  • pm-stack/aggregator/test/install-rehearsal.sh asserts the roadmap
    annotations path the same way it asserts the other PM_AGG_*
    state paths.
  • Posting an annotation (POST /api/roadmap/annotations) against an
    install.sh-style deployment leaves the checkout clean: no
    roadmap-annotations.json created under pm-stack/aggregator/.
  • The NixOS deployment's annotations path is unchanged.

Found by the pr-diff-review job reviewing PR #4054 and PR #4050
(developing-today/code).

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    on Nov 11, 2026
  2. developing-today commented on Nov 11, 2026

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

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 11, 2026
  5. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  6. 19 remaining items

  7. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: parked
    task: 15016 (repo-health-code-pilot, lane code-h)
    state: parked 30m; PR #8765 is not merge-ready. Fresh revalidation: PR OPEN at head d793d30, issue #8763 OPEN. Codex review receipt is clean on that head, but the current-head review threads still contain CodeRabbit race/recovery findings, and its linked-issue check requests a POST /api/roadmap/annotations rehearsal assertion proving no checkout-side file is created. CodeRabbit CI is skipping; no green required checks available.
    resume: resolve the remaining review/acceptance gaps, rerun targeted rehearsal and fresh checks, then reassess merge readiness. Do not merge yet.
    labels: queue/parked, status/parked, work/assigned.

  8. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · resumed and fixed — PR #8765 head caedd25 (task 15016, lane code-d)

    • Picked up: task 15016 claimed by lane code-d (direct); resumed from the park on PR fix(aggregator): keep roadmap annotations out of checkout #8765 head d793d30.
    • Re-validated fresh: issue fix(aggregator): roadmap annotations store defaults into the checkout on the install.sh deployment (PR #4054 x PR #4050) #8763 OPEN, no hard-stop labels (no held / user/owned / do-not-merge / do-not-auto-edit); PR fix(aggregator): keep roadmap annotations out of checkout #8765 OPEN, Codex receipt clean on the previous head.
    • Fixed the two remaining CodeRabbit follow-ups in caedd25: (1) migration gate stops the legacy writer unconditionally before inspecting either store (was: only when the destination was absent); (2) post-stop failure recovery — atomic .env render (.env.tmp + mv) plus an EXIT trap that restarts the service on a consistent configuration (store moved back if the new env has not landed).
    • Acceptance POST check: test/slice3.test.ts roadmap-annotations round-trip spawns the server with cwd = package dir and PM_AGG_ROADMAP_ANNOTATIONS_FILE at a state path and POSTs /api/roadmap/annotations — passes on this head, and no roadmap-annotations.json exists in the package dir afterwards.
    • Tests: install-rehearsal.sh passes including the new sops failure-injection phase; slice3 annotations test passes; git diff --check clean.
    • Next: Codex re-review requested on caedd25; merge when Codex is clean on this head.
  9. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 11, 2026
  10. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done — PR #8765 merged, issue #8763 closed (task 15016, lane code-d)

    • Outcome: fixed_merged. PR fix(aggregator): keep roadmap annotations out of checkout #8765 merged at 2026-11-11T22:20:28Z, merge commit e6ef453; issue fix(aggregator): roadmap annotations store defaults into the checkout on the install.sh deployment (PR #4054 x PR #4050) #8763 CLOSED by the merge.
    • Final head c7d384e: install.sh renders PM_AGG_ROADMAP_ANNOTATIONS_FILE under ~/.local/state/pm-aggregator, migrates a legacy checkout store (writer stopped unconditionally before either store is inspected, never overwriting an existing destination), renders .env atomically, and restores the service on a consistent configuration after any post-stop failure (a failed rollback move is reported and leaves the service stopped rather than starting it against a missing store).
    • Reviews: Codex clean on the final head (receipt 2026-11-11T22:17:06Z, no findings); all CodeRabbit threads dispositioned — the stop-before-check thread was resolved by CodeRabbit itself, the recovery threads were fixed in caedd25 and c7d384e.
    • Tests: install-rehearsal.sh passes including the new sops failure-injection and failed-rollback phases; bun test test/slice3.test.ts -t "roadmap annotations round-trip" passes (POST /api/roadmap/annotations with cwd = package dir and the env var at a state path; no roadmap-annotations.json created in the checkout afterwards); git diff --check clean. PR checks were QUEUED in the repo runner stall at merge time; merges here do not wait for CI.
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/aggregatorPackage/app: aggregator (pm-stack in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/pr-diff-reviewFiled by the pr-diff-review jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions