Record ops-hub bootstrap progress and add API bootstrap helper

Document the 2026-06-15 attended Inter-Hub bootstrap: hub row, active manifest,
widget seeding, and runtime API key creation. Add scripts/ops-hub-bootstrap-api.py,
extend the SQL fallback for widget versions and the first Gitea event, refresh
OpsHubBootstrapRunbook, and inline credential-routing guidance for agents.
This commit is contained in:
2026-06-19 19:09:21 +02:00
parent 3638ee14ad
commit 215e62a221
7 changed files with 1005 additions and 43 deletions

View File

@@ -9,6 +9,8 @@
-- - Owned type registry entries
-- - ApiConsumer row
-- - Seed widgets
-- - Initial widget versions for the seed widgets
-- - First Gitea registry readiness event
--
-- It intentionally does not create an ApiKey. Generate the key through the
-- authenticated Inter-Hub UI so the full static key can be shown once and
@@ -284,4 +286,97 @@ WHERE NOT EXISTS (
AND capability_ref = seed.capability_ref
);
WITH hub AS (
SELECT id FROM hubs WHERE slug = 'ops-hub'
), seeded_widgets AS (
SELECT
w.id,
w.name,
w.widget_type,
w.hub_id,
w.capability_ref,
w.view_context,
w.policy_scope,
w.status,
w.version
FROM widgets w
JOIN hub ON hub.id = w.hub_id
WHERE w.capability_ref IN (
'ops:environment:local',
'ops:environment:coulombcore',
'ops:environment:railiance01',
'ops:environment:threephoenix-prod',
'ops:host:coulombcore',
'ops:host:railiance01',
'ops:service-catalog',
'ops:service:gitea',
'ops:service:state-hub',
'ops:service:inter-hub',
'ops:endpoint:gitea-registry',
'ops:readiness:gitea-registry',
'ops:readiness:state-hub-cluster-deploy',
'ops:migration:coulombcore-to-threephoenix'
)
)
INSERT INTO widget_versions (
widget_id,
version,
schema_snapshot
)
SELECT
seeded_widgets.id,
1,
jsonb_build_object(
'name', seeded_widgets.name,
'widget_type', seeded_widgets.widget_type,
'hub_id', seeded_widgets.hub_id,
'capability_ref', seeded_widgets.capability_ref,
'view_context', seeded_widgets.view_context,
'policy_scope', seeded_widgets.policy_scope,
'status', seeded_widgets.status,
'version', seeded_widgets.version
)
FROM seeded_widgets
WHERE NOT EXISTS (
SELECT 1
FROM widget_versions
WHERE widget_id = seeded_widgets.id
AND version = 1
);
WITH readiness_widget AS (
SELECT id
FROM widgets
WHERE capability_ref = 'ops:readiness:gitea-registry'
AND hub_id = (SELECT id FROM hubs WHERE slug = 'ops-hub')
)
INSERT INTO interaction_events (
widget_id,
event_type,
actor_type,
view_context_ref,
metadata
)
SELECT
readiness_widget.id,
'ops-endpoint-verified',
'api',
'railiance-apps/workplans/RAIL-AP-WP-0001',
jsonb_build_object(
'vsmFunction', 'OPS',
'vsmSystem', 'S1',
'endpoint', 'https://gitea.coulomb.social/v2/',
'expectedStatus', 401,
'observedHeader', 'Docker-Distribution-Api-Version: registry/2.0',
'recordedBy', 'helix-forge/wiki/ops-hub-bootstrap.sql'
)
FROM readiness_widget
WHERE NOT EXISTS (
SELECT 1
FROM interaction_events
WHERE widget_id = readiness_widget.id
AND event_type = 'ops-endpoint-verified'
AND view_context_ref = 'railiance-apps/workplans/RAIL-AP-WP-0001'
);
COMMIT;