Skip to content

Commit 01701db

Browse files
author
MPCoreDeveloper
committed
last status 06-04-2026
1 parent f43c665 commit 01701db

File tree

70 files changed

+6179
-362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+6179
-362
lines changed

.github/issue-drafts/admin-console-v1.6.0/00-epic-admin-console-and-tool-compatibility.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,22 @@
22
Deliver an administration and observability roadmap for `SharpCoreDB` that prioritizes compatibility with existing database tools and optionally adds a lightweight native admin experience.
33

44
## Status
5-
**State:** IN PROGRESS
5+
**State:** RESOLVED ✅
66

77
Resolved workstreams in repository:
88
- [x] `01-tool-compatibility-matrix-and-certification.md`**RESOLVED**
99
- [x] `02-pg-catalog-and-information-schema-expansion.md`**RESOLVED**
10+
- [x] `03-binary-protocol-auth-and-session-hardening.md`**RESOLVED**
11+
- [x] `04-sql-compatibility-and-ddl-introspection-polish.md`**RESOLVED**
12+
- [x] `05-diagnostics-and-metrics-surface-upgrades.md`**RESOLVED**
13+
- [x] `06-viewer-v2-foundation-desktop-tooling.md`**RESOLVED**
14+
- [x] `07-viewer-diagnostics-and-admin-actions.md`**RESOLVED**
15+
- [x] `08-optional-web-admin-razor-pages-mvp.md`**RESOLVED**
16+
- [x] `09-odbc-jdbc-driver-strategy-feasibility.md`**RESOLVED**
17+
- [x] `10-documentation-and-adoption-playbook.md`**RESOLVED**
18+
- [x] `11-tool-compatibility-ci-smoke-tests.md`**RESOLVED**
1019

11-
Next planned work:
12-
- [ ] `03` and beyond — see remaining issue drafts.
20+
All workstreams complete. Epic 100% delivered for v1.6.0.
1321

1422
This roadmap is based on current `v1.6.0` behavior:
1523
- `tools/SharpCoreDB.Viewer` exists but remains minimal.

.github/issue-drafts/admin-console-v1.6.0/03-binary-protocol-auth-and-session-hardening.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
Harden binary protocol authentication/session behavior for external GUI and driver expectations.
33

44
## Status
5-
**State:** OPEN
5+
**State:** RESOLVED ✅
6+
**Completed:** 2025-04-06
7+
8+
### Delivered
9+
- Fixed SSL negotiation loop (reject repeat `SSLRequest` after initial negotiation)
10+
- Added missing parameter status messages (`server_version`, `server_encoding`, `client_encoding`, `DateStyle`, `TimeZone`, `integer_datetimes`, `application_name`) in `AuthenticateAndCreateSessionAsync`
11+
- Added `severity` field to `WriteErrorResponseAsync` for PG-compliant error responses
12+
- Added database existence validation before authentication (returns `3D000 invalid_catalog_name`)
13+
- 4 integration tests covering handshake, SSL, auth failure, and unknown database scenarios — all passing
614

715
## Why
816
Current binary protocol startup/auth flow is functional but needs stronger parity and production behavior.

.github/issue-drafts/admin-console-v1.6.0/04-sql-compatibility-and-ddl-introspection-polish.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,20 @@
22
Improve SQL compatibility and DDL/introspection behavior required by admin tools.
33

44
## Status
5-
**State:** OPEN
5+
**State:** RESOLVED ✅
6+
**Completed:** 2026-04-06
7+
8+
### Delivered
9+
- Added explicit result-shape schemas for common empty `pg_catalog` introspection views:
10+
- `pg_indexes`, `pg_index`, `pg_constraint`, `pg_proc`, `pg_trigger`, `pg_description`, `pg_stat_user_tables`, `pg_sequence`, `pg_attrdef`, `pg_depend`
11+
- Fixed catalog source detection ambiguity (longest-match selection) so `pg_indexes` no longer resolves to `pg_index`
12+
- Normalized binary protocol command tags for common statement classes:
13+
- row-returning: `SELECT n`
14+
- DML: `INSERT 0 n`, `UPDATE n`, `DELETE n`
15+
- DDL/transaction/session commands: `CREATE TABLE`, `CREATE INDEX`, `DROP TABLE`, `DROP INDEX`, `ALTER TABLE`, `BEGIN`, `COMMIT`, `ROLLBACK`, `SET`
16+
- Added regression coverage:
17+
- `PgCatalogServiceTests` for `pg_indexes`, `pg_constraint`, and `pg_proc` shape validation
18+
- `BinaryProtocolHandshakeTests` for DDL and `SELECT` command-tag validation
619

720
## Why
821
Many tools execute introspection SQL and DDL probes beyond regular CRUD workloads.

.github/issue-drafts/admin-console-v1.6.0/05-diagnostics-and-metrics-surface-upgrades.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,28 @@
22
Upgrade diagnostics surfaces for admin and monitoring workflows.
33

44
## Status
5-
**State:** OPEN
5+
**State:** RESOLVED ✅
6+
**Completed:** 2026-04-06
7+
8+
### Delivered
9+
- Expanded server metrics collector to include actionable in-memory telemetry snapshots:
10+
- request volume (`totalRequests`, query/non-query split)
11+
- reliability (`failedRequests`, `errorRatePercent`, `lastFailureCode`)
12+
- performance (`averageLatencyMs`, row and network byte totals)
13+
- protocol counters (`grpc`, `rest`, `binary` connection/request/message/error stats)
14+
- Added protocol-level instrumentation:
15+
- binary protocol connection/message/error tracking in `BinaryProtocolHandler`
16+
- gRPC `Connect`, `Disconnect`, and `ExecuteNonQuery` request/latency/error metrics
17+
- Upgraded health payloads for faster triage:
18+
- `HealthCheckService` now emits check statuses, error rate summary, recent failure signal, and per-protocol diagnostics
19+
- `/api/v1/health` now includes triage check map and reliability fields
20+
- Upgraded `/api/v1/metrics` payload with actionable telemetry fields and protocol metrics map
21+
- Added observability contract tests:
22+
- `ObservabilityContractTests.GetSnapshot_AfterTraffic_ShouldExposeActionableCounters`
23+
- `ObservabilityContractTests.GetDetailedHealth_WhenErrorsPresent_ShouldSurfaceTriageSignals`
24+
- Added operator documentation:
25+
- `docs/server/OBSERVABILITY_SETUP_v1.6.0.md` with Prometheus JSON-scrape baseline and dashboard panel queries
26+
- Updated `docs/server/REST_API.md` and `docs/server/QUICKSTART.md` examples for upgraded diagnostics contracts
627

728
## Why
829
Developers and operators need reliable health and metrics insight without deep internals access.

.github/issue-drafts/admin-console-v1.6.0/06-viewer-v2-foundation-desktop-tooling.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,38 @@
22
Evolve `tools/SharpCoreDB.Viewer` into a stronger development companion (`Viewer v2` foundation).
33

44
## Status
5-
**State:** OPEN
5+
**State:** ✅ RESOLVED — implemented in v1.6.0
66

77
## Why
88
A lightweight first-party desktop utility helps validate features and supports local workflows.
99

1010
## Scope
11-
- Improve database/table browser UX.
12-
- Add richer query editor and result grid capabilities.
13-
- Add metadata panes (indexes/constraints/triggers where available).
14-
- Add connection profile management improvements.
11+
- Improve database/table browser UX — table filter, selected-table state, Refresh button.
12+
- Add richer query editor and result grid capabilities — multi-statement, F5/Ctrl+Enter shortcuts.
13+
- Add metadata panes (indexes/constraints/triggers) — columns, indexes, triggers via PRAGMA.
14+
- Add connection profile management improvements — recent connections saved, Use/Remove actions.
1515

1616
## Implementation Plan
17-
1. Define MVP capabilities aligned to current server features.
18-
2. Refactor view-model/service layers for extensibility.
19-
3. Implement query/result and metadata exploration upgrades.
20-
4. Add user docs and basic smoke tests.
17+
1. Define MVP capabilities aligned to current server features.
18+
2. Refactor view-model/service layers for extensibility.
19+
3. Implement query/result and metadata exploration upgrades.
20+
4. Add user docs and basic smoke tests.
2121

2222
## Acceptance Criteria
23-
- Viewer supports practical daily development tasks.
24-
- Metadata and query UX clearly improved over baseline.
25-
- Documentation includes usage and limitations.
23+
- Viewer supports practical daily development tasks.
24+
- Metadata and query UX clearly improved over baseline.
25+
- Documentation includes usage and limitations — see `docs/viewer/viewer-v2-usage.md`.
2626

2727
## Dependencies
2828
- Benefits from metadata/protocol improvements.
29+
30+
## Resolved in
31+
- `tools/SharpCoreDB.Viewer/ViewModels/MainWindowViewModel.cs` — table filter, metadata panes, preview, keyboard shortcuts
32+
- `tools/SharpCoreDB.Viewer/ViewModels/ConnectionDialogViewModel.cs` — recent connection profiles
33+
- `tools/SharpCoreDB.Viewer/Models/AppSettings.cs``ConnectionProfile` model
34+
- `tools/SharpCoreDB.Viewer/Services/SettingsService.cs` — profile persistence helpers
35+
- `tools/SharpCoreDB.Viewer/Views/MainWindow.axaml` — explorer UX with filter + metadata panes
36+
- `tools/SharpCoreDB.Viewer/Views/ConnectionDialog.axaml` — recent connections UI
37+
- `tools/SharpCoreDB.Viewer/Views/MainWindow.axaml.cs` — F5/Ctrl+Enter keyboard handler
38+
- `tools/SharpCoreDB.Viewer/Resources/Strings.*.json` — all locales updated
39+
- `docs/viewer/viewer-v2-usage.md` — user documentation

.github/issue-drafts/admin-console-v1.6.0/07-viewer-diagnostics-and-admin-actions.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Add diagnostics and lightweight admin actions to `SharpCoreDB.Viewer`.
33

44
## Status
5-
**State:** OPEN
5+
**State:** RESOLVED
66

77
## Why
88
Users requested direct access to runtime metrics and common operational actions.
@@ -25,3 +25,21 @@ Users requested direct access to runtime metrics and common operational actions.
2525

2626
## Dependencies
2727
- Depends on diagnostics endpoint upgrades.
28+
29+
## Resolution
30+
Implemented in v1.6.0. Affected files:
31+
- `tools/SharpCoreDB.Viewer/Models/DiagnosticsSnapshot.cs` — immutable snapshot record
32+
- `tools/SharpCoreDB.Viewer/ViewModels/DiagnosticsViewModel.cs` — PRAGMA-based data collection, admin commands
33+
- `tools/SharpCoreDB.Viewer/Views/DiagnosticsDialog.axaml` — modal diagnostics dialog
34+
- `tools/SharpCoreDB.Viewer/Views/DiagnosticsDialog.axaml.cs` — code-behind; auto-runs on open
35+
- `tools/SharpCoreDB.Viewer/Views/MainWindow.axaml` — Diagnostics menu item (enabled when connected)
36+
- `tools/SharpCoreDB.Viewer/Views/MainWindow.axaml.cs``OnDiagnosticsClicked` handler
37+
- `tools/SharpCoreDB.Viewer/Resources/Strings.*.json` — 20 new keys across 6 locales
38+
39+
Features delivered:
40+
- Storage stats: page count, page size, total size, cache size, journal mode
41+
- Health status: PRAGMA integrity_check result with captured-at timestamp
42+
- Table row counts: COUNT(*) per table, sorted alphabetically
43+
- Admin actions: PRAGMA optimize, PRAGMA wal_checkpoint(FULL)
44+
- Export: full snapshot serialized to JSON via file picker
45+
- All operations guarded with IsRunning flag; error/success feedback per action

.github/issue-drafts/admin-console-v1.6.0/08-optional-web-admin-razor-pages-mvp.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Investigate and deliver an optional lightweight web admin MVP using ASP.NET Core Razor Pages.
33

44
## Status
5-
**State:** OPEN
5+
**State:** RESOLVED
66

77
## Why
88
A browser-based console lowers operational friction without committing to a heavy full console rewrite.
@@ -22,10 +22,30 @@ A browser-based console lowers operational friction without committing to a heav
2222
3. Add core pages for health/metrics/query/browse.
2323
4. Add docs and threat considerations.
2424

25+
## Implementation Notes
26+
- Feature-gated via `ServerConfiguration.EnableWebAdmin` (default: `false`).
27+
- Cookie-based authentication scheme `"WebAdmin"` — separate from the JWT Bearer scheme used by API/gRPC.
28+
- Admin role required (`DatabaseRole.Admin`); sign-in validates existing `UserConfiguration` password hash (SHA-256).
29+
- Razor Pages root: `src/SharpCoreDB.Server/WebAdmin/Pages/` (configured via `WithRazorPagesRoot`).
30+
- Pages delivered:
31+
- `GET /admin` — Dashboard with health stats, uptime, and per-check status.
32+
- `GET /admin/databases` — Configured databases with runtime online/offline status, encryption, storage mode.
33+
- `GET|POST /admin/query` — Guarded ad-hoc SQL with 500-row cap and full query logging.
34+
- `GET /admin/metrics` — MetricsCollector snapshot (active connections, latency, error rate, protocol breakdown).
35+
- `GET /admin/login` — Sign-in form (anonymous, admin role enforced after authentication).
36+
- `POST /admin/logout` — Cookie sign-out.
37+
- Security defaults:
38+
- `CookieSecurePolicy.Always` (HTTPS only).
39+
- `SameSiteMode.Strict`, `HttpOnly = true`.
40+
- Anti-forgery tokens on all POST handlers.
41+
- All query executions logged at Warning level via `ILogger`.
42+
- Route authorization configured declaratively via `AuthorizeFolder("/Admin")` + `AllowAnonymousToPage("/Admin/Login")`.
43+
- Does not affect existing JWT/gRPC/REST endpoints.
44+
2545
## Acceptance Criteria
26-
- MVP pages support core admin workflows.
27-
- Security defaults are strict and documented.
28-
- Feature is optional and does not break server core.
46+
- MVP pages support core admin workflows.
47+
- Security defaults are strict and documented.
48+
- Feature is optional and does not break server core.
2949

3050
## Dependencies
3151
- Depends on diagnostics and compatibility maturity.

.github/issue-drafts/admin-console-v1.6.0/09-odbc-jdbc-driver-strategy-feasibility.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,22 @@
22
Produce a concrete strategy for ODBC/JDBC enablement and external ecosystem integration.
33

44
## Status
5-
**State:** OPEN
5+
**State:** RESOLVED
6+
7+
## Implementation Notes
8+
9+
Completed for v1.6.0. Deliverable: `docs/server/ODBC_JDBC_STRATEGY.md`.
10+
11+
**Decision:** Adapter-first strategy — direct users to existing PostgreSQL ODBC/JDBC drivers (psqlODBC, pgjdbc) against the SharpCoreDB binary protocol endpoint (port 5433, TLS). No bespoke driver development required for v1.6.0.
12+
13+
**Key findings:**
14+
- Binary protocol endpoint is live and PostgreSQL wire-compatible (Protocol v3, TLS 1.2+).
15+
- Option A (adapter) satisfies >90% of reported enterprise use cases with zero development cost.
16+
- Option B (native ODBC) and Option C (native JDBC) deferred to v2.x pending confirmed enterprise demand.
17+
- Option D (JDBC proxy bridge) rejected — marginal benefit over Option A.
18+
- Phased roadmap defined: Phase 1 (adapter, now) → Phase 2 (catalog gap closure, v1.7.0) → Phase 3/4 (native drivers, v2.x).
19+
- ODBC quick-start and JDBC quick-start examples published in the strategy document.
20+
- Dependencies to binary protocol, pg_catalog, and security confirmed as satisfied by issues 01–03.
621

722
## Why
823
Some teams require standard connectivity layers for governance and tool compatibility.
@@ -20,9 +35,9 @@ Some teams require standard connectivity layers for governance and tool compatib
2035
4. Publish recommendation and decision record.
2136

2237
## Acceptance Criteria
23-
- Decision record with selected path and rationale.
24-
- Clear dependency map to protocol/catalog work.
25-
- Estimated implementation effort for next phases.
38+
- Decision record with selected path and rationale.
39+
- Clear dependency map to protocol/catalog work.
40+
- Estimated implementation effort for next phases.
2641

2742
## Dependencies
2843
- Informed by compatibility matrix and protocol maturity.

.github/issue-drafts/admin-console-v1.6.0/10-documentation-and-adoption-playbook.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,22 @@
22
Publish a practical adoption playbook for admin and tooling workflows.
33

44
## Status
5-
**State:** OPEN
5+
**State:** RESOLVED
6+
7+
## Implementation Notes
8+
9+
Completed for v1.6.0. Deliverable: `docs/server/ADMIN_TOOLING_GUIDE.md`.
10+
11+
**Delivered content:**
12+
- Three-endpoint overview (binary protocol / gRPC / HTTPS REST) with default ports.
13+
- Tool compatibility matrix: 8 GUI tools, 5 CLI tools, 6 BI/analytics tools, 10 programmatic drivers — with per-tool status (connect, browse, query, export, import) and notes.
14+
- Six setup flows: DBeaver, psql CLI, Npgsql (.NET), Python (psycopg2), Power BI Desktop (ODBC), Web Admin UI.
15+
- Known limitations table with 8 entries and mitigation steps.
16+
- Diagnostics & monitoring quickstart: health check endpoint, metrics endpoint, Prometheus integration example, SharpCoreDB Viewer diagnostics walkthrough.
17+
- Migration guidance for: embedded → server mode, custom HTTP/gRPC → standard API, file database → server hosted.
18+
- Connection string reference for all supported drivers/protocols.
19+
- Version support matrix (v1.4–v1.6).
20+
- `docs/INDEX.md` updated to link both new docs.
621

722
## Why
823
Users need clear guidance on what works now, what is in progress, and recommended paths.
@@ -22,9 +37,9 @@ Users need clear guidance on what works now, what is in progress, and recommende
2237
4. Link from root and package readmes.
2338

2439
## Acceptance Criteria
25-
- Docs enable fast, low-friction onboarding.
26-
- Limitations and support levels are transparent.
27-
- Docs remain version-aligned to `v1.6.0` policy.
40+
- Docs enable fast, low-friction onboarding.
41+
- Limitations and support levels are transparent.
42+
- Docs remain version-aligned to `v1.6.0` policy.
2843

2944
## Dependencies
3045
- Finalization workstream tied to all roadmap outputs.

.github/issue-drafts/admin-console-v1.6.0/11-tool-compatibility-ci-smoke-tests.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,27 @@
22
Add CI smoke tests for core external-tool compatibility scenarios.
33

44
## Status
5-
**State:** OPEN
5+
**State:** RESOLVED
6+
7+
## Implementation Notes
8+
9+
Completed for v1.6.0. Deliverables: `tests/CompatibilitySmoke/` and `.github/workflows/compatibility-smoke.yml`.
10+
11+
**Delivered:**
12+
13+
`tests/CompatibilitySmoke/` directory:
14+
- `appsettings.smoke.json` — minimal server config for CI: temp DB paths, no encryption, test credentials, dev cert reference, all three protocol endpoints enabled.
15+
- `smoke_tests.py` — Python smoke test runner with 7 tests across two layers:
16+
- **HTTP REST**: health check, JWT authentication, simple query (SELECT 1), metadata discovery (information_schema).
17+
- **Binary protocol**: TCP connect, SSLRequest negotiation (SSLRequest → 'S'), PostgreSQL startup message handshake.
18+
- Outputs coloured terminal report and structured `smoke-results.json`.
19+
- Exit code 0 = all passed; 1 = failures; 2 = server not ready.
20+
- `run-smoke.ps1` — PowerShell automation script: builds server, generates dev cert via `dotnet dev-certs`, patches config with absolute paths, starts server in background, polls health, runs Python tests, tears down, cleans up.
21+
- `README.md` — local reproduction documentation: prerequisites, two run options, expected output, config table, troubleshooting section.
22+
23+
`.github/workflows/compatibility-smoke.yml`:
24+
- Triggers on push/PR to master/develop and `workflow_dispatch`.
25+
- Ubuntu job: setup .NET + Python, install requests, build server, generate dev cert, patch config via Python script, start server in background, poll health endpoint, run smoke tests, print results summary, stop server, upload artifacts (14-day retention).
626

727
## Why
828
Compatibility can regress silently without automated checks.
@@ -19,9 +39,9 @@ Compatibility can regress silently without automated checks.
1939
4. Document how to run locally.
2040

2141
## Acceptance Criteria
22-
- CI runs compatibility smoke checks on target branches.
23-
- Regressions surface with actionable logs.
24-
- Local reproduction workflow documented.
42+
- CI runs compatibility smoke checks on target branches.
43+
- Regressions surface with actionable logs.
44+
- Local reproduction workflow documented.
2545

2646
## Dependencies
2747
- Depends on protocol and metadata baseline.

0 commit comments

Comments
 (0)