simocracy-v2 · create-event-add-council

Create event and add sim to council

@daviddao

End-to-end sanity check on production: author a brand-new org.simocracy.gathering from the /events gallery, then appoint a sim to its council from the detail-page sidebar.

Date: 2026-04-23 · Target: www.simocracy.org · Account: satyam2.climateai.org · did:plc:cpoagodpqrgs4t7thi5z37uf · pass


Headline result

2
Writes (create + council update)
1
Council member added
0
Blockers
2
Known quirks

Headline. Both halves of the flow succeeded against production. A new gathering record was written at at://did:plc:cpoagodpqrgs4t7thi5z37uf/org.simocracy.gathering/3mk74aics4c2a, and a subsequent PUT added FixTestSim to its councilSims. The event's sidebar now reports 1 council member and the sim sprite walks in the gathering world.

Walkthrough

01Starting state: /events gallery, signed in as satyam2.climateai.org, four events listed, CREATE AN EVENT visible.
02Create an Event dialog — all controls render: name, type, sprite size, scope, building image presets, descriptions, dates, location, URL, treasury, mechanism, templates.
03Dialog filled in: Test Event — Add Council Sim, Governance, Normal sprite size, Council-only scope, Senate building, virtual location, April 23, 2026, short + long description.
04Event detail page loads directly from the PDS record — empty Senate world, 0 sims, no council yet.
05Building clicked → sidebar opens → Council tab selected. + Add Council Member is the only action.
06Sim picker overlays the world — populated from the Simocracy indexer (50+ sims). Picked FixTestSim.
07After the PUT: sidebar reads 1 council member / FixTestSim, localCouncilSims state reflects the new entry, and the sim sprite walks in the gathering world.

Findings

Create-event flow writes a correct org.simocracy.gathering

POST /api/records returned 200 and the PDS now holds the expected record. gatheringType, simSize, simScope, status, location, dates, description, shortDescription, allocationMechanism all round-trip cleanly. No client-side form validation error, no server error. com.atproto.repo.getRecord confirms the write.

Add-council flow writes councilSims as a StrongRef list

Selecting FixTestSim in the picker fires updateCouncil()PUT /api/records. The updated PDS record contains councilSims: [{ uri: "at://did:plc:cpoagodpqrgs4t7thi5z37uf/org.simocracy.sim/3mjvl44sf5c2e", cid: "" }] and the new CID differs from the original. The sidebar immediately shows 1 council memberlocalCouncilSims optimistically reflects the change before the indexer catches up.

cid is an empty string on council StrongRefs

Looking at components/events/gathering-world.tsx, the picker's onSelect builds { uri: sim.uri, cid: "" } — it doesn't carry the sim's actual CID through. The record is valid against the lexicon (cid is a required string, just empty), but this weakens the guarantee of a StrongRef (point-in-time content hash). Either fetch the CID during the picker query or tighten the lexicon to disallow empty strings.

Events gallery lags behind newly-created events

Immediately after Event created!, handleCreated → window.location.reload() re-fetches via the Simocracy indexer. In this run the new gathering didn't appear on /events for ~20 s (carried over from the r2 note on gathering-default-constitution). Direct navigation to /events/<did>/<rkey> works immediately because the detail page reads the PDS, so this is an indexer-lag / optimistic-cache issue on the gallery only.

Tooling note: agent-browser eval triggered an unrelated navigation

Mid-run, several agent-browser eval … calls caused the tab to navigate to an unrelated http://localhost:8765/ page (a separate project on the host), wiping the session state. Switching from --session-name simocracy-qa (persistent) to an isolated --session nav-isolated and re-injecting the session-token cookie avoided the issue. Not a product bug — flagged only so the next agent running this flow knows to keep eval usage minimal against the persistent QA session.

Reproducing

DID=did:plc:cpoagodpqrgs4t7thi5z37uf
RKEY=3mk74aics4c2a

# 1. create-event POST
#    (fired from the CREATE AN EVENT dialog's Create Event button)
curl -s "https://climateai.org/xrpc/com.atproto.repo.getRecord" \
  --data-urlencode "repo=$DID" \
  --data-urlencode "collection=org.simocracy.gathering" \
  --data-urlencode "rkey=$RKEY" \
  -G | jq .

# → councilSims: [{ uri: "at://did:plc:cpoagodpqrgs4t7thi5z37uf/org.simocracy.sim/3mjvl44sf5c2e", cid: "" }]
Targetwww.simocracy.org · commit JDGYYAXuoZESssS3mdoxrRBRLmeL (build id) Accountsatyam2.climateai.org · did:plc:cpoagodpqrgs4t7thi5z37uf Event URIat://did:plc:cpoagodpqrgs4t7thi5z37uf/org.simocracy.gathering/3mk74aics4c2a Event detail/events/did:plc:cpoagodpqrgs4t7thi5z37uf/3mk74aics4c2a Council simFixTestSim · at://did:plc:cpoagodpqrgs4t7thi5z37uf/org.simocracy.sim/3mjvl44sf5c2e Toolingagent-browser (isolated session with injected session-token cookie) + curl against the PDS for verification Screenshotsassets/*.png — all 1280×577, under the 1500 px height cap