00-review.perplexity.md#
@GitHub review the data structure of a narrative beat into the npm package 'coaia-narrative' and explain its schema for advanced developper team (T8)#
In coaia-narrative, a narrative beat is not a dedicated top-level record type. It is modeled as a generic graph Entity whose beat-specific semantics live in EntityMetadata; the package’s canonical type source is src/types.ts.
Core shape#
interface Entity {
type?: string;
name: string; // stable beat identifier / title
entityType: string; // discriminates the node kind
observations: string[]; // append-only factual notes
metadata?: EntityMetadata; // narrative-beat payload
[key: string]: unknown; // forward-compatible extension point
}
A beat is therefore a node in a KnowledgeGraph, alongside Relation edges and optional raw JsonlRecord entries. The graph is persisted as JSONL, which makes each entity/relation an independently addressable event-like record rather than a row in a rigid relational table.
Beat-specific metadata#
The narrative fields are under metadata:
| Field | Type | Role |
|---|---|---|
act | number | undefined | Dramatic act or macro-sequence position |
type_dramatic | string | undefined | Beat classification, e.g. a dramatic-function label |
perspective_types | string[] | Perspectives that read the beat: engineer, ceremony, story_engine |
universes | string[] | Deprecated pre-0.17 predecessor of perspective_types; retained for old records |
timestamp | string | undefined | Beat time or occurrence marker |
narrative | { description, prose, lessons[] } | Human-readable narrative content and extracted lessons |
fourDirections | { north_vision, east_intention, south_emotion, west_introspection } | Four-direction reflection structure |
sessionContext | SessionContextMetadata | Embodied/working context: voice vs terminal, land-based setting, capture quality, continuation kind, privacy |
sessionLineage | HermesSessionLineageMetadata | Conversation branching, source beat, parent/branch session IDs, handoff state |
foundation | DeepResearchFoundationMetadata | Research-packet provenance, expected/produced artifacts, evaluation and publication state |
wampumBelt | WampumBeltMetadata | Non-linear mnemonic sequencing, bead positions/colors, ceremony links |
source | SourceProvenance | Producing system, tool, session, version, creation time |
github | GithubBridgeMetadata | Optional GitHub issue/project synchronization state |
These fields are explicitly commented as “Narrative beat specific metadata” in EntityMetadata.
Structural-tension context#
A beat also inherits the package’s broader Structural Tension model:
metadata.phaseis one ofgermination,assimilation, orcompletion.metadata.chartId,parentChart,parentActionStep, andlevelplace the beat within a chart/hierarchy.metadata.dueDate,completionStatus,delayedResolution, anddelayedResolutionHistorysupport actionable or time-bound beats.elementsOfPerformancerecordsDESIGNorEXECUTIONperformance elements.mmotEvaluationsrecords assessment cycles:acknowledge,analyze,update,recommit.
Relations and identity#
A beat connects to other entities through:
interface Relation {
from: string;
to: string;
relationType: string;
metadata?: {
createdAt?: string;
strength?: number;
context?: string;
description?: string;
[key: string]: unknown;
};
}
The from/to values are entity names, so Entity.name functions as the graph join key. Use relationType for the semantic edge—such as sequencing, causality, perspective, ceremony accountability, or chart membership—rather than embedding those relationships solely inside beat metadata.
Advanced-team implications#
- Treat
nameas an identity key. Renaming a beat can breakRelation.from/Relation.toreferences unless the graph layer migrates them. - Treat
observationsas append-oriented evidence, not a substitute for structured fields. Structured queryable state belongs inmetadata; narrative prose belongs inmetadata.narrative. - Use
perspective_types, notuniverses, for new data.universesis deprecated and exists only for backward compatibility with pre-0.17 records. - Preserve unknown fields. Both
EntityandEntityMetadatainclude index signatures, so consumers should not strip unrecognized properties during round-trips. - Keep ceremony data on the bead, not only the belt.
WampumCeremonyLinkcan reference achartIdandbeatName, whileWampumBead.ceremonyLinkcarries the ceremony-specific accountability/witness relationship. - Validate JSONL strictly at ingestion. The open
[key: string]: unknownsignatures maximize compatibility but shift schema enforcement to the reader/writer boundary.
In short: beat = Entity + narrative EntityMetadata + graph Relations, with JSONL as the durable representation and optional bridges to research lineage, session context, GitHub, and Wampum sequencing.
01-verified-against-0.25.0.md#
The Perplexity review checked against coaia-narrative 0.25.0#
Checked 2026-10-22 by the T8 seat (tmux iq-miadi-review-2610221150-coaia-narrative-followup-2610221322). The version read is the one npm publishes, 0.25.0 (2026-10-20), whose source is commit b6c8e76 on branch feat/delayed-resolution-261019 of avadisabelle/coaia-narrative (worktree /a/src/coaia-narrative--delayed-resolution-261019). Line numbers are in src/types.ts at that commit. The published dist/src/types.d.ts carries the same declarations without the // comments.
main of the checkout /a/src/coaia-narrative is at 0.23.0 (6d0ed15) and has none of the delayed-resolution types; its src/types.ts is 299 lines against 364.
Claims in 00-review.perplexity.md#
| # | claim | verdict | where (0.25.0) |
|---|---|---|---|
| 1 | A beat is not a top-level record type; it is a generic Entity whose beat semantics live in EntityMetadata | holds. A beat is an Entity with entityType: 'narrative_beat' | Entity L10 to 17; EntityMetadata L267 to 333; graph-manager.ts L1760, L1814, L1936 |
| 2 | Entity = type?, name, entityType, observations[], metadata?, index signature | holds | L10 to 17 |
| 3 | A beat is a node in a KnowledgeGraph beside Relation edges and optional JsonlRecord entries, persisted as JSONL | holds | L350 to 356; jsonl-records.ts, jsonl-preservation.ts; this folder's own .coaia/*.jsonl |
| 4 | Beat fields act, type_dramatic, perspective_types, universes (deprecated, pre-0.17), timestamp, narrative, fourDirections, sessionContext, sessionLineage, foundation, wampumBelt, source, github | holds | L282, L283, L285, L290, L291, L313, L307, L325, L323, L321, L327, L319, L318; their types at L156, L137, L114, L196, L100, L41 |
| 5 | Those fields are commented "Narrative beat specific metadata" | holds in source; the comment is absent from the published .d.ts | L281 |
| 6 | phase is germination, assimilation or completion | holds | L270 |
| 7 | chartId, parentChart, parentActionStep, level place the beat in a chart hierarchy | holds | L269, L276, L277, L278 |
| 8 | dueDate, completionStatus, delayedResolution, delayedResolutionHistory | holds. The two delay fields are 0.24.1 and 0.25.0 additions | L268, L271, L273, L275 |
| 9 | elementsOfPerformance is DESIGN or EXECUTION | holds | L292 to 295 |
| 10 | mmotEvaluations phases are acknowledge, analyze, update, recommit | holds; each entry also carries direction? (South, East, West, North) and timestamp | L296 to 301 |
| 11 | Relation = from, to, relationType, metadata? (createdAt, strength, context, description, index signature) | holds, incomplete: Relation also has type?: string and a top-level index signature | L335 to 348 |
| 12 | from and to are entity names, so Entity.name is the join key | holds at the type level (both string); graph-manager.ts has no rename method, so a renamed beat does orphan its edges | L336 to 338 |
| 13 | Use perspective_types, not universes; readers accept both | holds; the reader is readPerspectiveTypes() and the values are engineer, ceremony, story_engine | L285 to 290; perspective-types.ts L18, L54 |
| 14 | Unknown fields are preserved through the index signatures | holds | L17, L332, L347 |
| 15 | WampumCeremonyLink references chartId and beatName; WampumBead.ceremonyLink carries the ceremony relationship | holds | L175 to 183; L191 |
| 16 | Validate JSONL strictly at ingestion, since the open signatures move enforcement to the reader/writer boundary | a recommendation, not a schema claim. What exists: schema/data-model/ (entity, relation, knowledge-graph, storage-format, legacy-jsonl-data JSON schemas), validation.ts, argument-hygiene.ts | schema/README.md, schema/DATA_FORMAT.md |
What the review leaves out#
- No version. Its statements are true of 0.25.0 and of 0.24.1; items 8 and 17 are false of
main. relationalAlignment?: { assessed, score, principles[] }on every entity (L302 to 306).- The 0.25.0 types that Episode 297 added:
AgentSessionRef(L211 to 239, withtraceandrehydrateWithat L229 and L234),DelayedResolutionOutcome(L241:rehydrated,released,resolved) andDelayedResolution(L250 to 265). The review namesdelayedResolutiononly as time-bound support. Direction(L19) and the deprecatedsync_target(L329) andgithub_ref(L331), kept for old records.- The JSON schema under
schema/, which is where item 16's recommendation already has a home.
For T8#
The explanation to keep is: a beat is Entity with entityType: 'narrative_beat', its narrative payload under metadata from L281 on, joined to charts and other beats by Relation rows keyed on name, all of it one JSONL line per record. Any document T8 writes from this cites src/types.ts@b6c8e76 and says 0.25.0.
Inquiry artefact: /a/src/IAIP/prototypes/artefacts/miadi-review-2610221150-coaia-narrative-and-explain-its-schema-for-advanced-developper-team-T8-perplexityID-a73d7b8d-4dc0-4e97-a404-f8ced6cd40d9
Chronicle episode: 2026-07-24-episode-297-mino-bimaadizi-daa-stc-bot-ceremony
Woven into miadi-chronicle://297 (2026-07-24-episode-297-mino-bimaadizi-daa-stc-bot-ceremony)
Actions that follow from this inquiry: miadisabelle/Etuaptmumk-RSM#280