Compare commits

..

4 commits

10 changed files with 35 additions and 26 deletions

6
.gitignore vendored
View file

@ -1,4 +1,10 @@
# VS Code — only shared workspace settings # VS Code — only shared workspace settings
.vscode/* .vscode/*
!.vscode/
!.vscode/settings.json !.vscode/settings.json
!.vscode/extensions.json !.vscode/extensions.json
# framework
/master-knowledge-genome/
/keys/
*.key

View file

@ -11,7 +11,7 @@ export $(shell grep -v '^[#[:space:]]' globals.env | sed 's/=.*//')
help: help:
@echo "Available commands:" @echo "Available commands:"
@echo " make setup - Full system initialization" @echo " make setup - Full system initialization"
@echo " make add-genome - Register and scaffold a new genome [LINKED=owner/repo]" @echo " make add-genome - Register and scaffold a new genome [LINKED=owner/repo] [CROSS=yes|no]"
@echo " make status - Check submodule and encryption status" @echo " make status - Check submodule and encryption status"
@echo " make lint - Verify schema, privacy flags, and metadata" @echo " make lint - Verify schema, privacy flags, and metadata"
@echo " make verify-structure - Report directory drift across all genomes" @echo " make verify-structure - Report directory drift across all genomes"
@ -30,16 +30,17 @@ setup:
add-genome: add-genome:
@if [ -z "$(NAME)" ] || [ -z "$(DESC)" ]; then \ @if [ -z "$(NAME)" ] || [ -z "$(DESC)" ]; then \
echo "Error: NAME and DESC are required."; \ echo "Error: NAME and DESC are required."; \
echo "Usage: make add-genome NAME=my-genome DESC='My description' [LINKED=owner/project-repo]"; \ echo "Usage: make add-genome NAME=my-genome DESC='My description' [LINKED=owner/project-repo] [CROSS=yes|no]"; \
exit 1; \ exit 1; \
fi fi
@bash scripts/add-genome.sh "$(NAME)" "$(DESC)" "$(LINKED)" @bash scripts/add-genome.sh "$(NAME)" "$(DESC)" "$(LINKED)" "$(or $(CROSS),no)"
status: status:
@[ -d "$(MASTER_REPO)" ] || { echo "Master non trovato. Esegui 'make setup'."; exit 1; }
@echo "--- Master Status ---" @echo "--- Master Status ---"
@git submodule status @cd $(MASTER_REPO) && git submodule status
@echo "--- Encryption Status (per genome) ---" @echo "--- Encryption Status (per genome) ---"
@git submodule foreach 'git-crypt status 2>/dev/null | head -n 10 || true' @cd $(MASTER_REPO) && git submodule foreach 'git-crypt status 2>/dev/null | head -n 10 || true'
verify-structure: verify-structure:
@bash scripts/verify-genomes.sh @bash scripts/verify-genomes.sh
@ -62,14 +63,16 @@ doctor:
@echo "System ready." @echo "System ready."
sync: sync:
@[ -d "$(MASTER_REPO)" ] || { echo "Master non trovato. Esegui 'make setup'."; exit 1; }
@echo "Syncing submodules..." @echo "Syncing submodules..."
@git submodule update --init --recursive @cd $(MASTER_REPO) && git submodule update --init --recursive
@echo "--- Unpushed commits per genome ---" @echo "--- Unpushed commits per genome ---"
@git submodule foreach 'git log --oneline @{u}.. 2>/dev/null | head -5 || true' @cd $(MASTER_REPO) && git submodule foreach 'git log --oneline @{u}.. 2>/dev/null | head -5 || true'
lock: lock:
@[ -d "$(MASTER_REPO)" ] || { echo "Master non trovato. Esegui 'make setup'."; exit 1; }
@echo "Locking master repository..." @echo "Locking master repository..."
@git-crypt lock 2>/dev/null || true @cd $(MASTER_REPO) && git-crypt lock 2>/dev/null || true
@echo "Locking all submodules..." @echo "Locking all submodules..."
@git submodule foreach 'git-crypt lock 2>/dev/null || true' @cd $(MASTER_REPO) && git submodule foreach 'git-crypt lock 2>/dev/null || true'
@echo "All genomes securely locked." @echo "All genomes securely locked."

View file

@ -330,13 +330,14 @@ WORK_DIR="${HOME}/knowledge-genome-orchestrator"
KEYS_DIR="${WORK_DIR}/keys" KEYS_DIR="${WORK_DIR}/keys"
# Genome registry — format: "name|description|linked_repo" # Genome registry — format: "name|description|linked_repo"
# The third field is OPTIONAL: # The third and fourth fields are OPTIONAL:
# - leave it empty → knowledge-only genome (no linked project) # - leave it empty → knowledge-only genome (no linked project)
# - owner/repo → genome is linked to that project repository (rendered into AGENTS.md) # - owner/repo → genome is linked to that project repository (rendered into AGENTS.md)
# - cross_source → yes|no (default no): whether the cross-genome collector may read this genome as a source
GENOMES=( GENOMES=(
"genome-dev|Web development, TUI, Angular, software architecture|myorg/my-app" "genome-dev|Web development, TUI, Angular, software architecture|myorg/my-app|no"
"genome-finance|Personal finance, investments, market analysis|" "genome-finance|Personal finance, investments, market analysis||no"
"genome-homelab|Infrastructure, network configs, architecture logs|" "genome-homelab|Infrastructure, network configs, architecture logs||no"
) )
``` ```
@ -692,7 +693,9 @@ If a key is lost or compromised:
```bash ```bash
# From the knowledge-genome-orchestrator/ directory # From the knowledge-genome-orchestrator/ directory
source lib/git-crypt.sh source lib/git-crypt.sh
cd ~/knowledge-genome-orchestrator/genome-dev # If gcrypt_rotate_key operates on the CWD: cd into .../master-knowledge-genome/genome-dev
# If it navigates by name instead: cd into .../master-knowledge-genome
cd ~/knowledge-genome-orchestrator/master-knowledge-genome
gcrypt_rotate_key "genome-dev" gcrypt_rotate_key "genome-dev"
``` ```

View file

@ -9,7 +9,7 @@ PROVIDER=forgejo
# --- FORGEJO --- # --- FORGEJO ---
FORGEJO_URL=https://git.keruhomelab.com FORGEJO_URL=https://git.keruhomelab.com
FORGEJO_USER=keru FORGEJO_USER=Keru
FORGEJO_SSH_PORT=222 FORGEJO_SSH_PORT=222
# --- GITHUB (used when PROVIDER=github) --- # --- GITHUB (used when PROVIDER=github) ---

View file

@ -12,7 +12,7 @@ _REGISTRY_LOADED=1
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Dynamic paths # Dynamic paths
WORK_DIR="${HOME}/knowledge-genome-orchestrator" WORK_DIR="${PROJECT_ROOT}"
KEYS_DIR="${WORK_DIR}/keys" KEYS_DIR="${WORK_DIR}/keys"
TEMPLATES_DIR="${PROJECT_ROOT}/templates" TEMPLATES_DIR="${PROJECT_ROOT}/templates"
LIB_DIR="${PROJECT_ROOT}/lib" LIB_DIR="${PROJECT_ROOT}/lib"
@ -29,5 +29,7 @@ PROVIDERS_DIR="${PROJECT_ROOT}/providers"
# Example: "genome-work|Work notes and architecture logs||no" # Example: "genome-work|Work notes and architecture logs||no"
# "genome-finance|Personal finance|user/repo-finance|no" # "genome-finance|Personal finance|user/repo-finance|no"
GENOMES=( GENOMES=(
"genome-example|Template genome description for knowledge management||no" # Disposable sandbox: exercise the full pipeline (ingest -> PR) end-to-end.
# Created by `make setup`. Replace with real domains once the circle is validated.
"genome-test|Disposable sandbox for pipeline testing||no"
) )

View file

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

View file

@ -22,7 +22,7 @@ step "Genome structure: ${MODE}"
TOTAL_MISSING=0 TOTAL_MISSING=0
for entry in "${GENOMES[@]}"; do for entry in "${GENOMES[@]}"; do
IFS='|' read -r GENOME_NAME _ _ <<< "$entry" # 3-field registry; ignore desc + linked IFS='|' read -r GENOME_NAME _ <<< "$entry" # 4-field registry; only GENOME_NAME used here
genome_dir="${WORK_DIR}/${MASTER_REPO}/${GENOME_NAME}" genome_dir="${WORK_DIR}/${MASTER_REPO}/${GENOME_NAME}"
if [[ ! -d "$genome_dir" ]]; then if [[ ! -d "$genome_dir" ]]; then

View file

@ -4,11 +4,6 @@
# Insert an entry line into the correct section of wiki/index.md and keep that # Insert an entry line into the correct section of wiki/index.md and keep that
# section's entries alphabetically ordered. Bumps frontmatter last_updated. # section's entries alphabetically ordered. Bumps frontmatter last_updated.
# #
# NOTE: agents-genome.md and wiki-index.md claim the pre-commit hook sorts the
# index. The actual pre-commit.sh only runs the plaintext-leak check — it does
# NOT sort. This script owns the ordering instead. (If you later move sorting
# into the hook, reduce this to a plain append.)
#
# index-append.py --section Sources \ # index-append.py --section Sources \
# --entry '- [[sources/foo]] — One-line summary. `maturity: draft`' # --entry '- [[sources/foo]] — One-line summary. `maturity: draft`'
# ============================================================================= # =============================================================================

View file

@ -166,7 +166,7 @@ private: true | false
### Links ### Links
- Internal: `[[folder/file]]` — Obsidian wikilinks only. Never `[text](url)` for internal refs. - Internal: `[[folder/file]]` — Obsidian wikilinks only. Never `[text](url)` for internal refs.
- Cross-genome: `[[../genome-target/wiki/folder/file]]`. - Cross-genome: NOT via wikilink (submodule pointers make relative paths brittle). A concept owned by another genome is pulled in by the navigation skill as a raw under `raw/articles/crossgen-<topic>-<date>.md`, then ingested here normally. See master `AGENTS.md` §Cross-Genome Pull.
- External: `[text](https://...)`. - External: `[text](https://...)`.
### Index entries ### Index entries

View file

@ -57,7 +57,7 @@ grep "^## \[2026-05" wiki/log.md
## [{{DATE}}] CONFIG | Genome scaffolded ## [{{DATE}}] CONFIG | Genome scaffolded
- run_id: `system-init` - run_id: `system-init`
- model: `setup-knowledge-genome.sh` - model: `scaffold.sh`
- context_read: _(none — initial scaffold)_ - context_read: _(none — initial scaffold)_
- output_written: `[[wiki/index.md]]`, `[[wiki/log.md]]`, `[[AGENTS.md]]` - output_written: `[[wiki/index.md]]`, `[[wiki/log.md]]`, `[[AGENTS.md]]`
- reasoning: Initial directory structure and encryption layer initialized by setup script. - reasoning: Initial directory structure and encryption layer initialized by setup script.