Files
PlantAI-dev/.planning/ppi_kaks_current_diagnosis_20260808/findings.md
T

14 KiB

Findings

Historical hypotheses to re-check

  • PPI Gm LIS/SoyBase identifiers may not resolve to STRING identifiers.
  • PPI failed Manifest may lose the skill-level issue and ID-resolution artifact.
  • PPI technical reference may leak into biological scope/planning.
  • KaKs may contain user-specific absolute tool paths.
  • KaKs project skill may be a non-executing placeholder.
  • KaKs method/provenance may disagree with the actual PAML yn00/MUSCLE commands.
  • KaKs legacy execution may silently default to Arabidopsis.

Current evidence

  • Current main HEAD is 7399b0bf1; WTX worktree is independently ahead at 68d305f5d, so WTX history cannot be assumed to equal current main.
  • Current main apps/cli/run_kaks_v2.py still hard-codes /home/xzq/miniconda3/envs/test4py311 in the shebang, PATH/LIB setup, MUSCLE, pal2nal, yn00, and Rscript paths.
  • Current main skills/kaks/run.py:83-84 still logs completion while explicitly marked TODO placeholder.
  • Current KaKs CLI defaults neutral_rate=7.08e-9, contains Ath-specific data comments/diagnostics, and records yn00 as KaKs_Calculator (YN model).
  • Current legacy backend KaKs path still defaults missing reference to Ath and invokes hard-coded /home/xzq/miniconda3/bin/conda.
  • Current PlanningAgentV2 still maps explicit PPI species through a five-item static map and may write it into shared referenceSpecies/refSpeciesList with scopeMode=target_plus_reference.
  • Current stage tool description still says PPI requires ortholog mapping and defaults PPI species=ath, score=200.
  • Current PPI normalization and failed-manifest ownership still require detailed source tracing; search confirms the same issue codes and layers exist.
  • PPI planning root cause is current and explicit: _generate_default_stages() mutates the shared intent params before per-stage params are built. An explicit PPI species in a five-item static map becomes shared referenceSpecies/refSpeciesList and may set scopeMode=target_plus_reference, so technical STRING ownership can alter biological scope for every later stage.
  • normalize_gene_ids_for_string() currently contains only the rice transcript-to-gene rule. The PPI skill can additionally consume an evidence TSV through ReferenceAliasIndex, so the current Gm question depends on whether backend supplies an appropriate job-local --id-map; absence of a Gm mapping rule alone is not yet enough to conclude the production path must fail.
  • Stage tool/catalog drift is confirmed: PPI metadata still describes ortholog mapping as required and defaults species=ath, inconsistent with the newer snapshot/direct-target execution path.
  • PPI skill failed manifests are capable of preserving exact issue_code, metrics, artifacts, and provenance. The suspected information loss must therefore occur after the skill exits, in backend finalization/merge logic.
  • Backend projected PPI requires an ID-map and passes --id-map, but direct STRING-supported targets only pass it opportunistically if <input>/<ppi_storage_key>/<storage_key>.pep_cds_idmap.tsv happens to exist. For direct Gm, ppi_storage_key falls back to the STRING species token (gma/taxon), while job identifiers use LIS/SoyBase namespace; there is no current Gm transform in policy. This reproduces the structural precondition for 0/56 mapping unless a correctly named job-local ID map is present.
  • PPI failure ownership defect is confirmed in current source: the skill writes the exact failed manifest under workspace/ppi/<prefix>.manifest.json, but backend copies skill artifacts only when exit code is 0. On nonzero exit, it never reads/copies/merges that manifest; it creates or mutates final/<prefix>.ppi.manifest.json with generic error/provenance and can leave artifacts={}. This discards the skill-level ID-resolution issue/metrics/artifact and can also mutate a pre-existing final manifest.
  • Existing tests cover successful PPI artifact synchronization and owner isolation, but the initial search found no test asserting skill-failed-manifest preservation through backend finalization.
  • KaKs has two materially different backend paths. The scope path is fail-closed for missing target/reference species and files and uses sys.executable; the legacy no-scope path silently defaults the reference to Ath, searches Ft/Ath-specific filenames, and invokes /home/xzq/miniconda3/bin/conda.
  • Both KaKs paths call the same CLI, whose shebang/environment and MUSCLE/pal2nal/yn00/Rscript executables are hard-coded under /home/xzq. Therefore scope correctness does not solve deployment portability on a /home/xia-lab installation.
  • run_kaks_v2.py does generate a failed manifest and exits nonzero when no pair succeeds, but the backend returns a generic stage manifest on CLI failure and does not explicitly surface/merge the CLI failed manifest into status/diagnosis.
  • KaKs execution method is PAML yn00 after MUSCLE protein alignment and pal2nal codon projection, but CLI Manifest names the calculator KaKs_Calculator (YN model). The project skill/config additionally advertise CodeML M0/M1/M7/M8 and MUSCLE 5.1 while the authoritative backend never invokes the placeholder skill and the CLI uses MUSCLE 3-style -in/-out syntax.
  • The default neutral rate 7.08e-9 is labeled Arabidopsis in the project skill but is passed to every target/reference run unless overridden; the manifest records the number without species applicability/source provenance.
  • The current test inventory is rich for PPI/KaKs preflight isolation and frontend dependency ownership, but the search found no dedicated tests that execute run_kaks_v2.py, validate its tool resolver, assert nonzero failed-manifest propagation, or audit method/version truthfulness.
  • The normal frontend execution path is intentionally disabled for both stages: ppiKaksTemporaryCircuitBreakerEnabled = true. Batch execution marks PPI and KaKs paused, blocks their /api/execute submission, and also pauses an Ortholog stage that was auto-inserted solely for unavailable PPI/KaKs owners. Manual execution is blocked with “功能修订中,当前暂不可用”.
  • Therefore the most immediate current user-visible state is not “PPI/KaKs sometimes fail”; it is “the frontend never submits either stage”. Backend/CLI defects remain latent and can still affect direct API or future re-enablement.
  • The circuit breaker has dedicated unit tests proving later non-PPI/KaKs stages continue after pause; it is deliberate current behavior, not an accidental deadlock.
  • Environment classification: the mounted SJ/WTX-style worktree has broken absolute input and workspace symlinks into /home/xzq, while data is valid. On the actual 5090 production host, every hard-coded KaKs executable checked (MUSCLE, pal2nal, yn00, Rscript, conda) exists. Thus hard-coded paths are a confirmed portability/design defect and break the /home/xia-lab worktree, but they do not by themselves prove current 5090 production execution failure.
  • Existing Gm/TCP evidence exactly confirms cross-layer PPI loss: skill manifest has ppi_string_id_resolution_failed, 0/56 mappings, metrics and an ID-resolution TSV; final manifest has no issue code/metrics and empty artifacts. Both carry a misleading resource_error provenance and unused reference_species=At for a direct Gm query.
  • Existing Os/PEBP KaKs real run proves the core production computation can succeed on 5090: 17/17 pairs, result table and plots. It simultaneously confirms methodology drift: actual MUSCLE 3.8 + PAML yn00 is recorded as KaKs_Calculator, yn00 version is unknown, and the universal neutral-rate value is used without source/applicability metadata.
  • Current full PPI/KaKs-named unit suite result on production: 151 collected, 150 passed, 1 failed. The failure is the natural-language PPI Reset entry point.
  • PPI Reset root cause is current: isPpiResetIntent() is defined and detects the intended phrases, and the dialog/API implementation exists, but the predicate is never called by handleNlInput() and there is no openPpiResetDialog() call. The button path openPpiResetDialog(stage) still exists, so this is an orphaned natural-language route rather than a broken reset backend.
  • Current SJ main and WTX contain byte-identical PPI/KaKs core files: KaKs CLI/skill/config/docs, PPI policy/skill/provenance, backend, PlanningAgentV2, and stage tools. Only apps/web/vue3/index.html differs among the checked files. Therefore WTX does not contain a hidden backend/CLI PPI/KaKs fix that is merely awaiting merge.
  • The circuit breaker was introduced by commit 2623d3114 on 2026-08-06, although that commit is titled feat: update header and hide extension. This is a traceability problem: a material PPI/KaKs runtime behavior change was bundled under an unrelated frontend commit title. WTX does not contain the circuit breaker; SJ main does.
  • Diagnosis drift is confirmed. PPI diagnostics derive their code primarily from ppi_provenance.diagnosis_code; the real Gm final provenance says ppi_string_resource_error, so DiagnosisAgent cannot recover the exact skill issue after backend discarded it. Its declared PPI failure list includes ppi_string_id_mapping_low but not the skill's actual ppi_string_id_resolution_failed code.
  • KaKs DiagnosisAgent correctly detects missing reference scope, but its recommendation says to use a project default reference when unspecified. That conflicts with the KaKs contract's fail-closed rule (“不得自动换用 At”), so diagnosis can recommend the same unsafe legacy behavior the contract forbids.
  • Minimal current PlanningAgentV2 reproduction confirms the PPI scope bug, not just static suspicion. Input target=Gm, scopeMode=target_only, ppiSpecies=gma, stages=motif,ppi produces both stages with referenceSpecies=['Gm'], scopeMode=target_plus_reference, analysisRoute=multi_species, and scope/member-set IDs containing ref-Gm. Thus a PPI technical selector changes unrelated motif biological identity and even makes the target its own reference.
  • The failed Gm job contains input/Gm.id_alias.tsv (168,133 lines), but it maps LIS raw IDs to essentially the same LIS canonical IDs; it is not a STRING alias map. Backend also does not discover this file, because PPI looks for <input>/<ppi_storage_key>/<ppi_storage_key>.pep_cds_idmap.tsv. Resolution rows show only raw/versionless LIS candidates and all 56 unresolved. Root cause is not “STRING lacks Gm”; it is the absence of a validated LIS/SoyBase→STRING namespace mapping plus no compatible evidence-discovery contract.
  • Live 9010 /api/stage-status confirms the user-visible Gm PPI status is generic/wrong: failed, zero artifacts, error only “Manifest has no artifacts”, empty diagnosis report, and provenance ppi_string_resource_error with stale reference_species=At. The exact 0/56 ID-resolution root cause and TSV do not reach status.
  • Live 9010 status for historical Sv.HKL confirms PPI computation is not globally broken: the stage is completed with 6/6 IDs mapped, 15 interactions, six artifacts, target-only biological scope, and STRING taxon 4555 as technical ownership.
  • Live 9010 full-identity status for historical Os.PEBP confirms KaKs computation is not globally broken: the stage is completed with 17/17 pairs and three aggregate artifacts under the expected target/reference scope and member-set identity.

Final classification

Confirmed current defects

  1. PPI/KaKs are globally blocked in the normal frontend execution path by the enabled temporary circuit breaker; this is deliberate pause behavior, not a backend exception.
  2. PPI planning mutates shared biological scope from a technical STRING selector, contaminating unrelated stages and allowing target=reference scope.
  3. PPI nonzero-exit finalization discards the skill's exact issue, metrics, and resolution artifact, causing generic and sometimes stale user-facing diagnosis.
  4. Direct Gm PPI lacks a validated LIS/SoyBase-to-STRING mapping/evidence-discovery contract; the available job alias table is neither compatible nor consumed.
  5. KaKs has divergent scope and legacy backend semantics; the legacy path silently defaults to Ath contrary to the fail-closed contract.
  6. The project KaKs skill is a placeholder that reports completion without running KaKs, while production uses a separate CLI path.
  7. KaKs executable/environment paths are deployment-specific and its declared methodology/provenance do not truthfully match MUSCLE 3 + pal2nal + PAML yn00 execution.
  8. Natural-language PPI Reset is orphaned because its intent predicate is never invoked, despite the dialog/API and button path existing.

Confirmed but currently latent or environment-dependent

  • PPI/KaKs backend defects are hidden from the normal UI while the frontend circuit breaker remains enabled, but remain reachable by direct API or future re-enablement.
  • KaKs hard-coded /home/xzq paths are a portability defect and break the mounted /home/xia-lab worktree; those exact tools currently exist on the 5090 production host, so this alone is not evidence of a current production computation failure.
  • KaKs failed-manifest loss is strongly indicated by current source structure, but no real failed KaKs run was used to confirm the final user-visible outcome in this diagnosis.

Explicitly disproved overbroad conclusions

  • PPI is not globally nonfunctional: a validated Sv projected run completed successfully.
  • KaKs is not globally nonfunctional: an Os-to-At real run completed 17/17 pairs.
  • STRING support for Gm is not the root cause of the Gm failure; identifier namespace/evidence wiring is.
  • WTX does not contain an unsynchronized hidden core fix for these paths; checked core files are byte-identical to SJ main.