Skip to content

gitorio — Constitution

The rules every change to this repo must satisfy, whoever makes it — a human or an AI agent. Agents read this before AGENTS.md conventions, the PRD, or the feature catalog. Ratified by merged PR; amended only per § 8.

1. Missions

GitFactory's direction is to become the ultimate open home for all things GitHub automation — data, tools, resources and transparency, gathered in one place that anyone can inspect and reuse.

  1. Provide data, tools, resources and transparency for all stakeholders, automation engineers and practitioners, and the general public. Maintainers, harness authors, agent builders and anyone automating a repository are first-class audiences. The aim is a shared, inspectable commons: the same blueprints, the same compiled workflows, and the same trail of configuration for everyone.
  2. Let anyone design, compile and share visual blueprints that become readable, auditable GitHub Actions workflows on their own repos, with no hosted backend. Users arrange triggers, Claude Code agents and actions on a canvas, connect them, and Deploy compiles the blueprint into workflow YAML that works without GitFactory. GitHub remains the database, event bus and compute layer; blueprints and prompts stay versioned in the repo.
  3. Be the fleet's Harness Studio: observe every loop and harness live, design and configure new ones as reviewable blueprints, and manage them only through confirm-gated operations — read-only by default. A versioned graph and config schema, and an engine and API any UI can consume, keep the front end independent of the back end; the studio stays extensible through plugin node types, engine adapters and config-driven behavior, with Jev as the foundation for numbering, fragments and generated files.

These missions set the course; they do not claim the work is finished. They serve the PRD goals: compiling visual blueprints into auditable Actions YAML, versioned and shareable blueprints, guarded agent contracts, and factory-floor status from the Actions API.

Harness Studio (amendment 0002)

GitFactory is also the fleet's Harness Studio: a production-ready, community-ready open harness tool for creating agentic workflows. It observes every loop and harness live, designs and configures new ones as reviewable blueprints, and manages them only through confirm-gated hub operations — read-only by default. Its front end is abstracted from its back end by a versioned graph/config schema (fleetgraph/v1) and an engine/API layer that any UI consumes; it is extensible through plugin node types, engine adapters and config-driven behavior; and Jev is its foundation for numbering, fragments and generated files. (proposed, amendment 0002)

Source: PRD.md §1.1.

2. Invariants (non-negotiable)

These rules are lifted from the repo's own agent guide; breaking one is grounds to reject a PR.

  • The frontend stays static. Everything must work from GitHub Pages + APIs. (AGENTS.md)
  • The blueprint is the source of truth. Never hand-edit generated files; fix the compiler. (AGENTS.md)
  • The compiler is pure and tested. (AGENTS.md)
  • Verify, don't recall. (AGENTS.md)
  • Least privilege, always. Agent tools are granted via narrow --allowedTools patterns like Bash(gh issue comment:*), never blanket Bash. (AGENTS.md)
  • Loop guards are mandatory. Any workflow triggered by comments/issues that can also write comments/issues must guard on github.event.*.user.type != 'Bot' (or actor checks). (AGENTS.md)
  • Secrets never touch the blueprint, the code, or localStorage. PATs live in sessionStorage at most (or a DEV-only .env, guarded so it can never reach a build). (AGENTS.md)
  • Definition of done for a new machine type: registry entry (machines/registry.ts) + config fields + compiler emitter + invariant test + one sentence in docs/ARCHITECTURE.md machine catalog + it renders on the canvas. Use /add-machine for the checklist. (AGENTS.md)
  • Untrusted content is untrusted. Never widen tool grants to "make the prompt work"; tighten the prompt instead. (AGENTS.md)
  • End every session with /session-log — draft a post to blog/drafts/ (frontmatter draft: true, include a Working-with-AI tip section) and append a dated entry to docs/DECISIONS.md if any decision was made or reversed. (AGENTS.md)
  • Secrets (tokens, API keys) are never printed, logged or committed. (fleet rule)
  • CHANGELOG.md is generated by release-please from Conventional Commits; never hand-edit it. (fleet rule)

3. Authority and precedence

When two documents disagree, the higher one wins and the lower one is fixed in the same PR:

  1. This constitution (and its ratified amendments in docs/amendments/)
  2. AGENTS.md — how to work here (commands, conventions, Definition of Done)
  3. The PRD (PRD.md) — what the product must do (requirement ids FRn / NFRn)
  4. features/features.yml — what it does today (stable feature ids)
  5. ADRs in docs/adr/ and specs — why and how a specific change was made
  6. Code, tests, generated files

