PR Vision v0.1.1: rename from peptide-geo-monitor + P2 fixes
- Exhaustive rename: PGM_ -> PRV_, pgm_ -> prv_, text domain and slug peptide-geo-monitor -> pr-vision, admin menu GEO Monitor -> PR Vision, main file peptide-geo-monitor.php -> pr-vision.php, DB table pgm_ai_visibility -> prv_ai_visibility. - P2-A: replace ltrim($host,'www.') character-mask with str_starts_with/substr prefix strip in PRV_Citation_Detector. Adds test coverage for wikipedia.org, webmd.com survival. - P2-B: drop continue-on-error: true from PHPCS CI step; WordPress Coding Standards now gates the build. - P2-C: remove dead in-run cache from PRV_Probe_Runner::run(); each (peptide, intent, model) triplet is visited once per run, cache hit is structurally impossible. - Version bump 0.1.0 -> 0.1.1 + CHANGELOG [0.1.1] entry. Agent-Session: pr-vision rename v0.1.1
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Conventions — Peptide GEO Monitor
|
||||
# Conventions — PR Vision
|
||||
|
||||
**Version:** 0.1.0 | **Last updated:** 2026-06-13
|
||||
**Version:** 0.1.1 | **Last updated:** 2026-06-13
|
||||
|
||||
Applies to all contributors and AI agents working in this repo. Where this document and `AGENT-OPERATING-STANDARD.md` conflict on process, the Standard wins; this document wins on code style.
|
||||
|
||||
@@ -16,20 +16,20 @@ Applies to all contributors and AI agents working in this repo. Where this docum
|
||||
|
||||
| Concept | Convention | Example |
|
||||
|---------|-----------|---------|
|
||||
| Class | `PGM_` prefix + PascalCase | `PGM_Cost_Ledger` |
|
||||
| Interface | `PGM_` prefix + PascalCase | `PGM_Probe_Provider` |
|
||||
| File | `class-pgm-*.php` or `interface-pgm-*.php` | `class-pgm-probe-runner.php` |
|
||||
| Option | `pgm_` prefix | `pgm_monthly_budget_usd` |
|
||||
| Hook / cron | `pgm_` prefix | `pgm_weekly_probe` |
|
||||
| Constant | `PGM_` prefix | `PGM_TARGET_DOMAIN` |
|
||||
| wp-config key | `PGM_` prefix | `PGM_OPENROUTER_API_KEY` |
|
||||
| Class | `PRV_` prefix + PascalCase | `PRV_Cost_Ledger` |
|
||||
| Interface | `PRV_` prefix + PascalCase | `PRV_Probe_Provider` |
|
||||
| File | `class-prv-*.php` or `interface-prv-*.php` | `class-prv-probe-runner.php` |
|
||||
| Option | `prv_` prefix | `prv_monthly_budget_usd` |
|
||||
| Hook / cron | `prv_` prefix | `prv_weekly_probe` |
|
||||
| Constant | `PRV_` prefix | `PRV_TARGET_DOMAIN` |
|
||||
| wp-config key | `PRV_` prefix | `PRV_OPENROUTER_API_KEY` |
|
||||
| Test file | `test-*.php` | `test-citation-detector.php` |
|
||||
|
||||
## 3. File structure
|
||||
|
||||
- **One class per file.** Interfaces get their own file.
|
||||
- **300-line limit** (enforced by CI). Split at the method boundary when approaching the limit.
|
||||
- Autoloader resolves `PGM_Foo_Bar` → `class-pgm-foo-bar.php` via a search across `includes/` subdirectories.
|
||||
- Autoloader resolves `PRV_Foo_Bar` → `class-prv-foo-bar.php` via a search across `includes/` subdirectories.
|
||||
|
||||
## 4. Docblocks
|
||||
|
||||
@@ -43,7 +43,7 @@ Every class must have a preamble docblock:
|
||||
*
|
||||
* @see <cross-reference 1>
|
||||
* @see <cross-reference 2>
|
||||
* @package PeptideGeoMonitor
|
||||
* @package PrVision
|
||||
*/
|
||||
```
|
||||
|
||||
@@ -63,22 +63,22 @@ Every public method must have:
|
||||
## 6. Tests
|
||||
|
||||
- Tests live in `tests/unit/test-*.php` and are run by the CI `lint-php` job via `php $test`.
|
||||
- Each test file `require_once`s `tests/bootstrap.php` and calls `exit( pgm_test_summary() )`.
|
||||
- Use `pgm_assert()`, `pgm_assert_equals()`, `pgm_assert_throws()`.
|
||||
- Mock HTTP via `$GLOBALS['pgm_test_state']['remote_posts']` (queued responses).
|
||||
- Each test file `require_once`s `tests/bootstrap.php` and calls `exit( prv_test_summary() )`.
|
||||
- Use `prv_assert()`, `prv_assert_equals()`, `prv_assert_throws()`.
|
||||
- Mock HTTP via `$GLOBALS['prv_test_state']['remote_posts']` (queued responses).
|
||||
- No PHPUnit dependency.
|
||||
|
||||
## 7. Adding a new provider
|
||||
|
||||
1. Create `includes/providers/class-pgm-{name}-provider.php`.
|
||||
2. Implement `PGM_Probe_Provider` (`probe()`, `get_name()`, `is_configured()`).
|
||||
3. Add a branch in `PGM_Probe_Runner::resolve_provider()`.
|
||||
1. Create `includes/providers/class-prv-{name}-provider.php`.
|
||||
2. Implement `PRV_Probe_Provider` (`probe()`, `get_name()`, `is_configured()`).
|
||||
3. Add a branch in `PRV_Probe_Runner::resolve_provider()`.
|
||||
4. Update `ARCHITECTURE.md` §5 (Providers table).
|
||||
5. Add a parse test in `tests/unit/test-provider-parsing.php`.
|
||||
|
||||
## 8. Adding a new collector/panel pair
|
||||
|
||||
1. Implement `PGM_Data_Collector` in `includes/collector/`.
|
||||
2. Implement `PGM_Dashboard_Panel` in `includes/panel/`.
|
||||
3. Register both in `PGM_Plugin::init()` via `PGM_Collector_Registry::instance()`.
|
||||
1. Implement `PRV_Data_Collector` in `includes/collector/`.
|
||||
2. Implement `PRV_Dashboard_Panel` in `includes/panel/`.
|
||||
3. Register both in `PRV_Plugin::init()` via `PRV_Collector_Registry::instance()`.
|
||||
4. Update `ARCHITECTURE.md` §6 (Collector/Panel seam).
|
||||
|
||||
Reference in New Issue
Block a user