Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • P ps_tool
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Ed
  • ps_tool
  • Merge requests
  • !1

feat(ps-portal): locked module contract JSON for 16-agent Phase B rebuild

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Administrator requested to merge feat/ps-portal-contract into main Jun 14, 2026
  • Overview 0
  • Commits 1
  • Pipelines 2
  • Changes 2

PS Portal — Locked Module Contract for Phase B (16-Agent Rebuild)

This MR adds portal-contract.json — the single source of truth that all 16 Phase-B module agents will read before building their slice of the portal. No module agent re-reads claude.md; they work from this contract only.

What's in the contract

  • 79 API endpoints (28 already implemented in server.js v2.0.0; 51 planned — each flagged "status": "implemented"|"planned")
  • 14 MongoDB collections with full JSON Schema fragments + index definitions
  • 5 Postgres tables (sessions, torch_leaderboard_cache, calendar_events, calendar_rsvp, n8n_workflows)
  • Redis key patterns (sessions, Torch daily caps, socket rooms, rate limits)
  • 47 Torch scoring rules — one entry per action per module, with tier, pts, dailyCap, and label
  • 16 module entries — humanName, htmlFile, usesEndpoints, usesCollections, usesRedisKeys, fireTorchActions, dependencies
  • Hard constraints (no AI/LLM, vanilla HTML/CSS/JS only, Torch message shape frozen, JWT-in-Redis auth, Mongo/PG data split)
  • File storage spec (volume layout, subfolder structure, naming pattern, hash requirements)

Open questions needing Ed's call before Phase B fires

ID Topic
OQ-01 JWT secret rotation policy — static env var or dual-key grace-window?
OQ-02 draw.io banner copy — only exists in claude.md; not yet in any portal-src file
OQ-03 Voice tour — live Web Speech API vs pre-recorded MP3s? Spec says stored audio but live synth is data-safe
OQ-04 Torch anti-gaming cap enforcement approach — Redis counters in recordTorch()?
OQ-05 Cross-instance sync — shared remote MongoDB or per-user instances?
OQ-06 Calendar storage contradiction — Postgres tables AND Mongo collection both defined; pick one
OQ-07 PS Reach reach_requests collection missing from mongo init schema
OQ-08 6 implemented roles vs 7 spec'd roles — confirm canonical role list
OQ-09 Anti-gaming caps currently unenforced server-side — confirm fix priority
OQ-10 POST /api/notes awards +5 for private notes too — should be public/client only
OQ-11 Live fshost (.23) SSH was denied during contract generation — confirm deployed server.js = v2.0.0
OQ-12 Only ps_ingest_module.html exists in portal-src; index.html shell + 15 other modules not yet built

How to review

  1. Check portal-contract.json is valid JSON (it is — python3 -m json.tool passes)
  2. Scan modules{} keys — confirm all 16 are present and their htmlFile names match your naming convention
  3. Review openQuestions array and make calls on OQ-01 through OQ-12
  4. Merge → Phase B agents spawn

Hard constraints in the contract (verbatim)

  • No AI/LLM/Opus/Anthropic API connectivity anywhere in the portal — client data sensitivity policy
  • Vanilla HTML/CSS/JS — no React, no build step, no bundler
  • All inter-module communication via window.parent.postMessage(...) per the Torch event spec
  • Auth = JWT in Redis-backed sessions. Phase B agents do not invent new auth mechanisms.
  • MongoDB is the source of truth for documents/notes/reports/news/ask/collab/files; Postgres is sessions + Torch leaderboard cache + calendar

🤖 Contract generated by Claude Code · Phase A · 2026-06-14

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: feat/ps-portal-contract