codex-memory-curator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Codex Memory Curator

Codex Memory 整理器

Goal

目标

Audit Codex memory as user-owned durable state; classify stale, unsafe, duplicated, or misplaced claims and route review, planning, persistence, and cleanup. Even when invoked from Cursor, inspect only Codex memory/config, not Cursor state.
将 Codex 记忆作为用户拥有的持久化状态进行审计;对过时、不安全、重复或错置的声明进行分类,并分流审查、规划、持久化与清理工作。即使从 Cursor 调用,也只检查 Codex 记忆/配置,而不检查 Cursor 状态。

Core principle

核心原则

Memory is context, not truth. The latest user request, current repo files,
AGENTS.md
, package files, ADRs, and live evidence override stored memories.
记忆是上下文,而非事实。最新用户请求、当前仓库文件、
AGENTS.md
、package 文件、ADR 和实时证据均优先于已存储的记忆。

When to use

何时使用

  • Use for review, placement, configuration, planning, or cleanup of Codex memory and its durable configuration.
  • Use when memory is stale, conflicting, sensitive, noisy, cross-repository, or causing degraded behavior.
  • 用于审查、归置、配置、规划或清理 Codex 记忆及其持久化配置。
  • 当记忆过时、冲突、敏感、噪声过多、跨仓库,或导致行为质量下降时使用。

When not to use

何时不应使用

  • Do not use for ordinary docs, generic prompt work, or Cursor state unless Codex memory/config is explicitly involved.
  • Keep review requests read-only and inspect no personal files beyond Codex memory/config plus the minimum repository evidence needed for conflicts.
  • 不用于普通文档、通用提示词工作或 Cursor 状态,除非明确涉及 Codex 记忆/配置。
  • 审查请求应保持只读;除 Codex 记忆/配置以及解决冲突所需的最少仓库证据外,不检查个人文件。

Workflow selection

工作流选择

Expose all eight workflows in this stable order, compactly when intent is clear. Recommend the route matching the requested outcome and delivery; for a bare invocation recommend
review-chat
while asking the user to choose:
WorkflowDelivery and result
plan-run-cleanup-file
One record: review, approved plan, backup, cleanup, verification.
review-chat
Chat: read-only review and recommendations.
review-file
One record: read-only review and recommendations.
cleanup-chat
Chat and backup: review, high-confidence atomic cleanup, verification.
cleanup-file
One record and backup: review, high-confidence atomic cleanup, verification.
plan-cleanup-chat
Chat: review and approved plan; no cleanup.
plan-cleanup-file
One record: review and approved plan; no cleanup.
plan-run-cleanup-chat
Chat and backup: review, approved plan, cleanup, verification.
Route from intent instead of adding an
auto
workflow:
  • Direct review defaults to
    review-chat
    ; explicit persistence selects
    review-file
    .
  • Explicit cleanup without a delivery preference selects
    plan-run-cleanup-file
    .
  • A clear direct request may select another matching route when delivery and execution intent are explicit.
  • Agent-initiated activation may select only a relevant read-only route. Use
    review-file
    only when the existing task already requests persistence; never infer cleanup.
  • A bare invocation, conflicting cues, or ambiguity about review versus cleanup, chat versus file, execution, Codex home, or mutation authority exposes the table and asks the user to choose.
  • A mutating route may be selected only when the user already requested cleanup of the identified Codex memory scope.
Before substantive inspection, disclose the complete finite options once and state
Selected
,
Reason
, Codex home/repo target, write scope, expected artifacts, protected state, Plan-mode capability, and unresolved approvals. Reuse facts and exact authority already established in the task; combine known fields into a short announcement. If selection is unambiguous, announce it and proceed. If it is ambiguous, stop before inventory and ask only the unresolved choice. Do not repeat the selector or ask for an unchanged selection again.
Workflow selection does not authorize whole-file deletion, destructive recovery, config changes, paid or external actions, deployment, publication, or scope expansion.
按稳定顺序展示全部八个工作流;若意图明确,则紧凑展示。推荐与所请求结果和交付方式相符的路径;对于无上下文的调用,推荐
review-chat
,同时请用户选择:
工作流交付物与结果
plan-run-cleanup-file
一份记录:审查、获批方案、备份、清理、验证。
review-chat
聊天:只读审查和建议。
review-file
一份记录:只读审查和建议。
cleanup-chat
聊天和备份:审查、高置信度原子化清理、验证。
cleanup-file
一份记录和备份:审查、高置信度原子化清理、验证。
plan-cleanup-chat
聊天:审查和获批方案;不执行清理。
plan-cleanup-file
一份记录:审查和获批方案;不执行清理。
plan-run-cleanup-chat
聊天和备份:审查、获批方案、清理、验证。
根据意图选择路径,不要增加
auto
工作流:
  • 直接审查默认使用
    review-chat
    ;明确要求持久化时选择
    review-file
    。
  • 明确要求清理但未指定交付偏好时,选择
    plan-run-cleanup-file
    。
  • 如果交付方式和执行意图均明确,清晰的直接请求可以选择其他相符的路径。
  • Agent 主动激活时只能选择相关的只读路径。仅当现有任务已明确要求持久化时才使用
    review-file
    ;绝不能自行推断清理。
  • 对于无上下文的调用、冲突信号,或在审查与清理、聊天与文件、执行、Codex home 或变更权限方面存在歧义时,展示该表并请用户选择。
  • 只有当用户已明确要求清理已识别的 Codex 记忆范围时,才能选择会产生变更的路径。
在进行实质性检查前,一次性披露完整的有限选项,并说明
Selected
、
Reason
、Codex home/仓库目标、写入范围、预期产物、受保护状态、Plan 模式能力以及尚未解决的审批。复用任务中已确定的事实和精确授权;将已知字段合并为一段简短说明。如果选择无歧义,则宣布选择并继续。如果存在歧义,则在盘点前停止,并且只询问尚未解决的选择。不要重复选择器,也不要再次询问未发生变化的相同选择。
工作流选择并不授权整文件删除、破坏性恢复、配置更改、付费或外部操作、部署、发布或扩大范围。

Inputs to inspect

要检查的输入

  • Resolve the user-provided Codex home or
    ${CODEX_HOME:-$HOME/.codex}
    , then inspect the requested
    memories
    surfaces. Inspect
    config.toml
    only when configuration is requested or needed to resolve an in-scope conflict.
  • Inspect current repository evidence only as needed to verify a disputed claim.
  • Load the classification, conflict, config-mode, store-anatomy, and safe-editing references below only when their decision is active. Load the report or plan asset whenever producing that artifact.
  • 解析用户提供的 Codex home 或
    ${CODEX_HOME:-$HOME/.codex}
    ,然后检查请求的
    memories
    范围。仅在用户要求配置或解决范围内冲突需要时检查
    config.toml
    。
  • 仅按需检查当前仓库证据,以核实有争议的声明。
  • 仅在相应决策当前有效时加载下方分类、冲突、配置模式、存储结构和安全编辑参考。生成报告或方案产物时,始终加载相应的报告或方案资源。

Safety rules

安全规则

  • Do not inspect when the route is unresolved, and do not mutate unless the selected route and user request authorize cleanup of the exact target scope.
  • Never silently delete, rewrite, truncate, or move memory files.
  • Back up every exact file before an approved edit and report the backup path.
  • Do not print full secrets, tokens, credentials, customer data, private identifiers, or sensitive personal data.
  • If secret-like data is found, redact values in output, identify file and line when possible, recommend removal, and recommend rotation for real credentials.
  • If the memory schema is unclear, do not edit it directly. Defer it in the current record or chat result.
  • Treat memory files as generated state unless local instructions prove otherwise. Do not rewrite append-only evidence to fix a stale curated claim.
  • Do not apply repo-specific assumptions globally. Prefer
    AGENTS.md
    or repo docs for repo rules.
  • Do not run broad destructive commands.
  • 路径未解决时不得检查;除非所选路径和用户请求授权清理准确目标范围,否则不得变更。
  • 绝不静默删除、重写、截断或移动记忆文件。
  • 在执行已批准的编辑前,备份每个准确文件,并报告备份路径。
  • 不打印完整的机密、令牌、凭据、客户数据、私有标识符或敏感个人数据。
  • 如果发现疑似机密数据,应对输出中的值进行脱敏,在可能时标明文件和行号,建议移除;如果属于真实凭据,还建议进行轮换。
  • 如果记忆 schema 不清晰,不要直接编辑。应在当前记录或聊天结果中将其延后处理。
  • 除非本地指令另有证明,否则应将记忆文件视为生成状态。不要通过重写 append-only 证据来修正过时的整理声明。
  • 不要将仓库特有假设应用于全局。仓库规则应优先写入
    AGENTS.md
    或仓库文档。
  • 不要运行宽泛的破坏性命令。

