How does Number One prevent AI sessions from losing context or repeating mistakes?

Answer

Number One attaches a hash-chained event stream to .numberone/ so every edit, crash, thought, and ruling replays across all 24+ AI harnesses without losing history.

  1. StreamStore writes every workspace fact to events.jsonl with canonical SHA-256 hashes and linear-time secret redaction.1
  2. ReplayEngine folds those atomic events into one verified WorkspaceProjection guarded by snapshotDigest.
  3. AuthorityEngine enforces L1 stream truth and L2 directives above L4 session prompts.2
  4. PartyModeOrchestrator runs three specialist officers and promotes new checks only when KPI delta exceeds zero.3

Applies toNumber One v1.0.0Node >= 22all MCP and CLI harnesses

1

How do workspace signals become authoritative state?

Signal to System of Record
Diagram structure
  • Watchers & MCP sensors
  • Secret Redactor redact
  • events.jsonl log
  • ReplayEngine fold
  • Authority & Crew gate
  • Directory / GitHub / Jira mirrors
  • sensors → redact · raw events
  • redact → log · SHA-256
  • log → fold · JSONL
  • fold → gate · projection
  • log → mirrors · sync
  1. Watchers & MCP

    Captures edits, Git hooks, test crashes, transcripts, and MCP calls.

  2. Secret Redactor

    Scrubs cloud keys, PATs, JWTs, PEM blocks, and SAS tokens in linear time.

  3. events.jsonl

    Links prevHash to hash and flushes bytes with fsyncSync.

  4. ReplayEngine

    Rebuilds WorkspaceProjection and verifies snapshotDigest.

  5. Authority & Crew

    Blocks L4 plans that violate L1 crashes, L2 directives, or L3 lessons.

2

How does L1–L4 arbitration stop repeated dead-ends?

L4 Session vs L1-L3 Authority
Diagram structure
  • AI Harness agent
  • McpServer mcp
  • AuthorityEngine auth
  • StreamStore store
  • agent → mcp · consult_number_one
  • mcp → agent · lessons + dead-ends
  • agent → mcp · arbitrate_action
  • mcp → auth · check L1-L3 rules
  • auth → store · append arbitration.decided
  • store → mcp · seq + SHA-256 hash
  • mcp → agent · APPROVE or BLOCK
2src/core/authority-engine.ts:210–226
  public static readonly PRECEDENCE: AuthorityLevel[] = [
    'L1_SOR_INVARIANT',
    'L2_NUMBER_ONE_DIRECTIVE',
    'L3_OFFICER_GATE',
    'L4_SESSION_CONTEXT'
  ];

  constructor(store: StreamStore, lessonEngine: LessonEngine) {
    this.store = store;
    this.lessonEngine = lessonEngine;
  }

  public arbitrate(
    state: WorkspaceProjection,
    proposal: ArbitrationProposal,
    options: { recordAuditEvent?: boolean } = {}
  ): ArbitrationResult {
3

Why does an external SoR outperform chat memory?

CapabilityChat Window OnlyNumber One SoR
Context compactionAmnesiaDrops failed triesDurablePreserves every dead-end
Switching harnessesIsolatedStarts from zeroUnifiedShares .numberone + MCP
Security & release gatesSoftPrompt advice onlyEnforcedDeterministic 0-100 KPIs
050100EngineeringSecurityBridgeKPI Score100100100Verified Repo Score
Measured Officer KPI Baseline Scores (0-100)
Event Types
47 atomic schemas across 9 domains
MCP Surface
12 tools and 4 live numberone:// resources
Runtime Dependencies
1 (zod) with 0 CVEs
4

What must an operator verify after attaching a workspace?

Opening diagram…