feat(planning): enforce durable task completion chronology - #266
feat(planning): enforce durable task completion chronology#266seonghobae wants to merge 17 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review Please review the current exact head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== Checked-out commit =='
git rev-parse HEAD
git status --short
printf '%s\n' '== PR metadata =='
gh pr view 266 --repo ContextualWisdomLab/life-os --json headRefOid,baseRefOid,changedFiles,files,reviews,comments --jq '{headRefOid,baseRefOid,changedFiles,files:[.files[].path],reviews:[.reviews[]|{author:.author.login,state,body}],comments:[.comments[]|{author:.author.login,body}]}'
printf '%s\n' '== Merge-base and changed paths =='
base="$(git merge-base HEAD origin/main)"
printf 'merge-base=%s\n' "$base"
git diff --name-status "$base"...HEAD
printf '%s\n' '== Candidate migration and test files =='
fd -t f . apps/planning-service | rg '(migrations/(README|000[0-9].*\.sql)$|migration|database|db|test)'
printf '%s\n' '== Planning service structure =='
ast-grep outline apps/planning-service --items all --type function,class,interface --json=stream 2>/dev/null | head -c 30000 || trueLength of output: 36732 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== Changed files with line numbers =='
for file in \
apps/planning-service/migrations/0005_task_completion_chronology.sql \
apps/planning-service/migrations/0006_validate_task_completion_chronology.sql \
apps/planning-service/migrations/README.md \
apps/planning-service/src/task-completion-chronology-migration.test.ts
do
printf '\n--- %s ---\n' "$file"
cat -n "$file"
done
printf '%s\n' '== Original Planning task schema =='
cat -n apps/planning-service/migrations/0001_initial_planning.sql
printf '%s\n' '== All Planning migration references and runner candidates =='
rg -n -C 4 --glob '*.ts' --glob '*.sql' \
'(readdir|migrations/|readFile.*migration|apply.*[Mm]igration|CREATE TABLE.*tasks|ALTER TABLE.*tasks|completed_at|status)' \
apps/planning-service
printf '%s\n' '== Identity staged-validation precedent =='
rg -n -i -C 5 --glob '*.sql' --glob '*.md' \
'NOT VALID|VALIDATE CONSTRAINT' apps
printf '%s\n' '== Exact PR diff =='
git diff --check 193a87ef54c3fe6dcda4755bce4d6bc81e3a0297...HEAD
git diff --find-renames --unified=80 193a87ef54c3fe6dcda4755bce4d6bc81e3a0297...HEAD -- apps/planning-serviceLength of output: 128789 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== Planning package and test configuration =='
fd -t f -a 'package.json|vitest.*|vite.config.*|tsconfig.*' . \
-E node_modules -E dist -E build \
| while IFS= read -r file; do
case "$file" in
*planning-service*|./package.json|package.json)
printf '\n--- %s ---\n' "$file"
cat -n "$file"
;;
esac
done
printf '%s\n' '== Full explicit Planning migration lists =='
for file in \
apps/planning-service/src/postgres-planning-repository.integration.test.ts \
apps/planning-service/tests/postgres-data-rights.integration.test.ts \
apps/planning-service/tests/postgres-today-lock-order.integration.test.ts
do
printf '\n--- %s ---\n' "$file"
sed -n '/async function apply.*Migrations/,/^}/p' "$file"
done
printf '%s\n' '== Test discovery references =='
rg -n -C 3 --glob 'package.json' --glob '*.json' --glob '*.ts' \
'(task-completion-chronology-migration|vitest|test:.*planning|PLANNING_DATABASE_URL)' \
. -g '!node_modules/**' -g '!dist/**' -g '!build/**'
printf '%s\n' '== PR checks and workflow changes =='
gh pr view 266 --repo ContextualWisdomLab/life-os --json statusCheckRollup --jq \
'.statusCheckRollup[] | {name, status, conclusion, detailsUrl}'
git diff --name-status 193a87ef54c3fe6dcda4755bce4d6bc81e3a0297...HEAD -- .github
printf '%s\n' '== Commit history for the focused migration test =='
git log --format='%H %s' --reverse 193a87ef54c3fe6dcda4755bce4d6bc81e3a0297..HEAD -- apps/planning-service/src/task-completion-chronology-migration.test.tsLength of output: 148175 🏁 Script executed: #!/bin/bash
set -euo pipefail
for job in 102942895955 102943286521 102942958995; do
printf '\n== Job %s ==\n' "$job"
gh run view "$job" --repo ContextualWisdomLab/life-os --log-failed 2>&1 | tail -n 100
doneLength of output: 695
Finding
Verified
GitHub check logs could not be retrieved because the referenced job IDs returned HTTP 404. I could not independently classify the current failed and in-progress checks. You are interacting with an AI system. |
|
Exact-head gate sweep for
#266 therefore stays Draft. Its local migration contract is not the cause of the remaining required-check failures, and predecessor/shared-owner evidence is not being promoted to repository-wide GREEN. Next Planning work is kept dependency-ordered: explicit server-owned task completion transition first, then the bounded Weekly Review projection required by #263. |
|
@coderabbitai review Please review the current exact head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='1de871ea86fef454639708f1044c40246ca1e9f4'
actual="$(git rev-parse HEAD)"
printf 'HEAD=%s\nexpected=%s\n' "$actual" "$expected"
git status --short
if [ "$actual" != "$expected" ]; then
printf '%s\n' 'ERROR: checkout is not the requested exact head.' >&2
exit 2
fi
printf '\n== Exact change set ==\n'
git diff --check 193a87ef54c3fe6dcda4755bce4d6bc81e3a0297...HEAD
git diff --name-status 193a87ef54c3fe6dcda4755bce4d6bc81e3a0297...HEAD
printf '\n== Migration and focused test maps ==\n'
ast-grep outline apps/planning-service/migrations/0005_task_completion_chronology.sql --items all 2>/dev/null || true
ast-grep outline apps/planning-service/migrations/0006_validate_task_completion_chronology.sql --items all 2>/dev/null || true
ast-grep outline apps/planning-service/src/task-completion-chronology-migration.test.ts --items all --type function 2>/dev/null || true
printf '\n== Changed migration, documentation, and contract test ==\n'
for file in \
apps/planning-service/migrations/0005_task_completion_chronology.sql \
apps/planning-service/migrations/0006_validate_task_completion_chronology.sql \
apps/planning-service/migrations/README.md \
apps/planning-service/src/task-completion-chronology-migration.test.ts \
apps/planning-service/migrations/0001_initial_planning.sql
do
printf '\n--- %s ---\n' "$file"
cat -n "$file"
done
printf '\n== All explicit Planning migration application sites ==\n'
rg -n -C 12 --glob '*.ts' \
'(000[0-9]_[A-Za-z0-9_-]+\.sql|apply[A-Za-z]*Migrations|readFile.*migrations|migrations/000)' \
apps/planning-service
printf '\n== Migration runner / ordering references ==\n'
rg -n -C 5 --glob '*.ts' --glob '*.md' --glob '*.sql' \
'(readdir|sort\(|migration.*order|migration.*list|VALIDATE CONSTRAINT|NOT VALID|DROP CONSTRAINT|rollback|completed_at)' \
apps/planning-service
printf '\n== PR reviews and current checks ==\n'
gh pr view 266 --repo ContextualWisdomLab/life-os \
--json headRefOid,isDraft,reviews,statusCheckRollup \
--jq '{headRefOid,isDraft,reviews:[.reviews[]|{author:.author.login,state,commit:.commit.oid}],checks:[.statusCheckRollup[]|{name,status,conclusion}]}'Length of output: 60116
Finding
Verified
The focused database test is conditional on You are interacting with an AI system. |
|
@coderabbitai review Current exact head is now |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='b327e0142e3c1806d447b4b8e3491f8dacd376a0'
actual="$(git rev-parse HEAD)"
printf '== Exact checkout ==\nHEAD=%s\nexpected=%s\n' "$actual" "$expected"
git status --short
if [ "$actual" != "$expected" ]; then
printf '%s\n' 'ERROR: checkout does not match the requested exact head.' >&2
exit 2
fi
printf '\n== PR remote state ==\n'
gh pr view 266 --repo ContextualWisdomLab/life-os \
--json headRefOid,baseRefOid,isDraft,reviews,statusCheckRollup \
--jq '{headRefOid,baseRefOid,isDraft,reviews:[.reviews[]|{author:.author.login,state,commit:.commit.oid}],checks:[.statusCheckRollup[]|{name,status,conclusion,detailsUrl}]}'
printf '\n== Change set from protected base ==\n'
git diff --check 193a87ef54c3fe6dcda4755bce4d6bc81e3a0297...HEAD
git diff --name-status 193a87ef54c3fe6dcda4755bce4d6bc81e3a0297...HEAD
printf '\n== New-head repair diff ==\n'
git diff --check 1de871ea86fef454639708f1044c40246ca1e9f4...HEAD
git diff --find-renames --unified=100 1de871ea86fef454639708f1044c40246ca1e9f4...HEAD -- apps/planning-service
printf '\n== Relevant migration and test structure ==\n'
ast-grep outline apps/planning-service/src/postgres-planning-repository.integration.test.ts --items all --type function 2>/dev/null || true
ast-grep outline apps/planning-service/tests/postgres-data-rights.integration.test.ts --items all --type function 2>/dev/null || true
ast-grep outline apps/planning-service/tests/postgres-today-lock-order.integration.test.ts --items all --type function 2>/dev/null || true
ast-grep outline apps/planning-service/src/task-completion-chronology-migration.test.ts --items all --type function 2>/dev/null || true
printf '\n== All Planning migration application references ==\n'
rg -n -C 10 --glob '*.ts' \
'(000[0-9]_[A-Za-z0-9_-]+\.sql|apply[A-Za-z]*Migrations|migrations/000)' \
apps/planning-service
printf '\n== Migrations, documentation, and affected PostgreSQL tests ==\n'
for file in \
apps/planning-service/migrations/0001_initial_planning.sql \
apps/planning-service/migrations/0005_task_completion_chronology.sql \
apps/planning-service/migrations/0006_validate_task_completion_chronology.sql \
apps/planning-service/migrations/README.md \
apps/planning-service/src/task-completion-chronology-migration.test.ts \
apps/planning-service/src/postgres-planning-repository.integration.test.ts \
apps/planning-service/tests/postgres-data-rights.integration.test.ts \
apps/planning-service/tests/postgres-today-lock-order.integration.test.ts
do
printf '\n--- %s ---\n' "$file"
cat -n "$file"
done
printf '\n== Hosted repair workflow and run evidence ==\n'
gh run view 34561569759 --repo ContextualWisdomLab/life-os \
--json databaseId,headSha,status,conclusion,event,workflowName,jobs \
--jq '{databaseId,headSha,status,conclusion,event,workflowName,jobs:[.jobs[]|{databaseId,name,status,conclusion,startedAt,completedAt}]}'
gh run view 34561569759 --repo ContextualWisdomLab/life-os --log-failed 2>&1 | tail -n 250Length of output: 84465
I found no new Planning-local defect. The prior migration-chain finding is repaired. These fixtures now apply
The migration boundary remains correct:
The rollback documentation remains consistent. It identifies This slice does not add overdue, stalled, inactive, audit-history, browser-authority, or Weekly Review semantics. Hosted run If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! You are interacting with an AI system. |
|
Current exact head remains @coderabbitai approve |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/life-os"
expected="b327e0142e3c1806d447b4b8e3491f8dacd376a0"
actual="$(git rev-parse HEAD)"
printf '== Exact checkout ==\nHEAD=%s\nexpected=%s\n' "$actual" "$expected"
git status --short
if [ "$actual" != "$expected" ]; then
echo "ERROR: local checkout does not match requested head" >&2
exit 2
fi
printf '\n== Pull request authority and current check state ==\n'
gh pr view 266 --repo "$repo" \
--json headRefOid,baseRefOid,isDraft,reviewDecision,reviews,statusCheckRollup \
--jq '{
headRefOid, baseRefOid, isDraft, reviewDecision,
reviews: [.reviews[] | {author: .author.login, state, commit: .commit.oid}],
checks: [.statusCheckRollup[] | {name, status, conclusion, detailsUrl}]
}'
printf '\n== Current change set from protected base ==\n'
base="193a87ef54c3fe6dcda4755bce4d6bc81e3a0297"
git diff --check "$base"...HEAD
git diff --name-status "$base"...HEAD
printf '\n== Repair diff at requested head ==\n'
git diff --check 1de871ea86fef454639708f1044c40246ca1e9f4...HEAD
git diff --unified=40 1de871ea86fef454639708f1044c40246ca1e9f4...HEAD -- \
apps/planning-service/src/postgres-planning-repository.integration.test.ts \
apps/planning-service/tests/postgres-data-rights.integration.test.ts \
apps/planning-service/tests/postgres-today-lock-order.integration.test.ts
printf '\n== Migration boundary and all explicit Planning migration lists ==\n'
for file in \
apps/planning-service/migrations/0001_initial_planning.sql \
apps/planning-service/migrations/0005_task_completion_chronology.sql \
apps/planning-service/migrations/0006_validate_task_completion_chronology.sql \
apps/planning-service/migrations/README.md \
apps/planning-service/src/task-completion-chronology-migration.test.ts \
apps/planning-service/src/postgres-planning-repository.integration.test.ts \
apps/planning-service/tests/postgres-data-rights.integration.test.ts \
apps/planning-service/tests/postgres-today-lock-order.integration.test.ts
do
printf '\n--- %s ---\n' "$file"
cat -n "$file"
done
printf '\n== All explicit Planning SQL migration references ==\n'
rg -n -C 8 --glob '*.ts' \
'(000[0-9]_[A-Za-z0-9_-]+\.sql|apply[A-Za-z]*Migrations|migrations/000)' \
apps/planning-service
printf '\n== Claimed hosted repair run ==\n'
gh run view 34561569759 --repo "$repo" \
--json databaseId,headSha,status,conclusion,workflowName,jobs \
--jq '{databaseId,headSha,status,conclusion,workflowName,jobs:[.jobs[]|{databaseId,name,status,conclusion}]}' \
|| trueLength of output: 75834
I found no Planning-local defect. All three explicit PostgreSQL fixtures now apply migrations
Hosted run This approval applies only to ✅ Action performedComments resolved. Approval is disabled; enable |
Advances #263 with the first Planning-owned temporal foundation needed before Weekly Review can expose authoritative task-completion evidence. Protected
main@193a87ef54c3fe6dcda4755bce4d6bc81e3a0297persistedplanning.tasks.completed_at, but did not bind it tostatusandcreated_at; rows could therefore claim incoherent durable completion state.Durable boundary
0005_task_completion_chronology.sqladdstasks_completion_state_checkasNOT VALID, so new/changed rows must already satisfytodo ⇒ completed_at IS NULLanddone ⇒ completed_at >= created_atwithout forcing the initial historical scan during constraint addition.0006_validate_task_completion_chronology.sqlvalidates the staged constraint as a separate deployment boundary and fails closed on historical violations.overdue,stalled, orinactive, copy mutable sibling source, or move Review semantics into Planning persistence.RED → repair evidence
The staged-migration regression first proved the direct-add implementation was wrong: exact canary
34497919705/ job102941002188produced the intended RED. After splitting staged addition and validation, exact canary34498191009/ job102941944243passed the focused real-PostgreSQL contract and the temporary canary retired.A fresh current-head review then found that three existing PostgreSQL integration fixtures still stopped before the new migration pair, so they were testing a schema different from deployed Planning. Bounded repair input
9ab372ec773d6e63df52305585e2f356986ec8fa, run34561569759/ job103145425778, proved the defect against real PostgreSQL first:postgres-planning-repository.integration.test.ts,postgres-data-rights.integration.test.ts, andpostgres-today-lock-order.integration.test.tsall producedtasks_completion_state_check=missing. The repair advanced their explicit migration lists through0005/0006; the three PostgreSQL files then passed 9/9, Planning typecheck and build passed, exact remote-head equality was checked, and the bounded repair workflow removed itself before publication.Exact current state
Current exact head is
b327e0142e3c1806d447b4b8e3491f8dacd376a0; the temporary migration-fixture repair workflow is absent. CodeRabbit independently inspected this exact head after the repair and reported no new Planning-local defect: all three explicit PostgreSQL fixtures apply0001through0006in lexical order, theNOT VALID→VALIDATE CONSTRAINTboundary remains intact, contradictory states are rejected with SQLSTATE23514, and the validated constraint/documentation match the intended deployment semantics.That independent review did not create a GitHub
APPROVEDreview because this repository's CodeRabbit command configuration has explicit approval actions disabled. GitHub therefore still reports review authority as required; this PR remains Draft and is not merge-eligible. Hosted bounded RED→GREEN and a clean independent review are not being represented as repository-wide required-check GREEN or formal approval.This PR remains the base of #267 → #268 → #269. Keep Draft until applicable exact-head repository/security gates and an actual independent approval exist. No self-approval, bypass merge, force push, destructive rebase, gate weakening, cross-service SQL, or mutable sibling-source adoption.