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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 21 additions & 3 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,22 @@ if [ ${#hygiene_debris[@]} -gt 0 ] || [ ${#hygiene_unknown[@]} -gt 0 ]; then
exit 1
fi

# ── Develop-base Runtime Guard (F257 #5 / dev-af6d4e28): develop_base = 白名单-only ──
# develop_base 是运行基线分支:本地直接 commit 仅允许 §14 + local override
# 穷举的五项共享状态文件(具体清单由独立脚本维护)。
# 代码改动一律 feature worktree → PR → GitHub merge → 运行实例 pull(LI-004 结构强制)。
# 白名单主体在独立脚本里(可单测);develop_base 上脚本缺失 = 保护失效 → fail-closed。
if [ "$BRANCH" = "develop_base" ]; then
DB_GUARD="$REPO_ROOT/scripts/check-develop-base-allowlist.sh"
if [ ! -f "$DB_GUARD" ]; then
echo "🚫 DEVELOP-BASE GUARD: allowlist script missing ($DB_GUARD) — fail-closed." >&2
exit 1
fi
if ! git diff --cached --name-only | bash "$DB_GUARD" "$BRANCH"; then
exit 1
fi
fi

# ── Partial Commit Guard: pre-commit Biome scans the working tree, not the index ──
STAGED_FILES="$(git diff --cached --name-only || true)"
UNSTAGED_FILES="$(git diff --name-only || true)"
Expand Down Expand Up @@ -181,9 +197,11 @@ if [ -n "$BRAND_PROTECTED_STAGED" ]; then
fi
fi

# main 分支:Brand Guard 已在上面对所有分支生效;仅跳过 Shared State Guard
# (共享状态文件 SHOULD be committed on main)
if [ "$BRANCH" = "main" ]; then
# main / develop_base:Brand Guard 已在上面对所有分支生效;跳过 Shared State Guard
# — main: 共享状态文件 SHOULD be committed on main
# — develop_base: 由 Develop-base Runtime Guard(上方)全权守护,不二次拦截
# (sol R2 P1-3:旧 guard 会二次拒绝已放行的 cat-config.json)
if [ "$BRANCH" = "main" ] || [ "$BRANCH" = "develop_base" ]; then
exit 0
fi

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,6 @@ generated/capability-wakeup/
packages/api/test/__b1_parent_a__/
.claude/skills/organize-threads
.claude/skills/thread-orchestration

# F257 runtime eval snapshots (written by snapshot provider at runtime)
docs/harness-feedback/run-snapshots/
13 changes: 4 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
# Clowder AI — OpenAI/Codex Agent Guide
# Clowder AI — Agent Guide

## Identity
You are the Maine Coon cat (Codex/GPT), the code reviewer and security specialist of this Clowder AI instance.
Your identity, role, and personality are provided by Cat Cafe at runtime.
This file contains shared governance rules that apply to all team members.

## Safety Rules (Iron Laws)
1. **Data Storage Sanctuary** — Never delete/flush your Redis database, SQLite files, or any persistent storage.
2. **Process Self-Preservation** — Never kill your parent process or modify your startup config.
3. **Config Immutability** — Never modify runtime config files. Config changes require human action.
4. **Network Boundary** — Never access localhost ports that don't belong to your service.

## Your Role
- Code review with clear stance on every finding (no "fix or not, up to you")
- Security analysis and vulnerability detection
- Test coverage verification
- Cross-model review (you review Claude's code, Claude reviews yours)

## Review Protocol
- Same individual cannot review their own code
- Cross-family review preferred (Maine Coon reviews Ragdoll's code)
- Cross-family review preferred
- Every finding must have a clear severity: P1 (blocking) / P2 (should fix) / P3 (nice to have)

## Truth Sources
Expand Down
6 changes: 6 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ See `cat-cafe-skills/` for the full skill-based workflow:
- No `any` types
- Biome: `pnpm check` / `pnpm check:fix`
- Types: `pnpm lint`

## Cost Discipline
- **Agent demotion**: before spawning Agent/Explore/Workflow, ask "can a single grep/Read do this?" If yes → use Bash/Read directly
- **Model tiering**: simple subagent tasks (search, summarize, format) → `model: 'haiku'`
- **Debug strategy gate**: 1 round of static analysis with no root cause → switch to instrument → reproduce → observe. No multi-session static exhaustion
- Full rules: `cat-cafe-skills/refs/shared-rules.md` §20
18 changes: 9 additions & 9 deletions GEMINI.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Clowder AI — Gemini Agent Guide
# Clowder AI — Agent Guide

## Identity
You are the Siamese cat (Gemini), the visual designer and creative thinker of this Clowder AI instance.
Your identity, role, and personality are provided by Cat Cafe at runtime.
This file contains shared governance rules that apply to all team members.

## Safety Rules (Iron Laws)
1. **Data Storage Sanctuary** — Never delete/flush persistent storage.
2. **Process Self-Preservation** — Never kill your parent process.
3. **Config Immutability** — Never modify runtime config files.
4. **Network Boundary** — Never access ports that don't belong to your service.

## Your Role
- Visual design and UX consultation
- Creative ideation and brainstorming
- Design system maintenance
- Breaking conventional thinking patterns

## Important Constraints
## Gemini-Specific Constraints
- Focus on design consultation, not code implementation
- Always validate suggestions against the project's design system
- Provide visual references when suggesting changes

## Review Protocol
- Same individual cannot review their own code
- Cross-family review preferred
- Every finding must have a clear severity: P1 (blocking) / P2 (should fix) / P3 (nice to have)
5 changes: 5 additions & 0 deletions assets/prompt-hooks/c1-mcp-回调/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ inputs:
- mcpAvailable
- mcpCallbackContent

# Variable metadata (canonical source for Console editor)
variables:
- name: EXAMPLE_HANDLE
description: 句柄示例
placeholder: ""
# Override constraints
disableable: true

Expand Down
14 changes: 14 additions & 0 deletions assets/prompt-hooks/d1-身份锚定/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ resolver: D1IdentityAnchorResolver
inputs:
- identity

# Variable metadata (canonical source for Console editor)
variables:
- name: DISPLAY_NAME
description: 当前猫的显示名
placeholder: ""
- name: NICKNAME_PART
description: 当前猫昵称后缀(如 /小狸)
placeholder: ""
- name: CAT_ID
description: 当前猫的稳定 ID
placeholder: ""
- name: RUNTIME_MODEL
description: 当前运行模型
placeholder: ""
# Override constraints
disableable: false

Expand Down
5 changes: 5 additions & 0 deletions assets/prompt-hooks/d11-skill-触发/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ resolver: D11SkillTriggerResolver
inputs:
- skillTrigger

# Variable metadata (canonical source for Console editor)
variables:
- name: SKILL_NAME
description: 被触发 skill 的名称
placeholder: ""
# Override constraints
disableable: true

Expand Down
5 changes: 5 additions & 0 deletions assets/prompt-hooks/d12-活跃参与者/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ resolver: D12ActiveParticipantsResolver
inputs:
- activeParticipants

# Variable metadata (canonical source for Console editor)
variables:
- name: ACTIVE_LABEL
description: 当前活跃参与者标签
placeholder: ""
# Override constraints
disableable: true

Expand Down
5 changes: 5 additions & 0 deletions assets/prompt-hooks/d13-路由策略/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ resolver: D13RoutingPolicyResolver
inputs:
- routingPolicy

# Variable metadata (canonical source for Console editor)
variables:
- name: ROUTING_PARTS
description: 路由策略组成部分
placeholder: ""
# Override constraints
disableable: true

Expand Down
14 changes: 14 additions & 0 deletions assets/prompt-hooks/d14-sop-阶段提示/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ resolver: D14SopStageResolver
inputs:
- sopStageHint

# Variable metadata (canonical source for Console editor)
variables:
- name: FEATURE_ID
description: 功能 ID
placeholder: ""
- name: STAGE
description: SOP 阶段
placeholder: ""
- name: SUGGESTED_SKILL
description: 建议加载的 skill
placeholder: ""
- name: SOURCE_PART
description: 来源信息片段
placeholder: ""
# Override constraints
disableable: true

Expand Down
17 changes: 17 additions & 0 deletions assets/prompt-hooks/d16-bootcamp-模式/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ resolver: D16BootcampResolver
inputs:
- bootcampMode

# Variable metadata (canonical source for Console editor)
variables:
- name: THREAD_PART
description: thread 信息片段
placeholder: ""
- name: PHASE
description: 当前阶段
placeholder: ""
- name: LEAD_CAT_PART
description: 主导猫信息片段
placeholder: ""
- name: TASK_PART
description: 任务信息片段
placeholder: ""
- name: MEMBERS_PART
description: 成员信息片段
placeholder: ""
# Override constraints
disableable: true

Expand Down
5 changes: 5 additions & 0 deletions assets/prompt-hooks/d17-引导候选/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ resolver: D17GuideCandidateResolver
inputs:
- guideCandidate

# Variable metadata (canonical source for Console editor)
variables:
- name: GUIDE_PROMPT_LINES
description: 引导候选提示文本行
placeholder: ""
# Override constraints
disableable: true

Expand Down
29 changes: 29 additions & 0 deletions assets/prompt-hooks/d18-世界上下文/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,35 @@ resolver: D18WorldContextResolver
inputs:
- worldContext

# Variable metadata (canonical source for Console editor)
variables:
- name: WORLD_NAME
description: 世界名称
placeholder: ""
- name: WORLD_STATUS
description: 世界状态
placeholder: ""
- name: CONSTITUTION_LINE
description: 宪法声明行
placeholder: ""
- name: SCENE_NAME
description: 场景名称
placeholder: ""
- name: SCENE_STATUS
description: 场景状态
placeholder: ""
- name: CHARACTERS_BLOCK
description: 角色信息块
placeholder: ""
- name: CANON_BLOCK
description: 正典信息块
placeholder: ""
- name: RECENT_EVENTS_BLOCK
description: 近期事件块
placeholder: ""
- name: CARE_HINT_LINE
description: 关怀提示行
placeholder: ""
# Override constraints
disableable: true

Expand Down
5 changes: 5 additions & 0 deletions assets/prompt-hooks/d19-宪法知识/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ resolver: D19ConstitutionalResolver
inputs:
- constitutionalKnowledge

# Variable metadata (canonical source for Console editor)
variables:
- name: CONSTITUTIONAL_DOCS
description: 宪法知识文档块
placeholder: ""
# Override constraints
disableable: false

Expand Down
8 changes: 8 additions & 0 deletions assets/prompt-hooks/d2-直接消息来源/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ resolver: D2DirectMsgResolver
inputs:
- directMessageSource

# Variable metadata (canonical source for Console editor)
variables:
- name: FROM_LABEL
description: 发送方标签
placeholder: ""
- name: FROM_MODEL
description: 消息发送方模型
placeholder: ""
# Override constraints
disableable: true

Expand Down
5 changes: 5 additions & 0 deletions assets/prompt-hooks/d20-信号文章/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ resolver: D20SignalArticlesResolver
inputs:
- signalArticles

# Variable metadata (canonical source for Console editor)
variables:
- name: SIGNAL_ARTICLES_BLOCK
description: 信号文章块
placeholder: ""
# Override constraints
disableable: true

Expand Down
5 changes: 5 additions & 0 deletions assets/prompt-hooks/d21-决策树/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ resolver: D21DecisionTreeResolver
inputs:
- handoffDecisionTree

# Variable metadata (canonical source for Console editor)
variables:
- name: CC_MENTION
description: co-creator mention pattern (e.g. @co-creator)
placeholder: ""
# Override constraints
disableable: false

Expand Down
14 changes: 14 additions & 0 deletions assets/prompt-hooks/d3-同族警告/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ resolver: D3SameBreedResolver
inputs:
- sameBreedWarning

# Variable metadata (canonical source for Console editor)
variables:
- name: FROM_VARIANT
description: 消息发送方变体名
placeholder: ""
- name: FROM_MODEL
description: 消息发送方模型
placeholder: ""
- name: SELF_VARIANT
description: 当前猫变体名
placeholder: ""
- name: SELF_MODEL
description: 当前猫模型
placeholder: ""
# Override constraints
disableable: true

Expand Down
14 changes: 14 additions & 0 deletions assets/prompt-hooks/d4-跨-thread-回复/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ resolver: D4CrossThreadResolver
inputs:
- crossThreadReplyHint

# Variable metadata (canonical source for Console editor)
variables:
- name: SOURCE_THREAD
description: 来源 thread ID
placeholder: ""
- name: SENDER_CAT
description: 发送猫 ID
placeholder: ""
- name: EFFECT_LABEL
description: 跨线程回复效果标签
placeholder: ""
- name: CONSTRAINT_TEXT
description: 跨线程约束文本
placeholder: ""
# Override constraints
disableable: true

Expand Down
8 changes: 8 additions & 0 deletions assets/prompt-hooks/d5-乒乓球警告/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ resolver: D5PingPongResolver
inputs:
- pingPongWarning

# Variable metadata (canonical source for Console editor)
variables:
- name: OTHER_LABEL
description: 对方标签
placeholder: ""
- name: STREAK_COUNT
description: 连续互相 @ 轮数
placeholder: ""
# Override constraints
disableable: true

Expand Down
5 changes: 5 additions & 0 deletions assets/prompt-hooks/d6-队友上下文/hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ resolver: D6TeammatesContextResolver
inputs:
- teammatesContext

# Variable metadata (canonical source for Console editor)
variables:
- name: TEAMMATES_LIST
description: 队友列表
placeholder: ""
# Override constraints
disableable: true

Expand Down
Loading