pgserve 2.1.3 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +96 -0
- package/README.md +105 -1
- package/bin/autopg-wrapper.cjs +16 -0
- package/bin/pgserve-wrapper.cjs +32 -6
- package/bin/postgres-server.js +56 -0
- package/console/README.md +131 -0
- package/console/api.js +173 -0
- package/console/app.jsx +483 -0
- package/console/colors_and_type.css +227 -0
- package/console/components.jsx +167 -0
- package/console/console.css +1666 -0
- package/console/data.jsx +350 -0
- package/console/index.html +31 -0
- package/console/screens/databases.jsx +5 -0
- package/console/screens/health.jsx +5 -0
- package/console/screens/ingress.jsx +5 -0
- package/console/screens/optimizer.jsx +5 -0
- package/console/screens/rlm-sim.jsx +5 -0
- package/console/screens/rlm-trace.jsx +5 -0
- package/console/screens/security.jsx +5 -0
- package/console/screens/settings.jsx +611 -0
- package/console/screens/sql.jsx +5 -0
- package/console/screens/sync.jsx +5 -0
- package/console/screens/tables.jsx +5 -0
- package/console/tweaks-panel.jsx +425 -0
- package/package.json +14 -2
- package/scripts/postinstall.cjs +60 -0
- package/src/cli-config.cjs +310 -0
- package/src/cli-install.cjs +112 -11
- package/src/cli-restart.cjs +228 -0
- package/src/cli-ui.cjs +580 -0
- package/src/cluster.js +43 -38
- package/src/postgres.js +141 -19
- package/src/settings-loader.cjs +235 -0
- package/src/settings-migrate.cjs +212 -0
- package/src/settings-pg-args.cjs +146 -0
- package/src/settings-schema.cjs +422 -0
- package/src/settings-validator.cjs +416 -0
- package/src/settings-writer.cjs +288 -0
- package/src/upgrade/index.js +65 -0
- package/src/upgrade/runner.js +23 -0
- package/src/upgrade/steps/binary-cache-flush.js +67 -0
- package/src/upgrade/steps/consumer-signal.js +40 -0
- package/src/upgrade/steps/env-refresh.js +89 -0
- package/src/upgrade/steps/health-validate.js +53 -0
- package/src/upgrade/steps/plpgsql-resolve.js +66 -0
- package/src/upgrade/steps/port-reconcile.js +52 -0
- package/.claude/context/windows-debug.md +0 -119
- package/.genie/AGENTS.md +0 -15
- package/.genie/agents/README.md +0 -110
- package/.genie/agents/analyze.md +0 -176
- package/.genie/agents/forge.md +0 -290
- package/.genie/agents/garbage-cleaner.md +0 -324
- package/.genie/agents/garbage-collector.md +0 -596
- package/.genie/agents/github-issue-gc.md +0 -618
- package/.genie/agents/review.md +0 -380
- package/.genie/agents/semantic-analyzer/find-duplicates.md +0 -90
- package/.genie/agents/semantic-analyzer/find-orphans.md +0 -99
- package/.genie/agents/semantic-analyzer.md +0 -101
- package/.genie/agents/update.md +0 -182
- package/.genie/agents/wish.md +0 -357
- package/.genie/brainstorms/pgserve-v2/DESIGN.md +0 -174
- package/.genie/code/AGENTS.md +0 -694
- package/.genie/code/agents/audit/risk.md +0 -173
- package/.genie/code/agents/audit/security.md +0 -189
- package/.genie/code/agents/audit.md +0 -145
- package/.genie/code/agents/challenge.md +0 -230
- package/.genie/code/agents/change-reviewer.md +0 -295
- package/.genie/code/agents/code-garbage-collector.md +0 -425
- package/.genie/code/agents/code-quality.md +0 -410
- package/.genie/code/agents/commit-suggester.md +0 -255
- package/.genie/code/agents/commit.md +0 -124
- package/.genie/code/agents/consensus.md +0 -204
- package/.genie/code/agents/daily-standup.md +0 -722
- package/.genie/code/agents/docgen.md +0 -48
- package/.genie/code/agents/explore.md +0 -79
- package/.genie/code/agents/fix.md +0 -100
- package/.genie/code/agents/git/commit-advisory.md +0 -219
- package/.genie/code/agents/git/workflows/issue.md +0 -244
- package/.genie/code/agents/git/workflows/pr.md +0 -179
- package/.genie/code/agents/git/workflows/release.md +0 -460
- package/.genie/code/agents/git/workflows/report.md +0 -342
- package/.genie/code/agents/git.md +0 -432
- package/.genie/code/agents/implementor.md +0 -161
- package/.genie/code/agents/install.md +0 -515
- package/.genie/code/agents/issue-creator.md +0 -344
- package/.genie/code/agents/polish.md +0 -116
- package/.genie/code/agents/qa.md +0 -653
- package/.genie/code/agents/refactor.md +0 -294
- package/.genie/code/agents/release.md +0 -1129
- package/.genie/code/agents/roadmap.md +0 -885
- package/.genie/code/agents/tests.md +0 -557
- package/.genie/code/agents/tracer.md +0 -50
- package/.genie/code/agents/update/upstream-update.md +0 -85
- package/.genie/code/agents/update/versions/generic-update.md +0 -305
- package/.genie/code/agents/vibe.md +0 -1317
- package/.genie/code/spells/agent-configuration.md +0 -58
- package/.genie/code/spells/automated-rc-publishing.md +0 -106
- package/.genie/code/spells/branch-tracker-guidance.md +0 -28
- package/.genie/code/spells/debug.md +0 -320
- package/.genie/code/spells/emoji-naming-convention.md +0 -303
- package/.genie/code/spells/evidence-storage.md +0 -26
- package/.genie/code/spells/file-naming-rules.md +0 -35
- package/.genie/code/spells/forge-code-blueprints.md +0 -195
- package/.genie/code/spells/genie-integration.md +0 -153
- package/.genie/code/spells/publishing-protocol.md +0 -61
- package/.genie/code/spells/team-consultation-protocol.md +0 -284
- package/.genie/code/spells/tool-requirements.md +0 -20
- package/.genie/code/spells/triad-maintenance-protocol.md +0 -154
- package/.genie/code/teams/tech-council/council.md +0 -328
- package/.genie/code/teams/tech-council/jt.md +0 -352
- package/.genie/code/teams/tech-council/nayr.md +0 -305
- package/.genie/code/teams/tech-council/oettam.md +0 -375
- package/.genie/neurons/README.md +0 -193
- package/.genie/neurons/forge.md +0 -106
- package/.genie/neurons/genie.md +0 -63
- package/.genie/neurons/review.md +0 -106
- package/.genie/neurons/wish.md +0 -104
- package/.genie/product/README.md +0 -20
- package/.genie/product/cli-automation.md +0 -359
- package/.genie/product/environment.md +0 -60
- package/.genie/product/mission.md +0 -60
- package/.genie/product/roadmap.md +0 -44
- package/.genie/product/tech-stack.md +0 -34
- package/.genie/product/templates/context-template.md +0 -218
- package/.genie/product/templates/qa-done-report-template.md +0 -68
- package/.genie/product/templates/review-report-template.md +0 -89
- package/.genie/product/templates/wish-template.md +0 -120
- package/.genie/scripts/helpers/analyze-commit.js +0 -195
- package/.genie/scripts/helpers/bullet-counter.js +0 -194
- package/.genie/scripts/helpers/bullet-find.js +0 -289
- package/.genie/scripts/helpers/bullet-id.js +0 -244
- package/.genie/scripts/helpers/check-secrets.js +0 -237
- package/.genie/scripts/helpers/count-tokens.js +0 -200
- package/.genie/scripts/helpers/create-frontmatter.js +0 -456
- package/.genie/scripts/helpers/detect-markers.js +0 -293
- package/.genie/scripts/helpers/detect-todos.js +0 -267
- package/.genie/scripts/helpers/detect-unlabeled-blocks.js +0 -135
- package/.genie/scripts/helpers/embeddings.js +0 -344
- package/.genie/scripts/helpers/find-empty-sections.js +0 -158
- package/.genie/scripts/helpers/index.js +0 -319
- package/.genie/scripts/helpers/validate-frontmatter.js +0 -578
- package/.genie/scripts/helpers/validate-links.js +0 -207
- package/.genie/scripts/helpers/validate-paths.js +0 -373
- package/.genie/spells/README.md +0 -9
- package/.genie/spells/ace-protocol.md +0 -118
- package/.genie/spells/ask-one-at-a-time.md +0 -175
- package/.genie/spells/backup-analyzer.md +0 -542
- package/.genie/spells/blocker.md +0 -12
- package/.genie/spells/break-things-move-fast.md +0 -56
- package/.genie/spells/context-candidates.md +0 -72
- package/.genie/spells/context-critic.md +0 -51
- package/.genie/spells/defer-to-expertise.md +0 -278
- package/.genie/spells/delegate-dont-do.md +0 -292
- package/.genie/spells/error-investigation-protocol.md +0 -328
- package/.genie/spells/evidence-based-completion.md +0 -273
- package/.genie/spells/experiment.md +0 -65
- package/.genie/spells/file-creation-protocol.md +0 -229
- package/.genie/spells/forge-integration.md +0 -281
- package/.genie/spells/forge-orchestration.md +0 -514
- package/.genie/spells/gather-context.md +0 -18
- package/.genie/spells/global-health-check.md +0 -34
- package/.genie/spells/global-noop-roundtrip.md +0 -25
- package/.genie/spells/install-genie.md +0 -1232
- package/.genie/spells/install.md +0 -82
- package/.genie/spells/investigate-before-commit.md +0 -112
- package/.genie/spells/know-yourself.md +0 -288
- package/.genie/spells/learn.md +0 -828
- package/.genie/spells/mcp-diagnostic-protocol.md +0 -246
- package/.genie/spells/mcp-first.md +0 -124
- package/.genie/spells/multi-step-execution.md +0 -67
- package/.genie/spells/orchestration-boundary-protocol.md +0 -256
- package/.genie/spells/orchestrator-not-implementor.md +0 -189
- package/.genie/spells/prompt.md +0 -746
- package/.genie/spells/reflect.md +0 -404
- package/.genie/spells/routing-decision-matrix.md +0 -368
- package/.genie/spells/run-in-parallel.md +0 -12
- package/.genie/spells/session-state-updater-example.md +0 -196
- package/.genie/spells/session-state-updater.md +0 -220
- package/.genie/spells/track-long-running-tasks.md +0 -133
- package/.genie/spells/troubleshoot-infrastructure.md +0 -176
- package/.genie/spells/upgrade-genie.md +0 -415
- package/.genie/spells/url-presentation-protocol.md +0 -301
- package/.genie/spells/wish-initiation.md +0 -158
- package/.genie/spells/wish-issue-linkage.md +0 -410
- package/.genie/spells/wish-lifecycle.md +0 -100
- package/.genie/state/provider-status.json +0 -3
- package/.genie/state/version.json +0 -16
- package/.genie/wishes/canonical-pgserve-pm2-supervision/WISH.md +0 -290
- package/.genie/wishes/pgserve-v2/BRIEF-from-genie-pgserve.md +0 -99
- package/.genie/wishes/pgserve-v2/WISH.md +0 -442
- package/.genie/wishes/release-system-genie-pattern/WISH.md +0 -268
- package/.genie/wishes/release-system-genie-pattern/validation.md +0 -205
- package/.gitguardian.yaml +0 -29
- package/.gitguardianignore +0 -16
- package/.github/workflows/ci.yml +0 -122
- package/.github/workflows/release.yml +0 -289
- package/.github/workflows/version.yml +0 -228
- package/.husky/pre-commit +0 -2
- package/AGENTS.md +0 -433
- package/CLAUDE.md +0 -1
- package/Makefile +0 -285
- package/assets/icon.ico +0 -0
- package/bun.lock +0 -435
- package/bunfig.toml +0 -28
- package/ecosystem.config.cjs +0 -23
- package/eslint.config.js +0 -63
- package/examples/multi-tenant-demo.js +0 -104
- package/install.sh +0 -123
- package/knip.json +0 -9
- package/tests/audit.test.js +0 -189
- package/tests/backpressure.test.js +0 -167
- package/tests/benchmarks/runner.js +0 -1197
- package/tests/benchmarks/vector-generator.js +0 -368
- package/tests/cli-install.test.js +0 -322
- package/tests/control-db.test.js +0 -285
- package/tests/daemon-args.test.js +0 -86
- package/tests/daemon-control.test.js +0 -171
- package/tests/daemon-fingerprint-integration.test.js +0 -111
- package/tests/daemon-pr24-regression.test.js +0 -198
- package/tests/fingerprint.test.js +0 -263
- package/tests/fixtures/240-orphan-seed.sql +0 -30
- package/tests/multi-tenant.test.js +0 -374
- package/tests/orphan-cleanup.test.js +0 -390
- package/tests/pg-version-regex.test.js +0 -129
- package/tests/quick-bench.js +0 -135
- package/tests/router-handshake-retry.test.js +0 -119
- package/tests/router-handshake-watchdog.test.js +0 -110
- package/tests/sdk.test.js +0 -71
- package/tests/stale-postmaster-pid.test.js +0 -85
- package/tests/stress-test.js +0 -439
- package/tests/sync-perf-test.js +0 -150
- package/tests/tcp-listen.test.js +0 -368
- package/tests/tenancy.test.js +0 -403
- package/tests/wrapper-supervision.test.js +0 -107
package/console/data.jsx
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/* pgserve · mocked daemon snapshot */
|
|
2
|
+
|
|
3
|
+
const DBS = [
|
|
4
|
+
{ name: 'app_genie_a1b2c3d4e5f6', fp: 'a1b2c3d4e5f6', pkg: '@automagik/genie', size: '142 MB', tables: 14, conns: 3, last: '14:18:02', persist: true, state: 'running', pgvector: true, uptime: '3d 4h' },
|
|
5
|
+
{ name: 'app_brain_4f3e2d1c0b9a', fp: '4f3e2d1c0b9a', pkg: '@automagik/brain', size: '2.1 GB', tables: 41, conns: 7, last: '14:18:11', persist: true, state: 'running', pgvector: true, uptime: '12d 2h' },
|
|
6
|
+
{ name: 'app_omni_9876543210ab', fp: '9876543210ab', pkg: '@automagik/omni', size: '12 MB', tables: 6, conns: 0, last: '10:02:44', persist: false, state: 'idle', pgvector: false, uptime: '4h 16m' },
|
|
7
|
+
{ name: 'app_loom_5b4a3c2d1e0f', fp: '5b4a3c2d1e0f', pkg: '@studio/loom', size: '844 MB', tables: 22, conns: 12, last: '14:18:14', persist: true, state: 'running', pgvector: false, uptime: '6d 8h' },
|
|
8
|
+
{ name: 'app_drift_0123456789ab', fp: '0123456789ab', pkg: '@studio/drift', size: '38 MB', tables: 9, conns: 1, last: '14:17:50', persist: false, state: 'running', pgvector: true, uptime: '52m' },
|
|
9
|
+
{ name: 'app_relay_fedcba987654', fp: 'fedcba987654', pkg: '@hive/relay', size: '6.4 MB', tables: 3, conns: 0, last: '13:01:20', persist: false, state: 'reaped', pgvector: false, uptime: '—' },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
const SCHEMAS = ['public', 'auth', 'pgvector', 'audit'];
|
|
13
|
+
|
|
14
|
+
const TABLE_COLS = [
|
|
15
|
+
{ n: 'id', t: 'uuid', pk: true, nn: true },
|
|
16
|
+
{ n: 'created_at', t: 'timestamptz', nn: true },
|
|
17
|
+
{ n: 'title', t: 'text', nn: true },
|
|
18
|
+
{ n: 'body', t: 'text' },
|
|
19
|
+
{ n: 'author_id', t: 'uuid', fk: 'users.id' },
|
|
20
|
+
{ n: 'tags', t: 'text[]' },
|
|
21
|
+
{ n: 'embedding', t: 'vector(1536)', vec: true },
|
|
22
|
+
{ n: 'is_archived', t: 'bool', nn: true, d: 'false'},
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const TABLE_ROWS = [
|
|
26
|
+
{ id:'a14b…f021', created_at:'2026-04-02 14:02:11', title:'Onboarding flow audit', body:'Maps friction points across the first 90s of the genie surface.', author_id:'u_021', tags:['research','onboarding'], embedding:'[0.012, -0.044, …]', is_archived:false },
|
|
27
|
+
{ id:'b25c…0a19', created_at:'2026-04-04 09:31:48', title:'pgvector HNSW vs IVFFLAT', body:'Benchmarks at 1M rows. HNSW wins on recall, IVFFLAT on build time.', author_id:'u_021', tags:['db','vector','bench'], embedding:'[-0.114, 0.220, …]', is_archived:false },
|
|
28
|
+
{ id:'c36d…11b2', created_at:'2026-04-08 23:14:02', title:'Daemon socket hardening', body:'Move from 0700 dir to peercred + uid match. Audit event added.', author_id:'u_004', tags:['security'], embedding:'[0.067, -0.012, …]', is_archived:true },
|
|
29
|
+
{ id:'d47e…2233', created_at:'2026-04-12 11:48:00', title:'Restore-from-source UX', body:'Confirm dialog, dry-run preview, lock target during apply.', author_id:'u_018', tags:['sync','ux'], embedding:'[-0.031, 0.408, …]', is_archived:false },
|
|
30
|
+
{ id:'e58f…3344', created_at:'2026-04-14 06:02:39', title:'TTL reaper edge case', body:'Fingerprint last_connection_at can be NULL after fresh restore.', author_id:'u_004', tags:['bug','reaper'], embedding:'[0.244, 0.001, …]', is_archived:false },
|
|
31
|
+
{ id:'f69a…4455', created_at:'2026-04-18 19:22:14', title:'libpq client retry policy', body:'Exponential backoff capped at 4s; immediate for restarts.', author_id:'u_021', tags:['client'], embedding:'[-0.402, -0.019, …]', is_archived:false },
|
|
32
|
+
{ id:'071b…5566', created_at:'2026-04-20 13:00:00', title:'Token rotation cadence', body:'Default 24h. Apps can opt-in to 1h with --short-token.', author_id:'u_004', tags:['security','tokens'], embedding:'[0.118, 0.097, …]', is_archived:false },
|
|
33
|
+
{ id:'182c…6677', created_at:'2026-04-22 08:14:21', title:'Console settings draft', body:'Persist policy, GC TTL, control-socket path, telemetry, theme.', author_id:'u_018', tags:['console'], embedding:'[NULL]', is_archived:false },
|
|
34
|
+
{ id:'293d…7788', created_at:'2026-04-25 17:00:00', title:'pgserve.persist guidance', body:'Long-lived apps; not just for convenience. Doc copy locked.', author_id:'u_021', tags:['docs'], embedding:'[0.005, -0.211, …]', is_archived:false },
|
|
35
|
+
{ id:'3a4e…8899', created_at:'2026-04-27 02:31:09', title:'Async logical replication slots', body:'Slot per target; lag visible in stats panel; auto-drop on remove.', author_id:'u_004', tags:['sync','replication'], embedding:'[-0.066, 0.181, …]', is_archived:false },
|
|
36
|
+
{ id:'4b5f…99aa', created_at:'2026-04-28 12:48:30', title:'EXPLAIN cost-threshold', body:'Anything over 10k cost shows in optimizer board with index hint.', author_id:'u_018', tags:['perf'], embedding:'[0.401, -0.107, …]', is_archived:false },
|
|
37
|
+
{ id:'5c60…aabb', created_at:'2026-04-29 22:11:55', title:'Backup retention', body:'Keep 7 daily, 4 weekly, 3 monthly. Restore from any.', author_id:'u_021', tags:['backups'], embedding:'[NULL]', is_archived:true },
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
const SQL_TABS = [
|
|
41
|
+
{ id:'t1', label:'slow_queries.sql', dirty:false },
|
|
42
|
+
{ id:'t2', label:'documents_search.sql', dirty:true },
|
|
43
|
+
{ id:'t3', label:'tool_calls_agg.sql', dirty:false },
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const SQL_HISTORY = [
|
|
47
|
+
{ id:'h1', t:'14:18:02', ms:'2.4 ms', ok:true, q:'SELECT pg_database_size(current_database())' },
|
|
48
|
+
{ id:'h2', t:'14:17:11', ms:'184 ms', ok:true, q:"SELECT id, title FROM documents WHERE embedding <=> '[0.1, 0.2, ...]'::vector LIMIT 10" },
|
|
49
|
+
{ id:'h3', t:'14:14:00', ms:'38 ms', ok:true, q:"SELECT tool, count(*) FROM tool_calls GROUP BY tool" },
|
|
50
|
+
{ id:'h4', t:'14:11:08', ms:'6 ms', ok:false, q:"SELECT * FROM audit_events WHERE event = 'connection_denied' LIMIT 50" },
|
|
51
|
+
{ id:'h5', t:'14:08:14', ms:'12 ms', ok:true, q:'EXPLAIN ANALYZE SELECT * FROM messages WHERE session_id = $1' },
|
|
52
|
+
{ id:'h6', t:'14:02:11', ms:'78 ms', ok:true, q:'VACUUM ANALYZE messages' },
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
const SLOW_QUERIES = [
|
|
56
|
+
{ id:'q01', total:'4823 ms', calls:128, mean:'37.7 ms', rows:'1.2e5', hit:97.2, q:"SELECT * FROM articles WHERE author_id = $1 ORDER BY created_at DESC LIMIT 50", issue:'seq_scan', fix:'CREATE INDEX articles_author_created_idx ON articles (author_id, created_at DESC);', cost:18421 },
|
|
57
|
+
{ id:'q02', total:'2901 ms', calls:42, mean:'69.1 ms', rows:'8.4e3', hit:88.4, q:"UPDATE sessions SET last_seen = now() WHERE user_id = $1", issue:'no_index', fix:'CREATE INDEX sessions_user_idx ON sessions (user_id);', cost:9210 },
|
|
58
|
+
{ id:'q03', total:'1844 ms', calls:9, mean:'205 ms', rows:'3', hit:62.0, q:"SELECT embedding <=> $1 FROM docs ORDER BY 1 LIMIT 10", issue:'vector_scan', fix:'CREATE INDEX docs_embedding_hnsw ON docs USING hnsw (embedding vector_cosine_ops);', cost:14002 },
|
|
59
|
+
{ id:'q04', total:'1610 ms', calls:240, mean:'6.7 ms', rows:'9.6e3', hit:99.1, q:"SELECT count(*) FROM events WHERE created_at > now() - '1 day'::interval", issue:'partial_idx', fix:"CREATE INDEX events_recent_idx ON events (created_at) WHERE created_at > now() - '2 days'::interval;", cost:7880 },
|
|
60
|
+
{ id:'q05', total:'982 ms', calls:18, mean:'54.5 ms', rows:'512', hit:91.0, q:"SELECT u.*, p.* FROM users u LEFT JOIN profiles p ON p.user_id = u.id WHERE u.email ILIKE $1", issue:'ilike_no_trgm', fix:"CREATE EXTENSION pg_trgm; CREATE INDEX users_email_trgm ON users USING gin (email gin_trgm_ops);", cost:6044 },
|
|
61
|
+
{ id:'q06', total:'770 ms', calls:1240, mean:'0.6 ms', rows:'1240', hit:99.8, q:"INSERT INTO audit_log (...) VALUES (...)", issue:'fine', fix:'no action', cost:120 },
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
const BLOAT = [
|
|
65
|
+
{ table:'public.messages', dead:'12.4 MB', pct:8.2, age:'4d 12h', verdict:'low' },
|
|
66
|
+
{ table:'public.tool_calls', dead:'47.0 MB', pct:18.4, age:'1d 3h', verdict:'medium' },
|
|
67
|
+
{ table:'public.audit_events', dead:'118 MB', pct:31.6, age:'8d 1h', verdict:'high' },
|
|
68
|
+
{ table:'public.embeddings', dead:'4 MB', pct:0.4, age:'2h', verdict:'low' },
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
const AUDIT = [
|
|
72
|
+
{ ts:'14:18:14', lvl:'audit', evt:'tcp_token_issued', msg:"fingerprint=4f3e2d1c0b9a · ttl=24h" },
|
|
73
|
+
{ ts:'14:18:11', lvl:'info', evt:'connection_opened', msg:"app_brain_4f3e2d1c0b9a · pid=4821 · uid=1000" },
|
|
74
|
+
{ ts:'14:18:02', lvl:'info', evt:'connection_opened', msg:"app_genie_a1b2c3d4e5f6 · pid=4811 · uid=1000" },
|
|
75
|
+
{ ts:'14:17:58', lvl:'err', evt:'connection_denied', msg:"28P01 — peer fingerprint mismatch (a1b2c3d4 → app_genie req production)" },
|
|
76
|
+
{ ts:'14:17:42', lvl:'audit', evt:'rls_policy_violation', msg:"messages · session_id != current_setting('jwt.claim.sid')" },
|
|
77
|
+
{ ts:'14:17:01', lvl:'info', evt:'pgvector_index_built', msg:"public.docs.embedding · HNSW · 412ms" },
|
|
78
|
+
{ ts:'14:16:33', lvl:'warn', evt:'sql_lint', msg:"DELETE FROM users — no WHERE clause; rejected" },
|
|
79
|
+
{ ts:'14:14:00', lvl:'audit', evt:'replication_slot_active', msg:"slot=sync_prod_pg target=prod-pg.internal:5432" },
|
|
80
|
+
{ ts:'14:11:08', lvl:'err', evt:'connection_denied', msg:"28P01 fingerprint mismatch — peer 9876 → app_brain" },
|
|
81
|
+
{ ts:'14:08:33', lvl:'audit', evt:'tcp_token_issued', msg:"fingerprint=a1b2c3d4e5f6 · ttl=1h" },
|
|
82
|
+
{ ts:'14:02:11', lvl:'info', evt:'db_created', msg:"app_omni_9876543210ab · ephemeral · ttl=24h" },
|
|
83
|
+
{ ts:'13:48:09', lvl:'audit', evt:'role_created', msg:"genie_rw — owner=app_genie · grants=SELECT,INSERT,UPDATE" },
|
|
84
|
+
];
|
|
85
|
+
|
|
86
|
+
const ROLES = [
|
|
87
|
+
{ name: 'pgserve_super', super: true, conns: 1, last: '14:18:14', kind: 'daemon' },
|
|
88
|
+
{ name: 'genie_rw', super: false, conns: 3, last: '14:18:02', kind: 'app' },
|
|
89
|
+
{ name: 'brain_rw', super: false, conns: 7, last: '14:18:11', kind: 'app' },
|
|
90
|
+
{ name: 'loom_rw', super: false, conns: 12,last: '14:18:14', kind: 'app' },
|
|
91
|
+
{ name: 'audit_ro', super: false, conns: 1, last: '14:17:42', kind: 'system' },
|
|
92
|
+
{ name: 'replication_tx', super: false, conns: 1, last: '14:14:00', kind: 'system' },
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
const LINTS = [
|
|
96
|
+
{ sev:'high', msg:'public.users — no RLS policy and contains email column', fix:'ALTER TABLE users ENABLE ROW LEVEL SECURITY; …' },
|
|
97
|
+
{ sev:'high', msg:'public.messages.embedding — index is IVFFLAT, recall < 0.7', fix:'DROP INDEX messages_embedding_idx; CREATE INDEX … USING hnsw (…);' },
|
|
98
|
+
{ sev:'med', msg:'function exec_sql(text) — SECURITY DEFINER without search_path', fix:'ALTER FUNCTION exec_sql(text) SET search_path = pg_catalog, public;' },
|
|
99
|
+
{ sev:'low', msg:'public.audit_events — table not partitioned (902k rows, growing)', fix:'consider monthly partitioning by ts' },
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
const HEALTH = {
|
|
103
|
+
server: { mem: 847, mem_pct: 41, cpu: 28, cpu_pct: 28, uptime: '12d 4h 28m', version: 'PostgreSQL 16.2', host: 'pgserve.sock' },
|
|
104
|
+
conn: { active: 23, idle: 8, total: 1000, wait: 0, longest: '4.2s' },
|
|
105
|
+
back: [
|
|
106
|
+
{ pid: 4811, db: 'app_genie', user: 'genie_rw', state: 'active', wait: '—', q: 'SELECT * FROM messages WHERE …' },
|
|
107
|
+
{ pid: 4821, db: 'app_brain', user: 'brain_rw', state: 'active', wait: 'IO/DataFileRead', q: 'INSERT INTO embeddings …' },
|
|
108
|
+
{ pid: 4824, db: 'app_loom', user: 'loom_rw', state: 'idle', wait: '—', q: '<IDLE in transaction>' },
|
|
109
|
+
{ pid: 4828, db: 'app_drift', user: 'drift_rw', state: 'active', wait: 'Lock/transactionid', q: 'UPDATE sessions SET …' },
|
|
110
|
+
{ pid: 4830, db: 'app_brain', user: 'brain_rw', state: 'active', wait: '—', q: 'COPY embeddings FROM …' },
|
|
111
|
+
],
|
|
112
|
+
res: { tx_per_s: 412, tps_history: [380,402,388,410,422,395,401,418,412,420,408,412], cache_hit: 98.4, wal: '32 MB/s', commits: 11042, rollbacks: 18 },
|
|
113
|
+
pgi: { autovac: 'idle', last_vac: '03:14:00', last_an: '03:14:01', locks: 4, deadlocks: 0, longest_lock: '12ms' },
|
|
114
|
+
vec: { indexes: 6, queries_per_s: 14, recall: 0.94, hnsw_build: '412 ms', dim: 1536 },
|
|
115
|
+
cpu_history: [22,28,31,26,24,29,34,28,25,28,31,28,26,30,28,32,28,28,29,28,27,28,30,28],
|
|
116
|
+
mem_history: [38,39,40,40,41,40,41,42,41,40,41,41,41,40,41,42,41,41,41,40,41,41,41,41],
|
|
117
|
+
io_read_hist: [12,18,14,22,28,18,14,16,22,18,14,16,18,22,16,14,18,16,14,18,16,14,18,16],
|
|
118
|
+
io_write_hist: [4,8,6,10,14,8,6,8,10,8,6,8,10,12,8,6,10,8,6,10,8,6,10,8],
|
|
119
|
+
/* lock waterfall — concurrent locks held over the last 12s, longest first */
|
|
120
|
+
locks: [
|
|
121
|
+
{ pid:4828, mode:'RowExclusive', rel:'sessions', db:'app_drift', dur:12.4, blocking:0, wait:'Lock/transactionid' },
|
|
122
|
+
{ pid:4811, mode:'AccessShare', rel:'messages', db:'app_genie', dur:8.1, blocking:0, wait:null },
|
|
123
|
+
{ pid:4821, mode:'RowExclusive', rel:'embeddings', db:'app_brain', dur:5.6, blocking:1, wait:'IO/DataFileRead' },
|
|
124
|
+
{ pid:4830, mode:'AccessExclusive', rel:'embeddings', db:'app_brain', dur:2.2, blocking:0, wait:null, blocked_by:4821 },
|
|
125
|
+
{ pid:4824, mode:'AccessShare', rel:'sessions', db:'app_loom', dur:0.4, blocking:0, wait:null },
|
|
126
|
+
],
|
|
127
|
+
/* autovacuum lane — past 60min of activity */
|
|
128
|
+
vacuum_lane: [
|
|
129
|
+
{ rel:'app_brain.embeddings', start:-58, dur:6, kind:'auto', tuples:'2.4M', state:'done' },
|
|
130
|
+
{ rel:'app_brain.documents', start:-44, dur:2, kind:'auto', tuples:'48K', state:'done' },
|
|
131
|
+
{ rel:'app_genie.messages', start:-30, dur:14, kind:'auto', tuples:'1.8M', state:'done' },
|
|
132
|
+
{ rel:'app_drift.sessions', start:-18, dur:1, kind:'analyze',tuples:'412K', state:'done' },
|
|
133
|
+
{ rel:'app_brain.embeddings', start:-3, dur:8, kind:'auto', tuples:'124K', state:'running' },
|
|
134
|
+
],
|
|
135
|
+
/* pgvector recall histogram — buckets and counts over last hour */
|
|
136
|
+
recall_hist: [
|
|
137
|
+
{ bucket:'1.00', count:12 },
|
|
138
|
+
{ bucket:'0.95-99', count:28 },
|
|
139
|
+
{ bucket:'0.90-94', count:34 },
|
|
140
|
+
{ bucket:'0.85-89', count:18 },
|
|
141
|
+
{ bucket:'0.80-84', count:8 },
|
|
142
|
+
{ bucket:'<0.80', count:2 },
|
|
143
|
+
],
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const SYNC_TARGETS = [
|
|
147
|
+
{ name:'prod-pg', host:'prod-pg.internal:5432', state:'streaming', lag:'0.04s', slot:'sync_prod_pg', wal:'2.4 MB/s' },
|
|
148
|
+
{ name:'analytics-bq', host:'bq-bridge:7000', state:'streaming', lag:'0.18s', slot:'sync_bq', wal:'412 KB/s' },
|
|
149
|
+
{ name:'cold-archive', host:'archive.s3:443', state:'paused', lag:'—', slot:'sync_archive', wal:'—' },
|
|
150
|
+
];
|
|
151
|
+
|
|
152
|
+
const BACKUPS = [
|
|
153
|
+
{ id:'b41', when:'2026-04-30 03:00', kind:'daily', size:'4.1 GB', src:'app_brain', state:'ok' },
|
|
154
|
+
{ id:'b40', when:'2026-04-29 03:00', kind:'daily', size:'4.0 GB', src:'app_brain', state:'ok' },
|
|
155
|
+
{ id:'b39', when:'2026-04-28 03:00', kind:'daily', size:'3.9 GB', src:'app_brain', state:'ok' },
|
|
156
|
+
{ id:'b38', when:'2026-04-27 03:00', kind:'daily', size:'3.8 GB', src:'app_brain', state:'ok' },
|
|
157
|
+
{ id:'b37', when:'2026-04-26 03:00', kind:'weekly', size:'3.6 GB', src:'app_brain', state:'ok' },
|
|
158
|
+
{ id:'b36', when:'2026-04-19 03:00', kind:'weekly', size:'3.1 GB', src:'app_brain', state:'ok' },
|
|
159
|
+
{ id:'b35', when:'2026-04-01 03:00', kind:'monthly', size:'2.4 GB', src:'app_brain', state:'ok' },
|
|
160
|
+
];
|
|
161
|
+
|
|
162
|
+
/* ============================================================
|
|
163
|
+
* Swarm — agents that compose a SQL answer for a natural-language prompt
|
|
164
|
+
* ============================================================ */
|
|
165
|
+
|
|
166
|
+
const SWARM_PROMPT = "show me everyone who hit a tool error in the last hour, ranked by how many times";
|
|
167
|
+
|
|
168
|
+
const SWARM_AGENTS = [
|
|
169
|
+
{
|
|
170
|
+
id: 'router', glyph: '◉', name: 'router',
|
|
171
|
+
role: 'classify intent · pick swarm',
|
|
172
|
+
state: 'done', t: 38,
|
|
173
|
+
out: 'intent: read · target: app_brain · domain: tool_calls + sessions',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
id: 'scout', glyph: '◌', name: 'schema-scout',
|
|
177
|
+
role: 'crawl information_schema · score relevance',
|
|
178
|
+
state: 'done', t: 184,
|
|
179
|
+
out: 'matched 3 tables · tool_calls (0.92) · sessions (0.71) · users (0.44)',
|
|
180
|
+
branches: [
|
|
181
|
+
{ label: 'tool_calls.tool, status, session_id, ts', score: 0.92, picked: true },
|
|
182
|
+
{ label: 'sessions.id, user_id, started_at', score: 0.71, picked: true },
|
|
183
|
+
{ label: 'users.id, email, display_name', score: 0.44, picked: true },
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
id: 'sniffer', glyph: '◐', name: 'sample-sniffer',
|
|
188
|
+
role: "SELECT 5 from each candidate to confirm shape",
|
|
189
|
+
state: 'done', t: 92,
|
|
190
|
+
out: "tool_calls.status enum: ['ok','error','timeout','denied'] · matched 'error'",
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: 'author', glyph: '◑', name: 'query-author',
|
|
194
|
+
role: 'draft SQL · join through sessions to users',
|
|
195
|
+
state: 'done', t: 211,
|
|
196
|
+
out: 'draft v3 · 18 lines · 2 joins · time-bucket window',
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
id: 'critic', glyph: '◒', name: 'critic',
|
|
200
|
+
role: 'EXPLAIN · flag seq_scan · suggest rewrites',
|
|
201
|
+
state: 'done', t: 64,
|
|
202
|
+
out: 'plan ok · index hit on tool_calls(ts, status) · cost 184.2',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: 'exec', glyph: '●', name: 'executor',
|
|
206
|
+
role: 'run · stream rows · format markdown',
|
|
207
|
+
state: 'running', t: 12,
|
|
208
|
+
out: 'streaming row 7/12…',
|
|
209
|
+
},
|
|
210
|
+
];
|
|
211
|
+
|
|
212
|
+
// timeline of agent emissions (ms offset → which agent emitted what kind of event)
|
|
213
|
+
const SWARM_TIMELINE = [
|
|
214
|
+
{ ms: 0, a: 'router', kind: 'spawn' },
|
|
215
|
+
{ ms: 38, a: 'router', kind: 'done' },
|
|
216
|
+
{ ms: 38, a: 'scout', kind: 'spawn' },
|
|
217
|
+
{ ms: 110, a: 'scout', kind: 'branch', label: 'tool_calls' },
|
|
218
|
+
{ ms: 138, a: 'scout', kind: 'branch', label: 'sessions' },
|
|
219
|
+
{ ms: 162, a: 'scout', kind: 'branch', label: 'users' },
|
|
220
|
+
{ ms: 184, a: 'scout', kind: 'done' },
|
|
221
|
+
{ ms: 184, a: 'sniffer', kind: 'spawn' },
|
|
222
|
+
{ ms: 220, a: 'sniffer', kind: 'sample' },
|
|
223
|
+
{ ms: 276, a: 'sniffer', kind: 'done' },
|
|
224
|
+
{ ms: 276, a: 'author', kind: 'spawn' },
|
|
225
|
+
{ ms: 320, a: 'author', kind: 'draft', v: 1 },
|
|
226
|
+
{ ms: 410, a: 'author', kind: 'draft', v: 2 },
|
|
227
|
+
{ ms: 487, a: 'author', kind: 'draft', v: 3 },
|
|
228
|
+
{ ms: 487, a: 'author', kind: 'done' },
|
|
229
|
+
{ ms: 487, a: 'critic', kind: 'spawn' },
|
|
230
|
+
{ ms: 551, a: 'critic', kind: 'done' },
|
|
231
|
+
{ ms: 551, a: 'exec', kind: 'spawn' },
|
|
232
|
+
{ ms: 563, a: 'exec', kind: 'row', row: 1 },
|
|
233
|
+
];
|
|
234
|
+
|
|
235
|
+
const SWARM_DRAFT_SQL = `-- query-author · v3 · accepted by critic
|
|
236
|
+
WITH window_errors AS (
|
|
237
|
+
SELECT
|
|
238
|
+
tc.session_id,
|
|
239
|
+
tc.tool,
|
|
240
|
+
tc.error_code
|
|
241
|
+
FROM tool_calls tc
|
|
242
|
+
WHERE tc.status = 'error'
|
|
243
|
+
AND tc.ts > now() - INTERVAL '1 hour'
|
|
244
|
+
)
|
|
245
|
+
SELECT
|
|
246
|
+
u.display_name,
|
|
247
|
+
u.email,
|
|
248
|
+
count(*) AS error_count,
|
|
249
|
+
array_agg(DISTINCT we.tool) AS tools,
|
|
250
|
+
max(we.error_code) AS last_error
|
|
251
|
+
FROM window_errors we
|
|
252
|
+
JOIN sessions s ON s.id = we.session_id
|
|
253
|
+
JOIN users u ON u.id = s.user_id
|
|
254
|
+
GROUP BY u.id, u.display_name, u.email
|
|
255
|
+
ORDER BY error_count DESC
|
|
256
|
+
LIMIT 25;`;
|
|
257
|
+
|
|
258
|
+
const SWARM_RESULT_ROWS = [
|
|
259
|
+
{ name:'eli rosen', email:'eli@studio.dev', n:14, tools:['code_run','grep'], last:'TIMEOUT_4XX' },
|
|
260
|
+
{ name:'priya mehta', email:'priya@studio.dev', n:9, tools:['code_run'], last:'TOOL_SCHEMA_MISMATCH' },
|
|
261
|
+
{ name:'jonas vetra', email:'jonas@studio.dev', n:7, tools:['fetch_url','grep','tabulate'], last:'NETWORK_REFUSED' },
|
|
262
|
+
{ name:'mira asante', email:'mira@studio.dev', n:5, tools:['fetch_url'], last:'NETWORK_REFUSED' },
|
|
263
|
+
{ name:'adam bryce', email:'adam@studio.dev', n:4, tools:['code_run'], last:'TOOL_TIMEOUT' },
|
|
264
|
+
{ name:'lin yamamoto', email:'lin@studio.dev', n:3, tools:['grep'], last:'PERMISSION_DENIED' },
|
|
265
|
+
{ name:'ofelia carrasco', email:'ofelia@studio.dev', n:2, tools:['fetch_url'], last:'NETWORK_REFUSED' },
|
|
266
|
+
];
|
|
267
|
+
|
|
268
|
+
const SWARM_RECENT = [
|
|
269
|
+
{ id:'sw_91', t:'14:14:02', prompt:'top 10 slowest queries this morning', ms:412, status:'ok', cost:0.0014 },
|
|
270
|
+
{ id:'sw_90', t:'14:08:41', prompt:'sessions that exceeded 50 tool calls', ms:288, status:'ok', cost:0.0009 },
|
|
271
|
+
{ id:'sw_89', t:'13:55:11', prompt:'how many users haven\'t logged in for 7d', ms:140, status:'cached',cost:0 },
|
|
272
|
+
{ id:'sw_88', t:'13:48:04', prompt:'find duplicate embeddings in docs', ms:611, status:'asked', cost:0.0021 },
|
|
273
|
+
{ id:'sw_87', t:'13:31:40', prompt:'audit events with no fingerprint match', ms:204, status:'ok', cost:0.0011 },
|
|
274
|
+
];
|
|
275
|
+
|
|
276
|
+
/* ============================================================
|
|
277
|
+
* Ingress — Unix-socket peercred + TCP bearer-token authentication
|
|
278
|
+
* mirrors src/fingerprint.js + src/daemon-tcp.js + src/tokens.js + src/control-db.js
|
|
279
|
+
* ============================================================ */
|
|
280
|
+
|
|
281
|
+
const INGRESS_LISTENERS = [
|
|
282
|
+
{ id:'unix', proto:'unix', path:'/run/pgserve/control.sock', since:'2026-04-26 09:14', conns:14, accepted:412881, denied:0,
|
|
283
|
+
auth:'peercred · SO_PEERCRED → uid+pid', detail:'kernel-attested · cwd-walk → fingerprint' },
|
|
284
|
+
{ id:'tcp', proto:'tcp', path:'127.0.0.1:5433', since:'2026-04-26 09:14', conns:6, accepted:1844, denied:23,
|
|
285
|
+
auth:'application_name=?fingerprint=…&token=…', detail:'sha256 hash · timing-safe compare' },
|
|
286
|
+
];
|
|
287
|
+
|
|
288
|
+
const INGRESS_FUNNEL = {
|
|
289
|
+
windowLabel:'last 5 minutes',
|
|
290
|
+
total: 1280,
|
|
291
|
+
steps: [
|
|
292
|
+
{ id:'accept', label:'socket accept', kept:1280, dropped:0, note:'after listen()' },
|
|
293
|
+
{ id:'startup', label:'startup msg parsed', kept:1278, dropped:2, note:'truncated · 2' },
|
|
294
|
+
{ id:'auth', label:'auth resolved', kept:1265, dropped:13, note:'token_unknown · 11 · malformed · 2' },
|
|
295
|
+
{ id:'fp_match', label:'fingerprint match', kept:1262, dropped:3, note:'cross-fp attempt · 3' },
|
|
296
|
+
{ id:'db_route', label:'db route', kept:1261, dropped:1, note:'db not provisioned · 1' },
|
|
297
|
+
{ id:'pg_proxy', label:'pg proxy attached', kept:1261, dropped:0, note:'' },
|
|
298
|
+
],
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
const INGRESS_LIVE = [
|
|
302
|
+
{ ts:'14:18:14.221', proto:'unix', evt:'connection_routed', fp:'a1b2c3d4e5f6', mode:'package', pkg:'@automagik/genie', uid:1000, pid:48211, db:'app_genie_a1b2c3d4e5f6', ms:0.4, status:'ok', reason:null },
|
|
303
|
+
{ ts:'14:18:14.118', proto:'tcp', evt:'tcp_token_used', fp:'a1b2c3d4e5f6', mode:null, tokenId:'4f12a9e0', uid:null, pid:null, db:'app_genie_a1b2c3d4e5f6', ms:0.9, status:'ok', reason:null, remote:'127.0.0.1:54812' },
|
|
304
|
+
{ ts:'14:18:13.880', proto:'tcp', evt:'tcp_token_denied', fp:'b9d4e7f1a3c2', mode:null, tokenId:null, uid:null, pid:null, db:null, ms:0.2, status:'denied', reason:'token_unknown', remote:'127.0.0.1:54810' },
|
|
305
|
+
{ ts:'14:18:12.444', proto:'unix', evt:'connection_routed', fp:'b9d4e7f1a3c2', mode:'package', pkg:'@studio/brain', uid:1000, pid:48199, db:'app_brain_b9d4e7f1a3c2', ms:0.5, status:'ok', reason:null },
|
|
306
|
+
{ ts:'14:18:11.992', proto:'unix', evt:'connection_routed', fp:'c4d8e2b6f0a9', mode:'script', pkg:null, uid:1001, pid:48190, db:'svc_omx_c4d8e2b6f0a9', ms:0.6, status:'ok', reason:null },
|
|
307
|
+
{ ts:'14:18:11.041', proto:'tcp', evt:'tcp_token_used', fp:'a1b2c3d4e5f6', mode:null, tokenId:'4f12a9e0', uid:null, pid:null, db:'app_genie_a1b2c3d4e5f6', ms:1.1, status:'ok', reason:null, remote:'10.42.0.7:51220' },
|
|
308
|
+
{ ts:'14:18:09.661', proto:'tcp', evt:'tcp_token_denied', fp:null, mode:null, tokenId:null, uid:null, pid:null, db:null, ms:0.1, status:'denied', reason:'missing_or_malformed_application_name', remote:'10.42.0.13:51188' },
|
|
309
|
+
{ ts:'14:18:08.220', proto:'unix', evt:'connection_routed', fp:'a1b2c3d4e5f6', mode:'package', pkg:'@automagik/genie', uid:1000, pid:48184, db:'app_genie_a1b2c3d4e5f6', ms:0.4, status:'ok', reason:null },
|
|
310
|
+
{ ts:'14:18:07.103', proto:'unix', evt:'connection_routed', fp:'e8f1a2b3c4d5', mode:'package', pkg:'@studio/jobs', uid:1001, pid:48171, db:'svc_jobs_e8f1a2b3c4d5', ms:0.7, status:'ok', reason:null },
|
|
311
|
+
{ ts:'14:18:06.554', proto:'tcp', evt:'tcp_token_used', fp:'b9d4e7f1a3c2', mode:null, tokenId:'9c3e801b', uid:null, pid:null, db:'app_brain_b9d4e7f1a3c2', ms:1.0, status:'ok', reason:null, remote:'10.42.0.7:51160' },
|
|
312
|
+
{ ts:'14:18:05.099', proto:'tcp', evt:'tcp_token_denied', fp:'a1b2c3d4e5f6', mode:null, tokenId:null, uid:null, pid:null, db:null, ms:0.3, status:'denied', reason:'cross_fingerprint_attempt', remote:'10.42.0.21:50998' },
|
|
313
|
+
{ ts:'14:18:04.011', proto:'unix', evt:'connection_routed', fp:'f7c1b2d3e4a5', mode:'script', pkg:null, uid:1000, pid:48150, db:'svc_repl_f7c1b2d3e4a5', ms:0.5, status:'ok', reason:null },
|
|
314
|
+
];
|
|
315
|
+
|
|
316
|
+
const INGRESS_TOKENS = [
|
|
317
|
+
{ id:'4f12a9e0', fp:'a1b2c3d4e5f6', pkg:'@automagik/genie', issued:'2026-04-26 09:14', lastUsed:'14:18:14', uses:18244, status:'active', note:'CI · ci-runner@gha' },
|
|
318
|
+
{ id:'9c3e801b', fp:'b9d4e7f1a3c2', pkg:'@studio/brain', issued:'2026-04-22 11:02', lastUsed:'14:18:06', uses:9211, status:'active', note:'analytics · prod read' },
|
|
319
|
+
{ id:'2a8d3f7c', fp:'c4d8e2b6f0a9', pkg:'svc_omx (script)', issued:'2026-04-18 16:40', lastUsed:'13:50:11', uses:412, status:'active', note:'omx ingest worker' },
|
|
320
|
+
{ id:'7e0b1c4d', fp:'e8f1a2b3c4d5', pkg:'@studio/jobs', issued:'2026-04-12 08:29', lastUsed:'12:14:02', uses:5022, status:'expiring',note:'rotates in 47m' },
|
|
321
|
+
{ id:'88a4f1e2', fp:'a1b2c3d4e5f6', pkg:'@automagik/genie', issued:'2026-03-30 14:11', lastUsed:'2026-04-22 09:00', uses:1208, status:'idle', note:'unused 8d · candidate to revoke' },
|
|
322
|
+
{ id:'5d2b9011', fp:'(deleted)', pkg:'(deleted)', issued:'2026-03-12 10:00', lastUsed:'2026-03-15 04:22', uses:88, status:'revoked', note:'manual · key rotation' },
|
|
323
|
+
];
|
|
324
|
+
|
|
325
|
+
const INGRESS_DENY_REASONS = [
|
|
326
|
+
{ code:'token_unknown', count:11, share:0.478, hint:'hash not in pgserve_meta.allowed_tokens' },
|
|
327
|
+
{ code:'missing_or_malformed_application_name', count:8, share:0.348, hint:'app_name did not parse to {fp,token}' },
|
|
328
|
+
{ code:'cross_fingerprint_attempt', count:3, share:0.130, hint:'token valid for fp X · presented for fp Y' },
|
|
329
|
+
{ code:'unknown_fingerprint', count:1, share:0.044, hint:'fp present but no pgserve_meta row' },
|
|
330
|
+
];
|
|
331
|
+
|
|
332
|
+
const INGRESS_FP_DETAIL = {
|
|
333
|
+
fp: 'a1b2c3d4e5f6',
|
|
334
|
+
mode: 'package',
|
|
335
|
+
packageRealpath: '/Users/dev/code/genie',
|
|
336
|
+
packageName: '@automagik/genie',
|
|
337
|
+
uid: 1000,
|
|
338
|
+
derivation: 'sha256(realpath \\0 name \\0 uid)[:12]',
|
|
339
|
+
db: 'app_genie_a1b2c3d4e5f6',
|
|
340
|
+
liveness_pid: 48211,
|
|
341
|
+
persisted: true,
|
|
342
|
+
tokens: 2,
|
|
343
|
+
sample: 'sha256("0/Users/dev/code/genie\\0@automagik/genie\\01000")',
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
window.PGS = {
|
|
347
|
+
DBS, SCHEMAS, TABLE_COLS, TABLE_ROWS, SQL_TABS, SQL_HISTORY, SLOW_QUERIES, BLOAT, AUDIT, ROLES, LINTS, HEALTH, SYNC_TARGETS, BACKUPS,
|
|
348
|
+
SWARM_PROMPT, SWARM_AGENTS, SWARM_TIMELINE, SWARM_DRAFT_SQL, SWARM_RESULT_ROWS, SWARM_RECENT,
|
|
349
|
+
INGRESS_LISTENERS, INGRESS_FUNNEL, INGRESS_LIVE, INGRESS_TOKENS, INGRESS_DENY_REASONS, INGRESS_FP_DETAIL,
|
|
350
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" data-theme="mdr" data-screen-label="autopg console">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>autopg · console</title>
|
|
6
|
+
<link rel="stylesheet" href="colors_and_type.css" />
|
|
7
|
+
<link rel="stylesheet" href="console.css?v=settings1" />
|
|
8
|
+
<script src="https://unpkg.com/react@18.3.1/umd/react.development.js" integrity="sha384-hD6/rw4ppMLGNu3tX5cjIb+uRZ7UkRJ6BPkLpg4hAu/6onKUg4lLsHAs9EBPT82L" crossorigin="anonymous"></script>
|
|
9
|
+
<script src="https://unpkg.com/react-dom@18.3.1/umd/react-dom.development.js" integrity="sha384-u6aeetuaXnQ38mYT8rp6sbXaQe3NL9t+IBXmnYxwkUI2Hw4bsp2Wvmx4yRQF1uAm" crossorigin="anonymous"></script>
|
|
10
|
+
<script src="https://unpkg.com/@babel/standalone@7.29.0/babel.min.js" integrity="sha384-m08KidiNqLdpJqLq95G/LEi8Qvjl/xUYll3QILypMoQ65QorJ9Lvtp2RXYGBFj1y" crossorigin="anonymous"></script>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="root"></div>
|
|
14
|
+
<script src="api.js"></script>
|
|
15
|
+
<script type="text/babel" src="data.jsx"></script>
|
|
16
|
+
<script type="text/babel" src="components.jsx"></script>
|
|
17
|
+
<script type="text/babel" src="tweaks-panel.jsx"></script>
|
|
18
|
+
<script type="text/babel" src="screens/databases.jsx"></script>
|
|
19
|
+
<script type="text/babel" src="screens/tables.jsx"></script>
|
|
20
|
+
<script type="text/babel" src="screens/sql.jsx"></script>
|
|
21
|
+
<script type="text/babel" src="screens/optimizer.jsx"></script>
|
|
22
|
+
<script type="text/babel" src="screens/security.jsx"></script>
|
|
23
|
+
<script type="text/babel" src="screens/ingress.jsx"></script>
|
|
24
|
+
<script type="text/babel" src="screens/health.jsx"></script>
|
|
25
|
+
<script type="text/babel" src="screens/sync.jsx"></script>
|
|
26
|
+
<script type="text/babel" src="screens/rlm-trace.jsx"></script>
|
|
27
|
+
<script type="text/babel" src="screens/rlm-sim.jsx"></script>
|
|
28
|
+
<script type="text/babel" src="screens/settings.jsx"></script>
|
|
29
|
+
<script type="text/babel" src="app.jsx"></script>
|
|
30
|
+
</body>
|
|
31
|
+
</html>
|