Worked Examples
Developer reference for research workspaces — Workspace
Developer reference for research workspaces — Workspace Application: Workspace Status: Useful first draft, not a production-verified procedure. Proposed or audited service responsibility Support the following capability: associate
\
Application: Workspace
Product component: Research Projects / Integrated Project Workspace
Article type: Developer reference / integration contract
Source baseline: 20 November 2026; pinned source commit 2a67ee5
Verification status: Source inspected; deployed version, staging acceptance and independent review pending
Estimated reading time: 19 minutes
Goal
Implement and review a research workspace in which a research question, source material, datasets, notebooks, visual outputs, decisions and manuscript drafts are associated with the correct owner-scoped project. The implementation must preserve the specialist system of record, permit revision-safe updates, and distinguish private work from editorial approval and public publication.
Primary developer acceptance: each artifact is accessible only in an authorized research context, and its origin, revision, references and intended inference can be independently checked. Merely seeing an artifact in a dashboard is insufficient proof of identity, legal rights, data integrity, methodological correctness or publication approval.
Requirements
- An isolated development or staging Workspace environment and an owner-authorized session. Use disposable synthetic projects and test identities.
- A pinned Workspace source checkout; inspect the route and schema definitions before relying on any API example.
- Explicit research question, research area, project identity and responsible owner; source licenses, access rights and privacy classification should be separately documented.
- For server-backed paths, a functioning project registry, session-identity service, artifact store and the dependencies required by the selected component.
- Test harness support for both authorized and unauthorized owners, including denied write Origin and stale revision cases.
- Evidence from the actual target deployment before recording a supported product version or marking the article technically verified.
01. System boundaries and sources of authority
Workspace comprises multiple related workflows. They must not be flattened into one authority model:
| Component | Authority / behavior | Important boundary |
|---|---|---|
| Guest / first-run Workspace | Explicitly creates a browser-local project; supported starter shapes include blank, research investigation, analytical assessment, decision case and publication preparation. | Signing in does not by itself upload or synchronize local content. |
| Authenticated Research Projects | Stores a revisioned, owner-scoped Workspace project with research profile in the backend registry. | A project created here starts private; it does not publish to Research. |
| Research Project dashboard | Aggregates project overview, documents, citations, notebooks, data files, figures and private outputs. | A read projection; the underlying records retain their original authority. |
| Integrated Project Workspace | Aggregates source/evidence, datasets, model runtimes, visual analysis and session timeline by owner and project. | No generic write operation, automatic interpretation, truth assessment or execution. |
| Unified Research Context | Builds a reference-first research context and immutable context snapshots. | Platform Core remains authoritative for its linked cross-product research-session registry; snapshots are not alternate mutable stores. |
| Publication workflow | Maintains draft, Research binding, approval and publishing transitions in separate governed paths. | A private publication output or author-controlled draft is not a public article or independently reviewed scientific finding. |
Source references: Research Projects, Integrated workspace, Unified context, First-run creation specification and Research publication transitions.
02. Implemented Research Projects route inventory
The Reporting Studio router defines the shared prefix /v1/private-research/reporting-studio, and its Research Projects router adds /research-projects. These are source-level contracts, not claims that any particular live host exposes them.
| Method | Relative path under .../research-projects |
Contract and effect |
|---|---|---|
GET |
/api/projects |
Owner-scoped list, research areas and available project types. |
POST |
/api/projects |
Create research-profile project; new project 201, exact retry 200. |
GET |
/api/projects/{project_id} |
Owner-scoped aggregated dashboard. |
POST |
/api/projects/{project_id}/setup |
Idempotently attach a matching research-profile project to the private research store. |
POST |
/api/projects/{project_id}/overview |
Update research question, description, status, objectives and milestones using expectedProjectRevision. |
POST |
/api/projects/{project_id}/documents |
Add an immutable, project-scoped native file; rejects duplicate bytes and conflicting filename. |
GET |
/{project_id}/files/{artifact_id}/content |
Read authorized file bytes; the backend checks the recorded SHA-256. |
GET |
/api/projects/{project_id}/trash |
Read bounded trash status for project assets. |
POST |
/api/projects/{project_id}/delete |
Restricted destructive operation; only certain empty projects created here qualify. |
Related workspaces are linked through separately scoped URLs, including /v1/desk/notebooks?project=... and the private Publication Studio. A user-facing link is not permission to call or mutate another subsystem.
03. Project creation and identity schema
The implementation accepts the ProjectIn request below for the authenticated Research Project creation endpoint. This is a synthetic contract fixture; use the actual application UI for operational creation unless an approved developer environment is available.
{
"creationKey": "0b7c6a52-6f0e-4c51-9a55-1f1f8a3e2c11",
"title": "Synthetic coastal soil inquiry",
"area": { "slug": "climate-land-carbon" },
"researchQuestion": "How do synthetic observations differ?",
"description": "Disposable, synthetic project only.",
"projectType": "investigation"
}
Required values include a UUID-form creationKey, title, area and research question. Supported projectType values are investigation, paper, policy-analysis, data-methods and other. The backend produces a project with schema sc-workspace-project/20.0 and profile schema sc-research-project-profile/1.0.
Idempotency nuance: the generated project ID combines a title-derived slug with a digest of the owner and creation key. A retry must reuse both the same title and the same creation key, after inspecting the owner-scoped project list. Changing the title or key while recovering from a failed response can create a different project. Do not blindly retry network writes.
// Contract example, not a live operation: do NOT run against production.
// POST /v1/private-research/reporting-studio/research-projects/api/projects
// Content-Type: application/json
// Origin: https://workspace.sustainablecatalyst.com
// Credentials: authenticated browser session cookie (never copied into code)
// Expected: 201 { project, created: true, dashboardUrl }
// Repeat the SAME title + creationKey after inspecting existing state:
// Expected: 200 { project, created: false, dashboardUrl }
04. Read model: project-to-artifact mapping
The dashboard response declares sc-research-project-dashboard/1.0. It is assembled from the canonical project record and a set of related repositories and projections:
| Response field | Source and interpretation | Verification required |
|---|---|---|
project, profile, overview |
Owner-scoped project registry, research-profile object and revision history. | Owner, project ID, profile schema and current revision. |
documents.registered, documents.files |
Document register, native immutable artifacts and permitted legacy views. | Actual file digest, parent project, content rights and role. |
library.items |
Citation Studio reference collection within the project package. | Bibliographic identity, source rights, exact use in methodology. |
analysis.notebooks |
Notebook heads queried by user_key and project_id. |
Notebook revision, dataset inputs, execution environment and outputs. |
analysis.datasets |
Native artifact files with the data document role. |
Record-level provenance, units, quality and consent/rights. |
figures.files, figures.reports |
Figure-role files and stored research report references. | Data-to-visual encoding, aggregation and transformations. |
publications.outputs |
Private report/manuscript snapshots, their scientific status and optional private Research article binding. | Distinct publication approvals, actual public visibility and independent scientific review. |
Important: a decision record, even when shown by another Workspace or specialist component, requires its own authoritative object identity, rationale and evidence relationship. Do not assume this dashboard emits a complete decisions collection or that all relationships are stored as native links.
05. Read-only browser inspection
These examples make GET requests only from an already-authorized Workspace origin. They do not create or alter records. Do not copy session cookies, private outputs or complete project payloads into public bug reports.
// Read-only demonstration. Run only on your authorized Workspace origin.
const base = '/v1/private-research/reporting-studio/research-projects';
const res = await fetch(`${base}/api/projects`, {
method: 'GET', credentials: 'same-origin', cache: 'no-store',
headers: { Accept: 'application/json' }
});
if (!res.ok) throw new Error(`Workspace list failed: ${res.status}`);
const payload = await res.json();
if (payload.schema !== 'sc-research-project-list/1.0') {
throw new Error('Unexpected project-list schema');
}
console.table(payload.projects.map(p => ({
projectId: p.projectId, revision: p.revision,
privateResearchStore: p.privateResearchStore, kind: p.kind
})));
// Read-only inspection for an authorized project, from the Workspace origin.
const projectId = 'REPLACE_WITH_YOUR_AUTHORIZED_PROJECT_ID';
const path = '/v1/private-research/reporting-studio/research-projects/api/projects/'
+ encodeURIComponent(projectId);
const response = await fetch(path, {
method: 'GET', credentials: 'same-origin', cache: 'no-store',
headers: { Accept: 'application/json' }
});
if (response.status === 401) throw new Error('Sign in again');
if (response.status === 404) throw new Error('Project not found for this owner');
if (!response.ok) throw new Error(`Read failed: ${response.status}`);
const d = await response.json();
if (d.schema !== 'sc-research-project-dashboard/1.0') {
throw new Error('Unexpected dashboard contract');
}
if (d.project.projectId !== projectId) throw new Error('Project mismatch');
console.table({
revision: d.project.revision,
datasets: d.analysis.datasets.length,
notebooks: d.analysis.notebooks.length,
figures: d.figures.files.length,
privateOutputs: d.publications.outputs.length
});
If the deployment is not at the documented routing baseline, stop and compare the route registration and response schema with the deployed artifact. A 200 response alone does not establish a valid project or correct scientific result.
06. Revision-safe overview updates
The backend stores project revisions and fingerprints. A research overview update takes the exact expectedProjectRevision observed during the last authorized read. An outdated revision results in 409; the caller must reload and reconcile changes rather than overwrite the current record.
{
"expectedProjectRevision": 1,
"researchQuestion": "What does the synthetic comparison show?",
"description": "Document the revised analysis scope.",
"status": "active",
"objectives": ["Preserve source files", "Repeat numerical analysis"],
"milestones": [{"title": "Independent method review", "due": "2027-02-15", "done": false}]
}
Never substitute client timestamps for the authoritative revision. Source behavior distinguishes sc-workspace-sync-push/1.0 from manual backup, and an active sync head cannot be replaced by a manual backup. Use revision receipts and the project registry for authoritative state.
07. Native file upload and integrity contracts
Native files are stored as project-scoped artifacts with an artifactId, filename, MIME type, byte count, SHA-256 and role. Document roles include report, paper, draft, source, reference, data, figure and other. File upload uses Base64 bytes and validates safe filenames and supported extensions.
{
"filename": "synthetic-input.csv",
"contentBase64": "BASE64_OF_DISPOSABLE_SYNTHETIC_FILE",
"role": "data"
}
The implementation rejects duplicate hashes (409), filename conflicts (409), unsafe paths (400), unsupported extensions (415) and overlarge payloads (413). Reading authorized native bytes verifies SHA-256 and rejects tampered stored content (409).
Security and science boundary: a correct digest establishes byte equality only. It cannot establish the creator’s identity, lawful reuse, measurement quality, reproducibility, or that a figure accurately represents its underlying measurements.
import hashlib
from pathlib import Path
source = Path('synthetic-input.csv') # authorized, disposable test file
observed = hashlib.sha256(source.read_bytes()).hexdigest()
print({'source_sha256': observed, 'bytes': source.stat().st_size})
# Compare observed SHA-256 with the project's stored artifact metadata.
# Matching bytes do not establish lawful rights or scientific validity.
08. Notebook, figure and result relationships
The dashboard resolves notebook heads using the authenticated owner and project ID and exposes their revisions plus a project-scoped Notebook Desk URL. For each numerical result or figure, the developer or independent reviewer should separately record the input artifact identifiers and checksums, notebook or method revision, environment/package versions, transformations, calculation outputs, excluded data and uncertainty treatment.
Where a figure or result originates in Lab, Workbench or a visualization subsystem, retain its external canonical identifier rather than creating a misleading duplicate source of truth in Workspace. A dashboard count or generated report label is not a substitute for an explicit source-to-mark relationship.
09. Integrated and unified research context
The Integrated Project Workspace declares sc-workspace-integrated-research-project/1.0 and groups evidence, datasets, models, visual analysis and session timeline under a server-side owner/project lookup. The implementation reports source authority preservation and declares genericMutation=false and no automatic truth determination or execution.
The separate Unified Research Context defines sc-workspace-unified-research-project-context/1.0 and an immutable snapshot schema. Its snapshots include a project revision, project fingerprint, context fingerprint, and optional linked Core session ID. Reference-first snapshots aid replay and audit but cannot replace a scientifically complete method or a supported backup policy.
Relevant documented context routes include GET /v1/research-context/projects/{project_id} and POST /v1/research-context/projects/{project_id}/snapshots. Verify that these routes are registered and authorized in the target release before calling them; snapshot creation is a write operation.
10. Security, tenancy and identity constraints
- Private-project access resolves the signed browser session subject on the server; client-supplied project ownership is not authoritative.
- Cross-owner access to the same private project returns
404in the implementation tests, avoiding existence disclosure; a missing authenticated session returns401. - Research writes check an authorized
Originand may return403when the origin is invalid; exact policy must be confirmed for the deployed origin. - Page-based sign-in redirects are distinct from JSON API failures; do not treat a
303on an HTML page as successful API authorization. - The test-only
x-test-subheader in isolated fixtures is a mocked identity injection, not a production authentication mechanism. - Separate institutional role, scientific reviewer, legal owner, account subject, and publication approver. Technical access does not supply those other authorizations.
11. Local-first versus authenticated persistence
The browser-first Workspace experience can be used without signing in. The first-run implementation explicitly states that project creation writes locally; signing in does not automatically upload content. Backup and sync are separate, consentful actions. The authenticated Research Projects and associated private reporting services are server-backed, owner-scoped workflows. Do not promise cross-device persistence for an unbacked local project, or imply that clearing local storage deletes a server-backed research project.
12. Publication and institutional review boundary
The Research Project dashboard returns private publication outputs and an optional binding to a private Research article. This is not a public-release receipt. Later scientific, rights, ownership and publication approvals belong to separate governed workflows. The source defines these four approval dimensions, but their live availability and independent reviewer configuration must be validated separately. Preserve rights, uncertainty, reviewer identity and public visibility as independently inspectable states.
Procedure
- Pin the release: inspect the Workspace source commit, route mounts, deployed artifact identifier, migration state and environment configuration. Do not infer deployed support from this source-only reference.
- Establish the owner: create two disposable authenticated principals in isolated staging; record session claims privately without exposing session secrets.
- Inspect before creating: read
/api/projects; check for an existing project matching the intended operation, and retain the original title and creation key for uncertain retries. - Create a synthetic project: use the approved UI or a controlled staging API call; record
201, canonical project ID, initial revision, research-area binding and private status. - Attach artifacts: add one harmless dataset, one notebook, one figure and one draft under the same project. Record native IDs, bytes, digests, revisions and source rights outside public logs.
- Inspect the read model: read the project dashboard and verify each visible object belongs to the expected owner and project, including the Notebook Desk query parameter.
- Exercise revision controls: update the overview with the current expected revision, then try the stale revision on disposable data. Require a conflict instead of silent overwrite.
- Exercise privacy: attempt each private read and mutation as another test user and without a session. Require denial without project-content disclosure.
- Cross-check science and publication: verify source bytes, notebook input lineage, figure transformation and the private/unreviewed state independently. Record unresolved limits.
- Preserve an acceptance packet: save sanitized requests, responses, commit/digest, exact test run, environment, negative results, deployment evidence and explicit human review conclusions.
13. API error and control matrix
| Observed class | Possible source-backed cause | Safe developer response |
|---|---|---|
401 |
Missing, expired or invalid browser session. | Re-authenticate; preserve unsaved local work; do not assume project deletion. |
403 |
Unauthorized write Origin or another access policy failure. | Compare same-origin configuration; do not disable CSRF/Origin checks. |
404 |
Missing project, file, or cross-owner resource. | Inspect owner context and IDs privately; avoid enumerating other owners’ records. |
409 |
Stale project revision, duplicate artifact bytes/name, invalid project lifecycle transition or integrity failure. | Reload current state, compare source revision, resolve conflict without forced writes. |
400 / 415 / 413 |
Unsafe filename, unsupported file type, or configured size ceiling. | Correct the synthetic test input; do not bypass validators. |
422 |
Invalid creation payload, unknown area, missing field or confirmation mismatch. | Validate request against the pinned Pydantic model and actual response. |
503 |
Reporting Studio disabled or dependent service unavailable. | Stop mutation attempts, inspect feature flags and service health; reconcile uncertain outcomes. |
HTTP status is contextual: the same code can have different causes across routes. Capture the sanitized response body and trace ID; never publish cookies, research content, private identifiers or credentials.
Symptoms
- A research project or notebook is missing from the dashboard but appears in another workspace or browser.
- A project creation request timed out, then a retry created a second project.
- An upload reports a duplicate even when the filename differs, or a file cannot be viewed after ingest.
- An overview update fails with a stale revision or a known project unexpectedly behaves as read-only.
- A project exists but
privateResearchStorereportsnot-attachedorunavailable. - A figure exists without a validated source-dataset relationship, or a draft is mischaracterized as published.
Cause
Likely causes include: confusing browser-local with server-backed state; expired or mismatched sessions; cross-owner or cross-project lookup; a persisted project with an interrupted private-store attachment; stale optimistic concurrency revision; unexpected project profile/schema; content hash mismatch or duplicate immutable upload; feature flags or service dependencies; and a missing scientific provenance relationship that the dashboard was never designed to infer.
Do not attempt to infer a single root cause from a generic 409 or 503. The read model’s successful load is not a material proof of provenance, institutional authority or reproducibility.
Troubleshooting
- Read the owner-scoped project list; reconcile the project ID, title, current revision, kind and
privateResearchStorestatus. - Confirm whether the user worked in the browser-local flow or the signed Research Projects flow. Check account backup/sync enrollment rather than inventing missing server data.
- For a partial creation, keep the original creation key and title; confirm the stored project exists before invoking idempotent setup.
- For
409on overview, fetch the latest revision and compare competing edits. Do not force an update. - For missing notebooks, inspect the authoritative
NotebookHeadowner/project association; for missing figures, check role, native artifact metadata and source adapter. - For missing source relationships, inspect the specialist system’s canonical objects; do not manufacture lineage links just to clear a dashboard warning.
- For a public/private discrepancy, stop publishing and consult the Research authority and approval receipts before changing visibility.
- When outcome remains ambiguous, preserve sanitized evidence and escalate the exact failing route, deployment digest, request ID, user role and expected revision to the component owner.
Resolution
Close the incident only when the original authorized project is identified, a stable owner-scoped backend revision is observable (or the browser-local boundary is correctly documented), the relevant artifacts and method links are independently reconciled, all rejected access cases remain denied, and private drafts have not been promoted to public status. A schema-compatible read, an unverified journal entry or a passing local test does not replace this acceptance.
Where a defect requires code change, link the fix, PR, review decision, isolated regression test, release artifact digest and staging rollback evidence. Do not delete a populated project to repair a dashboard; the Research Projects deletion path is intentionally limited to eligible empty projects.
14. Reproducible local contract fixture
The companion package includes synthetic_project_dashboard.json, a standard-library checker, and 30 small unit tests. The fixture mirrors selected source-defined dashboard fields but is not a captured server response, a comprehensive schema validator, an auth service or a scientific certification engine.
# From the downloaded developer package; no network access is used.
python workspace_contract_check.py examples/synthetic_project_dashboard.json
python -m unittest discover -s tests -v
The positive fixture is classified structural-pass-only. Negative tests cover cross-project notebook links, missing IDs, wrong profile, malformed artifact SHA-256, duplicate artifact IDs, absent private-store attachment, unexpected public-visibility claims and inconsistent publication bindings. Inspect these locally before attempting any authorized staging tests.
15. Pinned implementation test commands
Run the actual Workspace tests inside a disposable, isolated checkout with the repository’s test dependencies. Do not point fixtures, environment variables, object-store roots or databases at production. The following tests exist in the inspected commit; they were not executed as part of this article update.
# From a disposable checkout of the pinned Workspace source commit:
git checkout 2a67ee5178f38b7710003715fd4d655c7deff32d
cd backend
# Use an isolated virtual environment with the repository's test dependencies.
python -m pytest -q \
tests/test_sc_research_project01_project_workspace.py \
tests/test_unified_research_project_context_v3200.py \
tests/test_integrated_project_workspace_v3800.py
The Research Projects suite uses synthetic identities and an isolated SQLite test database; verify those isolation conditions before executing in another environment. The integrated workspace test mainly checks profile flags, not all individual cross-system relationships.
Verification
| Verification tier | Required outcome | Current status for this article |
|---|---|---|
| Source contract | Pinned routes, schemas, owner filters, revision/conflict rules and boundaries inspected. | Source inspected at 2a67ee5. |
| Offline synthetic | Companion fixture checker and its negative tests pass without networks or user data. | 30/30 passed locally; structural only. |
| Repository integration | Workspace’s real isolated tests pass on pinned source with reproducible logs and digests. | Not executed in this update. |
| Authorized staging | Owner-scoped project and artifact creation, stale revision, cross-owner rejection, rights and publication boundaries checked on the candidate deployment. | Unobserved. |
| Production | Identified release, rollback plan, tenant/privacy gate, persistence, backups and operator approval. | Unobserved. |
| Scientific / editorial | Independent reviewer validates method, data rights, source interpretation and publication decision. | Pending. |
Acceptance matrix: positive project creation and read; exact retry returns the same project; owner B receives no owner A content; signed-out API access denied; invalid Origin denied; stale overview update rejected; duplicate name/bytes rejected; file content hashes verified; notebook project binding correct; local guest project not automatically backed up; draft remains private; absent rights or evidence remains unresolved.
16. Source evidence versus review claims
For a verification receipt, bind each technical assertion to its exact code path and test, the application commit and release artifact, plus the currently published article text revision. If article wording changes, review the wording again without erasing earlier software evidence. SC-KB-VERIFY-01’s WordPress mapping work can help attach a canonical article identity and content digest, but it does not imply the live article was mapped or independently accepted.
{
"article": "Developer reference for research workspaces — Workspace",
"source_commit": "2a67ee5178f38b7710003715fd4d655c7deff32d",
"source_inspection": "complete",
"offline_synthetic_tests": "30 passed",
"repository_tests_executed_here": false,
"staging_deployment_verified": false,
"production_deployment_verified": false,
"independent_scientific_review": false,
"supported_deployed_version": null
}
17. Metadata and release acceptance
Proposed WordPress component: Workspace → Research Projects / Integrated Project Workspace. Supported version: unassigned until supported deployment evidence is reviewed. Last verified version: pending. The source contains historical subsystem version declarations, but these do not establish the current production release. Link this article to its exact release or reviewed issue only after an owner confirms the deployment.
Editorial publication, technical verification, independently reviewed science and public Research publication are separate statuses. Retain the authoritative quality score and unresolved checks; this document does not override them.
18. Technical references
- Workspace — Research Projects routes, request models, read projection and private-store binding, pinned commit.
- Workspace — revisioned, owner-scoped project registry and mutation receipts, pinned commit.
- Workspace — authenticated subject, Origin check and owner-scoped project lookup, pinned commit.
- Workspace — Integrated Project Workspace read model, pinned commit.
- Workspace — Unified Research Context and immutable context snapshots, pinned commit.
- Workspace — First-Run Onboarding & Project Creation, historical source specification.
- Workspace — Research output approvals and publication boundaries, pinned commit.
- Workspace — isolated Research Projects implementation tests, pinned commit.
- Workspace — Unified Research Context tests, pinned commit.
- SC-KB-VERIFY-01 documentation PR #36 (status and current scope must be rechecked independently).
