2026-03-26 07:26:54 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
# read-journal.sh — read agent journal entries
|
|
|
|
|
#
|
|
|
|
|
# Usage: read-journal.sh AGENT [--date YYYY-MM-DD] [--list] [--help]
|
2026-03-26 11:18:55 +00:00
|
|
|
# AGENT: planner, supervisor, or predictor
|
2026-03-26 07:26:54 +00:00
|
|
|
# --date: specific date (default: today)
|
|
|
|
|
# --list: list available journal dates instead of reading
|
|
|
|
|
#
|
|
|
|
|
# Required env: PROJECT_REPO_ROOT
|
|
|
|
|
|
|
|
|
|
usage() {
|
2026-03-26 07:29:26 +00:00
|
|
|
cat <<'USAGE'
|
|
|
|
|
read-journal.sh AGENT [--date YYYY-MM-DD] [--list] [--help]
|
2026-03-26 11:18:55 +00:00
|
|
|
AGENT: planner, supervisor, or predictor
|
2026-03-26 07:29:26 +00:00
|
|
|
--date: specific date (default: today)
|
|
|
|
|
--list: list available journal dates instead of reading
|
|
|
|
|
USAGE
|
2026-03-26 07:26:54 +00:00
|
|
|
exit 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
agent=""
|
|
|
|
|
target_date=$(date +%Y-%m-%d)
|
|
|
|
|
list_mode=false
|
|
|
|
|
|
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
|
|
|
case "$1" in
|
|
|
|
|
--date) target_date="$2"; shift 2 ;;
|
|
|
|
|
--list) list_mode=true; shift ;;
|
|
|
|
|
--help|-h) usage ;;
|
|
|
|
|
-*) echo "Unknown option: $1" >&2; exit 1 ;;
|
|
|
|
|
*)
|
|
|
|
|
if [[ -z "$agent" ]]; then
|
|
|
|
|
agent="$1"
|
|
|
|
|
else
|
|
|
|
|
echo "Unexpected argument: $1" >&2; exit 1
|
|
|
|
|
fi
|
|
|
|
|
shift
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
fix: {project}-ops repo — separate operations from code (#757) (#767)
Fixes #757
## Changes
Separate operations from code into {project}-ops repo pattern. Added OPS_REPO_ROOT infrastructure (env.sh, load-project.sh, formula-session.sh with ensure_ops_repo helper). Updated all 8 agent scripts and 7 formulas to read/write vault items, journals, evidence, prerequisites, RESOURCES.md, and knowledge from the ops repo. Added setup_ops_repo() to disinto init for automatic ops repo creation and seeding. Removed migrated data from code repo (vault data dirs, planner journal/memory/prerequisites, supervisor journal/best-practices, evidence, RESOURCES.md). Updated all documentation. 55 files changed, ShellCheck clean, all 38 phase tests pass.
Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/disinto/pulls/767
Reviewed-by: Disinto_bot <disinto_bot@noreply.codeberg.org>
2026-03-26 19:55:12 +01:00
|
|
|
: "${OPS_REPO_ROOT:?OPS_REPO_ROOT is required}"
|
2026-03-26 07:26:54 +00:00
|
|
|
|
|
|
|
|
if [[ -z "$agent" ]]; then
|
2026-03-26 11:18:55 +00:00
|
|
|
echo "Error: agent name is required (planner, supervisor, predictor)" >&2
|
2026-03-26 07:26:54 +00:00
|
|
|
echo "" >&2
|
|
|
|
|
usage
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# --- Resolve journal directory ---
|
|
|
|
|
case "$agent" in
|
fix: {project}-ops repo — separate operations from code (#757) (#767)
Fixes #757
## Changes
Separate operations from code into {project}-ops repo pattern. Added OPS_REPO_ROOT infrastructure (env.sh, load-project.sh, formula-session.sh with ensure_ops_repo helper). Updated all 8 agent scripts and 7 formulas to read/write vault items, journals, evidence, prerequisites, RESOURCES.md, and knowledge from the ops repo. Added setup_ops_repo() to disinto init for automatic ops repo creation and seeding. Removed migrated data from code repo (vault data dirs, planner journal/memory/prerequisites, supervisor journal/best-practices, evidence, RESOURCES.md). Updated all documentation. 55 files changed, ShellCheck clean, all 38 phase tests pass.
Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/disinto/pulls/767
Reviewed-by: Disinto_bot <disinto_bot@noreply.codeberg.org>
2026-03-26 19:55:12 +01:00
|
|
|
planner) journal_dir="${OPS_REPO_ROOT}/journal/planner" ;;
|
|
|
|
|
supervisor) journal_dir="${OPS_REPO_ROOT}/journal/supervisor" ;;
|
2026-03-26 07:26:54 +00:00
|
|
|
predictor)
|
|
|
|
|
echo "The predictor does not write journal files."
|
|
|
|
|
echo "Its memory lives in forge issues labeled 'prediction/unreviewed' and 'prediction/actioned'."
|
|
|
|
|
echo ""
|
|
|
|
|
echo "Query predictions with:"
|
|
|
|
|
echo " curl -sH 'Authorization: token \${FORGE_TOKEN}' '\${FORGE_API}/issues?state=open&labels=prediction%2Funreviewed'"
|
|
|
|
|
exit 0
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo "Error: unknown agent '${agent}'" >&2
|
2026-03-26 11:18:55 +00:00
|
|
|
echo "Available: planner, supervisor, predictor" >&2
|
2026-03-26 07:26:54 +00:00
|
|
|
exit 1
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
if [[ ! -d "$journal_dir" ]]; then
|
|
|
|
|
echo "No journal directory found at ${journal_dir}" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# --- List mode ---
|
|
|
|
|
if $list_mode; then
|
|
|
|
|
echo "Available journal dates for ${agent}:"
|
|
|
|
|
find "$journal_dir" -maxdepth 1 -name '*.md' -printf '%f\n' 2>/dev/null | sed 's|\.md$||' | sort -r | head -20
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# --- Read specific date ---
|
|
|
|
|
journal_file="${journal_dir}/${target_date}.md"
|
|
|
|
|
if [[ -f "$journal_file" ]]; then
|
|
|
|
|
cat "$journal_file"
|
|
|
|
|
else
|
|
|
|
|
echo "No journal entry for ${agent} on ${target_date}" >&2
|
|
|
|
|
echo "" >&2
|
|
|
|
|
echo "Recent entries:" >&2
|
|
|
|
|
find "$journal_dir" -maxdepth 1 -name '*.md' -printf '%f\n' 2>/dev/null | sed 's|\.md$||' | sort -r | head -5 >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|