Worked Examples
Developer reference for publication controls — Workspace
Developer reference for publication controls — Workspace Application: Workspace Status: Useful first draft, not a production-verified procedure. Proposed or audited service responsibility Support the following capability: keep pri
Application: Workspace
Component: Workspace Backend — Research Approvals; Scientific Publication Studio / Outputs & Publishing
Article type: Developer reference
Source baseline: 6c5dfee4803ace1dbb2aca563b0bb80f3bfbdd2b (GitHub main, inspected 2026-11-20 UTC)
Locally described backend version: 3.83.0; deployed product / last verified deployment: not assigned
Reading time: approximately 18–22 minutes
Status: Published guidance — technical integration and independent scientific verification pending.
Goal
Define, inspect and verify the software contracts that prevent a private research draft or an unapproved scientific result from becoming public. Developers should be able to trace one immutable Studio revision to its Research revision, explicit human decisions, signed authorization records and Research-confirmed release receipt, while demonstrating refusal cases and preserving the confidentiality of unrelated research.
Requirements
- An authorized local checkout of
Content-Catalyst-LLC/sustainable-catalyst-workspaceat the pinned commit, Python 3.12 and the dependencies prescribed by the repository when executing its tests. - A disposable project, synthetic identity fixtures and an isolated PostgreSQL database for integration testing. Use the repository’s existing test harness; do not aim test mutations at production.
- For staged cross-product acceptance: authorized Workspace and Research endpoints, scoped test identities with step-up where configured, read-only service/image-digest inventory, applied migrations and test-only documents and rights grants.
- A separate independent scientific review for the actual method and conclusions; neither a test certificate nor a publication authorization substitutes for it.
Scope guard: Every command in this reference is a source-review or isolated-test command unless explicitly identified as a staging-only illustration. No publication action is safe to run against production without specific release authorization.
1. Authority boundaries and trust model
| Authority | Source responsibility | Must not infer |
|---|---|---|
| Workspace Scientific Publication Studio | Creates and preserves an exact authored document revision and its SHA-256; associates a Workspace project and source lineage with an output | A saved draft is not approved or public |
| Workspace approval service | Identifies authenticated requesters/deciders; manages grants; records dimension-specific, exact-revision decisions and signed records | Any user may approve; a signed record guarantees scientific correctness |
| Research service | Owns the editorial state and published revision, checks presented approvals and governs public visibility | A Workspace button, export or HTTP 200 is itself a public release |
| Public Research Hub | Displays only objects/revisions served by Research | Public projection may enumerate private siblings or reveal source metadata |
| Independent scientific reviewer | Assesses evidence, methods, interpretation, uncertainty and limitations | Software authorization establishes scientific validity |
Workspace’s research_outputs.py stores Research-confirmed receipts in the owner-scoped Workspace project, but Research remains authoritative for article status. Do not construct or overwrite publication status on the client.
2. Pinned implementation anchors
- backend/app/research_outputs.py — document binding, exact revision push, approval requests, Research responses, publish/unlist/relist/withdraw
- backend/app/research_approvals.py — approval roles, grants, request/decision validation, Ed25519-signed records and exact subject references
- backend/app/research_access.py — signed user-context session boundary
- backend/app/approval_desk.py — same-origin approval desk and restrictive Content Security Policy
- backend/tests/test_research_approvals_sc_ed01.py — actor, role and signed decision tests
- backend/tests/test_sc_pub_e2e01_outputs.py — publisher contract tests with a mock Research service
- docs/sc-pub-endtoend-01-outputs-publishing.md — intended complete publishing workflow and staging/release preconditions
Repository ≠ deployment. These are code locations at a fixed source commit, not independently verified production endpoints or release entitlements. Earlier work remains in open pull requests, including SC-ED-01 PR #24; assess actual ancestry and deployment digests rather than assuming an open PR is deployed.
3. Concrete contracts and object identities
| Identifier or schema | Meaning and validation |
|---|---|
sc-workspace-research-output/1.0 |
Workspace project binding of documentId to a Research article and area; one output must not bind to multiple articles |
sc-workspace-research-approval-record/1.0 |
Signed, dimension-specific decision containing subjectRef, grant/reviewer identity, audit and authentication evidence |
sc-workspace-research-role-attestation/1.0 |
Time-limited signed proof of an editor role, not a publication approval |
sc-workspace-research-session/1.0 |
Short-lived signed representation of the authenticated Workspace user to Research (documented lifetime no more than 300 seconds) |
research-object:<id>#<sha256> |
Exact Research object/revision identity accepted for the four article approval dimensions; the suffix is 64 lowercase hexadecimal characters |
research-area:<id>#<sha256> |
Exact area identity used for area-publication approval, not ordinary article approvals |
Distinguish studioRevision (the immutable authored revision) from researchRevision (the Research editorial revision). Record the original documentSha256, resolved Research subjectRef and pinned cited object hashes; never replace these with the latest head of a mutable object.
4. API reference: intended Workspace routes
These relative paths are extracted from Workspace source. They require a correctly configured, authenticated Workspace application; route availability, active feature flags and permissions must be probed in an authorized environment before use.
| Method/path | Contract purpose | Write effect |
|---|---|---|
GET /projects/{project_id}/outputs |
Read owner-scoped outputs and Research-derived state | No |
POST /projects/{project_id}/outputs/{document_id}/bind |
Bind Studio output to Research area/article slug | Yes |
POST .../research-revisions |
Push exact saved Studio revision and pinned cited objects | Yes |
POST .../submit |
Submit exact Research revision for editorial review | Yes |
POST .../approval-requests |
Request scientific, rights, ownership or publication approval | Yes |
POST .../approvals/attach |
Attach a signed decision only for matching subject/project/revision | Yes |
POST .../publish |
Request a Research-confirmed public release | Yes |
POST .../unlist, .../relist, .../withdraw |
Explicit public lifecycle changes | Yes |
GET .../receipts |
Read recorded Research confirmation history | No |
GET /v1/research-approvals/profile |
Read source-configured approval dimensions and policy description | No |
POST /v1/research-approvals/requests/{approval_id}/decide |
Record authenticated decision for one exact subject | Yes |
GET /v1/desk/approvals |
Serve the same-origin human approval desk | No |
The abbreviated .../ forms in this table replace /projects/{project_id}/outputs/{document_id}. They are notation, not literal paths. The /v1/research-approvals routes have an explicit FastAPI prefix; the Outputs & Publishing routes are built and mounted by Workspace’s reporting integration. Inspect the route registry for the tested build rather than assuming a proxy prefix.
5. Request-schema examples (not production commands)
The following are source-derived JSON body shapes, not authorization tokens or instructions to publish. extra="forbid" prevents undocumented payload fields in the relevant Pydantic models.
{
"areaSlug": "synthetic-methods",
"articleSlug": "example-results",
"title": "Synthetic results",
"summary": "Test-only publication"
}
Bind: BindIn accepts lowercase hyphenated area and article slugs. An idempotent binding to the same area/slug can return an existing result; attempting to rebind to another article fails.
{
"studioRevision": 2,
"publicationType": "working-paper",
"summary": "Synthetic test revision",
"references": [
{"objectId": "synthetic-dataset-1", "role": "dataset", "caption": "Synthetic fixture"}
]
}
Push: Workspace resolves each cited Research object and requires a current pin; the created Research revision records the authored document SHA and cited hashes. Do not infer citation rights from the existence of a pin.
{
"decision": "approve",
"expectedSubjectRef": "research-object:synthetic-article-2#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"note": "Reviewed this exact synthetic revision."
}
Decide: This example is only schema documentation. Real decision requests require the appropriate authenticated reviewer, active dimension grant, subject matching and—when SC Identity applies—fresh step-up authentication. The authenticated user, not a JSON actor field, determines the decider. Do not send test authorization requests to production.
6. Decision rules and independent-review disclosure
- Approvals are dimension-specific:
scientific,rights,ownershipandpublication; an area needs its ownarea-publicationdecision. - A grant named
approver:<dimension>authorizes only that dimension. An editor may request approval within the owner’s permitted project scope. - Normal decisions require separation between requester and decider; owner confirmation of ownership is separately scoped.
- Optional owner self-authorization: the source includes a separately enabled path requiring fresh step-up, exact-revision confirmation and a written declaration. It is explicitly labeled
owner-self-authorization, not independent review. Its availability must be verified for the deployed release before being mentioned as an available workflow. - Decisions bind to a typed
subjectRefand are signed. A modified or stale subject cannot inherit an earlier approval. - A legal right to publish, scientific review and editorial authorization answer different questions; do not substitute one approval dimension for another.
7. Publication state transitions
| Research state/action | Required interpretation |
|---|---|
| Studio draft and Research revision | Private by default; saved, bound or exported does not make a public article |
| Submitted | Review requested for an exact Research revision; no public projection implied |
| Approvals attached | Signed evidence evaluated against the precise submitted revision and its project; publication is still a separate action |
| Published | Research-confirmed published revision with recorded receipt; a subsequent draft remains under review without replacing the public revision |
| Unlisted / relisted | Changes public discovery behavior; unlisted is not equivalent to private or withdrawn |
| Withdrawn | Explicit irreversible/restricted public disposition with notice; documented Research Hub semantics include HTTP 410 tombstone |
Public state is derived from Research’s current response, never client-generated. After every authorized mutation, reread Research’s state and persist its acknowledgement; a client timeout is unknown outcome, not evidence of success or failure.
8. Revision integrity and audit invariants
For each release candidate, retain and compare a fixed tuple:
(
workspace_project_id,
document_id,
studio_revision,
studio_document_sha256,
research_article_slug,
research_revision,
research_subject_ref,
pinned_research_object_refs,
approval_record_digests,
research_release_receipt
)
A revised document must change its source revision and/or content hash; reusing an old approval record on the new subject must fail. A versioned receipt should preserve the full 64-character SHA-256, canonical algorithm name, signer identity, reviewer classification and evidence of the exact Research status transition.
Rehashing a locally accessible artifact uses SHA256(bytes), but matching metadata digests alone does not prove current storage-byte integrity. This distinction was exposed by Workspace PR #78 and addressed in the separate, still unmerged corrective PR #79. Do not apply the corrective PR’s guarantees to an older deployed build.
9. Authorization and tenancy requirements
Test authorization on every read and write, not merely the visibility of UI controls. The implementation requires an authenticated Workspace identity for owner-scoped outputs. Approval routes derive requester and decider from the authenticated context and check grants against project and dimension.
- Anonymous access: deny protected reads/writes; capture actual response and avoid exposing private objects in the body.
- Cross-owner access: do not disclose existence, IDs or counts of private project objects; the source uses 404 for tested foreign-owner project paths.
- Wrong reviewer grant, revoked grant or requester-as-decider: reject before issuing a new signed approval.
- Wrong revision and changed hash: reject with an explicit conflict; do not reuse a signature for another revision.
- Step-up: enforce freshness for an approving human when the configured identity layer requires it; reject a stale or missing factor.
- Network: require an allowlisted Origin for writes and TLS for Research connectivity except explicitly isolated staging.
Do not embed credentials or private subject references in public logs, article examples, CI artifacts or error pages.
Procedure
- Pin the source: clone Workspace, check out the inspected SHA and record whether deployed manifests and revisions match it. Never equate a source tag with the live product version.
- Inventory the actual mounted API: inspect route registration, Pydantic models and effective feature flags. Record permitted endpoints with service identity, not guesses from docs.
- Review the source contract: confirm precise Studio revision, cited Research object pins, authorization grants, immutable approval subject, signature and approval replay behavior.
- Execute local tests: use a disposable isolated database and the real repository tests. Distinguish tests that mock Research from tests that use a deployed Research service.
- Exercise failure paths: use synthetic projects to test revoked grants, stale revision, missing rights, wrong tenant, duplicate binding and public leakage before requesting release acceptance.
- Collect staging evidence: where authorized, record Workspace/Research running image digests, source commits, migrations, signing-key issuer identity, CI references, test artifacts and actual Research transition receipts.
- Assess scientific validity separately: request a methods and source-rights review of the real finding; approvals and logs alone are insufficient.
- Publish only after authorization: retain the release decision and Research status. A dry run, passing CI or synthetic approval must never trigger public release.
11. Reproducible repository inspection (macOS/Linux)
The following operations are read-only or run existing repository tests. They do not send publication requests.
gh repo clone Content-Catalyst-LLC/sustainable-catalyst-workspace
cd sustainable-catalyst-workspace
git fetch origin
git checkout --detach 6c5dfee4803ace1dbb2aca563b0bb80f3bfbdd2b
git rev-parse HEAD
# Locate the actual contracts and test coverage.
rg -n 'RECORD_SCHEMA|SCHEMA =|DIMENSIONS|@router\.(get|post)' \
backend/app/research_outputs.py backend/app/research_approvals.py
rg -n 'def test_|status_code|refuse_publish' \
backend/tests/test_sc_pub_e2e01_outputs.py \
backend/tests/test_research_approvals_sc_ed01.py
# Inspect PR and CI context; these are NOT deployed-environment checks.
gh pr view 24 --repo Content-Catalyst-LLC/sustainable-catalyst-workspace \
--json state,isDraft,headRefOid,baseRefOid
gh workflow view sc-pub-e2e-01.yml \
--repo Content-Catalyst-LLC/sustainable-catalyst-workspace
Use the repository’s declared Python dependencies in a disposable environment. A focused test command is:
python3.12 -m venv /tmp/sc-pub-ref-venv
. /tmp/sc-pub-ref-venv/bin/activate
python -m pip install -r backend/requirements.txt -r backend/requirements-reporting.txt pytest==8.3.4
cd backend
SC_TEST_KEY_DIR="$(mktemp -d)" python -m pytest -q \
tests/test_sc_pub_e2e01_outputs.py \
tests/test_research_approvals_sc_ed01.py \
tests/test_sc_pub_m1_step_up_approvals.py
Execution caveat: the tests may skip database-dependent cases without an appropriately configured disposable PostgreSQL environment. The publishing tests include a mocked Research transport. Inspect every actual outcome; this article has not executed the above command or asserted a pass count.
12. Staging read-only introspection and safe diagnostics
Do this only for a staging deployment that you administer or are explicitly authorized to examine. Replace placeholders with approved environment values and use an appropriate authenticated browser/service session. A missing route or 503 may indicate a disabled integration, proxy mismatch or absent Research configuration.
# An approved staging host only — intentionally no credentials in this example.
STAGING_BASE='https://workspace-staging.example.invalid'
# Read-only: the effective approval capability profile, if deployed.
curl --fail-with-body --silent --show-error \
"$STAGING_BASE/v1/research-approvals/profile"
# Record the actual deployment identity through your authorized inventory:
# Workspace source SHA / API image digest / worker image digest
# Research source SHA / service image digest / signing-key issuer
# Applied migration ledger / effective feature flags / SC Identity method
# Do not publish output or insert secret values in shell history.
A 200 on a profile or health route proves only that the responding route was reachable; it does not demonstrate authorization enforcement, Research’s acceptance of a signed approval or public-side data isolation. Publish no synthetic outputs without an explicit testing approval.
13. Failure and negative-test matrix
| Scenario | Expected safe behavior | Evidence to retain |
|---|---|---|
| Missing scientific, rights, ownership or publication approval | Research refuses the transition and keeps the prior public state; no false Workspace success receipt | Specific missing dimension, sanitized response and unchanged Research state |
| Approval for old revision/hash | 409/conflict or equivalent refusal; signed record not attached to new subject | Old and current subject fingerprints (synthetic), request/response |
| Wrong project/tenant or absent document | No private disclosure; 401/403/404 according to actual boundary | Denied response and empty/neutral public view |
| Wrong or revoked approver grant | Refused decision; no new signature or final approval record | Grant state, decider role and refusal code |
| Owner self-authorizes without permitted feature, step-up, declaration or disclosure | Refused, or labeled explicitly as nonindependent if all gates are enabled and satisfied | Feature state, challenge outcome, record review classification |
| Duplicate binding or repeated revision push | Exact retry idempotent; conflicting target 409 | Original and replay receipts, no duplicate article |
| Research returns an error or times out | No locally invented publication success; reconfirm remote state and retry idempotently | Correlation ID, response, remote state, local receipt status |
| Unlisted, withdrawn or later draft revision | Visibility semantics match actual Research response; later draft does not expose sibling private content | Anonymous read tests, tombstone/status evidence where supported |
| Corrupt cited source or unavailable output | Fail closed on independent byte-integrity claim and preserve provenance incident | Actual byte digest comparison and failure classification |
| Unsafe redirect/Origin or forged caller identity | Reject unapproved origin and spoofed fields; no browser-to-Research key leakage | Origin, auth policy, denial test without secrets |
14. Security, retention and recovery considerations
- Use exact object revisions and signed receipts to reconstruct a publication decision without granting a replaying service authority to mint a new one.
- Keep signed approval and withdrawal records in the appropriate append-only or finality-protected persistence layer; verify those protections with real migrations, not only ORM definitions.
- Check the transactional and retry boundary when Research accepts a request but Workspace loses the acknowledgement. Re-query by exact revision instead of blindly creating a second publication.
- Back up and test restore in isolated staging before an authorized production cutover; record which approval records, public projections and withdraw notices are restored or suppressed.
- Inspect credential scope, Origin policy, session revocation and key rotation procedures without extracting signing keys into documentation.
- Preserve published revisions and their public correction/withdrawal history; do not silently delete public accountability records to make a test pass.
Symptoms
- Publishing controls appear disabled or the Research article cannot be bound.
- Approval button appears available but the decision returns
403or a step-up challenge. - Research refuses publication despite apparently completed Workspace approvals.
- An earlier approved revision does not authorize the current draft.
- The UI shows a stale public status after a service timeout.
- A public route exposes a private sibling title, project identity, source hash or draft content.
Troubleshooting
| Symptom | Check first | Do not do |
|---|---|---|
| Research publishing unavailable | Approved Research endpoint, TLS configuration, enabled bridge and actual running image | Enable insecure HTTP outside isolated staging |
| Approver cannot sign | Active dimension grant, distinct requester/decider, SC Identity freshness and matching expectedSubjectRef |
Replace actor ID in JSON or borrow another user’s credentials |
| Rights rejection | Explicit rights decision on the exact source/revision and authoritative Research refusal | Assume a project owner automatically possesses redistribution rights |
| 409 changed subject | Re-fetch current subject reference; require re-review and a new decision | Rewrite stored subject hashes to fit the approval |
| Output draft unexpectedly public | Stop operations; capture authorized evidence; inspect Research publication state and anonymous projection; escalate as possible privacy incident | Publish further fixtures or expose more source data while diagnosing |
| Missing audit receipt after timeout | Query Research’s current revision and receipt first; reconcile event IDs and retry only where safe | Record success locally without Research confirmation |
Resolution
- Classify the observed failure by identity/authorization, revision integrity, rights, Research availability, privacy leak or release evidence.
- Stop the publication transition on any unresolved rights, revision, provenance or private-data concern.
- Capture sanitized, immutable evidence and associate it with the precise source commit, running image digest, request identifier and affected synthetic fixture.
- Apply a scoped fix in a corrective PR with positive and negative integration tests. Do not quietly reinterpret an earlier failure as a pass.
- Revalidate isolated staging with the real Workspace and Research service pair, actual migration ledger and independent reviewer approval.
- Update the Knowledge Base’s supported component, last verified version and reference receipt only after release-matched verification; preserve the WordPress article’s independent editorial publication status.
18. Acceptance criteria for a verifiable release
The publication-control claim is eligible for staging-verified classification only when the following evidence exists for one precise deployed release:
- Workspace and Research source SHAs match independently captured running image digests, environment flags and applied migration records.
- One authorized synthetic document can be bound, revised, submitted, granted the four dimension-specific approvals, and released through Research with an authentic Research receipt.
- One separately authorized area publication decision is exercised where required.
- Stale revision, wrong owner, missing rights, revoked reviewer, absent step-up and duplicate/altered requests are all refused.
- Public Research routes reveal no private sibling text, metadata, source hashes or unpublished revisions, including after unlist/withdraw and database reload.
- Approval records remain exact-revision bound and distinguish independent review from optional owner self-authorization.
- All commands, results, artifacts, tested identities (redacted), image digests, source SHAs, database migration ledger and signed reviewer disposition are retained.
- The independent scientific reviewer separately accepts the actual research methodology, evidence and limitations where scientific validation is claimed.
Mark missing evidence not tested, a failed assertion failed and a source-only inspection source reviewed. Do not upgrade any of those classifications to production-verified merely because a unit test or workflow passed.
19. Relationship to the Knowledge Base verification framework
Map this developer reference to its canonical SC-KB-03 article identity and actual WordPress post ID before importing receipts. Proposed technical claims include: publication-boundary, exact-revision-approval, rights-and-reviewer-authorization, cross-owner-denial, research-public-state-authority and public-private-isolation. These names are proposed mappings, not preexisting catalog IDs.
The SC-KB-VERIFY-01 draft framework, documentation PR #36 supports claim-level receipts, freshness and independent review. As of this source review, its four-article pilot does not establish verification for this article. Link only evidence that actually tests the corresponding claim and release, and keep editorial publication status separate.
20. WordPress metadata and verification wording
| Metadata field | Safe treatment |
|---|---|
| Application | Workspace |
| Product component | Use the existing Publication Studio / Outputs & Publishing or Research Approvals taxonomy term; do not invent a term automatically |
| Supported product version | Select a genuinely supported, deployed release only after a verified deployment mapping; do not assign one from a GitHub source baseline alone |
| Last verified version | Leave deployment-specific field pending until a tested release is identified; store source inspection separately |
| Related issue / PR | SC-ED-01 PR #24 and source publishing contracts; native product relationship if supported |
| Verification notice | Source-anchored; local/staging/production/scientific scopes are separate and require their own retained evidence |
21. Technical references
- Workspace Outputs & Publishing implementation — source-pinned route bodies, data models and status handling.
- Workspace signed approvals implementation — source-pinned roles, requests, decisions and signed records.
- Workspace Research session implementation — signed user-context boundary.
- Workspace approval desk — user interface and Content Security Policy.
- SC-PUB-ENDTOEND-01 specification — system workflow, staging and release notes.
- Workspace publishing contract tests — mocked Research test coverage, not a live Research acceptance.
- Workspace approval tests — dimension grant, actor and decision coverage.
- SC-KB-VERIFY-01 PR #36 — draft verification schema and claim-level review framework.
- Workspace PR #79 — candidate integrity improvement; not evidence of a deployed fix.
Editorial excerpt (copy to the Knowledge Base excerpt field): Inspect Workspace publication-control contracts, immutable research revisions, signed approvals, rights clearance, and Research-controlled public release. Includes source-pinned APIs, authorization failures, reproducible GitHub checks, and staging acceptance criteria.
