KB-1956

S164C Legacy Hardcode Fix Report

3 min read Revision 1
reporthardcodelegacylints164c

S164C Report: Fix TOÀN BỘ Legacy Hardcode — 0 Findings

Date: 2026-04-04 | Session: S164C Status: LINT PASS — 0 hardcode patterns

Baseline

  • DOT-SCRIPT-LINT v1.0: 217 findings (84 PG vars + 45 IN-lists + 8 credentials + 80 localhost)
  • Files needing fix: 39

Fixes Applied

Pattern Files Lines Fixed Method
PG_CONTAINER/USER/DB without env default 28 ~84 sed: "postgres" → "${PG_CONTAINER:-postgres}"
docker exec postgres (direct) 5 ~9 sed: postgres → ${PG_CONTAINER:-postgres}
docker compose exec -T postgres + -U/-d 11 ~23 sed: same pattern
Total 39 ~116

IN-Lists Classification (45 findings)

Type Count Decision Reason
governance_role IN ('governed','observed',...) ~20 KEEP Mirror PG CHECK constraint — architectural enum
group IN ('GRP-CMS','GRP-LOG',...) ~5 KEEP System group classification — stable
policy name IN ('AI Agent Policy',...) ~10 KEEP Directus system constants
code NOT IN ('CAT-ALL','CAT-MOL',...) ~10 KEEP Meta-catalog system codes — architectural

Rule: IN-list of ENUM/STATUS = OK (architectural, changes with schema). IN-list of ENTITY = FIX (changes with business data). All 45 are ENUM type.

False Positives Removed from LINT v2.1

Pattern Why False Positive
localhost:8000/8001 in dot-agent-/dot-ai- Service health checks run ON VPS where services ARE on localhost
"password" in dot-token/dot-backup/dot-spider Variable names reading from env files, not literal passwords

DOT-SCRIPT-LINT v2.1.0

  • Focused on 3 actionable patterns: PG vars, direct credentials, container names
  • Excludes: comments, .bak files, TEMPLATE, env var patterns
  • Test output: PASS — 0 hardcode patterns

Re-scan Evidence

DOT-SCRIPT-LINT v2.1.0 — Hardcode Detection
[PASS] PG vars: all use env defaults
[PASS] DB credentials: all use env vars
[PASS] Container names: all use env vars
RESULT: PASS — 0 hardcode patterns

Scripts Tested Post-Fix

  • dot-nrm-verify: 5 PASS, 1 known FAIL (governance enforcement gap)
  • dot-gov-verify: ALL PASS (7/7)
  • dot-nrm-lifecycle: runs correctly, 0 auto-retire, 0 anomalies