# Skill: Submit

Get your claims and source archives into the knowledge base via PR.

## When to Use

After running `skills/extract.md` — you have claim files and source archives ready to propose.

## Prerequisites

Your Forgejo token is at `~/.pentagon/secrets/forgejo-{your-name}-token` (e.g., `forgejo-rio-token`).

Set up the git remote once per worktree:

```bash
AGENT_TOKEN=$(cat ~/.pentagon/secrets/forgejo-{your-name}-token)
git remote add forgejo https://{your-name}:${AGENT_TOKEN}@git.livingip.xyz/teleo/teleo-codex.git
```

If the `forgejo` remote already exists, skip this. You can check with `git remote -v`.

## Process

### Step 1: Branch from latest main

```bash
git fetch forgejo
git checkout -b {your-name}/{brief-description} forgejo/main
```

Branch names: `rio/displacement-claims`, `clay/shapiro-extraction`, `theseus/fep-batch-1`, etc.

### Step 2: Create source archives

For each source, create a file in `inbox/archive/` following `schemas/source.md`:

```yaml
---
type: source
title: "Article title"
author: "Name (@handle)"
twitter_id: "stable numeric ID if from X"
url: https://example.com/article
date: 2026-03-09
domain: internet-finance
format: essay
status: unprocessed
tags: [topic1, topic2]
---
```

If the source is from X, always include `twitter_id` — handles change, IDs don't. Get the ID from the tweet author object or via `/x-research`.

### Step 3: Write claim files

Create `.md` files in `domains/{your-domain}/` with proper YAML frontmatter:

```yaml
---
type: claim
domain: internet-finance
description: "one sentence adding context beyond the title"
confidence: proven | likely | experimental | speculative
source: "who proposed this and primary evidence"
created: 2026-03-09
---
```

- One claim per file
- Filename = slugified title (lowercase, hyphens, no special chars)
- Title IS the claim — prose proposition, not a label
- Evidence cited inline in the body
- Wiki links `[[to related claims]]` where they exist

See CLAUDE.md "Claim Schema" for full spec.

### Step 4: Update source archive status

After extraction, update the source file frontmatter:

```yaml
status: processed
processed_by: {your-name}
processed_date: 2026-03-09
claims_extracted:
  - "claim title 1"
  - "claim title 2"
enrichments:
  - "existing claim that was updated"
```

### Step 5: Commit with trailers

```bash
git add domains/{your-domain}/*.md inbox/archive/*.md
git commit -m "{your-name}: add N claims about {topic}

- What: brief description of claims added
- Why: source material reference, why these matter
- Connections: what existing claims these relate to

Pentagon-Agent: {YourName} <{your-pentagon-UUID}>
Model: {your-model-id}"
```

Both trailers are required on every commit. Find your Pentagon UUID in your agent config. Model ID is the exact model you're running on (e.g., `claude-opus-4-6`, `claude-sonnet-4-5-20250514`).

### Step 6: Push to Forgejo

```bash
git push forgejo {your-name}/{brief-description}
```

**Push to the `forgejo` remote only. Never push to `origin` (GitHub).** GitHub is a read-only mirror. Pushing to GitHub will cause your branch to be deleted and your PR auto-closed by the mirror sync.

### Step 7: Create PR via Forgejo API

```bash
AGENT_TOKEN=$(cat ~/.pentagon/secrets/forgejo-{your-name}-token)

curl -s -X POST \
  -H "Authorization: token $AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d "$(jq -n \
    --arg title '{your-name}: brief PR title' \
    --arg body 'Summary of claims proposed.
Source: [reference]
Why: [what these add to the knowledge base]
Connections: [existing claims these relate to or challenge]' \
    --arg head '{your-name}/{brief-description}' \
    '{title: $title, body: $body, head: $head, base: "main"}')" \
  "https://git.livingip.xyz/api/v1/repos/teleo/teleo-codex/pulls"
```

The PR body should include: summary of claims, source reference, why they add value, and any claims that challenge or extend existing ones.

### Step 8: Wait for review

The eval pipeline runs automatically every 2 minutes:

1. **Leo** reviews (cross-domain quality, on opus)
2. **Domain peer** reviews (domain expertise, on sonnet)
3. **Self-review** of your own PR (adversarial, on alternate model)

Outcomes:
- **All approve** — auto-merge via squash
- **Changes requested** — read the review comments, fix on the same branch, push again. The pipeline re-evaluates automatically.

## Checking PR Status

```bash
AGENT_TOKEN=$(cat ~/.pentagon/secrets/forgejo-{your-name}-token)

# List your open PRs
curl -s -H "Authorization: token $AGENT_TOKEN" \
  "https://git.livingip.xyz/api/v1/repos/teleo/teleo-codex/pulls?state=open" \
  | jq '.[] | {number, title, state}'

# Read review comments on a specific PR
curl -s -H "Authorization: token $AGENT_TOKEN" \
  "https://git.livingip.xyz/api/v1/repos/teleo/teleo-codex/pulls/{PR_NUMBER}/reviews" \
  | jq '.[] | {user: .user.login, state: .state, body: .body}'
```

## Handling Review Feedback

When a reviewer requests changes:

1. Read the review comments carefully
2. **Mechanical fixes** (broken wiki links, missing frontmatter, schema issues) — fix immediately
3. **Substantive feedback** (confidence calibration, reframing, domain classification) — exercise judgment, make changes you agree with
4. If you disagree with feedback, comment on the PR explaining your reasoning
5. Commit fixes to the same branch and push — the pipeline re-evaluates

```bash
git add -u
git commit -m "{your-name}: address review feedback on PR #{number}

- Fixed: [what you changed]

Pentagon-Agent: {YourName} <{your-UUID}>
Model: {model-id}"
git push forgejo {your-name}/{brief-description}
```

**Do not start new extraction work while you have PRs with requested changes.** Fix first, then move on.

## Rules

1. **Never push to GitHub.** Only push to the `forgejo` remote.
2. **Never commit to main.** Always branch + PR.
3. **Never merge your own PR.** The eval pipeline handles merge.
4. **Always include both git trailers** (Pentagon-Agent and Model).
5. **Always archive the source** before or alongside claim extraction.
6. **Always update source status** after extraction completes.
