7.5 KiB
Programmer expert — V2 candidate code review
Reviewer: /root/programmer_expert. Reviewed Git 69607c52fd5bd27a873515d9811148b312f4aa99 against 7b3f497. Candidate source 401f0b06436f6eeeabe2635a32e6467cc5b9ff34de7fedfbe4badb7c7ac414f7; declared build bc774f70f86b9d0b9ab25631e2457da0451827c1e7fc6204243bc289301e756f. Read-only inspection of application; this report is the only changed artifact.
Frozen generated output inspected directly: /tmp/progcode-v2-frozen-401f0b06436f; its build-identity.json contains the same source hash and 14 articles. Local candidate recorded at http://127.0.0.1:64524 (PID 28007). I inspected source/output and recorded browser evidence rather than claiming a new independent live browser run.
Verdict
One small, real code block remains: unknown WordPress shortlink IDs can resolve inherited object properties. Everything else reviewed below is acceptable for this measured candidate. Fix the shortlink guard and test it before calling the candidate code-accepted; regenerate source/build identity and identify the replacement candidate. This is not a demand to deploy before code acceptance.
The mandatory expanded archive research issue webprogcode-v2.6 remains open. A code review cannot turn partial Semrush evidence (174 reported / 100 observed, plus 13 known dated leads) into complete restoration. No full-site PASS is issued.
V2-PE-4: restrict shortlink lookup to own validated entries (P2, blocking candidate code acceptance)
File: web/app/Shortlinks.jsx:4.
Current predicate if(id&&links[id]) accepts inherited properties of the imported JSON object. The values for constructor, toString and __proto__ are truthy even though none is a recovered WordPress ID. location.replace then coerces the function/object to a URL and navigates away from the home page, usually to a nonsensical relative path and 404. This is a concrete routing error, not an asserted open-redirect vulnerability.
Reproduced without mutating source:
const links = JSON.parse(await readFile('web/data/shortlinks.json'));
for (const id of ['constructor', 'toString', '__proto__', 'missing']) {
console.log(id, Object.hasOwn(links,id), Boolean(id && links[id]), typeof links[id]);
}
// constructor false true function
// toString false true function
// __proto__ false true object
// missing false false undefined
Compromise: keep the static client redirect for the 14 verified IDs. Require an own property and a string local article path (or numeric ID plus own-property lookup). Do not invent redirects for unknown values.
Removal criteria: all 14 known IDs resolve to their exact existing article paths; constructor, toString, __proto__, an unknown number and malformed ID stay on the requested home URL with no redirect. Exercise at least the prototype cases in the actual built browser. Then repeat source/build identity and limited frozen-candidate regression checks.
What was read and independently checked
- Entire
web/scripts/publication-sanitizer.mjs:1-9andprepare-publication.mjs:1-43;web/package.jsonbuild runs preparation before Next export. Parser-based allowlist removes active tags, handlers and unsafe link schemes; image publication is limited to local/visuals/. The hostile fixture executes assertions on the actual sanitizer; I additionally called it directly for script/event/protocol-relative/remote-image input and escaped code. Escaped<script>example text remains code. Raw captures do not flow directly into the trusted sink. - Entire
web/app/articles/[slug]/page.jsx:1-7,web/lib/articles.js:1-6, catchall routeweb/app/[...path]/page.jsx:1-12,Shortlinks.jsx,archive-routes.json,shortlinks.json. Sink receives build-generated sanitized publication JSON. Titles/excerpts/TOC are React text. Canonical article metadata is preserved. 60 historical routes and 14 explicit shortlinks are data-driven; unknown routes use the branded 404. - All final
contentHtmlbodies were parsed/count-inspected; substantive bodies remain distinct. Input edits, figures, TOC and preparation assertions were read. This technical review does not substitute for content-manager reading and source checking. - Read full URL inventory/coverage, editorial ledger structure and purpose decisions,
audit-outbound.py, discovery/fetch/reconciliation code,crawl-v2.py, outbound HTTP records. Both formerly omitted standalone paths now have explicitly documented meaningful equivalents, and taxonomy/date/author indexes are generated. Known historical article corpus reconciliation is addressed. Expanded research is still explicitly unresolved. - Parsed all 81 frozen HTML files independently: 91 external href/src/action occurrences, 41 unique external URLs, all present in the reviewed ledger; no unledgered external destination, no on* attributes and no javascript:/data:text/html URL attributes. Full ledger has 481 occurrences and zero unreviewed, computed again from actual
editorialReviewedfields: edited body37 / raw226 / template9 / build91 / DOM54 / bundled script64. Raw exclusion decisions do not mean raw ads were republished. Bundled runtime URL strings are separated from actual request evidence;behaviour.jsonreports no external requests. - Read frozen candidate
manifest.json,behaviour.json, DOM-link record and full-crawl report. Recorded full crawl is 81 HTML / 117 internal targets / 78 nonexcluded inventory rows / 14 canonical bodies, no missing or suspicious records, branded 404. Browser evidence includes positive/negative JSON, compact/copy, search3, D-filter6, keyboard focus and code/table scrolling, known shortlink, TOC and empty/error states. Prototype shortlinks were not covered, hence PE-4. - Read native D version/results and code fixtures: LDC1.43.0 / DMD2.113.0 results report module unittests passing. PHP fixture results report seven branches with PHP8.3 via
@php-wasm/node3.1.60; the runner and contract explicitly do not claim real Bitrix/database execution. These recorded tests substantiate fixture behavior, not full live CMS compatibility. - Read full Dockerfile,
.dockerignore, production workflow and stack. Diff excludes docs/raw/tracker from image context, preserves static runtime and introduces branded 404 configuration. Manager/user configuration fails closed; image tags and OCI revision retain commit identity. No new global infrastructure mutation is required.
Disposition of initial findings and release check
- PE-1: known CDX corpus/legacy omissions are now reconciled in inventory and generated routes; expanded Semrush scope remains mandatory open under
webprogcode-v2.6. - PE-2: reproducible build sanitization and per-occurrence outbound ledger now exist; independently scanned frozen output reconciles with that ledger. Acceptable for this candidate, subject to preserving the same boundary after PE-4 fix.
- PE-3: release verification still needed after authorized V2 deployment. Code acceptance is a prerequisite for deployment, not dependent on already having deployed. Once the candidate fix and the mandatory restoration/review gates are satisfied, deploy through the existing site-specific Gitea/Swarm path, then inspect exact reviewed OCI commit/image digest, source/build identity, healthy service, HTTPS/TLS and deployed representative content/legacy/404/static paths. Until those real checks occur, production acceptance remains pending. Old V1 health evidence cannot close it.
No other blocking application-code defect was found in this inspection. Do not describe this conditional result as completed restoration, completed production, or full-site PASS.