Tighten Section 0 projection wait proof

This commit is contained in:
virgil
2026-06-08 14:37:54 -07:00
parent edd60e905e
commit 39ef1f4eea
2 changed files with 14 additions and 8 deletions

View File

@@ -20,6 +20,7 @@ Edit Markdown files in this Git repo.
Current docs:
- `README.md`
- `docs/source-models.md`
- `rta/concept.md`
- `rta/reports/current-status.md`
@@ -62,11 +63,12 @@ section0-docs pull
section0-docs status
MESSAGE="Describe the doc change" section0-docs commit
section0-docs push
git rev-parse --short HEAD
```
After a push, send Virgil the short commit hash. AFFiNE refresh is handled by
the lab operator side; collaborators do not need the home-lab repo.
By default, `section0-docs push` waits for the projected commit to pass backend
verification and AFFiNE native read verification. If an already-open AFFiNE tab
still shows old content, reload the tab or open the printed doc URL in a fresh
tab.
## Contributor Setup
@@ -108,11 +110,9 @@ printf '\nMBP sync smoke test: %s\n' "$(date -Is)" >> rta/reports/current-status
section0-docs status
MESSAGE="MBP sync smoke test" section0-docs commit
section0-docs push
git rev-parse --short HEAD
```
Send the printed commit hash to Virgil. After the AFFiNE copies are refreshed,
the smoke line should appear in:
After the AFFiNE copies are refreshed, the smoke line should appear in:
```text
Agent Workspace / Section 0 / Git Projections / RTA Handbook / RTA Status

View File

@@ -170,6 +170,9 @@ wait_for_projection() {
origin_commit="\$(printf "%s" "\$status_json" | json_get source.originCommit 2>/dev/null || true)"
projected_commit="\$(printf "%s" "\$status_json" | json_get projected.commit 2>/dev/null || true)"
completed_at="\$(printf "%s" "\$status_json" | json_get projected.completedAt 2>/dev/null || true)"
backend_ok="\$(printf "%s" "\$status_json" | json_get verification.backend.ok 2>/dev/null || true)"
native_ok="\$(printf "%s" "\$status_json" | json_get verification.nativeRead.ok 2>/dev/null || true)"
browser_status="\$(printf "%s" "\$status_json" | json_get verification.browserFreshness.status 2>/dev/null || true)"
readme_url="\$(printf "%s" "\$status_json" | python3 -c 'import json,sys
data=json.load(sys.stdin)
for doc in (data.get("projected") or {}).get("docs") or []:
@@ -177,12 +180,15 @@ for doc in (data.get("projected") or {}).get("docs") or []:
print(doc.get("url",""))
break' 2>/dev/null || true)"
printf " origin=%s projected=%s state=%s%s\n" "\${origin_commit:-unknown}" "\${projected_commit:-none}" "\${state:-unknown}" "\${completed_at:+ completed=\$completed_at}"
if [ "\$projected_commit" = "\$expected" ]; then
echo "Projected and verified in AFFiNE."
printf " verification: backend=%s native-read=%s browser=%s\n" "\${backend_ok:-unknown}" "\${native_ok:-unknown}" "\${browser_status:-not_verified}"
if [ "\$projected_commit" = "\$expected" ] && { [ "\$backend_ok" = "True" ] || [ "\$backend_ok" = "true" ]; } && { [ "\$native_ok" = "True" ] || [ "\$native_ok" = "true" ]; }; then
echo "Projected and verified through AFFiNE backend and native read."
[ -z "\$readme_url" ] || echo "Doc: \$readme_url"
echo "If a browser tab still shows old content, reload the AFFiNE tab or open the doc URL in a fresh tab."
json_log "wait.complete" "\$expected"
return 0
elif [ "\$projected_commit" = "\$expected" ]; then
echo " commit is projected, but verification is not complete yet"
fi
else
echo " projection status not reachable yet"