KatalockAi AcademyBack to KatalockAi
Phase project, required for the Phase 14 certificate

Shape, Spec and Measure a Workflow Agent Slice

Pick a real recurring workflow, shape it into an outcome, assumptions, slice, spec and pre-registered metrics, then build a read-only agent slice, replay it on 20+ real cases and make an honest go, revise or stop decision.

about 8 h Reviewed against a 6-point rubric
Submit your project Get coached by Professor Katalock

Lessons this project uses

  1. 1Define the Outcome Before You Choose the OutputPhase 14: Agent engineering
  2. 2Discover the Workflow People Actually PerformPhase 14: Agent engineering
  3. 3Map Assumptions and Resolve the Riskiest One FirstPhase 14: Agent engineering
  4. 4Choose the Smallest Slice That Can Change the DecisionPhase 14: Agent engineering
  5. 5Write Specifications That Preserve JudgmentPhase 14: Agent engineering
  6. 6Design Success Metrics Before the Result ExistsPhase 14: Agent engineering
  7. 7Choose Prototype, Pilot, or Production DeliberatelyPhase 14: Agent engineering
  8. 8Build a Feedback Ratchet with Ownership and RetirementPhase 14: Agent engineering

What You'll Build

You take one real, recurring workflow (yours, a colleague's, a small business's, or a public proxy such as issue triage on an open-source repo you use) and decide whether an agent should touch it at all. You produce the shaping artifacts from the product-judgment lessons, commit a measurement plan before any result exists, then build the smallest slice that can change the decision: a propose-only agent that never writes, replayed against at least 20 real historical cases next to a baseline. Most of the grade is for judgment and evidence, not for agent sophistication.

Requirements

  1. Outcome frame in shaping/outcome-frame.json with all six parts: user, situation, current behavior, desired outcome, constraints, non-goals. Write a validator that flags solution leakage (a product form, model, framework or interface named in the desired outcome) and a test proving it flags a deliberately leaky variant.
  2. Workflow evidence in shaping/workflow-evidence.json: at least 6 ordered steps, each with actor, trigger, action, input, output, friction, authority and evidence, and an evidence level of direct, artifact, reported or inference. Include at least one exception path, one authority boundary and the computed direct-evidence ratio. The evidence must come from a real source you name (logs, tickets, email threads, a timed run of yourself doing the task).
  3. Assumption map in shaping/assumption-map.json: at least 5 falsifiable assumptions covering at least the value, feasibility and safety classes, each scored 1 to 5 for impact, uncertainty and irreversibility. Identify the highest open risk and design its experiment: claim, sample, observable, threshold, and the next decision for pass, fail and ambiguous.
  4. Slice decision in shaping/slice-decision.json: at least 3 candidate slices, the required proof set, which candidates fail the eligibility gate and why, the chosen slice, and a stop rule that does not end in "keep building".
  5. Specification in shaping/spec.json: outcome, invariants (at least one authority invariant such as "the agent never sends, edits or deletes"), examples (normal, edge, failure, forbidden), non-goals, a decision policy that marks each decision locked, bounded or delegated with a reason, and the proof required for each invariant.
  6. Measurement plan in shaping/measurement-plan.json, committed to git before the replay results file exists: a goal, questions, and at least one outcome metric, one guardrail and one counter-metric, each with name, direction (at-least or at-most), threshold, window, source and population, plus written pass, fail and ambiguous rules.
  7. The slice. An agent that takes one case and returns a structured proposal validated against a JSON schema. Tools are read-only; any write is expressed only as a proposal. Use any OpenAI-compatible endpoint (including the KatalockAi API) or a local model. Also implement a baseline: the recorded human decisions and times, or a simple rule-based heuristic.
  8. Replay. Run the agent and the baseline over at least 20 real, anonymized historical cases with ground truth (what the human actually decided). Log every tool call to an audit log and check the guardrail automatically (for example, zero side-effecting calls). Compute every metric in the plan and write results/measurement-report.json with value, threshold, pass or fail per metric and the decision the pre-written rules produce. Do not edit thresholds after the run; if you believe one was wrong, say so in the README and leave it.
  9. Stage decision in shaping/stage-decision.json: prototype, pilot or production, with the controls required and exit criteria for expand, revise or stop, consistent with your actual results.
  10. Feedback ratchet in shaping/feedback-backlog.json: at least 4 signals from the replay (wrong answers, near misses, slow cases), each routed to the owning layer (evaluation or test, context, policy, runtime, backlog) with owner, priority, artifact to change, verification and retirement condition. Implement at least one action, for example turning a failed case into a regression test that now runs in the replay.
  11. Tests for each artifact validator, including the leaky-outcome test and a test that a measurement plan without a guardrail is rejected.

Constraints

  • CPU only. A local 1B to 8B model through Ollama or llama.cpp is enough, or any OpenAI-compatible endpoint. No specific commercial provider is required. Cap tokens per call and cache responses so the replay can be re-scored offline.
  • Data must be real but anonymized; never commit personal data, customer names or credentials. If your workflow is confidential, use a public proxy with real ground truth, such as label triage on public GitHub issues or answered threads from a public support forum.
  • The agent must not have write access to any real system during the replay. The read-only boundary must be enforced in code, not only in the prompt.

Stretch Goals

  • Run a bounded pilot for a few days with one real user, with a named owner and a rollback path, and report what the offline replay missed.
  • Compare two prompts or two models on the same replay without touching thresholds, and report whether the decision changes.
  • Have a second person label a subset of cases and report agreement with your ground truth.

How to Submit

Public repo with: README.md, shaping/ (all JSON artifacts above), agent/ (agent, tools, schema, baseline), replay.py, tests/, data/cases/ (anonymized cases or a script that fetches the public proxy), results/measurement-report.json, results/audit-log.jsonl. The README must explain the workflow and why you chose it, how to run the replay, the results table against thresholds, the decision and stage, the riskiest assumption and what the evidence said about it, and the limitations of a 20-case replay. Paste the outputs listed under evidence.

How It's Reviewed

Professor Katalock reads your repository and the evidence you paste, and scores each criterion out of 100. You pass with a weighted total of 70 or more and no criterion below 40. A copied or padded submission is flagged and fails.

CriterionWeightHow it's checked
Shaping artifacts25All six shaping files exist and validate; outcome has no solution leakage; workflow steps carry evidence levels from a named real source with an exception path; assumptions are falsifiable and scored; the slice passes its own eligibility gate; spec decisions are marked locked, bounded or delegated with reasons.
Pre-registered metrics and honest decision20git log shows measurement-plan.json committed before results/measurement-report.json; plan has outcome, guardrail and counter-metric with source and window; the reported decision follows the pre-written rules and thresholds were not moved.
Working slice and replay20replay.py runs the agent and baseline on 20+ cases; proposals validate against the schema; the audit log shows no side-effecting calls; metric values in the report match the pasted terminal output.
Stage decision and feedback ratchet15Stage choice is consistent with results and names controls and exit criteria; backlog has 4+ routed signals with owner, verification and retirement condition; at least one action is implemented and visible in tests or replay.
Code quality and tests10Validators and agent are separate modules, the read-only boundary is enforced in code, and tests (including leaky-outcome and missing-guardrail cases) pass.
README explanation and reflection10README explains the workflow choice, results against thresholds, the riskiest assumption and its evidence, at least one case the agent got wrong and why, and the limits of the replay.

Submit

Push your work to a public GitHub repository with a README that explains how to run it, then paste the evidence below. Up to 3 reviews a day, free.

  • Output of git log --format='%h %ad %s' --date=iso -- shaping/measurement-plan.json results/measurement-report.json
  • Full terminal output of python replay.py (or your equivalent command)
  • Contents of results/measurement-report.json
  • Full output of your test run
  • Model and endpoint used (local or hosted) and a one-paragraph description of your data source and how it was anonymized
  • A short reflection: your riskiest assumption, whether the evidence supported it, and one case the agent got wrong

Reviews are done by AI against the rubric above. They check the evidence in your repository; they are not a substitute for a human code review, and a review can be wrong. If you think it is, improve the README so the evidence is unmistakable and resubmit.