psy-exp-reviewer — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited psy-exp-reviewer (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
v1.4.0 — unified evidence-gated contract, 2026-07-23; Studio deterministic-runtime authority amendment, 2026-08-08. Sub-skill of amazing-psycoder.
Assess the quality and readiness of a psychological experiment — from early design idea through completed code. The reviewer adapts its mode to the input available. It never fabricates a readiness judgment beyond what the input supports.
This is the final mandatory gate in the experiment development chain. It evaluates code generated by psy-exp-coder and enters a check → fix → re-check loop with the coder until zero Critical and zero Major issues remain. Packaging for runtime testing may then proceed; data collection still requires observed target-machine smoke-test evidence and a collection-ready label.
Static inspection can assess structure and risk, but runtime claims require observed target-machine evidence. A collection-ready verdict must show:
Each item must be backed by the structured RuntimeEvidence records in references/review-report-schema.md. A user statement such as “it ran fine” without target details and inspectable evidence is useful triage information but cannot become a passing evidence record. Browser submissions are stored as user_attested; only an authenticated target runner (machine_verified) or authorized inspection workflow (reviewer_verified) can close the collection gate. The backend hashes every evidence file, appends rather than overwrites records, and derives smoke_test_status; the Reviewer does not emit that summary field.
The reviewer cross-references the psy-exp-coder skill's artifacts:
| Coder artifact | Reviewer use |
|---|---|
| Platform spec Canonical Skeleton | Reference for correct API patterns — compare generated code against skeleton |
| Platform spec anti-pattern table | Checklist of forbidden patterns to scan for |
| Coder Quality Gate (10 items) | Minimum bar — if any gate fails, automatic not_ready_for_collection |
| Platform mapping README | Verify config→code mapping correctness |
| Exact design reference, when available | Candidate failure modes only; never an authority over the confirmed spec |
The reviewer also cross-references the psy-exp-designer skill's artifacts:
| Programming artifact | Reviewer use |
|---|---|
Paradigm ## Do Not Assume | Paradigm-specific checks — verify known pitfalls are addressed |
references/data-recording.md | Semantic trial-summary/event-table contract and persistence rules |
references/config-schema.md | Config validation rules — every deterministic and design-semantic check passes before code generation |
Before reviewing, classify the request into one mode.
| Mode | Use when | Minimum Input | Allowed Output |
|---|---|---|---|
code-audit | User provides experiment code | Code file or pasted code | PASS / FAIL with readiness label + platform-specific findings + smoke test protocol |
config-audit | User provides config YAML, trial timeline, or condition schema but no code | config YAML or structured experiment spec | Pre-code design review; cannot judge code correctness |
implementation-plan-review | User provides pseudocode or planned code architecture | Implementation plan | Architecture risk review; cannot judge runtime behavior |
triage-only | User provides only a natural-language experiment idea | Natural-language description | Missing-information list and design risks; cannot judge readiness |
blocked | User asks for readiness judgment but provides neither code nor config | Insufficient input | Explain what is missing; refuse to judge readiness |
If the user's input could fit multiple modes, default to the highest mode available (code-audit > config-audit > implementation-plan-review > triage-only). If input is insufficient for any productive review, use blocked.
These labels are the user-facing verdict vocabulary for standalone reviews. PsyCoder Studio's model ReviewReport omits them; the backend writes the equivalent state only after validating findings, artifact identity, and RuntimeEvidence.
| Label | Allowed in mode | Meaning |
|---|---|---|
ready_for_collection | code-audit only | Zero critical or major issues; code matches platform spec skeleton; smoke test passed |
not_ready_for_collection | code-audit | Critical/Major issues exist, or required runtime tests have not passed; do NOT collect data |
pre_code_ready | config-audit only | Config/spec complete and ready for code generation |
needs_experiment_info | triage-only, config-audit | Key design information is missing |
not_applicable | implementation-plan-review | Architecture risks were reviewed, but no artifact-readiness claim is made |
blocked | blocked | Cannot review; input is insufficient |
Hard rule: ready_for_collection requires actual code review plus passed runtime smoke tests. Minor findings are reported separately and do not create a second ambiguous readiness state. If no code was provided, the highest possible label is pre_code_ready.
At the start of every review output, state what was and was not reviewed. If no code was provided:
Scope: No experiment code was provided. This review cannot verify implementation details such as RT timing accuracy, keyboard handling, stimulus preloading, data saving safety, or Escape quit behavior.
When code is provided, first detect the platform:
| Signature | Platform |
|---|---|
from psychopy import / visual.Window / keyboard.Keyboard | PsychoPy |
initJsPsych / jsPsych.run / jsPsychHtmlKeyboardResponse | jsPsych |
PsychImaging / Screen('Flip' / KbQueueCreate / sca | Psychtoolbox |
Once detected, load the corresponding coder spec for authoritative API patterns:
../psy-exp-coder/psychopy/spec/README.md../psy-exp-coder/jspsych/spec/README.md../psy-exp-coder/psychtoolbox/spec/README.mdWhen an exact design reference exists, it may be loaded from ../psy-exp-designer/paradigms/{paradigm_name}.md for candidate failure modes. Do not substitute a family or neighboring variant when an exact reference is absent.
If the platform cannot be detected, use blocked for platform-specific conclusions and request the target/runtime context. Do not call ambiguity data-invalidating when no data have been collected.
Run the 10-item Quality Gate from quality-gate.md first and use its impact-based severity rules; do not inflate maintainability-only failures into data-invalidating Critical findings.
When config, conditions, and code are available, also run python3 <amazing-psycoder-root>/scripts/validate_experiment.py <config.yaml> --code <code-file>. Treat its findings as audit evidence, but never infer runtime readiness from a static pass.
Load the detected platform's canonical spec before scanning. Its anti-pattern table is authoritative and avoids duplicating rules here:
PsychoPy:
keyboard.Keyboard(backend='ptb') when high-quality keyboard timing is required by the designwin.callOnFlip(kb.clock.reset) — clock reset at stimulus onset, not before flipkb.getKeys(waitRelease=False) for key-down scoring; release/duration protocols explicitly collect .duration/release evidence insteadkey.rt used for RT — not kb.clock.getTime(), not time.time()CountdownTimer loop for response deadline — not core.wait()win.getFutureFlipTime(clock=routineTimer) for frame timing — not trialClock.getTime()kb.clearEvents() BEFORE stimulus flip — prevents pre-stimulus key contaminationwin.callOnFlip(port.setData, code) if EEG trigger — trigger AFTER flip, not beforethisExp.addLoop(trials) is scoped to the loop it records; skip this check for standalone scriptsjsPsych:
initJsPsych() + jsPsych.run() — not jsPsych.init()data.rt used for RT — no manual Date.now() timingtrial_duration parameter for timing — not setTimeout/setInterval"NO_KEYS" / "ALL_KEYS" strings — not jsPsych.NO_KEYSchoices where it could be recorded as a task responseon_data_update creates a durable per-trial server/IndexedDB/localStorage checkpoint, with final .localSave('csv', filename) in experiment on_finishjsPsych.pluginAPI.compareKeys() for accuracy — not manual == comparisonPsychtoolbox:
KbQueueCreate + KbQueueCheck — not KbCheck for RTVBLTimestamp from Screen('Flip') as RT origin — not GetSecsfirstPress - stimOnset for RT calculation (ms precision)vbl + (waitframes - 0.5) * ifi for frame timing — not WaitSecs()KbQueueFlush([], 2) at start of each trialtry/catch/sca/Priority(0)/ShowCursor — not bare scaCreate + Start before trial loop, Stop + Release after loop — never insidewhenScreen('DrawingFinished') before Flip if heavy drawing — prevents frame overrunInitializePsychSound and PsychPortAudio use the config-confirmed device/latency class; no literal mode is treated as universally correctSkipSyncTests, 0 — production must not skip sync tests+ is acceptable when font and size are explicitSound() + CreateBuffer before trial loop, not FillBuffer per trialCreateProceduralGabor / MakeTexture — not per trialTextStyle / TextFont set once before loop, only content changes per trialThis section validates that the experiment produces analyzable, complete data.
#### 6.1 Output Column Compliance
Cross-reference against data-recording.md. Validate semantic roles against the confirmed config; do not force non-keypress paradigms into a universal fixed column list:
| Role | Check |
|---|---|
| Identity/order | Subject/session/trial identity is unique and reconstructs realized order |
| Design/exposure | Condition, item/stimulus, counterbalance/adaptive values, and completion state reconstruct what occurred |
| Response/timing | Applicable raw response, status, RT unit, and onset/event definitions are explicit |
| Scoring | Correct response/accuracy exists only when defined and preserves raw inputs |
| Provenance | Config/code version and traceable timing/order metadata are recorded |
| Repeated events | One-to-many events use a linked event table rather than overwriting a trial cell |
#### 6.2 Accuracy Coding Correctness
| Trial type | Correct behavior | accuracy value |
|---|---|---|
| Go trial, correct key | response == correct_response | 1 |
| Go trial, wrong key | response != correct_response | 0 |
| Go trial, timeout | no response within deadline | 0 when omission is defined as incorrect; response status remains timeout |
| No-go trial, withheld | no response | 1 |
| No-go trial, responded | any key pressed | 0 |
| Stop-signal, stop success | no response after stop signal | 1 |
| Stop-signal, stop fail | responded despite stop signal | 0 |
How to verify: Read the accuracy evaluation code. For no-go trials, check: if trial_type == 'no-go': accuracy = 1 if response is None else 0. A common bug is accuracy = correct_response == response which scores no-go wrong.
#### 6.3 Crash Recovery Test
on_data_update rather than relying on in-memory data#### 6.4 Missing/Timeout Handling
'', NA, or null); never encode it as 0, -1, -999, or another numeric sentinel-999 are prohibited unless an external format forces them and import code converts them immediatelyprint(), console.log(), disp() without guard)mkdir/exist check)When an exact paradigm reference exists, cross-reference it for candidate failure modes only. The confirmed config remains authoritative, and a missing reference does not invalidate a custom design. Never audit one variant by importing the logic of another member of the same paradigm family. Load ../psy-exp-designer/paradigms/{paradigm_name}.md and check each item in ## Do Not Assume.
Go/No-go:
IAT:
Stop-signal:
N-back:
Dot-probe:
Stroop:
When no exact reference exists: Run the generic checks against the confirmed spec:
After automated checks pass, load references/smoke-test.md, adapt its commands to the target platform and OS, and require the user to report the results. Do not assign ready_for_collection until the required runtime checks have passed or clearly state that runtime readiness remains unverified.
Only design-level checks. Do not check implementation details.
rt_onset defined{column_name} in windows[] exists in the condition file| Severity | Definition | Concrete examples |
|---|---|---|
| Critical | The artifact cannot run/produce recoverable data, or would systematically invalidate the primary outcome | Inverted correctness, wrong RT origin for the primary DV, end-only/no persistence, missing required artifact, deterministic condition construction contradicts the confirmed design |
| Major | Affects a subset of trials/participants, materially degrades measurement, or blocks safe target testing | Unrecoverable realized randomization, unresolved field mapping, CJK glyph failure, inappropriate response event, production sync tests disabled, media I/O in a timed window |
| Minor | Does not affect data quality; fix when convenient | Extra debug print left in code, variable naming convention, missing code comment, parameter ordering, redundant import, hardcoded path that works but should be configurable |
For a code-audit that produces a PsyCoder Studio ReviewReport, follow references/review-report-schema.md: emit read-only findings and file hashes only. Never emit repairs, issue counts, static_review_passed, smoke_test_status, or readiness booleans; the backend derives them from the current report and separately validated runtime evidence. Other modes report their mode-bounded human label, scope, evidence reviewed, severity-grouped findings, limitations, and recovery path without fabricating unavailable evidence.
ready_for_collectionready_for_collection with minor > 0not_ready_for_collection; packaging may proceed only for runtime testingnot_ready_for_collectionpre_code_readyneeds_experiment_info (collection readiness is not judged without code)not_applicable. A plan cannot become pre_code_ready until it is represented by a complete validated config.psy-exp-designer; implementation defects return to psy-exp-coder after config confirmation.No verdict given. State what input is needed to proceed and exit.
When code has been modified after an initial review, re-audit with this focused checklist:
If the change is trivial (e.g., parameter value only, comment fix), re-audit is optional. If the change affects trial loop, response collection, or data saving, full re-audit is required.
Load and include the pre-first-subject checklist from references/smoke-test.md with every ready_for_collection verdict.
审计不是一次性报告——发现问题后进入 检查 → 修复 → 再检查 循环,直到通过。
psy-exp-coder 生成代码
│
▼
psy-exp-reviewer 审计
│
├── Critical/Major 问题 → 修复 → 重新审计
│ ↑ │
│ └─────────┘
│ 循环直到 0 Critical + 0 Major
│
└── 0 Critical + 0 Major → 静态通过 → 目标机 smoke test → 最终就绪判断| Issue type | Who fixes | How to fix |
|---|---|---|
| Design error (missing windows or incorrect declared semantics) | psy-exp-designer | Fix design → regenerate config → psy-exp-coder regenerate code |
| Code error (anti-pattern found, wrong API, missing escape) | psy-exp-coder | Fix code directly according to reviewer's specific findings |
| Missing data columns / wrong RT source | psy-exp-coder | Verify against platform spec → fix code |
| Missing parameter / hardcoded value | psy-exp-designer or psy-exp-coder | Fix in design or code → regenerate |
| CJK font missing / tofu characters | psy-exp-coder | Add the platform-appropriate explicit font strategy and target-machine glyph/layout check → re-audit |
"第 N 轮审计:发现 X 个问题。修复后进入第 N+1 轮。"
每次修复后必须重新审计。审计轮次和每轮问题数记录在最终报告中。
When the audit passes with ready_for_collection:
"审计通过。下一步:
>
1. 保存已完成的 First-Run Checklist 和目标机 Smoke Test 证据 2. 保存审计报告、运行环境和验证产物路径 3. 首名正式被试前复核设备、版本与刺激资源未改变 4. 如需分析数据,使用 /amazing-psycoder 进入分析流水线"| File | When to load |
|---|---|
| ../psy-exp-coder/psychopy/spec/README.md | PsychoPy code audit — canonical skeleton + authoritative anti-pattern table |
| ../psy-exp-coder/jspsych/spec/README.md | jsPsych code audit — canonical skeleton + authoritative anti-pattern table |
| ../psy-exp-coder/psychtoolbox/spec/README.md | PTB code audit — canonical skeleton + authoritative anti-pattern table |
| ../psy-exp-designer/paradigms/ | Paradigm failure mode cross-reference |
| ../psy-exp-designer/references/data-recording.md | Data output column validation |
| ../psy-exp-designer/references/config-schema.md | Config validation rules |
| references/review-report-schema.md | ReviewReport + ReviewIssue schema (v1.4.0) |
| references/review-gate.md | Review Gate packaging rules (v1.4.0) |
| references/smoke-test.md | Runtime smoke test and pre-first-subject checklist |
The reviewer must verify that generated code/conditions match spec constraints.
correct_response from the task-relevant dimension for every row. Any systematically wrong source is critical.Spec-code-condition inconsistency must be reported at its evidence-based severity; the backend then derives ready_for_collection = false when a blocking finding remains.
Load references/review-gate.md whenever producing a PsyCoder Studio ReviewReport. A report covers exactly one content-addressed artifact set. The Reviewer is read-only. Blocking findings fail the Studio run and route to maintained compiler-adapter repair plus regression testing; the current runtime is never patched by the model. Every regenerated artifact set receives a fresh review. Require complete reviewed_files hashes and report every Critical/Major finding so the backend can fail packaging deterministically.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.