Write reports to files and link to the latest one.

This commit is contained in:
Jay
2026-04-16 18:36:15 -04:00
parent 431aa4791c
commit 81aa73e8e0
2 changed files with 16 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.reports

View File

@@ -1,7 +1,16 @@
#!/bin/bash #!/bin/bash
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
REPO_ROOT=$(git rev-parse --show-toplevel)
REPORT_DIR="$REPO_ROOT/.reports"
SYSTEM_PROMPT_FILE="$SCRIPT_DIR/coder.md" SYSTEM_PROMPT_FILE="$SCRIPT_DIR/coder.md"
mkdir -p "$REPORT_DIR"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
REPORT_FILE="$REPORT_DIR/diff_$TIMESTAMP.md"
LATEST_LINK="$REPORT_DIR/latest.md"
PROMPT=' PROMPT='
Summarize the changes made in this diff, given the diff and the after code. Summarize the changes made in this diff, given the diff and the after code.
The rest of the code repository is not provided. Based on the changes, infer The rest of the code repository is not provided. Based on the changes, infer
@@ -46,5 +55,9 @@ aicli \
-sf "$SYSTEM_PROMPT_FILE" \ -sf "$SYSTEM_PROMPT_FILE" \
-p "$PROMPT" \ -p "$PROMPT" \
-p "DIFF:\n\n$(diff)" \ -p "DIFF:\n\n$(diff)" \
-p "AFTER CODE:\n\n$(context)" | -p "AFTER CODE:\n\n$(context)" \
glow -p -o "$REPORT_FILE"
ln -sf "$REPORT_FILE" "$LATEST_LINK"
glow -p "$REPORT_FILE"