Workflow

工作流

Every route applies the same review quality to the explicitly requested scope before planning or cleanup. A request about one file or claim does not authorize inspecting the entire store: use targeted reads instead of whole-root inventory/scanner commands, and consult other evidence only to resolve an in-scope conflict. Delivery never reduces review quality:
  1. Resolve the selected route, Codex home, repo target, persistence path when applicable, and protected state. Discover Codex home as follows:
    Use
    ${CODEX_HOME}
    when set; otherwise use the user's home directory plus
    .codex
    .
  2. For requests that explicitly cover the entire memory store, inventory all memory files without dumping contents:
    bash
    node scripts/inventory-memories.mjs
    For a narrower request, skip this whole-store command and inventory only the explicitly requested paths with targeted reads.
  3. For a store-wide request, run the redacted risk scanner when looking for sensitive, stale, broad, local, repo-specific, or config-like entries:
    bash
    node scripts/scan-memory-risks.mjs --json
    For a single-file or single-claim review, use targeted reads in the requested scope; do not run this whole-store scanner because it has no file selector. Exit code
    1
    means findings were found, not that the scan failed. The scanner caps returned findings and skips generated evidence by default; raise
    --max-findings
    or add
    --include-generated-evidence
    only when needed. Use scanner JSON as evidence; report counts and the highest-signal redacted findings instead of pasting the full payload.
  4. If configuration is requested or needed to resolve an in-scope conflict, locate memory/config signals across the entire
    <codex-home>/config.toml
    with
    node scripts/locate-memory-config.mjs --json
    . The locator emits line numbers and fixed signal names, never values. Inspect only relevant bounded sections, including their table/profile context; redact sensitive values. Candidate matches are not parsed TOML or effective configuration proof.
  5. Classify memory mode as disabled, enabled but not injected, enabled and injected, external-context generation disabled, or unknown. Load
    references/config-modes.md
    for exact mode signals.
  6. If multiple memory file types are present, load
    references/memory-store-anatomy.md
    before deciding what is safe to edit.
  7. Read memory files in small chunks; avoid huge dumps and redact sensitive values.
  8. Extract one atomic claim per row. Split compound entries before classification.
  9. Verify conflicts against only the current repo files needed for the disputed claim. Load
    references/conflict-resolution.md
    when precedence is unclear.
  10. Assign exactly one primary classification per atomic claim:
    KEEP
    ,
    KEEP BUT REWRITE
    ,
    MOVE TO AGENTS.md
    ,
    MOVE TO REPO DOCS
    ,
    MOVE TO SKILL
    ,
    MOVE TO CONFIG
    ,
    DELETE
    , or
    ASK USER
    .
  11. Tag high-risk entries as useful context only:
    stale
    ,
    duplicated
    ,
    too-broad
    ,
    too-specific
    ,
    repo-specific
    ,
    workflow
    ,
    config
    ,
    sensitive
    ,
    conflicting
    , or
    useful
    .
  12. Add confidence (
    high
    ,
    medium
    , or
    low
    ) and a proposed action to every entry.
  13. Produce the complete review before planning or editing. Route delivery must not reduce review quality or expand the requested scope.
每条路径在规划或清理前,都必须对明确请求的范围应用相同的审查质量。关于一个文件或声明的请求并不授权检查整个存储:使用定向读取,而不是整个根目录的盘点/扫描命令;只有在解决范围内冲突时才查阅其他证据。交付方式不得降低审查质量:
  1. 解析所选路径、Codex home、仓库目标、适用时的持久化路径和受保护状态。查找 Codex home 的方式如下: 当设置了
    ${CODEX_HOME}
    时使用该值;否则使用用户主目录加
    .codex
    。
  2. 对于明确覆盖整个记忆存储的请求,在不输出内容的情况下盘点所有记忆文件:
    bash
    node scripts/inventory-memories.mjs
    对于范围更窄的请求,跳过此全存储命令,仅通过定向读取盘点明确请求的路径。
  3. 对于全存储请求,在查找敏感、过期、范围过宽、本地化、仓库特有或类似配置的条目时,运行经过脱敏的风险扫描器:
    bash
    node scripts/scan-memory-risks.mjs --json
    对于单文件或单声明审查,使用请求范围内的定向读取;不要运行此全存储扫描器,因为它没有文件选择器。退出码
    1
    表示发现了问题,而不是扫描失败。扫描器会限制返回的发现数量,默认跳过生成的证据;仅在确有需要时提高
    --max-findings
    或添加
    --include-generated-evidence
    。 将扫描器 JSON 作为证据;报告计数和信号最强的脱敏发现,而不是粘贴完整载荷。
  4. 如果用户要求配置,或解决范围内冲突需要配置信息,则使用
    node scripts/locate-memory-config.mjs --json
    在完整的
    <codex-home>/config.toml
    中定位记忆/配置信号。定位器会输出行号和固定信号名称,但绝不输出值。仅检查相关的有限区段,包括其配置表/profile 上下文;对敏感值进行脱敏。候选匹配不能作为已解析 TOML 或有效配置的证明。
  5. 将记忆模式分类为
    disabled
    (已禁用)、
    enabled but not injected
    (已启用但未注入)、
    enabled and injected
    (已启用且已注入)、
    external-context generation disabled
    (外部上下文生成已禁用)或
    unknown
    (未知)。如需确切模式信号,加载
    references/config-modes.md
    。
  6. 如果存在多种记忆文件类型,在决定哪些内容可以安全编辑之前,加载
    references/memory-store-anatomy.md
    。
  7. 小批量读取记忆文件;避免大量转储,并脱敏敏感值。
  8. 每行提取一个原子声明。分类前拆分复合条目。
  9. 仅使用解决争议声明所需的当前仓库文件来验证冲突。优先级不清楚时,加载
    references/conflict-resolution.md
    。
  10. 每个原子声明必须且只能分配一个主分类:
    KEEP
    、
    KEEP BUT REWRITE
    、
    MOVE TO AGENTS.md
    、
    MOVE TO REPO DOCS
    、
    MOVE TO SKILL
    、
    MOVE TO CONFIG
    、
    DELETE
    或
    ASK USER
    。
  11. 仅可使用以下标签标记高风险条目:
    stale
    、
    duplicated
    、
    too-broad
    、
    too-specific
    、
    repo-specific
    、
    workflow
    、
    config
    、
    sensitive
    、
    conflicting
    或
    useful
    。
  12. 为每个条目添加置信度(
    high
    、
    medium
    或
    low
    )和建议操作。
  13. 在规划或编辑前完成完整审查。交付方式不得降低审查质量或扩大请求范围。

Route execution

路径执行

  • review-chat
    : return the review in chat and create no durable curation report.
  • review-file
    : persist the single curation record and make no memory or config change.
  • cleanup-chat
    : derive only high-confidence atomic actions from the completed review, back up every exact file to be changed, apply them, re-read changed sections, and report verification in chat. Create no durable curation report.
  • cleanup-file
    : create the curation record before mutation; if persistence fails, stop. Then back up exact files, apply only high-confidence atomic actions, and complete the same record with execution and verification.
  • plan-cleanup-chat
    and
    plan-cleanup-file
    : enter the Plan lifecycle, resolve the cleanup plan with the user, and stop after approval without changing Codex state.
  • plan-run-cleanup-chat
    and
    plan-run-cleanup-file
    : enter the Plan lifecycle, resolve and approve the complete cleanup plan, recheck state, exit Plan mode, back up exact files, execute only the unchanged plan, and verify. Do not ask a generic second cleanup question after plan approval.
