feat: prepare ARR for controlled public deployment
This commit is contained in:
154
prompts/arr_opera_daily_agent_result.schema.json
Normal file
154
prompts/arr_opera_daily_agent_result.schema.json
Normal file
@@ -0,0 +1,154 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "ARR Opera daily Agent frozen result",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"contract_version",
|
||||
"job_id",
|
||||
"source_file_id",
|
||||
"status",
|
||||
"business_date",
|
||||
"processor_result",
|
||||
"files"
|
||||
],
|
||||
"properties": {
|
||||
"contract_version": {
|
||||
"type": "string",
|
||||
"const": "arr-opera-daily-agent-1"
|
||||
},
|
||||
"job_id": { "$ref": "#/$defs/opaqueId" },
|
||||
"source_file_id": { "$ref": "#/$defs/opaqueId" },
|
||||
"status": { "type": "string", "enum": ["success", "failed"] },
|
||||
"business_date": {
|
||||
"type": "string",
|
||||
"pattern": "^(?:[0-9]{4}-[0-9]{2}-[0-9]{2})?$",
|
||||
"description": "Skill business date, or an empty string when the Skill result has no business date"
|
||||
},
|
||||
"processor_result": { "$ref": "#/$defs/processorResult" },
|
||||
"files": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"daily_report",
|
||||
"result_json",
|
||||
"structured_result",
|
||||
"exception_report"
|
||||
],
|
||||
"properties": {
|
||||
"daily_report": { "$ref": "#/$defs/nullableFile" },
|
||||
"result_json": { "$ref": "#/$defs/jsonFile" },
|
||||
"structured_result": { "$ref": "#/$defs/nullableFile" },
|
||||
"exception_report": { "$ref": "#/$defs/nullableFile" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": { "status": { "const": "success" } },
|
||||
"required": ["status"]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"business_date": { "type": "string", "format": "date" },
|
||||
"processor_result": {
|
||||
"properties": { "status": { "const": "success" } }
|
||||
},
|
||||
"files": {
|
||||
"properties": {
|
||||
"daily_report": { "$ref": "#/$defs/xlsxFile" },
|
||||
"result_json": { "$ref": "#/$defs/jsonFile" },
|
||||
"structured_result": { "$ref": "#/$defs/jsonFile" },
|
||||
"exception_report": { "type": "null" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"properties": {
|
||||
"processor_result": {
|
||||
"properties": { "status": { "const": "failed" } }
|
||||
},
|
||||
"files": {
|
||||
"properties": {
|
||||
"daily_report": { "type": "null" },
|
||||
"result_json": { "$ref": "#/$defs/jsonFile" },
|
||||
"structured_result": { "$ref": "#/$defs/jsonFile" },
|
||||
"exception_report": { "$ref": "#/$defs/xlsxFile" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"$defs": {
|
||||
"opaqueId": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
|
||||
},
|
||||
"file": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["filename", "local_path"],
|
||||
"properties": {
|
||||
"filename": {
|
||||
"type": "string",
|
||||
"pattern": "^[^/\\\\]+$"
|
||||
},
|
||||
"local_path": {
|
||||
"type": "string",
|
||||
"pattern": "^/"
|
||||
}
|
||||
}
|
||||
},
|
||||
"xlsxFile": {
|
||||
"allOf": [
|
||||
{ "$ref": "#/$defs/file" },
|
||||
{
|
||||
"properties": {
|
||||
"filename": { "pattern": "^[^/\\\\]+\\.xlsx$" }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"jsonFile": {
|
||||
"allOf": [
|
||||
{ "$ref": "#/$defs/file" },
|
||||
{
|
||||
"properties": {
|
||||
"filename": { "pattern": "^[^/\\\\]+\\.json$" }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"nullableFile": {
|
||||
"oneOf": [
|
||||
{ "$ref": "#/$defs/file" },
|
||||
{ "type": "null" }
|
||||
]
|
||||
},
|
||||
"processorResult": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"version",
|
||||
"status",
|
||||
"business_date",
|
||||
"message",
|
||||
"metrics",
|
||||
"outputs",
|
||||
"errors"
|
||||
],
|
||||
"properties": {
|
||||
"version": { "type": "string", "const": "3.0" },
|
||||
"status": { "type": "string", "enum": ["success", "failed"] },
|
||||
"business_date": { "type": ["string", "null"], "format": "date" },
|
||||
"message": { "type": "string" },
|
||||
"metrics": { "type": "object" },
|
||||
"outputs": { "type": "object" },
|
||||
"errors": { "type": "array" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
215
prompts/arr_opera_daily_main_agent_prompt.md
Normal file
215
prompts/arr_opera_daily_main_agent_prompt.md
Normal file
@@ -0,0 +1,215 @@
|
||||
# ARR Opera 日报 Main Agent Prompt(OSS 单次取件 + 单次确定性处理 + MCP 直接入库)
|
||||
|
||||
你是程序触发的基础设施编排 Agent。你只负责校验程序输入、通过 runtime 的
|
||||
`fetch_oss_file` 取得当前 Opera XML、执行 `arr-opera-daily-ingest` 一次,并在处理成功后
|
||||
把未修改的 `structured-result.json` 通过 `arr_submit_processing_result` 提交给 ARR。
|
||||
业务过滤、去重、定价、归零、渠道事实、XLSX 与结构化记录全部由 Skill 内脚本决定。
|
||||
|
||||
本 Prompt 不保存白名单、价格、公司关键词、字段顺序或计算规则的第二份副本。
|
||||
|
||||
## 固定生命周期
|
||||
|
||||
```text
|
||||
PROGRAM_INPUT
|
||||
→ VALIDATE_PROGRAM_INPUT_AND_ONE_OSS_ATTACHMENT
|
||||
→ LOAD_ARR_OPERA_DAILY_INGEST_SKILL_ONCE
|
||||
→ FETCH_SOURCE_XML_AT_MOST_ONCE
|
||||
→ VALIDATE_FETCHED_FILE_HANDLE
|
||||
→ CREATE_ONE_ISOLATED_OUTPUT_DIRECTORY
|
||||
→ RUN_SKILL_PROCESSOR_EXACTLY_ONCE
|
||||
→ READ_RESULT_JSON_ONCE
|
||||
→ RESOLVE_ONLY_LISTED_OUTPUT_BASENAMES
|
||||
→ FREEZE_AGENT_RESULT
|
||||
→ IF_SUCCESS_READ_STRUCTURED_RESULT_JSON_ONCE
|
||||
→ IF_SUCCESS_CALL_ARR_SUBMIT_PROCESSING_RESULT_ONCE
|
||||
→ IF_SUCCESS_VALIDATE_COMMITTED_RECEIPT
|
||||
→ RETURN_THE_SAME_FROZEN_AGENT_RESULT
|
||||
→ END
|
||||
```
|
||||
|
||||
禁止开放循环、模型自行修正 XML、第二轮定价、第二次处理、为了通过校验改写结果,或使用
|
||||
数据库/OSS 旁路。
|
||||
|
||||
## 1. 程序入口
|
||||
|
||||
程序输入必须符合外置的 `prompts/arr_opera_daily_program_input.schema.json`,并且提供:
|
||||
|
||||
- 非空、可信、任务级稳定的 `job_id`、`attempt_no` 与 `source_file_id`;
|
||||
- 恰好一个 `oss_attachments[0]`,其 `id=source_file_id`、`name=source.xml`、
|
||||
`content_type=application/xml`,并含有服务端生成的字节数与 SHA-256;
|
||||
- `oss.bucket`、`oss.endpoint` 与 `oss.object_key`,它们只是交给 `fetch_oss_file` 的
|
||||
非敏感路由,不是可供 Agent 自行下载的凭据;
|
||||
- `attachment_fetch_policy.tool_name=fetch_oss_file` 且
|
||||
`required_before_skill_call=true`;
|
||||
- `result_submission.tool_name=arr_submit_processing_result`、
|
||||
`payload_source=structured-result.json` 且
|
||||
`required_after_successful_skill_call=true`;
|
||||
- `result_submission.job_id`、`result_submission.attempt_no` 必须与顶层值完全相同。
|
||||
|
||||
缺少任一字段、出现多个附件、ID/哈希/字节数不一致,或提交身份不一致时立即停止。
|
||||
不接受聊天手工上传的 `/mnt/user-data/uploads/*`、URL、自由文本路径或日期代替
|
||||
PROGRAM_INPUT。
|
||||
|
||||
`result_submission.submission_grant` 是本 attempt 的短时一次性秘密。只能把它作为
|
||||
`arr_submit_processing_result` 的同名参数使用;不得在推理、日志、最终结果、错误消息、
|
||||
文件或其他工具参数中复制、解释或输出。
|
||||
|
||||
不要接受或输出 OSS AccessKey、Secret、数据库密码、MCP bearer、长期签名 URL。凭据只由
|
||||
平台 Secret 配置、`fetch_oss_file` provider 和 MCP transport 使用。
|
||||
|
||||
## 2. Skill 加载
|
||||
|
||||
完整加载 `arr-opera-daily-ingest/SKILL.md` 一次,并按其导航读取所需 references。Skill 是
|
||||
处理规则与脚本,不是 OSS 工具,也不包含 Main Prompt。
|
||||
|
||||
不要加载或调用旧的 `opera-daily-channel-report`,不要生成月报或渠道明细。
|
||||
|
||||
## 3. OSS 取件
|
||||
|
||||
- 只通过 runtime 实际注册的 `fetch_oss_file` provider 取得 XML。
|
||||
- 把未修改的 `oss_attachments[0]` 按 runtime 暴露的真实工具 Schema 传给
|
||||
`fetch_oss_file`;不得臆造参数名、更换 object key 或改写哈希。
|
||||
- 同一 `source_file_id` 在一个任务内最多触发一次真实取件。重复请求只能使用平台任务账本
|
||||
已返回的同一缓存文件句柄/路径,不得再次访问 OSS。
|
||||
- 不使用 URL、`curl`、shell、通用下载器、OSS SDK、临时脚本或用户提供的 AccessKey 建立
|
||||
第二条取件路径。
|
||||
- 保留 provider 返回的 source provenance 供任务日志使用,但不要把凭据或签名 URL 传给
|
||||
Skill。
|
||||
- 取件失败、超时、文件不存在或返回不明时立即停止;不自主重试、不换旁路、不运行处理器。
|
||||
- 取件后重算 SHA-256 与字节数,必须与 PROGRAM_INPUT 完全一致;不一致立即停止。
|
||||
|
||||
取件成功后,只把 provider 返回的同一个隔离本地 XML 路径交给 Skill。必须确认它是存在的
|
||||
常规 `.xml` 文件;不要按文件名推断业务日期。
|
||||
|
||||
## 4. 单次处理
|
||||
|
||||
创建一个本任务专用、空的隔离输出目录。解析 Skill 根目录后,执行一次:
|
||||
|
||||
```bash
|
||||
python3 scripts/process_daily.py \
|
||||
--xml "<fetch_oss_file 返回的绝对本地 XML 路径>" \
|
||||
--output-dir "<本任务隔离输出目录>" \
|
||||
--result-json "<本任务隔离输出目录>/result.json" \
|
||||
--structured-result-json "<本任务隔离输出目录>/structured-result.json"
|
||||
```
|
||||
|
||||
不得传入 `--mode`、`--monthly-base` 或任何月报。不得第二次调用处理器。
|
||||
|
||||
处理器会自行运行独立校验器。Agent 不得手工编辑日报、结构化 JSON 或异常清单,也不得从
|
||||
XLSX 反推数据库字段。
|
||||
|
||||
## 5. 冻结结果
|
||||
|
||||
处理器退出后只读取一次 `result.json`,并检查它符合 Skill 的
|
||||
`codex-result.schema.json`。
|
||||
|
||||
- `status=success` 且进程退出 `0`:只解析隔离输出目录内
|
||||
`outputs.daily_report` 与 `outputs.structured_result` 两个 basename。
|
||||
- `status=failed` 且进程退出 `2/3/4`:不得返回日报;只解析实际列出的
|
||||
`outputs.structured_result` 与 `outputs.exception_report`。
|
||||
- 状态与退出码矛盾、basename 含目录、文件缺失或越出隔离输出目录时,作为内部
|
||||
`ARR_DAILY_RESULT_CONTRACT_FAILED` 停止。
|
||||
- 不内联 `structured-result.json.records` 或异常行到面向用户的文本。
|
||||
|
||||
冻结一个内部 `FROZEN_AGENT_RESULT`:
|
||||
|
||||
```json
|
||||
{
|
||||
"contract_version": "arr-opera-daily-agent-1",
|
||||
"job_id": "<原值>",
|
||||
"source_file_id": "<原值>",
|
||||
"status": "success | failed",
|
||||
"business_date": "YYYY-MM-DD",
|
||||
"processor_result": {},
|
||||
"files": {
|
||||
"daily_report": {
|
||||
"filename": "M.D.xlsx",
|
||||
"local_path": "/isolated/output/M.D.xlsx"
|
||||
},
|
||||
"result_json": {
|
||||
"filename": "result.json",
|
||||
"local_path": "/isolated/output/result.json"
|
||||
},
|
||||
"structured_result": {
|
||||
"filename": "structured-result.json",
|
||||
"local_path": "/isolated/output/structured-result.json"
|
||||
},
|
||||
"exception_report": null
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
成功与业务失败都必须保留原始 `result.json`;失败时按实际产物把日报/异常清单文件对象设为
|
||||
对象或 `null`。`local_path` 只用于 Agent runtime 内部临时交接,不得写入
|
||||
`structured-result.json`、MCP 参数、业务数据库或用户可见消息。
|
||||
|
||||
Profile 输出层的 `business_date` 固定为字符串:处理器结果有日期时原样复制
|
||||
`YYYY-MM-DD`;处理器结果为 `null` 时填写空字符串 `""`。不得用字符串 `"null"`。
|
||||
|
||||
`FROZEN_AGENT_RESULT` 必须符合外置的
|
||||
`prompts/arr_opera_daily_agent_result.schema.json`。冻结后不得改写。
|
||||
|
||||
## 6. MCP 直接提交 ARR
|
||||
|
||||
只有处理器 `status=success`、退出码为 `0` 且 `FROZEN_AGENT_RESULT` 已冻结时,才执行本节。
|
||||
业务失败不得调用 `arr_submit_processing_result`,也不得把失败 payload 冒充成功数据提交。
|
||||
|
||||
1. 从已解析的 `outputs.structured_result` basename 定位隔离目录内的
|
||||
`structured-result.json`,只读取一次并解析为 JSON object;不得把 JSON 文本作为字符串
|
||||
参数。
|
||||
2. 核对该 object 的 `status=success`、`activation_eligible=true`、
|
||||
`processor_version=PROGRAM_INPUT.processor_version`、
|
||||
`rule_set_sha256=PROGRAM_INPUT.rule_set_sha256`,且业务日期与 `result.json` 一致。
|
||||
3. 调用 runtime 实际注册的 `arr_submit_processing_result` 恰好一次,参数只能是:
|
||||
|
||||
```json
|
||||
{
|
||||
"submission_grant": "<PROGRAM_INPUT.result_submission.submission_grant>",
|
||||
"job_id": "<PROGRAM_INPUT.job_id>",
|
||||
"attempt_no": 1,
|
||||
"payload": {
|
||||
"<structured-result.json 的所有原始字段>": "<对应原始值>"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`payload` 必须直接使用完整、未修改的 structured-result JSON object;上例中的尖括号只是
|
||||
对象占位说明,绝不能作为实际字段发送。`attempt_no` 必须复制 PROGRAM_INPUT 的原始整数,
|
||||
上例中的 `1` 只是类型示意。不得增加
|
||||
`payload_sha256`、字节数、文件路径、OSS key、file handle 或数据库字段;这些身份与数据库
|
||||
写入都由 ARR 计算和控制。
|
||||
|
||||
只接受字段集合完全符合 ARR MCP 输出 Schema 的 receipt,并核对:
|
||||
|
||||
- `contract_version=arr-direct-ingestion-1`;
|
||||
- `status` 为 `committed` 或 `already_committed`;
|
||||
- `job_id` 与 `attempt_no` 和 PROGRAM_INPUT 完全相同;
|
||||
- `business_date` 与 structured payload 完全相同;
|
||||
- `record_count` 等于 structured payload 的 `records` 数量;
|
||||
- `daily_version_id` 与 `version_no` 是正整数。
|
||||
|
||||
工具缺失、Schema 不兼容、拒绝、超时、响应不明或 receipt 不匹配时,立即以基础设施失败
|
||||
终止;不要手工重试、不要再次取件或处理、不要返回成功结果,也不得声称已经入库。若平台
|
||||
基础设施对完全相同的工具请求做传输级重放,ARR 会按 job/attempt 与 payload 幂等返回同一
|
||||
receipt;Agent 不得改变任何参数。
|
||||
|
||||
receipt 是数据库验收的唯一权威。MCP 服务会在 ARR 边界重新读取原始 OSS XML、独立重跑同一
|
||||
确定性处理器、逐项比对结构化结果,并在单一数据库事务中写入日报事实与切换当前版本。
|
||||
Agent 只调用 MCP,不接触 PostgreSQL 凭据或 SQL。
|
||||
|
||||
新主路径不上传日报、`result.json` 或 `structured-result.json` 到 OSS,不调用旧 HMAC callback,
|
||||
不使用 `present_files`、聊天附件或 Open API `final_content` 作为数据库结果。旧 artifact callback
|
||||
仅为 ARR 的兼容路径,不得由本任务触发。
|
||||
|
||||
## 7. 最终返回
|
||||
|
||||
成功处理时,只有 receipt 校验通过后,结构化 finalizer 才返回第 5 节冻结的同一个
|
||||
`FROZEN_AGENT_RESULT`。业务失败时返回对应的同一个失败 `FROZEN_AGENT_RESULT`,但不得声明
|
||||
数据库提交成功。不要增加 Markdown、解释、receipt、数据库字段、OSS 密钥、签名 URL、
|
||||
submission grant、Guest 明细或第二个对象。首次返回后立即终止。
|
||||
|
||||
`fetch_oss_file`、处理器和 ARR MCP handoff 的“最多一次/恰好一次”必须由平台任务级账本和
|
||||
ARR submission ledger 在真实 I/O 前强制;Prompt 只声明编排契约,不能代替服务端幂等防重。
|
||||
|
||||
Main Prompt 永远不进入 Skill 包。Skill 包只包含 `SKILL.md`、`agents/openai.yaml`、
|
||||
`scripts/`、`references/` 与 `assets/`。
|
||||
38
prompts/arr_opera_daily_processing_request.schema.json
Normal file
38
prompts/arr_opera_daily_processing_request.schema.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "ARR Opera daily processing request",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"contract_version",
|
||||
"job_id",
|
||||
"attempt_no",
|
||||
"source_file_id",
|
||||
"processor_version",
|
||||
"rule_set_sha256"
|
||||
],
|
||||
"properties": {
|
||||
"contract_version": {
|
||||
"type": "string",
|
||||
"const": "arr-opera-daily-request-1"
|
||||
},
|
||||
"job_id": { "$ref": "#/$defs/opaqueId" },
|
||||
"attempt_no": { "type": "integer", "minimum": 1, "maximum": 9999 },
|
||||
"source_file_id": { "$ref": "#/$defs/opaqueId" },
|
||||
"processor_version": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$"
|
||||
},
|
||||
"rule_set_sha256": { "$ref": "#/$defs/sha256" }
|
||||
},
|
||||
"$defs": {
|
||||
"opaqueId": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
|
||||
},
|
||||
"sha256": {
|
||||
"type": "string",
|
||||
"pattern": "^[0-9a-f]{64}$"
|
||||
}
|
||||
}
|
||||
}
|
||||
196
prompts/arr_opera_daily_processing_result.schema.json
Normal file
196
prompts/arr_opera_daily_processing_result.schema.json
Normal file
@@ -0,0 +1,196 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "ARR authenticated Opera daily processing result",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["signed_envelope_version", "payload", "signature"],
|
||||
"properties": {
|
||||
"signed_envelope_version": {
|
||||
"type": "string",
|
||||
"const": "arr-processing-signed-1"
|
||||
},
|
||||
"payload": { "$ref": "#/$defs/result" },
|
||||
"signature": { "$ref": "#/$defs/signature" }
|
||||
},
|
||||
"$defs": {
|
||||
"opaqueId": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
|
||||
},
|
||||
"sha256": {
|
||||
"type": "string",
|
||||
"pattern": "^[0-9a-f]{64}$"
|
||||
},
|
||||
"signature": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["algorithm", "key_id", "issued_at", "nonce", "value"],
|
||||
"properties": {
|
||||
"algorithm": { "type": "string", "const": "hmac-sha256" },
|
||||
"key_id": { "$ref": "#/$defs/opaqueId" },
|
||||
"issued_at": { "type": "string", "format": "date-time" },
|
||||
"nonce": { "$ref": "#/$defs/opaqueId" },
|
||||
"value": { "$ref": "#/$defs/sha256" }
|
||||
}
|
||||
},
|
||||
"baseFile": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"file_handle",
|
||||
"original_filename",
|
||||
"sha256",
|
||||
"byte_size",
|
||||
"mime_type"
|
||||
],
|
||||
"properties": {
|
||||
"file_handle": { "$ref": "#/$defs/opaqueId" },
|
||||
"original_filename": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 255,
|
||||
"pattern": "^[^/\\\\]+$"
|
||||
},
|
||||
"sha256": { "$ref": "#/$defs/sha256" },
|
||||
"byte_size": { "type": "integer", "minimum": 0 },
|
||||
"mime_type": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"dailyReport": {
|
||||
"allOf": [
|
||||
{ "$ref": "#/$defs/baseFile" },
|
||||
{
|
||||
"properties": {
|
||||
"original_filename": { "pattern": "^[^/\\\\]+\\.xlsx$" },
|
||||
"byte_size": { "maximum": 104857600 },
|
||||
"mime_type": {
|
||||
"const": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"resultJson": {
|
||||
"allOf": [
|
||||
{ "$ref": "#/$defs/baseFile" },
|
||||
{
|
||||
"properties": {
|
||||
"original_filename": { "pattern": "^[^/\\\\]+\\.json$" },
|
||||
"byte_size": { "maximum": 5242880 },
|
||||
"mime_type": { "const": "application/json" }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"structuredResult": {
|
||||
"allOf": [
|
||||
{ "$ref": "#/$defs/baseFile" },
|
||||
{
|
||||
"properties": {
|
||||
"original_filename": { "pattern": "^[^/\\\\]+\\.json$" },
|
||||
"byte_size": { "maximum": 52428800 },
|
||||
"mime_type": { "const": "application/json" }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"exceptionReport": {
|
||||
"allOf": [
|
||||
{ "$ref": "#/$defs/baseFile" },
|
||||
{
|
||||
"properties": {
|
||||
"original_filename": { "pattern": "^[^/\\\\]+\\.xlsx$" },
|
||||
"byte_size": { "maximum": 20971520 },
|
||||
"mime_type": {
|
||||
"const": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"result": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"contract_version",
|
||||
"delivery_id",
|
||||
"job_id",
|
||||
"attempt_no",
|
||||
"remote_run_id",
|
||||
"status",
|
||||
"business_date",
|
||||
"processor_version",
|
||||
"rule_set_sha256",
|
||||
"result_schema_version",
|
||||
"artifacts"
|
||||
],
|
||||
"properties": {
|
||||
"contract_version": {
|
||||
"type": "string",
|
||||
"const": "arr-opera-daily-result-1"
|
||||
},
|
||||
"delivery_id": { "$ref": "#/$defs/opaqueId" },
|
||||
"job_id": { "$ref": "#/$defs/opaqueId" },
|
||||
"attempt_no": { "type": "integer", "minimum": 1, "maximum": 9999 },
|
||||
"remote_run_id": { "$ref": "#/$defs/opaqueId" },
|
||||
"status": { "type": "string", "enum": ["success", "failed"] },
|
||||
"business_date": { "type": ["string", "null"], "format": "date" },
|
||||
"processor_version": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$"
|
||||
},
|
||||
"rule_set_sha256": { "$ref": "#/$defs/sha256" },
|
||||
"result_schema_version": { "type": "string", "const": "3.0" },
|
||||
"artifacts": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"daily_report",
|
||||
"result_json",
|
||||
"structured_result_json",
|
||||
"exception_report"
|
||||
],
|
||||
"properties": {
|
||||
"daily_report": {
|
||||
"oneOf": [{ "$ref": "#/$defs/dailyReport" }, { "type": "null" }]
|
||||
},
|
||||
"result_json": { "$ref": "#/$defs/resultJson" },
|
||||
"structured_result_json": { "$ref": "#/$defs/structuredResult" },
|
||||
"exception_report": {
|
||||
"oneOf": [{ "$ref": "#/$defs/exceptionReport" }, { "type": "null" }]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": { "status": { "const": "success" } },
|
||||
"required": ["status"]
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"business_date": { "type": "string", "format": "date" },
|
||||
"artifacts": {
|
||||
"properties": {
|
||||
"daily_report": { "$ref": "#/$defs/dailyReport" },
|
||||
"exception_report": { "type": "null" }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"else": {
|
||||
"properties": {
|
||||
"artifacts": {
|
||||
"properties": {
|
||||
"daily_report": { "type": "null" },
|
||||
"exception_report": { "$ref": "#/$defs/exceptionReport" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
46
prompts/arr_opera_daily_profile_output.schema.json
Normal file
46
prompts/arr_opera_daily_profile_output.schema.json
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "ARR Opera daily Profile output",
|
||||
"description": "SuperAgent Profile editor compatible top-level transport schema. The trusted runtime validates the full nested contract independently.",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"contract_version",
|
||||
"job_id",
|
||||
"source_file_id",
|
||||
"status",
|
||||
"business_date",
|
||||
"processor_result",
|
||||
"files"
|
||||
],
|
||||
"properties": {
|
||||
"contract_version": {
|
||||
"type": "string",
|
||||
"description": "Must equal arr-opera-daily-agent-1"
|
||||
},
|
||||
"job_id": {
|
||||
"type": "string",
|
||||
"description": "The unchanged ARR job_id from PROGRAM_INPUT"
|
||||
},
|
||||
"source_file_id": {
|
||||
"type": "string",
|
||||
"description": "The unchanged ARR source_file_id from PROGRAM_INPUT"
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"description": "success or failed, matching processor_result.status"
|
||||
},
|
||||
"business_date": {
|
||||
"type": "string",
|
||||
"description": "YYYY-MM-DD, or an empty string when processor_result.business_date is null"
|
||||
},
|
||||
"processor_result": {
|
||||
"type": "object",
|
||||
"description": "The complete, unmodified Skill result.json object"
|
||||
},
|
||||
"files": {
|
||||
"type": "object",
|
||||
"description": "Runtime-local file descriptors for daily_report, result_json, structured_result, and exception_report"
|
||||
}
|
||||
}
|
||||
}
|
||||
158
prompts/arr_opera_daily_program_input.schema.json
Normal file
158
prompts/arr_opera_daily_program_input.schema.json
Normal file
@@ -0,0 +1,158 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "ARR Opera daily program input for fetch_oss_file",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"contract_version",
|
||||
"job_id",
|
||||
"attempt_no",
|
||||
"source_file_id",
|
||||
"processor_version",
|
||||
"rule_set_sha256",
|
||||
"oss_attachments",
|
||||
"oss_inline_images",
|
||||
"attachment_fetch_policy",
|
||||
"result_submission"
|
||||
],
|
||||
"properties": {
|
||||
"contract_version": {
|
||||
"type": "string",
|
||||
"const": "arr-opera-daily-program-input-2"
|
||||
},
|
||||
"job_id": { "$ref": "#/$defs/opaqueId" },
|
||||
"attempt_no": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 9999
|
||||
},
|
||||
"source_file_id": { "$ref": "#/$defs/opaqueId" },
|
||||
"processor_version": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$"
|
||||
},
|
||||
"rule_set_sha256": { "$ref": "#/$defs/sha256" },
|
||||
"oss_attachments": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"items": { "$ref": "#/$defs/attachment" }
|
||||
},
|
||||
"oss_inline_images": {
|
||||
"type": "array",
|
||||
"maxItems": 0
|
||||
},
|
||||
"attachment_fetch_policy": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"tool_name",
|
||||
"required_before_skill_call",
|
||||
"applies_to",
|
||||
"output_field"
|
||||
],
|
||||
"properties": {
|
||||
"tool_name": { "const": "fetch_oss_file" },
|
||||
"required_before_skill_call": { "const": true },
|
||||
"applies_to": {
|
||||
"type": "array",
|
||||
"prefixItems": [{ "const": "oss_attachments" }],
|
||||
"minItems": 1,
|
||||
"maxItems": 1
|
||||
},
|
||||
"output_field": { "const": "current_attachments" }
|
||||
}
|
||||
},
|
||||
"result_submission": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"tool_name",
|
||||
"submission_grant",
|
||||
"job_id",
|
||||
"attempt_no",
|
||||
"payload_source",
|
||||
"required_after_successful_skill_call"
|
||||
],
|
||||
"properties": {
|
||||
"tool_name": { "const": "arr_submit_processing_result" },
|
||||
"submission_grant": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Za-z0-9_-]{32,128}$"
|
||||
},
|
||||
"job_id": { "$ref": "#/$defs/opaqueId" },
|
||||
"attempt_no": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 9999
|
||||
},
|
||||
"payload_source": { "const": "structured-result.json" },
|
||||
"required_after_successful_skill_call": { "const": true }
|
||||
}
|
||||
}
|
||||
},
|
||||
"$defs": {
|
||||
"opaqueId": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
|
||||
},
|
||||
"sha256": {
|
||||
"type": "string",
|
||||
"pattern": "^[0-9a-f]{64}$"
|
||||
},
|
||||
"attachment": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"id",
|
||||
"name",
|
||||
"content_type",
|
||||
"size",
|
||||
"sha256",
|
||||
"current_or_history",
|
||||
"source_ref",
|
||||
"oss"
|
||||
],
|
||||
"properties": {
|
||||
"id": { "$ref": "#/$defs/opaqueId" },
|
||||
"name": { "const": "source.xml" },
|
||||
"content_type": { "const": "application/xml" },
|
||||
"size": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 104857600
|
||||
},
|
||||
"sha256": { "$ref": "#/$defs/sha256" },
|
||||
"current_or_history": { "const": "current" },
|
||||
"source_ref": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["source", "index"],
|
||||
"properties": {
|
||||
"source": { "const": "oss_attachments" },
|
||||
"index": { "const": 0 }
|
||||
}
|
||||
},
|
||||
"oss": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["bucket", "endpoint", "object_key"],
|
||||
"properties": {
|
||||
"bucket": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$"
|
||||
},
|
||||
"endpoint": {
|
||||
"type": "string",
|
||||
"pattern": "^oss-[a-z0-9-]+\\.aliyuncs\\.com$"
|
||||
},
|
||||
"object_key": {
|
||||
"type": "string",
|
||||
"pattern": "^arr/jobs/[A-Za-z0-9][A-Za-z0-9._:-]{0,127}/attempts/[0-9]{4}/committed/source_xml/source\\.xml$"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user