Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Bug report
description: Something in the Cortex control plane is wrong
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Use this for defects in **this** repo (gateway, validator, challenges, deploy).
Security issues: do **not** file here — see [SECURITY.md](../SECURITY.md).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Bug-report security-policy link targets a nonexistent file

../SECURITY.md resolves relative to .github/ISSUE_TEMPLATE/, so the form links to .github/SECURITY.md, which does not exist. The repository policy is at the root as SECURITY.md, leaving reporters unable to reach the security-reporting instructions from this form. Change the target to ../../SECURITY.md or use a repository-root URL.

Artifacts

Markdown link resolution verifier source

  • Review-authored Python verifier that reads the template link and resolves it from the template directory, providing reproducible validation.

Captured Markdown link resolution verifier source

  • Command capture showing the exact review-authored verifier source that was used for the resolution checks.

Broken Markdown link resolution output

  • Executed verifier output for the committed `../SECURITY.md` link; it resolves to absent `.github/SECURITY.md`, confirming the failure.

Root security policy path comparison output

  • Executed same-scope comparison with `../../SECURITY.md`; it resolves to the existing root `SECURITY.md`, demonstrating the required path depth.

View artifacts

T-Rex Ran code and verified through T-Rex

Miner-facing public repos are separate (design-challenge / prism).
- type: textarea
id: summary
attributes:
label: Summary
description: What broke, in one or two sentences.
validations:
required: true
- type: dropdown
id: component
attributes:
label: Component
options:
- gateway
- validator
- design-challenge
- prism-challenge
- deploy / compose
- docs
- other
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: Commit SHA on main, or annotated tag (v*.*.*).
validations:
required: true
- type: textarea
id: repro
attributes:
label: Reproduction
description: Commands you ran (cargo test, local-e2e, curl). No secrets, no exploit payloads.
render: bash
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual
validations:
required: true
- type: checkboxes
id: naming
attributes:
label: Naming
options:
- label: I am not asking to rename BASE_* env vars, /opt/base paths, or base-*-v1 domain tags (see docs/NAMING.md).
required: true
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Miner submit docs
url: https://github.com/CortexLM/cortex/blob/main/docs/external-miner/README.md
about: HTTP submit guides live in docs/external-miner (and the public design-challenge / prism repos).
- name: Security report
url: https://github.com/CortexLM/cortex/security/advisories/new
about: Private vulnerability reporting — do not file a public issue.
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Feature request
description: Propose a change to the Cortex control plane
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Frozen specs (`docs/BUNDLE_SPEC.md`, `docs/DESIGN_CHALLENGE.md`) pin
incentive / scoring / consensus semantics. A feature that changes those
needs an explicit spec + xtask pin update, not a drive-by PR.
- type: textarea
id: problem
attributes:
label: Problem
description: What is hard or missing today?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposal
description: What should Cortex do instead? Name crates/binaries if you know them.
validations:
required: true
- type: dropdown
id: area
attributes:
label: Area
options:
- challenge (design / prism)
- gateway / weights
- validator / chain
- deploy / ops
- docs / branding
- other
validations:
required: true
- type: checkboxes
id: constraints
attributes:
label: Constraints
options:
- label: I have read AGENTS.md and docs/NAMING.md (BASE_* / domain tags stay).
required: true
- label: This is not a request to fork cryptographic domain tags or on-chain names.
required: true
20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Summary

<!-- What does this PR change, and why? -->

## Test plan

- [ ] `cargo test --workspace` (or note the subset and why)
- [ ] `cargo fmt --all -- --check`
- [ ] Clippy / deny / xtask gates if this PR touches crates they cover

## Risk

<!-- Deploy, miner CVM measurement, signature domain, or emission impact. -->

## Naming

I did **not** rename `BASE_*` environment variables, deployed host paths
(`/opt/base`, `/run/base`, …), GHCR `baseintelligence/base` package names, or
`base-*-v1` cryptographic domain tags, unless this PR’s purpose is a coordinated
cutover documented in `docs/NAMING.md`.
26 changes: 24 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# AGENTS.md — BASE control plane
# AGENTS.md — Cortex control plane

Short contract for agents and operators. Prefer linking over restating runbooks.

