Worked Examples
Apply research area catalog — Sustainable Catalyst Research Hub
Apply research area catalog — Sustainable Catalyst Research Hub Application: Sustainable Catalyst Research Hub Status: Useful first draft, not a production-verified procedure. Purpose Organize public research themes without reveal
Application: Sustainable Catalyst Workspace
Documentation type: Troubleshooting / developer operations reference
Component: Project recovery and scientific lineage (reference validation package)
Estimated reading time: 19–23 minutes, excluding command execution and operator review
Evidence revision: 81984e335e471a8938fad8b61676e430a89cecac
Last production-verified version: Not established; assign in Knowledge Base metadata only after deployed acceptance.
Goal
Identify why a Workspace project appears incomplete after session loss, partial application failure, or a recovery exercise; preserve every accepted research artifact and its audit trail; and establish whether recovered sources, methods, and outputs remain linked to exactly the reviewed evidence. The core acceptance statement is: a recovered project must not silently lose accepted records.
Separate three questions throughout: (a) does a user have a usable session, (b) does persisted project state match an authoritative recovery point, and (c) does the reconstructed research maintain its scientific meaning and approvals? A successful sign-in or 200 response answers neither (b) nor (c).
Requirements
- Read-only investigation: project and tenant identifiers, the intended artifact/revision, last independently accepted snapshot, authorized audit access, and sanitized error/trace references.
- Local reference exercises: macOS or Linux with Git and Python 3.10 or later (Python 3.12 recommended for reproducible team environments; macOS Python 3.15.2 has a recorded passing run). No third-party Python libraries are required for the pinned package.
- Restoration exercises: a disposable, segregated environment and approved, verified backup; explicit operator authority, rollback plan, and no shared production databases or credentials.
- Publication boundaries: distinguish draft, reviewed, accepted, and published, with actor rights and exact artifact revisions documented before any state transition.
Stop condition: If tenant scope, recovery point, source integrity, or authorization is uncertain, preserve current evidence and do not issue a restore or repeat an uncertain mutation.
Symptoms
- The project opens but an accepted document, notebook, dataset, figure, or report revision is missing.
- A restored artifact appears under a different owner, project, or tenant.
- Revision numbers decrease, source or method identifiers change, or an output checksum no longer matches the accepted record.
- Audit history shows missing events, unrecognized actors, contradictory timestamps, or broken parent revisions.
- Recent changes vanish on reload, or the UI reports a save despite stale or partial persisted state.
- A draft appears public after recovery, or an accepted scientific link loses its review classification.
Cause
| Symptom | Likely category | Decisive check |
|---|---|---|
| Expired session or missing role | Identity / permission boundary | Reauthenticate through approved Workspace sign-in; verify authorized project mapping without exposing tokens |
| Object not found or incorrect project | Scope or identifier mismatch | Compare immutable project, tenant, object, and revision IDs |
| Accepted artifact absent | Incomplete snapshot or restore | Compare accepted object inventory before/after using exact artifact IDs |
| Digest or method changed | Scientific lineage mismatch | Compare source revision, method revision, output digest, and accepted artifact revision |
| Revision gap or orphan event | Audit/persistence integrity | Validate event IDs, monotonic revision chain, parent revisions, timestamps |
| Page shows old state | Cache or partial dependency | Compare authoritative persistence and revision headers before interpreting UI |
| Public exposure of draft | Publication authorization failure | Freeze publication and independently inspect exact-revision approvals |
Immediate containment
When there is evidence of lost accepted records, broken lineage, or unauthorized exposure: suspend the affected write/publish operation; retain a read-only copy of relevant sanitized IDs, timestamps, response status, and correlation identifiers; and preserve the original backup and audit history. Do not clear storage, rerun migrations, change revision counters, or invent audit events to make a recovered snapshot appear complete. A failed restore should remain inspectable.
Procedure
Establish the authoritative state
- Record the signed-in environment, organization, project ID, intended object, and exact accepted revision.
- Identify authoritative persisted records and their capture time; distinguish a browser cache, application draft, durable database row, and an independently backed-up artifact.
- Build a before/after inventory: object ID, revision, lifecycle status, content digest, source ID/revision, method ID/revision, output ID/digest, evidence class, and review state.
- Confirm the approved snapshot timestamp and whether events occurred before or after capture; never discard legitimate later activity silently.
- Compare audit events and scientific links against the same project and tenant boundary, then document exceptions.
- Only after the reference checks pass, proceed to release-specific integration checks for authenticated users and actual storage restoration.
GitHub source code and immutable evidence
The publicly accessible Workspace repository contains the merged validation package. Review PR #68 and pin any published evidence to commit 81984e335e471a8938fad8b61676e430a89cecac, not a moving main link.
- Package README and verification boundaries
recovery_validation.py— snapshot, event, and accepted-artifact continuityscientific_recovery.py— source/method/output provenance continuitytest_recovery_validation.py— 19 recovery regression teststest_scientific_recovery.py— 20 scientific continuity tests
Evidence interpretation: the merged code and prior passing test log establish a reproducible reference suite. They do not prove that the deployed Workspace application invokes these modules, nor that production credentials, persistence, or restored data were tested.
Mac Terminal — clean, reproducible checkout
Run these commands in macOS Terminal. A temporary checkout avoids changing any existing Workspace development branch or overwriting user files. The exact commit is checked out in detached mode, deliberately preventing accidental commits to main.
set -euo pipefail
python3 --version
git --version
WORKDIR="$(mktemp -d "${TMPDIR:-/tmp}/sc-recovery-mac.XXXXXX")"
echo "Disposable checkout: $WORKDIR"
git clone --filter=blob:none https://github.com/Content-Catalyst-LLC/sustainable-catalyst-workspace.git "$WORKDIR/workspace"
cd "$WORKDIR/workspace"
git checkout --detach 81984e335e471a8938fad8b61676e430a89cecac
cd scientific_validation/workspace_recovery
python3 -m unittest -v test_recovery_validation test_scientific_recovery 2>&1 | tee test-results-local.txt
shasum -a 256 recovery_validation.py scientific_recovery.py test_recovery_validation.py test_scientific_recovery.py
git rev-parse HEAD
Expected: the final test summary reports Ran 39 tests followed by OK. If the python3 command is unavailable, install an appropriate Python version first, for example using Homebrew. Do not run a broad system upgrade solely to execute this reference package. A local failure is evidence to investigate, not a reason to modify production data.
Linux Terminal — isolated local verification
Run on a Linux workstation or disposable development VM, not an application production host. Use the installed python3 and git; on Debian/Ubuntu, if missing, approved administrators can install python3 and git through the system package manager. Do not mount production databases, volumes, or secrets to run the synthetic suite.
set -euo pipefail
python3 --version
git --version
WORKDIR="$(mktemp -d /tmp/sc-recovery-linux.XXXXXX)"
echo "Disposable checkout: $WORKDIR"
git clone --filter=blob:none https://github.com/Content-Catalyst-LLC/sustainable-catalyst-workspace.git "$WORKDIR/workspace"
cd "$WORKDIR/workspace"
git checkout --detach 81984e335e471a8938fad8b61676e430a89cecac
cd scientific_validation/workspace_recovery
python3 -m unittest -v test_recovery_validation test_scientific_recovery 2>&1 | tee test-results-local.txt
sha256sum recovery_validation.py scientific_recovery.py test_recovery_validation.py test_scientific_recovery.py
git rev-parse HEAD
The sha256sum command is the Linux analogue of macOS shasum -a 256. Both produce hashes of the downloaded code files; those hashes document the executed source but do not verify the bytes of an actual scientific dataset or restored artifact.
Terminal exercise — reproduce a rejected recovery
From the package directory on either macOS or Linux, execute the following. It uses the package’s documented synthetic test fixture and intentionally removes an accepted artifact; it performs no database or network writes.
python3 - <<'PY'
from dataclasses import replace
from test_recovery_validation import fixture
from recovery_validation import compare_recovery, RecoveryError
before = fixture()
after = replace(before, artifacts=(), events=())
try:
compare_recovery(before, after, "tenant1")
except RecoveryError as exc:
assert str(exc) == "accepted_artifact_missing", str(exc)
print("PASS: rejected recovery missing accepted artifact")
else:
raise SystemExit("FAIL: loss of accepted artifact was not detected")
PY
The expected output is PASS: rejected recovery missing accepted artifact. The validator’s exception accepted_artifact_missing is a reference-model error name, not a documented production HTTP error code.
Contract reference — what is actually implemented
The merged reference source defines Python dataclasses Snapshot, Artifact, Event, and ScientificLink. It exports verify_snapshot(snapshot, tenant_id), compare_recovery(before, after, tenant_id), validate_links(snapshot, links), and verify_scientific_recovery(before, after, before_links, after_links, tenant_id).
Snapshot validation checks tenant identity, time-zone-aware timestamps, unique object/event IDs, syntactically valid 64-character hex digests, linear event revisions, acceptance events, and published-state event consistency. Recovery comparison checks that originally accepted/published artifacts remain present without revision regression or same-revision digest changes and that original audit-event IDs remain represented. Scientific continuity additionally checks recorded source/method/output IDs and revisions and rejects changes to accepted scientific links.
Important implementation limit: a digest-shaped string is not the same as rehashing real file bytes; lifecycle labels are not signed authorizations; and the reference assumes a linear history rather than branching/merging provenance graphs.
Failure classification and safe responses
| Reference error / class | Interpretation | Safe next action |
|---|---|---|
tenant_mismatch |
Snapshot belongs to another tenant | Stop; check identity and project scope; do not cross-load records |
revision_gap / broken_revision_lineage |
Event chain does not reconstruct declared artifact revision | Retain both histories; investigate provenance and missing events |
accepted_artifact_missing |
Previously accepted artifact absent after recovery | Block acceptance and compare authoritative restore inventory |
accepted_digest_changed |
Same accepted revision now has another recorded digest | Preserve both objects; verify bytes and provenance independently |
audit_event_missing |
Prior audit-event identity no longer present | Do not fabricate an event; investigate source logs and backup integrity |
accepted_scientific_lineage_missing |
Accepted scientific derivation link disappeared | Reconcile exact output, source, and method references |
unreviewed_or_unpublished_public_link |
Public scientific link has invalid synthetic review/publication state | Hold public release; require actual rights/review/identity checks |
Handling uncertain writes and retries
An interrupted save can be successful on the server even when the client reports a timeout. Before retrying, query the authoritative state through the actual documented application interface, compare object revision and stored operation identity, and determine whether the operation is idempotent. Do not assume that a request retry creates an equivalent revision. If the implementation supports an idempotency key or revision precondition, follow its published contract; neither is established by the synthetic package.
For incomplete dependencies, distinguish client rendering failure from persistence failure. Preserve nonsecret status, trace ID, request time, object revision, and affected component. Never include session cookies, OAuth tokens, real research datasets, or internal network details in public GitHub issues.
Diagnostic decision tree
- Access denied? Verify user-to-project authorization and tenant scope; stop if unresolved.
- Record absent? Compare accepted inventory with immutable backup and audit history.
- Record present, version differs? Check parent revision, capture time, and legitimate later writes.
- Version matches, scientific result differs? Rehash actual output bytes and independently rerun the documented method with pinned inputs; synthetic checks alone are insufficient.
- UI differs from stored state? Diagnose session/cache/read-model freshness without rewriting accepted records.
- Privacy or publication mismatch? Disable exposure, review exact-revision authorization, and escalate as a release blocker.
Evidence collection on macOS and Linux
After the unit test command has completed, record execution environment and exact source revision using the following command in the disposable checkout’s validation directory. Keep the resulting log and metadata as locally controlled evidence until reviewed for public release.
python3 - <<'PY'
import json, platform, subprocess, pathlib, datetime
root = pathlib.Path.cwd()
data = {
"scope": "synthetic-reference-only",
"source_commit": subprocess.check_output(["git","rev-parse","HEAD"], text=True).strip(),
"python": platform.python_version(),
"os": platform.platform(),
"run_at_utc": datetime.datetime.now(datetime.timezone.utc).isoformat(),
"test_log": "test-results-local.txt",
"production_workspace_recovery_verified": False
}
(root / "local-evidence-metadata.json").write_text(json.dumps(data, indent=2)+"\n")
print(json.dumps(data, indent=2))
PY
Attach a sanitized receipt to a GitHub issue or PR only after checking that it contains no private usernames, home-directory paths, internal endpoints, or source data. A test transcript is evidence of a particular test execution, not proof that a production restore was completed.
Staging restore acceptance — separate from the reference tests
A real restore exercise requires independent off-host backup evidence, a disposable isolated database, fixed source/image versions, migrator compatibility assessment, a known restore point, an explicit operator, and rollback capability. On staging, compare record counts and exact accepted artifact IDs; verify revision and audit continuity; revalidate source/method/output relationships; then sign in with authorized test identities to exercise same-owner access, cross-owner denial, logout/revocation, and fail-closed behavior.
Do not provide an unverified docker compose, SQL restore, or cloud-host command in a public guide: Workspace’s current deployed backup topology and schema migration state must be established by the release runbook first. No staging or production restore is claimed by the 39 passing tests.
Resolution
Close the incident only when the correct project and tenant have been independently confirmed; accepted records are reconciled against the authoritative recovery point; audit events and exact scientific lineage are intact; unauthorized disclosure is absent; and a documented regression or read-model fix reproduces the behavior. If any of these checks fails, label the state not accepted, retain both before/after evidence sets, and escalate to the relevant application and data owner.
Troubleshooting
Python reports import errors: ensure the shell is in scientific_validation/workspace_recovery and that both test modules exist. Git checkout fails: confirm network access and the commit SHA; do not substitute an unreviewed branch. 39 tests pass but the UI is still broken: that is expected to be possible, because the suite has no live Workspace integration. Digest comparison passes but output looks wrong: inspect and hash the actual artifact bytes and independently reproduce the analysis. Restore was interrupted: stop further writes and preserve the failed state for a governed recovery assessment.
Acceptance and test matrix
| Control | Synthetic reference | Deployed Workspace acceptance |
|---|---|---|
| Accepted artifact remains present | Executed locally: negative case covered | Must compare actual persisted artifacts and backed-up bytes |
| Audit event continuity | Executed locally: event-ID and revision checks | Must verify authoritative event storage and actual actor identity |
| Scientific source/method lineage | Executed locally: IDs and revisions | Must verify actual source objects, method runtime, outputs and independent reproduction |
| Tenant isolation | Executed locally: tenant identifier mismatch | Must verify real authentication, authorization, and cross-owner denials |
| Public visibility | Executed locally: synthetic state labels | Must verify signed approvals, rights, and actual public routes |
| Database restore / rollback | Not implemented | Requires isolated restore receipt, migration compatibility, and approved runbook |
Support escalation and issue template
Open a GitHub issue only for a reproducible public-code defect. For private project or production incidents, use the authorized internal incident channel. A useful sanitized report contains: affected component and code commit; test command and Python version; synthetic fixture or minimal redacted reproduction; expected/actual error identifier; relevant nonsecret trace reference; evidence capture timestamp; and whether the failure concerns local validation, staging, or production. Avoid attaching private manuscripts, raw data, credentials, session identifiers, or internal infrastructure details.
