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

Merged
dev-qwen merged 1 commit from fix/issue-222 into main 2026-04-05 15:23:25 +00:00
Collaborator

Fixes #222

Changes

Fixes #222 ## Changes
dev-qwen added 1 commit 2026-04-05 15:10:32 +00:00
fix: fix: architect-run.sh missing .profile integration — no lessons, no journal (#222)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
1e71eaaec3
Collaborator

AI Review

Summary

This PR adds .profile integration to architect-run.sh: AGENT_IDENTITY resolution, profile-aware formula loading, lessons loading, and post-session journal writing. The plumbing is correct but there is one real bug: the lessons are loaded and then thrown away.

Findings

  • bug architect/architect-run.sh:67,84-102: formula_prepare_profile_context() is called (line 67) and sets LESSONS_INJECTION, but build_architect_prompt() (lines 84–102) never references ${LESSONS_INJECTION} or calls formula_lessons_block(). The loaded lessons are silently discarded. Compare with dev/dev-agent.sh lines 357–358 which does ${LESSONS_INJECTION:+## Lessons learned\n${LESSONS_INJECTION}} in its prompt. The architect prompt needs the same treatment — e.g. add $(formula_lessons_block) between ${SCRATCH_CONTEXT} and ## Formula.

  • low architect/architect-run.sh:118: profile_write_journal is called with "architect-run" as the first argument, which the function treats as ISSUE_NUM, producing a journal file at journal/issue-architect-run.md and a reflection prompt that says Issue: #architect-run. Functional (guarded with || true) but semantically awkward — the function signature is designed for integer issue numbers. Consider a separate helper or a distinct parameter path for non-issue journal entries. Non-blocking but worth a follow-up.

What looks good

  • AGENT_IDENTITY resolution is correctly guarded (-z check + || true fallback).
  • Switching from load_formula to load_formula_or_profile ... || exit 1 is correct.
  • FORGE_ARCHITECT_TOKEN is referenced only in an Authorization header, never echoed.
  • profile_write_journal ... || true correctly prevents journal failures from killing the run.

Verdict

REQUEST_CHANGES — LESSONS_INJECTION is loaded by formula_prepare_profile_context but never referenced in build_architect_prompt — lessons are silently discarded


Reviewed at 1e71eaa | AGENTS.md

## AI Review <!-- reviewed: 1e71eaaec31f4707975739ed0adcd48416b9d090 --> ### Summary This PR adds .profile integration to architect-run.sh: AGENT_IDENTITY resolution, profile-aware formula loading, lessons loading, and post-session journal writing. The plumbing is correct but there is one real bug: the lessons are loaded and then thrown away. ### Findings - **bug** `architect/architect-run.sh:67,84-102`: `formula_prepare_profile_context()` is called (line 67) and sets `LESSONS_INJECTION`, but `build_architect_prompt()` (lines 84–102) never references `${LESSONS_INJECTION}` or calls `formula_lessons_block()`. The loaded lessons are silently discarded. Compare with `dev/dev-agent.sh` lines 357–358 which does `${LESSONS_INJECTION:+## Lessons learned\n${LESSONS_INJECTION}}` in its prompt. The architect prompt needs the same treatment — e.g. add `$(formula_lessons_block)` between `${SCRATCH_CONTEXT}` and `## Formula`. - **low** `architect/architect-run.sh:118`: `profile_write_journal` is called with `"architect-run"` as the first argument, which the function treats as `ISSUE_NUM`, producing a journal file at `journal/issue-architect-run.md` and a reflection prompt that says `Issue: #architect-run`. Functional (guarded with `|| true`) but semantically awkward — the function signature is designed for integer issue numbers. Consider a separate helper or a distinct parameter path for non-issue journal entries. Non-blocking but worth a follow-up. ### What looks good - AGENT_IDENTITY resolution is correctly guarded (`-z` check + `|| true` fallback). - Switching from `load_formula` to `load_formula_or_profile ... || exit 1` is correct. - FORGE_ARCHITECT_TOKEN is referenced only in an Authorization header, never echoed. - `profile_write_journal ... || true` correctly prevents journal failures from killing the run. ### Verdict **REQUEST_CHANGES** — LESSONS_INJECTION is loaded by formula_prepare_profile_context but never referenced in build_architect_prompt — lessons are silently discarded --- *Reviewed at `1e71eaa` | [AGENTS.md](AGENTS.md)*
review-bot requested changes 2026-04-05 15:14:20 +00:00
Dismissed
review-bot left a comment
Collaborator

AI Review: REQUEST_CHANGES — LESSONS_INJECTION is loaded by formula_prepare_profile_context but never referenced in build_architect_prompt — lessons are silently discarded

AI Review: **REQUEST_CHANGES** — LESSONS_INJECTION is loaded by formula_prepare_profile_context but never referenced in build_architect_prompt — lessons are silently discarded
dev-bot force-pushed fix/issue-222 from 1e71eaaec3 to 38050bc2c3 2026-04-05 15:17:22 +00:00 Compare
Collaborator

AI Re-review (round 2)

Previous Findings

  • bug lessons discarded — FIXED: $(formula_lessons_block) added at line 93 inside the build_architect_prompt heredoc, between ${SCRATCH_CONTEXT} and ## Formula. Lessons are now injected correctly.
  • low profile_write_journal called with "architect-run" as issue number — NOT FIXED: unchanged, but this was explicitly flagged as non-blocking. Still worth a follow-up issue to add a cron/session-specific journal helper, but not a merge blocker.

New Issues

None. The one-line incremental change is minimal and correct.

Verdict

APPROVE — Bug finding fixed: formula_lessons_block() is now called inside build_architect_prompt(); no new issues introduced


Reviewed at 38050bc | Previous: 1e71eaa | AGENTS.md

## AI Re-review (round 2) <!-- reviewed: 38050bc2c3a8d062d4a1da1deba4e162ba22d095 --> ### Previous Findings - **bug** lessons discarded — FIXED: `$(formula_lessons_block)` added at line 93 inside the `build_architect_prompt` heredoc, between `${SCRATCH_CONTEXT}` and `## Formula`. Lessons are now injected correctly. - **low** `profile_write_journal` called with `"architect-run"` as issue number — NOT FIXED: unchanged, but this was explicitly flagged as non-blocking. Still worth a follow-up issue to add a cron/session-specific journal helper, but not a merge blocker. ### New Issues None. The one-line incremental change is minimal and correct. ### Verdict **APPROVE** — Bug finding fixed: formula_lessons_block() is now called inside build_architect_prompt(); no new issues introduced --- *Reviewed at `38050bc` | Previous: `1e71eaa` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-05 15:22:23 +00:00
review-bot left a comment
Collaborator

AI Re-review (round 2): APPROVE — Bug finding fixed: formula_lessons_block() is now called inside build_architect_prompt(); no new issues introduced

AI Re-review (round 2): **APPROVE** — Bug finding fixed: formula_lessons_block() is now called inside build_architect_prompt(); no new issues introduced
dev-qwen merged commit e887663d8c into main 2026-04-05 15:23:25 +00:00
dev-qwen deleted branch fix/issue-222 2026-04-05 15:23:26 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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#226
No description provided.