4. Roles: humans and AI agents

Actor May May not
Maintainer (human) Ratify amendments, PRD changes and releases by merging PRs; change settings, secrets, branch protection —
AI agent Read this file first; open PRs on a branch with Conventional Commit titles; update the feature catalog, PRD block and docs in the same PR as the change; propose amendments Merge a PR that is not mergeable, or one the review gate holds (§ Merge authority); push to the default branch; force-push; change repo settings or branch protection; print or commit secrets; invent features or requirements (unknown = TBD)

5. How the artifacts relate

Artifact Answers Owned by Rule
docs/constitution.md What must always hold Maintainer Changes only by amendment (§ 8)
docs/amendments/NNNN-*.md How and why the rules changed Proposer → maintainer Append-only; ratified by merged PR
AGENTS.md / CLAUDE.md How to work here Repo Must link this file; CLAUDE.md imports @AGENTS.md
PRD What the product must do Maintainer Requirements carry stable ids (FRn, NFRn)
features/features.yml What the product does, where, proven how Repo Every user-facing feature has an id, status, location and prd: refs
PRD "Feature catalog" block PRD → feature trace Generated governance_lint.py prd-sync; never hand-edit
docs/adr/NNNN-*.md Why a hard-to-reverse decision was made Proposer One ADR per decision; an amendment may cite one
CHANGELOG.md What shipped release-please Generated from Conventional Commits; never hand-edit

6. Change process

Change Required in the same PR
Typo, docs fix, refactor with no user-visible effect Conventional Commit title
New or changed user-facing feature Entry in features/features.yml (status, link/docs, prd:), regenerated PRD block
New or changed requirement PRD edit with a new FRn/NFRn id (ids are never reused), feature prd: refs updated
Hard-to-reverse technical decision ADR in docs/adr/
Change to this constitution Amendment record in docs/amendments/ (§ 8)

7. Quality gates

Every PR passes the checks the repo's guide names:

  • npm test (AGENTS.md)
  • npm run typecheck (AGENTS.md)
  • npm run build (AGENTS.md)
  • tools/ ← stdlib gates: spec_validator · backlog_lint · picker · id-minter · evolve_audit · unwrap-prose (AGENTS.md)
  • tools/backlog_lint.py (AGENTS.md)
  • npm test && npm run build (AGENTS.md)
  • python3 <bamr87/bamr87>/tools/governance_lint.py check . (feature catalog ↔ PRD, constitution, amendments)

8. Amendments

This constitution changes only through a numbered record in docs/amendments/ (NNNN-kebab-slug.md, copied from 0000-template.md):

  1. Propose — open a PR that adds the record (Status: proposed) and the edit to this file it describes. Name what it affects: constitution sections, PRD requirement ids, feature ids.
  2. Review — the maintainer reviews; an agent never approves or merges its own amendment.
  3. Ratify — merging the PR ratifies it. The record says Status: ratified and Ratified by: the PR. A rejected or withdrawn PR keeps its record with that status; numbers are never reused.
  4. Supersede — a later amendment may replace an earlier one; mark the old record superseded by NNNN.

Records are append-only history: fix a ratified rule with a new amendment, never by editing an old record. 0001 ratifies this document.

Merge authority and the review gate

(amendment agent-merge-review-gate, numbered at merge; conforms to hub constitution § 12, bamr87/bamr87 amendment. The hub's text governs.)

  1. Mergeable PR. A PR is mergeable only when all of these are true, rechecked against live state just before the merge: (1) the required CI checks are green; (2) the required reviews are satisfied; (3) there are no merge conflicts; (4) the review gate has passed wherever human review is required.
  2. An AI agent may merge a PR only when it is mergeable; otherwise it waits. Merges use a merge commit, never squash or rebase, never --admin, and never a force-push.
  3. Review gate. The gated categories are those in hub § 12: amendments and this constitution; secrets, budgets and billing; settings, branch protection and permissions; security-sensitive changes; deploys and the maintainer's machines; non-trivial conflicts; destructive changes; and anything labelled agent:hold, blocked or needs-amr. A gated PR gets the needs-amr label and the Fleet status Needs Amr. An agent never merges it, and amendments are ratified only by the maintainer merging.