feat(epic3): deliver the accepted Epic 3 scope through Story 3.17
CI / Rust Checks (pull_request) Failing after 13m41s
CI / UI Checks (pull_request) Skipped
CI / Frontend E2E (pull_request) Skipped
CI / Community Image Smoke (pull_request) Skipped
CI / Deploy (pull_request) Skipped
Community Release / release (push) Failing after 13m33s

Recovery delivery of the accumulated, TL-accepted Epic 3 work that had never been
committed to Git (stories 3.6-3.17, see the crank board). Story 3.18 is not accepted
yet and is deliberately excluded: its logging surface, its capability registration,
its oracle projections and its tests are not part of this tree.

Accepted scope
- 3.6 typed static Resource Drafts; 3.7 publication and exact binding of static
  Resource Versions; 3.8 MCP discovery/read and revocation of static Resources;
- 3.9 Resource import/export in API and UI plus TLS dependency maintenance;
  3.10 REST-backed Resource templates; 3.11 shared REST read runtime and the MCP
  revision/capability foundation;
- 3.12 parameterised Prompt Drafts with preview; 3.13 Prompt publication and exact
  version binding to Agents; 3.14 MCP prompts; 3.15 Prompt import/export;
- 3.16 composite Prompts with published Resources (dependency content scan plus
  dynamic read through the accepted 3.11 runtime, admin preview and MCP prompts/get);
- 3.17 bounded MCP completion suggestions from typed published schemas and the
  resources/list admission fix for bound template publications.

Accepted evidence being reused (unchanged code paths)
- 3.16 candidate: core 7, admin-api 22, registry 4, mcp-server 4, UI 6; one final
  `just verify` run 1651 passed / 0 failed / 2 ignored.
- 3.17 candidate: full run 1672 passed / 0 failed / 2 ignored, QA targeted reruns and
  a real MCP Inspector 2.12.0 client smoke.

Delivery engineering in this commit
- CI: one event per change (feature branches are gated by their pull request, push
  runs only on main), story events run the changed packages, the full workspace suite
  stays the feature/release gate; no cache/sharding without a measured runner check.
- Release: the packaged archives, checksums and SBOM are now uploaded to the Gitea
  release entry of the tag instead of dying with the runner workspace.

Not included on purpose: Story 3.18 work, build caches, runtime databases, local
credentials and scratch evidence.

Refs: crank kanban t_e39d7263; baseline 1b6db09bd1.
This commit is contained in:
bsodfather committed 2026-10-25 09:08:22 +00:00
1 parent 1b6db09bd1
commit 54ce770682
357 files changed
+117394 -5115

No files matched your search

+14
View File
@@ -80,6 +80,18 @@ const BUNDLES = {
'js/secrets.js',
],
},
resources: {
files: [
'js/nav.js',
'js/resources.js',
],
},
prompts: {
files: [
'js/nav.js',
'js/prompts.js',
],
},
settings: {
files: [
'js/nav.js',
@@ -235,6 +247,8 @@ async function main() {
rewriteHtml('html/api-keys.html', manifest, '..');
rewriteHtml('html/logs.html', manifest, '..');
rewriteHtml('html/secrets.html', manifest, '..');
rewriteHtml('html/resources.html', manifest, '..');
rewriteHtml('html/prompts.html', manifest, '..');
rewriteHtml('html/settings.html', manifest, '..');
rewriteHtml('html/usage.html', manifest, '..');
rewriteHtml('html/workspace-setup.html', manifest, '..');
+86 -26
View File
@@ -4,6 +4,15 @@ set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
TMP_DIR="$ROOT_DIR/.tmp/ui-e2e"
LOG_DIR="$TMP_DIR/logs"
# This script deletes log files and (on a fresh database) the artifact root
# under $TMP_DIR. A symlinked .tmp or .tmp/ui-e2e would redirect that cleanup
# into an unrelated directory, so refuse before the first write through it.
if [[ -L "$ROOT_DIR/.tmp" || -L "$TMP_DIR" ]]; then
echo "refusing to use a symlinked E2E workspace: $TMP_DIR" >&2
exit 1
fi
POSTGRES_CONTAINER="crank-e2e-postgres"
POSTGRES_PORT="${CRANK_E2E_POSTGRES_PORT:-55433}"
ADMIN_PORT="${CRANK_E2E_ADMIN_PORT:-3301}"
@@ -218,7 +227,8 @@ export POSTGRES_USER="$POSTGRES_USER"
export POSTGRES_PASSWORD="$POSTGRES_PASSWORD"
export DATABASE_URL="postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB"
export SQLX_OFFLINE="true"
export CRANK_STORAGE_ROOT="$TMP_DIR/storage"
STORAGE_ROOT="$TMP_DIR/storage"
export CRANK_STORAGE_ROOT="$STORAGE_ROOT"
export CRANK_ADMIN_BIND="0.0.0.0:$ADMIN_PORT"
export CRANK_MCP_BIND="0.0.0.0:$MCP_PORT"
export CRANK_MCP_REFRESH_MS="1000"
@@ -231,8 +241,19 @@ export CRANK_SESSION_TTL_HOURS="24"
export CRANK_BOOTSTRAP_ADMIN_EMAIL="$ADMIN_EMAIL"
export CRANK_BOOTSTRAP_ADMIN_DISPLAY_NAME="Crank E2E"
export CRANK_BASE_URL="http://127.0.0.1:$UI_PORT"
mkdir -p -m 700 "$CRANK_STORAGE_ROOT"
chmod 700 "$CRANK_STORAGE_ROOT"
# The artifact root is paired with the database lifecycle and is decided after
# the bootstrap step below: a database that was just bootstrapped is empty, so
# stale artifact files must not survive it. Files left from an earlier run have
# no owning database row, the reconciler claims them, and a Resource
# create/update with identical bytes then fails with
# `resource_storage_unavailable`.
# $TMP_DIR is verified above to be a real workspace-local directory, so this
# reference root is independent of the storage path being checked.
EXPECTED_STORAGE_ROOT="$(realpath -m -- "$TMP_DIR")/storage"
if [[ -L "$STORAGE_ROOT" || "$(realpath -m -- "$STORAGE_ROOT")" != "$EXPECTED_STORAGE_ROOT" ]]; then
echo "refusing to touch an unexpected artifact root: $STORAGE_ROOT" >&2
exit 1
fi
(
cd "$ROOT_DIR/apps/ui"
@@ -256,6 +277,14 @@ if ! (
exit 1
fi
# A disposable container is always a brand-new database; an external one is
# only known to be new once the bootstrap below creates its first admin.
FRESH_DATABASE=0
if [[ "$USE_EXTERNAL_POSTGRES" != "1" ]]; then
FRESH_DATABASE=1
fi
BOOTSTRAP_REUSED=0
if ! (
cd "$ROOT_DIR"
cargo run -p admin-api --bin crank-migrate -- admin-auth bootstrap-create \
@@ -263,37 +292,68 @@ if ! (
--display-name "Crank E2E" \
>"$LOG_DIR/bootstrap-create.log" 2>&1
); then
echo "Failed to create the E2E bootstrap contract" >&2
show_startup_log "$LOG_DIR/bootstrap-create.log"
exit 1
# A retained external PostgreSQL still holds the active bootstrap contract
# from the previous start, and its admin account keeps the same constant
# credentials, so a restart has nothing to bootstrap.
if [[ "$USE_EXTERNAL_POSTGRES" = "1" ]] \
&& grep -q '"code":"admin_bootstrap_unavailable"' "$LOG_DIR/bootstrap-create.log"; then
echo "reusing the existing bootstrap contract of the external PostgreSQL"
BOOTSTRAP_REUSED=1
else
echo "Failed to create the E2E bootstrap contract" >&2
show_startup_log "$LOG_DIR/bootstrap-create.log"
exit 1
fi
fi
BOOTSTRAP_JSON="$(tail -n 1 "$LOG_DIR/bootstrap-create.log")"
if ! BOOTSTRAP_TOKEN="$("$PYTHON_BIN" - <<'PY' "$BOOTSTRAP_JSON"
if [[ "$BOOTSTRAP_REUSED" = "0" ]]; then
BOOTSTRAP_JSON="$(tail -n 1 "$LOG_DIR/bootstrap-create.log")"
if ! BOOTSTRAP_TOKEN="$("$PYTHON_BIN" - <<'PY' "$BOOTSTRAP_JSON"
import json, sys
print(json.loads(sys.argv[1])["bootstrap_token"])
PY
)"; then
echo "Failed to parse the E2E bootstrap token" >&2
show_startup_log "$LOG_DIR/bootstrap-create.log"
exit 1
fi
printf '%s' "$BOOTSTRAP_TOKEN" >"$TMP_DIR/bootstrap-token.txt"
printf '%s' "$ADMIN_PASSWORD" >"$TMP_DIR/admin-password.txt"
printf '%s' "$CRANK_PASSWORD_PEPPER" >"$TMP_DIR/password-pepper.txt"
echo "Failed to parse the E2E bootstrap token" >&2
show_startup_log "$LOG_DIR/bootstrap-create.log"
exit 1
fi
printf '%s' "$BOOTSTRAP_TOKEN" >"$TMP_DIR/bootstrap-token.txt"
printf '%s' "$ADMIN_PASSWORD" >"$TMP_DIR/admin-password.txt"
printf '%s' "$CRANK_PASSWORD_PEPPER" >"$TMP_DIR/password-pepper.txt"
if ! (
cd "$ROOT_DIR"
cargo run -p admin-api --bin crank-migrate -- admin-auth bootstrap-complete \
--token-file "$TMP_DIR/bootstrap-token.txt" \
--password-file "$TMP_DIR/admin-password.txt" \
--password-pepper-file "$TMP_DIR/password-pepper.txt" \
>"$LOG_DIR/bootstrap-complete.log" 2>&1
); then
echo "Failed to complete the E2E admin bootstrap" >&2
show_startup_log "$LOG_DIR/bootstrap-complete.log"
exit 1
if ! (
cd "$ROOT_DIR"
cargo run -p admin-api --bin crank-migrate -- admin-auth bootstrap-complete \
--token-file "$TMP_DIR/bootstrap-token.txt" \
--password-file "$TMP_DIR/admin-password.txt" \
--password-pepper-file "$TMP_DIR/password-pepper.txt" \
>"$LOG_DIR/bootstrap-complete.log" 2>&1
); then
# `admin_bootstrap_rejected` on a retained external database means an admin
# account with the same constant password already exists.
if [[ "$USE_EXTERNAL_POSTGRES" = "1" ]] \
&& grep -q '"code":"admin_bootstrap_rejected"' "$LOG_DIR/bootstrap-complete.log"; then
echo "reusing the existing admin account of the external PostgreSQL"
else
echo "Failed to complete the E2E admin bootstrap" >&2
show_startup_log "$LOG_DIR/bootstrap-complete.log"
exit 1
fi
else
# No admin existed before this start, so the database is new.
FRESH_DATABASE=1
fi
fi
if [[ "$FRESH_DATABASE" = "1" ]]; then
rm -rf "$STORAGE_ROOT"
mkdir -p -m 700 "$STORAGE_ROOT"
else
echo "keeping the retained artifact root of the existing database: $STORAGE_ROOT"
mkdir -p -m 700 "$STORAGE_ROOT"
fi
chmod 700 "$STORAGE_ROOT"
# Launch the built executable directly so the test lifecycle controls the
# actual server PID, rather than a Cargo wrapper. This control exists only in
# the local Playwright harness and adds no application endpoint/configuration.
+14
View File
@@ -49,6 +49,12 @@ function mapRoute(urlPath) {
if (urlPath === '/secrets') {
return path.join(ROOT_DIR, 'html', 'secrets.html');
}
if (urlPath === '/resources') {
return path.join(ROOT_DIR, 'html', 'resources.html');
}
if (urlPath === '/prompts') {
return path.join(ROOT_DIR, 'html', 'prompts.html');
}
if (urlPath === '/logs') {
return path.join(ROOT_DIR, 'html', 'logs.html');
}
@@ -194,6 +200,14 @@ const server = http.createServer((request, response) => {
redirect(response, '/secrets');
return;
}
if (urlPath === '/html/resources.html') {
redirect(response, '/resources');
return;
}
if (urlPath === '/html/prompts.html') {
redirect(response, '/prompts');
return;
}
if (urlPath === '/html/logs.html') {
redirect(response, '/logs');
return;