Repository navigation
fix(hub): complete local decision model walkthrough - #326
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 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
Reset repository-specific state when navigating between repositories · New Restrict local authority to enabled local sign-in and unlinked repositories · New Recheck session and repository authority after private reads · New Keep the passwordless local API behind a loopback-only boundary · New Prevent completed jobs from reviving pending requests · New Do not attribute deployment-wide locks to unrelated jobs · New Keep status polling read-only · New Stop automatic retries for non-lock overview errors · New Base promotion eligibility on the candidate's training backend · New Offer only Builds with complete evaluation coverage · New Allow local administrators through session-aware authorization · New Batch or bound learning-text lookups during overview refresh · New Handle withheld and missing learning text in overview responses · New Keep Hub and fixture runtime generation history in sync · New Make the runtime target reachable on native Linux Docker · New Always assert the training job ID in confirmed-training cases · New Test loopback HTTP transport policy in the runtime client · New Test evaluationBuilds filters, ordering, and limit · New Test seed guards before database and filesystem resets · New Test forwarder startup order and cleanup on failure · New
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)
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
force-pushed
the
alliscode-decision-ux-walkthrough
branch
from
November 20, 2026 19:50
bf95e76 to
cdf3155
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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:
The running job stays visible while repeated overview reads encounter the learning lock:
The page recovers automatically after the lock is released:
Storybook screenshots
Hub/Pages/Learnings decision-model states — dark system theme — desktop
Default
Decision Training Paused
Decision Training Blocked
Decision Training Queued
Decision Training Preparing
Decision Training Running
Decision Training Failures
Decision Candidate Promoted
Decision Candidate Rejected