Skip to content

fix(hub): complete local decision model walkthrough - #326

Merged
alliscode merged 4 commits into
build/hub/newfrom
alliscode-decision-ux-walkthrough
Nov 20, 2026
Merged

alliscode merged 4 commits into
build/hub/newfrom
alliscode-decision-ux-walkthrough

Conversation

@alliscode

Copy link
Copy Markdown
Contributor

Why

The decision-model control plane was implemented, but contributors could not run its complete lifecycle through the real local Hub. The first fixture-backed walkthrough also exposed confusing training behavior: an accepted or running job could disappear behind a red learning-lock warning during automatic refresh, and the page had no action for evaluating a Build.

What changes

This adds a repeatable local walkthrough that starts the TypeScript Hub, PostgreSQL and workers, private artifact and learning stores, and the customer-operated fixture runtime. A deterministic seed creates accepted learning evidence, training consent, reviewed Builds, complete screenshots, repository administrator authority, and train/development/test coverage. The fixture is labeled as development-only contract evidence and does not claim model quality.

The Learnings page now uses an explicit two-step training confirmation, disables the confirmation while it is being submitted, and correlates the accepted request with its persisted job. If evidence preparation temporarily holds the learning lock, Hub keeps the last confirmed queued or running state visible, shows one neutral delayed-refresh status, and retries with capped backoff. Unrelated lock conflicts and runtime failures remain visible errors. Revalidation is read-only, and repeated clicks or refreshes reuse the confirmed operation instead of creating another job.

Repository administrators can also evaluate an eligible successful Build from the page and inspect the saved learning, route, captured views, probabilities, candidate, and promotion generation. Local administrator authority now follows the existing local-repository boundary, and local HTTP runtime access requires an explicit development-only loopback opt-in.

Real local walkthrough

Explicit confirmation before one bounded fixture job:

Explicit training confirmation

The running job stays visible while repeated overview reads encounter the learning lock:

Running training preserved during delayed refresh

The page recovers automatically after the lock is released:

Training status recovered after lock release

Storybook screenshots

Hub/Pages/Learnings decision-model states — dark system theme — desktop

Default

Hub Pages Learnings Default dark system theme desktop

Decision Training Paused

Hub Pages Learnings Decision Training Paused dark system theme desktop

Decision Training Blocked

Hub Pages Learnings Decision Training Blocked dark system theme desktop

Decision Training Queued

Hub Pages Learnings Decision Training Queued dark system theme desktop

Decision Training Preparing

Hub Pages Learnings Decision Training Preparing dark system theme desktop

Decision Training Running

Hub Pages Learnings Decision Training Running dark system theme desktop

Decision Training Failures

Hub Pages Learnings Decision Training Failures dark system theme desktop

Decision Candidate Promoted

Hub Pages Learnings Decision Candidate Promoted dark system theme desktop

Decision Candidate Rejected

Hub Pages Learnings Decision Candidate Rejected dark system theme desktop

@alliscode
alliscode requested review from a team and nshki as code owners November 20, 2026 17:21
Copilot AI adaptive review requested due to automatic review settings November 20, 2026 17:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical security issues expose the passwordless local API, bypass repository authorization boundaries, and allow private learning text to be returned after access revocation.

20 open issues
What changed in this PR

Adds a fixture-backed local walkthrough for Hub’s decision-model lifecycle and connects training recovery and Build evaluation to the Learnings page.

Changes:

  • Adds deterministic seed data, container configuration, runtime forwarding, and walkthrough documentation.
  • Adds training confirmation, submission feedback, accepted-job tracking, and delayed-refresh retries.
  • Adds Build evaluation actions and learning-text findings, with updated contracts, mocks, stories, and tests.
File Description
hub/​server/​workers/​index.test.ts Updates the runtime configuration mock.
hub/​server/​scripts/​start-decision-walkthrough-api/​index.ts Starts runtime and API forwarders.
hub/​server/​scripts/​start-decision-walkthrough-api/​create-tcp-forwarder/​index.ts Implements TCP forwarding.
hub/​server/​scripts/​start-decision-walkthrough-api/​create-tcp-forwarder/​index.test.ts Covers byte forwarding.
hub/​server/​scripts/​seed-decision-model-walkthrough/​index.ts Seeds review evidence, learning consent, Builds, and authority.
hub/​server/​scripts/​seed-decision-model-walkthrough/​create-solid-png/​index.ts Generates fixture screenshots.
hub/​server/​scripts/​seed-decision-model-walkthrough/​create-solid-png/​index.test.ts Checks generated image dimensions and data.
hub/​server/​routes/​api/​decision-model/​types.ts Adds nullable learning text to findings.
hub/​server/​routes/​api/​decision-model/​index.test.ts Updates overview response expectations.
hub/​server/​routes/​api/​decision-model/​create-decision-model-route-dependencies/​index.ts Loads learning text and projects Build choices.
hub/​server/​repositories/​repository-access/​lock-repository-administrator-authority/​index.ts Adds local developer administrator authorization.
hub/​server/​repositories/​repository-access/​lock-repository-administrator-authority/​index.db.test.ts Covers local authority cases.
hub/​server/​repositories/​decision-model-configurations/​get-decision-model-overview/​index.ts Queries recent screenshot-bearing Builds.
hub/​server/​integrations/​decision-runtime/​create-decision-runtime-client/​index.ts Adds opt-in HTTP loopback transport.
hub/​server/​domains/​learning/​authorize-repository-administration/​index.test.ts Updates authorization query mocks.
hub/​server/​domains/​decision-model/​read-decision-runtime-configuration/​index.ts Restricts plaintext runtime access to opted-in development.
hub/​server/​domains/​decision-model/​read-decision-runtime-configuration/​index.test.ts Covers runtime URL restrictions.
hub/​package.json Adds walkthrough startup and seed commands.
hub/​docs/​development.md Documents the local lifecycle walkthrough.
hub/​docs/​decision-model-control-plane.md Documents loopback access and refresh recovery.
hub/​client/​pages/​learnings-page/​stories.tsx Adds Build choices and a preparation story.
hub/​client/​pages/​learnings-page/​index.tsx Passes training submission state to the panel.
hub/​client/​features/​decision-model-panel/​types.ts Adds preparation status and Build choices.
hub/​client/​features/​decision-model-panel/​index.tsx Adds submission feedback, fixture promotion, and evaluation controls.
hub/​client/​features/​decision-model-panel/​index.test.tsx Covers confirmation, promotion, and evaluation controls.
hub/​client/​application/​hub/​view-models/​settings-learnings/​index.ts Maps preparation status and evaluation actions.
hub/​client/​application/​hub/​view-models/​settings-learnings/​index.test.ts Checks evaluation Build mapping.
hub/​client/​application/​hub/​routes/​settings-learnings/​index.tsx Adds job correlation, refresh recovery, and evaluation submission.
hub/​client/​application/​hub/​routes/​settings-learnings/​index.test.ts Updates mutation and response assertions.
hub/​client/​application/​hub/​routes/​learnings-flow.test.tsx Covers delayed-refresh recovery and saved evaluations.
hub/​client/​application/​hub/​mocks/​create-decision-model-handlers/​index.ts Simulates evaluation and aligns promotion responses.
hub/​client/​application/​hub/​decision-model-contracts/​types.ts Updates overview, availability, and promotion types.
hub/​client/​application/​hub/​decision-model-contracts/​index.ts Validates Build choices and mutation responses.
hub/​client/​application/​hub/​decision-model-contracts/​index.test.ts Covers the evaluation-choice limit.
hub/​.env.example Documents the development loopback opt-in.
hub/​.devcontainer/​decision-walkthrough.compose.yaml Configures walkthrough storage, runtime access, and dependency volumes.

Review effort: Max (adaptive)

Prototype Author and others added 4 commits November 20, 2026 11:24
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@alliscode
alliscode force-pushed the alliscode-decision-ux-walkthrough branch from bf95e76 to cdf3155 Compare November 20, 2026 19:50
@alliscode
alliscode merged commit 651febd into build/hub/new Nov 20, 2026
51 checks passed
@alliscode
alliscode deleted the alliscode-decision-ux-walkthrough branch November 20, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants