LearnNewsExamplesServices
Frontmatter
id14938
titleComplete temporal-pyramid aggregation before runtime enablement
stateOpen
labels
enhancementaiarchitecture
assigneesneo-gpt
createdAt7:30 AM
updatedAt7:30 AM
githubUrlhttps://github.com/neomjs/neo/issues/14938
authorneo-gpt
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]

Complete temporal-pyramid aggregation before runtime enablement

Open Backlog/active-chunk-5 enhancementaiarchitecture
neo-gpt
neo-gpt commented on 7:30 AM

Context

PR #14897 delivers the disabled-by-default scaffold for #14434: the pure aggregation engine, the IO service, the daemon entry point, and all six named source bindings. The live PR body still records unfinished runtime contracts and keeps aggregationEnabled false. To preserve that converged work while ending repeated review cycles, this successor owns every remaining enablement obligation in one coherent lane.

This is not a micro-ticket split. It is the completion lane after the scaffold merges, owned by @neo-gpt.

The Problem

The scaffold is safe to merge while runtime-disabled, but enablement would currently outrun the contract:

  • ADR 0028 requires both durable L1 session and L2 daily records; the branch proves the L2 engine but not the complete L1/L2 runtime path.
  • sandboxesGraduated cannot use Discussion close time or marker-like prose as the fact source. The canonical author-action marker and its event timestamp must be read from the complete Discussion conversation.
  • The lane must participate in the existing supervised orchestrator/backpressure topology rather than creating a second independent scheduler.
  • SUMMARY_DAILY writes, bounded retention/version progression, and live durable-write evidence remain absent.
  • The opt-in must stay false until the complete path is proven.

The Architectural Reality

The governing surfaces were re-verified before filing:

  • ADR 0028 §2.1/§2.3/§2.4/§2.6 fixes durable L1/L2, one temporal-summary collection, named metric sources, deterministic SUMMARY_DAILY writes, and unified plus per-agent partitions.
  • ADR 0028 §4 assigns bounded retention/versioning to this implementation lane.
  • ADR 0022 and #14434 require the aggregation work to share the existing orchestrator fairness and heavy-maintenance backpressure substrate.
  • The scaffold lives in ai/daemons/temporal-summary/{daemon,TemporalSummaryAggregationService}.mjs and ai/services/memory-core/helpers/temporalSummaryAggregationEngine.mjs; the orchestrator owner surfaces are ai/daemons/orchestrator/scheduling/{registry,pipeline}.mjs and ai/daemons/orchestrator/services/MaintenanceBackpressureService.mjs.
  • ADR 0024 already registers SUMMARY_SESSION and SUMMARY_DAILY as deterministic aggregation-lane node types.

The Fix

Build on the merged scaffold and finish the lane in one PR:

  1. Register a supervised, one-shot temporal-summary task in the existing orchestrator topology; keep cadence and heavy-lane fairness there rather than inside an independent child poller.
  2. Materialize both L1 and L2 records for unified and per-agent partitions through the existing schema and pure engine.
  3. Source sandboxesGraduated from exact [GRADUATED_TO_TICKET: #N] author actions with their event timestamps; paginate the full conversation and fail closed when evidence is unavailable.
  4. Emit SUMMARY_DAILY only from this deterministic writer.
  5. Define and test append-only version progression plus bounded retention.
  6. Prove the real durable write and idempotent replay before runtime enablement.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
AiConfig.temporalSummary.aggregationEnabled ADR 0019 + #14897 scaffold contract Remains false until every AC below passes Disabled; no partial writes Config JSDoc + PR body Disabled-path spec and live boot
Temporal-summary scheduled task ADR 0022 + #14434 Existing orchestrator dispatches one supervised, backpressure-aware run Defer without writing Service/task JSDoc Registry, fairness, lease, and failure-path specs
L1/L2 temporal-summary records ADR 0028 §2.1/§2.3/§2.6 Session + daily, unified + per-agent, idempotent per window/version Fail closed; never invent a partition Engine/service JSDoc Focused unit proof + real Chroma upsert/replay
sandboxesGraduated ADR 0028 §2.4 + canonical ideation graduation marker Count exact author-action graduations by event time from the complete conversation Unavailable evidence is not a numeric zero Source-binding JSDoc Pagination, prose-rejection, timestamp, and absence specs
SUMMARY_DAILY ADR 0024 + ADR 0028 §2.3 Deterministic lane is the sole writer No label on write failure Schema/producer JSDoc Graph-write specs + extractor untouched
Version/retention policy ADR 0028 §4 Append-only version minting with bounded retained history Runtime stays disabled Policy JSDoc Version-bump, idempotence, and retention specs

Decision Record impact

aligned-with ADR 0028; aligned-with ADR 0022; aligned-with ADR 0024. No ADR amendment is required unless implementation changes one of those fixed boundaries.

Acceptance Criteria

  • aggregationEnabled remains false until every other criterion is satisfied.
  • The existing orchestrator owns cadence and dispatch; the temporal task is supervised, one-shot, bounded, and backpressure-aware.
  • Durable L1 session and L2 daily records are written for unified and per-agent partitions without duplicate attribution.
  • sandboxesGraduated accepts only exact author-action graduation markers, uses the marker event timestamp, paginates the full conversation, rejects marker-like prose, and fails closed when source evidence is unavailable.
  • SUMMARY_DAILY is written only by this deterministic lane; the semantic extractor remains unchanged.
  • Version bumps mint append-only records, replay is idempotent, and retention bounds growth.
  • Focused tests cover success, deferral, pagination, partial-source failure, write failure, replay, and retention.
  • Live validation proves one real Chroma upsert, one idempotent replay, and one orchestrator-owned execution before enablement.

Out of Scope

  • L3–L5 dynamic synthesis.
  • UI or query consumers.
  • Deep-history backfill.
  • Direction breakdown from #14811.
  • A second daemon, scheduler, collection, or extractor-prompt label path.

Avoided Traps

  • No micro-ticket decomposition of this completion lane.
  • No prose-derived metric values.
  • No Discussion-close-time proxy for graduation time.
  • No independent setInterval scheduler beside the orchestrator.
  • No enablement based on unit-only evidence.

Related

Successor to #14434
Parent epic: #12679
Scaffold PR: #14897
Related consumer: #14811

Live latest-open sweep: checked the latest 20 open issues plus GitHub title search and all-state A2A at 2026-07-10T05:29:39Z; no equivalent successor or competing claim found.

Origin Session ID: de713f27-0e82-4960-b4c6-f281e0c36449

Retrieval Hint: "temporal pyramid scaffold completion L1 L2 sandboxesGraduated orchestrator SUMMARY_DAILY retention #14897"