Decision 0022 — Wiki Runtime Owner¶
- Status:
ACCEPTED - Date:
2026-08-28 - Scope: Logistics Workspace User Wiki catalogue, tenant overrides, preview, assets and export
- Supersedes: the runtime-only portion of Decision 0007; compiled page guidance remains unchanged
- Restriction delta:
RD-000 / NONE
Currently Applied Scope¶
The body below preserves the choice, alternatives and impact of 2026-08-28. The current authority and generation boundary follow the Wiki operating contract, and the starting point of the earlier runtime-only change is in Decision 0007.
- Boundaries that remain: Workspace session use, UUID public identity, separation of responsibility between the DB and file adapters, and readback after saving.
- Scope that was replaced: instead of composing the compiled Legacy baseline with tenant overrides,
the authority for the operator manual is
T_WIKI_PAGE, and images are theWIKI_ASSETrelation ofT_FILEplus the existing object store. What is generated from Git and served read-only is the development specifications, and it is not a second source for the operator manual. - The unchanged-schema and no-migration scope and the rollback in the body are limited to the candidate as it stood. Current change and recovery reconcile the current Wiki contract with that work's source and evidence; this text does not restore a historical baseline.
This application note is a document correction that links the existing Wiki contract. It does not approve an updated approval date or past verification result, and it does not approve a new DB migration, Wiki publication or operational application.
Context¶
- Decision 0007 compiles repository guidance into
@ctc/user-wikiand renders it in/wiki. - Legacy adds a tenant-scoped 30-page catalogue,
T_WIKI_PAGEoverrides, page/menu mapping, Markdown preview,T_FILEimage assets and JSON export. - Workspace login issues
CTC_SESSION; Legacy manual and API routes requirePHPSESSID. - The current candidate calls Legacy routes in the browser. Its source test passes, but the actual authenticated route follows the Legacy login redirect and never loads the catalogue.
@ctc/file-storage,@ctc/db-mysql, the Workspace session resolver and a dedicated/wikiProduct surface already exist. No new package or schema is required.
Problem¶
An authorized operator must read the Legacy-derived manual and an authorized editor must preview, save, update, attach, export and recover changes through the actual Workspace session. The solution must not add Web SQL, a second writer, a PHP browser session, a tenant-named backend owner or another general Platform God route.
Options¶
Alternative 1 — Keep the compiled three-article Wiki¶
No structural change, but it omits the Legacy catalogue, tenant overrides, mapping, assets and export. It cannot satisfy Phase-3 parity.
Alternative 2 — Create a reverse Workspace-to-Legacy session bridge¶
This reuses all PHP behavior but creates a second authentication bridge, retains browser/runtime dependence on Legacy and expands the security and retirement surface. It is rejected.
Alternative 3 — Extend the existing User Wiki with a generic New-System runtime adapter¶
Compile the Legacy baseline into the existing Wiki package, resolve CTC_SESSION in a dedicated
Wiki API, and keep tenant DB/file compatibility inside generic adapters. This introduces one narrow
DB export and no package, schema, tenant branch or second writer. It is accepted.
Decision¶
Legacy manual source
-> deterministic build-time baseline in @ctc/user-wiki
-> dedicated Workspace /api/platform/wiki/** route
-> @ctc/user-wiki validation and safe rendering
-> @ctc/db-mysql/wiki tenant compatibility and authoritative readback
-> existing @ctc/file-storage object store for Wiki assets
- The browser calls only base-path-aware Workspace APIs and uses only
CTC_SESSION. @ctc/user-wikiowns catalogue DTOs, slug/Markdown validation, safe rendering and generated Legacy baseline. Tenant/profile selection is data, never a source owner.@ctc/db-mysql/wikiis aSTABLE_ADAPTER. It ownsT_WIKI_PAGEand Wiki-relatedT_FILEcompatibility queries/transactions only; it owns no access or rendering policy.- The dedicated Wiki API resolves the Workspace session, applies Legacy-equivalent read access for
signed-in users, role
1/system edit access and mapped-page menu access, then calls the two owners. - Public page/file identities are UUID. Numeric IDs remain private inside
@ctc/db-mysql. - Static baseline generation is deterministic and checked for drift. Runtime never starts PHP and never parses Legacy HTML.
- Asset bytes use the existing file-storage root. Metadata writes and object writes use explicit compensation and final readback; no provider call occurs inside a DB transaction.
- Existing
T_WIKI_PAGEandT_FILEschema remains authoritative. No migration is admitted.
Budget¶
- new packages:
0 - new Product surfaces:
0 - new DB subpath exports:
1(@ctc/db-mysql/wiki) - new tenant-specific backend names:
0 - new architecture exceptions:
0 - new dedicated API route owner:
1, replacing the candidate's Legacy browser calls
Verification¶
- architecture/source: tenant-name, Web SQL, dependency, type and generated-baseline checks;
- runtime: actual
/logisticsWorkspace/wikilogin, catalogue, search and article navigation; - CRUD: disposable create, read, update and final cleanup with DB and object-store readback;
- flow: normal, denied, invalid, stale/conflict, discard, unavailable, retry and export journeys;
- defect handling: each found defect is fixed and its affected journey reruns before parity changes;
- completion: the manifest remains
PARTIALuntil separate runtime, CRUD, flow, defect and effect evidence fields all point to passing executable evidence.
Consequences¶
- Workspace Wiki no longer depends on a Legacy browser session.
- The existing User Wiki gains one immediate runtime consumer without a new module or framework.
- A generated baseline is added and must be refreshed when Legacy manual source changes.
- Wiki DB/file compatibility becomes independently testable and removable at Legacy retirement.
Revisit Triggers¶
T_WIKI_PAGEis retired in favor of a UUID-native store;- Wiki content becomes an external documentation product;
- a non-filesystem object provider is approved for the existing file-storage port;
- the generated Legacy baseline has no remaining runtime consumer.
Rollback¶
Revert the dedicated Wiki API/adapter and generated runtime baseline together. Keep the compiled
Decision-0007 articles and leave the parity item PARTIAL; do not restore the reverse session bridge.
Source:
new-system/docs/decisions/0022-wiki-runtime-owner.md— ctc repository · This page is an English translation of the source document. Identifiers, file paths and code symbols are unchanged.