Merged
Conversation
Add auth_nonces table + migration for nonce persistence and single-use verification Implement Substrate signature verification for /api/auth/verify (keep DEV_BYPASS_SIGNATURE for demo) Implement Humanode mainnet RPC eligibility check (v1: Session::Validators) with TTL caching in eligibility_cache Add tests for real signature flow and RPC gate caching (api-auth-signature.test.js, api-gate-rpc.test.js) Rewrite and reconcile simulation docs for consistency and remove legacy guidance across vortex-simulation-*.md
phase3(auth): finish wallet gating + harden local dev Add nonce expiry + per-IP rate-limit tests (api-auth-nonce.test.js) Fix stale “cookie not stored” warning in connect flow Default local Node API server to real gating/signature (demo mode via env) Update Phase 3 docs for connect/disconnect and current test coverage
Add JSON-safe feed:list seed (feedApi.ts) and include it in readModels.ts Implement GET /api/feed with optional stage filter and cursor pagination (index.ts) Wire local Node API router for /api/feed (dev-api-node.mjs) Switch Feed.tsx to load items via apiFeed() (apiClient.ts) Update docs + DTOs and add endpoint tests (vortex-simulation-api-contract.md, vortex-simulation-implementation-plan.md, api-feed.test.js)
Add READ_MODELS_INLINE_EMPTY mode so list endpoints return { items: [] } and singletons return minimal defaults when no read models exist
Add yarn db:clear to truncate simulation tables while keeping schema/migrations intact
Update local dev defaults so fixtures are opt-in (READ_MODELS_INLINE=true) instead of always showing seeded content
Add reusable NoDataYetBar and wire it into API-driven pages (chambers, proposals, feed, courts, factions, humans, drafts, formation, invision, CM panel)
Extend api-readmodels.test.js to cover empty/default responses for all Phase 4 read endpoints
Update README.md and simulation docs to reflect Phase 4 modes, scripts, and clean/seed workflow
Add append-only events table + migration and include it in migration tests Add event payload schema + pure feed projector with pagination + stage filtering Serve GET /api/feed from events in DB mode (fallback to read_models/inline modes) Extend yarn db:seed to also seed events deterministically and update yarn db:clear to truncate it Add new tests for event seeding and feed projection; update docs for Phase 5 and cursor opacity
Add deterministic pool quorum evaluator and advance proposals from pool to chamber vote once thresholds are met Make read_models writable in inline/DB modes to support stage transitions and generated chamber pages Reject pool voting once a proposal is no longer in pool stage (409) Add unit + integration tests covering quorum math, idempotency, and stage transition Update simulation docs to reflect new behavior and API notes
Add chamber.vote command with quorum/passing evaluation and optional yes-score (1–10) Persist chamber votes and CM awards (chamber_votes.score, cm_awards) and truncate in seed/clear scripts Auto-advance proposals vote → build (Formation) on pass and create minimal formation read models when missing Overlay live chamber vote counts in GET /api/proposals/:id/chamber Award CM once per passed proposal and overlay ACM deltas in /api/humans + /api/humans/:id Expand tests for vote flow, scoring, awards, and ACM updates; refresh docs/README
Add Formation schema + migrations (formation_projects, formation_team, formation_milestones, formation_milestone_events) Implement Formation store (DB-backed with memory fallback) and hook into POST /api/command Add commands: formation.join, formation.milestone.submit, formation.milestone.requestUnlock (+ feed events) Overlay live Formation state in GET /api/proposals/:id/formation Wire Formation actions in UI and add API client helpers Add Formation API tests and update docs/seed/clear scripts
Add courts schema + migration (court_cases, court_reports, court_verdicts) and update Drizzle schema Add /api/command writes: court.case.report and court.case.verdict (with gating + idempotency) Overlay /api/courts and /api/courts/:id with live reports and status Wire Courtroom UI to call the new court commands (report + guilty/not guilty) Add tests (api-command-courts.test.js) and update docs/seed/clear scripts
Add era_snapshots + era_user_activity tables and Drizzle schema/migration Track per-era user activity (pool/chamber/courts/formation) without overcounting on vote/command updates Overlay activeGovernors in proposal pool/chamber pages from the current era snapshot (SIM_ACTIVE_GOVERNORS, default 150) Overlay My Governance done counts from era activity when authenticated Add api-era-activity.test.js and refresh simulation docs for phase 10a
Add era_rollups + era_user_status tables (0010_era_rollup_status.sql) and Drizzle schema (schema.ts) Implement POST /api/clock/rollup-era (admin) to compute per-era status buckets + activeGovernorsNextEra and persist results (eraRollupStore.ts, rollup-era.ts) Make My Governance requirements configurable via env (SIM_REQUIRED_*) and align action requirements/done counts (index.ts) Add rollup idempotency test (api-era-rollup.test.js) and extend migrations coverage Update local Node API runner routes + DB seed/clear truncation + docs (dev-api-node.mjs, db-seed.ts, db-clear.ts, docs/*)
Add rollup visibility via GET /api/clock and GET /api/my-governance (and use rollup status in UI) Rate limit POST /api/command per IP/address (api_rate_limits + env knobs) Add moderation action locks with admin lock/unlock endpoints (user_action_locks) Add tests for rate limiting and action locks Update simulation docs for new contracts and dev env vars`
Add per-era quotas for counted write actions (pool/chamber/courts/formation) Add admin inspection endpoints (/api/admin/users/locks, /api/admin/users/:address) Log admin lock/unlock actions into an audit feed (/api/admin/audit; admin.action.v1) Add tests for quotas and admin tools; update docs and migration checks`
Add admin write-freeze toggle and deploy-time kill switch (SIM_WRITE_FREEZE) Enforce freeze in POST /api/command and audit freeze/unfreeze actions Add GET /api/admin/stats for operational visibility (memory + DB mode) Add tests for write freeze and extend admin tools tests; update docs and migration checks
Remove remaining unsafe casts (as unknown as) and keep polymorphic Surface typing clean Drop stale eslint-disable no-console comments in dev scripts (leave output intact) Keep dist/ untouched (generated output); cleanup is source-only Confirm hygiene: yarn prettier:check, yarn exec tsc -p tsconfig.json --noEmit, yarn test all pass
Fix Drizzle query typing by removing mutable query reassignments (adminAuditStore, eventsStore) Fix beforeSeq null/undefined handling (adminAuditStore, feedEventProjector, eventsStore) Fix era rollup typing and object shape (requiredTotal, remove duplicate address spread) Add tsconfig.json + cloudflare.d.ts for PagesFunction typing in editors Make base64url helpers ES2020-safe (no replaceAll) Add default exports for key UI components to match existing import styles Silence VS Code CSS warnings for Tailwind/generated CSS via settings.json
Add proposal_drafts persistence (Drizzle schema + 0014_proposal_drafts.sql) Implement Phase 12 commands in POST /api/command: proposal.draft.save, proposal.draft.delete, proposal.submitToPool Add draft read endpoints: GET /api/proposals/drafts and GET /api/proposals/drafts/:id Wire Proposal Creation + Draft pages to backend save/submit (ProposalCreation.tsx, ProposalDraft.tsx) Make inline read-models writable in READ_MODELS_INLINE_EMPTY and add memory fallbacks when DATABASE_URL is unset (dev-friendly) Add/extend tests for draft lifecycle + idempotency (api-command-drafts.test.js) and assert migration contains proposal_drafts Update docs to mark Phase 12 as done (vortex-simulation-implementation-plan.md, vortex-simulation-state-machines.md, vortex-simulation-v1-constants.md)
Switch mainnet eligibility to Session::Validators membership (remove ImOnline-based gating) Return not_in_validator_set when address is not a current validator Update RPC gate tests to match new behavior and caching Update docs to define Phase 13 and renumber roadmap phases
Add sim-config.json and resolve HUMANODE_RPC_URL from origin config as a fallback Set default Humanode mainnet RPC to https://explorer-rpc.mainnet.stages.humanode.io Improve auth UI error messages for missing /api/* and RPC misconfig Update simulation docs for runtime RPC config and gate reasons
Add canonical proposals table (schema + 0015_proposals.sql) and include it in db-clear.ts + migrations.test.js Add proposalsStore.ts (listProposals, updateProposalStage) and proposalProjector.ts for stable DTO projection Make GET /api/proposals + GET /api/proposals/:id/pool prefer canonical proposals, with read_models fallback for seeded legacy payloads Update pool→vote and vote→build auto-advance to update canonical stage (still mirrors read_models for UI compatibility) Add regression test proving proposal reads still work after clearing inline read_models Expand tsconfig.json include paths and tighten docs/README to match current behavior
…rst proposal pages Add v1 constants + proposal stage state machine helpers Enforce proposal stage transitions via transitionProposalStage (compare-and-set + validation) Make pool.vote and chamber.vote auto-advance canonical proposals without relying on read_models Ensure vote→build also seeds Formation and awards CM in canonical path Allow proposal.submitToPool even when read_models store is unavailable Add tests for transition validation + CAS behavior Update implementation plan: Phase 15 marked DONE
Add stageWindows helpers and v1 defaults for pool/vote window durations Enforce pool/vote windows on POST /api/command (HTTP 409 after window ends) Compute vote-stage timeLeft from canonical timestamps in proposal list + chamber page Add tests for expired pool/vote actions
Enforce optional pool/vote stage windows (SIM_ENABLE_STAGE_WINDOWS) and return timeLeft: "Ended" when expired Add POST /api/clock/tick window-end detection that emits a deduped feed event per (proposal, stage, endedAt) Add inline-mode feed event memory store so tick/feed behavior is testable without Postgres Extend tests for tick event emission + dedupe across both pool and vote Update docs to include endedWindows in the tick response and document the behavior
Add chamber_memberships table + store and enforce chamber.vote eligibility Grant voting eligibility on proposal acceptance (general + specialization) Decouple vote acceptance from Formation; gate Formation actions when not required Add genesis chamber members via sim-config.json (genesisChamberMembers) and SIM_CONFIG_JSON override for tests
Add canonical chambers table + migration 0017_chambers.sql Add genesisChambers + genesisChamberMembers to sim-config.json Implement chambersStore.ts (seeding, stats/pipeline projection, create/dissolve hooks) Switch GET /api/chambers* to canonical (respect READ_MODELS_INLINE_EMPTY=true) Wire General-proposal outcomes (metaGovernance) to create/dissolve chambers on acceptance Update seed/clear scripts, docs, and add lifecycle tests
Add listChamberMembers to project rosters from chamber_memberships + genesis members Project chamber proposal status list from canonical proposals with stage mapping and Formation/Pased meta Update lifecycle tests and API contract/plan docs accordingly
Phase 19: project GET /api/chambers/:id from canonical proposals + memberships (+ genesis), including General roster union Phase 20: block proposal.submitToPool into unknown/dissolved chambers and reject chamber votes for post-dissolution proposals Add integration tests for chamber detail projection and dissolution edge cases Update simulation docs (processes, API contract, implementation plan)
Wire ProposalCreation wizard to proposal.draft.save and proposal.submitToPool Persist server draftId locally and link to Draft detail page Refactor wizard into step components + storage helpers under src/pages/proposals/proposalCreation/ Update implementation plan to mark phase 23 as done Tests: yarn test; Build: yarn build
Add proposal kind selector (project vs system change) and collect metaGovernance fields Allow meta-governance drafts to submit with no budget items; require confirmBudget + agreeRules Update processes + implementation plan docs for the system-vs-project distinction Add tests for meta-governance submission without budget; run tests/build/tsc
Add ProposalPageHeader and reuse across PP/chamber/formation pages Simplify PP quorum section markup (no container drift) Test canonical proposals override seeded read models
Store proposal timeline events in events as proposal.timeline.v1 Add GET /api/proposals/:id/timeline Append timeline events for proposal lifecycle commands Render Timeline section on PP/chamber/formation pages
Treat SS58 addresses as case-sensitive everywhere (trim only; no lowercasing) Compute isActiveNextEra from era requirements + Session::Validators (RPC), with dev bypass/allowlist Ensure rollups always write next-era era_snapshots.active_governors Fix affected API projections/tests and add coverage for validator gating + next-era baseline Update docs/README and remove legacy SIM_DYNAMIC_ACTIVE_GOVERNORS knob
Persist stage-entry quorum denominators in proposal_stage_denominators to prevent drift across era changes Add delegation graph + history tables (delegations, delegation_events) with cycle/self-delegation guards Add delegation.set / delegation.clear commands and apply delegation weighting to chamber vote counts (pool remains direct-only) Wire proposal read endpoints to use stored denominators and weighted chamber counts Add migrations 0018_proposal_stage_denominators.sql, 0019_delegations.sql and extend db-clear.ts Add tests for denominator snapshot stability + delegation vote weighting + cycle rejection Update simulation docs to reflect implemented behavior
Add veto persistence: veto_votes table + proposal veto fields (0020_veto.sql, schema.ts) Compute veto council from CM awards (top LCM holder per active chamber) and snapshot onto proposals Add veto.vote command, threshold floor(2/3*n)+1, max applies = 2, 2-week pause on veto Finalize “passed (pending veto)” proposals via POST /api/clock/tick when the veto window ends Update docs: API contract, data model, paper alignment, implementation plan Update tests for veto + chamber lifecycle under pending-veto flow
Add chamber_multiplier_submissions table + schema export for outsider multiplier submissions Implement chamber.multiplier.submit command (outsiders-only: blocked if address has LCM history in that chamber) Apply rounded-average aggregate to chambers.multiplier_times10 Keep cm_awards immutable; recompute ACM/MCM views using current chamber multipliers Add api-chamber-multiplier-voting.test.js and extend migrations coverage
Set v1 pool attention quorum to 22% (was 20%)
Apply strict passing rule in chamber votes: yes >= floor(2/3 * engaged) + 1 Update paper + alignment docs to 66.6% + 1 wording Adjust chamber quorum/vote tests for the stricter threshold
Enforce delegator+delegatee chamber eligibility for delegation.set Align vote stage window default to 7 days (paper) Update paper/simulation docs and Vortexopedia wording (66.6% + 1) Adjust delegation weighted-votes test fixture
Restrict pool.vote to governors (any accepted proposal) Return 403 pool_vote_ineligible with chamberId when blocked Update tests to seed/clear chamber memberships Update API contract + processes + paper-alignment docs
Add chamberActiveDenominators.ts to compute per-chamber active governor denominators (incl. General = all governors) Fix General denominator to include union of genesis members so genesis-only governors count in General quorums Fix inline clock store behavior for READ_MODELS_INLINE_EMPTY Update quorum-related tests to account for early stage advancement (409 after pass / pending veto) Update simulation docs to reflect chamber-scoped denominators and pool eligibility rules
Canonicalize auth to Humanode SS58 (hm..., format 5234) and compare addresses by public key to avoid SS58 prefix mismatches Align nonce/verify/session flow with canonical HMND addresses and update auth tests accordingly Make eligibility/membership checks SS58-format-agnostic (genesis + tier bootstrap) Ensure local API runner serves sim-config.json and defaults to configured Humanode RPC Fix ProposalPP hook-order crash Add vortex-simulation-proposal-wizard-architecture.md and link it across docs/README, API contract, data model, scope, modules, processes, implementation plan
Canonicalize auth to Humanode SS58 (hm..., format 5234) and compare addresses by public key to avoid SS58 prefix mismatches Align nonce/verify/session flow with canonical HMND addresses and update auth tests accordingly Make eligibility/membership checks SS58-format-agnostic (genesis + tier bootstrap) Ensure local API runner serves sim-config.json and defaults to configured Humanode RPC Fix ProposalPP hook-order crash Add vortex-simulation-proposal-wizard-architecture.md and link it across docs/README, API contract, data model, scope, modules, processes, implementation plan
Normalize legacy draft payloads on read (DB + memory) and backfill template ids Drop system-branch checks from the project wizard compute Add migration test coverage for legacy drafts Update proposal wizard docs and phase status
centralize system action metadata and reuse in wizard UI remove project-only fields from system flow and review adjust system validation to require only system-specific inputs add system wizard compute test and update phase 39 docs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dev Log #1 — Vortex Simulator v0.1
Date: 2025-12-24
Release scope
This release merges the entire
devbranch intomasteras Vortex Simulator v0.1. It covers every simulator domain that has evolved since the last published release: the proposal wizard, chamber lifecycle, gating/quorum logic, canonical read models, admin tooling, docs/tests, and the blog-ready narrative. It now serves as the single source of truth for what changed between the previous shipping baseline (origin/masterprior to this merge) and the current simulator.Key differences vs. previous master
/chambersimmediately.docs/updates, and this Dev Log is the single source of truth for release notes, blog drafts, and the phase-aligned implementation plan.What end users will notice
/app/chambersnow reflects newly created or dissolved chambers immediately, even in the local read-model mode, because we patch the read-model store as part of the vote acceptance flow.Technical changes (for reference)
formationEligiblefrom the payload/read model so meta-governance proposals bypass Formation and instead create/dissolve chambers directly from the read model store (both inline and real DB). The canonicalfinalizeAcceptedProposalFromVotepath seeds chambers + memberships for metaproposals.chambers:listplus per-chamber entries so the UI sees new chambers before persistence exists.maybeAdvanceVoteProposalToBuildinspectsmetaGovernance, callscreateChamberFromAcceptedGeneralProposal/dissolveChamberFromAcceptedGeneralProposal, and updates the read models; genesis members plus proposers automatically join newly created chambers.docs/updates/dev-log-1.mdnow records the entire release; the README links have been refreshed to point at this summary, and the old extra dev log drafts were removed per the new single-doc rule.Commit appendix
Major commits included (hash + title):
57b4d64— Doc grouping and updates (read-model docs reorganized).6f607a0&c0c32a5— Proposal wizard refactors (meta payloads + drafts).e99dbb7/1f7a04f— HMND canonicalization + wizard plans.dad0a22…3ac134a— Quorum engine overhauls, governor eligibility, doc alignment.f152962/3a740e1/69b4057— Thresholds, attention quorum, chamber-multiplier voting.e48962c/9589ccc— Veto implementation and CM/quorum snapshot stability.1c7d90b…10843a1— Phase 26–27 moves (event-driven timeline, canonical read models, stage windows).52deba7…26534b0— Proposal UI unification, system wizard, draft-based creation.414f85a…e1b3377— Chamber detail modeling, membership seeding, plan-phase doc alignments.Each of those commits either added new simulator behavior, rewired an API surface, or refreshed the docs so the release note matches the current state.