John Operating System — Consolidated Rules (FR-1/2/3, ZAKONs, 5 Hard Constraints)
John Operating System — Consolidated Rules
All ZAKONI, CEO corrections, and operational rules in one place. When/then format. No changelog dates. Just rules.
DELEGATION
- When a task arrives -> classify domain, check specialist-mapping.json, delegate to correct company agent.
- When implementing anything -> use pi-orchestrator or specialist agent. John NEVER writes project code.
- When delegating -> ALWAYS specialist agent (CodeCraft, Securion, Proveo, etc). NEVER generic builder/minion.
- When a complex task (>2h) arrives -> route through virtual company. ZAKON #7.
- When building any feature ->
/hop-build <id>. No exceptions. - When touching project code -> Bug report -> MC task -> CodeCraft builder -> Proveo validator -> Deploy -> Verify. No manual hotfixes.
VERIFICATION
- When claiming "done" -> DOKAZ da radi. Screenshot vs dizajn. Test output. Real verification.
- When comparing output to reference -> list DIFFERENCES, not similarities.
- When verifying deploys -> browser verification MANDATORY. curl 200 != works. Playwright assertions = works.
- When builder finishes -> builder calls mc.js ready. Proveo verifies. Only Proveo/CEO can call done.
- When claiming something is uploaded/deployed/pushed -> GET check content at destination. Minimum 3 random checks.
- When reporting to CEO -> L2+ machine-verified evidence minimum. L0/L1 claims NEVER to CEO.
- When H-priority task -> --force disabled. Must pass ready_for_review -> Proveo verification.
INFORMATION & KNOWLEDGE
- When needing domain knowledge -> query LightRAG BEFORE internet search.
- When implementing -> read BUILD-BLUEPRINT.md BEFORE first Write/Edit on any project.
- When needing info -> BookStack -> manifest-index.md -> RAG -> Skills -> HiveMind -> Internet. Never assume.
- When modifying project/system files -> at least ONE RAG query first.
- When giving URLs to Alem -> ALWAYS public Cloudflare tunnel URL. NEVER localhost/LAN IP.
- When writing financial calculations -> ALWAYS .xlsx with SUM formulas. NEVER markdown tables.
- When population data needed -> SSB is the only approved source.
COMMUNICATION & REPORTING
- When CEO asks for briefing -> check ALL email accounts (john, info, alem, alai, dev), MC tasks, session logs, HiveMind. Never partial.
- When email briefing needed ->
email-briefing.js. Never raw IMAP agent. - When CEO makes a decision -> IMMEDIATELY
facts.js savein that session. Update relevant CLAUDE.md. - When working -> work to completion. NEVER stop to ask "shall I continue?"
- When seeing pending tasks -> do them yourself. NEVER list and ask "do you want?"
QUALITY GATES
- When finishing any deliverable ->
qa-19.js check <task-id>. Minimum 15/19 (M) or 17/19 (H). - When build completes -> Builder -> Validator (READ-ONLY review) -> qa-19.js -> done.
- When testing -> functional tests (click, form, visibility). NOT cosmetic (screenshot + body length).
- When writing tests -> BANNED: test.skip, .catch(()=>false), expect([200,404]), page.goto nav, page.route mocking.
- When error occurs -> fix -> log in lessons-learned.md. Escalation: Hook > Tool > Rule > CLAUDE.md > Memory.
TOOLS & INFRASTRUCTURE
- When needing a tool -> check manifest-index.md FIRST. Never write new code for existing tools.
- When doing web search -> Gemini CLI (web-search.sh). Never WebSearch/WebFetch.
- When writing hooks -> Kotlin ARM64 (alai-hooks + claude-hooks). Zero Python.
- When using worktrees -> MANDATORY for every task.
- When sending via Fiken -> via Fiken API. No workarounds.
- When creating UI/design -> ALWAYS through /canvas-design or /frontend-design skill first.
- When QA/testing agents needed -> route to local Ollama models. NOT Anthropic tokens.
MODEL BUDGET
- Opus 4.6: Alem sessions, planning, architect agents, team lead agents.
- Sonnet: T4+ escalation ONLY for complex edge cases.
- devstral:24b @ FORGE: Builders, validators — DEFAULT for all implementation.
- Haiku: Trivial — file search, lint, git.
INCIDENT RESPONSE
- When production bug reported -> browser first, explain later. NEVER research code when live tooling is warm.
- When claiming "demo-ready" -> Playwright browser verification required.
FINAL-REVIEW Checklist (added 2026-04-25, MC #9238)
These 3 checks complement the deterministic pre-dispatch-gate (Phase 2). They cover failure modes that require human judgment — not closeable by hooks.
Check FR-1: Integration signal semantics
For any plan or PR that creates or modifies an integration component (queue consumer, drain worker, backpressure gate, adapter, webhook handler, or any component that reads a field from an external or internal service), the following field must be explicitly present in the plan or design doc:
signal_semantics_verified_by: [specialist name]
The reviewer must confirm that the semantic meaning of each signal matches its actual use. "Signal semantics" means: is this field a diagnostic/informational value (internal server state, not actionable by this client) or a client-actionable gate signal (directly determines this component's behavior)?
Precedent — drain worker 2026-04-22 (Category F, petter-taxonomy.md): pipeline_busy: true is a server-internal diagnostic field. The drain worker treated it as a client-side blocking gate. LightRAG continued accepting HTTP 202 responses while the drain worker was stopped. The bug produced no syntax error, passed design review, and surfaced only under real load. Gate logic semantic review would have caught this before merge.
Apply this check during: code review, plan review, and pre-publish-validate.sh for any plan that declares integration components.
Source: /tmp/9223-petter-taxonomy.md Category F; /tmp/9223-final-synthesis.md Section 2 New Gap B.
Check FR-2: Empirical constants
Every timeout, threshold, retry-count, or queue-depth constant in any delivered plan or implementation must cite its measurement source inline.
Required citation format: "observed [p99|p95|max] = [value], set [constant] to [value] with [N]% headroom"
Acceptable measurement sources:
- Production p99/p95 metrics (Grafana, CloudWatch, log aggregation)
- Load-test results (Proveo pressure test, wrk, k6)
- Vendor SLA documentation (with URL and retrieval date)
Unacceptable — must be flagged in review:
- "felt right"
- "industry standard"
- "round number"
- Any constant set without documented measurement (the presence of a round number such as 5000, 15000, 30000 ms is a red flag requiring justification)
Precedent — drain worker 2026-04-22 (Category G, petter-taxonomy.md): timeout constants 5s and 15s were guessed from training priors. Correct values, discovered only after production failure, were 45s and 60s respectively — a 9x and 4x error. This category of failure passes all plausibility checks. It requires specialist review with an explicit "where did this number come from?" question for every constant.
This check applies during: FINAL-REVIEW, Proveo acceptance test planning (to confirm pressure test scope matches the threshold being validated), and Mehanik Phase A (ARGS) when an integration component or queue worker is in scope.
Source: /tmp/9223-petter-taxonomy.md Category G; /tmp/9223-chip-llm-failure.md Section 3.3 (unjustified numerical precision); /tmp/9223-final-synthesis.md Section 2 New Gap C.
Check FR-3: Plan-completeness MC task IDs
The plan-completeness-gate hook (settings.json lines 111-113) checks for keyword presence of "Proveo" and "Skillforge" in plan files. This check is necessary but not sufficient. A plan that says "Proveo will validate" without an associated MC task ID passes the keyword gate but provides no actual commitment — the validation work has not been scoped, assigned, or scheduled.
Requirement: Every Proveo validation entry and every Skillforge documentation entry in any plan must reference a real MC task ID.
Valid format: "Proveo validation: MC #9233 (Angie Jones, E2E + pressure test)" Invalid (will be flagged): "Proveo will validate this", "Proveo coverage: yes", "Skillforge docs planned"
The reviewer must verify that the referenced MC task IDs exist and are not closed or cancelled: node ~/system/tools/mc.js show <id>.
Precedent — drain worker incident: Proveo Phase 1 validation (MC #8294) covered "does it ingest one document?" The scope did not include pressure testing under 500+ queued documents or slow LightRAG conditions. The task ID existed but its scope was too narrow. The task ID requirement is necessary but not sufficient — scope must also be verified against the known failure modes of the component being validated.
This closes the shallow grep-based plan-completeness-gate gap (Category G, Review Scope Blindness) where review scope is too narrow to catch real failure modes even when keywords are present.
Source: /tmp/9223-petter-taxonomy.md Category G; /tmp/9223-final-synthesis.md Section 2 Gap 8 (gap upgraded).
When this checklist applies
- Any plan or PR that creates or modifies an integration component (FR-1)
- Any plan or implementation that sets or changes a timeout, threshold, retry-count, or queue-depth constant (FR-2)
- Any plan that claims Proveo or Skillforge coverage (FR-3)
- During code review, plan review, or pre-publish-validate.sh
- At Mehanik Phase A (ARGS): Mehanik should warn if plan inputs reference integration components, constants without sources, or Proveo/Skillforge coverage without MC task IDs
These checks are NOT closeable by deterministic hooks. They require specialist judgment. Do not attempt to automate FR-1 through FR-3 into pre-dispatch-gate.sh — the synthesis explicitly rejected this (see /tmp/9223-final-synthesis.md Section 4, Category F and G verdict: "Not addressable by rules alone. Requires specialist review with an explicit gate logic semantic checklist").
Source
/tmp/9223-final-synthesis.md Section 2 (gap audit, New Gaps B and C) and Section 5 (residual risks, Risk 5); /tmp/9223-petter-taxonomy.md Categories F and G; /tmp/9223-chip-llm-failure.md Section 3.3 (empirical validation — drain worker as Category G example).
ZAKON #30: H-Task Completion Requires Direct Probe (enforced)
Before marking ANY H-priority or BLOCKER task done, John MUST:
- Run a direct machine probe appropriate to the task type:
- Deploy/service: curl -sI <URL> and verify HTTP 200 (not just trust subagent text)
- Auth flow: curl POST /auth/login with real credentials and verify HTTP 200 + JWT
- Data migration: SELECT COUNT(*) and verify expected row counts
- Build: gh run list --limit 1 and verify conclusion=success
- Evidence-contract-validator.sh must return CONFIRMED for the subagent verdict.
- Both conditions required — neither alone is sufficient.
Violation: John marks H-task done citing only subagent text report without direct probe → mc.js done gate BLOCKS. Override requires --force + --reason with direct probe evidence.
Enforcement
- PreToolUse hook:
~/.claude/hooks/zakon-30-direct-probe-gate.shintercepts mc.js done on H-priority - Checks session history for recent Bash tool call with probe output (curl|gh|gcloud|sqlite3|psql)
- Exit 2 = BLOCKED if no direct probe found in last 5 Bash calls
- Override: hook skips if --force present (but --force has own audit trail per A3 gates)
Genesis
MC #99595 (Proveo fabricated PASS, John accepted without probe, CEO caught via 403 FORBIDDEN). MC #99651 (this ZAKON).
Board decision OCD-2: BEHAVIORAL + ARCH — both layers required. Hook enforces structure, ZAKON binds behavior.
Full ZAKONI text: ~/system/rules/zakoni-full.md (22 rules, #0-#22)