Skip to content

fix(aggregator): provenance is lazily populated per process — /api/health reports "fixtures" for facets not yet loaded since boot #1267

Closed

Description

@dezren39

Found by the #1184 coherence design track (2026-10-26, verified live twice): the aggregator's Provenance facet strings are lazily populated per server process. live.ts initializes every facet to a fixture default, and each facet's string is only replaced when that facet's method has actually run in that process. /api/health (server.ts) reads source.provenance() without exercising the facets — so its answers depend on which pages happened to be visited since boot.

Verified tonight: /api/health reported registry: "fixtures" in the same minutes /sessions was serving 221 merged records. Health that lies by omission, depending on request order, undermines every freshness/honesty surface in epic #1184.

Fix direction

Health must actively load or probe the facets it reports on (or provenance must be computed from loaded state, not request history). The coherence design doc (~/workspace/pm-stack-coherence-design-2026-10-26.md, health/freshness sections) already stipulates: actively load or probe; never trust the lazy strings. Coordinate with #1140 (absent-vs-invalid diagnosis) — same honesty family, different mechanism: #1140 is about the orchestration section's validation outcome being misreported as absent; this is about facet provenance depending on process request history.

Acceptance

  • Fresh server process, first-ever request is /api/health: every facet reports its true source (live vs fixtures) without any prior page visit.
  • Regression test: provenance correctness independent of call order.
  • /api/health output for a fully-live deployment contains no false "fixtures" facets.

Refs: epic #1184, #1140, #1138.

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
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Oct 27, 2026
  2. developing-today commented on Oct 27, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    Agent note (pickup): building the honesty + freshness slice of epic #1184 in one PR — this issue (banner + unknown counts + dead-man's-switch half of #1148), #1138 (freshness chips), #1267 (health priming). Design: ~/workspace/pm-stack-coherence-design-2026-10-26.md cluster 1. The PR also carries the role-based copy change (visible "Needs Drew" → "Needs user"; contract field names untouched).

  4. added 2 commits that reference this issue on Oct 27, 2026
  5. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    Agent-note (completion): shipped in PR #1318 (merge b8aedf09), closing this issue.

    What landed

    Regression test: test/health-priming.test.ts boots a live-source server against a controlled feed and asserts on the first response the process ever serves (the readiness poll itself): quota facet live (fleet feed …, orchestration facet live (orchestration section orch-health-test …, registry facet contains 1 session records (not fixtures), and sections.orchestration.state === "live".

    Verification: bun test 181 pass / 0 fail, bunx tsc --noEmit clean, CI green. The fresh-process case is additionally proven live at deploy time (service restart → /api/health as first hit).

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

Metadata

Metadata

Assignees

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codekind/bugSomething isn't working (prefixed form of the classic bug label)status:donetask/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