IntentGuard

S06.2 — Load the artifact and implement health and prediction endpoints

Planning / historicaltaskdelivery

Historical

Planning material. It summarizes and links to the authoritative specification and the current measured state — it does not replace either, and it is not current engineering truth.

Migration identity#

  • Canonical identifier: S06.2 (GitHub issue type: subtask).
  • Legacy identifier: C06.2 (retained as old_identifier).
  • Parent epic: E06.
  • Milestone: M1 — IntentGuard Weekend MVP.

Objective#

Load one immutable transformer artifact at startup and implement health plus accepted/abstained prediction responses using its persisted threshold.

Rationale#

Serving parity and readiness must be tied to the exact evaluated artifact.

Parent identifier#

E06.

Source task#

T-006.

Traceability#

Primary: FR-006, FR-007, AC-006, AC-007, AC-009. Secondary: FR-008, AC-010.

Prerequisites#

C06.1 contract stable; U04 artifact and U05 evaluation identity available.

Likely files#

src/intentguard/predictor.py, src/intentguard/api.py, tests/integration/test_api.py, tests/unit/test_artifacts.py.

Implementation boundary#

Single-process read-only inference; no training, threshold changes, background mutation, or external state.

MUST scope#

Startup load/failure, health readiness/artifact ID, tokenization parity, deterministic argmax/tie rule, confidence, threshold comparison, accept/abstain response.

Explicit non-goals#

Batching, queue, database, dynamic artifact swap, mock-only production path, or cloud serving.

Acceptance criteria#

Health reflects artifact readiness; accepted and abstained fixtures return contract-compliant 200 responses; invalid artifact startup fails honestly; artifact/threshold identity matches U05.

Validation commands#

uv run pytest tests/integration/test_api.py tests/unit/test_artifacts.py -q.

Expected evidence#

Health, accept, abstain, startup-failure, and serving-parity test output with artifact ID.

Fallback and status consequence#

Deterministic predictor is Mocked and test/degraded-only. Without the real artifact path, U06 fails strict MVP.

Stop condition#

Stop for artifact mismatch, threshold mutation, training at startup, nondeterministic ties, or misleading readiness.

Definition of ready#

Schema, artifact, preprocessing, request-ID, and tie rules are frozen.

Definition of done#

FR-006/007 and AC-006/007/009 pass for the real artifact implementation.

Labels#

type:subtask, priority:MUST, area:api

Estimate#

1.0 hour.

Related in repository

Open in full graph →
DOCUMENTED_BY — source: docs/backlog/tasks/C06.2-predictor-health-predict.md § S06.2 — Load the artifact and implement health and prediction endpointsREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.mdREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.mdREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.mdREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.mdREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.mdREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.mdREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.mdREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.mdREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.mdPART_OF — source: docs/backlog/TRACEABILITY.md § Functional requirementsPART_OF — source: docs/backlog/TRACEABILITY.md § Functional requirementsPART_OF — source: docs/backlog/TRACEABILITY.md § Functional requirementsPART_OF — source: docs/backlog/TRACEABILITY.md § Acceptance criteriaPART_OF — source: docs/backlog/TRACEABILITY.md § Acceptance criteriaPART_OF — source: docs/backlog/TRACEABILITY.md § Acceptance criteriaREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.md § TraceabilityREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.md § TraceabilityREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.md § TraceabilityREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.md § TraceabilityREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.md § TraceabilityREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.md § TraceabilityREFERENCES — source: docs/backlog/tasks/C06.2-predictor-health-predict.md § TraceabilitySATISFIES — source: docs/specification/docs/TRACEABILITY.md § Functional traceabilityREFERENCES — source: docs/backlog/umbrellas/U06-fastapi-demo.md § TraceabilitySATISFIES — source: docs/specification/docs/TRACEABILITY.md § Functional traceabilityREFERENCES — source: docs/backlog/umbrellas/U06-fastapi-demo.md § TraceabilitySATISFIES — source: docs/specification/docs/TRACEABILITY.md § Functional traceabilitySATISFIES — source: docs/specification/docs/TRACEABILITY.md § Functional traceabilityREFERENCES — source: docs/backlog/umbrellas/U06-fastapi-demo.md § TraceabilitySATISFIES — source: docs/specification/docs/TRACEABILITY.md § Functional traceabilityREFERENCES — source: docs/backlog/umbrellas/U06-fastapi-demo.md § TraceabilityREFERENCES — source: docs/backlog/umbrellas/U06-fastapi-demo.md § TraceabilityCURRENTdocument: S06.2 — Load the artifact and implement health and prediction endpointsS06.2task: S06.2AC-006 — Accepted predic…acceptance-criterion: AC-006 — Accepted predictionAC-007 — Abstained predi…acceptance-criterion: AC-007 — Abstained predictionAC-009 — Readinessacceptance-criterion: AC-009 — ReadinessAC-010 — Artifact parityacceptance-criterion: AC-010 — Artifact parityE06epic: E06FR-006 — Inference APIrequirement: FR-006 — Inference APIFR-007 — Health checkrequirement: FR-007 — Health checkFR-008 — Artifact persis…requirement: FR-008 — Artifact persistence
Hover an edge for its provenance · click a node to open it10 nodes · 33 edges