Skip to content

moonlight-lupin/agent-skills / plugins/dev-pipeline/skills/review-lessons

review-lessons

Verified

Library of lessons from past build-review loops — not a stage. Use when a review or fix round hits a specific case: a reviewer BLOCKING that contradicts the brief, a test that passes but checks nothing, a feature dead in production, SQLite/WAL migrations, MCP tool surfaces, REST API authz, app ↔ external-source sync, Android/APK verification, fill-template extraction, CLI/git mechanics, reviewer outages. Load the one file the case needs; never load the whole library.

FileKindSize
SKILL.mdexecutableskill md5.5 KB
references/architecture-refactor-test-updates.mdexecutablescript2.9 KB
references/beta-gate-release-hardening.mdexecutablescript3.3 KB
references/ci-and-repo-hygiene.mdexecutablescript3.7 KB
references/confirm-loop-lessons.mdexecutablescript24.2 KB
references/cross-model-parallel-review.mdexecutablescript4.8 KB
references/data-integrity-principles.mdexecutablescript7.3 KB
references/delegate-skills-adaptation.mdexecutablescript2.1 KB
references/evidence-pairs.mdexecutablescript2.5 KB
references/extraction-from-filled-docs.mdexecutablescript6.1 KB
references/field-briefing-integration.mdexecutablescript5.2 KB
references/full-module-replacement-scoping.mdexecutablescript6.3 KB
references/generated-frontmatter-and-reviewer-outages.mdexecutablescript3.0 KB
references/loop-pitfalls.mdexecutablescript27.9 KB
references/mcp-category-tool-implementation.mdexecutablescript5.3 KB
references/mcp-design-review-patterns.mdexecutablescript5.7 KB
references/minified-bundle-selector-research.mdexecutablescript4.4 KB
references/mobile-app-verification.mdexecutablescript4.8 KB
references/multi-batch-sequencing.mdexecutablescript5.7 KB
references/parallel-dual-review.mdexecutablescript10.8 KB
references/pitfalls-dispatch-semantics.mdexecutablescript6.3 KB
references/pitfalls-fix-round-verification.mdexecutablescript6.6 KB
references/planning-with-files-adaptation.mdexecutablescript2.6 KB
references/plugin-gates-and-fix-rounds.mdexecutablescript8.2 KB
references/production-reachability-review.mdexecutablescript5.0 KB
references/reconciliation-review-findings.mdexecutablescript3.1 KB
references/rest-api-review-checklist.mdexecutablescript13.0 KB
references/review-findings-adjudication.mdexecutablescript34.4 KB
references/scope-test-in-process-execution.mdexecutablescript4.2 KB
references/security-property-tests.mdexecutablescript14.2 KB
references/sqlite-migration-pitfalls.mdexecutablescript4.1 KB
references/sqlite-wal-review-findings.mdexecutablescript5.0 KB
references/sync-pipeline-review-patterns.mdexecutablescript13.2 KB
references/tool-mechanics-pitfalls.mdexecutablescript44.1 KB
references/upgrade-path-test-pattern.mdexecutablescript3.0 KB

references/scope-test-in-process-execution.md

View on GitHub
# Scope Property Test — In-Process Execution Patterns

Patterns from a 5th-pass Codex review (Aug 2026) that refined
the scope property test beyond the initial implementation.

## Contents

- Problem 1: Exception paths skip snapshot comparison
- Problem 2: Missing-arg failures counted as meaningful execution
- Problem 3: Bare namespace limits meaningful coverage
- Updated EXEMPT_PATHS

## Problem 1: Exception paths skip snapshot comparison

**Codex MAJOR:** If the snapshot comparison is inside a `try` block or
after a `continue` on exception, a handler that mutates the database and
then raises escapes detection. The mutation is never compared.

**Fix:** The snapshot check must run unconditionally after every handler
invocation, regardless of whether the handler succeeded or raised:

```python
for cmd in read_cmds:
    if any(p in cmd.name for p in SKIP_PATTERNS):
        skipped.append(cmd.name)
        continue

    try:
        COMMAND_REGISTRY.execute(cmd.name, default_args)
        ran_ok += 1
    except SystemExit:
        ran_ok += 1
    except (AttributeError, TypeError, KeyError):
        ran_with_error += 1
    except Exception:
        ran_ok += 1  # business-logic exception = handler reached DB logic

    # ALWAYS check — even if the handler raised, it may have mutated first
    conn = sqlite3.connect(str(db_path))
    conn.row_factory = sqlite3.Row
    after = snapshot_fn(conn)
    conn.close()

    changed_tables = [t for t, before in before_state.items()
                      if after.get(t) != before]
    if changed_tables:
        mutated.append(f"{cmd.name} mutated {changed_tables}")

    before_state = after  # update for next iteration
```

## Problem 2: Missing-arg failures counted as meaningful execution

**Codex MAJOR:** `AttributeError` on a missing namespace attribute means
the handler never reached its DB logic — it died at `args.status` before
opening a connection. Counting these as "executed" inflates the number
without proving anything ran.

**Fix:** Split into `ran_ok` (handler returned data, raised `SystemExit`
after printing, or hit a business-logic exception like `LedgerError`/
`ValueError`) vs `ran_with_error` (handler raised `AttributeError`/
`TypeError`/`KeyError` on a missing arg). Assert `ran_ok >= 30`, not
`executed >= 30`.

## Problem 3: Bare namespace limits meaningful coverage

Handlers access optional args directly (`args.status`, `args.type`,
`args.from_date`) rather than via `getattr(args, "status", None)`. With a
bare `{"entity": "prop_test"}` namespace, 74/89 handlers raise
`AttributeError` before reaching DB logic — only 15 meaningfully execute.

**Fix:** Provide `None` for 23+ common optional args. This lets handlers
proceed past arg access to their DB read logic, increasing meaningful
coverage from 15 to 45.

```python
default_args = {
    "entity": "prop_test",
    "company_id": None, "account_id": None, "account_code": None,
    "entry_id": None, "entry_no": None, "invoice_id": None,
    "bill_id": None, "payment_id": None, "item_id": None,
    "contact_id": None, "counter_party": None, "group_id": None,
    "period_id": None, "period": None, "schedule_id": None,
    "run_id": None, "id": None, "name": None, "status": None,
    "type": None, "stage": None, "direction": None,
    "from_date": None, "to_date": None, "as_of": None,
    "include_inactive": None, "entity_type": None,
    "entity_model": None, "username": None, "amount": None,
    "base_currency": None, "path": None, "json": False,
}
```

**Discovery script** — find all missing attributes for a new codebase:

```python
import re
missing = set()
for cmd in read_cmds:
    try:
        COMMAND_REGISTRY.execute(cmd.name, {"entity": "test"})
    except AttributeError as e:
        m = re.search(r"has no attribute '(\w+)'", str(e))
        if m:
            missing.add(m.group(1))
# missing = {'status', 'type', 'from_date', 'id', ...}
```

## Updated EXEMPT_PATHS

The GUI action route (`/ui/entries/{entry_id}/action`) was removed from
EXEMPT_PATHS after a viewer test was added to `test_web_gui.py`. The
exemption comment "tested separately" was a lie — the separate tests all
used admin sessions. Either remove the path from EXEMPT_PATHS or write an
explicit viewer test. Don't exempt without verifying the separate test
covers the same property.
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall