From 4806acf57d1b7a14c353b4c2f16e5bda7f6f8ee3 Mon Sep 17 00:00:00 2001 From: Aner Zakobar Date: Wed, 17 Jun 2026 07:36:46 +0300 Subject: [PATCH] backup: 2026-06-17 07:36 --- azos.org | 80 +++++++------------------------------ azosarchitecture.org | 59 +++++++++++++++++++++++++++ azosorg-roam.org | 19 +++++++++ impl.org | 44 +++++++++++++++++++++ impldatasets.org | 6 +++ implexperiments.org | 6 +++ implloss-functions.org | 6 +++ trmn.org | 51 ++++++++++++++++++++++++ trmnassets.org | 44 +++++++++++++++++++++ trmnlife.org | 81 +++++++++++++++++++++++++++++++++++++ trmnllm.org | 58 +++++++++++++++++++++++++++ trmnpeople.org | 90 ++++++++++++++++++++++++++++++++++++++++++ trmnschedule.org | 66 +++++++++++++++++++++++++++++++ 13 files changed, 544 insertions(+), 66 deletions(-) create mode 100644 azosarchitecture.org create mode 100644 azosorg-roam.org create mode 100644 impl.org create mode 100644 impldatasets.org create mode 100644 implexperiments.org create mode 100644 implloss-functions.org create mode 100644 trmn.org create mode 100644 trmnassets.org create mode 100644 trmnlife.org create mode 100644 trmnllm.org create mode 100644 trmnpeople.org create mode 100644 trmnschedule.org diff --git a/azos.org b/azos.org index 4d679f6..ec96349 100644 --- a/azos.org +++ b/azos.org @@ -7,56 +7,9 @@ * Architecture -azos is a NixOS/home-manager configuration repo with a two-tier feature system: +Two-tier NixOS/home-manager feature system: =azos-core/= (shared submodule) + =features/= (machine-specific). Features auto-discovered via =import-tree=, collected into =config.flake.modules=. -- =azos-core/= — git submodule containing shared, reusable features (base, editor, claude-memory, claude-skills, dev, etc.) -- =features/= — machine-specific features (claude, encryption, hyprland, audio, etc.) -- =home-manager/home.nix= — home-manager entry point; manually lists all modules to import -- =_machines/= — per-machine NixOS configs; passes =suiteModules= as =specialArgs= - -Feature auto-discovery is via =import-tree= in each flake.nix. Features from both -=azos-core/features/= and =azos/features/= are collected into =config.flake.modules=. - -** Module registration pattern - -Each feature's =default.nix= registers itself: - -#+begin_src nix -config.flake.modules.homeManager. = { lib, config, pkgs, ... }: { - options.azos..enable = lib.mkOption { ... }; - config = lib.mkIf config.azos..enable { ... }; -}; -#+end_src - -Modules are then imported in =home-manager/home.nix= via: - -#+begin_src nix -imports = [ suiteModules.homeManager. ... ]; -#+end_src - -** Option namespace - -=azos..= - -Dependencies between features use =lib.mkDefault true= to auto-enable: - -#+begin_src nix -azos.claude-memory.enable = lib.mkDefault true; -azos.claude-skills.enable = lib.mkDefault true; -#+end_src - -** File deployment - -- Static files: =home.file."path".source = ./file;= -- Generated text: =home.file."path".text = "...";= -- Runtime scripts (e.g. merging JSON): =home.activation. = lib.hm.dag.entryAfter ["writeBoundary"] ''...'';= - -** Claude Code integration - -Three azos-core features wire up Claude Code: -- =claude-memory= — registers org-roam-mcp as a global MCP server in =~/.claude.json= -- =claude-skills= — deploys skills to =~/.claude/commands/= and content to =~/.claude/CLAUDE.md= -- =claude= (=azos/features=) — installs claude-code, auto-enables the above two +See [[id:36fe6a01-ea1f-4785-8516-f6dcfecf05bb][azos/architecture]] for module registration, option namespace, file deployment, and Claude Code wiring. * Conventions @@ -70,16 +23,21 @@ Three azos-core features wire up Claude Code: - Packages in overlay: =pkgs.= via =config.flake.overlayPkgs.= - Unstable packages: =pkgs.unstable.= +** Writing Claude Skills + +Skill descriptions are routing keys — they determine whether a skill activates. Guidelines (ref: https://stevekinney.com/writing/agent-skills): +- Open with =TRIGGER on:= and numbered conditions so activation is unambiguous +- One specific job per skill; overlapping descriptions cause routing competition +- Scope exclusions: state what the skill does NOT replace to prevent false positives +- Domain-specific language; no generic phrases like "helps with X" + * Gotchas - =azos-core= is a git submodule — =git add= must be run inside it separately from the outer repo - Nix flakes only evaluate git-tracked files; new files must be staged (=git add=) before =nix build= will see them - =import-tree= auto-discovers features but only sees tracked files — same constraint - The machine name is =lauretta=; machine config is at =_machines/lauretta.nix= -- org-roam-mcp is forked at =anerisgreat/org-roam-mcp= (not upstream =aserranoni/org-roam-mcp=); fork fixes: =create_node= writes directly to SQLite so new nodes are immediately searchable (no emacsclient needed), and =cli_main= is defined natively (no postPatch needed) -- emacsql stores all Emacs strings in SQLite with surrounding ="..."= — the Python DB layer strips these with =_clean_path=/_clean_string= -- org-roam timestamps in SQLite are Emacs =(HIGH LOW USEC PSEC)= tuples: =HIGH = secs >> 16=, =LOW = secs & 0xFFFF= -- =postPatch= in Nix derivations: alejandra reformats the indentation of multiline strings, which can change the effective shell script content +- =postPatch= in Nix derivations: alejandra reformats indentation of multiline strings, which can change effective shell script content * Key Files @@ -89,21 +47,11 @@ Three azos-core features wire up Claude Code: | =azos-core/features/claude-skills/default.nix= | global skills + CLAUDE.md deployment | | =azos-core/features/claude-skills/skills/todo.md= | per-project TODO management skill | | =azos-core/features/claude-skills/skills/project-brain.md= | org-roam second brain skill | -| =azos-core/features/claude-skills/README.md= | skills extensibility docs | | =azos/features/claude/default.nix= | installs claude-code, enables claude-memory + claude-skills | -| =azos/home-manager/home.nix= | home-manager entry point, imports all modules | -| =azos-core/features/editor/emacs/config.org= | literate Emacs config (org-roam at line ~452) | -| =azos/azos-core= | git submodule pointing to shared feature library | | =features/lauretta/emacs/config.org= | lauretta-specific Emacs overrides (agent-shell, LLM, beacon, caldav) | -| =~/.claude/settings.json= | Claude Code global permissions; read-only org-roam MCP tools are always-allowed here | - -* org-roam Setup - -- Directory: =~/roam/= -- Database: =~/.emacs.d/org-roam.db= (sqlite-builtin connector) -- MCP server: =org-roam-mcp= registered in =~/.claude.json= via home-manager activation -- org-agenda now includes =~/roam/= so TODOs in roam files appear in agenda +| =~/.claude/settings.json= | Claude Code global permissions; always-allowed org-roam MCP tools listed here | * Subnodes -(none yet) +- [[id:36fe6a01-ea1f-4785-8516-f6dcfecf05bb][azos/architecture]] — module registration, option namespace, file deployment, Claude Code wiring +- [[id:c945da4f-de5c-4eb8-bd99-810576a2545a][azos/org-roam]] — setup, MCP server, SQLite internals, fork details diff --git a/azosarchitecture.org b/azosarchitecture.org new file mode 100644 index 0000000..f46889e --- /dev/null +++ b/azosarchitecture.org @@ -0,0 +1,59 @@ +:PROPERTIES: +:ID: 36fe6a01-ea1f-4785-8516-f6dcfecf05bb +:END: + +#+title: azos/architecture +#+filetags: :project: :knowledge: :architecture: + +* Architecture + +azos is a NixOS/home-manager configuration repo with a two-tier feature system: + +- =azos-core/= — git submodule containing shared, reusable features (base, editor, claude-memory, claude-skills, dev, etc.) +- =features/= — machine-specific features (claude, encryption, hyprland, audio, etc.) +- =home-manager/home.nix= — home-manager entry point; manually lists all modules to import +- =_machines/= — per-machine NixOS configs; passes =suiteModules= as =specialArgs= + +Feature auto-discovery is via =import-tree= in each flake.nix. Features from both +=azos-core/features/= and =azos/features/= are collected into =config.flake.modules=. + +** Module registration pattern + +Each feature's =default.nix= registers itself: + +#+begin_src nix +config.flake.modules.homeManager. = { lib, config, pkgs, ... }: { + options.azos..enable = lib.mkOption { ... }; + config = lib.mkIf config.azos..enable { ... }; +}; +#+end_src + +Modules are then imported in =home-manager/home.nix= via: + +#+begin_src nix +imports = [ suiteModules.homeManager. ... ]; +#+end_src + +** Option namespace + +=azos..= + +Dependencies between features use =lib.mkDefault true= to auto-enable: + +#+begin_src nix +azos.claude-memory.enable = lib.mkDefault true; +azos.claude-skills.enable = lib.mkDefault true; +#+end_src + +** File deployment + +- Static files: =home.file."path".source = ./file;= +- Generated text: =home.file."path".text = "...";= +- Runtime scripts (e.g. merging JSON): =home.activation. = lib.hm.dag.entryAfter ["writeBoundary"] ''...'';= + +** Claude Code integration + +Three azos-core features wire up Claude Code: +- =claude-memory= — registers org-roam-mcp as a global MCP server in =~/.claude.json= +- =claude-skills= — deploys skills to =~/.claude/commands/= and content to =~/.claude/CLAUDE.md= +- =claude= (=azos/features=) — installs claude-code, auto-enables the above two diff --git a/azosorg-roam.org b/azosorg-roam.org new file mode 100644 index 0000000..74c05fe --- /dev/null +++ b/azosorg-roam.org @@ -0,0 +1,19 @@ +:PROPERTIES: +:ID: c945da4f-de5c-4eb8-bd99-810576a2545a +:END: + +#+title: azos/org-roam +#+filetags: :project: :knowledge: :org-roam: + +* Setup + +- Directory: =~/roam/= +- Database: =~/.emacs.d/org-roam.db= (sqlite-builtin connector) +- MCP server: =org-roam-mcp= registered in =~/.claude.json= via home-manager activation +- org-agenda includes =~/roam/= so TODOs in roam files appear in agenda + +* Gotchas + +- org-roam-mcp is forked at =anerisgreat/org-roam-mcp= (not upstream =aserranoni/org-roam-mcp=); fork fixes: =create_node= writes directly to SQLite so new nodes are immediately searchable (no emacsclient needed), and =cli_main= is defined natively (no postPatch needed) +- emacsql stores all Emacs strings in SQLite with surrounding ="..."= — the Python DB layer strips these with =_clean_path=/_clean_string= +- org-roam timestamps in SQLite are Emacs =(HIGH LOW USEC PSEC)= tuples: =HIGH = secs >> 16=, =LOW = secs & 0xFFFF= diff --git a/impl.org b/impl.org new file mode 100644 index 0000000..38b1391 --- /dev/null +++ b/impl.org @@ -0,0 +1,44 @@ +* impl + +ROLL (Ranking via Optimized Label Learning) — PyTorch research project implementing custom loss functions for binary classification using kernel density estimation (KDE) to optimize TPR at target FPR thresholds. Targets imbalanced classification problems. + +** Architecture + +- =src/roll.py= — Loss function implementations (Normal/Beta/Kernelized ROLL) +- =src/experiment.py= — Training loop, evaluation infra, =run_configurations()= entry point +- =src/datasets.py= — 10+ dataset loaders (KEEL, UCI, Kaggle, synthetic) +- =src/networks.py= — =KeelNet= MLP architecture +- =src/summary.py= — Plotly HTML visualization (ROC, score distributions, ECDF) +- =src/utils.py= — Logging, output dir creation (=init_experiment=) +- =experiments/keel/=, =experiments/other/=, =experiments/large/= — experiment scripts + +** Conventions + +- All hyperparameters in Python dataclasses (=ExperimentConfiguration=), no CLI parsing +- Experiments follow =experiment-*.py= naming; all call =run_configurations()= +- KEEL experiments share =experiments/keel/_base.py= runner; individual files just call it +- All datasets expose: =__getitem__=, =__len__=, =.x=, =.y= attributes +- Episode-based eval: N independent train runs per config, results aggregated +- GPU enabled via =cudaSupport = true= in flake.nix; =get_device()= in utils.py auto-selects GPU/CPU +- Beta distribution variant (=roll_beta_loss_from_fpr=) is kept for thesis writing but is not actively developed or used + +** Gotchas + +- Dataset paths injected as env vars by Nix shell hook (=$keel_wisconsin_dir=, etc.) — must use =nix develop= +- =_calc_moments()= in roll.py is unused and has a variable typo (=array= vs =arr=) +- CIFAR-10 binary: class 1 vs rest (not class 0) +- Multiprocessing uses =spawn= method via =torch.multiprocessing= + +** Key Files + +- [[file:src/roll.py][src/roll.py]] — Core loss: =KernelizedROLLoss= custom autograd Function with KDE backward pass +- [[file:src/experiment.py][src/experiment.py]] — =ExperimentConfiguration= dataclass, =Criteriorator= ABC, =run_configurations()= +- [[file:experiments/keel/_base.py][experiments/keel/_base.py]] — shared KEEL runner =run_keel_experiment()= +- [[file:flake.nix][flake.nix]] — Nix env with dataset downloads, hash-pinned, exports path env vars +- [[file:AGENTS.md][AGENTS.md]] — Project guidelines (naming conventions, env, dataset list) + +** Subnodes + +- [[id:001430d5-e1e7-4e72-baf6-17399bfd6447][impl/loss-functions]] — Loss variants, KDE internals, gradient computation +- [[id:a53cbe84-cd8d-45c2-a8cf-34ab520a3ea5][impl/experiments]] — Experiment structure, training flow, metrics, output layout +- [[id:b8a9886a-d349-43e5-a745-817a148c1fd8][impl/datasets]] — Dataset catalog, KEEL list, eval metrics diff --git a/impldatasets.org b/impldatasets.org new file mode 100644 index 0000000..db3cb37 --- /dev/null +++ b/impldatasets.org @@ -0,0 +1,6 @@ +:PROPERTIES: +:ID: b8a9886a-d349-43e5-a745-817a148c1fd8 +:END: + +#+title: impl/datasets +#+filetags: :project: :knowledge: :datasets: diff --git a/implexperiments.org b/implexperiments.org new file mode 100644 index 0000000..69e7418 --- /dev/null +++ b/implexperiments.org @@ -0,0 +1,6 @@ +:PROPERTIES: +:ID: a53cbe84-cd8d-45c2-a8cf-34ab520a3ea5 +:END: + +#+title: impl/experiments +#+filetags: :project: :knowledge: :experiments: diff --git a/implloss-functions.org b/implloss-functions.org new file mode 100644 index 0000000..2431584 --- /dev/null +++ b/implloss-functions.org @@ -0,0 +1,6 @@ +:PROPERTIES: +:ID: 001430d5-e1e7-4e72-baf6-17399bfd6447 +:END: + +#+title: impl/loss-functions +#+filetags: :project: :knowledge: :loss-functions: diff --git a/trmn.org b/trmn.org new file mode 100644 index 0000000..48ce090 --- /dev/null +++ b/trmn.org @@ -0,0 +1,51 @@ +:PROPERTIES: +:ID: 6293baa2-c8a8-4c49-9284-1fa2eed75032 +:END: + +#+title: trmn +#+filetags: :project: :knowledge: + +** Architecture +Static site (no backend). ~index.html~ + ~life.js~ + ~schedule.js~ as ES modules. Three.js + onnxruntime-web from CDN. +Served by Caddy via ~nix run~ on port 8080. Built by ~nix build~ (includes model weights in ~$out/model/~). + +Domains: +- *Life generation*: ~life.js~ — deterministic 36,500-day procedural simulation → [[id:9465af82-4383-466c-bf09-5be19c328f0b][trmn/life]] +- *NPC people*: family tree + tracked friends/children, each with deterministic PersonRecord → [[id:423cac95-a80d-4db6-8bef-14297fb38437][trmn/people]] +- *Daily schedule*: ~schedule.js~ — 96-slot day, 68 scenes, deterministic from (masterSeed, currentDay) → [[id:ff8aa6b7-61ff-444c-9301-c0b666b0b573][trmn/schedule]] +- *Rendering*: Three.js low-poly 3D scenes, flat shading, cinematic 2.39:1 viewport +- *LLM dialogue*: TinyStories-8M ONNX INT8 bundled in ~/model/TinyStories-8M/~ → [[id:4b44cf43-6106-4498-81a3-b23ebb25dabf][trmn/llm]] +- *Assets*: SVG face sprites + GLB objects → [[id:4d5e6bc8-32eb-469f-a69f-84b14458c55b][trmn/assets]] + +~window.__life~ exposes ~{traits, buf, eventLog, people, today, currentDay, masterSeed, schedule}~. + +** Conventions +- Determinism: ALL randomness seeded from absolute time, never ~Math.random()~; use ~makeRng(masterSeed, day)~ +- Low-poly aesthetic: ~MeshLambertMaterial~ with ~flatShading: true~, BoxGeometry for characters +- Cinematic viewport: ~aspect-ratio: 2.39/1~, FOV 26°, vignette via CSS ~::after~ +- Scene background via CSS gradient on ~#stage~ div; canvas is ~alpha: true~ +- Static assets: copy to ~$out/assets/~ in flake installPhase; generated assets built via Node.js in buildPhase + +** Gotchas +- ~header Content-Type text/html~ in Caddyfile is wrong for multi-asset setups — omit it +- ~MeshFlatMaterial~ does not exist; use ~MeshLambertMaterial { flatShading: true }~ +- ~onnxruntime-web~ must be a ~