Files
PlantAI-dev/.superpowers/sdd/task-3-final-verification.md
2026-08-03 18:42:47 +08:00

8.9 KiB
Executable File

Task 3 final authoritative verification

Verdict

PASS

Fresh final verification found no remaining Critical, Important, or Minor Task 3 defect. All historical findings are closed by current production behavior and were re-probed with live sockets/DNS disabled. This checkpoint is approved for Task 3 only.

Material and patch reviewed

Read before verification:

  • AGENTS.md.
  • .superpowers/sdd/task-3-brief.md.
  • Updated .superpowers/sdd/task-3-report.md and .superpowers/sdd/task-3-review-package.md.
  • All prior Task 3 main reviews: task-3-verification.md, task-3-antipattern.md, task-3-review.md, task-3-reverification.md, task-3-reantipattern.md, and task-3-rereview.md.
  • .superpowers/sdd/progress.md.

This workspace has no functional Git repository (.git contains only info/), so the review-package baselines were used. The complete current patch/new-file surface was inspected:

/tmp/ppi-id-resolution-task3-baseline/run.py
  -> skills/ppi/run.py                         1139 diff lines
/tmp/ppi-id-resolution-task3-baseline/pipeline_backend.py
  -> apps/web/pipeline_backend.py                65 diff lines
/tmp/ppi-id-resolution-task3-baseline/test_ppi_string_policy.py
  -> tests/unit/test_ppi_string_policy.py        100 diff lines
gfa_core/string_rate_gate.py                     148 complete lines
gfa_core/ppi_string_policy.py                    297 complete lines
tests/unit/test_ppi_id_resolution.py            1217 complete lines

The two parent-authorized backend fake-signature changes were also inspected at tests/unit/test_pipeline_backend_execution_env.py:1034 and :1071; both now require allow_redirects is False. The production patch remains confined to the Task 3 implementation plus the documented policy/test expansions. No Task 4 Reset/CLI discovery wiring or Task 5 contract/diagnosis/frontend work was introduced by this patch.

Fresh socket-blocked automated verification

Before every pytest command, the verifier replaced all four network entry points below with a function that raises AssertionError("live network blocked by final Task 3 verifier"):

socket.socket.connect = blocked
socket.socket.connect_ex = blocked
socket.create_connection = blocked
socket.getaddrinfo = blocked

Any live HTTP/DNS attempt, including from the forked multiprocessing tests, would therefore fail the run.

Focused Task 3 suite

/home/xia-lab/miniconda3/envs/test4py311/bin/python [socket-blocked pytest]
  tests/unit/test_ppi_id_resolution.py
  tests/unit/test_ppi_string_policy.py -q

collected 116 items
116 passed in 0.79s
exit 0

Relevant backend image/PPI selection

/home/xia-lab/miniconda3/envs/test4py311/bin/python [socket-blocked pytest]
  tests/unit/test_pipeline_backend_execution_env.py
  -k 'string_network_image or ppi' -q

collected 31 items / 5 deselected / 26 selected
26 passed, 5 deselected in 5.69s
exit 0

Combined regression

/home/xia-lab/miniconda3/envs/test4py311/bin/python [socket-blocked pytest]
  tests/unit/test_id_resolution.py
  tests/unit/test_ppi_id_resolution.py
  tests/unit/test_ppi_string_policy.py
  tests/unit/test_pipeline_backend_execution_env.py -q

collected 159 items
159 passed in 6.67s
exit 0

All pytest runs emitted the pre-existing environment-level RequestsDependencyWarning for installed urllib3/chardet versions. It did not affect collection or assertions.

Syntax compilation

/home/xia-lab/miniconda3/envs/test4py311/bin/python -m py_compile \
  gfa_core/ppi_string_policy.py \
  gfa_core/string_rate_gate.py \
  skills/ppi/run.py \
  apps/web/pipeline_backend.py

exit 0; no output

Fresh direct production probes

A separate inline Python verifier imported current production code, blocked the same four socket/DNS entry points, used temporary files plus local fake clients, and exited 0. Its terminal conclusions were:

