Skip to content

docs: project health specification (definition + owner-decided policy) - #148

Open
samo-agent wants to merge 1 commit into
mainfrom
docs/project-health-spec
Open

docs: project health specification (definition + owner-decided policy)#148
samo-agent wants to merge 1 commit into
mainfrom
docs/project-health-spec

Conversation

@samo-agent

Copy link
Copy Markdown
Collaborator

What

Adds docs/HEALTH.md — the canonical definition of what GREEN health means for a samo per-client project.

Why

Without a deterministic definition, health is a judgment call and propped/asserted passes reach the merge gate. This spec compiles to a concrete command (planned: samohost health <app>) that exits 0 or non-zero.

Structure

§1 Purpose — health as a deterministic check, not a judgment call.

§2 Criteria — 4 tiers, 23 criteria total:

  • TIER 0 IDENTITY: 1 criterion (ID-1) — prerequisite; everything else keys off it
  • TIER 1 PROD: 8 criteria (PROD-1..8) — 7 BLOCKERs, 1 AMBER
  • TIER 2 PREVIEW: 9 criteria (PREV-1..9) — all BLOCKERs
  • TIER 3 PIPELINE: 6 criteria (PIPE-1..6) — all BLOCKERs
  • TIER 4 TRUTH: 4 criteria (TRUTH-1..4) — 3 BLOCKERs, 1 AMBER

§3 Verdict levels — GREEN / RED / AMBER / UNKNOWN (fail-closed on BLOCKERs).

§4 Owner decisions (settled policy):

  • Gold-flow = BLOCKER (no merge without real samotest walk)
  • Prod-DB internet exposure = BLOCKER; least-privilege drift = AMBER
  • Preview-up SLA / deploy freshness = ~10 min (2 trigger cycles); staler = RED
  • NRestarts > 0 since env creation = RED

§5 Red-team coverage index — all 7 real production failure modes mapped to catching criteria:

  1. All previews 521, trigger dead → PIPE-1 + PREV-1 + PROD-1
  2. Preview wrote to prod DB (baked port) → PREV-3(c) canary + PREV-3(d) bake guard
  3. Frontend 200, API crash-looping → PREV-2 per-listener + NRestarts
  4. Propped BYPASSRLS + unmerged branch → PREV-6 strict-equality + TRUTH-1/2
  5. Snapshot lagged prod schema → PREV-5(c) freshness + parity preflight
  6. Preview ran prod code → ID-1 + PREV-4 baked SHA + MainPID anchors
  7. Fail-open empty-count comparison → PREV-6 canary + fail-closed gate test

§6 samohost health <app> — command design (productization target, not yet built): 4 phases (offline state → on-VM batched SSH → external probes + SHA triangle → --deep samotest), output format, trigger wiring, implementation order.

Changes

  • docs/HEALTH.md added (376 lines)
  • No code changes, no test changes, no Playwright

Do NOT merge

This PR is for review only.

Adds docs/HEALTH.md — the canonical definition of what GREEN health means
for a samo per-client project. Deterministic-check contract (not judgment),
four tiers (PROD/PREVIEW/PIPELINE/TRUTH), all 7 real failure modes covered,
owner-settled policy on gold-flow blocker / security split / NRestarts / SLA.
Productization target: samohost health <app> (not yet built).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant