ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/AI_Brain / daemon/seed_common.py

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/AI_Brain / daemon/seed_common.py
DateNot specified in source
RepositoryJanady13/AI_Brain
Revision11aa50ef5d7692e8abd1b8d74ae31c5c29201b14
Branchcodex/build-online-github-ani-irqa7y
Path or archive memberdaemon/seed_common.py
Original SHA-256576868ebf65bbd39b48a5bac6ed08a4139e840f041fe0b2f759223034a516673
Git blob SHA1f6ee9a2344564024f98df3057924985806051f0
Reading-copy SHA-256576868ebf65bbd39b48a5bac6ed08a4139e840f041fe0b2f759223034a516673

Original source ↗

Every recorded occurrence

These 23 records contain identical original source bytes. Their paths and revisions remain part of the archive.

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-irqa7y11aa50ef5d7692e8abd1b8d74ae31c5c29201b14Open original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-hr4y0z366ab848896ae49159cfb3f6c201b8c5a731e9c8Open original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-i3cigl3a6e002311c48c27ffd41ef4a2a31c63947128cdOpen original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani49db80a641b10ab62d16cc7643bd0b367f93951cOpen original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-hrtsoc50285aff347685f043e7a72e4d72891eebaa6cd6Open original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-7v4kug5cd0bbf744b0aee9445913337e852889d9a8098eOpen original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-nbgsix840945d70b88674d8f40d330001cc63d871dc8e2Open original
Janady13/AI_Brain / daemon/seed_common.pycopilot/vscode17602838959829e1c1a5b171addb5bb4a83b2ea7dede50c1cc81eOpen original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-jf5oloc6653627c453ab428d665226167fa5f4aa05e9a5Open original
Janady13/AI_Brain / daemon/seed_common.pyfeature/seeder-engine-testscdb497ece2d1a770ca8c83eb1de8923cfaa9ecebOpen original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-7nmb21d0f50071c85cddaaebbf9c4dd1313bd7676986daOpen original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-0etknse250b19d446bdffd542c9eea31cead12e30800d6Open original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-hr4y0z366ab848896ae49159cfb3f6c201b8c5a731e9c8Open original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-irqa7y11aa50ef5d7692e8abd1b8d74ae31c5c29201b14Open original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-i3cigl3a6e002311c48c27ffd41ef4a2a31c63947128cdOpen original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-7v4kug5cd0bbf744b0aee9445913337e852889d9a8098eOpen original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-nbgsix840945d70b88674d8f40d330001cc63d871dc8e2Open original
Janady13/AI_Brain / daemon/seed_common.pycopilot/vscode17602838959829e1c1a5b171addb5bb4a83b2ea7dede50c1cc81eOpen original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-7nmb21d0f50071c85cddaaebbf9c4dd1313bd7676986daOpen original
Janady13/AI_Brain / daemon/seed_common.pyfeature/seeder-engine-testscdb497ece2d1a770ca8c83eb1de8923cfaa9ecebOpen original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani49db80a641b10ab62d16cc7643bd0b367f93951cOpen original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-jf5oloc6653627c453ab428d665226167fa5f4aa05e9a5Open original
Janady13/AI_Brain / daemon/seed_common.pycodex/build-online-github-ani-hrtsoc50285aff347685f043e7a72e4d72891eebaa6cd6Open original

Recovered source transcript

#!/usr/bin/env python3 # Local seeding utilities following 12-factor config from __future__ import annotations import os, sys, hashlib, time from typing import Iterable, Tuple, Callable, List from pathlib import Path # Lazy import psycopg2 only when needed try: import psycopg2 # type: ignore except Exception: # pragma: no cover psycopg2 = None # allow dry-run without dependency DEFAULT_DB = os.getenv("PGDATABASE", os.getenv("DB_NAME", "brain_atomic")) DEFAULT_USER = os.getenv("PGUSER", os.getenv("DB_USER", "postgres")) # Prefer Brain volume sockets if present, then External, then home dir, else localhost DEFAULT_HOST = ( os.getenv("PGHOST") or os.getenv("DB_HOST") or next( ( c for c in [ "/Volumes/Brain/AI_Brain/pg", "/Volumes/Brain/HiveExpansion/pg", "/Volumes/External/AI_Brain/pg", str(Path.home() / "AI_Brain" / "pg"), ] if Path(c).exists() ), "localhost", ) ) DEFAULT_PORT = int(os.getenv("PGPORT", os.getenv("DB_PORT", "5432"))) DRY_RUN = os.getenv("DRY_RUN", "0").lower() in {"1", "true", "yes", "on"} SOURCE_TAG = os.getenv("SEED_SOURCE", "Hive500Expansion") def compute_hash(sentence: str) -> str: # Atomic uniqueness across identical sentences (global), as specified return hashlib.sha256(sentence.encode("utf-8")).hexdigest() def connect_db(): if DRY_RUN: return None if psycopg2 is None: sys.stderr.write( "psycopg2 not installed. Install with: pip install psycopg2-binary\n" ) sys.exit(1) return psycopg2.connect(dbname=DEFAULT_DB, user=DEFAULT_USER, host=DEFAULT_HOST, port=DEFAULT_PORT) INSERT_SQL = ( "INSERT INTO atomic_facts (hash, sentence, category, source, created_at) " "VALUES (%s, %s, %s, %s, now()) ON CONFLICT (hash) DO NOTHING;" ) def insert_many(category: str, items: Iterable[str]) -> Tuple[int, int]: """Insert items; returns (attempted, inserted_estimate).""" attempted = 0 inserted = 0 conn = connect_db() cur = conn.cursor() if conn is not None else None try: for s in items: sentence = s.strip() if not sentence: continue if not sentence.endswith("."): sentence = f"{sentence}." h = compute_hash(sentence) attempted += 1 if DRY_RUN: inserted += 1 continue cur.execute(INSERT_SQL, (h, sentence, category, SOURCE_TAG)) if conn is not None: conn.commit() finally: if cur is not None: cur.close() if conn is not None: conn.close() return attempted, (inserted if DRY_RUN else attempted) def read_file_lines(path: str, limit: int) -> List[str]: seen = set() out: List[str] = [] with open(path, "r", encoding="utf-8") as f: for raw in f: line = raw.strip() if not line: continue if line in seen: continue seen.add(line) out.append(line) if len(out) >= limit: break return out def run_seed(category: str, generator: Callable[[int], Iterable[str]], limit: int = 500) -> None: start = time.time() cat_upper = category.upper() file_override = os.getenv(f"SEED_FILE_{cat_upper}") or os.getenv("SEED_FILE") if file_override and os.path.isfile(file_override): items = read_file_lines(file_override, limit) mode_detail = f"FILE:{file_override}" else: items = list(generator(limit)) mode_detail = "GENERATOR" attempted, inserted = insert_many(category, items) dur = time.time() - start mode = "DRY_RUN" if DRY_RUN else "LIVE" print( f"✅ {mode} seeded category='{category}' source={mode_detail} attempted={attempted} inserted~={inserted} in {dur:.2f}s" )

Search equations, builds, manuscript text, and recovered sources.