Direct cleanup (
cleanup-chat
or
cleanup-file
) is limited to high-confidence atomic edits, moves, or entry deletion in existing, editable, runtime-owned Codex memory. Defer whole-file deletion, new context files, config,
AGENTS.md
, repository docs, skills, generated append-only evidence, uncertain schemas, medium/low-confidence changes, and any scope expansion. A plan-run route may execute broader curation changes only when the approved plan names each destination, write path, backup, rollback, and separate approval boundary.
  • review-chat
    :在聊天中返回审查结果,不创建持久化整理报告。
  • review-file
    :持久化单条整理记录,不更改记忆或配置。
  • cleanup-chat
    :仅从已完成的审查中推导高置信度原子操作;备份每个将更改的准确文件;执行操作;重新读取已更改的部分;并在聊天中报告验证结果。不创建持久化整理报告。
  • cleanup-file
    :先创建整理记录再进行变更;如果持久化失败,则停止。随后备份准确文件,仅执行高置信度原子操作,并使用执行和验证结果补全同一记录。
  • plan-cleanup-chat
    和
    plan-cleanup-file
    :进入 Plan 生命周期,与用户确定清理方案,获得批准后即停止,不更改 Codex 状态。
  • plan-run-cleanup-chat
    和
    plan-run-cleanup-file
    :进入 Plan 生命周期,确定并批准完整清理方案,重新检查状态,退出 Plan 模式,备份准确文件,仅执行未变更的方案,并进行验证。方案批准后不要再询问通用的二次清理问题。
直接清理(
cleanup-chat
或
cleanup-file
)仅限于对现有、可编辑且由运行时所有的 Codex 记忆执行高置信度原子化编辑、移动或条目删除。将整文件删除、新上下文文件、配置、
AGENTS.md
、仓库文档、skill、生成的 append-only 证据、不确定的 schema、中低置信度变更及任何范围扩展延后处理。只有当获批方案明确列出每个目标位置、写入路径、备份、回滚方式和独立审批边界时,
plan-run
路径才可执行更广泛的整理变更。

Plan lifecycle

Plan 生命周期

Respect active/requested native Plan mode and actual write permissions on every route: no report, backup, or cleanup write while Plan is active or permission is unknown. Planning may continue read-only without a manual mode switch. For
plan-*
routes or pending material questions, read references/plan-lifecycle.md. Reuse unchanged approval; mode exit alone is not approval, and unanswered questions grant no authority. Recheck state before writes and reconfirm only material changes. Plan-only routes never authorize cleanup.
Do not invoke
codex-spec-interviewer
inside this curation workflow. If findings require a broader durable rule, repository spec, or unresolved product decision, finish the selected curation route and offer the interviewer as a separate follow-up.
在每条路径上都遵循当前激活或请求的原生 Plan 模式和实际写入权限:Plan 处于活动状态或权限未知时,不得写入报告、备份或清理内容。即使不手动切换模式,规划也可以继续以只读方式进行。对于
plan-*
路径或存在待解决的实质性问题,读取 references/plan-lifecycle.md。复用未变更的批准;仅退出模式并不等于批准,未回答的问题不授予任何权限。写入前重新检查状态,仅对实质性变化再次确认。仅含规划的路径绝不授权清理。
不要在此整理工作流中调用
codex-spec-interviewer
。如果发现需要更广泛的持久化规则、仓库规范或尚未解决的产品决策,请完成所选整理路径,并将该访谈流程作为单独的后续事项提供。

File delivery contract

文件交付约定

File routes persist exactly one redacted curation record. Prefer an existing repository-native report location; otherwise use
<repo>/.agent-reports/codex-memory-curation/<UTC timestamp>-<selection-id>.md
. Create a new path without overwriting and keep all route output in that record.
The record contains
Review
,
Plan
,
Execution Receipt
,
Deferred Work
,
Backup
, and
Verification
. Use
not applicable
with a reason for phases the route does not perform. Create the record before mutation for
cleanup-file
and
plan-run-cleanup-file
; persistence failure blocks cleanup. Chat routes create no report file. Backup directories remain mandatory safety artifacts and do not count as curation reports.
Explicit --backup-root requires a stable non-sensitive --backup-root-alias; file routes persist the script-reported portable storage locator and <storage-locator>/backup-manifest.json.
Report exact absolute backup and manifest paths only in non-persisted chat, never in repository artifacts.
文件路径恰好持久化一条经过脱敏的整理记录。优先使用现有的仓库原生报告位置;否则使用
<repo>/.agent-reports/codex-memory-curation/<UTC timestamp>-<selection-id>.md
。创建新路径且不得覆盖,并将该路径的全部输出保留在记录中。
记录包含
Review
、
Plan
、
Execution Receipt
、
Deferred Work
、
Backup
和
Verification
。对于路径不执行的阶段,使用
not applicable
并说明原因。对于
cleanup-file
和
plan-run-cleanup-file
,在变更前创建记录;持久化失败将阻止清理。聊天路径不创建报告文件。备份目录仍是必需的安全产物,不计作整理报告。
显式指定 --backup-root 时必须提供稳定且非敏感的 --backup-root-alias;文件路径会持久化脚本报告的便携存储定位符以及 <storage-locator>/backup-manifest.json。
只能在非持久化聊天中报告确切的绝对备份路径和清单路径,绝不能写入仓库产物。

