Under --reset-managed-namespaces, the deploy preview reports stale: 0 while the same run has queued every topic in the managed categories for deletion. The preview is the readout an operator uses to decide whether a destructive run is safe, and in this mode it does not describe what the run will do.
stale: 0 sits directly above purged: 1213. sow-topdata's wrapper prints, immediately before this block, "stale-policy=purge: of the pages counted as 'stale' below, they will be DELETED from NodeBB" (scripts/deploy-wiki.sh:148-158). Read together, the operator is told zero pages will be deleted on a run that would delete 1213.
Cause
planNodeBBDeploy (internal/topdata/wiki_deploy.go:498-506) adds the reset plans straight to result.Purged and then discards the manifest:
Nothing touches result.Stale, because the reset purge never goes through stale computation at all. It is a second, independent deletion path.
The documented model says otherwise
sow-topdata's wrapper documents the contract it was given, at scripts/deploy-wiki.sh:32-36 and :92-94: "the deployer deletes only pages the manifest says we wrote", and "crucible computes the stale set from the deploy manifest only: no manifest => nothing is stale => archive/purge delete nothing". Under --reset-managed-namespaces neither statement holds. That repo built a fail-closed gate (require_page_history, deploy-wiki.sh:99-117) on top of the assumption, and its recovery advice at :102 tells operators to re-seed with RESET=1 — the exact flag that bypasses the model the gate protects.
Scope of the reset enumeration
Worth stating plainly in the docs, because it is easy to assume otherwise: planManagedNamespaceReset (internal/topdata/wiki_deploy.go:685-730) calls client.listNamespacePages(cid) and queues every topic it returns. There is no filter on the managed-region marker that wiki/wiki.yaml configures (page_marker_prefix: sow-topdata-wiki). So the reset purges the whole category, including topics crucible never wrote. In the run above that is the 13-topic gap between 1213 purged and 1200 recreated.
That may well be the intent of a re-seed. The problem is that no output distinguishes "1200 pages I own" from "13 pages I have never seen", and the count that would have flagged it reads 0.
Suggested fix
Report the reset purges in a field that the preview's destructive-policy warning actually covers — either fold them into stale, or print a distinct line naming them as a namespace reset and how many of them are unrecognized. The unrecognized subset is the number worth surfacing, since those are the deletions a re-seed cannot undo.
Under `--reset-managed-namespaces`, the deploy preview reports `stale: 0` while the same run has queued every topic in the managed categories for deletion. The preview is the readout an operator uses to decide whether a destructive run is safe, and in this mode it does not describe what the run will do.
## What it looks like
sow-topdata `deploy-wiki`, `stale_policy=purge`, `reset_managed_namespaces=true`, dry run:
```
local pages: 1200
created: 1200
updated: 0
skipped: 0
stale: 0
archived: 0
purged: 1213
drifted: 0
```
`stale: 0` sits directly above `purged: 1213`. sow-topdata's wrapper prints, immediately before this block, "stale-policy=purge: of the pages counted as 'stale' below, they will be DELETED from NodeBB" (`scripts/deploy-wiki.sh:148-158`). Read together, the operator is told zero pages will be deleted on a run that would delete 1213.
## Cause
`planNodeBBDeploy` (`internal/topdata/wiki_deploy.go:498-506`) adds the reset plans straight to `result.Purged` and then discards the manifest:
```go
resetPlans, purged, err := planManagedNamespaceReset(opts, client, progress)
...
result.Purged += purged
manifest = wikiDeployManifest{Version: "nodebb-v1", Pages: map[string]wikiDeployManifestPage{}}
```
Nothing touches `result.Stale`, because the reset purge never goes through stale computation at all. It is a second, independent deletion path.
## The documented model says otherwise
sow-topdata's wrapper documents the contract it was given, at `scripts/deploy-wiki.sh:32-36` and `:92-94`: "the deployer deletes only pages the manifest says we wrote", and "crucible computes the stale set from the deploy manifest only: no manifest => nothing is stale => archive/purge delete nothing". Under `--reset-managed-namespaces` neither statement holds. That repo built a fail-closed gate (`require_page_history`, `deploy-wiki.sh:99-117`) on top of the assumption, and its recovery advice at `:102` tells operators to re-seed with `RESET=1` — the exact flag that bypasses the model the gate protects.
## Scope of the reset enumeration
Worth stating plainly in the docs, because it is easy to assume otherwise: `planManagedNamespaceReset` (`internal/topdata/wiki_deploy.go:685-730`) calls `client.listNamespacePages(cid)` and queues **every** topic it returns. There is no filter on the managed-region marker that `wiki/wiki.yaml` configures (`page_marker_prefix: sow-topdata-wiki`). So the reset purges the whole category, including topics crucible never wrote. In the run above that is the 13-topic gap between 1213 purged and 1200 recreated.
That may well be the intent of a re-seed. The problem is that no output distinguishes "1200 pages I own" from "13 pages I have never seen", and the count that would have flagged it reads 0.
## Suggested fix
Report the reset purges in a field that the preview's destructive-policy warning actually covers — either fold them into `stale`, or print a distinct line naming them as a namespace reset and how many of them are unrecognized. The unrecognized subset is the number worth surfacing, since those are the deletions a re-seed cannot undo.
Found while working ShadowsOverWestgate/sow-topdata#198.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Under
--reset-managed-namespaces, the deploy preview reportsstale: 0while the same run has queued every topic in the managed categories for deletion. The preview is the readout an operator uses to decide whether a destructive run is safe, and in this mode it does not describe what the run will do.What it looks like
sow-topdata
deploy-wiki,stale_policy=purge,reset_managed_namespaces=true, dry run:stale: 0sits directly abovepurged: 1213. sow-topdata's wrapper prints, immediately before this block, "stale-policy=purge: of the pages counted as 'stale' below, they will be DELETED from NodeBB" (scripts/deploy-wiki.sh:148-158). Read together, the operator is told zero pages will be deleted on a run that would delete 1213.Cause
planNodeBBDeploy(internal/topdata/wiki_deploy.go:498-506) adds the reset plans straight toresult.Purgedand then discards the manifest:Nothing touches
result.Stale, because the reset purge never goes through stale computation at all. It is a second, independent deletion path.The documented model says otherwise
sow-topdata's wrapper documents the contract it was given, at
scripts/deploy-wiki.sh:32-36and:92-94: "the deployer deletes only pages the manifest says we wrote", and "crucible computes the stale set from the deploy manifest only: no manifest => nothing is stale => archive/purge delete nothing". Under--reset-managed-namespacesneither statement holds. That repo built a fail-closed gate (require_page_history,deploy-wiki.sh:99-117) on top of the assumption, and its recovery advice at:102tells operators to re-seed withRESET=1— the exact flag that bypasses the model the gate protects.Scope of the reset enumeration
Worth stating plainly in the docs, because it is easy to assume otherwise:
planManagedNamespaceReset(internal/topdata/wiki_deploy.go:685-730) callsclient.listNamespacePages(cid)and queues every topic it returns. There is no filter on the managed-region marker thatwiki/wiki.yamlconfigures (page_marker_prefix: sow-topdata-wiki). So the reset purges the whole category, including topics crucible never wrote. In the run above that is the 13-topic gap between 1213 purged and 1200 recreated.That may well be the intent of a re-seed. The problem is that no output distinguishes "1200 pages I own" from "13 pages I have never seen", and the count that would have flagged it reads 0.
Suggested fix
Report the reset purges in a field that the preview's destructive-policy warning actually covers — either fold them into
stale, or print a distinct line naming them as a namespace reset and how many of them are unrecognized. The unrecognized subset is the number worth surfacing, since those are the deletions a re-seed cannot undo.Found while working ShadowsOverWestgate/sow-topdata#198.