perf(search): prefix-by-default Deployments and config-audit search; bounded Contains opt-in (ScadaBridge#50)
Deployments free-text search and the config-audit EntityName filter no longer emit LIKE '%term%' by default. Prefix (LIKE 'term%') is the default; substring is an explicit opt-in (DeploymentSearchMode.Contains / entityNameContains) always bounded by a DeployedAt/Timestamp window (explicit, else 30 days). Migration PrefixSearchIndexes adds DeployedBy, RevisionHash and EntityName indexes. Deployments page gains a 'Match anywhere' checkbox. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -229,6 +229,7 @@ spec for each is `docs/requirements/Component-<Name>.md`, and `README.md` carrie
|
||||
- Host readiness gating: `/health/ready` endpoint, no traffic until operational.
|
||||
- EF Core migrations: auto-apply in dev, manual SQL scripts for production. Gotcha: `dotnet ef migrations add … --no-build` scaffolds off the previously-built DLL and can emit an **empty** migration — build first (drop the `--no-build`), and delete the empty `Migrations/` files if it happens (`migrations remove` needs a live DB).
|
||||
- Audit logging absorbed into Configuration Database component (IAuditService). The config `AuditLogEntries` table stores **summaries** (a script body is recorded as length + SHA-256), caps `AfterStateJson` at 256 K chars, pages deterministically on `(Timestamp DESC, Id DESC)`, and has an optional purge: `ScadaBridge:ConfigAudit:RetentionDays` (default `0` = retained indefinitely), `PurgeBatchSize` 5000, `MaxBatchesPerTick` 200, `PurgeInterval` (bound with `ValidateOnStart` on Central).
|
||||
- **Search is prefix by default (ScadaBridge#50, register row 36).** The Deployments page search (instance name, deployment id, revision hash, user) and the config-audit `EntityName` filter are `LIKE 'term%'` (index-seekable); a substring match is an explicit opt-in (`DeploymentListFilter.SearchMode = Contains` / the page's "Match anywhere" checkbox; `GetAuditLogEntriesAsync(entityNameContains: true)`) that is ALWAYS bounded to a `DeployedAt`/`Timestamp` window (explicit `DeployedFrom`/`from`, else the last 30 days). Migration `PrefixSearchIndexes` (script `docs/plans/sql/PrefixSearchIndexes.sql`; not applied to QA/prod) adds the `DeployedBy`, `RevisionHash` and `AuditLogEntries.EntityName` indexes. Tests: `SearchPrefixQueryTests` (SQL-shape via `ToQueryString`).
|
||||
- **Review remediation 2026-10-21** (8-slice system review, ~107 findings, 4 High; record `docs/plans/2026-10-21-system-review-remediation.md`). Decisions: CLI uses bearer-per-invocation (see Security); the never-read `Database:MachineDataDb` option was **removed** (it was a required boot key); config audit stores summaries + retention (above); a **bound Test Run** (Test Run against a deployed instance) now needs Deployer + site scope and writes an audit row; persisted static overrides **seed** script state at actor start without firing scripts (alarms still evaluate). Also changed: site deploy gate rejects non-actor-safe (`ActorNameRules`) instance/script/alarm/native-source names and Data Connection actor names are ASCII-sanitised with collision rejection; site gRPC addresses are validated on every write path (management + Transport import); artifact applies are serialised per site with a 10-min stuck-apply watchdog; `IDataConnection.WriteBatchAndWaitAsync` is **gone** (the script-level handshake composes `WriteTagBatchRequest` + waiter); `instance list --search` is a **prefix** match paged in SQL; command-plane failback probes readiness with a real RPC (probation 5 min); `Transport:SchemaVersionMajor` removed; migration `ReviewRemediationIndexes` (script `docs/plans/sql/ReviewRemediationIndexes.sql`; **QA/prod not yet applied**). New register rows 128-135; row 117 closed.
|
||||
|
||||
### Akka.NET Conventions
|
||||
|
||||
Reference in New Issue
Block a user