PoracleNG v2 API Review & PoracleWeb.NET Migration Plan¶
Lead architect synthesis of architecture, db-elimination, tracking-types, performance, security, testing, optimization, and source-verification (researcher) reviews of PoracleNG v2 (issue #138 / PR #139, "huma" framework).
Companion to
poracleng-enhancement-requests.md. That doc tracks v1-era workaround gaps; this doc evaluated whether v2 closes them and what we would still have to ask for.
Area writes: updated 2026-10-21
Row 1 ("NOT closed") and every other claim below about user-fence area writes predate sub-project 2.
Area writes now go through PoracleNG 5.4.0's v2 routes (trusted setAreas, rename and remove with
all_profiles), with no direct database write behind them. This page is a historical review.
Historical record, written 2026-08 against an open pull request
This review was written against PoracleNG PR #139 (branch huma-api-migration) while it was still
open. Every "source-verified" claim in it is a claim about that branch, not about a release. v2 has
since shipped in PoracleNG 5.2.0, and the fixes it asked for shipped in 5.4.0, which PoracleWeb.NET
now requires. Poracle:TrackingApiVersion no longer exists.
Read it for the reasoning, not for the current state. Three of its recommendations were overtaken:
- The flag is
Poracle:TrackingApiVersion(auto|v1|v2), notPoracle:ApiVersion. - It recommends migrating reads first, writes after. The opposite shipped, and for a reason the
review could not have known: v2 answers
nullfor every field at its wildcard where v1 answers the sentinel, so a v2 read would need a per-field default table matching PoracleNG's exactly. One write moved instead — the pokemon PUT. - Its advice to keep
include_descriptionsoff except on the profiles-overview page is superseded. Descriptions are now on for nine tracking types across eight alarm list pages, which is whatRuleSummaryComponentrenders.
Appendix A's asks were later filed as jfberry/PoracleNG#208 through #216 and fixed in PR #217, merged 2026-08-31 and released in 5.4.0. Where each ask now stands is tracked in the enhancement requests, which is the document kept current.
Two of that batch were built against a running develop on 2026-09-16 and do not close the rows
this review says they would, which is worth knowing before planning from the scorecard below:
- The keystone
trustedflag onsetAreaslifts the community area restriction as well asuserSelectable, so it cannot be used on the one call that carries user-supplied area names (#228). There is also no profile target for the all-profiles writes, and the per-ruleoverride_areaswrite is still refused outright. Row 1 stays open, and so do rows 5 and 6. - The admin list route's projection omits the three columns the admin grid renders
(#229), so row 2 stays open and
HumanRepository-- andPoracleContext-- stay with it.
Both of those are now out of date too, as of PR #230
(merged 2026-10-06, not yet released). #230 fixed trusted's scoping properly -- it lifts
userSelectable only, confirmed by jfberry -- closing #228, and closed #229 by adding the three
columns. Row 1 is partially closed (three of six IUserAreaDualWriter methods adopted the trusted
path; the other three stay blocked on a profile target and on a trusted per-rule create, which v2
tracking updates have but creates do not) and row 2 is closed, both in PoracleWeb.NET
#838/#937
and #839/#936
respectively. As with everything else on this page: this note is itself a point-in-time correction, not
a live status -- the enhancement requests doc is still the one
kept current.
The reads-first recommendation is not merely reordered but abandoned. Restoring the v1 shape from a v2
read needs the stored wildcard for 137 nullable fields across eleven schemas, and the server publishes
none of them: no property carries a machine-readable default. Since TrackingFieldPreserver re-reads
a row before a PUT, a wrong wildcard is written back rather than merely displayed. Migrate a type --
read, write and delete together -- rather than a verb.
Invasion, listed here as staying on v1, no longer does: it writes through v2 where the server carries
grunt_type and its masterdata lists the name.
What actually shipped is documented in The v2 write path and Version compatibility. Kept as written, apart from this banner and the corrections marked below, because the reasoning behind each ask is still the reasoning.
Executive Summary¶
PoracleNG v2 is a strong, well-shaped API surface that PoracleWeb.NET should adopt. The full human-scoped snapshot (GET /api/v2/humans/{id}/tracking → {human, tracking, profiles, locations, summaries}) collapses our dashboard/bootstrap reads into one round-trip, the wrapper-free typed bodies delete reams of JsonElement unwrap plumbing, and strict typing + RFC 9457 errors are exactly the defense-in-depth that the March 31 NULL-template incident demanded.
But the headline goal of this review — eliminate all direct access to the Poracle DB — is NOT achievable on v2 as currently designed. The researcher verified against PR #139 source that the three load-bearing direct-DB touchpoints are each blocked by a missing endpoint or an unbypassable filter:
-
Trusted setAreas (the
IUserAreaDualWriterHACK) — NOT closed.v2_humans.go registerV2HumanSetAreasmirrors v1HandleSetAreas: for non-admins it skips every fence where!f.UserSelectable. Our user-drawn geofences are serveduserSelectable=false, so their names are still silently dropped. The new per-ruleoverride_areasfield does not rescue this —validateOverrideFields(tracking.go) checks each override againstGetAvailableAreas, which for non-admins also excludesuserSelectable=falsefences (bot/area_logic.go), returning a 400. This is the single most important blocker and it requires a new PoracleNG capability. (Half wrong, both ways: theoverride_areasrefusal never happened, because that check was dead code — see the re-test. ThesetAreasfilter is real, was re-confirmed on 5.2.1, and the capability now exists ondevelopas an opt-intrustedflag.) -
Admin list-all-humans, batch name/avatar resolve, full-purge delete — NONE exist in v2. All v2 human endpoints are single-
{id}-scoped. These three keepHumanRepository(and thereforePoracleContextand the entire Poracle-DBDatadependency) alive.
Net consequence: without three explicit asks to jfberry, the keystone deletion (PoracleContext + the 10 alarm entities, ~800 LOC) cannot happen. What we can delete unconditionally on v2 is the proxy unwrap helpers, StripUidZero, PoracleJsonHelper's coercion machinery, and the dead ProfileRepository / dead HumanRepository methods — a real but smaller win (~600–700 LOC).
Recommended posture (as written): adopt v2 behind a Poracle:ApiVersion flag, migrate reads first (snapshot), then writes after a strict-payload audit, while sending jfberry the three High-priority asks below (trusted setAreas, admin list, batch resolve). Treat v2 wire shapes as not yet frozen — PR #139 is still OPEN.
What shipped instead: the flag is
Poracle:TrackingApiVersionand the order reversed — one write path (the pokemon PUT) moved first, reads stayed on v1. See the banner above.Source-verified against branch
huma-api-migration(PR #139): theuserSelectablefilter inregisterV2HumanSetAreas(v2_humans.go:518-522), theoverride_areas→GetAvailableAreasgate (tracking.go:266,322), the absence of any admin list/delete-human endpoint (fullRegisterV2Humansset), theactive_hoursday0-6/Sun=0 schema with no cross-midnight (v2_profiles.go:43,71), andblocked_alertsas a read-only field on the human GET. Correction vs our older gap-tracker:monsters.gonow already doesCOALESCE(template, '') AS templateon this branch — the template crash vector is closed; onlypingis still selected raw (see ask #4).
What v2 Gets Right (for us)¶
- Full snapshot in one call.
GET /api/v2/humans/{id}/tracking(+?all_profiles=true) folds human, areas, profiles, locations, all tracking, and summaries into one typed response — replaces our/auth/me+/api/dashboard+/api/areas+/api/profiles+/api/locationsfan-out. Confirmed to coverDashboardService's count needs. - No wrappers. Typed bodies directly — deletes the
{human:{...}}/{profile:[...]}/{type:[...]}/{status:ok}unwrap branches inPoracleHumanProxy/PoracleTrackingProxyand theDeserializeHuman/DeserializeProfileshand-parsers. - Strict types, no coercion. Game-master ids as ints, fixed categories as string enums, flags as bools. Lets us drop the defensive
JsonValueKindswitches (and the IDE0072 suppressions) and thePropertyNameCaseInsensitivetolerance. cleansplit into independent booleans (clean/edit/summary). Genuinely better than the 3-bit bitmask we compose client-side — we want it, provided bot-set bits survive partial writes.- POST-array create keeps the
{created,updated,unchanged}diff. Matches today'sTrackingCreateResultflow; we depend on the created UID round-tripping for the optimistic UI. - RFC 9457 problem+json. A structured error contract we can map to typed exceptions, directly addressing the class of failure that motivated the proxy migration.
- No
uid:0sentinel. Explicit POST(create)/PUT(replace)/DELETE removes theStripUidZeromagic. - Saved-locations editor (
PUT /{label}) and typedactive_hoursare net-new capabilities we can surface.
Direct-DB Elimination Scorecard¶
| # | Touchpoint (file) | What it does | v2 status | What's needed to eliminate |
|---|---|---|---|---|
| 1 | UserAreaDualWriter + 6 UserGeofenceService callsites + AreaController.UpdateAreas merge-back |
Direct dual-write of humans.area + profiles.area because setAreas strips userSelectable=false names; forces manual ReloadGeofencesSafeAsync |
NO (verified: v2 setAreas mirrors v1; override_areas blocked by same filter) |
Trusted setAreas variant (secret-gated, bypasses userSelectable, per-profile + all-profiles, triggers internal reloadState) — ask #1 |
| 2 | HumanRepository.GetAllAsync → AdminController.GetAllUsers |
Admin user-list enumerates whole humans table | NO | GET /api/v2/humans paginated admin list — ask #2 |
| 3 | HumanRepository.GetByIdsAsync → UserGeofenceService.GetAllWithDetailsAsync |
Batch-resolve owner/reviewer names for admin geofence submissions UI | NO | Batch human resolve endpoint — ask #3 |
| 4 | HumanRepository.DeleteUserAsync → AdminController.DeleteUser |
Full account purge | NO | DELETE /api/v2/humans/{id} cascade — ask #4 |
| 5 | UserGeofenceService non-active-profile cleanup (RemoveAreaFromAllProfilesAsync, spans every profiles.area) |
Remove deleted geofence from all profiles | NO | Trusted setAreas with all_profiles targeting — folded into ask #1 |
| 6 | HumanRepository.GetByIdAndProfileAsync (UserGeofenceService submission display name, :292) |
Read human name for Discord forum post | PARTIAL | GET /api/v2/humans/{id} covers the read; swap now (independent of trusted-areas) |
| 7 | LocationController.UpdateLanguage → HumanService.UpdateAsync → HumanRepository.UpdateAsync |
Generic direct-DB human update for language | YES | POST /api/v2/humans/{id}/language exists — swap now |
| 8 | ProfileRepository (all methods) + ProfileService.Create/Update/Delete |
Dead code — controllers already use proxy | YES | Delete outright; v2 profile endpoints exist |
| 9 | HumanRepository.GetByIdAsync/ExistsAsync/CreateAsync |
Dead — service uses proxy | YES | Delete dead methods |
| 10 | ~~HumanRepository.DeleteAllAlarmsByUserAsync~~ |
Dead — service loops via proxy | DONE | Deleted in #707 (its ExecuteDeleteAsync calls could not run on MariaDB anyway); one-shot purge endpoint is still a nice-to-have (ask #6) |
| 11 | DashboardService.GetAllTrackingAsync (proxy, not direct DB) |
Fetches full payloads to count | YES | Snapshot/counts — perf win, not DB elimination |
Verdict: rows 6–11 close on v2 (some are pure dead-code deletion). Rows 1–5 — the entire reason PoracleContext still exists — require four new PoracleNG capabilities. Until those land, HumanRepository shrinks to ~3 admin methods that still pin PoracleContext, and UserAreaDualWriter stays in full.
Answering the maintainer's 6 open questions¶
- Q1 (collection scoping). Keep the human-scoped sub-resource
/api/v2/humans/{id}/tracking[/{type}][/{uid}]?profile={n}. PoracleWeb.NET is always single-human-scoped; a flat?user=&profile=collection would forceuserinto every query and lose the ownership boundary. We do not need a/users/{id}/alias. - Q2 (create response). Keep
{created,updated,unchanged}— we depend on the created UID round-tripping. Enhancement: return the full resulting rule objects in each bucket (with applied defaults), not just UIDs, so we can hydrate cards without a follow-up GET. - Q3 (int/enum split). Correct as-is. Keep
team/gender/rsvp_changes/fort_typeas string enums, game ids as ints, flags as bools. Theclean→3-booleans split is good; confirm all three are independently settable and bot-set bits survive partial writes. - Q4 (invasion two-axis + incident). Two-axis fits our UI (we already carry
typeId). Caveat: moving fromgrunt_typestring to integertype_id/grunt_idrequires a published id dictionary so our Angular table doesn't drift. Confirmincident.display_typeis a different dictionary than invasiontype_id, and that read-back returns the same axis we wrote. - Q5 (discrete action endpoints + typed active_hours). Discrete endpoints suit us. Typed
active_hoursis good — but day numbering flips from our 1-7 Mon-Sun to v2's 0-6 Sun=0, and v2 forbids cross-midnight ranges. Documentday=0=Sundayandstep/end_hours/end_minssemantics authoritatively. - Q6 (v1 dependencies missing in v2). Yes — admin list-all-humans, admin full-purge delete, and batch human resolve. These are hard blockers to a DB-free PoracleWeb.NET.
New Capabilities to Build (unblocked by v2)¶
incidentalarm type (shipped). Genuinely new (facade over invasion,display_typeint). Full four-layer wiring per CLAUDE.md (model +IncidentCreate/Update, controller with[RequireFeatureEnabled],DisableFeatureKeysentry, Angular module/route/guard/nav). **Do not under-scope as "another invasion".display_typeis a different dictionary. Effort: L.forttype. We already haveFortChangemodel/UI; reconcileinclude_emptydefault (v2 = TRUE, ours = 0) and convert int flags to bools. Effort: S–M.maxbattle. Model/UI exist; addgmaxbool +moveint coverage. Effort: S.pokemon.pvp_ranking_evolution(int 0/2/3) — additive field onMonsterCreate/Update. Effort: S.- Saved-locations editor. The v2
PUT /{id}/locations/{label}enables in-place edit of saved locations. Effort: S. blocked_alerts. Read-only per-user authz signal (derived from Discord roles). Consume from the snapshot to hide/disable alarm-type nav + add-dialogs per user (distinct from globaldisable_*gates). Mapmonster→pokemon. Effort: M.
Risks & Gotchas¶
override_areasis a trap. Per-rule, not the human/profile area subscription list, and source-verified to be gated by the sameuserSelectablefilter. Adopting it expecting a filter-bypass would silently reintroduce the geofence-persistence regression. Do not deleteUserAreaDualWriteruntil a confirmed trusted human-level areas op exists. (The gate was dead code and accepted everything; PR #217 makes it live. The conclusion is unchanged — see the re-test.)- PUT full-replace footgun. v2 PUT resets omitted fields to defaults — incompatible with our
ApplyUpdatenull-skip merge. A naive partial PUT silently zeroes IV/CP/PvP/template — echoing the NULL-template incident. Route single-field edits through POST-array-diff or send the complete object. (Confirmed live on 5.2.1: omittingmin_ivwiped a stored 90. The complete object is what ships —TrackingFieldPreserverre-reads the row and fills in anything the model does not declare before the PUT.) active_hoursday off-by-one. 1-7 Mon-Sun → 0-6 Sun=0 is a silent, high-blast-radius corruption. v2 also bans cross-midnight ranges. (Correction: the 0-6 numbering is the OpenAPI schema's, and the schema is wrong. The scheduler uses ISO weekdays, Monday 1 through Sunday 7 (isoDowinprocessor/cmd/processor/profiles.go), so the schema rejects Sunday and accepts a meaningless 0. No shim was needed or written; 1-7 is correct and stayed. The cross-midnight ban is real, andActiveHoursValidatorenforces it on repeating entries.) Needs a translation shim and dedicated round-trip tests (the existing suite tests string coercion'09'/'00'and 1-7 numbering — these invert under v2 and must be rewritten, not find-replaced).- Strict 422 rejection. Unknown fields and wrong types hard-fail. Our snake_case proxy currently sends ints for enums and string-coerced hours in places — a full payload audit is mandatory before flipping writes.
- Snapshot payload bloat. For power users (500+ alarms) the snapshot is hundreds of KB. Do not use it for the lightweight badge path — use a counts projection/selective includes, keep
include_descriptionsOFF except on the Profiles-overview page, add client-side dedupe + ETag/304 if offered. - RFC 9457 reflected input.
errors[].value/detailecho submitted input — sanitize at the proxy boundary before surfacing to the SPA. - Trust model unchanged.
X-Poracle-Secret= full impersonation of any human id. If admin list/delete/resolve are added but reachable without the secret (e.g. via public/docs), they become mass-enumeration/deletion vulns. Verify secret-gating before adopting. - PR #139 is OPEN. Wire shapes may shift; pin a vendored
openapi.jsonas a golden contract fixture and treat shapes as not-yet-frozen. (Closed: PR #139 merged and shipped as 5.2.0.TrackingV2Translatoris built from 5.2.1'sopenapi.golden.json.) monsters.goCOALESCE — closed.COALESCE(template, '') AS template, clean, ping,is onmain, not only on the v2 branch, so the template DoS vector (one NULL row crashing state reload for everyone) is closed in the release line.pingis still selected raw but is declaredNOT NULLon every tracking table PoracleNG creates, so there is no second crash to guard against.
Appendix A — Prioritized API Change Requests to PoracleNG (feedback for issue #138)¶
The three High asks (trusted setAreas, admin list, batch resolve) are the gating set for full DB elimination.
Since filing: asks 1, 2, 3 and 5 went upstream as #215
and #214 and are fixed on develop in PR #217, which no
release carries. Ask 4 is closed — monsters.go on main selects COALESCE(template, '') AS template, and
ping is declared NOT NULL on every tracking table in PoracleNG's initial schema, so the parity nit has
nothing to fix. The active_hours half of ask 8 is settled by #208:
the convention is ISO 1-7, not 0-6. Ask 12's cascade question is answered — SQLHumanStore.DeleteProfile
deletes the profile's tracking rows and moves current_profile_no to the lowest remaining profile. The rest
stand.
| # | Priority | Ask | Proposed shape |
|---|---|---|---|
| 1 | High | Trusted setAreas variant (bypass userSelectable filter) — keystone blocker. Only thing that lets us delete IUserAreaDualWriter + 6 callsites + the merge-back + manual reloads. The filter is a browser-hack defense, meaningless against a caller holding X-Poracle-Secret. |
POST /api/v2/humans/{id}/areas?trusted=true&profile={n\|all} body {areas:[...], mode:add\|remove\|replace}; secret-gated; runs reloadState internally. Alternative (most defensible): per-fence ownedBy:humanId so the intersection admits owned fences regardless of userSelectable. |
| 2 | High | Admin list-all-humans (paginated). Keeps HumanRepository.GetAllAsync → PoracleContext alive. |
GET /api/v2/humans?limit=&offset=&search=&community= → {humans:[{id,name,type,enabled,admin_disable,current_profile_no,language,last_checked,disabled_date,notes}], total}. Secret-gated. Must include last_checked/disabled_date (admin grid shows them). |
| 3 | High | Batch human display-name/avatar resolution. GetByIdsAsync resolves N owner+reviewer ids in one query for the admin submissions UI; per-id fan-out is a perf regression. |
GET /api/v2/humans?ids=a,b,c → [{id,name,type,avatar?}] or POST /api/v2/humans/resolve {ids:[...]}. Minimal projection. Secret-gated. |
| 4 | Medium | monsters.go COALESCE parity — template already fixed on huma-api-migration, ping still raw. Verified: line 97 now reads COALESCE(template, '') AS template, clean, ping,, so the original template crash vector (the incident that motivated our proxy migration) is closed there. But ping is still selected raw — if nullable, that's the same converting NULL to string crash class. |
Confirm ping is NOT NULL in schema, or COALESCE(ping,'') AS ping for parity with the other tracking files. Also confirm the template fix is in the release line we deploy, not only the v2 branch. |
| 5 | Medium | Admin delete-human (full purge). Last admin write with no v2 mapping. | DELETE /api/v2/humans/{id} → {deleted:{human,profiles,tracking}}; cascades all profiles/tracking/locations/roles. Secret-gated, idempotent. |
| 6 | Medium | Return full rule objects in {created,updated,unchanged}. Eliminates our post-create re-fetch. |
Each bucket returns full rule (incl. uid + applied defaults). Confirm POST-array upsert preserves omitted fields (vs PUT full-replace). |
| 7 | Medium | Publish integer dictionaries (invasion type_id/grunt_id, incident display_type). Our hardcoded Angular tables must match exactly. |
In openapi.json or /api/v2/dictionaries. Confirm read-back returns the same axis written; clarify whether invasion type_id == incident display_type dictionary. |
| 8 | Medium | Document sentinel→null mapping + active_hours day convention. distance=0='use areas' is meaningful, not absent. |
Annotate each field's null-meaning/omit-default in OpenAPI; flag distance:0. Document day=0-6 (0=Sunday), step/end_*, no-wrap. Echo-on-read. |
| 9 | Medium | Bulk field-update (PATCH) for distance/clean. Replaces O(N) fetch-modify-POST; PUT full-replace makes per-uid updates more dangerous. | PATCH /api/v2/humans/{id}/tracking/{type}?profile=N body {uids?:[...]\|all:true, distance?, clean?, edit?, summary?} → {updated:[uids]}. |
| 10 | Medium | Surface blocked_alerts in the snapshot + confirm reject semantics. Per-user authz we should respect. |
Include in GET …/tracking; document monster=pokemon/specificgym/specificstation; confirm POST of a blocked type returns 403/422 (not silent-unchanged). |
| 11 | Medium | Versioned /api/v2/openapi.json as a golden contract fixture. Our mocked tests can't catch wire drift (the NULL-template blind spot). |
semver/etag, published per release, so we vendor it and add a build-time contract test. |
| 12 | Low | Confirm profile-DELETE cascade + single-call all-types purge. | Document DELETE …/profiles/{n} cascades tracking, reassigns current_profile_no, refreshes humans.area, rejects last profile (422). Add DELETE …/tracking?all_profiles=true. |
| 13 | Low | Sanitize/document RFC 9457 error echo. errors[].value/detail can reflect attacker input. |
Document they contain only caller-submitted values; optional X-Poracle-Verbose-Errors:false. |
Appendix B — PoracleWeb.NET Migration Sequence¶
Phase 0 — Unconditional, no API dependency (do now):
| Step | Detail | Effort |
|---|---|---|
| 0a | Swap LocationController.UpdateLanguage to proxy SetLanguageAsync (→ POST /api/v2/humans/{id}/language). Removes the last live HumanRepository.UpdateAsync caller. |
S |
| 0b | Swap UserGeofenceService:292 display-name read to proxy GetHumanAsync. |
S |
| 0c | Delete dead ProfileRepository/IProfileRepository + ProfileService CRUD; dead HumanRepository methods (GetByIdAsync/ExistsAsync/CreateAsync; DeleteAllAlarmsByUserAsync already gone in #707) + EnsureNotNullDefaults. Update test mocks. Keep only GetAllAsync/GetByIdsAsync/DeleteUserAsync until v2 admin endpoints land. |
M |
Phase 1 — v2 read path (behind Poracle:ApiVersion flag): (not taken; see the banner — the flag is Poracle:TrackingApiVersion and the write path moved first)
| Step | Detail | Effort |
|---|---|---|
| 1a | Collapse IPoracleTrackingProxy + IPoracleHumanProxy into one IPoracleV2Client. Point reads at /api/v2, deserialize typed bodies, delete all unwrap branches + hand-parsers. Keep v1 as runtime fallback. |
L |
| 1b | RFC 9457 → typed PoracleApiException; handle 400→422; sanitize errors[].value/detail before surfacing to SPA. |
M |
| 1c | Add GetSnapshotAsync; re-point DashboardService, AreaController.GetSelectedAreas, profile/location reads, /auth/me resync at the cached snapshot. include_descriptions OFF; counts projection for the badge path. |
M |
Phase 2 — v2 write path (after strict-payload audit):
| Step | Detail | Effort |
|---|---|---|
| 2a | Strict-payload audit across all create/update builders: correct JSON types, no unknown fields, int↔enum translation, sentinel↔null mapping (preserve distance=0=use-areas). |
L |
| 2b | Keep POST-array upsert; never adopt PUT full-replace for partial edits. Verify CleanFlags bit preservation on the 3-boolean path. Drop StripUidZero. |
M |
| 2c | active_hours 1-7↔0-6 shim + typed-schema validator rewrite; update Angular day picker + utilities; drop string coercion. Rewrite (don't find-replace) the active_hours tests. |
L |
| 2d | Vendor openapi.json contract test; re-point proxy/service tests at /api/v2; shared typed-fixture builder to replace ~150 snake_case JsonElement fixtures. |
L |
Phase 3 — gated on API asks landing:
| Step | Detail | Effort |
|---|---|---|
| 3a | GATED on trusted setAreas: replace all 6 UserAreaDualWriter callsites + merge-back, delete the writer + interface + tests + manual reloads. Until then, keep the HACK + add a regression-lock test proving v2 setAreas still strips userSelectable=false. |
L |
| 3b | GATED on admin endpoints: re-point AdminController.GetAllUsers/DeleteUser/GetAllWithDetailsAsync at proxy; delete HumanRepository, then PoracleContext, the 10 Poracle-DB entities, the connection string, and the Human/Profile half of EntityMappingExtensions. Keep PoracleWebContext untouched. |
L |
Phase 4 — new capabilities: incident (four-layer, distinct dictionary), invasion two-axis, pvp_ranking_evolution, fort.include_empty reconcile, saved-locations editor, blocked_alerts consumption. Effort: L.
Phase 5 — gated on bulk PATCH: replace fetch-modify-POST across 8 alarm services + CleaningService with one PATCH; reconcile poracleng-enhancement-requests.md with v2. Effort: M.
override_areas re-test, 2026-08-24¶
The claim in the Executive Summary above — that validateOverrideFields refuses a userSelectable:
false fence with a 400, "the single most important blocker" — did not reproduce. It was a source
read against an open pull request, and it has never been confirmed by calling a server. It has now been
tested against two, and both accept.
Method. A real user-drawn geofence was inserted into the dev poracle_web database so PoracleWeb.NET's
feed served it with userSelectable: false and displayInMatches: false — the same shape a user's own
geofence takes. Both PoracleNG instances read that one feed, so both saw it after a reload. A human with
no admin role and no area restriction was created on each. This matters: the earlier probe used a fence
name that did not exist, which never reaches the filter being tested.
Control, run on the same human in the same session. setAreas with
["v2probe-fence", "aberdeen"] stored ["aberdeen"] on 5.1.0 v1 and on 5.2.1 v2. So the human was
demonstrably non-admin and the userSelectable filter was demonstrably live.
Result. With the filter proven live on the areas surface, the same fence name was accepted and
stored verbatim in override_areas by every write path tested:
| Server | Surface | override_areas sent |
Stored |
|---|---|---|---|
| 5.1.0 | v1 POST /api/tracking/pokemon/{id} |
["v2probe-fence"] |
["v2probe-fence"] |
| 5.2.1 | v1 POST /api/tracking/pokemon/{id} |
["v2probe-fence"] |
["v2probe-fence"] |
| 5.2.1 | v2 POST /api/v2/humans/{id}/tracking/pokemon |
["v2probe-fence"] |
["v2probe-fence"] |
| 5.1.0 | v1 | ["definitely-not-a-real-fence"] |
stored verbatim |
| 5.2.1 | v2 | ["definitely-not-a-real-fence"] |
stored verbatim |
All probe rows, the probe humans and the probe geofence were deleted afterwards and both instances reloaded; the feed is back to its 793 admin fences.
Why, established later. Filed as #211, where the
answer turned out to be that the check never ran at all: validateOverrideFields gates on
oc.permitted != nil, permitted is built from deps.AreaLogic, and processor/cmd/processor/main.go
never sets AreaLogic. Dead code on every tracking write, v1 and v2, all eleven types — still so on main
today.
So the class stays, and for a firmer reason than "unexplained negative". PR #217 wires the validation up, at
which point a v1 tracking write carrying an unpermitted override_areas starts answering 400 where it used
to answer 200. UserOwnedOverrideAreaProxy sends PoracleNG the filtered list and writes the full list to the
row itself, which stores the right value either way.
It also does not weaken blocker 1. The setAreas control above re-confirms it on 5.2.1 v2:
IUserAreaDualWriter and its HACK: trusted-set-areas sites stay on direct DB.