Classification checks

分类检查

For each atomic claim, test stability, scope, portability, strength, duplication, staleness, sensitivity, higher-precedence conflicts, concise phrasing, and whether
AGENTS.md
, repo docs, a skill, config, or deletion is more precise. Load
references/classification-rubric.md
for the detailed rules and examples.
对每个原子声明,检查稳定性、范围、可移植性、强度、重复性、时效性、敏感性、更高优先级冲突、表述简洁性,以及
AGENTS.md
、仓库文档、skill、配置或删除是否更为准确。需要详细规则和示例时,加载
references/classification-rubric.md
。

References

参考资料

Read only when needed:
  • Classification and conflict:
    references/classification-rubric.md
    ,
    references/conflict-resolution.md
    .
  • Config and store boundaries:
    references/config-modes.md
    ,
    references/memory-store-anatomy.md
    .
  • Safe mutation and examples:
    references/safe-editing-procedure.md
    ,
    references/example-review-report.md
    .
  • Output artifacts:
    assets/review-report-template.md
    ,
    assets/cleanup-plan-template.md
    .
仅在需要时读取:
  • 分类与冲突:
    references/classification-rubric.md
    、
    references/conflict-resolution.md
    。
  • 配置与存储边界:
    references/config-modes.md
    、
    references/memory-store-anatomy.md
    。
  • 安全变更与示例:
    references/safe-editing-procedure.md
    、
    references/example-review-report.md
    。
  • 输出产物:
    assets/review-report-template.md
    、
    assets/cleanup-plan-template.md
    。

Scripts

脚本

Use only when needed. All scripts are non-interactive, use Node.js stdlib only, and accept
--help
.
bash
node scripts/inventory-memories.mjs [--codex-home PATH] [--json]
node scripts/locate-memory-config.mjs [--codex-home PATH] [--json]
node scripts/scan-memory-risks.mjs [--codex-home PATH] [--json] [--max-findings N] [--include-generated-evidence]
node scripts/backup-memories.mjs [--repo PATH] [--codex-home PATH] [--backup-root PATH --backup-root-alias NAME] [--include PATH ...]
  • The config locator is read-only and scans the complete document, including late tables and dotted/quoted keys. It is a discovery aid; comments and strings can match, so resolve TOML scope, active profiles, and overrides before classifying mode.
  • Inventory is read-only. The scanner is read-only, redacts by default, bounds findings, skips generated evidence unless requested, and uses exit
    1
    for findings rather than execution failure.
  • backup-memories.mjs
    creates a no-clobber backup plus
    backup-manifest.json
    without editing sources. Unredacted backup payloads and manifests stay outside Git worktrees and outside the resolved Codex memories tree, including physical aliases. Preflight rejects unsafe roots and every symlink path component; any traversal error fails before root creation. Use exact
    --include
    paths for edits; zero includes retains legacy discovery. Before invoking it, read
    references/safe-editing-procedure.md
    for root safety, preflight, manifest reconciliation, and recovery.
仅在需要时使用。所有脚本均为非交互式,仅使用 Node.js 标准库,并接受
--help
。
bash
node scripts/inventory-memories.mjs [--codex-home PATH] [--json]
node scripts/locate-memory-config.mjs [--codex-home PATH] [--json]
node scripts/scan-memory-risks.mjs [--codex-home PATH] [--json] [--max-findings N] [--include-generated-evidence]
node scripts/backup-memories.mjs [--repo PATH] [--codex-home PATH] [--backup-root PATH --backup-root-alias NAME] [--include PATH ...]
  • 配置定位器为只读,扫描完整文档,包括靠后出现的表以及带点号或引号的键。它只是发现辅助工具;注释和字符串也可能匹配,因此在判定模式前,先解析 TOML 作用域、活跃 profile 和 override。
  • 盘点为只读。扫描器为只读,默认脱敏,限制发现数量,除非请求否则跳过生成的证据,并以退出码
    1
    表示存在发现,而不是执行失败。
  • backup-memories.mjs
    创建禁止覆盖既有内容的备份和
    backup-manifest.json
    ,且不编辑源文件。未脱敏的备份载荷和清单必须留在 Git worktree 之外,并且位于解析后的 Codex memories 树之外,包括物理别名。预检会拒绝不安全的根路径和每一个 symlink 路径组件;任何遍历错误都会在创建根目录前失败。对编辑使用准确的
    --include
    路径;未提供 include 时保留旧版发现行为。调用前读取
    references/safe-editing-procedure.md
    ,了解根路径安全、预检、清单对账和恢复机制。

