Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 30 additions & 0 deletions .agent/rules/60_agent_loop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Agent Loop Rule (Completion > Vibes)
This workspace uses an agent loop for any non-trivial task:

**LOOP = Attempt → Verify → Record → Reflect → Attempt again** until success criteria passes.
The agent loop is not "try harder." It's **external verification gates** that prevent early exits.

## When Agent Loop is REQUIRED
- Anything touching: auth / passkeys / tx submission / relayers / money movement
- “Works locally but fails in preview/prod”
- Bugfixes with intermittent behavior
- Large ambiguity / unknown root cause

## The ONLY acceptable stop condition
You may stop *only* when the task’s **Success Criteria** are satisfied by validators:
- build passes
- tests pass (or explicit manual checklist passes)
- repro no longer reproduces on target env (preview/prod if relevant)
- regressions checklist is clean

## Hard stop safety rails (anti-chaos)
- Max iterations: 8 (default)
- Max wall time: 90 minutes per loop session
- If iteration 3 repeats the same failure: stop and switch to **Triage workflow**.
- No secrets in artifacts. Never paste tokens/Auth Tokens in logs.

## Mandatory artifacts each iteration
Write/update:
- .agent/_reports/AGENT_PROGRESS.md (what failed, what changed, what verified)
- .agent/_reports/AGENT_DIFFSTAT.txt (git diff --stat)
- If tx/auth: .agent/_reports/AGENT_RISK.md (redacted risks + checks)
82 changes: 82 additions & 0 deletions .agent/scripts/agent-loop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/usr/bin/env bash
set -euo pipefail

# Generic agent loop driver. Configure via env vars so it works with Antigravity, Claude Code, etc.
# You provide:
# PROMPT_FILE: file containing task prompt for the agent (required)
# AGENT_CMD: command to run the agent (required) e.g. "antigravity run" or "claude" etc
# VALIDATE_CMD: command(s) to validate success (required) e.g. "pnpm test && pnpm build"
# Optional:
# MAX_ITERS (default 8)
# REPORT_DIR (default .agent/_reports)

PROMPT_FILE="${PROMPT_FILE:-}"
AGENT_CMD="${AGENT_CMD:-}"
VALIDATE_CMD="${VALIDATE_CMD:-}"
MAX_ITERS="${MAX_ITERS:-8}"
REPORT_DIR="${REPORT_DIR:-.agent/_reports}"

if [[ -z "$PROMPT_FILE" || -z "$AGENT_CMD" || -z "$VALIDATE_CMD" ]]; then
echo "Missing required env vars."
echo "Example:"
echo " PROMPT_FILE=.agent/_reports/TASK_PROMPT.md \\"
echo " AGENT_CMD='antigravity run' \\"
echo " VALIDATE_CMD='pnpm -s test && pnpm -s build' \\"
echo " bash .agent/scripts/agent-loop.sh"
exit 1
fi

mkdir -p "$REPORT_DIR"
PROGRESS="$REPORT_DIR/AGENT_PROGRESS.md"
DIFFSTAT="$REPORT_DIR/AGENT_DIFFSTAT.txt"

if [[ ! -f "$PROGRESS" ]]; then
cat > "$PROGRESS" <<EOF
# AGENT PROGRESS LOG
Start: $(date -u +"%Y-%m-%dT%H:%M:%SZ")

## Success Criteria (EDIT THIS)
- [ ] <criterion 1>
- [ ] <criterion 2>

## Validators
- VALIDATE_CMD: $VALIDATE_CMD
EOF
fi

echo "" >> "$PROGRESS"
echo "----" >> "$PROGRESS"
echo "Loop session: $(date -u +"%Y-%m-%dT%H:%M:%SZ") max_iters=$MAX_ITERS" >> "$PROGRESS"

for ((i=1; i<=MAX_ITERS; i++)); do
echo "" | tee -a "$PROGRESS"
echo "## Iteration $i" | tee -a "$PROGRESS"
echo "- time: $(date -u +"%Y-%m-%dT%H:%M:%SZ")" | tee -a "$PROGRESS"

echo "- git status:" >> "$PROGRESS"
git status --porcelain >> "$PROGRESS" || true

echo "- running agent: $AGENT_CMD < $PROMPT_FILE" | tee -a "$PROGRESS"
# NOTE: agent tools differ; this assumes the agent can read the prompt file content.
# If your agent requires different invocation, wrap AGENT_CMD in a shell script.
bash -lc "$AGENT_CMD \"$(cat "$PROMPT_FILE")\"" >> "$PROGRESS" 2>&1 || true

echo "- diffstat:" | tee -a "$PROGRESS"
git diff --stat > "$DIFFSTAT" || true
cat "$DIFFSTAT" >> "$PROGRESS"

echo "- running validators: $VALIDATE_CMD" | tee -a "$PROGRESS"
if bash -lc "$VALIDATE_CMD" >> "$PROGRESS" 2>&1; then
echo "- ✅ validators passed" | tee -a "$PROGRESS"
echo "" | tee -a "$PROGRESS"
echo "STOP CONDITION REACHED: validators passed. Verify success criteria + repro manually if needed." | tee -a "$PROGRESS"
exit 0
else
echo "- ❌ validators failed" | tee -a "$PROGRESS"
echo "- next: update hypothesis in $PROGRESS, adjust prompt, and continue" | tee -a "$PROGRESS"
fi
done

echo "" | tee -a "$PROGRESS"
echo "HARD STOP: max iterations reached ($MAX_ITERS). Switch to /triage." | tee -a "$PROGRESS"
exit 2
32 changes: 32 additions & 0 deletions .agent/skills/agent-loop/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: agent-loop
description: Enforces verified completion using an attempt→verify→iterate loop with explicit success criteria, validators, artifacts, and safety limits. Use for non-trivial bugs, SSR issues, auth/tx flow, and "works locally but not in preview/prod."
---

# Agent Loop Skill (Verified Completion)
The agent loop is a persistence + verification pattern: the loop is the hero, not the model.

## When to use
- Any high-risk area (passkeys/tx/relayer)
- Any deployment parity bug
- Any bug that is intermittent or hard to reproduce

## Required inputs
- Success criteria (binary, testable)
- Validators (commands/checklist)
- Max iteration/time budget

## How to run
1) **Audit Skills**: Check all available scripts and `SKILL.md` files for relevance to the current topic. Read them BEFORE planning.
2) **Define Success**: Write success criteria + validators at top of .agent/_reports/AGENT_PROGRESS.md
3) Run /agent-loop workflow steps.
4) Every iteration must:
- change one thing
- run validators
- record results
5) Stop only on verified pass.

## Safety
- Never include secrets in artifacts.
- Prefer tiny diffs.
- If repeated failure after 3 loops, switch to /triage.
6 changes: 3 additions & 3 deletions .agent/skills/agent-onboarding/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ description: Master skill for new agents joining the repo. Teaches how to read t
- Read `AGENTS.md` in the root.
- Read `docs/REPO_MAP.md` to understand the lay of the land.

## 2. Check the Ralph Loop
- Read `scripts/ralph/prd.json` to see what is PENDING/FAILING.
- Read `scripts/ralph/progress.txt` to see what has been recently done.
## 2. Check the Agent Loop
- Read `scripts/agent/prd.json` to see what is PENDING/FAILING.
- Read `scripts/agent/progress.txt` to see what has been recently done.

## 3. Work Habits
- **One Priority at a Time**: Pick the highest failing priority from PRD.
Expand Down
2 changes: 1 addition & 1 deletion .agent/skills/project-standards/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ PUBLIC_SOROSWAP_API_KEY → Soroswap API access
## 8. Testing & Deployment 🚀
- **Build**: `pnpm build`
- **Lint**: `npx astro check` & `npx svelte-check`
- **Verification**: Run the **Ralph Loop** pattern for any high-risk changes (Passkeys, TX flows).
- **Verification**: Run the **Agent Loop** pattern for any high-risk changes (Passkeys, TX flows).
- **Build**: `pnpm build`
- **Local Dev**: `pnpm dev` (requires HTTPS for passkeys)
- **Deployment**: PR to `kalepail/smol-fe:noot` branch for noot.smol.xyz
Expand Down
43 changes: 43 additions & 0 deletions .agent/workflows/agent-loop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# /agent-loop — Verified Completion Workflow
Agent Loop = enforce completion via verification, not confidence.

## Inputs (must be explicit)
1) Repro steps (including env: local / preview / prod)
2) Success criteria (pass/fail statements)
3) Validators (commands or checklist)

## Setup
Create/ensure:
- .agent/_reports/ exists
- A minimal "validator set" exists:
- build command
- tests command OR manual checklist

## Loop cycle (repeat)
1) ATTEMPT
- Make the smallest change that could fix the failure.
2) VERIFY (external, objective)
- Run validators (build/tests/checklist).
- Re-run repro steps.
3) RECORD
- Append iteration log to .agent/_reports/AGENT_PROGRESS.md:
- iteration number
- failure observed
- hypothesis
- change made
- verification results
4) REFLECT (short)
- If fixed: stop (only if success criteria fully met)
- If not fixed: update hypothesis and continue

## Exit criteria
Stop only when:
- all success criteria are met
- validators pass
- rollback plan noted (if risky)

## If stuck
- Switch to /triage and produce:
- 3 competing hypotheses
- top 2 experiments (minimal diffs)
- what evidence would falsify each
23 changes: 23 additions & 0 deletions .devcontainer/the-farm-noir/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "the-farm-noir",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "22"
},
"ghcr.io/devcontainers/features/rust:1": {
"version": "stable"
},
"ghcr.io/aztecprotocol/devcontainer-features/noir:1": {},
"ghcr.io/aztecprotocol/devcontainer-features/barretenberg:1": {}
},
"customizations": {
"vscode": {
"extensions": [
"noir-lang.vscode-noir"
]
}
},
"postCreateCommand": "bash -lc 'sudo apt-get update && sudo apt-get install -y jq git bash && noirup && bbup && nargo --version && bb --version'",
"remoteUser": "vscode"
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=lf
6 changes: 3 additions & 3 deletions .github/workflows/labs-scope-guard.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ralph Scope Guard
name: Labs Scope Guard

on:
pull_request:
Expand All @@ -11,7 +11,7 @@ jobs:
check-allowlist:
if: >-
github.event_name == 'push' ||
(github.event_name == 'pull_request' && (startsWith(github.head_ref, 'labs/') || startsWith(github.head_ref, 'ralph/')))
(github.event_name == 'pull_request' && (startsWith(github.head_ref, 'labs/') || startsWith(github.head_ref, 'agent/')))
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -23,7 +23,7 @@ jobs:
run: |
# Define allowlist patterns (must match PRD)
# Note: Using grep for matching. Adjust regex as needed.
ALLOWLIST="^src/pages/labs/|^src/components/labs/|^src/lib/labs/|^public/labs/|^scripts/ralph/|^\.github/workflows/labs-scope-guard\.yml|^src/styles/labs/|^\.agent/"
ALLOWLIST="^src/pages/labs/|^src/components/labs/|^src/lib/labs/|^public/labs/|^scripts/agent/|^\.github/workflows/labs-scope-guard\.yml|^src/styles/labs/|^\.agent/"

# Get changed files against the base branch (usually main or the target of PR)
if [ "${{ github.event_name }}" == "pull_request" ]; then
Expand Down
29 changes: 28 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,16 @@ pnpm-debug.log*

.wrangler/

# Rust build artifacts
**/target/

# ZK build outputs
zk/**/build/
zk/circom-tier/artifacts/tier_proof.wasm

# Large data files (exceed Cloudflare 25 MiB limit)
data/all-smols.json!.agent/
data/all-smols.json
!.agent/

test-results/
playwright-report/
Expand All @@ -37,6 +45,25 @@ tldts-results*.txt
usernames.txt
verification-check.txt
check-output.txt
*.xdr.txt
upload_cost.txt
upload_farm_attestations.xdr.txt
install_farm_attestations.xdr.txt
gateway_logs.txt
openclaw_help.txt
openclaw_full_help.txt
models.txt
deployed-*-id.txt

# RISC0 local build cache
zk/**/.risc0_work/

.agent/_reports/
.tmp/

browser_profile_v2/
scripts/mixea_browser_profile_v2/
scripts/mixea_browser_profile/
scripts/mixea_browser_data/
scripts/mixea_browser_data_bak/
scripts/dk_browser_data/
31 changes: 14 additions & 17 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
# Vibe Code of Ethics
# Principles of High-Velocity Development

## Principles
- **Speed**: We move fast. We use AI. We accept that things will break.
- **Autonomy**: You are smart. You have tools. You don't need permission to have a good idea.
- **Kindness**: High velocity requires high trust. Trust requires kindness.
## Principles
1. **Velocity**: We prioritize speed and iteration. We use AI tools to accelerate building. We accept that broken code is a temporary state on the way to better code.
2. **Trust**: High velocity requires high autonomy. We trust contributors to make informed decisions using the provided tools and documentation.
3. **Kindness**: Radical autonomy depends on respect and kindness. We are a community of builders, not gatekeepers.

## Collaboration
We don't do committees. We do **syncs**.
- **Remix Culture**: Fork it, improve it, merge it. Go for it.
- **Default to Open**: Work in public. Share your half-baked ideas so we can bake them together.
## 🛠️ Collaboration
- **No Committees**: We move through async consensus. We value "Remix Culture"—if you can make it better, fork it, improve it, and show us.
- **Default to Open**: We design and discuss in the open. Sharing incomplete work early leads to better final results.
- **Bikeshed-Free Zone**: We do not argue over trivialities. Focus on the core user experience and the integrity of the blockchain/ZK layers.

## Anti-Patterns
- Gatekeeping.
- Bikeshedding (arguing over trivial details).
- Being a buzzkill.
## 🚫 Anti-Patterns
- Gatekeeping or credentialism.
- Arguing over default formatting.
- Disrespecting the "Fail-Closed" documentation policy.

Let's build.

## Addendum
This code of ethics was vibe coded. If the vibe changes, we'll vibe a new vibe. Who's askin'? Fuggadabout it, I'm walkin' here!
Let's build. 👋
Loading