一键导入
ask
Accept an ordinary user question inside a DocMason workspace, route it to the right inner workflow, and preserve conversation-native logs automatically.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Accept an ordinary user question inside a DocMason workspace, route it to the right inner workflow, and preserve conversation-native logs automatically.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Answer a user question through DocMason's canonical grounded workflow using retrieval, provenance tracing, render escalation, and a final answer-state check.
Produce evidence-backed research, planning, drafting, or composition output from the published DocMason knowledge base while preserving provenance and answer-file discipline.
Stage, incrementally refresh, validate, and publish the DocMason knowledge base from the local source corpus.
Trace published DocMason knowledge objects or answer text back to evidence units and provenance records.
Retrieve ranked evidence bundles from the published DocMason knowledge base.
Prepare a DocMason repository for local operation by bootstrapping the environment, creating required directories, and recording runtime state.
| name | ask |
| description | Accept an ordinary user question inside a DocMason workspace, route it to the right inner workflow, and preserve conversation-native logs automatically. |
ask is the canonical skill at skills/canonical/ask/SKILL.md.
It is the user-facing top-level workflow for ordinary natural-language requests.
Use this skill as the default top-level workflow for a new ordinary user request in this workspace unless the request is clearly explicit operator work.
The user should be able to ask naturally. They should not need to name internal workflow IDs or repository mechanics first.
If the request is clearly an explicit setup, status, sync, adapter-maintenance, or operator-review request, switch to the matching top-level workflow instead of forcing it through ask.
ask itself remains the only ordinary natural-language front door, and a request counts as ordinary front-door execution only after it has been opened as a canonical ask turn under this workflow.Plan Mode or a similar host planning/collaboration mode should not discourage the host from opening canonical ask for an ordinary user request; if the current mode still blocks ask, the host should use a concise in-band alert or approval question and continue the same user task in the most natural available way rather than silently defaulting to operator-direct or side-path work.Canonical Ask Contract below for the exact ordinary-ask opening and completion rules. Generated adapter guidance may restate that contract, but it does not replace this workflow surface, and compatible hosts must use that supported entry surface rather than helper stitching, ad hoc probing, or direct lifecycle calls.retrieve or trace remain legal operator tools, but they do not complete the ordinary ask contract by themselves.ask owns front-door legality, same-turn governance, workspace gating, and routing.
The routed inner workflow owns the deeper evidence loop.
native turn means the host's own chat turn before DocMason opens canonical ask handling.canonical ask turn means the governed DocMason turn for the current request.runtime ownership means the current request has been opened into that canonical ask turn and is now governed by DocMason.native ledger means host-side audit capture that is not canonical ask truth by itself.interaction-ingest means the runtime holding area for reconciled host activity before any governed promotion.runtime/answers/, runtime/runs/, and runtime/logs/.workflow.json remains routing metadata. It does not define the executable host call contract.conversation_id, turn_id, run_id, answer_file_path, and log_contextfront_door_state = canonical-askcat <<'JSON' | ./.venv/bin/python -m docmason _ask
{ ...payload... }
JSON
openprogressfinalizeopen request envelope:{
"action": "open",
"question": "<user question>",
"host_provider": "<provider>",
"host_thread_ref": "<stable host thread ref>",
"host_identity_source": "<host identity source>",
"semantic_analysis": {
"question_class": "answer",
"question_domain": "workspace-corpus",
"route_reason": "<one concise reason>"
}
}
semantic_analysis is best-effort. For an ordinary native Codex ask, question_class, question_domain, and one concise route_reason are usually enough.question_class chooses workflow shape. It is not a difficulty score: use answer for a direct answer, explanation, or source-backed summary; use composition for a new evidence-backed work product or synthesis; use retrieval, provenance, or runtime-review only for explicit evidence, citation, or runtime-review requests.question_domain chooses evidence basis. It is not a mirror of question_class: prefer workspace-corpus, external-factual, or general-stable when one of those is the real basis, and reserve composition for composition-shaped evidence planning rather than setting it merely because question_class = composition.question_class = composition with question_domain = workspace-corpus.open normalizes missing supported routing fields, derives defaults such as support_strategy, and may refine reference resolution or workspace notices from repository truth..venv is available, call hidden open directly with best-effort semantic_analysisCODEX_THREAD_ID identity from the execution environment; do not hand-fill placeholder host thread references such as codex-desktop-thread or codex-native-threadworkspace-status, workspace-bootstrap, source search, implementation source, or tests first just to decide whether canonical ask may open, whether a named source exists, or which semantic_analysis fields are acceptedopen returns a governed blocker, waiting state, or explicit operator routeopen, preserve the returned conversation_id, turn_id, run_id, answer_file_path, log_context, and support_contract for the rest of the same canonical ask turn.execute means canonical ask is open and the host should continue through the chosen inner workflow.awaiting-confirmation means pause the same turn and wait for the user's confirmation reply.awaiting-user-decision means pause the current work for a material decision that only
the user can authorize. It never implies a timeout, default, or skip.waiting-shared-job means pause the same turn and wait for governed shared-job settlement.completed means the turn is committed and a final business answer may be returned.boundary means the turn is committed as a governed boundary and that boundary reply may be returned.blocked means no final business answer may be returned yet.next_step is a derived convenience field and should stay aligned with that status law:
execute -> continue-inner-workflowawaiting-confirmation -> wait-for-user-confirmationawaiting-user-decision -> wait-for-user-decisionwaiting-shared-job -> wait-for-shared-jobcompleted -> return-final-answerboundary -> return-boundary-answerblocked -> do-not-return-final-answerresult_explanation is a derived convenience field, not a new truth surface.
result_explanation.show_to_user = true for a blocker or evidence boundary, translate its summary, why, and next_step into one concise user-facing explanation in the user's language.user_status_line.show_to_user = false, do not add extra result-explanation prose.result_explanation text into the canonical answer markdown.admissibility_repair is present only for same-turn repairable finalize failures.
open or same-turn reuse already performs governed preanswer work:
open, treat the returned status, question_class, question_domain, analysis_origin, route_reason, inner_workflow_id, support_strategy, reference_resolution, source_scope_policy, support_contract, and notices as the source of truth for the next step. Do not re-derive them from side-path probing before honoring that result.docmason retrieve or docmason trace inside the same canonical ask turn, export each returned log_context field as DOCMASON_<FIELD> and then call the public command normally--json --compact for interactive inspection; if full nested retrieve or trace detail is genuinely needed, redirect full --json to a local file and inspect it selectively instead of loading the raw payload straight into the live chat contextjq assumptions such as .matchessession_idresultsreference_resolutionsource_scope_policytrace_idsession_idanswer_statereference_resolutionsource_scope_policyissue_codesprepare_ask_turn(), complete_ask_turn(), or trace_answer_file(...) as a substitute for the supported pathexport DOCMASON_CONVERSATION_ID="<conversation_id>"
export DOCMASON_TURN_ID="<turn_id>"
export DOCMASON_RUN_ID="<run_id>"
export DOCMASON_ENTRY_WORKFLOW_ID="ask"
export DOCMASON_INNER_WORKFLOW_ID="<inner_workflow_id>"
export DOCMASON_FRONT_DOOR_STATE="canonical-ask"
./.venv/bin/python -m docmason retrieve "<query>" --json --compact
./.venv/bin/python -m docmason trace --answer-file "<answer_file_path>" --json --compact
progress request envelope:{
"action": "progress",
"conversation_id": "<conversation_id>",
"turn_id": "<turn_id>",
"completion_status": "covered | blocked",
"hybrid_refresh_summary": { "...": "..." }
}
{
"action": "progress",
"conversation_id": "<conversation_id>",
"turn_id": "<turn_id>",
"decision_frontier": {
"class": "judgment-authority-gap | high-cost-expression-choice",
"question": "<material decision question>",
"why_user_is_required": "<why evidence and reasoning cannot decide it>",
"evidence_boundary": "<what evidence establishes and cannot decide>",
"options": [
{
"id": "<stable option id>",
"label": "<short label>",
"impact": "<real downstream consequence>",
"recommended": true
},
{
"id": "<stable option id>",
"label": "<short label>",
"impact": "<real downstream consequence>",
"recommended": false
}
],
"affected_outputs": ["<specific model or artifact scope>"],
"invalidates": []
}
}
A legal gate has two or three real options, explains their downstream impact, marks exactly one current recommendation, and names the affected output scope. Do not persist a vague or non-material question.
After progress returns awaiting-user-decision, present the same gate through the host's
native Plan or structured-input UI, without a timeout or default, and wait. If no such UI is
available, ask the one material question concisely in-band.
The user's answer opens a new linked turn with continuation_type=decision-resolution, the
exact gate_id as resolves_gate_id, and either one legal option_id or a non-empty
free_form decision. Never settle the old turn in place or reinterpret an unrelated message
as consent.
completion_status is optional when the caller is only re-entering a waiting-shared-job turn to let the hidden wrapper reconcile deterministic repo-owned shared-job truth.
supply completion_status only when the host is actively settling a still-unsettled governed multimodal refresh.
when the current-turn hybrid_refresh_work.json lists render or focus-render assets and the host can inspect images, inspect the relevant assets lightly and include render_inspection_used plus inspected_render_assets in hybrid_refresh_summary.
when a turn is paused in waiting-shared-job, re-enter through hidden open reuse, hidden progress, or hidden finalize; do not grep runtime/control_plane/ or shared-job files manually.
finalize request envelope:
{
"action": "finalize",
"conversation_id": "<conversation_id>",
"turn_id": "<turn_id>",
"answer_text": "<exact final business answer>",
"answer_file_path": "<answer_file_path>",
"response_excerpt": "<short excerpt>",
"session_ids": ["<selected_session_id>"],
"trace_ids": ["<selected_trace_id>"],
"workflow_outcome": {
"support_basis": "kb-grounded | mixed | external-source-verified | model-knowledge | governed-boundary",
"session_ids": ["<selected_session_id>"],
"trace_ids": ["<selected_trace_id>"],
"bundle_paths": ["<composition bundle path>"]
}
}
answer_text is the preferred terminal input. The wrapper writes it atomically to the
canonical answer path, binds the exact digest, reuses only a digest-matching trace, and runs
one exact trace when necessary. The successful response keeps answer_text clean and returns
one separate user_status_line; internal IDs and support state remain in governance_detail.
When the exact final answer is already present at answer_file_path, callers may omit
answer_text and use the file-based handshake below.
session_ids and trace_ids are optional advanced-caller fields. Omit them when the turn has exactly one ask-owned retrieve session and one final trace candidate. Supply them only when the caller has already selected the canonical pair among multiple ask-owned candidates.
workflow_outcome is the preferred finalize-time handoff for workflow-owned facts. Supply it when the inner workflow already knows the correct support_basis, selected session_ids / trace_ids, support-manifest linkage, bundle linkage, or bounded degradation metadata. Older callers may keep using the compatible top-level finalize fields.
Legal closure handshake for one canonical ask turn:
./.venv/bin/python -m docmason trace --answer-file "<answer_file_path>" --json --compact
cat <<'JSON' | ./.venv/bin/python -m docmason _ask
{
"action": "finalize",
"conversation_id": "<conversation_id>",
"turn_id": "<turn_id>",
"answer_file_path": "<answer_file_path>",
"response_excerpt": "<short excerpt>"
}
JSON
completed or boundary permits a final business reply to the userexecute, awaiting-confirmation, awaiting-user-decision,
waiting-shared-job, and blocked do notIf the environment cannot satisfy those capabilities, stop and explain the blocker instead of improvising.
ask turn, and run steps 2 through 4 as the governed open or same-turn reuse phase before any inner workflow execution.
Canonical Ask Contract.
open, form a thin agent-authored work_brief from the user's actual goal
and medium; include only fields that matter for this turn: deliverable and use, audience,
in/out scope, success criteria, distinctions that must survive, named evidence and
exemplars, confirmed method/storyline/expression grammar, and high-cost artifact risksemantic_analysis; keep one concise route_reason, and
set needs_latest_workspace_state only when fresh local workspace truth is
actually required, and include compact evidence_requirements only when the question
needs channel guidancerevision_of turn id and
the narrow continuation_type, revision_scope, and affected_outputs; adjacency in the
same chat is not sufficient authority to inherit evidence or accepted scopesresolves_gate_id plus either a
legal option_id from that gate or an explicit non-empty free_form decision; do not
reinterpret arbitrary later text as gate approvalopen normalize supported routing fields, resolve user-native source references when the user names a document, path, page, slide, sheet, heading, or similar locator, and return the governed turn bindingopen or same-turn reuse, let the governed ask path choose the smallest evidence basis that can support the answer correctly and truthfully before deeper workflow execution.
workspace-corpus -> KB-firstcomposition -> KB-first with explicit evidence planningexternal-factual -> web-firstgeneral-stable -> model knowledge when the boundary is explicitopen, check workspace state only when the answer really depends on workspace truth.
runtime/bootstrap_state.json as the cached readiness markerself-contained
self-contained means the repo-local steady-state runtime is trusted for ordinary ask workmixed or degraded, let the ask helper repair or surface the governed boundary instead of answering from a partially trusted runtimeknowledge-base-sync instead of bluffing a workspace-grounded answeroriginal_doc/ rather than git-tracked repo searchawaiting-confirmation
yes or no replies as approve or decline
yes continues the same taskno commits the same turn as abstained + governed-boundaryprepared, awaiting-confirmation, or waiting-shared-job, prefer reusing that governed state over rerunning shared-state mutationwaiting-shared-job or awaiting-confirmation, do not bypass the governed path by answering from original_doc/, knowledge_base/staging/, or .staging-buildstatus = execute, let the canonical ask turn continue through the narrowest ask-routed inner workflow that matches the ask.
workspace-bootstrap or knowledge-base-sync, honor that governed state first instead of forcing one of the ask-routed evidence workflowsgrounded-answergrounded-compositionretrieval-workflowprovenance-traceruntime-log-reviewretrieve, trace, raw-source inspection, or internal helper probing may support that live turn, but they do not replace canonical ask ownership or its completion rulesfocus_render_assets or render spans when the question is genuinely visual or layout-sensitive, and only then consider governed refresh or source fallbacksupport_contract:
work_brief, revision lineage, accepted scopes, and turn
evidence packet before deciding whether evidence work is necessaryevidence-gap, reasoning-uncertainty, and
judgment-authority-gap: solve the first two autonomously; persist a decision gate only
for the third or for a genuinely expensive expression choiceconstraint-update and evidence-neutral decision-resolution, inherit legal evidence,
skip sync and retrieval, preserve unrelated accepted scopes, retrace only the exact revised
answer or artifact, and finalizeaccepted_by_user: true; reopen it only after explicit user authority with
reopened_by_user: true. Dependency drift marks a scope at-risk but never silently
reopens or replaces itevidence-refresh or mixed, retrieve only the evidence delta and invalidate only
explicitly affected or dependency-linked outputsprogresscovered settlement, rerun retrieve and trace exactly on the post-refresh evidence; if the result is commit-admissible but still only partially supported, finalize honestly as partially-grounded instead of starting a second refreshruntime/answers/<conversation_id>/<turn_id>.mdruntime/agent-work/ when neededCanonical Ask Contract: run the final trace on the exact answer-file version, then call hidden finalize, passing selected artifact IDs only when the turn is ambiguousstatus = execute with a repairable support_fulfillment, keep the same turn open, do one contract-aware rewrite and retrace, then finalize once moreanswer_state, support_basis, optional support_manifest_path, and linked session or trace IDsanswer_text unchanged, followed outside the artifact by exactly one
concise completion line; use user_status_code as the stable meaning and render the line
naturally in the user's language (completed-and-verified or
completed-with-evidence-boundary)governance_detail only for blockers, evidence boundaries, diagnostics, or explicit
user inspection; never append trace IDs, manifest paths, repair codes, or release-entry
notices to a successful copy-ready artifactexternal-source-verified, model-knowledge, or governed-boundary outcomes as product failures just because the KB path was not fully grounded.original_doc/ or rerender source files by reflex.grounded-answer and grounded-composition remain inner specialist workflows.