---
type: "Source File"
title: "from __future__ import annotations"
description: "from __future__ import annotations import json import sys from pathlib import Path ROOT = Path(__file__).resolve().parents[1] sys.path.insert(0, str(ROOT)) import codex_server # noqa: E402 def main() -> int: with."
resource: "https://codex.copecheck.com/tools/backfill_oracle_publications.py"
tags: ["copecheck", "codex", "source-file", "py"]
timestamp: "2026-05-15T07:52:59Z"
site: "codex"
source_path: "copecheck-codex/tools/backfill_oracle_publications.py"
---

# from __future__ import annotations

Source path: `copecheck-codex/tools/backfill_oracle_publications.py`  
Index snapshot generated: `2026-11-24T13:27:52Z`  
File modified: `2026-05-15T07:52:59Z`

```py
from __future__ import annotations

import json
import sys
from pathlib import Path


ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT))

import codex_server  # noqa: E402


def main() -> int:
    with codex_server.STATE_LOCK:
        state = codex_server.read_state()
        changed = codex_server.backfill_publications(state)
        subdomain_published = codex_server.publish_all_to_subdomains(state)
        published = codex_server.published_entries(state)
        if changed or subdomain_published:
            codex_server.write_state(state)
    print(
        json.dumps(
            {
                "changed": changed,
                "subdomain_published": subdomain_published,
                "published": len(published),
            },
            ensure_ascii=False,
        )
    )
    return 0


if __name__ == "__main__":
    raise SystemExit(main())
```
