LearnNewsExamplesServices
Frontmatter
id14434
titleTemporal-pyramid L1/L2 durable aggregation lane + velocity fields
stateClosed
labels
enhancementaiarchitecture
assigneesneo-opus-ada
createdAtJul 2, 2026, 6:09 AM
updatedAt7:33 AM
githubUrlhttps://github.com/neomjs/neo/issues/14434
authorneo-fable-clio
commentsCount4
parentIssue12679
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[ ] 14811 Direction-velocity writer: land directionBreakdown on L1/L2 via the single deterministic lane + the F3 cost guard, [x] 14568 Per-direction {v,s,r} composition on the temporal pyramid
closedAt7:33 AM

Temporal-pyramid L1/L2 durable aggregation lane + velocity fields

Closed Backlog/active-chunk-2 enhancementaiarchitecture
neo-fable-clio
neo-fable-clio commented on Jul 2, 2026, 6:09 AM

Context

Leaf B of Epic #12679's implementation decomposition (map: https://github.com/neomjs/neo/issues/12679#issuecomment-4862079789). Filed pre-Accepted per ADR 0005 §2.3 for planning visibility. Sequenced after Leaf A (#14433 — the storage substrate this lane writes into).

⛔ Merge gate: merge-blocked until ADR 0028 is Accepted (PR #14428), per #11376 §6 and ADR 0028 §5.

The Problem

The durable tiers do not exist: no lane aggregates sessions (L1) and days (L2) into the temporal-summary collection, and the deterministic velocity fields (the substrate's answer to the "150+ PRs a week" V-B-A failure class) have no producer.

The Architectural Reality

Bound by ADR 0028 (re-verify Accepted at claim):

  • §2.1: the aggregation lane reuses the landed #12676 pattern — MaintenanceBackpressureService heavy-maintenance lane + supervised-child scheduled task + most-recent-first bounded batches — scheduled under ADR 0022 fairness (must not starve REM/defrag siblings).
  • §2.4: L1/L2 records carry the deterministic velocity fields (mergedPrs, devCommits, sessionsPerAgent, highImpactSessions, adrsLanded, sandboxesGraduated), each bound to its named source substrate at implementation; prose is never the source of truth. Velocity fields are folded into this leaf (not separate) because they ship with the aggregation write path — a separate metrics leaf would re-open the same files (fold rationale in the map).
  • §2.6: per-agent partitions + one unified track with attribution.
  • §2.3 boundary: writes go through the Leaf-A schema (SUMMARY_DAILY labels via this deterministic lane only — never extractor-prompt widening).
  • Retention/versioning policy: owned here, within the version metadata field.
  • New .mjs placement via structural-pre-flight at claim (likely ai/daemons/ scheduled-task + ai/services/ territory; contract stays directory-agnostic).

The Fix

One PR: the L1 (per-session) + L2 (daily) aggregation lane writing collection records + SUMMARY_DAILY labels, velocity fields populated from named sources, retention/versioning policy, scheduled under the backpressure/fairness substrate. No L3–L5 logic (Leaf C), no consumer surface.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
Aggregation lane (new scheduled task + service logic) ADR 0028 §2.1 + ADR 0022 + landed #12676 pattern Bounded, most-recent-first, backpressure-leased L1/L2 writes No durable tiers (status quo) ADR 0028 §2.1 Task registered + lease behavior tested
L1/L2 records in temporal-summary ADR 0028 §2.3/§2.4/§2.6 (via Leaf A schema) Five-field metadata + velocity fields + partition keys ADR 0028 §2.4 table Field-source binding asserted per field
Retention/versioning ADR 0028 §4 (negative/handoffs) Policy defined within version; bounded growth Unbounded growth (rejected) This ticket → impl docs Policy tests

Decision Record impact

depends-on ADR 0028 (Accepted-gate) · aligned-with ADR 0022 (scheduling fairness) · consumes Leaf A (#14433) schema.

Acceptance Criteria

  • L1 + L2 aggregation runs as a supervised, backpressure-leased scheduled lane (most-recent-first, bounded batches).
  • Every §2.4 velocity field populated from its named source; per-field source binding documented; no prose-derived values.
  • Per-agent + unified partition tracks written per §2.6.
  • SUMMARY_DAILY labels written only by this lane (extractor untouched).
  • Retention/versioning policy defined + tested within the version field.
  • PR held un-merge-ready until ADR 0028 Accepted; gate stated in the PR body.
  • Cross-family review before merge.

Out of Scope

  • L3–L5 synthesis (Leaf C). Consumer surfaces. Schema creation (Leaf A). Backfill of deep history (a follow-up policy decision once the lane is proven forward-running).

Avoided Traps

  • Durable compression above L2 — rejected (ADR 0028 anti-anchor; photocopy cascade).
  • A universal PR impact score — rejected (§2.5; named sources only).
  • Separate velocity-metrics leaf — rejected (fold rationale above).
  • New cron per tier×partition — rejected (the L3–L5-dynamic shape exists precisely to avoid it).

Related

Parent: #12679 (native link on file). Authority: ADR 0028 (PR #14428). Depends-on: #14433 (Leaf A). Sibling: Leaf C (L3–L5 synthesis). Pattern source: PR #12676 (merged 2026-06-07).

Live latest-open sweep: latest-10 at 2026-07-02T04:06Z + this filing window; no equivalent. A2A sweep: all-states at 04:06Z; no competing claim. Filed unclaimed — self-select; claimer runs ticket-intake + structural-pre-flight.

Origin Session ID: 2251c81c-1446-4723-86b3-479322bbcc95 Retrieval Hint: "temporal pyramid Leaf B L1 L2 durable aggregation velocity fields backpressure"

tobiu referenced in commit 3195ba7 - "feat(ai): temporal-summary substrate — collection, SUMMARY_* schema, MC maintenance registration (#14433) (#14733) on Jul 4, 2026, 2:29 PM
tobiu closed this issue on 7:33 AM
tobiu referenced in commit 2fc2fef - "feat(memory-core): temporal-pyramid L1/L2 durable aggregation writer (#14434) (#14897) on 7:33 AM