Skip to content

[PORT-004][RFC][P0 before host-attested use] Implement the dedicated suite host in read-only shadow mode #17

Open

Description

@chaoz23

Decision requested

Approve an implementation plan for the dedicated suite host selected by #9 and ADR 0001. This issue specifies the first safe slice: a separate process/package running in read-only shadow mode. It does not authorize creating a repository, publishing a package, or enabling outbound writes.

Why this is P0 before host-attested use

table-kit currently publishes table.event/1.0 and table.evaluation/1.0, and the four tools have installed-package conformance gates (#7, #8; PRs #11–#15). Those contracts correctly label current evidence self_attested. No existing tool can truthfully mint host_attested results because no independent principal owns the protected session descriptor, durable source cursors, evaluator execution, and result commit.

MVP boundary

The host MUST run under a service/OS identity distinct from adapters and evaluators and MUST own:

  • protected session descriptors and immutable descriptor digests;
  • append-only canonical TableEvent storage;
  • per-source durable cursors and replay/idempotency records;
  • evaluator configuration/policy digests and invocation records;
  • committed EvaluationResult envelopes and audit metadata;
  • export/deletion/retention state.

Adapters may submit observations and source-native IDs but may not advance canonical cursors. Evaluators may read a bounded event snapshot and return a candidate result but may not attest or commit it. The shadow MVP receives no Discord/VTT post credential and exposes no write-to-table capability.

Protected session descriptor

Define and version a machine-readable descriptor containing at minimum:

  • campaign ID, session ID, creation/close timestamps;
  • roster, normalized principals, roles, and source-identity bindings;
  • system/edition and canonical source-set selection;
  • enabled evaluators, versions, policy/config digests;
  • consent, visibility, retention, export, and deletion policy;
  • source instances and required event families;
  • descriptor version, digest, and supersession lineage.

Changes create a new digest and explicit supersession record; they never rewrite prior evidence authority.

Ingestion and commit protocol

  1. Adapter submits a page with source instance, source-native IDs, prior cursor, ordering evidence, and TableEvents.
  2. Host validates schema, descriptor binding, identity, contiguity, duplicate/replay semantics, and required redaction metadata.
  3. Host atomically commits accepted events and the next cursor. Any gap, fork, malformed row, or partial write leaves the prior cursor authoritative and records a typed refusal.
  4. Host invokes each evaluator against an immutable event range plus descriptor/config/policy digests.
  5. Host validates semantic invariants, evidence references, coverage, and evaluator identity before committing the result.
  6. authority_status=host_attested is allowed only when the committed envelope carries the host binding required by table.evaluation/1.0; otherwise it remains self_attested or unknown.

Recovery and lifecycle requirements

  • exactly-once effects over at-least-once delivery;
  • deterministic replay and byte-stable result reproduction for the same inputs;
  • crash recovery before/after event write, cursor commit, evaluator return, and result commit;
  • explicit rotate/truncate/fork/source-reset handling; never infer continuity;
  • restart-safe session open/close and late-event behavior;
  • correction and human-ruling events remain distinct from machine findings;
  • consent withdrawal, scoped export, retention expiry, and deletion produce auditable tombstone/control records without silently rewriting prior outputs.

Minimum operator/agent surface

The implementation MAY choose CLI, local API, or both, but must provide typed, machine-readable operations equivalent to:

  • initialize host storage;
  • create/read/supersede/close a session descriptor;
  • ingest and query source progress;
  • request evaluation and read committed results;
  • export/delete according to descriptor policy;
  • inspect health and recovery state.

Human prose must be additive; an AI agent must not have to parse logs to know success, refusal, incompleteness, or next action.

Acceptance criteria

  • Architecture records the process/package and repository decision without making table-kit the trusted host.
  • Descriptor schema, canonical digest rules, and compatibility policy are reviewed.
  • Capability matrix proves adapters/evaluators cannot mint attestation or advance canonical state.
  • One table-kit stream and dmcheck evaluation complete end to end in shadow mode.
  • CharacterCheck and SRDCheck candidates are accepted through the same generic evaluator boundary.
  • Gaps, duplicates, replay, forks, malformed/redacted required content, mixed sessions, unknown event types, and evaluator failure all fail closed.
  • Kill-point tests cover event/cursor/result atomicity and restart recovery.
  • Credential-isolation test proves the shadow host cannot post to a table.
  • Descriptor forgery, evaluator impersonation, cursor rollback, result replay, and storage tamper tests cannot yield host_attested output.
  • Export/deletion/retention and consent transitions have deterministic tests.
  • Installed-artifact four-tool conformance remains green.
  • The pilot in the companion UXR issue can run without privileged manual database edits.

Explicit non-goals for this issue

  • outbound Discord/VTT posting;
  • autonomous DM rulings or changes to game state;
  • public package release;
  • choosing a repository/package name before approval;
  • claiming production readiness from synthetic fixtures alone.

Dependencies and closure

Depends on #7, #8, and #9. Close only when an independently protected implementation passes the adversarial acceptance suite and produces a valid host-bound shadow result. Contract publication or another in-process adapter is not sufficient.

Activity

  1. chaoz23 commented on Aug 3, 2026

    @chaoz23
    OwnerAuthor

    Implementation location is now established at https://github.com/chaoz23/table-host.

    Foundation commit d7f84b6e87754ec27d52518f6c17d9aaae3f35ad records the dedicated-boundary ADR and security posture, exposes a versioned agent-readable capability contract, and enforces that the scaffold is non-operational, shadow-only, cannot mint host_attested, and has no outbound writes. Exact hosted run 30838331895 passes Python 3.10 and 3.14.

    This satisfies repository/package placement only. The issue remains open. The next acceptance slice is the protected session descriptor plus canonical digest; storage, cursors, evaluation commits, isolation, adversarial tests, pilot evidence, and any release remain unimplemented and unauthorized.

  2. chaoz23 commented on Aug 3, 2026

    @chaoz23
    OwnerAuthor

    First implementation slice is ready in chaoz23/table-host#1 at 3685788.

    It packages table.session-descriptor/1.0, validates strict UTF-8/NFC integer-only JSON and cross-field identity/source/evaluator/consent/retention/visibility rules, computes a golden canonical SHA-256 digest, and exposes typed agent CLI success/refusal output. Adversarial tests cover duplicate keys, floats/NaN, unknown fields, ordering/coverage gaps, identity ambiguity, incomplete or late consent, DM visibility, raw-prose retention, lifecycle, and lineage digests.

    Local Python 3.10/3.12/3.14 suites pass 38 tests; wheel/cold-install/package-data checks pass. Hosted push run 30859071316 and PR run 30859111941 are green on Python 3.10 and 3.14. PR #1 is ready but not merged.

    This advances the protected descriptor contract only. Results remain self_attested; transactional protected storage, descriptor supersession commits, separate runtime principal, events/cursors/evaluations, adversarial process isolation, pilot evidence, and any release remain open.

  3. chaoz23 commented on Aug 3, 2026

    @chaoz23
    OwnerAuthor

    Descriptor PR chaoz23/table-host#1 merged as 4392589dd1d01c790d4dc58a4f7a70f0a5081cf4; exact post-merge run 30859456490 is green.

    The next slice is ready in chaoz23/table-host#2 at 2880eb4. It adds a private, versioned SQLite store that atomically appends canonical descriptors, compare-and-swaps one active campaign/session head, and appends audit metadata. Current-descriptor replay is idempotent; supersession requires the exact active digest. Status reads revalidate schema/triggers, every canonical descriptor/digest/generation/predecessor, and the audit chain.

    The 58-test suite passes locally on Python 3.10/3.12/3.14 and in hosted push/PR runs 30859969034/30859990271. It covers concurrent siblings (one winner), injected crashes after insert/head update/before commit (no partial effects), stale rollback, permissions/ownership/symlink/hard-link checks, schema drift, descriptor/audit tamper, and cold-installed CLI operation.

    PR #2 is ready but unmerged. This is still same-principal, local, and self_attested; canonical TableEvent ingest, atomic source cursors, evaluator/result commits, service identity isolation, external attestation, pilot evidence, outbound writes, and release remain open.

  4. chaoz23 commented on Aug 4, 2026

    @chaoz23
    OwnerAuthor

    table-host progress update:

    • PR [TK-002] Fail closed on invalid config, CLI, and ledger input and contain ledger paths #2 merged as exact squash commit 924ece004d57261463b4acf60f08bd6099cf3443; exact post-merge run 30869489657 passed.
    • Draft PR [TK-003] Build resumable, gap-aware Discord capture with commit-safe checkpoints #3: feat: ingest canonical table events atomically table-host#3 at 59ea656 implements the next RFC slice: canonical table.event/1.0 page ingestion plus atomic per-source and canonical-session cursor commits.
    • It consumes table-kit's packaged contract at exact commit a7b8a2857a459b45dda6df5302d3760e6265888d and verifies the canonical schema digest; no schema copy was forked into table-host.
    • The transaction appends page receipt/events, session head, source cursor, and audit together. It refuses stale descriptor/source/session cursors, page conflicts, duplicate event/native IDs, source sequence gaps/rebinding, raw prose contrary to descriptor policy, and unverifiable host authority.
    • Exact v1.0 stores migrate explicitly and transactionally to v1.1; migration and ingestion kill points are covered.
    • Local Python 3.10/3.12/3.14 suites pass 71 tests, and cold-built table-host + table-kit wheels complete the end-to-end ingest/status flow. Hosted PR checks are pending.

    The slice remains read-only and self_attested: no evaluator execution/result commit, outbound writes, credentials, release, or host_attested claim.

  5. chaoz23 commented on Aug 4, 2026

    @chaoz23
    OwnerAuthor

    Follow-up: table-host PR #3 is now ready, clean, and mergeable at exact head 59ea6565c9c8b97bfda1facba146a21e81fa5a43. Hosted push run 30870604081 and PR run 30870633442 both pass Python 3.10/3.14 and exact table-kit cold-wheel conformance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions