# LAYER_B — SiXiS Dashboard v0.1 (Cycle Log Writer)

**Layer A:** SiXiS Protocol v1.0 (formerly Universal Shell v1.1) at `~/Documents/Claude/Projects/SixiS/SiXiS_Protocol_v1.0md.md`
**Layer B status:** Draft pending Tommy's Tier-2 ratification
**Cycle Zero completed:** 2026-05-04
**Sovereign:** Tommy
**Brains polled (Cycle Zero):** Claude (Orchestrator), GPT (Architect/Strategist), Deepseek (Reviewer/Cross-checker)
**Cycle Zero deliberation rounds:** Round 1 (Z1+Z2 + initial classification), Round 2 (technical sub-questions: storage, file layout), Round 3 (K3 cross-check on storage disagreement)
**Failure log for this Cycle Zero:** `../cycles/cycle_zero/FAILURE_LOG.md` (3 breakdowns observed, all at orchestrator-to-sovereign interface)

---

## CONTEXT (frozen intent + merged gap list)

**Frozen intent:**
> "Build a dashboard to track work and conversations, breakdowns, etc. so I can evolve the protocol."

**Why this project exists (from prior thread):** This is the persistent-state-layer surfaced as the highest-leverage move toward partial protocol self-evolution. Without it, every conversation starts amnesiac and Tommy is the only continuity in the system. With it, the protocol becomes something that learns from itself over time. Five data streams identified upstream: cycle log, friction events, rule activations, brain disagreements, override log.

**Self-referential validation:** Cycle Zero for the project that exists to capture protocol breakdowns produced three protocol breakdowns. This is not an embarrassment — it is the strongest possible argument for the project's necessity, and it generates real seed data for v0.1's first ingestion.

**Resolved gaps:**
- Consumer of dashboard → **Tommy in v0.1.** Future SiXiS-the-engine consumption is deferred to v0.2+.
- Capture mechanism → **Approach A (manual annotation)** with assisted suggestion from brains via `[SUGGESTED_LOG_ENTRY]` tags. Approach B (Z9 wrap-up gate) deferred. Approach C (native-database protocol with brain write access) is Tier-3-gated indefinitely.
- Storage → **Local SQLite first** with named migration trigger to dedicated Supabase project. See FORCED_RULE_05 below.
- File layout → **Structured subdirectories** under `~/Documents/Claude/Projects/SixiS/projects/<project_name>/` per the converged structure.
- Authority layer → **Tommy is sole writer in v0.1.** Brains may propose via `[SUGGESTED_LOG_ENTRY]`; nothing persists without `[TOMMY_RATIFIED]`.
- Cycle/round granularity → Inherits Cycle Zero's existing definitions: a "cycle" is a Cycle-Zero-instantiated unit; a "round" is one cross-poll within a cycle.
- Protocol versioning → Every `cycles` row carries a `protocol_version` field. Non-negotiable.

**Open gaps deferred to v0.2 or later:**
- Visualization dashboard (charts, trend lines)
- Auto-instrumentation from chat transcripts
- Brain write access (Approach C — Tier-3-gated)
- Integration with TowMarX Operations Cockpit
- Multi-operator support
- Retroactive ingestion of past chat transcripts (including this Cycle Zero conversation)

---

## CLASSIFICATION

| Field | Value |
|---|---|
| `PROJECT_TYPE` | SaaS Build (instrumentation system, self-referential) |
| `TIER` | 2 — with auto-escalation to 3 on conditions below |
| `ARCHETYPE` | SaaS Build, Compressed Hybrid (strategy embedded in first build iteration; no separate Product Strategy precursor cycle, per K3 cross-check resolution favoring GPT's self-referential argument) |
| `SCOPE` | Structured logging substrate + minimal queryable layer. NOT a visualization dashboard in v0.1. No write-back from substrate to protocol state. Substrate is a derived view; raw transcripts remain canonical. |

**Tier-3 auto-escalation triggers:**
1. Approach C selected (native-database protocol with brain write access)
2. Substrate promoted from "derived view" to "source of truth for protocol health"
3. Schema declared canonical (locking against future drift)

---

## ROLES

| Brain | Role | Responsibilities |
|---|---|---|
| Claude | Orchestrator + Product Architect | Schema decisions, query design, cycle coordination, Round-2 cross-check enforcement |
| GPT | System Designer + Strategist | Capture-mechanism trade-offs, query semantics, K6 (exponential-growth) lens |
| Deepseek | Reviewer + Implementation Check | Constraint validation, K7 audit, schema-drift watch, hidden-obligation analysis |
| Tommy | Sole Executor + Sovereign | Only writer to substrate; Tier-3 ratification authority; cross-check gatekeeper |

---

## CYCLE STRUCTURE

| Cycle | Name | Task Types Allowed | Deliverable |
|---|---|---|---|
| 1 | Schema & Capture Lock | STRATEGY, DRAFT | Final 3-table SQLite schema as `schema_v0_1.sql`; capture-mechanism implementation choice (CLI vs lightweight web form vs direct sqlite3 invocation) |
| 2 | Build Cycle Log Writer | DRAFT, EXECUTION | Working substrate (SQLite DB + minimal write interface + post-cycle git-commit hook) |
| 3 | First Three Queries | DRAFT, EXECUTION, REVIEW | The 3 success queries (see SUCCESS_QUERIES) running against real seed data (the Cycle Zero FAILURE_LOG entries become the first ingestion target) |
| 4 | Observe & Reflect | META, REVIEW | After ≥2 real protocol cycles have been logged, retrospect on what's missing. Feeds v0.2 strategy. |

---

## SCHEMA v0.1 (3 tables, polymorphic events)

```sql
-- cycles: one row per Cycle-Zero-instantiated unit of work
CREATE TABLE cycles (
  id TEXT PRIMARY KEY,                  -- uuid
  intent TEXT NOT NULL,                 -- frozen Z1 intent
  archetype TEXT NOT NULL,
  tier INTEGER NOT NULL CHECK (tier IN (1,2,3)),
  protocol_version TEXT NOT NULL,       -- e.g., 'SiXiS_Protocol_v1.0'
  started_at TIMESTAMP NOT NULL,
  ended_at TIMESTAMP,
  outcome TEXT CHECK (outcome IN ('shipped','stalled','abandoned','in_progress'))
);

-- rounds: one row per cross-poll round within a cycle
CREATE TABLE rounds (
  id TEXT PRIMARY KEY,
  cycle_id TEXT NOT NULL REFERENCES cycles(id),
  round_number INTEGER NOT NULL,
  summary TEXT,
  locked_artifact_ref TEXT,             -- pointer to STATE_LOCK output
  converged_at TIMESTAMP
);

-- events: polymorphic event log (friction, rule_activation, disagreement, etc.)
CREATE TABLE events (
  id TEXT PRIMARY KEY,
  cycle_id TEXT NOT NULL REFERENCES cycles(id),
  round_id TEXT REFERENCES rounds(id),
  type TEXT NOT NULL CHECK (type IN (
    'friction','rule_activation','disagreement','adoption',
    'override','drift','rollback','redundancy_flag','breakdown'
  )),
  source TEXT NOT NULL CHECK (source IN ('claude','gpt','deepseek','tommy','system')),
  timestamp TIMESTAMP NOT NULL,
  description TEXT NOT NULL,            -- structured short-form
  related_event_id TEXT REFERENCES events(id)  -- for adoption/override chains
);

CREATE INDEX idx_events_cycle ON events(cycle_id);
CREATE INDEX idx_events_type ON events(type);
CREATE INDEX idx_events_source ON events(source);
```

**Schema-drift discipline:** Per FORCED_RULE_04, all schema changes after v0.1 lock are `[AMENDMENT]`-gated. The `events` table is intentionally polymorphic so new event types can be added via enum extension (lightweight amendment) rather than new tables (heavy amendment).

---

## SUCCESS QUERIES v0.1

If the v0.1 substrate cannot answer these three queries, it has failed:

```sql
-- Q1: Last 10 cycles where outcome != shipped — what events preceded the breakdown?
SELECT c.id, c.intent, c.outcome, e.type, e.timestamp, e.description
FROM cycles c
LEFT JOIN events e ON e.cycle_id = c.id
WHERE c.outcome IN ('stalled','abandoned')
ORDER BY c.started_at DESC, e.timestamp ASC
LIMIT 10;

-- Q2: Which forced rules have fired most across all cycles, and were they respected vs overridden?
SELECT
  description AS rule_or_event,
  COUNT(*) AS fire_count,
  SUM(CASE WHEN type = 'override' THEN 1 ELSE 0 END) AS override_count
FROM events
WHERE type IN ('rule_activation','override')
GROUP BY description
ORDER BY fire_count DESC;

-- Q3: Which cycle/round combinations had the most disagreements, and how did they resolve?
SELECT
  r.cycle_id,
  r.round_number,
  COUNT(CASE WHEN e.type = 'disagreement' THEN 1 END) AS disagreements,
  COUNT(CASE WHEN e.type = 'adoption' THEN 1 END) AS adoptions,
  COUNT(CASE WHEN e.type = 'override' THEN 1 END) AS overrides,
  r.summary AS resolution
FROM rounds r
LEFT JOIN events e ON e.round_id = r.id
GROUP BY r.cycle_id, r.round_number
HAVING disagreements > 0
ORDER BY disagreements DESC;
```

---

## STORAGE & FILE LAYOUT (locked)

**Storage v0.1:** Local SQLite at `projects/dashboard_v0_1/sixis_dashboard.db`. Migration trigger to dedicated Supabase project named in FORCED_RULE_05 below.

**Per-project file structure (this project):**
```
projects/dashboard_v0_1/
├── layer_b/
│   └── LAYER_B_SiXiS_Dashboard_v0_1.md   # this file
├── cycles/
│   ├── cycle_zero/
│   │   ├── FAILURE_LOG.md                # 3 breakdowns logged
│   │   └── conversations/                # raw transcripts per round (TBD)
│   ├── cycle_1/                          # Schema & Capture Lock (next)
│   ├── cycle_2/                          # Build Cycle Log Writer
│   └── cycle_3/                          # First Three Queries
├── artifacts/
│   ├── schema_v0_1.sql                   # produced in Cycle 1
│   └── archive/                          # SHA-256-checksummed snapshots
└── scripts/
    └── post_cycle_commit.sh              # git-commit hook (Cycle 2)
```

**Universal-level file layout** (deferred cleanup): Existing protocol docs (`SiXiS_Protocol_v1.0md.md`, `Universal_Shell_v1.0.md`, `Cycle_Zero_v1.1.md`, `Archetype_Library_v1.0.md`) currently live at `~/Documents/Claude/Projects/SixiS/` root. Per converged file structure, they should move to `~/Documents/Claude/Projects/SixiS/universal/`. This reorganization is queued as a separate small task to avoid mid-cycle file moves that could break external references.

---

## WRAPPER SPEC

Inherit Universal Shell default wrapper:

```
[BRAIN: <name> | TASK_TYPE: <type> | TIMESTAMP: YYYY-MM-DD HH:MM:SS | CYCLE: <name>]
[ROLE: <role>]   (when roles differentiated)
<response>
[END BRAIN: <name>]
```

**Project-specific extras:**
- `[SUGGESTED_LOG_ENTRY: type=<event_type> | source=<brain> | description=<short_text>]` — emitted by any brain during a cycle to propose a substrate write. Tommy commits via `[TOMMY_RATIFIED]` or rejects via `[REJECTED: <reason>]`.
- `[TIER_ESCALATION_TRIGGERED: <which_trigger>]` — emitted immediately when any of the Tier-3 auto-escalation conditions are proposed. Halts the cycle until full Tier-3 poll completes.

---

## ROUTING CONFIRMATION

Three-brain parallel polling confirmed for all Tier-2+ decisions in this project. Brains certify they will not read other brains' responses before posting their own. Round-2 cross-check (per FORCED_RULE_03 below) is mandatory whenever real disagreement persists after Round 1.

---

## KERNEL RATIFICATION

All seven Kernel principles ratified for this project. Load-bearing principles flagged:

- **K1 (Cognitive Load Optimization)** — load-bearing at orchestrator-to-Tommy interface (see breakdowns #1–3 in FAILURE_LOG)
- **K2 (Sovereignty)** — Tier-3 auto-escalation triggers above
- **K3 (Multi-Perspective Adversarial Reasoning)** — load-bearing per FORCED_RULE_03
- **K7 (Auditability and No Hidden Agency)** — load-bearing for entire project (substrate-as-derived-view, git-commit discipline, archival checksums)

---

## FORCED RULES (project-specific)

These forced rules apply to this project for its full lifecycle. Each was added in response to a specific need surfaced during Cycle Zero (either from an archetype default, a cross-check resolution, or a logged breakdown).

### FORCED_RULE_01 — Tommy is sole writer in v0.1
All event commits to the substrate require Tommy's explicit ratification. Brains propose with `[SUGGESTED_LOG_ENTRY]`; nothing persists without `[TOMMY_RATIFIED]`. Applies to: all cycles after Cycle Zero.

### FORCED_RULE_02 — protocol_version stamped on every cycle row
Every `cycles` row must carry the SiXiS Protocol version active when the cycle ran. No exceptions. Enables longitudinal analysis across protocol evolution. Applies to: Cycle 1+ writes.

### FORCED_RULE_03 — Round-2 cross-check required before synthesis on real disagreement (added from breakdown #3)
When two or more brains take materially different positions on a Tier-2+ decision, orchestrator must issue a Round-2 cross-check showing each brain the other's full position plus any proposed orchestrator synthesis. Synthesis cannot be declared until each brain has had the opportunity to respond with one of: (a) defend with new reasoning, (b) `[ADOPTING_FROM]` with re-audit reason, or (c) introduce a third position. Orchestrator-side override without Round-2 is a K3 + M-Imperative-3 violation. Applies to: all cycles.

### FORCED_RULE_04 — Schema changes require [AMENDMENT]
Adding/removing columns or tables to the substrate is a Layer B amendment. Lightweight by default; heavy if event-type semantics change or if the change affects any of the 3 success queries. No silent schema drift. Applies to: Cycle 1+.

### FORCED_RULE_05 — Storage Promotion Trigger (from K3 cross-check, GPT contribution)
v0.1 begins on local SQLite. Migration to a **dedicated** Supabase project (NOT TowMarX/ValueBet reuse) is mandatory when ANY of the following occur:
1. Hosted dashboard UI requires remote access
2. Any brain/agent write-access is contemplated
3. More than one human writer is added
4. Schema survives 5 real protocol cycles without structural change
5. Protocol telemetry becomes an input to automated decision-making

Migration is a planned, scripted, verifiable transformation: `sqlite3 .dump` → `pgloader` → row-by-row hash verification. The migration script is committed alongside the final SQLite snapshot. Applies to: lifecycle of project.

### FORCED_RULE_06 — Audit Backup (from K3 cross-check, GPT contribution)
After every logged protocol cycle, export:
- `sixis_dashboard.db`
- `schema.sql`
- `latest_snapshot.csv` or `.json`

Store under `artifacts/` with date/version stamp. Applies to: Cycle 2+ (once substrate exists).

### FORCED_RULE_07 — Git Commit Discipline (from K3 cross-check, Deepseek contribution)
A post-cycle script (`scripts/post_cycle_commit.sh`) must run after every cycle to commit the `.db` file, all `cycles/` transcripts, and any updated artifacts. Git commit history IS the per-write audit log; no cloud provider matches it without additional tooling. Tommy may invoke manually or wire to a hook. Applies to: Cycle 2+.

### FORCED_RULE_08 — Archival Rule (from K3 cross-check, Deepseek contribution)
The final SQLite `.db` before any Storage Promotion (FORCED_RULE_05) is frozen as `sixis_audit_final_v<N>.sqlite` and stored in `artifacts/archive/` with a SHA-256 checksum logged in `cycles/<latest_cycle>/CHECKSUMS.md`. The archived `.db` is never deleted. Migration script is committed alongside. This makes the migration a "crystallization event" rather than an audit discontinuity. Applies to: at storage promotion.

### FORCED_RULE_09 — Substrate is derived view, not source of truth (from breakdown audit + Deepseek's Round-1 K7 sharpening)
Raw chat transcripts remain the canonical record. The substrate is reconstructable from transcripts. No protocol decision may cite the substrate as primary evidence without also citing the source transcript. Applies to: all cycles.

### FORCED_RULE_10 — Conversational synthesis to sovereign (added from breakdown #1)
Convergence-pass outputs to Tommy must be prose-form. Structured artifacts (Layer B drafts, schemas, forced-rule lists) are written to files or held in brain handoff blocks; never dumped inline to Tommy. Applies to: orchestrator's user-facing output, all cycles.

### FORCED_RULE_11 — Technical sub-questions cross-poll before sovereign ask (added from breakdown #2)
Inside an already-ratified scope, any technical sub-question (storage, library choice, file layout, schema details, etc.) must be cross-polled to ≥2 brains and converged before being presented to Tommy. Tommy receives the converged recommendation for ratification, not a menu of options. Exception: true sovereign-only decisions (red-line risk acceptance, scope-boundary changes, irreversible Tier-3 escalations) still go directly to Tommy. Applies to: all cycles.

---

## CANDIDATE UNIVERSAL SHELL AMENDMENTS (queued for future meta-cycle)

The following Layer-B forced rules are candidates for promotion to the Universal Shell itself (Section 4 forcing functions or Section 1 Kernel principles) in a future Tier-3 amendment cycle. They were derived from breakdowns observed during this Cycle Zero and may apply to all future SiXiS Protocol projects.

1. **FORCED_RULE_03** (Round-2 cross-check on real disagreement) — candidate for new Section 4.x in Universal Shell
2. **FORCED_RULE_10** (Conversational synthesis to sovereign) — candidate for K1 elaboration in Universal Shell
3. **FORCED_RULE_11** (Technical sub-questions cross-poll before sovereign ask) — candidate for K3 elaboration or new Section 4.x

The unifying observation across the 3 breakdowns logged in `cycles/cycle_zero/FAILURE_LOG.md`: orchestrator's default posture optimizes for forward-velocity (move to next step) over deliberation-completeness (satisfy all K-principles before advancing). This bias deserves an explicit forcing function in a future Universal Shell amendment.

---

## DEFERRED TO v0.2 OR LATER

- Visualization dashboard (charts, trend lines)
- Auto-instrumentation from chat transcripts (move toward Approach B)
- Brain write access (Approach C — Tier-3-gated)
- Integration with TowMarX Operations Cockpit
- Multi-operator support
- Retroactive ingestion of past chat transcripts
- Storage promotion to dedicated Supabase project (gated by FORCED_RULE_05)
- Universal Shell amendment cycle to promote candidate rules above

---

*End of LAYER_B for SiXiS Dashboard v0.1. This document is binding for all Cycle 1+ work. Any change requires `[AMENDMENT]` per Universal Shell Section 4.8.*
