Skip to content

STD-GATE-001: Canonical Factory Pre/Post Execution Gate & Single Completion Law

Status: Canonical & Binding
Standard ID: STD-GATE-001
Owner: Blu (kingstown-core.blu) — Director
Directive: Beads + Documentation Are Required Work, Not Aftercare


1. Prime Directive & Single Completion Law

No Bluefly Factory change is complete unless its durable work state (Beads) and durable knowledge state (Documentation) are updated as part of the same operation.

Mandatory Lifecycle

BEAD
 └── CLAIM (active status, single claim per worker)
      └── EXECUTE (bounded change in Gas City worktree)
           └── VERIFY (independent proof of requested effect)
                └── RECORD EVIDENCE (attach logs, metrics, test outputs)
                     └── UPDATE DURABLE KNOWLEDGE (update canonical doc authority)
                          └── SOURCE DELIVER (branch -> commit -> MR -> CI -> merge)
                               └── WITNESS (independent verification)
                                    └── CLOSE BEAD

Any operation skipping any stage remains DONE=NO.


2. Core Operational Rules

Rule 1: No Work Without a Bead

Before any source or runtime mutation:

BEAD_ID=           # Existing claimed Bead ID
BEAD_STATUS=in_progress
BEAD_OWNER=        # Current executing Agent identity
DEPENDENCIES=      # Unresolved blockers = 0
ACCEPTANCE=        # Testable definition of done
Always search existing Beads (bd ready, bd list --status in_progress) before creating work. Do not create duplicate Beads.

Rule 2: One Execution Worker = One Claimed Bead

Every executing Agent session must satisfy ACTIVE_CLAIM_COUNT=1. No unclaimed work, no invisible work, no scope creeping ("fixing something nearby").

Rule 3: Continuous Bead State Maintenance

The Bead is the execution ledger. Update structured metadata whenever ROOT_CAUSE, SCOPE, BLOCKER, OWNER, BRANCH, MR, COMMIT, RUNTIME_STATE, or VERIFICATION changes.

Rule 4: Evidence Before Claiming Success

Before declaring DONE=YES, SHIPPED=YES, or RESTORED=YES, attach structured evidence:

REQUESTED_EFFECT=
OBSERVED_BEFORE=
CHANGE=
OBSERVED_AFTER=
VERIFICATION_METHOD=
COVERAGE=
KNOWN_LIMITS=
An Agent's narrative assertion is never proof.

Rule 5: Mandatory Documentation Update

When work changes architecture, operating model, security model, deployment model, configuration model, API contracts, or factory standards, update the canonical documentation authority as part of the change.

Document Authority Order

1. CURRENT SOURCE / LIVE RUNTIME
2. ENGINEERING STANDARD / ADR
3. PRODUCT AUTHORITY (blutown.ai / ContextControl)
4. PROJECT-SPECIFIC DURABLE DOC
5. BEAD
6. GENERATED REPORT / SCRATCH
Chat windows, session context, and scratch files are NEVER documentation authority.

Rule 6: BluCity-Docs vs Project-Specific Docs

  • BluCity-Docs: Scoped strictly to durable cross-project architecture, standards, and operating models. Never dump task status or session stories into BluCity-Docs.
  • Project Repositories: Scoped to project-specific implementation knowledge (api_normalization, agent-docker, iac, drupalworks).

Rule 7: ADR Required for Material Architecture Decisions

Create or update an Architecture Decision Record (ADR) in BluCity-Docs/Engineering-Standard/decision-records/ whenever changing system authority, deployment topology, security boundaries, storage authority, API exposure, or identity models.

Rule 8: Material Incidents Require Two Durable Records

  • Bead: Executable remediation work item.
  • Incident Record: Durable technical learning in BluCity-Docs/operations/ or ledger/evidence/incidents/.

Rule 9: Source Delivery Applies to Documentation Too

Documentation is source code: Worktree ──► Branch ──► Commit ──► MR ──► CI ──► Merge. Direct manual edits to production host docs are prohibited.

Rule 10: RunningTodo.md is a Human Projection

RunningTodo.md is a navigation summary. Beads remain the canonical executable work authority. Never close a task solely because a checkbox was ticked.

Rule 11: Mandatory Product Impact & Economic Gate Evaluation

Every change must explicitly state:

CUSTOMER_OPERATION_SERVED=
PRODUCT_BLOCKER=
REVENUE_EFFECT=
COST_EFFECT=
RELIABILITY_EFFECT=

IS_THE_NEXT_RUN_GETTING_CHEAPER_AND_MORE_REUSABLE= [YES | NO | NOT_ESTABLISHED]
WHY=

Rule 12: Learning & Repeat Work Promotion

  • Reusable lessons discovered during execution must be attached to the Bead and evaluated for promotion (policy, test, procedure, Formula, Pack, Skill).
  • If substantially the same action is performed REPEAT_COUNT >= 3 times, evaluate it as a Capability Candidate.

Rule 13: Handoff Contract

Handoffs between agents require Bead state update + sling/routing (MAIL_SENT != HANDOFF_COMPLETE). The Bead is the handoff contract.

Rule 14: Independent Witness Verification & End-of-Work Receipt

Executor agents cannot close material changes independently. Independent Witness verification (WITNESS=pass) is required.


3. Mandatory Universal Factory Pre-Execution Gate

Before any mutation:

WORK_AUTHORITY=
SOURCE_AUTHORITY=
OWNER=
RIG=
BEAD=
CLAIM=
CAPABILITY_MATCH=
AUTHORITY=
SERVICE_IDENTITY=
POLICY=
DEPENDENCIES=
EXECUTION_SURFACE=
ACCEPTANCE=
VERIFICATION=
DELIVERY_PATH=
EVIDENCE_PATH=
DOCUMENTATION_DISPOSITION=
FACTORY_GATE=PASS

After mutation & before completion:

BEAD_UPDATED=YES
DOCS_UPDATED=YES
SOURCE_DELIVERED=YES
RUNTIME_VERIFIED=YES
WITNESS_VERIFIED=YES
ECONOMIC_GATE=PASS

If any key is missing or unverified: DONE=NO.