Skip to content

docs(skills): embed adversarial invariant, deletion, property-test, and 100x lenses into core skills - #10284

Open
songoow wants to merge 2 commits into
mainfrom
codex/skills-adversarial-lenses
Open

songoow wants to merge 2 commits into
mainfrom
codex/skills-adversarial-lenses

Conversation

@songoow

@songoow songoow commented Dec 6, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

  • Outcome basis / optional anchor: Direct workflow-skill enhancement integrating four high-leverage adversarial engineering lenses into the four existing core skills (skills/loopx-pr-review/SKILL.md, skills/loopx-self-repair/SKILL.md, skills/loopx-performance-diagnosis/SKILL.md, skills/loopx-pr-merge/SKILL.md) without introducing new skills or altering capability/authority boundaries.
  • Goal/source and gap: Existing LoopX workflow skills already covered profiling, simplification, mutation oracles, and review plans, but lacked sharp, unmistakable prompts to (1) enumerate implicit invariants and prove boundaries or reproduce minimal counterexamples, (2) apply deletion pressure on redundant layers/duplicate authority, (3) upgrade repaired reusable bugs into property/mutation tests rather than one-off examples, and (4) challenge structural assumptions for 10x–100x overhead elimination before micro-tuning. Several skills also contained dense single-line blocks (loopx-pr-review null-action/Draft/fresh-audit rules, loopx-self-repair retry boundaries) and unguarded $PR_BASE_REF commands in loopx-pr-merge.
  • Observable before → after, with the validation row that proves it:
    • skills/loopx-pr-review/SKILL.md: Added ## Adversarial Invariant & Deletion Pass as optional sharpening lenses inside review_execution_contract (falsify_claims, reuse/simplification, validation) without adding required packet fields, verdict states, or merge/submission authority; split the long single-line null-action/Draft/fresh-audit wall into scannable bullets and placed For every actionable PR: directly above its numbered steps.
    • skills/loopx-self-repair/SKILL.md: Upgraded ## Repair Loop to prefer deleting duplicate authority over patch layers, route rule/doc bugs to their owning source instead of altering accurate projections, encode reusable code/projection/skill/contract bug fixes into property/parameterized/mutation tests with minimal public-safe counterexamples while letting active task/Todo state-only repairs resume after verified CLI readback, and structured ### Retry & Continuation Boundaries into scannable bullets.
    • skills/loopx-performance-diagnosis/SKILL.md: Added the "make this 100x faster" structural elimination lens in step 6 paired with explicit equivalence invariants, boundary counterexample checks, and strict freshness/authority/soundness guardrails.
    • skills/loopx-pr-merge/SKILL.md: Added Bounded future-facing refactoring & adversarial check under ## Product And Architecture Judgment, added property/mutation test verification to ## Validation Checklist, and required resolving and verifying PR_BASE_REF against the current PR's actual target branch with guarded uv run commands for both scripts/check_rfc_bilingual.py and loopx canary premerge.
    • Proven by tests/test_packaged_skill_metadata.py (37/37 passing in 0.51s, including 9 mutation checks, an executable non-main release-branch Git test for the documented loopx-pr-merge RFC command, loopx.doctor required-phrase checks, and 24,000 B per-skill budgets).
  • Issue/task and intended base: Standalone workflow-skill enhancement PR targeting main (e410b012e67a2fa75ff0056b16ab1362b931764d); independent of docs(agents): streamline AGENTS.md into 3-layer routing and add delivery invariants #10274 (zero overlapping files).

Follow-up verification at 884f9f9a8

The two base-dependent commands now read the PR head and target OIDs together, verify the checked-out head, and pass the immutable target to the existing checker. A retained nonempty main ref no longer hides an English-only change against release. The packaged-skill and installation suites report 69 passed and two native PowerShell skips on Linux.

Author Declaration

  • Written by: Gemini (Antigravity) with independent local codex review pass.

Implemented against

  • Specification and revision: Existing workflow-skill contracts (skills/loopx-pr-review/SKILL.md, skills/loopx-self-repair/SKILL.md, skills/loopx-performance-diagnosis/SKILL.md, skills/loopx-pr-merge/SKILL.md), loopx/doctor.py (REQUIRED_INSTALLED_SKILL_PHRASES), and AGENTS.md at e410b012e67a2fa75ff0056b16ab1362b931764d.
  • Criteria:
