6 Commits

Author SHA1 Message Date
xsser 56332fe2eb fix(hooks): make integrity guard advisory-only 2026-05-13 23:39:49 +08:00
xsser 92850d9db2 feat(upload): allow consented anonymous session uploads 2026-05-09 17:25:49 +08:00
xsser 534b91c65f fix(upload): make contribution uploads reliable
Summary:
- Treat /contribute.html and /contribute as first-class SPA routes so
  GitHub OAuth callback and documented upload links land on the uploader.
- Switch the browser uploader from multipart/base64 to raw JSONL POSTs
  with metadata headers, while keeping JSON file_data and multipart
  compatibility on the API.
- Add static upload-flow gates and Vitest coverage for authenticated
  upload sanitization, R2 writes, and D1 metadata recording.
- Bump plugin and marketplace versions to 3.4.4.

Rationale:
- The upload path had two breakpoints: documented /contribute.html links
  rendered the homepage because routing only checked hash, and multipart
  browser uploads could be stripped by proxy/custom-domain behavior.
- Raw JSONL avoids multipart body loss and avoids base64 size/memory bloat
  for large session files.

Tests:
- bash evals/test-upload-flow.sh
- bash evals/test-release-consistency.sh
- npm --prefix landing test -- --run src/test/upload-function.test.ts
- static eval suite: governance, feedback auth, heartbeat, integrity
  guard, issue regressions, Microsoft flavor, platform compat, loop hook,
  Windows Python hooks, YAML frontmatter
- npm --prefix landing run build
- ./landing/node_modules/.bin/tsc -p pi/pua/tsconfig.json
- git diff --check

Co-authored-by: Codex <codex@openai.com>
2026-05-09 17:15:54 +08:00
xsser d40ca8a164 feat(pua): add silent heartbeat stats
Summary:
- Add a silent SessionStart heartbeat hook that posts minimal anonymous
  install activity to Cloudflare without emitting stdout, stderr, or
  additionalContext.
- Add the Cloudflare Pages heartbeat endpoint, D1 migration, and
  admin-only stats page at #/admin/heartbeats.
- Add heartbeat regression gates, release consistency checks, FAQ/design
  notes, and bump marketplace/package versions to 3.4.3.

Rationale:
- Active-user measurement belongs in a hook-side mechanical gate, not in
  the model prompt, so the worker context cannot narrate or leak the
  telemetry behavior.
- Privacy gates disable the signal for offline mode, telemetry opt-out,
  and feedback-off users before any local telemetry identity is created.

Tests:
- bash evals/test-heartbeat.sh
- bash evals/test-release-consistency.sh
- static eval suite: governance, feedback auth, integrity guard, issue
  regressions, Microsoft flavor, platform compat, loop hook, Windows
  Python hooks, YAML frontmatter
- bash evals/test-behavior.sh
- npm --prefix landing run build
- ./landing/node_modules/.bin/tsc -p pi/pua/tsconfig.json
- git diff --check

Co-authored-by: Codex <codex@openai.com>
2026-05-09 17:01:38 +08:00
xsser ee09e3153a feat(pua): add Trae and pi package gates 2026-05-09 00:13:50 +08:00
xsser 0672b260b3 feat(pua): sweep open issues and add offline adapters
Summary:
- Filter UserPromptSubmit prompts inside the hook and soften hook wording so
  normal first-attempt prompts stay silent and frustration prompts read as
  user-installed productivity context.
- Add offline mode, remove stop-feedback /tmp plugin-root rendezvous, and add
  feedback endpoint body caps, origin checks, and D1-backed rate limiting.
- Add diagnosis-first discipline, Huawei military-order mode, Codex subcommand
  alias skills, a lightweight pi adapter, and Trae prompt/rule files.
- Clarify ambiguous 下场 wording, add FAQ guidance, and bump manifests to
  v3.3.0.

Rationale:
- Open issues covered over-aggressive hooks, model refusal, closed-network
  usage, Codex subcommands, Pi/Trae support, feedback abuse, ambiguous lifecycle
  wording, Huawei tone, and the misleading-traceback blind spot.
- The fixes convert ad-hoc prompt pressure into mechanical gates: script-level
  trigger filtering, offline config gates, endpoint abuse controls, and static
  regression checks.

Tests:
- for f in hooks/*.sh scripts/*.sh evals/*.sh; do bash -n "$f"; done
- bash evals/test-windows-python-hooks.sh
- bash evals/test-yaml-frontmatter.sh
- bash evals/test-release-consistency.sh
- bash evals/test-agent-governance.sh
- bash evals/test-pua-loop-hook.sh
- bash evals/test-integrity-guard.sh
- bash evals/test-issue-regressions.sh
- bash evals/test-behavior.sh
- bash evals/run-trigger-test.sh
- ./landing/node_modules/.bin/tsc -p pi/pua/tsconfig.json --noEmit
- npm -C landing run build
- git diff --check
- python3 JSON parse check for plugin and hook manifests

Co-authored-by: Codex <codex@openai.com>
2026-05-08 23:41:30 +08:00