13 Commits
Author SHA1 Message Date
xsserandCodex 4a7793859b fix: preserve PUA tone across model runtimes in 3.5.1
Retain original skill rhetoric and the frozen flavor library while adding
portable Claude Code, Codex and ChatGPT runtime contracts and packages.
Correct hook event handling, scoped numeric checkpoints, flavor locks,
plugin path resolution, advisory integrity checks and voluntary feedback.

Add native-loading and ordered-evidence runners for cc0, OMP and Codex.
Document paired model results, refusals, approval/rate-limit failures,
explanatory factual errors and remaining evidence gaps without an all-model
pass claim. Exclude private execution archives from public Git content.

Bump all six PUA manifests including Pi, refresh three-language READMEs,
and add release notes plus reproducible offline validation instructions.
Resolve optional OMP source metadata relative to the current user's home.

Validation:
- 17 offline suites passed, including 13 OMP evidence regressions
- Six manifest versions synchronized; all tested skill hashes unchanged
- Three portable packages rebuilt reproducibly; original tone checks pass
- Python, Bash and JSON syntax; public doc links; staged diff checks pass
- 330 private archive files verified unchanged and excluded from staging

Real-model results remain limited: this is not universal behavior acceptance.

Co-authored-by: Codex <codex@openai.com>
2026-09-09 17:56:22 +08:00
xsser ac50267918 Remove all data collection: 5 upload channels, client and server
PUA Skill no longer sends anything over the network. Removed end to end,
both the client hooks that emit data and the server that received it.

Channels removed:
- Session transcript upload   (/api/upload)      full redacted .jsonl
- Rating feedback             (/api/feedback)    rating, counts, flavor
- Silent heartbeat telemetry  (/api/heartbeat)   install id, version, platform
- PUA leaderboard             (/api/leaderboard) email, phone, PUA counts
- pua-api platform            (agentguard.workers.dev)
    phone + SMS registration, silent session_start/pua_triggered/command_used
    events, remote prompt-template fetch, and the payment flow that depended
    on the registration token

Client:
- delete hooks/heartbeat.sh; drop both SessionStart registrations
- stop-feedback.sh: 5 curl calls -> append one line to ~/.pua/feedback.jsonl
- rewrite references/platform.md as a local-only command reference
- drop the leaderboard section and commands from skills/pro
- survey/pua/offline command docs: local-only wording

