Skip to content

Add OpsHistory and local-first service contracts to SourceOS typed specs #84

@mdheller

Description

@mdheller

Mission

Add canonical machine-readable SourceOS typed contracts for OpsHistory, BearHistory, shell receipts, local-first sync policy, service activation, and redaction/tombstone propagation.

This repository is the shared contract layer for SourceOS/SociOS. The OpsHistory/BearHistory work should not live only as repo-local docs in AgentTerm, BearBrowser, Memory Mesh, Policy Fabric, Agent Registry, AgentPlane, and sourceos-shell.

Source lessons

From the CloudHistory-style remote configuration:

  • local-first state with adaptive throttling;
  • single-device vs multi-device/topology-aware cadence;
  • payload caps;
  • bounded sync windows;
  • idle/debounce delays;
  • deletion/redaction priority over ordinary writes;
  • bounded shutdown behavior.

From the SafariBookmarksSyncAgent-style launchd service:

  • separately activatable local services;
  • named IPC/service endpoints;
  • push/subscription registration as a distinct lane;
  • background maintenance resource posture;
  • network-aware bidirectional activity;
  • idle-safe / pressure-exitable service design;
  • durable local state for safe restart.

Scope

Add schemas/examples/spec patches for:

  1. OpsHistoryEvent
    • chat, slash command, agent reply, tool call, browser event, shell receipt, memory recall/writeback, policy decision, AgentPlane run, GitHub/CI event, artifact ref, redaction, revocation, handoff.
  2. OpsHistorySyncPolicy
    • topology-aware cadence, payload caps, sync windows, debounce, offline behavior, redaction priority.
  3. LocalFirstServiceManifest
    • service name, activation mode, IPC endpoint names, durable store, network posture, idle-stop/pressure-exit behavior, subscription registration, resource priority.
  4. BearHistoryEvent and BearHistorySyncPolicy additive family.
  5. ShellReceiptEvent additive family for SourceOS shell/TurtleTerm/cloud-fog metadata receipts.
  6. OpsHistoryContextPackRef / context-pack envelope for Memory Mesh and AgentPlane handoff.
  7. RedactionTombstone / revocation invalidation envelope.
  8. AsyncAPI channel fragments for OpsHistory events, redaction events, context-pack events, and service subscription events.
  9. JSON-LD vocabulary additions for ops history, service activation, event classes, context packs, tombstones, and evidence refs.

Acceptance criteria

  • Schemas live in schemas/ with stable URN discipline.
  • Examples live in examples/ and validate offline.
  • Additive OpenAPI/AsyncAPI patch fragments are included where appropriate.
  • Semantic vocabulary additions are documented.
  • Docs identify downstream consumers:
    • SourceOS-Linux/agent-term;
    • SourceOS-Linux/BearBrowser;
    • SourceOS-Linux/sourceos-shell;
    • SocioProphet/memory-mesh;
    • SocioProphet/policy-fabric;
    • SocioProphet/agent-registry;
    • SocioProphet/agentplane.
  • No raw transcripts, credentials, browser histories, shell outputs, or sensitive payloads appear in examples.
  • Redaction/tombstone propagation is explicitly modeled as higher-priority than ordinary memory writeback.
  • Local-first service manifests include Linux mapping for systemd user units, D-Bus/Unix socket endpoints, timers/socket activation, durable local store, and network-aware retry posture.

Non-goals

  • Do not implement runtime services here.
  • Do not move repo-local product ownership into sourceos-spec.
  • Do not define centralized cloud account requirements.

Suggested files

  • schemas/OpsHistoryEvent.json
  • schemas/OpsHistorySyncPolicy.json
  • schemas/LocalFirstServiceManifest.json
  • schemas/BearHistoryEvent.json
  • schemas/BearHistorySyncPolicy.json
  • schemas/ShellReceiptEvent.json
  • schemas/OpsHistoryContextPackRef.json
  • schemas/RedactionTombstone.json
  • examples/ops-history-event.json
  • examples/ops-history-sync-policy.json
  • examples/local-first-service-manifest.json
  • examples/bearhistory-event.json
  • examples/bearhistory-sync-policy.json
  • examples/shell-receipt-event.json
  • examples/ops-history-context-pack-ref.json
  • examples/redaction-tombstone.json
  • asyncapi.ops-history.patch.yaml
  • semantic/ops-history-vocabulary.jsonld
  • docs/contract-additions/ops-history.md

Agent note

@copilot @codex Keep the first pass additive and contract-only. Do not add runtime behavior or sensitive examples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions