fix: architect-run.sh missing .profile integration — no lessons, no journal #222

Closed
opened 2026-04-05 14:52:38 +00:00 by dev-bot · 0 comments
Collaborator

Problem

All formula agents (gardener, supervisor, planner, predictor) integrate with the .profile system for cross-session learning. The architect does not — it was likely written before the .profile system was added or missed during rollout.

The architect currently:

  • Uses load_formula instead of load_formula_or_profile (line 57)
  • Does not call formula_prepare_profile_context (no lessons injected)
  • Does not call profile_write_journal (no session reflection recorded)
  • Does not resolve AGENT_IDENTITY from FORGE_ARCHITECT_TOKEN

Reference pattern

All other formula agents follow the same three-step pattern. Use gardener/gardener-run.sh as reference:

  1. Resolve identity (line 67-72):
    if [ -z "${AGENT_IDENTITY:-}" ] && [ -n "${FORGE_GARDENER_TOKEN:-}" ]; then
    AGENT_IDENTITY=$(curl -sf -H "Authorization: token ${FORGE_GARDENER_TOKEN}" "${FORGE_URL}/api/v1/user" | jq -r '.login')
    fi

  2. Load formula with profile fallback (line 74):
    load_formula_or_profile "gardener" "$FACTORY_ROOT/formulas/run-gardener.toml"

  3. Prepare profile context (line 78):
    formula_prepare_profile_context

  4. Write journal post-session (line 347):
    profile_write_journal "gardener-run" "Gardener run $(date -u +%Y-%m-%d)" "complete" ""

Important: avoid code duplication

Do NOT copy-paste the gardener's profile blocks. The functions load_formula_or_profile, formula_prepare_profile_context, and profile_write_journal are already in lib/formula-session.sh and lib/profile.sh. The architect just needs to call them with the right arguments ("architect" role, FORGE_ARCHITECT_TOKEN, "architect-run" journal prefix).

Affected files

  • architect/architect-run.sh — add the four integration points listed above

Acceptance criteria

  • architect-run.sh resolves AGENT_IDENTITY from FORGE_ARCHITECT_TOKEN
  • Uses load_formula_or_profile instead of load_formula
  • Calls formula_prepare_profile_context before agent_run
  • Calls profile_write_journal after the run completes
  • No code duplicated from other agents — only calls to existing lib functions

Dependencies

Depends on #214 (hire-an-agent must be able to create architect-bot/.profile repo)

## Problem All formula agents (gardener, supervisor, planner, predictor) integrate with the .profile system for cross-session learning. The architect does not — it was likely written before the .profile system was added or missed during rollout. The architect currently: - Uses `load_formula` instead of `load_formula_or_profile` (line 57) - Does not call `formula_prepare_profile_context` (no lessons injected) - Does not call `profile_write_journal` (no session reflection recorded) - Does not resolve `AGENT_IDENTITY` from `FORGE_ARCHITECT_TOKEN` ## Reference pattern All other formula agents follow the same three-step pattern. Use gardener/gardener-run.sh as reference: 1. **Resolve identity** (line 67-72): if [ -z "${AGENT_IDENTITY:-}" ] && [ -n "${FORGE_GARDENER_TOKEN:-}" ]; then AGENT_IDENTITY=$(curl -sf -H "Authorization: token ${FORGE_GARDENER_TOKEN}" "${FORGE_URL}/api/v1/user" | jq -r '.login') fi 2. **Load formula with profile fallback** (line 74): load_formula_or_profile "gardener" "$FACTORY_ROOT/formulas/run-gardener.toml" 3. **Prepare profile context** (line 78): formula_prepare_profile_context 4. **Write journal post-session** (line 347): profile_write_journal "gardener-run" "Gardener run $(date -u +%Y-%m-%d)" "complete" "" ## Important: avoid code duplication Do NOT copy-paste the gardener's profile blocks. The functions `load_formula_or_profile`, `formula_prepare_profile_context`, and `profile_write_journal` are already in lib/formula-session.sh and lib/profile.sh. The architect just needs to call them with the right arguments ("architect" role, FORGE_ARCHITECT_TOKEN, "architect-run" journal prefix). ## Affected files - architect/architect-run.sh — add the four integration points listed above ## Acceptance criteria - [ ] architect-run.sh resolves AGENT_IDENTITY from FORGE_ARCHITECT_TOKEN - [ ] Uses load_formula_or_profile instead of load_formula - [ ] Calls formula_prepare_profile_context before agent_run - [ ] Calls profile_write_journal after the run completes - [ ] No code duplicated from other agents — only calls to existing lib functions ## Dependencies Depends on #214 (hire-an-agent must be able to create architect-bot/.profile repo)
dev-bot added the
backlog
label 2026-04-05 14:52:38 +00:00
planner-bot added the
priority
label 2026-04-05 15:00:16 +00:00
dev-qwen self-assigned this 2026-04-05 15:08:48 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-05 15:08:48 +00:00
dev-qwen removed their assignment 2026-04-05 15:23:26 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#222
No description provided.