Jump to content

MindAttic.Telemetry/SPEC

From MindAttic Docs

MindAttic.Telemetry — Product specification

The complete product, written down before it is built (owner, 2026-11-30, MAT-T360). Every epic, feature and story the finished product will have is listed here, built or not. The ticket tree mirrors this file one to one: every ID below is a ticket. Nothing gets built unless it is here, and anything taken out of here is closed wont-do in the tree. docs/RELEASE.md says which part of this the current milestone delivers.

1. Product definition

In docs/ECOSYSTEM.md MindAttic.Telemetry owns the telemetry concern: game sessions are recorded through it, nowhere else.

MindAttic.Telemetry records raw, replayable turn and event telemetry for MindAttic games as one crash-safe, append-only NDJSON file per session, from .NET or Unity, and reads it back as flat rows for balance analysis. The finished product is version 1.0 with the Unity package running the same hardened core as the .NET build, proven by a GridGame session that reads back.

2. Scope boundary

2.1 In the product

  • The core (netstandard2.1 and net10.0), the Unity 6 package com.mindattic.telemetry and TelemetryReader.

2.2 Never in the product

  • A replay or re-simulation engine. It records seed and commands; replay is the game's job.
  • An agent, service or encoder. Just files and a file-lock probe.
  • Dashboards or analysis tooling beyond TelemetryReader. Analysis happens in pandas or the game's own tools.
  • A universal event schema. The core never assumes what a turn or event looks like.
  • Generic cleanups, bughunts and repo sweeps.

3. Users and roles

  • A game (GridGame.Unity today) records every turn and event without risk to play.
  • An analyst (the owner) asks balance questions of real sessions.

4. Requirements

Status is built (closed ticket, with evidence) or MS-n: the milestone in §7 that delivers it.

E1. Session telemetry — M.TELE-T38 — built

F1.1 Recording — M.TELE-T39 — built

  • S1.1.1 Begin a session file — M.TELE-T40 — built. As a game, Telemetry.Begin opens <root>\<AppName>\<date>_<id>\<id>.ndjson.tmp under R:\Telemetry (Documents fallback) and writes SessionStart.
  • S1.1.2 Record turns and events verbatim — M.TELE-T41 — built. As a game, my own DTOs are written as flushed, independently valid JSON lines.
  • S1.1.3 Clean finish rename — M.TELE-T42 — built. As an analyst, FinishAsync writes SessionEnd and renames the file to .ndjson.
  • S1.1.4 Orphans recover — M.TELE-T43 — built. As a game, the next Begin closes an abandoned .tmp with a recovered SessionEnd. Evidence: bb9829c, 69c0ad6.
  • S1.1.5 Never throws into the game — M.TELE-T29 — built. As a game, a throwing event sequence is dropped and logged, never thrown. Evidence: 72c4c9e.

F1.2 Reading and Unity — M.TELE-T44 — built

  • S1.2.1 Reader flattens sessions — M.TELE-T45 — built. As an analyst, TelemetryReader.Read/Flatten turns sessions into flat rows.
  • S1.2.2 Unity package — M.TELE-T48 — built. As a Unity game, TelemetryUnity.Begin/RecordTurn/RecordEvent/Finish writes the same file shape as .NET, via NewtonsoftTelemetryJson/UnityTelemetryLog and the netstandard2.1 IsExternalInit polyfill. Evidence: 57ff529; dictionary-key and session-handling fix M.TELE-T18 (bb9829c).
  • Membrane — M.TELE-T49 — built. Directory.Build.props compiles Recording (F1.1) and Reading and Unity (F1.2) under one set of language rules, and TelemetrySessionTests.cs drives Telemetry.Begin through RecordTurn/RecordEvent/FinishAsync/orphan-recovery and reads the result back with TelemetryReader.Read/Flatten, proving the on-disk session format both features share. Evidence: 57ff529.

E2. Unity games record telemetry — M.TELE-T30 — MS-65

F2.1 Plugin refresh — M.TELE-T31 — built

  • M.TELE-T32 — built. As a Unity game, the plugin DLL and XML are rebuilt from current source by tools/update-unity-plugin.ps1, carrying the T28 and T29 fixes. Acceptance: given the refreshed DLL, when an orphan sweep hits an inaccessible folder, then Begin logs and continues. Evidence: f1b83aa.

F2.2 Consumer verification — M.TELE-T33 — MS-65

  • M.TELE-T34 — MS-65, blocked on GG-T2261 (Telemetry needs the renamed path before it can battle-test it) and an owner-only step (an interactive Unity Editor session). As the owner, one GridGame.Unity editor battle with the refreshed plugin leaves a .ndjson under R:\Telemetry\GridGameGaiden that TelemetryReader.Flatten reads.
  • M.TELE-T36 — MS-65, blocked on GridGame.Unity's own rename (GG-T2260/GG-T2261, both still open): there is no Convergence name yet to point these references at. As the maintainer, Telemetry's references to GridGame.Unity follow its rename to the Convergence names (related to GG-T2261).
  • Membrane — M.TELE-T47 — MS-65. After references follow the Convergence rename (T36), one GridGame.Unity editor battle against the refreshed plugin (T34) writes a Flatten-readable .ndjson under GridGameGaiden, proving the feature end to end.
  • Membrane (epic) — M.TELE-T46 — MS-65. The refreshed plugin (F2.1) is loaded by GridGame (F2.2) so one real battle writes Flatten-readable .ndjson, proving Unity telemetry end to end.

5. Non-functional requirements

  • Core is dependency-free and netstandard2.1 for Unity (M.TELE-LAW-3); append-only (M.TELE-LAW-1); never throws into the game (M.TELE-LAW-2); the plugin follows source (M.TELE-LAW-4).

6. Interfaces and dependencies

Platform concerns it uses (docs/ECOSYSTEM.md): none; it depends on no other MindAttic repo. Its Unity package ships beside the engine kits (Unity.Shared).

  • Consumer: GridGame.Unity, through a file: package path and the plugin DLL.

7. Release sequence

  1. MS-65 — MindAttic.Telemetry 1.0: Unity at parity (active): E2. Reaching it finishes the product.

8. Change log

Date Change to scope Ticket
2026-11-30 Specification written from the BIBLE, charter, overview, code and ticket history; M.TELE-T36 seated under F2.2 MAT-T397
2026-11-30 Build-up comb (MAT-T484): S1.2.2 repointed to its real built story M.TELE-T48 (Unity package authoring); the Session telemetry epic's built membrane (M.TELE-T49) and the Unity-games epic's and feature's membranes (M.TELE-T46, M.TELE-T47) added M.TELE-T49
2026-11-30 MAT-T462 single-source pass: 1 renamed, 0 buckets, 0 requires added, 0 platform re-points MAT-T465
From MindAttic.Telemetry/docs/SPEC.md via MindAttic.Docs; synced automatically, so edit the repo, not this page.