Fall back to local artifacts when object storage is unset #497

Merged
weichen merged 18 commits from fix/u7-k4-artifact-upload into main 2026-10-13 02:13:04 +00:00
Owner

Summary

  • Treat a typed-nil blob store as unconfigured and fall back to the local artifacts directory.
  • Cover the upload with a two-process round trip, then retest C5 K4. Second-instance writes stay closed.

Task card

  • .task/fix-u7-k4-artifact-upload.md:需求 R1–R4、阶段 1–5、结果与验证、证据收据。

Why: an unset BLOBSTORE_S3_ENDPOINT left a typed nil *S3 inside the store interface, so artifact upload panicked and C5 K4 failed.
Evidence: Backend 46073d30 vet-and-test run 2783 success (GATE). Dev local make test on ca0ab46 exit 0 (SELF). Drill backup-20261013-013354 K1–K7 true, RPO 65s, RTO 3s, artifacts checked=5 missing=0 mismatch=0, cross-user 404 (SELF). Documents 5335499 is PR #92. make task-sync sync_base 5aebedebeb.
Impact: team/PG uploads without an S3 endpoint use --artifacts. Configured S3 is unchanged. Write traffic is not released; REPLAY or a CI fast tier, plus C3, are still missing.
Refs: https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Backend/pulls/186 https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/92

Test plan

  • Dev HEAD ci / test, ci / test-pg, ci / svc-realcombo green
  • Backend vet-and-test run 2783 on 46073d30
  • Local red/green cross-instance upload (SELF)
  • C5 drill backup-20261013-013354 (SELF)
## Summary - Treat a typed-nil blob store as unconfigured and fall back to the local artifacts directory. - Cover the upload with a two-process round trip, then retest C5 K4. Second-instance writes stay closed. ## Task card - `.task/fix-u7-k4-artifact-upload.md`:需求 R1–R4、阶段 1–5、结果与验证、证据收据。 Why: an unset `BLOBSTORE_S3_ENDPOINT` left a typed nil `*S3` inside the store interface, so artifact upload panicked and C5 K4 failed. Evidence: Backend `46073d30` `vet-and-test` run 2783 success (GATE). Dev local `make test` on `ca0ab46` exit 0 (SELF). Drill `backup-20261013-013354` K1–K7 true, RPO 65s, RTO 3s, artifacts checked=5 missing=0 mismatch=0, cross-user 404 (SELF). Documents `5335499` is PR #92. `make task-sync` sync_base `5aebedebeb`. Impact: team/PG uploads without an S3 endpoint use `--artifacts`. Configured S3 is unchanged. Write traffic is not released; REPLAY or a CI fast tier, plus C3, are still missing. Refs: https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Backend/pulls/186 https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Documents/pulls/92 ## Test plan - [ ] Dev HEAD `ci / test`, `ci / test-pg`, `ci / svc-realcombo` green - [x] Backend `vet-and-test` run 2783 on `46073d30` - [x] Local red/green cross-instance upload (SELF) - [x] C5 drill `backup-20261013-013354` (SELF)
weichen added 9 commits 2026-10-13 01:47:06 +00:00
Why: establish the authorized task workspace and its initial baseline.

Evidence: preserved precheck receipt in .task/fix-u7-k4-artifact-upload.md; R0=5212fef01e59b7f9e12fa7fc42cd987c6792a786.

Impact: task metadata only; the feature workspace starts at 5212fef01e.

Refs: .task/fix-u7-k4-artifact-upload.md
Why: the approved plan authorizes this increment through merge and close, and the task card is the record of that scope.
Evidence: stages 1-5 cite the 2026-10-13 plan approval; precheck receipt remains in the card.
Impact: task metadata only; no product code yet.
Refs: .task/fix-u7-k4-artifact-upload.md
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: the typed-nil fallback needs a recorded local run before the component pull request.
Evidence: GOWORK=off go vet and go test ./... exited 0 against backend 46073d30; source SELF. The PostgreSQL-gated case was skipped locally.
Impact: task card only. The backend gitlink is not pinned in this commit.
Refs: .task/fix-u7-k4-artifact-upload.md
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: an unset object store must keep artifact bytes available to the other process, which the store-level test does not execute.
Evidence: cross_artifact_roundtrip failed with EOF on backend c6fb130 and passed on 46073d30 (SELF, isolated u7drill-k4).
Impact: Dev now builds the fixed backend. Second-instance write traffic stays closed.
Refs: modules/backend tests/integration/multi-instance/multi_instance_test.go
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: the pin needs a recorded local red/green roundtrip and a combination test before the backup drill.
Evidence: cross_artifact_roundtrip exited 1 on backend c6fb130 and 0 on 46073d30; make test exited 0 on ca0ab46. Backend vet-and-test run 2783 succeeded. All SELF.
Impact: task card only.
Refs: .task/fix-u7-k4-artifact-upload.md
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: the restored drill passed artifact recovery, and the handbook, checklist, and collaboration plan have to say so without opening write traffic.
Evidence: backup-20261013-013354 on Dev a83588dd and backend 46073d30; K1-K7 true, RPO 65s, RTO 3s, five artifacts matched, cross-user access 404. SELF. Documents 5335499 is PR #92.
Impact: C5 is marked SELF-pass. Second-instance writes stay closed until REPLAY or CI and a second host exist.
Refs: docs/svc.md docs/release-multi-instance.md modules/documents
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: include the current integration baseline before verification.

Evidence: fetched origin/main=5aebedebeb963b5c01f39fd9122ec60dbe6d34d3.

Impact: integrate upstream changes without rewriting task history.

Refs: task-sync
Why: bind the task validation checkpoint to the latest integration baseline.

Evidence: SELF recursive component checks; sync_base=5aebedebeb963b5c01f39fd9122ec60dbe6d34d3; candidate=d480b2d05818644b620d9874380b786746c81ea8.

Impact: task metadata only.

Refs: .task/fix-u7-k4-artifact-upload.md
Retain the task-sync receipt
ci / svc-realcombo (pull_request) Successful in 2m0s
ci / test-pg (pull_request) Successful in 2m52s
ci / test (pull_request) Successful in 4m56s
6d8b746e92
Why: acceptance has to record that this branch contains the current main before review.
Evidence: make task-sync exit 0; sync_base=5aebedebeb; merge d480b2d058; checkpoint 4a06bb4991. SELF.
Impact: task metadata only.
Refs: .task/fix-u7-k4-artifact-upload.md
Co-authored-by: Cursor <cursoragent@cursor.com>
Author
Owner

Independent review of Backend #186 (46073d30) and Dev #497 (6d8b746e) approved with no blockers.

The reviewer did not implement the change. blobstore.IsNil treats a nil interface and a typed nil *S3 as unconfigured. finishOpen still uses NewLocal / OpenLocalExisting. Configured S3 is kept. app.go and the HTTP contract are unchanged. cross_artifact_roundtrip strips BLOBSTORE_S3_*, uploads on A, downloads on B, and compares sha256. The handbook and checklist keep the 2026-10-13 K4 drill as SELF and do not release second-instance writes.

Note, not a change request: the typed-nil store test covers createArtifacts=true (NewLocal), which is the production path. OpenLocalExisting is unchanged and not retested with a typed nil.

Independent review of Backend #186 (`46073d30`) and Dev #497 (`6d8b746e`) approved with no blockers. The reviewer did not implement the change. `blobstore.IsNil` treats a nil interface and a typed nil `*S3` as unconfigured. `finishOpen` still uses `NewLocal` / `OpenLocalExisting`. Configured S3 is kept. `app.go` and the HTTP contract are unchanged. `cross_artifact_roundtrip` strips `BLOBSTORE_S3_*`, uploads on A, downloads on B, and compares sha256. The handbook and checklist keep the 2026-10-13 K4 drill as SELF and do not release second-instance writes. Note, not a change request: the typed-nil store test covers `createArtifacts=true` (`NewLocal`), which is the production path. `OpenLocalExisting` is unchanged and not retested with a typed nil.
weichen added 3 commits 2026-10-13 01:55:01 +00:00
Why: Dev has to follow the commits that landed on Backend and Documents main, which share trees with the drilled objects.
Evidence: Backend dc736e339d01 tree 498f61947564 equals 46073d30. Documents 05c13a42b14d tree equals 5335499. GATE run 2794 on 6d8b746 succeeded before this pin.
Impact: gitlinks move to the merge commits. Second-instance writes stay closed.
Refs: #186 #92 #497
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: bind the task validation checkpoint to the latest integration baseline.

Evidence: SELF recursive component checks; sync_base=5aebedebeb963b5c01f39fd9122ec60dbe6d34d3; candidate=b35d9946bc917b8d490a1352599e357ca42317b2.

Impact: task metadata only.

Refs: .task/fix-u7-k4-artifact-upload.md
Retain the pre-merge sync receipt
ci / svc-realcombo (pull_request) Successful in 1m50s
ci / test-pg (pull_request) Successful in 2m48s
ci / test (pull_request) Successful in 4m41s
3fc9be3bb7
Why: the pinned head has to show it already contains origin/main before the final CI.
Evidence: make task-sync exit 0; already up to date; sync_base=5aebedebeb; tested_head=b35d9946bc. SELF.
Impact: task metadata only.
Refs: .task/fix-u7-k4-artifact-upload.md
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen added 3 commits 2026-10-13 02:01:26 +00:00
Why: include the current integration baseline before verification.

Evidence: fetched origin/main=6193db1b548b964ab3133557ddbb9d83a3643d31.

Impact: integrate upstream changes without rewriting task history.

Refs: task-sync
Why: bind the task validation checkpoint to the latest integration baseline.

Evidence: SELF recursive component checks; sync_base=6193db1b548b964ab3133557ddbb9d83a3643d31; candidate=e2e3d254184a04043b9cf79928851624ad5551cb.

Impact: task metadata only.

Refs: .task/fix-u7-k4-artifact-upload.md
Retain the sync receipt for the RDM main
ci / svc-realcombo (pull_request) Successful in 1m49s
ci / test-pg (pull_request) Successful in 2m46s
ci / test (pull_request) Successful in 4m52s
42ba9cdf7d
Why: main gained the RDM admin recovery after the previous CI, and this head has to contain it.
Evidence: make task-sync exit 0; sync_base=6193db1b54; merge e2e3d25418. SELF. No store-open change, so the K4 drill is not rerun.
Impact: task metadata plus the upstream frontend pin and svc admin tooling.
Refs: .task/fix-u7-k4-artifact-upload.md
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen added 3 commits 2026-10-13 02:07:48 +00:00
Why: include the current integration baseline before verification.

Evidence: fetched origin/main=e23cee5561ecb90ba3d52980b239990c0f4def4f.

Impact: integrate upstream changes without rewriting task history.

Refs: task-sync
Why: bind the task validation checkpoint to the latest integration baseline.

Evidence: SELF recursive component checks; sync_base=e23cee5561ecb90ba3d52980b239990c0f4def4f; candidate=62422afe5dd3b0bc1b0bf9a1af9fd96f60ecbba2.

Impact: task metadata only.

Refs: .task/fix-u7-k4-artifact-upload.md
Retain the sync receipt for the archived RDM card
ci / svc-realcombo (pull_request) Successful in 1m59s
ci / test-pg (pull_request) Successful in 2m53s
ci / test (pull_request) Successful in 4m59s
cfa8230d4c
Why: main archived the RDM recovery card after the previous CI, and the branch head has to contain that main.
Evidence: make task-sync exit 0; sync_base=e23cee5561; merge 62422afe5d. SELF. Card archive only.
Impact: task metadata.
Refs: .task/fix-u7-k4-artifact-upload.md
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen merged commit bb5343ca0d into main 2026-10-13 02:13:04 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Dev#497