From cd353b6432e34b0fac4268191113f6790be40852 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Mon, 13 Jul 2026 08:02:43 -0400 Subject: [PATCH] Review safe-polish: docs accuracy, dead imports, no-emoji, geenforce robustness From the full multi-agent review (0 high, 7 medium, 17 low findings). Applies the mechanical, low-risk items; design/policy findings left for a decision. Docs accuracy: CLAUDE.md contract 0.10.0 -> 0.11.0 and both stale Alembic head citations -> 7d24_customfield_searchable / 31 migrations; Dockerfile bundled- plugin comment fixed (drop nonexistent "equipment", add machines + measuringtools, count eleven). Style/naming (LOCKED rules): remove a CSS-escaped pushpin emoji before location search results (no-emoji policy); rename ManifestEditor shareRoot -> shareroot (variable mirrors the API field verbatim). Dead code: remove confirmed-unused imports across ~20 modules (require_role/ require_permission scaffold residue, stray db/Vendor/Model/current_user/Optional/ error_response); drop unused build_scope import + a stale GEENFORCE_API_KEY docstring clause in geenforce. Migration files left untouched. Correctness: geenforce ingest robustness - record_enforcement_report now 400s on a non-dict counts / non-list results instead of 500; _apply_app_link ignores a non-numeric appid per its docstring instead of 500. Regression tests added. Backend query.get sweep finished: auth.py refresh -> db.session.get (last one). 910 backend tests pass; pyflakes clean; naming green; frontend build green. Co-Authored-By: Claude Opus 4.8 --- CLAUDE.md | 6 +- Dockerfile | 5 +- frontend/src/views/SearchResults.vue | 4 - .../src/views/geenforce/ManifestEditor.vue | 8 +- plugins/computers/api/routes.py | 4 +- plugins/geenforce/api/routes.py | 13 +- plugins/geenforce/plugin.py | 2 +- plugins/geenforce/service.py | 6 + plugins/knowledgebase/api/routes.py | 2 +- plugins/machines/api/routes.py | 4 +- plugins/network/api/routes.py | 2 +- plugins/notifications/api/routes.py | 2 +- plugins/printers/api/asset_routes.py | 2 +- plugins/usb/plugin.py | 1 - plugins/warranty/services/providers.py | 1 - shopdb/__init__.py | 2 +- shopdb/core/api/applications.py | 2 +- shopdb/core/api/assets.py | 2 +- shopdb/core/api/auditlogs.py | 384 +++++++++--------- shopdb/core/api/auth.py | 2 +- shopdb/core/api/businessunits.py | 2 +- shopdb/core/api/locations.py | 2 +- shopdb/core/api/models.py | 2 +- shopdb/core/api/modeltypes.py | 4 +- shopdb/core/api/operatingsystems.py | 2 +- shopdb/core/api/plugins.py | 2 +- shopdb/core/api/vendors.py | 2 +- shopdb/core/services/dualpath.py | 1 - shopdb/utils/responses.py | 2 +- tests/test_plugins/test_geenforce_crud.py | 11 + .../test_plugins/test_geenforce_reporting.py | 13 + 31 files changed, 263 insertions(+), 234 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index d62f158..797dc3b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -43,9 +43,9 @@ Refactor phases 0-5 landed; phase 6 (multi-site distribution readiness) largely ### Active state - 808 tests passing, naming/style check green, Gitea Actions CI (backend + naming + frontend build) -- `__contract_version__` at 0.10.0 (product `__version__` 0.7.0, tags v0.5.0/v0.6.0/v0.7.0 - distinct series, ADR-007) +- `__contract_version__` at 0.11.0 (product `__version__` 0.7.0, tags v0.5.0/v0.6.0/v0.7.0 - distinct series, ADR-007) - 11 bundled plugins all satisfy contract: computers, employees, knowledgebase, machines, measuringtools, network, notifications, printers, slides, usb, warranty -- Core Alembic chain: baseline `68b3947ae14f` -> head `7d23_user_mustchangepassword` (30 core migrations). Each plugin owns its own chain (ADR-008); deploy runs `flask db upgrade` then `flask plugin upgrade-all`. Reproducible + idempotent from empty. +- Core Alembic chain: baseline `68b3947ae14f` -> head `7d24_customfield_searchable` (31 core migrations). Each plugin owns its own chain (ADR-008); deploy runs `flask db upgrade` then `flask plugin upgrade-all`. Reproducible + idempotent from empty. - API is migration-complete: an admin PAT + docs/IMPORT-API.md let a script/LLM import the whole legacy DB (X-Import-Mode preserves timestamps). - Pre-1.0 framework; sister sites should pin tight `core_version` ranges until contract reaches 1.0 @@ -134,4 +134,4 @@ Each plugin must have: - `migrations/FIX_LOCATIONONLY_EQUIPMENT_TYPES.md` - LocationOnly equipment type fix - `migrations/PRODUCTION_MIGRATION_GUIDE.md` - production import methods - `migrations/rename_underscore_columns.sql` - one-time rename of snake_case columns to lowercase concatenated (per CONTRIBUTING.md) -- `migrations/versions/` - the core Alembic chain (baseline `68b3947ae14f` -> head `7d16_directoryemployees`). Run `flask db upgrade` to apply. +- `migrations/versions/` - the core Alembic chain (baseline `68b3947ae14f` -> head `7d24_customfield_searchable`). Run `flask db upgrade` to apply. diff --git a/Dockerfile b/Dockerfile index 17291fc..9450c59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,9 @@ # # One image, one site. Per ADR-004, each adopting facility runs its own # stack with its own DB, secrets, and enabled-plugin list. This image -# bundles all ten core plugins (computers, employees, equipment, -# knowledgebase, network, notifications, printers, slides, usb, warranty); +# bundles all eleven core plugins (computers, employees, knowledgebase, +# machines, measuringtools, network, notifications, printers, slides, usb, +# warranty); # install them at runtime with `flask plugin install `. # # The frontend is built in a first stage and its dist output is copied into diff --git a/frontend/src/views/SearchResults.vue b/frontend/src/views/SearchResults.vue index 532965a..6f7a12f 100644 --- a/frontend/src/views/SearchResults.vue +++ b/frontend/src/views/SearchResults.vue @@ -464,10 +464,6 @@ watch(results, () => { color: var(--text-light); } -.result-location::before { - content: '\1F4CD '; -} - .result-ticket { font-family: monospace; font-size: 0.75rem; diff --git a/frontend/src/views/geenforce/ManifestEditor.vue b/frontend/src/views/geenforce/ManifestEditor.vue index 2917e25..0b4424d 100644 --- a/frontend/src/views/geenforce/ManifestEditor.vue +++ b/frontend/src/views/geenforce/ManifestEditor.vue @@ -36,7 +36,7 @@