diff --git a/controle-semantico.sqlite b/controle-semantico.sqlite index 0fcdd91..931a76a 100644 Binary files a/controle-semantico.sqlite and b/controle-semantico.sqlite differ diff --git a/dados/canonical-identity-central-write-status.json b/dados/canonical-identity-central-write-status.json index 3502482..cedfadd 100644 --- a/dados/canonical-identity-central-write-status.json +++ b/dados/canonical-identity-central-write-status.json @@ -6,6 +6,6 @@ "path": "G:\\_codex-git\\nucleo-gestao-operacional\\central-de-ordem-de-servico\\projects\\15_repo_tudo-para-ia-mais-humana-platform\\reports\\EXECUTADO__canonical-identity-graph.md" } ], - "generatedAt": "2026-05-02T09:21:36+00:00", + "generatedAt": "2026-05-02T09:25:08+00:00", "ok": false } \ No newline at end of file diff --git a/dados/canonical-identity-graph.json b/dados/canonical-identity-graph.json index 60b7fea..1376763 100644 --- a/dados/canonical-identity-graph.json +++ b/dados/canonical-identity-graph.json @@ -1808,7 +1808,7 @@ "compatibilityRule": "Nome canonico institucional aprovado como tudo-para-ia-mais-humana-platform; o repositorio local historico tudo-para-ia-mais-humana e o alias tudo-para-ia-mais-humana-plataform permanecem aliases de compatibilidade ate migracao Git/MCP sincronizada, sem duplicar repositorio nem sobrescrever historico.", "controlPlaneId": "tudo-para-ia-mcps-internos-plataform", "decisionSource": "015-ROTEADOR-PERMANENTE-DE-ORDEM_DE_SERVICO.MD", - "generatedAt": "2026-05-02T09:21:36+00:00", + "generatedAt": "2026-05-02T09:25:08+00:00", "graphId": "canonical-identity-59e116f20f1a36a6", "maisHumanaCanonicalProjectId": "tudo-para-ia-mais-humana-platform", "maisHumanaCentralFolder": "15_repo_tudo-para-ia-mais-humana-platform", diff --git a/dados/canonical-identity-semantic-write-status.json b/dados/canonical-identity-semantic-write-status.json new file mode 100644 index 0000000..bad96a6 --- /dev/null +++ b/dados/canonical-identity-semantic-write-status.json @@ -0,0 +1,7 @@ +{ + "error": "", + "filesCount": 6, + "generatedAt": "2026-05-02T09:25:08+00:00", + "ok": true, + "sqlitePath": "G:\\_codex-git\\tudo-para-ia-mais-humana\\controle-semantico.sqlite" +} \ No newline at end of file diff --git a/dados/workspace-hygiene-central-write-status.json b/dados/workspace-hygiene-central-write-status.json index 59d2cf4..5065e42 100644 --- a/dados/workspace-hygiene-central-write-status.json +++ b/dados/workspace-hygiene-central-write-status.json @@ -6,6 +6,6 @@ "path": "G:\\_codex-git\\nucleo-gestao-operacional\\central-de-ordem-de-servico\\projects\\15_repo_tudo-para-ia-mais-humana-platform\\reports\\EXECUTADO__workspace-hygiene.md" } ], - "generatedAt": "2026-05-02T08:21:08+00:00", + "generatedAt": "2026-05-02T09:27:04+00:00", "ok": false } \ No newline at end of file diff --git a/dados/workspace-hygiene-report.json b/dados/workspace-hygiene-report.json index b79edf4..70d7c96 100644 --- a/dados/workspace-hygiene-report.json +++ b/dados/workspace-hygiene-report.json @@ -7,7 +7,7 @@ "error": "PermissionError: [WinError 5] Acesso negado: 'G:\\\\_codex-git\\\\tudo-para-ia-mais-humana\\\\.test-tmp\\\\tmpnk6r4sdb'", "footprint_after": { "byte_count": 0, - "child_count": 897, + "child_count": 1042, "errors": [ "PermissionError: [WinError 5] Acesso negado: 'G:\\\\_codex-git\\\\tudo-para-ia-mais-humana\\\\.test-tmp\\\\tmpnk6r4sdb'", "PermissionError: [WinError 5] Acesso negado: 'G:\\\\_codex-git\\\\tudo-para-ia-mais-humana\\\\.test-tmp\\\\tmpu13bzfhr'" @@ -17,8 +17,8 @@ "is_file": false }, "footprint_before": { - "byte_count": 60842050, - "child_count": 2213, + "byte_count": 68130347, + "child_count": 3052, "errors": [ "PermissionError: [WinError 5] Acesso negado: 'G:\\\\_codex-git\\\\tudo-para-ia-mais-humana\\\\.test-tmp\\\\tmpnk6r4sdb'", "PermissionError: [WinError 5] Acesso negado: 'G:\\\\_codex-git\\\\tudo-para-ia-mais-humana\\\\.test-tmp\\\\tmpu13bzfhr'" @@ -63,11 +63,11 @@ "blockers": [ "python-test-temp:PermissionError: [WinError 5] Acesso negado: 'G:\\\\_codex-git\\\\tudo-para-ia-mais-humana\\\\.test-tmp\\\\tmpnk6r4sdb'" ], - "central_platform_folder": "", + "central_platform_folder": "G:\\_codex-git\\nucleo-gestao-operacional\\central-de-ordem-de-servico\\projects\\15_repo_tudo-para-ia-mais-humana-platform", "clean": false, - "generated_at": "2026-05-02T08:28:47+00:00", + "generated_at": "2026-05-02T09:27:04+00:00", "project_root": "G:\\_codex-git\\tudo-para-ia-mais-humana", - "report_id": "workspace-hygiene-534686882219", + "report_id": "workspace-hygiene-389155382838", "status": "blocked", "summary": [ "Targets evaluated: 2.", diff --git a/ecossistema/CANONICAL-IDENTITY-GRAPH.md b/ecossistema/CANONICAL-IDENTITY-GRAPH.md index 6bd7f8d..fdf0a8f 100644 --- a/ecossistema/CANONICAL-IDENTITY-GRAPH.md +++ b/ecossistema/CANONICAL-IDENTITY-GRAPH.md @@ -1,7 +1,7 @@ # Canonical Identity Graph - graph_id: `canonical-identity-59e116f20f1a36a6` -- generated_at: `2026-05-02T09:21:36+00:00` +- generated_at: `2026-05-02T09:25:08+00:00` - records: `15` - aliases: `75` - acceptance_cases: `4125` diff --git a/ecossistema/WORKSPACE-HYGIENE-REPORT.md b/ecossistema/WORKSPACE-HYGIENE-REPORT.md index bb3b76e..3d7c10e 100644 --- a/ecossistema/WORKSPACE-HYGIENE-REPORT.md +++ b/ecossistema/WORKSPACE-HYGIENE-REPORT.md @@ -1,9 +1,9 @@ # Workspace Hygiene Report -- report_id: `workspace-hygiene-534686882219` -- generated_at: `2026-05-02T08:28:47+00:00` +- report_id: `workspace-hygiene-389155382838` +- generated_at: `2026-05-02T09:27:04+00:00` - project_root: `G:\_codex-git\tudo-para-ia-mais-humana` -- central_platform_folder: `` +- central_platform_folder: `G:\_codex-git\nucleo-gestao-operacional\central-de-ordem-de-servico\projects\15_repo_tudo-para-ia-mais-humana-platform` - status: `blocked` - clean: `False` - apply: `True` @@ -27,8 +27,8 @@ - applied: `True` - deleted: `False` - exists_after: `True` -- children_before: `2213` -- bytes_before: `60842050` +- children_before: `3052` +- bytes_before: `68130347` - note: artifact retained by ACL or filesystem lock - error: `PermissionError: [WinError 5] Acesso negado: 'G:\\_codex-git\\tudo-para-ia-mais-humana\\.test-tmp\\tmpnk6r4sdb'` - footprint_errors: diff --git a/matrizes/workspace-hygiene-targets.csv b/matrizes/workspace-hygiene-targets.csv index 6087e2e..90fab97 100644 --- a/matrizes/workspace-hygiene-targets.csv +++ b/matrizes/workspace-hygiene-targets.csv @@ -1,3 +1,3 @@ target_id,path,action,status,applied,deleted,exists_after,children_before,bytes_before,error,note -python-test-temp,G:\_codex-git\tudo-para-ia-mais-humana\.test-tmp,delete_directory,blocked,yes,no,yes,2213,60842050,PermissionError: [WinError 5] Acesso negado: 'G:\\_codex-git\\tudo-para-ia-mais-humana\\.test-tmp\\tmpnk6r4sdb',artifact retained by ACL or filesystem lock +python-test-temp,G:\_codex-git\tudo-para-ia-mais-humana\.test-tmp,delete_directory,blocked,yes,no,yes,3052,68130347,PermissionError: [WinError 5] Acesso negado: 'G:\\_codex-git\\tudo-para-ia-mais-humana\\.test-tmp\\tmpnk6r4sdb',artifact retained by ACL or filesystem lock node-dependencies,G:\_codex-git\tudo-para-ia-mais-humana\node_modules,verify_absent,not_found,no,no,no,0,0,,target already absent diff --git a/src/mais_humana/canonical_identity.py b/src/mais_humana/canonical_identity.py index b481d49..1fc644a 100644 --- a/src/mais_humana/canonical_identity.py +++ b/src/mais_humana/canonical_identity.py @@ -30,6 +30,7 @@ from .identity_policy import ( from .models import GeneratedFile, as_plain_data, merge_unique, slugify, utc_now from .repository_mesh import RepositoryTarget, default_repository_targets, stable_digest from .repository_mesh_naming import plataform_to_platform, platform_to_plataform +from .storage import connect, upsert_files class CanonicalAliasKind(str, Enum): @@ -848,6 +849,53 @@ def write_identity_graph_artifacts( return tuple(records) +def _semantic_status_record(project_root: Path) -> GeneratedFile: + return GeneratedFile( + path=str(project_root / "dados" / "canonical-identity-semantic-write-status.json"), + description="Status da escrita semantica local do grafo canonico.", + function="canonical identity local semantic write status", + file_type="json", + changed_by="mais_humana.canonical_identity", + change_summary="Registrado resultado da atualizacao do controle-semantico.sqlite local.", + relation_to_order="0035_EXECUTIVA__reconciliar-nome-canonico-real-alias-platform", + ) + + +def write_local_semantic_records(project_root: Path, records: Sequence[GeneratedFile]) -> tuple[GeneratedFile, ...]: + sqlite_path = project_root / "controle-semantico.sqlite" + status_record = _semantic_status_record(project_root) + status_path = Path(status_record.path) + tracked_records = tuple(records) + (status_record,) + error = "" + ok = False + try: + with connect(sqlite_path) as conn: + upsert_files(conn, tracked_records) + ok = True + except Exception as exc: + error = f"{type(exc).__name__}: {exc}" + status_path.parent.mkdir(parents=True, exist_ok=True) + status_path.write_text( + json.dumps( + { + "generatedAt": utc_now(), + "ok": ok, + "error": error, + "sqlitePath": str(sqlite_path), + "filesCount": len(tracked_records), + }, + ensure_ascii=False, + indent=2, + sort_keys=True, + ), + encoding="utf-8", + ) + if ok: + with connect(sqlite_path) as conn: + upsert_files(conn, (status_record,)) + return tracked_records + + def run_canonical_identity_graph( *, project_root: Path, @@ -856,4 +904,5 @@ def run_canonical_identity_graph( ) -> tuple[CanonicalIdentityGraph, tuple[GeneratedFile, ...]]: graph = build_identity_graph(use_generated=use_generated) records = write_identity_graph_artifacts(graph, project_root, central_platform_folder=central_platform_folder) - return graph, records + semantic_records = write_local_semantic_records(project_root, records) + return graph, semantic_records