1954 finalize migration importexport kea prompt mapping full platform team config export#2106
Open
simcariou wants to merge 4 commits into
Conversation
…prompts, OpenFGA role transform (#1954) Validated end-to-end against a real kea dump (2026-07-22): - bundle.py: default users_schema_version=1 for source_platform != "swift" (kea's exporter predates the field); kea bundles were rejected at open_bundle() before this. - importer.py kea path: - agents keep their real tuning (role/description/tags/created_by) and customized system prompt via tuning.values["prompts.system"] — the key the runtime overlays onto the template prompt (MIGR-05.11); v1 secondary prompts warned; legacy type=leader rows skipped. - chat-context resources become prompt rows in personal-{author} (front-matter stripped, idempotent by resource_id, name collisions suffixed); other kinds warned; kea library tags filtered (MIGR-05.15). - OpenFGA tuple restore with role transformation (MIGR-05.04), replacing the ops bulk-copy plan: owner→team_admin+team_editor, manager→team_editor, member→team_member; drops team:personal, resource#parent and non-UUID subjects; replays agent/tag/document/ organization 1:1; idempotent audited writes via RebacEngine. - team table read under its kea file name (teammetadata.jsonl, from main's EXPORT_TABLES) on the kea path (MIGR-05.14). - tests: test_import_export_kea_bundle.py (12 tests, kea-format bundles). - docs: PLATFORM-IMPORT-RFC §4/§8/§9, KEA-MIGRATION-BACKLOG §0bis, KEA_SWIFT_CUTOVER implementation state.
…lm export (#1954) Kea stores team names only in Keycloak groups and platform roles only as per-user realm roles — neither lives in Postgres or OpenFGA, so the kea import path now consumes keycloak/realm.json when the bundle carries it: - every tuple-referenced team gets a swift teammetadata row: name from the realm groups, customization merged from the kea row when present, joining_mode defaulted; no realm in the bundle -> named by id + warning (SQL on the Keycloak DB documented as ops fallback). - a FULL realm export (kc export --users) re-provisions platform roles from users[].realmRoles: admin->platform_admin, viewer->platform_observer, editor dropped with a warning. Partial-exports carry no users -> grants stay on the users.json/bootstrap channel. - tests: 3 new in test_import_export_kea_bundle.py; harness gives the task service its own SQLite file (single-writer lock artifact, not a product concern). - docs: PLATFORM-IMPORT-RFC §8, KEA-MIGRATION-BACKLOG MIGR-05.16.
… as MIGR-05.17, mark MIGR-02.02 superseded
2 tasks
…ompt-mapping-full-platform-team-config-export
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
1. What problem does this solve — and where is it tracked?
ID:
Problem in one sentence:
Backlog ref:
2. Before you wrote a single line of code
This section cannot be skipped. If the answer to any question is "no" or
"I didn't", explain why — do not leave it blank.
RFC written?
Plan presented to the team before implementation?
Confirmation received?
3. What you built
4. Proof of quality
Tests added or updated:
make code-qualityoutput (paste the last line or "all checks passed"):Raw
basedpyrightoutput (required if a touched package keeps a non-empty baseline file):make testoutput (paste the summary line — pass count, 0 failures):If you touched multiple packages, paste one block per package.
5. Docs updated
Work through this line by line. If an item does not apply, write "n/a" and say why.
[ ]item is now doneexecution.py,agent_app.py, OpenAPI)6. Close-out statement
7. Risk and rollback
What breaks if this is wrong?
How do we roll back?