Server:
- delete all Pages Functions (upload, feedback, heartbeat, leaderboard,
  _sanitize, me, _session, auth/*) and all 5 D1 migrations
- contribute + admin pages become notices; no upload form, no login
- wrangler.toml: drop R2/D1 bindings and GitHub OAuth vars

Note: removing the bindings does not delete stored data. The R2 bucket
(puaskill-upload), the D1 database (pua-uploads-db) and the
GITHUB_CLIENT_SECRET / SESSION_SECRET secrets must be deleted in the
Cloudflare dashboard separately.

Guard rail:
- add evals/test-no-telemetry.sh: reverse assertions over the whole repo
  (collection hosts, endpoint paths, outbound request bodies, deleted files,
  hook registrations, CF bindings) plus a positive control that local
  feedback still works. Verified by injecting both a naive and an evasive
  upload; 4 and 2 gates fired respectively.
- test-upload-flow / test-heartbeat / test-feedback-auth asserted that
  collection worked, so they were replaced rather than merely deleted --
  deleting them would have removed the guard along with the feature.

hooks/sanitize-session.sh is kept as a standalone offline redaction tool.
Unlike the deleted TypeScript port it does not split input per line, so the
multiline PEM pattern still matches (issue #134 ID-001 did not apply to it).

Refs #134, #98, #100
2026-08-29 15:57:20 +08:00
xsser 92850d9db2 feat(upload): allow consented anonymous session uploads 2026-05-09 17:25:49 +08:00
xsserandCodex 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
xsserandCodex d3219862d9 fix(landing): make d1 migrations idempotent
Summary:
- Make the initial uploads index migration use IF NOT EXISTS.
- Add a release consistency gate that rejects non-idempotent D1 CREATE
  INDEX statements.

Rationale:
- Production D1 already had the old uploads index before Wrangler's
  migration journal was used, so migrations apply could fail on 0001
  before reaching newer migrations.
- Keeping migrations idempotent makes future Cloudflare release gates
  mechanical instead of relying on manual SQL execution.

Tests:
- bash evals/test-release-consistency.sh
- git diff --check

Co-authored-by: Codex <codex@openai.com>
2026-05-09 17:04:56 +08:00
xsserandCodex 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 aee3d5c2fa feat(pua): add Microsoft growth flavor 2026-05-09 14:23:39 +08:00
xsser ee09e3153a feat(pua): add Trae and pi package gates 2026-05-09 00:13:50 +08:00
xsserandCodex 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
xsserandCodex 2e9d3b9bf6 fix(pua): respect off on Windows Git Bash
Summary:
- Add shared Python launcher fallback, Git Bash path conversion, and JSON
  config readers for hook configuration access.
- Route UserPromptSubmit, PostToolUse, SessionStart, Stop, and integrity
  hooks through the shared config reader so /pua:off and feedback_frequency=0
  work when only python is available.
- Add issue #159 Windows Git Bash regression coverage and bump all plugin
  manifests to v3.2.8.

Rationale:
- Native Windows Python cannot open Git Bash /c/... paths directly, and some
  Windows installations provide python without python3.
- The previous fallback treated config read failures as always_on=true, so
  /pua:off could still inject PUA on frustration prompts.

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-behavior.sh
- bash evals/run-trigger-test.sh
- git diff --check
- python3 JSON parse check for plugin and hook manifests

Co-authored-by: Codex <codex@openai.com>
2026-05-08 23:15:35 +08:00
xsserandCodex f2e5716055 feat(pua): add four-power governance agents
Summary:
- Add four context-isolated governance agents for action,
  self-evaluation, verifier recommendation, and policy review.
- Bind each power to PUA cultural narratives: Alibaba/Musk for
  execution, Huawei/Netflix/Jobs for review, ByteDance/JD for
  verification, and Tencent/Amazon/Alibaba internal control for policy.
- Document the multi-agent topology in the PUA skill and harness
  reference, inject it on SessionStart, add static agent governance evals,
  and bump manifests to v3.2.7.
- Harden trigger evals to accept observable PUA behavior when Claude
  applies pressure without emitting a Skill tool event before max-turns.

Rationale:
- v3.2.6 created mechanical hook gates; v3.2.7 separates the thinking
  contexts too, so execution, review, verification, and environment
  approval cannot collapse into one self-proving narrative.
- Cultural narratives provide role-specific pressure, but the agents still
  remain advisory compartments under hook/external/human authority.

Tests:
- for f in hooks/*.sh scripts/*.sh evals/*.sh; do bash -n "$f"; done
- 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-behavior.sh
- bash evals/run-trigger-test.sh
- git diff --check
- python3 JSON manifest validation

Co-authored-by: Codex <codex@openai.com>
2026-05-08 22:49:53 +08:00
xsserandCodex 86746c26b1 feat(pua): add harness integrity governance
Summary:
- Add harness governance reference for four-power separation,
  task contracts, verifier-owned status, and memory boundaries.
- Add PreToolUse integrity guard for grader-gaming, solution
  contamination, capability-abuse, status, CI, and memory risks.
- Add integrity-guard eval coverage and release gates, then bump
  marketplace/plugin manifests to v3.2.6.

Rationale:
- PUA should not just pressure agents to try harder; it should make
  it difficult to fake completion by modifying tests, verifier assets,
  hidden answers, secrets, or persistent status/memory.
- The guard uses ask/deny decisions so ordinary code changes still
  proceed while governance assets require verifier or human approval.

Tests:
- for f in hooks/*.sh scripts/*.sh evals/*.sh; do bash -n "$f"; done
- bash evals/test-yaml-frontmatter.sh
- bash evals/test-release-consistency.sh
- bash evals/test-pua-loop-hook.sh
- bash evals/test-integrity-guard.sh
- bash evals/test-behavior.sh
- bash evals/run-trigger-test.sh
- git diff --check
- python3 JSON manifest validation

Co-authored-by: Codex <codex@openai.com>
2026-05-08 21:30:24 +08:00
xsserandCodex b995858141 fix(pua): harden confidence gate and trigger evals
Summary:
- Replace the one-line confidence loop with an explicit Confidence Gate
  that enumerates claims, finds risks, fixes or discloses them, and
  reruns evidence before delivery.
- Make pua-loop Oracle verification portable on macOS/Linux and add
  hook smoke tests for verified, rejected, and quoted verify commands.
- Fix trigger/behavior evals so they use portable timeouts, isolated
  PUA config, a neutral workspace, and the Claude CLI stream-json
  verbose requirement.
- Tighten PUA skill and slash-command descriptions to avoid triggering
  on normal first-attempt coding or information requests.
- Bump marketplace/plugin manifests to v3.2.5 with an updated Claude
  marketplace changelog summary.

Rationale:
- The previous strategy relied on vague "100% confidence" wording and
  left the verification system itself vulnerable to false failures on
  macOS, local user config leakage, and workspace-biased false triggers.
- Confidence is now defined as evidence-backed gates: all runnable
  checks pass, known high-risk issues are fixed, and residual risks are
  disclosed.

Tests:
- bash -n hooks/*.sh scripts/*.sh evals/*.sh
- bash evals/test-yaml-frontmatter.sh
- bash evals/test-release-consistency.sh
- bash evals/test-pua-loop-hook.sh
- bash evals/test-behavior.sh
- bash evals/run-trigger-test.sh

Co-authored-by: Codex <codex@openai.com>
2026-05-08 20:54:48 +08:00