**Product:** Cortex ([`CortexLM/cortex`](https://github.com/CortexLM/cortex)) — Bittensor subnet control plane for decentralized collaborative AI research via multiple challenges. Naming split (Cortex vs leftover `base` / `BASE_*`): [`docs/NAMING.md`](docs/NAMING.md).

## Monorepo map

| Path | Role |
Expand All @@ -22,6 +24,9 @@ Working branch: **`main`**. Prod ships from annotated tags `v*.*.*` cut on `main
- **Gateway runs on master only** (`--profile master` / `role-master.yml`). Validators point at the master gateway over VPC.
- **`evil-gateway` is test-only** — never enable on prod hosts; assert with `deploy/scripts/assert-evil-gateway-not-default.sh`.
- Platform is **DigitalOcean Droplets + Docker Compose**, not App Platform / DOKS.
- **Do not rename `BASE_*` env vars, deployed paths, or crypto domain tags.** They are measured into miner CVM `app-compose.json` and live on droplets / RTMR3 pin continuity. `CORTEX_*` is an accepted alias in `crates/config` only. See [`docs/NAMING.md`](docs/NAMING.md).
- Frozen specs (`docs/BUNDLE_SPEC.md`, `docs/DESIGN_CHALLENGE.md`) are pinned by xtask. Do not weaken gates or rewrite incentive / scoring / consensus semantics.
- `unsafe_code = forbid`. No `unwrap` / `expect` in non-test code.

## Wallet / key roles (do not conflate)

Expand All @@ -44,7 +49,7 @@ Each live challenge has a **separate public GitHub repo** for miners. Those repo
| Design | [`BaseIntelligence/design-challenge`](https://github.com/BaseIntelligence/design-challenge) | Miner docs + baseline harness |
| Prism | [`BaseIntelligence/prism`](https://github.com/BaseIntelligence/prism) | Miner docs + recipe examples (publish / keep in sync; no control-plane code) |

Monorepo mirror for CI and operators: [`docs/external-miner/`](docs/external-miner/). Frozen contracts stay in this repo (`docs/DESIGN_CHALLENGE.md`, `docs/PRISM.md`, …).
Those public URLs are historical org names; this control-plane repo is `CortexLM/cortex`. Monorepo mirror for CI and operators: [`docs/external-miner/`](docs/external-miner/). Frozen contracts stay in this repo (`docs/DESIGN_CHALLENGE.md`, `docs/PRISM.md`, …).

**When a challenge product or public API changes**, agents **must** update:

Expand All @@ -68,6 +73,22 @@ When verifying a challenge (local-e2e, staging, or focused tests), **simulate a

Local smoke automates the weights seal step via `weights-smoke` inside `./deploy/scripts/local-e2e.sh --smoke` (see [`deploy/AGENTS.md`](deploy/AGENTS.md) and [`docs/runbooks/local-testnet-e2e.md`](docs/runbooks/local-testnet-e2e.md)).

## Commands (local)

```bash
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
cargo deny check
cargo run -p xtask -- loc-cap
cargo run -p xtask -- consensus-lint
cargo run -p xtask -- spec-check
cargo run -p xtask -- design-check
cargo run -p xtask -- external-docs-check
```

Commit subjects: `type(scope): summary` (lowercase, ≤72 chars). Hooks: `./scripts/install-githooks.sh`.

## Required gates (before merge)

Match CI (`.github/workflows/ci.yml`):
Expand All @@ -86,6 +107,7 @@ Match CI (`.github/workflows/ci.yml`):
| Need | Start here |
|------|------------|
| System map / process topology | [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) |
| Cortex vs leftover `base` names | [`docs/NAMING.md`](docs/NAMING.md) |
| Deploy / Compose / DO topology | [`deploy/README.md`](deploy/README.md) + [`deploy/AGENTS.md`](deploy/AGENTS.md) |
| **Local full-subnet test** (master+gateway+validator on testnet 541 + tunnel) | [`docs/runbooks/local-testnet-e2e.md`](docs/runbooks/local-testnet-e2e.md) · [`deploy/AGENTS.md`](deploy/AGENTS.md) § Local testnet E2E · `./deploy/scripts/local-e2e.sh --help` |
| Doc authority vs evidence | [`docs/AGENTS.md`](docs/AGENTS.md) |
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Default owners for BaseIntelligence/base
# Default owners for CortexLM/cortex
* @echobt
131 changes: 131 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by opening a GitHub issue on
[`CortexLM/cortex`](https://github.com/CortexLM/cortex) or by contacting the
maintainers listed in [CODEOWNERS](CODEOWNERS) via GitHub (mention or
maintainer tools). GitHub Discussions are not enabled on this repository.
There is no public conduct inbox.

All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the
[Contributor Covenant](https://www.contributor-covenant.org), version 2.1,
available at
<https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>.

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/inclusion).

For answers to common questions about this code of conduct, see the FAQ at
<https://www.contributor-covenant.org/faq>. Translations are available at
<https://www.contributor-covenant.org/translations>.
Loading
Loading