internal/migrate
github.com/ensera-ai/taisce/internal/migrate · 6 files · 929 lines · 64 tests · source
Package migrate applies the schema and provisions a project's storage.
The SQL lives beside the code because go:embed cannot reach outside its package directory, and one embedded copy is what makes the binary self-contained: a deployment ships a schema rather than depending on a file being present next to it.
Where it sits
Imports: internal/infra/pg
Imported by: cmd/taisce, internal/docsite
Files
| File | Lines | Declarations | What it is for |
|---|---|---|---|
| connectionbound.go | 95 | 5 | ErrConnectionBudget is a deployment that asked for more than the substrate has. |
| memorywrites.go | 109 | 7 | memoryWrites is every memory-namespace table the memory role may change, and how. |
| migrate.go | 218 | 14 | Carries the package documentation. |
| planes.go | 222 | 5 | One instance has separate control and memory database identities. |
| privileges.go | 168 | 9 | ValidateRolePrivileges inspects effective privileges, including roles whose privileges are immediately inherited or reachable with SET ROLE. |
| provision.go | 117 | 6 | scopePattern is what a project identifier may contain. |
64 tests hold this package's behaviour; the list is named for what each one proves.
Files it carries
Not Go, and part of what the package is: embedded, rendered or read at build time.
control/0001_the_fence_before_the_registry.sqlcontrol/0002_a_credential_names_the_projects_it_may_reach.sqlcontrol/0003_a_credential_belongs_to_one_project.sqlcontrol/0004_credentials_declare_read_or_write_access.sqlcontrol/0005_an_operator_credential_reaches_the_management_surface_and_no_project.sqlsql/0001_the_spine.sqlsql/0002_a_turn_is_messages_with_roles.sqlsql/0003_a_closed_predicate_vocabulary.sqlsql/0004_what_extraction_refused.sqlsql/0005_stored_is_not_the_same_as_formed.sqlsql/0006_evidence_names_the_message_it_indexes.sqlsql/0007_a_projection_kind_declares_where_it_lives.sqlsql/0008_a_claim_already_recorded_is_refused_not_repeated.sqlsql/0009_a_turn_that_will_not_form_is_parked_not_lost.sqlsql/0010_supersession_is_a_constraint_rather_than_a_lock.sqlsql/0011_a_claim_the_message_did_not_assert.sqlsql/0012_a_project_is_a_row_with_settings.sqlsql/0013_the_audit_ledger.sqlsql/0014_a_fact_carries_the_role_that_said_it.sqlsql/0015_salience_had_no_reader.sqlsql/0016_a_subject_that_names_nothing.sqlsql/0017_the_ledger_seals_itself.sqlsql/0018_a_relation_the_message_puts_in_the_past.sqlsql/0019_a_kind_declares_whether_sharing_saves_it.sqlsql/0020_subjects_and_what_was_written_about_them.sqlsql/0021_observation_retries_have_one_receipt.sqlsql/0022_speakers_have_project_scoped_identity.sqlsql/0023_relationships_agree_on_the_project.sqlsql/0024_project_names_fit_the_provisioning_contract.sqlsql/0025_unfinished_observations_reserve_ingestion_capacity.sqlsql/0026_operator_formation_recovery.sqlsql/0027_operational_formation_health.sqlsql/0028_citation_resolution_is_audited.sqlsql/0029_supersession_preserves_earlier_knowledge.sqlsql/0030_record_inspection_is_bounded_and_audited.sqlsql/0031_reports_follow_source_fact_revisions.sqlsql/0032_retractions_preserve_source_instructions.sqlsql/0033_curated_claims_are_authoritative_source_input.sqlsql/0034_formation_receipts_preserve_recorded_knowledge.sqlsql/0035_projects_are_the_content_access_boundary.sqlsql/0036_authored_assertions_are_audited.sqlsql/0037_agent_artifacts_are_bounded_owned_storage.sqlsql/0038_retention_work_follows_stored_deadlines.sqlsql/0039_subject_registry_keeps_external_references_at_the_boundary.sqlsql/0040_source_extraction_pins_prevent_mixed_retries.sqlsql/0041_fact_generations_keep_old_citations.sqlsql/0042_project_fact_rebuild_jobs.sqlsql/0043_entity_name_variants_have_source_owners.sqlsql/0044_messages_retain_their_chunk_identity.sqlsql/0045_entity_inspection_is_audited.sqlsql/0046_message_embeddings_belong_to_model_generations.sqlsql/0047_embedding_progress_separates_targets_from_coverage.sqlsql/0048_message_reference_reads_are_audited.sqlsql/0049_entity_embeddings_are_source_owned_candidates.sqlsql/0050_report_embeddings_are_source_owned_themes.sqlsql/0051_canonical_names_are_the_exact_anchor_key.sqlsql/0052_a_second_current_value_is_refused_not_failed.sqlsql/0053_a_non_user_message_may_assert_about_others.sqlsql/0054_an_event_is_reported_in_the_past_and_stays_true.sqlsql/0055_a_segment_stands_in_for_the_turns_it_covers.sqlsql/0056_the_ledger_admits_what_an_operator_does.sqlsql/0057_the_ledger_admits_withdrawing_an_entity.sqlsql/0058_a_scope_can_tell_somebody_it_formed.sqlsql/0059_the_ledger_admits_choosing_where_to_be_told.sqlsql/0060_a_report_says_what_wrote_it.sqlsql/0061_a_doubt_is_not_yet_a_belief.sqlsql/0062_a_failure_names_no_address.sqlsql/0063_the_console_reads_the_ledger_by_the_hour.sqlsql/0064_a_seal_waits_for_what_it_covers.sqlsql/0065_the_fanout_cap_bounds_what_is_read.sqlsql/0066_a_name_that_cannot_be_kept_is_a_refusal.sqlsql/0067_a_retention_sweep_leaves_a_receipt.sqlsql/0068_an_expired_turn_is_unreachable_before_it_is_swept.sql