Mapping Human Tasks to AI Delimiters
Given a human task description, produce a specification using reserved, collision-proof delimiters ⟦TAG attr="val"⟧ ... ⟦/TAG⟧:
XML⟦TASK_SCOPE id="T1" objective="reconcile invoices" acceptance="all line items matched or flagged"⟧ ⟦HUMAN_STEP id="H1" seq="1" actor="accountant" action="open spreadsheet, compare invoice to PO"⟧ ⟦ARTIFACT_IO direction="in" schema="invoice.csv,po.csv"⟧ ⟦ARTIFACT_IO direction="out" schema="reconciled.csv"⟧ ⟦/HUMAN_STEP⟧ ⟦MAPPING_RECORD id="M1" from="H1" to="AI_ACT1" mapping_type="direct" confidence="0.9" gap="none"⟧ ⟦ADAPTATION_RECORD id="A1" reason="model can't access local spreadsheet" original="manual open file" adapted="file uploaded via API"⟧ ⟦AI_MODEL_BINDING id="B1" model="gpt-x" prompt_id="recon_v1" io_schema="invoice.csv,po.csv->reconciled.csv"⟧ ⟦VERIFICATION_ACCEPTANCE id="V1" method="row diff" expected="0 unmatched" pass_fail="TBD"⟧ ⟦EXCEPTION_ROLLBACK id="E1" trigger="schema mismatch" fallback="route to human review"⟧ ⟦/TASK_SCOPE⟧
| # | Delimiter | Purpose |
|---|---|---|
| 1 | TASK_SCOPE | Bounds the whole task: objective, constraints, acceptance criteria |
| 2 | HUMAN_STEP | One atomic human action |
| 3 | DECISION_GATE | Branch, approval, or conditional point |
| 4 | ARTIFACT_IO | Input/output artifact for a step or binding |
| 5 | MAPPING_RECORD | Links a human step/action to an AI action/function/prompt |
| 6 | TRANSITION_RECORD | Handoff or state change between steps, actors, or systems |
| 7 | ADAPTATION_RECORD | Required workflow change due to model/tool constraints |
| 8 | AI_MODEL_BINDING | Exact AI binding: model, prompt, tools, params, IO schema |
| 9 | VERIFICATION_ACCEPTANCE | Tests/checks proving AI output is acceptable |
| 10 | EXCEPTION_ROLLBACK | Failure handling, fallbacks, escalations, undo |
TASK_SCOPE
└── HUMAN_STEP
└── MAPPING_RECORD
└── TRANSITION_RECORD
└── MAPPING_RECORD
└── ADAPTATION_RECORD
└── MAPPING_RECORD
└── ADAPTATION_RECORD
└── TRANSITION_RECORD
└── MAPPING_RECORD
└── AI_MODEL_BINDING
└── VERIFICATION_ACCEPTANCE
└── EXCEPTION_ROLLBACK
This encodes: mapped and/or transitioned, then mapped and/or adapted (repeated as many times as needed), then bound to a model, then verified, then protected by a rollback.
Progress:
- Step 1: Define
TASK_SCOPE— objective, constraints, acceptance criteria - Step 2: Decompose the process into atomic
HUMAN_STEPrecords (one actor, one action, one input/output each — split anything with "and") - Step 3: Add
ARTIFACT_IOfor each step's inputs/outputs - Step 4: Create
MAPPING_RECORDlinking each human step to a candidate AI action; includesource_id,target_id,mapping_type,confidence,gap - Step 5: Insert
TRANSITION_RECORDwherever an actor/system handoff occurs (do NOT merge with mapping records) - Step 6: If the AI can't fully replicate the step, add an
ADAPTATION_RECORD(reason, original, adapted), then re-map with a newMAPPING_RECORD— repeat this map→adapt cycle as many times as needed, documenting each cycle separately - Step 7: Once stable, bind to infrastructure with
AI_MODEL_BINDING(model, prompt_id, tools, params, io_schema) - Step 8: Close with
VERIFICATION_ACCEPTANCEthat traces back to the original acceptance criteria inTASK_SCOPE - Step 9: Define
EXCEPTION_ROLLBACKupfront alongside the binding (never deferred to post-deployment) - Step 10: Validate — every tag has
id,parent,seq,version; every open tag has a matching close; no orphan records
For multi-task pipelines: wrap the whole pipeline in a master TASK_SCOPE, nest each sub-task as a child TASK_SCOPE with parent pointing to the master, and use TRANSITION_RECORD at every boundary where one child scope's output triggers the next.
For conditional branches: use DECISION_GATE with condition, evaluation_type (human/automated), and choices mapping each outcome to a distinct TRANSITION_RECORD → downstream TASK_SCOPE. Every choice listed must have a matching TRANSITION_RECORD destination.
Universal (every tag): id, parent, seq, version
MAPPING_RECORD specifically: source_id (or from), target_id (or to), mapping_type (direct/partial/proxy), confidence, gap
Example 1:
Input: "Human manually reconciles invoices in a spreadsheet. Give me the delimiters to map this to an AI workflow."
Output: The worked TASK_SCOPE/HUMAN_STEP/MAPPING_RECORD/ADAPTATION_RECORD/AI_MODEL_BINDING/VERIFICATION_ACCEPTANCE/EXCEPTION_ROLLBACK chain shown in Quick Start.
Example 2:
Input: "Data entry clerk reads PDF invoice attachments and types totals into a CRM."
Output: Full chain including two mapping records, a transition record (webhook trigger), one adaptation record (no desktop/CRM access), binding to gemini-2.5-pro with pdf_extraction_helper tool, JSON schema verification, and Slack-alert rollback.
Example 3:
Input: "Route support tickets: refunds ≥$500 need human compliance sign-off, <$500 auto-process."
Output: Master TASK_SCOPE → DECISION_GATE with two choices → two TRANSITION_RECORDs → two child TASK_SCOPEs (TS_HUMAN_REVIEW, TS_AUTO_PROCESS), each self-contained with its own verification/rollback, with the automated branch's rollback escalating upward to the human branch on failure.
- Keep
HUMAN_STEPatomic — one actor, one action, one input/output; split on "and" - Reference real
source_id/target_ideverywhere — no orphan records - Document every map→adapt cycle separately, even if repeated; never collapse history
- Close every chain with
VERIFICATION_ACCEPTANCEthat maps back toTASK_SCOPE.acceptance - Define
EXCEPTION_ROLLBACKat spec time, alongside the model binding — not post-deployment - Use reserved, content-safe delimiter tokens (
⟦...⟧,<<<...>>>) instead of###or--- - Validate bracket/tag balance before treating a spec as complete (see validation script pattern: track an open/close stack, flag orphan closes and unclosed blocks)
- For pipelines, isolate branch scopes — Branch A must never reference tokens/variables declared in Branch B
- Generic delimiters (
###,---) collide with body text/code — don't use them - Glossing over gaps — don't silently swap a human step for an AI one without an
ADAPTATION_RECORD - Conflating handoffs and mappings —
TRANSITION_RECORD(system/actor handoff) andMAPPING_RECORD(human↔AI functional alignment) are distinct; don't merge them - Delayed error handling — don't defer
EXCEPTION_ROLLBACKto "after launch"; define it with the binding - Ambiguous nesting — always verify every opening tag has exactly one matching closing tag before finalizing
- Missing universal fields — a tag without
id/parent/seq/versionfails the audit trail - Incomplete DECISION_GATE routing — every listed choice must resolve to a
TRANSITION_RECORDand downstream scope; unmatched choices are a validation failure