Output format

输出格式

Use the workflow announcement above. There, report only unresolved approval gates; in the selected route's result, report its required deliverables and verification according to the route execution and file-delivery contracts below.
Before producing a report, load and follow
assets/review-report-template.md
as the canonical heading and field contract. File routes copy that complete template into the one curation record; chat routes render only applicable sections in chat and create no report file. Populate every applicable field, use
not applicable
with a reason for skipped phases, and redact sensitive values.
Before edits, complete the review and decision tables. After edits, complete the same record's receipt, including Manifest reconciliation and unmatched paths; New paths (
created-no-preimage
) and rollback; Backup mode and manifest path; Backup integrity result; and the row schema
| Changed path | Backup destination | Bytes | SHA-256 | Verification |
.
使用上述工作流公告。在其中仅报告尚未解决的审批关口;在所选路径的结果中,根据路径执行和文件交付约定报告所需交付物与验证情况。
生成报告前,加载并遵循
assets/review-report-template.md
,将其作为规范的标题和字段约定。文件路径将完整模板复制到一条整理记录中;聊天路径仅在聊天中呈现适用章节,不创建报告文件。填写每个适用字段,对跳过阶段使用
not applicable
并说明原因,同时脱敏敏感值。
编辑前,完成审查表和决策表。编辑后,补全同一记录的执行回执,包括 Manifest 对账与未匹配路径;新路径(
created-no-preimage
)及回滚;备份模式和清单路径;备份完整性结果;以及表结构
| Changed path | Backup destination | Bytes | SHA-256 | Verification |
。

Completion criteria

完成标准

  • One of the eight canonical workflows was selected from clear authority or resolved ambiguity; agent activation never inferred cleanup.
  • Applicable memory/config was inventoried or reported missing; generated evidence changed only for explicitly authorized sensitive-data cleanup.
  • Every atomic claim has one classification, risk tags, confidence, action, and higher-precedence conflict evidence when applicable.
  • Plan/direct-cleanup and destination boundaries remain satisfied.
  • Delivery matches the canonical template; every edit has exact backup, manifest reconciliation, re-read, and integrity proof.
  • 已从明确授权或已解决的歧义中选择了八种规范工作流之一;Agent 激活绝不推断清理。
  • 适用范围内的记忆/配置已盘点,或已报告其缺失;只有在明确授权敏感数据清理时,才可更改生成的证据。
  • 每个原子声明均有一个分类、风险标签、置信度、建议操作,并在适用时提供更高优先级的冲突证据。
  • 规划/直接清理及目标边界始终得到满足。
  • 交付内容符合规范模板;每次编辑都有准确备份、清单对账、重新读取和完整性证明。

Failure modes

失败模式

  • Missing memory/config: report what is unavailable and whether enablement, app defaults, or a different Codex home may explain it.
  • Unknown schema: defer instead of editing or creating sibling state.
  • Sensitive or conflicting content: redact; cite location and higher source; recommend removal/rotation or classify for rewrite, move, or deletion.
  • Persistence, backup, or approved-state recheck failure: stop before mutation (or before further mutation), report the failure, and return to planning after drift.
  • 记忆/配置缺失:报告不可用内容,以及启用状态、应用默认设置或不同 Codex home 是否可以解释该情况。
  • 未知 schema:延后处理,不要直接编辑或创建同级状态。
  • 敏感或冲突内容:进行脱敏;指出位置和更高优先级来源;建议移除或轮换,或分类为重写、移动或删除。
  • 持久化、备份或已批准状态重新检查失败:在变更前(或进一步变更前)停止,报告失败,并在发生状态漂移后返回规划阶段。