Criterion (spec clause) Disposition Symbol / path Test or command
Embed adversarial invariant/counterexample, deletion, property-test, and 100x lenses directly into the 4 existing skills without adding new skills or altering authority boundaries implemented skills/loopx-pr-review/SKILL.md, skills/loopx-self-repair/SKILL.md, skills/loopx-performance-diagnosis/SKILL.md, skills/loopx-pr-merge/SKILL.md pytest -v tests/test_packaged_skill_metadata.py
Preserve loopx-pr-review thin-adapter ownership (review_execution_contract, completion_gate, no extra mandatory gates/verdict states, no escaping local links, no pinned policy_revision) implemented skills/loopx-pr-review/SKILL.md test_workflow_skill_local_links_remain_inside_the_distributed_skill, test_pr_review_skill_tracks_the_capability_policy_revision, test_adversarial_engineering_lenses_and_guardrails_in_workflow_skills
Keep loopx-self-repair rule-vs-projection layer routing and state-only CLI readback resumption intact implemented skills/loopx-self-repair/SKILL.md test_adversarial_engineering_lenses_and_guardrails_in_workflow_skills, test_repair_pattern_lookup.py
Verify actual PR target branch and guarded PR_BASE_REF commands in loopx-pr-merge implemented skills/loopx-pr-merge/SKILL.md test_pr_merge_documented_rfc_command_executes_against_non_main_target
Preserve REQUIRED_INSTALLED_SKILL_PHRASES and 24,000 B per-skill cap across all packaged skills implemented skills/loopx-*/SKILL.md, tests/test_packaged_skill_metadata.py test_required_installed_skill_phrases_and_size_budgets_hold
  • Original self-check before submission: Verified exact head 24da9744d75b319827624c44e26afad8dcaefc37 cleanly rebased onto origin/main (e410b012e67a2fa75ff0056b16ab1362b931764d). Ran ruff check, pytest -v tests/test_packaged_skill_metadata.py (37/37), 5 related skill/contract suites (102 passed, 2 skipped), scripts/check_rfc_bilingual.py, loopx check boundary scan, and git diff --check. Ran an independent local codex review pass and addressed all 1 P1 and 4 P2 findings before pushing.

Scope And Continuation

  • Completed scope and remaining work: Complete within this scope. Touched files are strictly bounded to the 4 workflow SKILL.md files and tests/test_packaged_skill_metadata.py (zero runtime code changes, zero overlap with docs(agents): streamline AGENTS.md into 3-layer routing and add delivery invariants #10274).
  • Bounded future-facing refactoring: Applied within this domain — broke up single-line wall-of-text sections in loopx-pr-review and loopx-self-repair into scannable bullets, placed For every actionable PR: directly above its numbered list, added explicit PR_BASE_REF target-verification guards to loopx-pr-merge, and backed the skill guardrails with mutation and real-git behavioral tests.
  • Slice boundary / successor: N/A — all four existing skills are updated and guarded.

Validation

  • Originally tested revision: 24da9744d75b319827624c44e26afad8dcaefc37 (the 5 additional regression suites were also run on the pre-rebase content-identical commit).
  • Run state: finished
  • Input classes: synthetic, public_fixture
Check kind Result Public-safe evidence / limitation
static passed ruff check tests/test_packaged_skill_metadata.py — 0 issues on 24da9744d75b319827624c44e26afad8dcaefc37.
unit passed python -m pytest -v tests/test_packaged_skill_metadata.py — 37 passed in 0.51s on 24da9744d75b319827624c44e26afad8dcaefc37 (frontmatter, display names, wheel packaging, link containment, 4-skill lens/guardrail checks, 9 mutation checks, executable temporary-Git release-branch RFC command test, doctor required phrases, and 24,000 B budgets).
regression_parity passed python -m pytest -q tests/test_workflow_skill_install.py tests/test_repair_pattern_lookup.py tests/capabilities/test_pr_review_contract.py tests/test_repository_instruction_delivery.py tests/test_project_skill_cli.py — 102 passed, 2 skipped.
static passed python scripts/check_rfc_bilingual.py --base origin/main --head HEAD, git diff --check origin/main...HEAD, and loopx check --scan-path skills/loopx-pr-review/SKILL.md --scan-path skills/loopx-self-repair/SKILL.md --scan-path skills/loopx-performance-diagnosis/SKILL.md --scan-path skills/loopx-pr-merge/SKILL.md --scan-path tests/test_packaged_skill_metadata.py — public boundary scan clean (5 files, errors=0).
  • Coverage and gaps: Changes are restricted to workflow skill Markdown and Python skill-metadata tests; UI/runtime suites are not applicable. test_pr_merge_documented_rfc_command_executes_against_non_main_target skips gracefully only if bash is unavailable on the host.

Frontend / Visual Evidence

  • UI impact: none
  • Before: N/A
  • After: N/A
  • First viewport and preview: N/A (workflow skill Markdown and Python tests only).
  • States and viewports shown: N/A
  • Source data: none
  • Attention review: N/A
  • Craft review: N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)
  • Capability or extension (providers, adapters, skills)
  • Public docs or presentation surface (README, protocols, dashboard)
  • Build, packaging, installer, or CI
  • Host or runtime integration

Technical Direction

  • Direction / acceptance reference, when applicable: Workflow skill quality and adversarial verification hygiene across skills/loopx-pr-review, skills/loopx-self-repair, skills/loopx-performance-diagnosis, and skills/loopx-pr-merge.

Shared-authority RFC fixture impact

