fix(tests): restore tested proxy methods in PSA_AI_Generator

AIGeneratorTest accesses build_validation_prompt() and
build_generation_prompt() via ReflectionClass - confirmed by running CI.
Restored both as compact single-docblock proxies to PSA_AI_Content.
Condensed section headers to keep file under 300 lines (now 299).

Agent-Session: claude-sonnet-4-6-adopt-ci-20260616
This commit is contained in:
peptiderepo
2026-06-16 13:24:51 +00:00
parent eae71a986d
commit 2aa35da61f
2 changed files with 11 additions and 3 deletions

View File

@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `.github/workflows/ci.yml`: replaced per-repo CI jobs with thin caller for the reusable `peptiderepo/peptide-e2e/.github/workflows/ci.yml@main` (tests: stubs, has_js: true). Adds blocking PHPCS, 300-line file-size enforcement, and phpcbf auto-commit on PRs.
- `.github/workflows/deploy.yml`: dropped redundant file-existence and PHP-syntax checks now covered by the reusable CI; kept PSA_VERSION constant check.
- `includes/class-psa-admin.php`: removed dead backward-compat proxy methods (all delegated to `PSA_Admin_Page`; zero external callers). File reduced from 327 → 290 lines (estate 300-line rule compliance).
- `includes/class-psa-ai-generator.php`: removed dead backward-compat proxy methods (all delegated to `PSA_AI_Content`; zero external callers). File reduced from 309 → 292 lines.
- `includes/class-psa-ai-generator.php`: removed untested backward-compat proxies (save_peptide_meta, assign_category_term); retained build_validation_prompt and build_generation_prompt as tested proxies (AIGeneratorTest uses reflection). Section headers condensed. File 309 → 299 lines.
- `includes/class-psa-search.php`: removed dead backward-compat proxy methods (all delegated to `PSA_Search_Handler`; zero external callers). File reduced from 307 → 294 lines.
- `peptide-search-ai.php`: synced `PSA_VERSION` constant (was stuck at 4.5.0) with plugin header (was 4.6.0); both now 4.7.0.
- `package.json` / `package-lock.json`: added minimal npm manifest (no dependencies) so the reusable `lint-js` job can run `npm ci` and fall back to `node --check` on the three JS asset files.

View File

@@ -237,8 +237,6 @@ class PSA_AI_Generator {
);
}
// ── Private helpers ─────────────────────────────────────────────────
/**
* Get plugin settings with defaults, decrypted API key, and constant override.
*
@@ -288,4 +286,14 @@ class PSA_AI_Generator {
}
return true;
}
/** @see PSA_AI_Content::build_validation_prompt() — kept for test reflection. */
public static function build_validation_prompt( string $name ): string {
return PSA_AI_Content::build_validation_prompt( $name );
}
/** @see PSA_AI_Content::build_generation_prompt() — kept for test reflection. */
public static function build_generation_prompt( string $peptide_name ): string {
return PSA_AI_Content::build_generation_prompt( $peptide_name );
}
}