Troubleshooting
Troubleshoot article versioning — Product Support and Feedback Platform
Diagnose support article versioning failures by tracing generated-content fingerprints, manual edits, WordPress revisions, importer identity, and editorial approval evidence. This technical troubleshooting guide provides reproducible tests, read-only audits, and controlled recovery procedures to protect human-authored documentation across automated updates.
Application: Product Support and Feedback Platform
Component: Integrated Knowledge Base, Content Operations, WordPress revisions, and Editorial Governance
Article type: Troubleshooting / Technical Reference
Source baseline: Plugin 7.8.1; integrated Knowledge Base 5.4.0; Content Operations importer; editorial governance 5.5.0
Verification status: Source-reviewed and locally tested using synthetic records; staging and production acceptance pending
Estimated reading time: 19–22 minutes
Goal
Diagnose and recover from support-article versioning failures without overwriting human edits, changing public visibility unintentionally, or losing the attribution that supports editorial approval. Distinguish a genuine content overwrite from an apparent change caused by the active WordPress revision, content cache, taxonomy repair, import metadata, or unexpected publication status. The primary object is the WordPress sc_support_article post; its post ID, revision history, content, and public URL are not interchangeable with importer fingerprints or editorial-state metadata.
Requirements
- An authorized WordPress administrator and a safe staging copy, or a privacy-approved synthetic fixture; do not experiment on live support documentation.
- Known article ID, canonical URL, import content key (if present), post status, before/after timestamps, and source version.
- A protected pre-change backup or revision record and a record of who authorized the import or editorial update.
- Permission to review nonpublic editorial history; public incident reports must use anonymized counts and synthetic examples.
- A change freeze for the affected importer while evidence is preserved; a known rollback path and independent reviewer for any release repair.
Symptoms
- An editor saves a revised guide, but the next import apparently restores older wording.
- Article body is preserved while summary, supported version, approval note, or product classification unexpectedly changes.
- A custom excerpt or slug disappears even though body edits remain intact.
- A draft or pending article becomes published during a corpus repair; conversely, a published article appears to disappear after a status change.
- Two articles share a generated content key, point to the same canonical URL, or produce different versions in public search and the editor.
- The content-integrity score is unchanged despite a new revision, or an approval hash no longer matches published content.
- Import reports claim that manual edits were preserved although a human-authored field changed, or a rerun produces a different result.
Cause
Do not collapse these symptoms into a single “broken versioning” diagnosis. Three independent mechanisms can affect an article: the bundled documentation importer compares a generated title/body fingerprint; the Content Operations importer creates new records after duplicate detection; and WordPress/editorial workflows track post status, revisions, and approval metadata. Each has a different source of truth and recovery procedure. A successful import report or high documentation score does not independently establish that an editor’s work was retained.
Troubleshooting
- Identify the affected post ID and capture the current
post_status, slug, permalink, title/body digest, revision list, source key, stored generated hash, and editorial state before any write. - Determine which mechanism ran: bundled Knowledge Base migration, Content Operations import, native WordPress save, bulk edit, external sync, or a cache refresh. Preserve a job ID and commit if available.
- Compare the before title/body digest with the stored
_scfs_integrated_kb_hashor legacy hash. Missing fingerprints are a distinct failure class. - Compare all human-edited fields: title, body, excerpt, slug, summary, supported/verified version, taxonomy assignments, and public status.
- Check that the imported record refers to the same WordPress ID and content key. Review revision history, authorization evidence, and changes to editorial approval timestamps.
- Reproduce the exact sequence in a staging copy, checking repeat imports and a simulated interrupted import. Use anonymous browser/REST checks only for nonsecret fixtures.
- Choose recovery based on evidence, not an expected workflow status. Do not reset hashes or rerun imports to silence diagnostics.
Resolution
The default recovery is contain, export evidence, identify the last independently verified revision, and restore only approved fields. Pause automated importing for the affected corpus and block unreviewed publishing where governance requires it. Preserve the current content and metadata snapshot, database and file backups, revision IDs, importer source revision, execution logs, and the specific human decisions authorizing restoration. Only after review should a qualified operator restore the selected WordPress revision or apply a narrowly scoped field-level patch. Never mass-delete revisions, rewrite generated hashes, or force post_status=publish as a workaround.
Verification
A successful repair must show that manually edited fields are unchanged after two sequential replays, WordPress identity and canonical URL remain stable, editorial approval evidence is consistent with the final title/body/excerpt, and no restricted record becomes public. Verify metadata and taxonomy changes separately, because body preservation does not imply full record preservation. Repeat the checks anonymously for public surfaces and with an authorized editor for protected history; record the exact content fingerprints, number of tested articles, exclusions, and test results. This remains staging acceptance until the deployed plugin, hooks, and WordPress revision configuration are actually checked.
1. Source-reviewed importer behavior
The bundled importer is implemented in SCFS_Integrated_Knowledge_Base::import_documentation(). It looks up the article by its canonical generated key, with a legacy key fallback and a slug fallback. For existing posts it calculates a stored generated fingerprint from the current post_title and post_content. A nonempty baseline hash that differs from the current hash sets manual_override=true; that path keeps the title, slug, excerpt, and body out of the update payload. Otherwise the importer supplies the bundled title, slug, excerpt, and HTML body. All existing matched records are assigned post_status=publish. This is a statement about source code, not confirmation of actual execution.
generated_hash = SHA256( post_title + "\n" + post_content )
manual_override = (stored_generated_hash != "") AND
(hash(current_title + "\n" + current_body) != stored_generated_hash)
IF manual_override: leave title, slug, excerpt, body unchanged
ELSE: update title, slug, excerpt, body from bundled source
ALWAYS: set status = publish; update selected meta and terms
The importer uses the legacy _sckb_generated_hash when the primary _scfs_integrated_kb_hash is absent. It does not detect changes to the slug or excerpt when the title/body pair is unchanged. Nor does it preserve the publication state by default. A source update can legitimately change generated content, but that is distinct from recovering an unauthorized human edit.
2. Three independent meanings of “version”
| Version or identity | Stored evidence | What it can prove |
|---|---|---|
| WordPress revision | revision child post and post ID |
Saved historical title/body/excerpt when revision capture was enabled; not full term/meta history |
| Generated corpus fingerprint | _scfs_integrated_kb_hash or legacy key |
Whether current title/body differs from last generated baseline, not whether edit was authorized |
| Editorial approval hash | _scfs_editorial_content_hash |
Title/body/excerpt digest at editorial approval, if recorded and compared correctly |
| Product version | scfs_product_version, related metadata |
Declared applicable product release; not proof of test coverage or editorial approval |
| Importer provenance | Content key, source reference, source version, import report | Which generated record and content release were intended to apply |
These hashes use different source strings. The generated importer hash uses title, a newline, and body; the editorial hash uses JSON-encoded title/content/excerpt. Do not compare them as if they were equivalent. A matching generated hash cannot prove an approval exists, and an approval record must be reassessed after content changes.
3. Failure matrix: identify the smallest plausible cause
| Symptom | Likely cause | Discriminating evidence | Next action |
|---|---|---|---|
| Human body reverted | Missing baseline or wrong article match | Stored hash absent; content key or slug fallback; revision diff | Preserve evidence; restore the authorized revision; fix matching/baseline contract in staging |
| Only excerpt changed | Excerpt omitted from generated hash | Body/title hash matches; excerpt differs | Compare pre-import excerpt and add an explicit protection test |
| Only slug changed | Slug omitted from generated hash | Stable post ID but permalink drift | Check redirects and metadata; require change approval |
| Body retained, meta changed | update_article_meta() runs despite manual override |
Before/after taxonomy, summary, verified version, editorial state | Reconcile individual metadata fields |
| Draft unexpectedly public | Bundled importer hard-codes publish |
Post-status transition and import timestamp | Restrict import; review visibility and approval evidence |
| Article “disappears” | Status/canonical change, filter mismatch, or cache | Post still exists by ID; anonymous canonical/REST status | Restore the intended status or canonical mapping only after review |
| Duplicate guide | Content key and slug mismatch or other importer behavior | Duplicate post IDs, key collisions, canonical URLs | Select one canonical identity; retain redirects and revision history |
| Stale public article | Cache/index not invalidated after legitimate save | Editor revision differs from anonymous HTML/REST | Invalidate narrowly and retest with cache bypass |
4. Missing baseline fingerprints
The code protects title/body edits only when a stored generated hash exists. If it is blank, the importer treats the record as generated and can apply a new source body even if an editor previously revised it. An importer may find an article by a matching slug or old content key without any baseline fingerprint; this is especially important during migrations or legacy-content cleanup. Treat such records as quarantined for import until a human compares the current revision, preserved snapshot, and intended source. Creating a fingerprint from the current content after the incident can obscure whether a manual rewrite occurred; it is not safe evidence repair.
5. Excerpt-only and slug-only edits
A human can edit post_excerpt or post_name while leaving post_title and post_content unchanged. The stored generated hash still matches, so the bundled importer updates both fields from its source. That means the simplistic claim “manual edits are always preserved” is unsupported. Stage exact before/import/after snapshots for excerpt-only, slug-only, and mixed edits. If the slug changes, test permalink history, redirects, canonical tags, sitemaps, and internal links; do not create duplicate URLs in an attempt to repair search results.
6. Metadata and taxonomy drift when the body is protected
The bundled importer runs update_article_meta() and assign_article_terms() after saving the post, including the manual-override branch. It may update summary, audience, prerequisites, reading time, last verified product version, source reference, editorial state, approval note/timestamp, and product/section assignments. The source even assigns _scfs_verified_at a fixed historical date for bundled records. These values should not be interpreted as fresh scientific review. Record a field-level diff and require explicit approval for changes to verification claims, public classification, or editorial authority.
7. Publication status and editorial approval
The bundled importer forces matched records to publish, even when it deliberately preserves the body. The reviewed Editorial Governance class also exempts sc_support_article from the general enforce_publication_gate() filter; native WordPress publishing permissions remain relevant. Editorial state metadata is not an independent authorization gate for Support Articles. If an imported draft becomes public, first preserve the prior status, actor and import event, then compare public visibility with approved policy. Do not silently “fix” it by rewriting editorial metadata to match publish.
8. WordPress revisions are necessary but not sufficient
The sc_support_article post type enables WordPress revisions in its registration. In practice, revision retention depends on the host configuration, hooks, autosave frequency, database health, and retention settings. Revisions generally preserve core text fields, not a complete history of all post metadata, taxonomy mappings, plugin settings, import receipts, or approval decisions. An absence of recent revisions is an investigation target, not conclusive proof of deletion. Protect a database backup and original export before restoring a revision; validate the final post and its metadata after restoration.
9. Distinguish a bundled import from Content Operations
The Content Operations importer in SCFS_Support_Content_Operations::import_records() follows a separate process: it validates inputs, checks duplicates, applies a configured duplicate policy (typically skip), and creates WordPress posts. It writes batch, source-reference, source-version, and fingerprint metadata. It does not use the bundled importer’s manual-override comparison as its general update rule. A run returning “skipped duplicate” is not proof of a safe update; it may mean the editor’s existing article was never touched while a separate import record was rejected or created.
10. Identity matching and duplicate records
The bundled importer first searches for a generated content key (_scfs_integrated_kb_key), then a legacy content key (_sckb_content_key), and finally an article slug. A slug-based fallback can select a preexisting record with the same slug that was not previously part of the bundled corpus. Confirm that the current WordPress ID belongs to the intended document and that its source and taxonomy history are consistent. An apparent duplicate can also be a cache, stale index, or legacy redirect; distinguish two distinct post IDs from two URLs that resolve to one post.
11. Import failures, partial writes, and replay
An existing post update can succeed before metadata or taxonomy assignment is complete. A later failure, timeout, or plugin interruption can therefore leave a record in an intermediate state; do not infer atomicity across WordPress post, postmeta, terms, and plugin options. Capture a replay key, import report, pre-import snapshot, post-update revision, and every failed step. Retry once in isolated staging after identifying which writes already persisted. Repeat the same import twice and assert that the second run does not change approved content or create new identities.
12. Read-only WordPress audit
The companion package includes read_only_wordpress_version_audit.php. It requires an explicitly authorized WordPress administrator and reports only aggregate counts: missing fingerprints, changed title/body baselines, publication/editorial-state mismatches, approval-hash mismatches, duplicate source keys or permalinks, and a bounded revision sample. It performs no imports, repairs, or publication changes. Use it in staging first. The example assumes a verified WordPress path and an account with the required permissions.
# Replace placeholders; run only on an authorized staging WordPress site.
wp --path=/path/to/wordpress --user=AUTHORIZED_ADMIN \
eval-file read_only_wordpress_version_audit.php
# Optional: native, read-only record metadata (never publish output).
wp --path=/path/to/wordpress --user=AUTHORIZED_ADMIN post get 812 \
--fields=ID,post_type,post_status,post_name,post_modified_gmt --format=json
A hash mismatch means the record changed from its stored generated baseline, but it does not identify the editor or establish impropriety. Audit output intentionally excludes titles, messages, names, bodies, approval notes, credentials, and URLs. Keep any supplementary WordPress exports in approved private evidence storage.
13. Synthetic import model and reproducible negative tests
The supplied validate_article_import.py models the selection and write semantics of the bundled importer and checks before/after snapshots for policy-sensitive changes. It is not a WordPress compatibility layer and cannot certify live importer behavior. Fixtures are synthetic and use example.test. The bad fixture deliberately includes unsafe outcomes: missing hash, manual excerpt/slug overwrite, draft publication, duplicate keys, stale approval evidence, and revision loss.
python3 -m unittest discover -s tests -p "test_*.py" -v
python3 validate_article_import.py fixtures/valid_import.json
# Expected exit 0 and finding_count=0
python3 validate_article_import.py fixtures/adverse_import.json
# Expected exit 2 and finding_count > 0: deliberately adverse test case
# Exit 3 means malformed or unavailable input.
14. How to interpret a model finding
A MANUAL_BODY_REPLACED or MANUAL_SLUG_REPLACED finding means the synthetic after-snapshot changed a field identified as manually edited without a recorded approval. A BASELINE_HASH_MISSING finding indicates insufficient generated-baseline evidence. UNAPPROVED_STATUS_CHANGE identifies a publication-state transition in the fixture lacking an authorization record. NEW_REVISION_NOT_EVIDENCED indicates absent revision evidence under the selected test policy—not guaranteed data loss. A STALE_APPROVAL_HASH finding requires a separate, source-specific approval hash check before any editorial conclusion.
15. Staging acceptance sequence
- Create distinct synthetic articles representing unmodified generated content, human-modified body/title, excerpt-only edit, slug-only edit, missing fingerprint, draft, pending, and published status. Record pre-import WordPress IDs, hashes, revisions, and metadata.
- Run the bundled importer once from a pinned source version. Capture the full post/meta/terms diff and its import report.
- Repeat the import with the same source, then with a newer source version. Compare both replays for idempotence and intended updates.
- Simulate interruption after post update and before metadata/terms update; verify an operator can reconcile the state without data loss.
- Test authorization for editorial approval separately from native Publish/Update. Use anonymous HTTP requests to verify draft confidentiality and intended public URLs.
- Restore a previously approved revision in the staging copy; compare content, permalink, terms, public status, and approval records after restoration.
The companion staging matrix defines expected evidence for each case and begins with NOT RUN. Its existence is not a completed staging test. Live verification must state exact installed plugin version, WordPress version, operator, time, environment, sample size, and results.
16. Containment protocol for suspected overwrite
Stop only the affected import or scheduled update path; do not disable unrelated public support services without a justified incident response. Retain a snapshot of the current article before any rollback, because it may contain a second editor’s valid changes. Save the source package hash, plugin commit, import request, configured duplicate policy, last-successful job, and last-failed job. Notify the responsible content owner and technical owner through an approved channel. Use a synthetic issue ticket without private draft text; link a restricted incident record for evidence.
17. Recovery: a manual title/body was overwritten
Confirm that a trusted revision or verified backup actually contains the missing work. Investigate the generated fingerprint: was it blank, overwritten, stale, or linked to the wrong post? Determine whether the editor had changed the title/body and whether a source import was permitted at that time. In a staging clone, select the approved revision and preview a field-level diff. Restore only the required title/body/excerpt/slug fields after two-person review; keep existing permalink and taxonomy relationships unless a separate change is authorized. Re-run the importer in staging to prove the correction persists before release.
18. Recovery: slug or excerpt changed while body stayed intact
Do not restore the entire post if only one field was affected. Compare current post_name, excerpt, canonical URL, and incoming links with the documented editorial version. For a slug, preserve link equity using the site’s approved redirect mechanism and check internal links, sitemaps, and canonical directives; a redirect is not a substitute for correcting the source identity. For an excerpt, compare the editor’s summary and SEO metadata because multiple plugins may render different description fields. Add a regression case that changes only slug or excerpt, leaving the generated title/body hash unchanged.
19. Recovery: metadata or approval markers were rewritten
A body-preserving import may still rewrite summary, verification, or editorial metadata. Compare these fields with the last authorized review package and protected audit log. The approved content hash must match the actual title/body/excerpt and be attributable to a real reviewer action; do not manufacture an approval timestamp or copy an old approval hash. If review evidence is missing, mark the item for human re-review instead of presenting it as scientifically verified. A fixed source verification date is evidence of a source artifact label, not proof of new assessment.
20. Recovery: unexpected public exposure
A matched imported draft can become publicly visible because the bundled path assigns publish. Treat this as a publication-control issue until the actual deployed write sequence is verified. Capture the before/after status, operator and source, anonymous response, cache state, URL, and approval policy. If public exposure is not authorized, use a reviewed status correction and verify public REST, canonical URLs, site search, feeds, sitemaps, and cached copies. Do not delete article content or its revision history. Escalate any privacy-sensitive disclosure under the organization’s incident process.
21. Restore order and exit criteria
Use the following order: (1) evidence preservation; (2) affected-import containment; (3) identity and revision reconciliation; (4) human approval of the intended field-level delta; (5) staging recovery; (6) repeat-import regression; (7) protected production change under normal release authority; (8) independent public and administrative verification; (9) incident closure with retention controls. A restore is incomplete if public article content looks correct but the approval hash, source key, version taxonomy, or future importer behavior remains inconsistent.
22. Quantitative acceptance criteria
Report human-edited field preservation rate as the number of protected human edits remaining unchanged after import divided by the number of independently evidenced human edits tested. Report wrongful publication rate as unauthorized draft-to-public transitions divided by eligible pre-import nonpublic records. Report identity collisions per distinct imported content keys. For each numerator, retain the denominator, exclusions, sample selection, and exact source revision. A zero observed failure rate in a small test set does not establish zero underlying risk; as a rough rule, zero failures in n independent Bernoulli trials gives a one-sided 95% upper bound of about 3/n. Correlated imports, reused test fixtures, or unmeasured paths invalidate that simple bound.
preservation_rate = protected_human_fields_unchanged / evidenced_human_fields_tested
unauthorized_publish_rate = unauthorized_nonpublic_to_public / eligible_nonpublic_before
identity_collision_rate = duplicate_content_keys / distinct_content_keys_tested
# Illustrative only: 0 failures over 100 independent tests
upper_95_failure_probability_approx = 3 / 100 # 0.03, not proof of 0 risk
23. Preventive controls and engineering follow-up
For future implementations, consider requiring a nonempty generated baseline for updates, including slug and excerpt in an independently versioned edit-protection model, preventing importer-driven publication-state changes without explicit approval, retaining provenance and reviewer decisions separately from generated metadata, and making post/meta/terms updates recoverable as one coordinated operation. These are proposals; they are not described as currently implemented. Review compatibility with WordPress’s revision model, content-import ownership, multisite configuration, cache invalidation, and the organization’s documented preference for publishing on normal editor save.
24. Reporting boundary and escalation
Provide the service owner with a concise evidence packet: exact plugin commit, source content key, synthetic or protected test case ID, before/after field digests, importer report, requested status, saved status, revision count, approval decision, observed public visibility, and a reproducible step sequence. Exclude private drafts, customer names, contact data, credentials, hidden review comments, and unpublished research from public reports. Differentiate source review, independently executed offline tests, staging experiments, and live acceptance. If a discrepancy cannot be reproduced or the pre-import state is missing, classify it as unresolved rather than asserting loss of work.
25. Technical references and version boundary
- Bundled importer, fingerprints, and metadata
- Separate Content Operations importer
- WordPress Support Article post type and editor
- Editorial state, approval hash, and publication filter
- Importer contract test
- Imported Knowledge Base architecture
- Content Operations and product onboarding
Reviewed repository commit: 29a2bbfec41bdae059d31eff1aac1b6bfea9e129; plugin version declared in that source: 7.8.1. This article does not certify the deployed site or claim that historical revisions are recoverable without verified backups. The supplied regression suite and read-only WP-CLI example are diagnostic instruments, not a production patch.
