Commit Graph

9 Commits

Author SHA1 Message Date
Асель
56b6224587 PEP-12: share projects with other users
- project_members / project_invites; owner adds people by Gitea login,
  invitations are applied at first login; members get the owner's access
  except member management; a member can leave
- access everywhere via projectForUser / userProjectIds (owner or member):
  web inbox, sessions, project pages, MCP
- shareProject / unshareProject: login checked in Gitea, repo collaborator
  (write) added by the owner's client or peppa-bot; missing admin rights
  don't block membership (repoAccess flag)
- web: Members block on the project page, 'shared' badge; MCP:
  list_members, add_member, remove_member; Help updated
- tests: 5 sharing journeys on mock-gitea (64 e2e total, green); test DB
  now also clears users and OAuth clients between files
- OpenSpec: pep-12 archived (project-sharing, web-auth)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-11-12 22:35:56 +05:00
Асель
cf43669ce8 PEP-14: full PM toolkit over MCP and a Help page
- MCP: create_goal, update_goal (title, description, open/done/archived),
  create_project (same provisioning as the web, as the user), update_task
  goal_id (move between goals / detach); server instructions explain the
  project → goals → tasks → board model and good habits
- web: /help — concepts, connecting ChatGPT/Codex/other MCP clients,
  scenarios with example phrases, tool reference; links in menu/settings
- PEPPA_TEMPLATE_URL override for provisioning (tests)
- 3 new tests (59 e2e total, green); prod tools/list and /help verified
- OpenSpec: pep-14 archived (remote-mcp, web-workspace)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 22:24:05 +05:00
Асель
3f55248150 PEP-13: connect Claude from the web for remote users
- Settings → Claude: Peppa runs 'claude setup-token' in tmux, shows the
  claude.com sign-in link, the user pastes the code into the form; the
  1-year token is stored encrypted on the user (users.claude_token_enc)
- Claude sessions of the owner's projects get CLAUDE_CODE_OAUTH_TOKEN;
  projects without an owner token keep using the machine login
- disconnect / reconnect; setup times out after 10 min and its tmux
  session (and scrollback with the token) is killed right after saving
- mock-claude setup-token; 2 new tests (56 e2e total, green)
- verified on prod: the button yields the real claude.com authorize URL
- OpenSpec: pep-13 archived into spec agent-credentials

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 22:06:37 +05:00
Асель
4e20f76767 PEP-11: update_task in the remote MCP
- edit a task's title and/or description by key through the owner-scoped
  manager tools; goal, status and other fields kept, no agent started;
  uses core updateTask (event log, NOTIFY) and returns the updated card
- test: title only, description only, both; goal/status/sessions intact;
  empty call and another user's task refused (54 e2e total, green)
- verified on prod: tools/list over HTTPS includes update_task
- OpenSpec: pep-11 archived into spec remote-mcp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 21:52:46 +05:00
Асель
39367b1d82 PEP-8: remote MCP for ChatGPT with Peppa as OAuth 2.1 server
- OAuth: RFC 8414/9728 metadata, RFC 7591 dynamic registration,
  authorization code + PKCE S256 with a consent screen after Gitea login,
  refresh token rotation; tokens and codes stored hashed; revoke in web
- /mcp: stateless Streamable HTTP, Bearer → user; PM tools from
  @peppa/mcp/manager: projects, goals, tasks, create, move (board
  semantics, starts agents), inbox, answer/accept — owner-scoped
- login keeps ?next= through Gitea OAuth; Settings page with MCP URL and
  connected apps
- 5 new tests (53 e2e total, green); verified on prod as a client:
  DCR → consent → token → MCP over HTTPS → revoke → 401
- OpenSpec: pep-8 archived into spec remote-mcp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 21:38:09 +05:00
Асель
00c8f79a36 PEP-7: autonomous mode — board moves start agents, PM only for stoppers
- web board (Backlog / In progress / Review / Done) with drag-and-drop and
  buttons; moveTask starts an agent on In progress, stops on Backlog/Done
- routine proposals go straight to apply; request_approval/ask_pm only for
  architectural stoppers (RULES.md, MCP hints, template pushed to Gitea)
- Stop hook keeps the agent going (decision: block, max 2 in a row,
  sessions.auto_nudges reset by a human answer) instead of pinging the PM
- review: ready-for-review message with Accept (acceptTask → done, session
  stopped) in Telegram and web; a text reply goes back to the agent
- mock-claude honours Stop-hook block; 6 new e2e tests (48 total, green)
- OpenSpec: pep-7 archived (task-autonomy, web-workspace board)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 21:21:11 +05:00
Асель
2b0f2fd984 PEP-1: web platform with Gitea login, projects, goals, tasks, sessions
- web: Gitea OAuth2 login, signed session cookie, everything behind login;
  inbox with answers, project board (goals → tasks), task page with
  OpenSpec artifacts, questions and session controls; new project form;
  auto-refresh, light/dark, mobile
- users + projects.owner_id; tokens AES-256-GCM encrypted; owner-only access
- provisionProject (runner): new or existing Gitea repo, peppa-bot
  collaborator, template + openspec init, push, rollback; used by web and
  peppa project create (replaces scripts/bootstrap-project.sh)
- peppa web login-link, peppa project owner; Gitea OAuth app script
- bins/template resolved via PEPPA_ROOT (works inside the Next build)
- testkit: mock-gitea + 10 tests (42 e2e total, all green)
- OpenSpec: pep-1-web-platform archived into specs web-auth,
  project-provisioning, web-workspace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:55:02 +05:00
Асель
9cf0d53303 Add Telegram bot: pairing, durable outbox, answers from buttons and replies
- bot: own Bot API client, long polling with persisted offset, updates
  claimed before acting (no replay after restart), outbox with retries
  (429 retry_after, 5xx), /start pairing code (hashed, single use, 10 min),
  only the paired chat/user is served
- PM questions rendered per kind: approve button / reply to reject,
  option buttons, allow/always/deny, alerts with continue or resume/stop;
  messages are closed with who answered what, incl. terminal answers
- stopping/resuming a session expires its open questions
- CLI: peppa telegram pair|status|unpair; launchd agent for the bot
- testkit: mock-telegram + 11 bot journeys (32 e2e tests, all green)
- fix: keep the tmux server alive when empty (exit-empty off) — a new
  session could die with a server shutting down after the last kill
- fix: test env must load before runner modules (no leaks to real tmux)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:26:58 +05:00
Асель
1df550bb86 Add Codex provider, mock agents and end-to-end CJM suite
- runner: provider abstraction (claude | codex); per-run launch.sh keeps
  long argv out of tmux; Codex via notify callback + -c config for rules
  and the peppa MCP server; session env carries DATABASE_URL/PEPPA_HOME
- testkit: mock-claude / mock-codex driven by scenarios — real hooks,
  notify, MCP calls, raw-mode TUI input with bracketed paste, permission
  dialog, usage limits, hangs, crashes, /clear
- 21 CJM tests on an isolated DB, tmux server and state dir (all green)
- fix: watchdog crash/stall alerts showed blank lines instead of the tail
- bins load .env without overriding the caller's env; tmux socket option
- AGENTS.md (was CLAUDE.md) and shared RULES.md: mock-first rule with a
  mock prefix for anything blocked on external dependencies

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 20:09:43 +05:00