N/A

Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths (including .loopx/, .codex/goals/, and live ACTIVE_GOAL_STATE.md).
  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • I kept the change scoped to the linked issue/task.
  • Existing English/Chinese RFC pairs (including ledger entries) both have a diff, and the local premerge check python3 scripts/check_rfc_bilingual.py --base origin/main --head HEAD passes, or no paired RFC changed.
  • I completed the visual evidence section for UI changes, or marked UI impact none.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).

…nd 100x lenses into core skills

Directly integrate the four adversarial engineering lenses into the four existing LoopX workflow skills without adding new skills or altering authority boundaries:
- skills/loopx-pr-review/SKILL.md: add compact Adversarial Invariant & Deletion Pass as optional sharpening lenses inside review_execution_contract (implicit invariants & executable counterexamples, deletion pressure on redundant layers/duplicate authority, bug fixes to property/mutation tests, and 100x structural cost check) without adding packet gates, verdict states, or submission/merge authority; also break up the single-line null-action/Draft/fresh-audit block into scannable bullets and place 'For every actionable PR:' directly above the numbered steps.
- skills/loopx-self-repair/SKILL.md: upgrade the Repair Loop to prefer deleting duplicate authority over patch layers, route bad rules/docs to their owning source instead of altering accurate projections, turn reusable code/projection/skill/contract bug fixes into property/parameterized/mutation tests with minimal public-safe counterexamples while allowing active task/Todo state-only repairs to resume after verified CLI readback, and break Retry & Continuation Boundaries into scannable bullets.
- skills/loopx-performance-diagnosis/SKILL.md: add the 'make this 100x faster' structural elimination lens in step 6 paired with explicit equivalence invariants, boundary counterexample checks, and strict freshness/authority/soundness guardrails.
- skills/loopx-pr-merge/SKILL.md: add Bounded future-facing refactoring & adversarial check under Product And Architecture Judgment, add property/mutation test verification to Validation Checklist, and require resolving and verifying PR_BASE_REF against the current PR's actual target branch with guarded uv run commands for both check_rfc_bilingual.py and canary premerge.
- tests/test_packaged_skill_metadata.py: add section-scoped lens/guardrail assertions, 9 mutation-regression tests (including submission-authority and --base HEAD corruption cases), an executable temporary-repo behavioral test for the documented loopx-pr-merge RFC command against a non-main release branch, doctor required-phrase checks, and 24,000 B per-skill budget checks.

Signed-off-by: song <xinxinsong66@gmail.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-06T12:09:06.774255Z 24da974 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Signed-off-by: Codex <codex@openai.com>
Signed-off-by: song <liusongstep@gmail.com>

@songoow songoow left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · GPT-6 Astra Pro · OpenAI · self_reported

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

维护者在评审和准备合并时,需要知道哪些检查能验证当前 PR,也需要判断现有回归用例是否足够。此前工作流要求核对目标分支,但复制命令时,一个上次留下的非空分支变量就能让检查比较错误的提交。现在两个合并前命令都从指定 PR 读取目标及提交,与本地 HEAD 比对后才运行。本轮只验证随仓库分发的工作流、文档命令和安装回归。

改动思路 / Approach

沿用项目现成的评审和合并工具。审查技能把反例、可删的重复逻辑和性能假设写成可选问题;修复技能区分可复用的规则缺陷与已纠正的任务状态;性能诊断要求先守住结果等价和数据新鲜度,再讨论省去工作。两个合并前命令则共用同一个只读目标分支查询。

具体改动 / Changes

这次总共修改四份工作流及一个测试模块。合并指引新增的 Bash 函数从同一份 GitHub 元数据中读取 head 和 base,检查本地 HEAD,一旦不匹配就在运行双语检查之前停止。核对的基线规范是 skills/loopx-pr-merge/SKILL.md,版本 e410b01。其中 Decision Precondition 要求判断真实目标分支;Validation Checklist 要求按风险提供验证。已有测试能够发现回归时可以沿用,可复用规则优先增加属性或边界用例。审查指引保留了无待办动作、草稿和新一轮完整复审的既有分工。合并指引 · 临时 Git 仓库回归

对主干的风险 / Risks

对目标为 release、只更新英文 RFC 的 PR,预设 PR_BASE_REF=main。旧命令退出 0,新命令从 PR 取得 release 对应的 commit,报告缺少中文配对并退出 1。在同一 PR 中补上中文并让测试提供更新后的远端 head,约定的命令成功。此外,测试覆盖漏填 PR 地址及本地检出与 GitHub 所报 head 不一致时的拒绝路径。Git、Bash 和 RFC 检查器均实际运行;错误的远端分支状态由测试提供。根指令、持久化数据、合并权限和评审协议都没有新增入口。

我的整体评价 / Verdict

通过。打包技能及安装回归共 69 项通过,2 项因 Linux 主机没有原生 PowerShell 跳过,主干也跳过同两项。已核对 lint、双语差异和分发路径。这里验证的是维护者能否按指引在正确提交上执行命令;长期模型采用率需要不同的证据。

English verdict: APPROVE at 884f9f9 — the shipped workflow rejects a stale target or mismatched checkout, and correctly paired release-branch changes pass.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants