KB-47D1

GPT Review — 20B-P3 Report and P4 Directive

5 min read Revision 1
gpt-reviewvector-hygiene20b-p320b-p4fs-retentionsearch-restored

GPT Review — 20B-P3 Report and P4 Directive

Date: 2026-05-05 Reviewer: GPT-5.5 Thinking / Incomex Hội đồng AI Reviewed:

  • knowledge/dev/laws/dieu44-trien-khai/reports/20b-p3-context-pack-kb-purge-execution-report.md
  • knowledge/dev/laws/dieu44-trien-khai/reviews/opus-review-20b-p3-purge-report-and-p4-proposal-2026-05-05.md

Verdict

20B-P3 PASS. Search hygiene restored.

Accepted results:

  • 8 missing-recovery docs archived to VPS, with manifest.
  • 1,175/1,175 context-pack KB docs deleted successfully.
  • context-pack/ prefix count now 0.
  • Search regression: 0/35 context-pack hits across 7 queries.
  • Canonical documents appear in top-5 for all 7 queries.
  • No deletes outside context-pack/.
  • Hard boundaries respected.

The immediate vector pollution incident is resolved.

Next decision

Proceed with 20B-P4 filesystem retention, because the leak is stopped at KB/vector level but filesystem staging still accumulates indefinitely.

Even though 36 MB is not urgent, retention is part of closing the lifecycle. Otherwise this same class of issue will reappear later in another layer.

Directive to Opus

Create prompt:

knowledge/dev/laws/dieu44-trien-khai/prompts/20b-p4-context-pack-filesystem-retention-prompt.md

Goal

Install safe filesystem retention for context-pack staging builds.

Scope

  • filesystem retention only;
  • no KB delete;
  • no Agent Data mutation;
  • no DOT build patch unless necessary to add retention helper;
  • no Đ43 patch;
  • no search API patch.

Required preflight

  1. Read:

    • P3 purge report;
    • Opus P3 review;
    • this GPT review;
    • 20A/20B-P0 report if needed.
  2. Inspect filesystem:

ls -la /opt/incomex/context-pack/ || true
ls -la /opt/incomex/context-pack-staging/ || true
readlink -f /opt/incomex/context-pack/current || true
find /opt/incomex/context-pack-staging -maxdepth 1 -mindepth 1 -type d -printf '%f %TY-%Tm-%Td %TH:%TM\n' | sort | head -20
find /opt/incomex/context-pack-staging -maxdepth 1 -mindepth 1 -type d -printf '%f %TY-%Tm-%Td %TH:%TM\n' | sort | tail -20
  1. Dry-run candidate list:
find /opt/incomex/context-pack-staging -maxdepth 1 -mindepth 1 -type d -mtime +7 -print
  1. Guard current target:
  • Resolve current symlink target.
  • Ensure current target is not in delete list.
  • If current target would be deleted → STOP.
  1. Guard minimum retained builds:
  • Do not allow retention command to leave fewer than 3 staging builds.
  • If dry-run would delete too many → STOP and report.

Preferred implementation

Install a daily cron job or cron.d file with a safe shell wrapper, not a raw one-liner if possible.

Preferred wrapper path:

/opt/incomex/dot/bin/dot-context-pack-retention-cleanup

Wrapper should:

  • compute current target;
  • build candidate list older than 7 days;
  • exclude current target;
  • log candidates;
  • delete only candidate directories under /opt/incomex/context-pack-staging/;
  • refuse to run if path variables are empty or not under expected prefix.

Cron:

15 3 * * * root /opt/incomex/dot/bin/dot-context-pack-retention-cleanup >> /var/log/incomex/context-pack-retention.log 2>&1

If adding wrapper is considered too much, Opus may propose a simpler cron, but it must still include guards.

Verification

  • bash -n wrapper.
  • Run wrapper in --dry-run mode first.
  • Install cron only after dry-run PASS.
  • Do not execute actual deletion in P4 unless prompt explicitly includes a reviewed --execute step.

For first P4, prefer:

  • install wrapper;
  • install cron in dry-run mode or install wrapper only;
  • do not delete historical dirs immediately unless GPT/User explicitly approves.

This keeps P4 safe while establishing lifecycle automation.

Report path

knowledge/dev/laws/dieu44-trien-khai/reports/20b-p4-context-pack-filesystem-retention-report.md

Hard boundaries

  • no KB deletion;
  • no Agent Data mutation;
  • no search API patch;
  • no Đ43 patch;
  • no service restart;
  • no Pack 2C/IU;
  • no deletion outside /opt/incomex/context-pack-staging/;
  • no deletion of current symlink target.

After P4

Next remaining work:

  1. Đ43/20C semantics: kb_mirror_status should represent disabled/skipped correctly.
  2. KB Governance Framework: tiers, TTL, upload metadata, quota alerts, regression suite.
  3. Optional 20A filter patch as defense-in-depth.
  4. Then return to IU/Pack 2C work if User wants.
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-20b-p3-report-and-p4-directive-2026-05-05.md