TATEKAN Control Basic Design
Date: 2026-03-10 JST
Status: Draft v0.1
1. Design Decision Summary
Recommended baseline:
- frontend: lightweight admin web app
- backend: Python
FastAPI
- runtime: Cloud Run
- primary DB: Firestore / Datastore
- audit storage: Datastore entities + optional GCS evidence export
- analytics: optional later BigQuery export
This aligns Con with the Toriteki stack, avoids unnecessary relational constraints for the current single-tenant phase, and removes the need to keep a Cloud SQL instance running only for Con.
2. Logical Role
Con is the control plane.
It stores:
- tenant definitions
- enabled app definitions
- source-of-truth policies
- numbering policies
- sync policies
- drift / conflict states
- governance exceptions
It does not store:
- full quotation business data
- full ordering business data
- full contract / billing transaction history
It must, however, store enough policy to explain:
- which app owns each business object
- which shared references are parent-managed
- which tenants are standalone and which are linked
- which objects are drifting or in conflict across apps
Con should not be the default executor of sync jobs or diff-calculation workers.
Those should run in app-local jobs or a dedicated integration service, and only publish status into Con.
3. Logical Architecture
3.1 App Layer
- superadmin dashboard
- tenant configuration UI
- app enablement UI
- policy setup UI
- drift / conflict review UI
- audit view UI
3.2 API Layer
- tenant API
- app-composition API
- policy API
- numbering-policy API
- sync-status API
- audit API
3.3 Data Layer
Recommended primary entity kinds:
control_tenants
control_tenant_apps
control_app_relation_policies
control_source_policies
control_numbering_policies
control_master_policies
control_sync_status
control_conflicts
control_governance_events
Phase 1 assumes tenant-scoped entities keyed around tenant_id, with embedded or denormalized properties where practical rather than cross-kind foreign-key joins.
4. Integration Model
4.1 With TATEKAN Core
If Core is enabled for a tenant:
Con may designate Core as source of truth for:
- case references
- customer
- building
- department
Core remains the parent owner for:
- case
- contract
- sales
- customer billing
- payment / settlement
4.2 With Mitsumori
If Mitsumori is enabled:
Con governs whether Mitsumori uses:
- Core-linked references
- local minimal references
- later shared canonical references
Mitsumori remains the owner for:
- quotation
- quotation output
- quotation submission support
Mitsumori must not become the owner of:
- contract
- sales
- customer billing
- payment / settlement
4.3 With Toriteki
If Toriteki is enabled:
Con governs whether Toriteki uses:
- Core-linked references
- local minimal references
- later shared canonical references
Toriteki remains the owner for:
- vendor estimate request
- ordering workflow
- delivery workflow
- inspection workflow
- vendor-side billing workflow
Toriteki must not become the owner of:
- contract
- sales
- payment / settlement
4.4 Cross-App Boundary Baseline
Recommended boundary baseline:
case
- owner:
Core if enabled
- fallback owner: app-local header in standalone mode
quotation
- owner:
Mitsumori
vendor estimate request
- owner:
Toriteki
order
- owner:
Toriteki for workflow
- referenced by
Core when linked to the commercial case
contract
- owner:
Core
sales / customer billing / payment
- owner:
Core
vendor-side billing workflow
- owner:
Toriteki
This means Con must model both object ownership and cross-reference links.
5. Policy Modes
Recommended initial policy modes:
core_parent
Core is enabled and acts as the parent source of truth
core_linked_dual
Core plus one app is enabled and linked
dual_app_linked
Toriteki and Mitsumori are enabled without Core, sharing agreed reference keys
app_local
- the enabled app uses local minimal references
shared_canonical
- reserved for future shared-reference mode
Recommended sync status values:
ok
drift
conflict
needs_review
disabled
migration_pending
6. Governance Model
Examples of governance events:
- backdated case registration warning
- retroactive state change
- numbering collision
- reference mismatch
- policy override by superadmin
All governance events should be auditable.
7. First-Tenant Design Constraint
For 合同産業, Con must support:
Core = enabled
Toriteki = enabled
Mitsumori = enabled
- linked policy mode
This is the most demanding initial composition and should be treated as the reference design.
8. Future-Tenant Design Constraint
Con must also support:
Toriteki only
Mitsumori only
Toriteki + Mitsumori
Core + Mitsumori
Core + Toriteki
Core only
This means Core-first is allowed, but Core-required is not.
For these future tenants, Con must define:
- whether customer / supplier / building / department are local or linked
- whether the tenant intends later migration into
Core
- whether local numbers will be preserved or remapped during linkage
9. Standalone Design Constraint
If Core is not enabled, the active app must still be usable.
Therefore:
Mitsumori only must have local minimal masters for quotation creation
Toriteki only must have local minimal masters for ordering workflow
Toriteki + Mitsumori must have either:
- one app designated as practical parent for shared references, or
- a shared lightweight reference registry controlled by
Con
Con does not need to become a full business MDM in Phase 1, but it must make this policy explicit.
Recommended initial decision:
- Phase 1 should use
designated_parent_app
shared_registry should remain a future option, not the default
Recommended rationale:
- this keeps
Con as a control plane rather than a new operational master system
- this reduces the first implementation surface for standalone tenants
- this still allows later migration into
Core-linked mode
9.1 Recommended designated_parent_app Selection
Recommended practical rule:
- choose
Mitsumori if the tenant's work usually begins with preparing quotations
- choose
Toriteki if the tenant's work usually begins with vendor requests, ordering, delivery, or inspection control
Recommended evaluation factors:
- operational entrypoint
- dominant day-to-day object
- which app first creates the tenant's reusable business header
- whether the tenant expects later migration into
Core
Recommended implementation behavior:
Con should require an explicit selection, not infer it silently
Con should store the reason text
Con should allow later reassessment before the tenant moves to Core-linked mode
Important note:
designated_parent_app means a practical host for shared references in standalone dual-app mode
- it does not override business-object ownership defined elsewhere
10. Membership And Auth Boundary
Recommended initial decision:
Con should not own user authentication in Phase 1
Con should not become the primary membership directory in Phase 1
- each app should continue to own or delegate its own auth and membership model
Con should instead store:
- tenant-level enablement policy
- role-policy summary
- governance/audit events for superadmin configuration changes
Recommended rationale:
- identity and invitation flows can expand the scope too quickly
Con should first stabilize tenant composition and cross-app governance
- auth federation can be introduced later after app boundaries are stable
11. Open Design Items
- exact tenant onboarding flow
- exact drift-detection jobs
- exact conflict-resolution UX
- whether standalone tenants later migrate into
Core-linked mode
- whether
Con later needs centralized identity or only federation hooks
- whether general purchasing should later be modeled in
Con policy scope as a distinct phase-2 object family
- whether
MARCURY handoff events should be surfaced as governance visibility for the first tenant