feat: add linked project field to genome registry

This commit is contained in:
Matteo Cherubini 2026-06-03 12:28:18 +02:00
parent ea9283637b
commit ee4f5beacf
5 changed files with 44 additions and 19 deletions

View file

@ -16,17 +16,21 @@ render_template() {
local content local content
content=$(<"$template_file") content=$(<"$template_file")
# Defaults (:-) so master-repo templates render even when GENOME_* are unset
# (scaffold_master runs before any genome; set -u would otherwise abort here).
local genome_name_upper local genome_name_upper
genome_name_upper=$(tr '[:lower:]' '[:upper:]' <<< "${GENOME_NAME}") genome_name_upper=$(tr '[:lower:]' '[:upper:]' <<< "${GENOME_NAME:-}")
# Placeholder replacement # Placeholder replacement
content="${content//\{\{GENOME_NAME\}\}/${GENOME_NAME}}" content="${content//\{\{GENOME_NAME\}\}/${GENOME_NAME:-}}"
content="${content//\{\{GENOME_NAME_UPPER\}\}/${genome_name_upper}}" content="${content//\{\{GENOME_NAME_UPPER\}\}/${genome_name_upper}}"
content="${content//\{\{GENOME_DESC\}\}/${GENOME_DESC}}" content="${content//\{\{GENOME_DESC\}\}/${GENOME_DESC:-}}"
content="${content//\{\{FORGEJO_URL\}\}/${FORGEJO_URL}}" content="${content//\{\{FORGEJO_URL\}\}/${FORGEJO_URL:-}}"
content="${content//\{\{FORGEJO_USER\}\}/${FORGEJO_USER}}" content="${content//\{\{FORGEJO_USER\}\}/${FORGEJO_USER:-}}"
content="${content//\{\{VAULTWARDEN_URL\}\}/${VAULTWARDEN_URL}}" content="${content//\{\{VAULTWARDEN_URL\}\}/${VAULTWARDEN_URL:-}}"
content="${content//\{\{MASTER_REPO\}\}/${MASTER_REPO}}" content="${content//\{\{MASTER_REPO\}\}/${MASTER_REPO:-}}"
# linked project reference (optional) — empty registry field renders as 'none'
content="${content//\{\{LINKED_PROJECT\}\}/${GENOME_LINKED:-none}}"
content="${content//\{\{DATE\}\}/$(date +%Y-%m-%d)}" content="${content//\{\{DATE\}\}/$(date +%Y-%m-%d)}"
mkdir -p "$(dirname "$output_file")" mkdir -p "$(dirname "$output_file")"

View file

@ -19,9 +19,13 @@ LIB_DIR="${PROJECT_ROOT}/lib"
PROVIDERS_DIR="${PROJECT_ROOT}/providers" PROVIDERS_DIR="${PROJECT_ROOT}/providers"
# --- GENOME REGISTRY --- # --- GENOME REGISTRY ---
# Format: "name|description" # Format: "name|description|linked_repo"
# - linked_repo is OPTIONAL. Leave empty (trailing pipe) for knowledge-only genomes.
# - It is an opaque reference rendered verbatim into the genome's AGENTS.md
# (phase-2 project work is parked, so the framework does not act on it yet).
# - Example with a project: "genome-homelab|Keru infrastructure...|keru/homelab-infra"
GENOMES=( GENOMES=(
"genome-dev|Web development, TUI, Angular, software architecture" "genome-dev|Web development, TUI, Angular, software architecture|"
"genome-finance|Personal finance, investments, market analysis" "genome-finance|Personal finance, investments, market analysis|"
"genome-homelab|Keru infrastructure, network configs, architecture logs" "genome-homelab|Keru infrastructure, network configs, architecture logs|"
) )

View file

@ -11,16 +11,18 @@ source "registry.sh"
GENOME_NAME="${1:-}" GENOME_NAME="${1:-}"
GENOME_DESC="${2:-}" GENOME_DESC="${2:-}"
GENOME_LINKED="${3:-}" # optional: linked project repo reference
if [[ -z "$GENOME_NAME" || -z "$GENOME_DESC" ]]; then if [[ -z "$GENOME_NAME" || -z "$GENOME_DESC" ]]; then
error "Missing arguments." error "Missing arguments."
echo "Usage: $0 <genome-name> <description>" echo "Usage: $0 <genome-name> <description> [linked-repo]"
exit 1 exit 1
fi fi
step "Adding New Genome: ${GENOME_NAME}" step "Adding New Genome: ${GENOME_NAME}"
GENOMES=("${GENOME_NAME}|${GENOME_DESC}") # Build a 3-field registry entry (linked_repo may be empty)
GENOMES=("${GENOME_NAME}|${GENOME_DESC}|${GENOME_LINKED}")
source "scripts/setup-genomes.sh" source "scripts/setup-genomes.sh"

View file

@ -19,8 +19,9 @@ source "providers/${PROVIDER}.sh"
step "Processing Genome Registry" step "Processing Genome Registry"
for entry in "${GENOMES[@]}"; do for entry in "${GENOMES[@]}"; do
IFS='|' read -r GENOME_NAME GENOME_DESC <<< "$entry" # 3-field format: name|description|linked_repo (linked_repo optional → may be empty)
export GENOME_NAME GENOME_DESC IFS='|' read -r GENOME_NAME GENOME_DESC GENOME_LINKED <<< "$entry"
export GENOME_NAME GENOME_DESC GENOME_LINKED
info "Processing: ${GENOME_NAME}..." info "Processing: ${GENOME_NAME}..."

View file

@ -14,12 +14,26 @@
--- ---
## Linked Project
| Field | Value |
| --------------- | --------------------- |
| Project repo | `{{LINKED_PROJECT}}` |
| Branch | `main` |
| Allowed tasks | `readme, tests, code` |
| Preferred model | `auto` |
If `Project repo` is `none`, this genome is knowledge-only — phase-2 project work
does not apply. When set, after a wiki PR is **merged**, the orchestrator may trigger
work on this repo within _Allowed tasks_. The agent never touches the project repo
during ingest.
## PRIVATE_CONTEXT ## PRIVATE_CONTEXT
**Default: `disabled`** — never infer; require explicit operator declaration per session. **Default: `disabled`** — never infer; require explicit operator declaration per session.
| State | Behavior | | State | Behavior |
|-------|----------| | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `disabled` | `raw/private/` and `wiki/private/` do not exist. No read, list, grep, or summary on private paths. All outputs safe for collaborators. | | `disabled` | `raw/private/` and `wiki/private/` do not exist. No read, list, grep, or summary on private paths. All outputs safe for collaborators. |
| `enabled` | Operator has confirmed `git-crypt unlock` ran on host. Read/write `private/` authorized. All outputs from private data go exclusively to `wiki/private/`. Prefix every response drawing on private data: `[PRIVATE DATA INCLUDED]`. Never leak private synthesis into public wiki paths. | | `enabled` | Operator has confirmed `git-crypt unlock` ran on host. Read/write `private/` authorized. All outputs from private data go exclusively to `wiki/private/`. Prefix every response drawing on private data: `[PRIVATE DATA INCLUDED]`. Never leak private synthesis into public wiki paths. |