Build your pathway page of a shipped course
const url = 'http://127.0.0.1:8765/api/learning/shipped/example/pathway';const options = {method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://127.0.0.1:8765/api/learning/shipped/example/pathway \ --header 'Content-Type: application/json' \ --data '{}'Build your own pathway page of a shipped course: ask first (the estimate), build on approval. The lessons and practice pages of a shipped course are the same for every user. ONE page is the user’s own: what the postings stored on this computer ask for, and what the user’s master resume already shows of each lesson (known, some, new). This route builds it. THE RESUME IS ALWAYS THE REFERENCE: a build always compares the course with the master resume, and no key turns that off. The comparison is about one model call on the user’s own model target, so NOTHING is sent without approve: true. Without it the answer is status: "ask" and nothing is sent or started: resume.lines is how many master lines would be compared, estimate is what the comparison takes (calls, tokens_in, tokens_out, seconds: arithmetic on the prompt that would be sent, not a history) and sends is the line to show before the approval: the build reads the resume, and sends the course’s lesson and subtopic titles and the resume lines, contact lines removed, to the model. With no master resume line resume.lines is 0, estimate is zero and sends says that nothing is sent: the build then makes no model call and the page marks nothing as known. With approve: true the build starts on a thread of the server and the answer is 202 with the GET /api/learning/pathways/{pathway_id} object of the course, whose local_page.build says running; read that route (or the list) to see how it goes. The build counts the stored postings with the course’s shipped vocabulary first (no model; a build that cannot count fails before anything is sent), then compares, checks every answer in code (a cited resume line must exist and the quote must be verbatim, else the subtopic is new), and writes the page and a record of numbers (the master revision, and cost: calls, tokens in and out). When it ends, local_page.state is built and build is null; when it did not finish, build is {status: failed, error_code, error} with a plain line (error_code: model_unavailable, model_authentication_required, markers_invalid, cap_reached, search_index_unavailable, config_unavailable, pathway_page_failed, interrupted), nothing was written and the page that was there stays: a partial comparison is never shown. One at a time per project, together with the generation of a course: 409 learning_running. 404 not_found for a role key no shipped course has. Every model call is recorded in GET /api/metrics (kind learning: numbers, never text). No answer of this route holds resume text or posting text. approve: true is Scout’s own approval: it does not replace the user’s choice.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The id of a row of GET /api/learning/pathways whose source is shipped (lower-case words joined by dashes).
Request Body
Section titled “Request Body”object
True: start the build (202). Left out or false: only what it takes and sends; nothing is sent.
Example
{}Responses
Section titled “Responses”Success.
object
Example
{ "estimate": { "calls": 1, "seconds": 92, "tokens_in": 21463, "tokens_out": 11410 }, "resume": { "lines": 52 }, "role_key": "mlops-engineer", "role_text": "MLOps engineer", "schema_version": "scout-learning-pathway-build:1", "sends": "This reads your resume to mark what you already know. It sends the lesson titles of this course and your resume lines (contact lines removed) to your model.", "status": "ask"}Forbidden / forbidden_origin: loopback peer and Host 127.0.0.1:<port> or localhost:<port> only (Origin too on writes).
object
object
Examplegenerated
{ "error": { "allowed_keys": [ "example" ], "code": "example", "message": "example" }}Not_found, target_unavailable
object
object
Example
{ "error": { "code": "not_found", "message": "..." }}Learning_running, master_unreadable, invalid_shipped
object
object
Example
{ "error": { "code": "learning_running", "message": "..." }}Unsupported_media_type: writes need Content-Type: application/json.
object
object
Examplegenerated
{ "error": { "allowed_keys": [ "example" ], "code": "example", "message": "example" }}Wrong_type, unknown_key
object
object
Example
{ "error": { "code": "wrong_type", "message": "..." }}