Repository navigation
fix(import,license): importer stage cleanup, SafeError, single bundle verify, supabase users, read-only plan clock (D-0763, D-0764, D-0768, D-0785, D-0888) - #991
Conversation
|
Rebased onto origin/main and fixed the three failing ratchets from the review:
Verified locally with Note: |
|
Review fixes pushed. The wiki pages for nhost, Hasura Cloud and Postgres said a failed run keeps its stage; they now use the Supabase wording (kept only after a write, removed when refused before any write). That matches |
|
Rebased onto origin/main (clean) and fixed the nself-ci failure. TestApplyEntitlementRefreshFailureIsPublished faked a build that wrote the literal |
|
Rebased onto origin/main (6 new commits). Conflicts were in generated files only (.github/facts.json, .github/wiki/MCP-Tools.md); took main's side, then regenerated both (make cmd-inventory, wikigen) in 48aaf7b. schemas-check, wiki-check, mcpgen golden, importer, license, reconcile, repoqa, cmdregistry, tools and cmd/commands tests pass. |
…inary for --pipeline (P7-CI-20)
… (P7-CI-20 review round 2)
|
Rebased onto origin/main and resolved merge conflicts in .github/wiki/Drills.md, scripts/drill/legs/clean-host/lib.sh, scripts/drill/legs/clean-host/run, scripts/drill/legs/upgrade-continuity/run, and scripts/drill/stack-lock.sh. Kept both sides' intent: HEAD's stack-lock at /tmp with atomic takeover mutex, bounded probes, freshness fields, retrying row_digest, and stricter curl; incoming's importers drill row, bytes wording, and simpler drop-table check. Shellcheck passes on touched scripts. Force-pushed to dw9-cli-13 (be898fd). |
Rows
Runnow removes.nself/import/<run>/stagewhenreport.Wroteis false, not only on pass. A written, failed run and--keep-stagestill keep it.report.jsonalways stays. TestTestRefusedImportRemovesStagefails on main, passes here.importer.SafeError/NewSafeError(code, what).publicErrorpasses it through unchanged (also when wrapped) for E517/E518/E520/E521 when the text is plain (<=300 chars, valid UTF-8, no control or bidi characters). Sources build it only from fixed templates plus checked values.AllowMessagesstays for static texts.Input.Handoffcarries Detect's verifiedportable.Readerto Extract (nself source), andExtracted.Stagedcarries the verified staged reader torunBundle, so the stage is opened once and the source is opened once. Hash passes drop from about five to three (Detect, the streaming copy, the staged re-open). A handed-off reader keeps its identity snapshot and the copy still hashes every member, so a bundle altered after Detect is still refused with E516 (tested).+prefix (done in Go via a new variadicadjusthook onpostgres.WriteUsers, so it is unit-tested). The duplicate-phone preflight uses the same normalisation.is_anonymoususers are read when the column exists and listed inusers.anonymousin the report (new field, omitted when empty, golden files unchanged). Wiki page updated.license.WithReadOnlyClock(ctx):cacheTruststill verifies the entry and refuses a clock behind the stored mark, but does not raiselicense.clock.gatherPlan(update --plan/--yes planning) uses it. Needs the licence owner's confirmation at review: only the plan path is switched over; other licence checks still advance the clock.bundleEntitledFromCache/GraceandcacheTrustgained actxparameter.D-0781 not done
The preferred fix needs collection-group
runQuery(allDescendants, no collectionId at the root) and a pinnedreadTime. Neither can be exercised here (no Firestore or emulator on the worker), andreadTimeis limited to the last hour without PITR, so it would break the hours-long exports the row is worried about. Per-pattern counts for nested collections also cannot come from one collection-group COUNT when two parents share a collection id. This needs a design decision and a run against the emulator.Checks run
go build ./...okgo vet ./internal/importer/... ./internal/license/... ./cmd/commands/okgo test ./internal/importer/... ./internal/license/... ./internal/plugin/... ./internal/bundle/... ./cmd/commands/ -count=1: 6359 passed in 31 packages