Remove production *pgxpool.Pool from Server, centralize domain→HTTP status mapping, and expose Runtime ports for task-store readiness, duty heal, and artifact vault registry. Allow app→docduty for heal wiring.
655 lines
14 KiB
YAML
655 lines
14 KiB
YAML
# U1 architecture baseline. Import allowlist is a 2026-09-14 production go list snapshot,
|
|
# refreshed 2026-09-22 for modules/edges shipped later through their own accepted tasks
|
|
# (materialindex, mineru, workflowscope + app/docnotify ctxmgr + docgov/intent workflowdef).
|
|
# SQL write / path / event rules apply only to production Go (not Goose, *_test.go, or fixtures).
|
|
# Existing debt lives in exceptions with owner + milestone + expiry. New findings block immediately.
|
|
|
|
imports:
|
|
agent:
|
|
- config
|
|
auth:
|
|
- config
|
|
authz:
|
|
- docduty
|
|
bizdev:
|
|
- authz
|
|
- config
|
|
- ctxmgr
|
|
- db
|
|
- docduty
|
|
- docgov
|
|
- docrevision
|
|
- freedoc
|
|
- kb
|
|
- maturity
|
|
- projectcontext
|
|
- projectworkflow
|
|
- materialindex
|
|
- quote
|
|
- squad
|
|
- storage
|
|
- stream
|
|
- workflowdef
|
|
chat:
|
|
- app/chatflow
|
|
- app/intentflow
|
|
- app/stageflow
|
|
- coordinator
|
|
- ctxmgr
|
|
- docgov
|
|
- intent
|
|
- projectinstance
|
|
- replyexport
|
|
- squad
|
|
- stream
|
|
- taskrun
|
|
config: []
|
|
coordinator:
|
|
- agent
|
|
- app/stageflow
|
|
- ctxmgr
|
|
- docgov
|
|
- intent
|
|
- kb
|
|
- maturity
|
|
- projectinstance
|
|
- squad
|
|
- stream
|
|
- workflowscope
|
|
ctxmgr:
|
|
- app/uow
|
|
- docgov
|
|
- replyexport
|
|
- storage
|
|
db: []
|
|
docduty: []
|
|
app:
|
|
- agent
|
|
- app/chatflow
|
|
- app/docadvance
|
|
- app/docflow
|
|
- app/docnotify
|
|
- app/docproject
|
|
- app/intentflow
|
|
- app/stageflow
|
|
- app/uow
|
|
- artifactvault
|
|
- auth
|
|
- authz
|
|
- bizdev
|
|
- config
|
|
- coordinator
|
|
- ctxmgr
|
|
- docduty
|
|
- docgov
|
|
- docrevision
|
|
- events
|
|
- freedoc
|
|
- intent
|
|
- kb
|
|
- notification
|
|
- observability
|
|
- projectinstance
|
|
- projectworkflow
|
|
- storage
|
|
- taskrun
|
|
- traceimpact
|
|
- workflowdef
|
|
- workflowscope
|
|
- workspace
|
|
- sysadmin
|
|
app/chatflow:
|
|
- coordinator
|
|
- ctxmgr
|
|
- maturity
|
|
- projectinstance
|
|
app/docnotify:
|
|
- ctxmgr
|
|
- docgov
|
|
- docrevision
|
|
- notification
|
|
- events
|
|
app/docadvance:
|
|
- docgov
|
|
- events
|
|
- notification
|
|
- projectinstance
|
|
- projectworkflow
|
|
app/docproject:
|
|
- docgov
|
|
- events
|
|
app/docflow:
|
|
- app/uow
|
|
- docgov
|
|
- docquery
|
|
- docrevision
|
|
- events
|
|
app/intentflow:
|
|
- app/uow
|
|
- events
|
|
- intent
|
|
app/fav:
|
|
- artifactvault
|
|
- events
|
|
app/uow: []
|
|
app/stageflow:
|
|
- bizdev
|
|
docquery:
|
|
- docgov
|
|
- docrevision
|
|
docgov:
|
|
- app/uow
|
|
- doccontent
|
|
- docduty
|
|
- fsutil
|
|
- workflowdef
|
|
docrevision:
|
|
- app/uow
|
|
- doccontent
|
|
- fsutil
|
|
doccontent: []
|
|
freedoc:
|
|
- app/uow
|
|
- ctxmgr
|
|
- docrevision
|
|
- replyexport
|
|
fsutil: []
|
|
httpx: []
|
|
intent:
|
|
- maturity
|
|
- squad
|
|
- workflowdef
|
|
- workflowscope
|
|
kb:
|
|
- config
|
|
materialindex:
|
|
- config
|
|
- kb
|
|
- mineru
|
|
- squad
|
|
maturity: []
|
|
mineru: []
|
|
notification: []
|
|
observability: []
|
|
projectcontext:
|
|
- squad
|
|
projectinstance:
|
|
- docduty
|
|
- docgov
|
|
- projectworkflow
|
|
- workflowdef
|
|
projectworkflow:
|
|
- auth
|
|
quote: []
|
|
replyexport: []
|
|
server:
|
|
- agent
|
|
- app
|
|
- app/chatflow
|
|
- app/docflow
|
|
- app/intentflow
|
|
- app/stageflow
|
|
- app/uow
|
|
- auth
|
|
- authz
|
|
- bizdev
|
|
- chat
|
|
- config
|
|
- coordinator
|
|
- ctxmgr
|
|
- docduty
|
|
- docgov
|
|
- docquery
|
|
- docrevision
|
|
- events
|
|
- freedoc
|
|
- httpx
|
|
- intent
|
|
- kb
|
|
- materialindex
|
|
- mineru
|
|
- notification
|
|
- observability
|
|
- projectinstance
|
|
- projectworkflow
|
|
- replyexport
|
|
- storage
|
|
- squad
|
|
- stream
|
|
- stream/transport
|
|
- swboot
|
|
- taskrun
|
|
- traceimpact
|
|
- upload
|
|
- workflowdef
|
|
- workflowscope
|
|
- workspace
|
|
- artifactvault
|
|
- sysadmin
|
|
squad:
|
|
- agent
|
|
- config
|
|
- quote
|
|
- stream
|
|
- template
|
|
- workspace
|
|
- workflowdef
|
|
storage: []
|
|
stream: []
|
|
stream/transport:
|
|
- stream
|
|
swboot: []
|
|
taskrun:
|
|
- app/uow
|
|
- artifactvault
|
|
- bizdev
|
|
- ctxmgr
|
|
- events
|
|
- projectworkflow
|
|
- stream
|
|
- workspace
|
|
template:
|
|
- workflowdef
|
|
upload: []
|
|
workflow: []
|
|
workflow/runtime:
|
|
- projectinstance
|
|
- workflowdef
|
|
workflowdef:
|
|
- projectworkflow
|
|
- storage
|
|
- upload
|
|
- workflow
|
|
workflowscope:
|
|
- workflowdef
|
|
workspace:
|
|
- app/uow
|
|
events:
|
|
- app/uow
|
|
artifactvault:
|
|
- app/uow
|
|
- fsutil
|
|
dataset:
|
|
- artifactvault
|
|
- app/uow
|
|
sysadmin:
|
|
- config
|
|
traceimpact: []
|
|
|
|
table_owners:
|
|
document_records:
|
|
- docgov
|
|
project_trace_items:
|
|
- traceimpact
|
|
project_trace_item_revisions:
|
|
- traceimpact
|
|
project_trace_edges:
|
|
- traceimpact
|
|
project_trace_edge_decisions:
|
|
- traceimpact
|
|
project_trace_index_state:
|
|
- traceimpact
|
|
stage_reopen_requests:
|
|
- traceimpact
|
|
stage_recheck_marks:
|
|
- traceimpact
|
|
trace_revision_proposals:
|
|
- traceimpact
|
|
chat_messages:
|
|
- ctxmgr
|
|
chat_turns:
|
|
- ctxmgr
|
|
freeform_documents:
|
|
- freedoc
|
|
task_runs:
|
|
- taskrun
|
|
task_run_manifests:
|
|
- taskrun
|
|
document_versions:
|
|
- docrevision
|
|
document_snapshots:
|
|
- docrevision
|
|
document_change_events:
|
|
- docrevision
|
|
event_envelopes:
|
|
- events
|
|
event_deliveries:
|
|
- events
|
|
event_dead_letters:
|
|
- events
|
|
event_inventory_decisions:
|
|
- events
|
|
event_repair_audit:
|
|
- events
|
|
event_replay_plans:
|
|
- events
|
|
event_service_principals:
|
|
- events
|
|
event_delivery_attempts:
|
|
- events
|
|
event_consumer_modes:
|
|
- events
|
|
event_consumer_checkpoints:
|
|
- events
|
|
event_reconciliations:
|
|
- events
|
|
event_projection_outcomes:
|
|
- app/docproject
|
|
notifications:
|
|
- notification
|
|
stage_advance_requests:
|
|
- notification
|
|
final_artifacts:
|
|
- artifactvault
|
|
artifact_payload_staging:
|
|
- artifactvault
|
|
artifact_blob_references:
|
|
- artifactvault
|
|
artifact_publication_attempts:
|
|
- artifactvault
|
|
artifact_deletion_ledger:
|
|
- artifactvault
|
|
artifact_quarantine:
|
|
- artifactvault
|
|
artifact_backfill_exclusions:
|
|
- artifactvault
|
|
dataset_registry:
|
|
- dataset
|
|
dataset_backfill_jobs:
|
|
- dataset
|
|
dataset_backfill_checkpoints:
|
|
- dataset
|
|
dataset_backfill_queue:
|
|
- dataset
|
|
dataset_destroy_requests:
|
|
- dataset
|
|
intent_plans:
|
|
- app/intentflow
|
|
intent_plan_steps:
|
|
- app/intentflow
|
|
intent_plan_decisions:
|
|
- app/intentflow
|
|
intent_plan_projections:
|
|
- app/intentflow
|
|
intent_plan_shadow:
|
|
- app/intentflow
|
|
system_settings:
|
|
- sysadmin
|
|
|
|
path_owners:
|
|
output.md:
|
|
- squad
|
|
- workspace
|
|
data/dev:
|
|
- config
|
|
- workspace
|
|
- artifactvault
|
|
workspaces/:
|
|
- squad
|
|
- workspace
|
|
|
|
event_producers:
|
|
outbox.notify:
|
|
- docrevision
|
|
- app/docflow
|
|
document.agent_candidate_ready:
|
|
- docrevision
|
|
- app/docflow
|
|
- events
|
|
document.agent_version_committed:
|
|
- docrevision
|
|
- app/docflow
|
|
- events
|
|
- app/docproject
|
|
document.downstream_impact_detected:
|
|
- docrevision
|
|
- app/docflow
|
|
- events
|
|
document.change_report_degraded:
|
|
- docrevision
|
|
- app/docflow
|
|
- events
|
|
document.approved:
|
|
- app/docflow
|
|
- events
|
|
- app/docadvance
|
|
taskrun.completed:
|
|
- taskrun
|
|
taskrun.cancelled:
|
|
- taskrun
|
|
fav.artifact_staged:
|
|
- app/docflow
|
|
intent.plan.awaiting_input:
|
|
- app/intentflow
|
|
- events
|
|
intent.plan.step_changed:
|
|
- app/intentflow
|
|
- events
|
|
intent.plan.completed:
|
|
- app/intentflow
|
|
- events
|
|
|
|
event_consumers:
|
|
outbox.notify:
|
|
- app/docnotify
|
|
- notification
|
|
document.agent_candidate_ready:
|
|
- notify
|
|
document.agent_version_committed:
|
|
- projection
|
|
- notify
|
|
document.downstream_impact_detected:
|
|
- notify
|
|
document.change_report_degraded:
|
|
- notify
|
|
document.approved:
|
|
- workflow_advance
|
|
- notify
|
|
taskrun.completed:
|
|
- notify
|
|
taskrun.cancelled:
|
|
- notify
|
|
fav.artifact_staged:
|
|
- fav
|
|
intent.plan.awaiting_input:
|
|
- projection
|
|
- notify
|
|
intent.plan.step_changed:
|
|
- projection
|
|
- notify
|
|
intent.plan.completed:
|
|
- projection
|
|
- notify
|
|
|
|
unwrap_owners:
|
|
- docgov
|
|
- docrevision
|
|
- taskrun
|
|
- freedoc
|
|
- events
|
|
- artifactvault
|
|
- ctxmgr
|
|
- app/intentflow
|
|
|
|
exceptions:
|
|
- kind: sql_write
|
|
package: docduty
|
|
file: internal/docduty/revoke.go
|
|
symbol: document_records
|
|
owner: docduty
|
|
reason: duty slot revoke still writes reviewer/approver columns directly; fold into docgov repository during U3
|
|
milestone: U3
|
|
expires: "2026-09-28"
|
|
- kind: sql_write
|
|
package: docduty
|
|
file: internal/docduty/store.go
|
|
symbol: document_records
|
|
owner: docduty
|
|
reason: heal/store updates duty columns on document_records; move behind docgov repository in U3
|
|
milestone: U3
|
|
expires: "2026-09-28"
|
|
- kind: sql_write
|
|
package: docrevision
|
|
file: internal/docrevision/pg_store.go
|
|
symbol: document_records
|
|
owner: docrevision
|
|
reason: projectRootPointersTX updates controlled root pointers; U3 must keep this inside the shared UnitOfWork
|
|
milestone: U3
|
|
expires: "2026-09-28"
|
|
- kind: sql_write
|
|
package: docrevision
|
|
file: internal/docrevision/pg_store.go
|
|
symbol: freeform_documents
|
|
owner: docrevision
|
|
reason: projectRootPointersTX also projects freeform heads; keep atomic in U3 then hand write ownership back
|
|
milestone: U3
|
|
expires: "2026-09-28"
|
|
- kind: sql_write
|
|
package: projectinstance
|
|
file: internal/projectinstance/store.go
|
|
symbol: task_runs
|
|
owner: projectinstance
|
|
reason: workflow terminate cancels task_runs; U8 owns run finalization in the same UoW
|
|
milestone: U8
|
|
expires: "2026-10-26"
|
|
- kind: path
|
|
package: agent
|
|
file: internal/agent/cursor.go
|
|
symbol: output.md
|
|
owner: agent
|
|
reason: runner still names the deliverable file; U5 replaces this with WorkspaceRef
|
|
milestone: U5
|
|
expires: "2026-10-12"
|
|
- kind: path
|
|
package: agent
|
|
file: internal/agent/piagent.go
|
|
symbol: output.md
|
|
owner: agent
|
|
reason: PI runner contract still uses output.md; U5 capability must hide the literal
|
|
milestone: U5
|
|
expires: "2026-10-12"
|
|
- kind: path
|
|
package: bizdev
|
|
file: internal/bizdev/service.go
|
|
symbol: data/dev
|
|
owner: bizdev
|
|
reason: default data-root example string; U5 resolver owns environment roots
|
|
milestone: U5
|
|
expires: "2026-10-12"
|
|
- kind: path
|
|
package: bizdev
|
|
file: internal/bizdev/service.go
|
|
symbol: output.md
|
|
owner: bizdev
|
|
reason: orchestration still joins workspace output.md; U5 removes Root/OutputDir
|
|
milestone: U5
|
|
expires: "2026-10-12"
|
|
- kind: path
|
|
package: coordinator
|
|
file: internal/coordinator/context.go
|
|
symbol: output.md
|
|
owner: coordinator
|
|
reason: coordinator reads projection path; U4/U5 must go through workspace capability
|
|
milestone: U5
|
|
expires: "2026-10-12"
|
|
- kind: path
|
|
package: coordinator
|
|
file: internal/coordinator/dialogue_llm.go
|
|
symbol: data/dev
|
|
owner: coordinator
|
|
reason: prompt example embeds data/dev; U5 must not leak runtime roots
|
|
milestone: U5
|
|
expires: "2026-10-12"
|
|
- kind: path
|
|
package: coordinator
|
|
file: internal/coordinator/document_summary.go
|
|
symbol: data/dev
|
|
owner: coordinator
|
|
reason: summary prompt embeds data/dev; U5 must not leak runtime roots
|
|
milestone: U5
|
|
expires: "2026-10-12"
|
|
- kind: path
|
|
package: coordinator
|
|
file: internal/coordinator/engine.go
|
|
symbol: output.md
|
|
owner: coordinator
|
|
reason: engine joins deliverable path; U5 WorkspaceRef
|
|
milestone: U5
|
|
expires: "2026-10-12"
|
|
- kind: path
|
|
package: docgov
|
|
file: internal/docgov/lease.go
|
|
symbol: output.md
|
|
owner: docgov
|
|
reason: SaveDocumentContent still writes projection files; U5 capability + U4 ledger-first read
|
|
milestone: U5
|
|
expires: "2026-10-12"
|
|
- kind: path
|
|
package: docgov
|
|
file: internal/docgov/project_docs.go
|
|
symbol: output.md
|
|
owner: docgov
|
|
reason: project doc helpers still construct output.md; U5
|
|
milestone: U5
|
|
expires: "2026-10-12"
|
|
- kind: path
|
|
package: docrevision
|
|
file: internal/docrevision/projection.go
|
|
symbol: output.md
|
|
owner: docrevision
|
|
reason: InspectProjection reads workspace file; U4 treats this as optional cache only
|
|
milestone: U4
|
|
expires: "2026-09-28"
|
|
- kind: path
|
|
package: docrevision
|
|
file: internal/docrevision/reconcile.go
|
|
symbol: output.md
|
|
owner: docrevision
|
|
reason: reconcile still repairs projection files; U5
|
|
milestone: U5
|
|
expires: "2026-10-12"
|
|
- kind: path
|
|
package: server
|
|
file: internal/server/document_revision_access.go
|
|
symbol: output.md
|
|
owner: server
|
|
reason: handler still reads workspace files; U4 must use docquery ledger
|
|
milestone: U4
|
|
expires: "2026-09-28"
|
|
- kind: path
|
|
package: server
|
|
file: internal/server/document_revision_handlers.go
|
|
symbol: output.md
|
|
owner: server
|
|
reason: handler error text mentions output.md; U4/U5 remove path leakage
|
|
milestone: U4
|
|
expires: "2026-09-28"
|
|
- kind: path
|
|
package: server
|
|
file: internal/server/server.go
|
|
symbol: workspaces/
|
|
owner: server
|
|
reason: server still concatenates workspaces/ roots; U5
|
|
milestone: U5
|
|
expires: "2026-10-12"
|
|
- kind: path
|
|
package: storage
|
|
file: internal/storage/cas.go
|
|
symbol: data/dev
|
|
owner: storage
|
|
reason: CAS default example path; U5 resolver
|
|
milestone: U5
|
|
expires: "2026-10-12"
|
|
|
|
baseline_counts:
|
|
import: 0
|
|
sql_write: 5
|
|
path: 16
|
|
event: 0
|
|
|
|
# U12: kinds already at zero production findings fail --mode block.
|
|
# sql_write/path keep dated exceptions until their owner milestones clear them.
|
|
block_kinds:
|
|
- import
|
|
- event
|