PASS redirects disabled; no Location resend; final URL authority enforced for scientific/image paths
PASS every declared species self-resolves; unknown/empty fail before HTTP
PASS mapping shape/queryIndex/echo/taxon/stringId coherence fail closed
PASS endpoint identity/taxon/score/status plus empty-vs-failure semantics
PASS empty/comment-only/all-missing Ortholog = 2/0/0/2 with zero API calls
PASS partial Ortholog denominator and wrapper/subclass deterministic path
PASS production PpiSkill.run 24 relationships -> 12 selected STRING IDs with 24 provenance rows
PASS rate gate rejects nonfinite interval/clock and corrupt/unreadable timestamps
DIRECT_PROBE_PASS all historical Task 3 defects; sockets blocked

The direct evidence closes every historical defect as follows:

Historical defect Fresh evidence
Unsupported/empty species fell back to Arabidopsis Every code in STRING_SPECIES_MAP resolved to its declared taxon; empty and unknown values raised before the fake client recorded any HTTP call; Spinacia oleracea resolved to 3562.
Four declared codes were unreachable ath, soe, osa, zma, gma, ptr, vvi, sly, mtr, stu, bdi, and sbi all self-resolved exactly. The invariant is implemented at gfa_core/ppi_string_policy.py:32-33.
Stable URL authority was fail-open Exact/genuine STRING HTTPS hosts were accepted; HTTP, deceptive suffix hosts, credentials, explicit port, double-slash/empty-label hosts, and javascript: were rejected.
Redirects could resend identifiers and bypass the gate Scientific 307/308 probes made exactly one request with allow_redirects=False and never called the supplied Location. Optional image probes attempted only the three configured authoritative STRING endpoints, all with redirects disabled, and never called the external Location. Production enforcement is at skills/ppi/run.py:143-160 and apps/web/pipeline_backend.py:3248-3265.
Final response authority was ignored An already-followed fake response whose final URL was https://collector.evil.example/received was rejected as protocol failure before JSON parsing; the image path likewise rejected non-STRING final authority.
Mapping rows accepted malformed identity/taxon data Missing/blank preferredName, malformed/blank STRING IDs, duplicate/out-of-range queryIndex, wrong echo, booleans/floats, and wrong row taxon were rejected.
Mapping STRING ID could contradict selected taxon ncbiTaxonId=3562 with stringId=3702.A was rejected; valid 3562.A was accepted. Cross-field enforcement is at skills/ppi/run.py:256-303.
Network rows accepted blank/missing/foreign endpoints Missing stringId_A, wrong-taxon endpoint IDs, whitespace endpoint names, wrong row taxon, NaN, and out-of-range scores were all rejected; a complete 3562 row was accepted. Enforcement is at skills/ppi/run.py:364-388.
Malformed status escaped the typed boundary A non-integer status raised StringApiError(kind="protocol"). Mapping 404 and [] remained zero-resolution, network [] remained a valid empty network, and network 503 remained a typed HTTP failure.
Empty/comment-only Ortholog silently switched to direct mode Empty, comment-only, and all-nonmatching supplied mapping files each returned ID-resolution failure with exact metrics input=2 / relationships=0 / resolved=0 / unresolved=2 and zero mapping/network calls. Explicit projected-mode selection is at skills/ppi/run.py:1141-1182.
Missing canonical members disappeared from denominators A partial mapping produced exact 2 / 1 / 1 / 1 input/relationship/resolved/unresolved metrics. Complete canonical membership is included at skills/ppi/run.py:842-860.
Signature inspection could select a legacy path A subclass overriding analyze_network(self, *args, **kwargs) still used deterministic resolution and submitted only the resolved STRING ID.
Relationship provenance was lost during deduplication The production PpiSkill.run() probe consumed 24 canonical-to-reference relationships, wrote 24 TSV data rows, deduplicated to 12 reference queries, resolved 5 from raw XP evidence and 7 from GeneID fallback, and submitted exactly 12 selected STRING IDs.
Rate gate could fail open on invalid/corrupt state NaN/infinite intervals and clocks, empty/NaN/infinite/nonnumeric timestamp files, and a non-missing read error all failed closed. The lock remains held across read/wait/atomic replacement at gfa_core/string_rate_gate.py:82-148.

Scope and residual validation

  • Verdict scope is approved Task 3 only.
  • No live STRING request, backend service execution, Celery restart, or full real-job execution was performed. Those remain Task 6 work; Task 3 explicitly uses offline fake clients, and socket blocking proves this final verification stayed offline.
  • No source or repository test file was edited during this verification. This report is the only repository file created.
  • No service/Celery restart was needed, and no diagnosis record was updated because diagnosis is Task 5 scope.