Commit Graph

409 Commits

Author SHA1 Message Date
934c02609a feat: hectic-lab: mechabellum for lismy 2026-05-23 19:40:36 +00:00
fb6ee3cb54 chore: devide xrays systems 2026-05-23 18:27:02 +00:00
bce720fcff chore: hectic-lab: +vismajor in matrix 2026-05-23 18:17:27 +00:00
7f39fc2dc3 fix 2026-05-23 17:13:49 +00:00
819f1691b4 chore: hecitc-lab: +lvgkcfjl email to hectic-lab 2026-05-23 14:11:27 +00:00
0a6e97f456 fix: media-browser: view button 2026-05-23 12:18:05 +00:00
d220a4588f fix: media-browser: synced files 2026-05-23 12:03:56 +00:00
7dc66abc21 feat: media-browser: preview for local files 2026-05-23 11:56:04 +00:00
e38bf7582d feat: media-browser for matrix 2026-05-23 11:46:58 +00:00
afd4970cf4 fix: matrix: s3 sync 2026-05-23 11:22:49 +00:00
ef59f14372 feat: matrix: s3 object storage 2026-05-23 09:59:34 +00:00
d86eeae4a5 fix?: support bot 2026-05-23 08:50:10 +00:00
4d7908de4b chore: hecitc-lab: add lvgkcfjl to matrix 2026-05-23 08:49:51 +00:00
20b12d42a8 feat: hectic-lab: matrix 100mb max file 2026-05-23 06:47:34 +00:00
51d40841ce feat: hectic-lab: users for matrix 2026-05-22 21:19:52 +00:00
09ed045da9 feat: module: ~matrix 2026-05-22 20:13:47 +00:00
56881b766a feat: +package merge-archive 2026-05-22 07:45:47 +00:00
19b95e707d feat: deploy: 1 no tty option 2026-05-05 20:19:52 +00:00
e71886c34e feat: lab: +models 2026-05-04 10:19:38 +00:00
da999fc37b feat: lab: configure olama models 2026-05-04 05:41:25 +00:00
f9c292643d Merge branch 'master' of github.com:hectic-lab/util.nix 2026-05-03 22:07:13 +00:00
bcdc8f0836 feat: lab: configure olama 2026-05-03 22:06:57 +00:00
66722bd8a4 fix: db-tool: NO_TTY 2026-05-03 15:35:22 +00:00
1aaf21e9c0 fix: posix-helpers 2026-05-03 05:23:23 +00:00
4204d68eed fix(db-tool): prevent fd leak from logger to long-running daemons
The hectic logger opens fd 3 as a dup of stderr. Child processes inherit
this fd, and daemonized PostgreSQL/PostgREST keeping it open prevents the
terminal from returning to the prompt after the spawning script exits.

- Add with_closed_fds helper that runs commands in a subshell with fds
  3-9 redirected to /dev/null
- Inline the helper into both database and postgres-init builds
- Wrap pg_ctl start and postgrest with the helper
2026-05-03 03:14:15 +00:00
4378b13877 feat: windows-devshell 2026-05-02 15:31:26 +00:00
c041f2e88d fix: linux-devshell for ubuntu 2026-05-01 23:11:23 +00:00
61861ff170 fix: linux-devshell from root 2026-05-01 22:56:03 +00:00
d64314d68b chore: fix nixpkgs 25.05 deprecation warnings 2026-05-01 22:26:29 +00:00
35e35980b4 test: fix: . 2026-05-01 22:19:43 +00:00
0a54a41670 fix: wsl system 2026-05-01 21:57:41 +00:00
d5d4d5a5c3 test: arch 2026-05-01 21:40:54 +00:00
ff0766519c test: linux-devshell 2026-05-01 21:13:15 +00:00
87b57d5011 feat: linux-devshell: init 2026-05-01 20:39:38 +00:00
e46a4bf8a1 fix: db-tool: envcontent 2026-05-01 12:31:44 +00:00
8b7a9b5141 fix(db-tool): typo hydate.stdout.log -> hydrate.stdout.log 2026-04-30 23:10:46 +00:00
d3cdbdf3e2 docs(postgres-hooks): document hectic bundle + responsibility split
Add lib/hook/sql/README.md describing bundle layout, apply order, Nix API
(self.lib.hectic.*), shell helper contract, and the steps for adding a new
SQL file. Rewrite db-tool README's hectic section: drop stale
PG_HECTIC_INHERITANCE / HECTIC_INHERITANCE_SQL env vars, add
HECTIC_DOTENV_FILE, document the postgres-init / migrator init / database
hydrate responsibility split.
2026-04-30 22:12:18 +00:00
1a209f6960 test(postgres-hooks): retarget hectic bundle tests to migrator init + db-tool hydrate
Move postgres-init-hectic-inheritance test (13 cases) to
migrator/init-hectic-bundle since the bundle is now applied by `migrator init`
instead of `postgres-init`. Drop init-migrator-with-inherits since
`--inherits` is now a deprecation warning, not an error. Add db-tool
hydrate-hook test (5 cases) covering --no-hook skip, default apply,
idempotency, and HECTIC_DOTENV_FILE. Augment init-migrator with
hectic.version and hectic.secret table assertions.
2026-04-30 22:12:09 +00:00
3d5e3fdb36 feat: postgres hooks 2026-04-30 21:59:53 +00:00
bf7ee34716 feat: start impliment postgres hooks 2026-04-30 21:36:22 +00:00
70c44f1fa7 feat: include hectic-landing to hectic 2026-04-30 19:33:21 +00:00
2eaa568f5b feat(db-tool): hectic-inheritance: add hectic.immutable + diff coverage
Add a hectic.immutable parent table. Tables inheriting it get auto-attached
BEFORE INSERT/UPDATE/DELETE/TRUNCATE row+statement triggers that block DML
unless the session sets hectic.migration_mode='on' (intended use: SET LOCAL
inside a migration transaction). Same exemptions as the rest of the bundle
apply (hectic schema, partitions, temp tables, GUC-excluded schemas).

database diff now appends an --- IMMUTABLE TABLE DATA --- section to its
output, with per-table unified row diffs of every table inheriting
hectic.immutable, surfacing drift in 'frozen' reference data alongside schema
drift. Subcommand exits non-zero when either schema or data differs.

Test postgres-init-hectic-inheritance extended to 10 cases covering
immutable triggers, DML blocked outside migration_mode, SET LOCAL allowing
DML inside a transaction, GUC not leaking past COMMIT, and TRUNCATE under
migration_mode.
2026-04-30 16:10:38 +00:00
31d2994997 feat(db-tool): postgres-init: apply hectic-inheritance by default
Flip PG_HECTIC_INHERITANCE default 0 -> 1. Set PG_HECTIC_INHERITANCE=0 to opt out.
2026-04-30 15:48:33 +00:00
58e9aa8fad feat(db-tool): hectic-inheritance: bootstrap hectic.created_at / hectic.updated_at inheritance hook
Adds a SQL bundle plus event triggers that enforce `INHERITS (hectic.created_at)`
on every user CREATE TABLE and auto-attach a BEFORE UPDATE row trigger when a
table inherits `hectic.updated_at`. Always-exempt: `hectic`, `information_schema`,
`pg_*`, declarative partitions, temp tables. Per-DB opt-out via the GUC
`hectic.inheritance_extra_excluded_schemas`.

Exposed three ways:
  * `pkgs.hectic.hectic-inheritance` — derivation with the SQL at
    $out/share/hectic/hectic-inheritance.sql
  * `self.lib.hecticInheritance.{sql,path}` — pkgs-free Nix surface
  * `postgres-init` opt-in via `PG_HECTIC_INHERITANCE=1` (HECTIC_INHERITANCE_SQL
    overrides the default)

Test postgres-init-hectic-inheritance covers all six branches: bootstrap,
non-inheriting reject, accepting inheritance, auto updated_at trigger fires,
GUC exclusion, declarative partition exemption.
2026-04-30 15:16:57 +00:00
7d5300853b fix(db-tool): postgres-init: createdb on reuse when target DB missing
Previously when PG_REUSE=1 and PG_VERSION existed but the target database had
never been successfully created (e.g. devshell exited mid-init in a prior run),
postgres-init skipped createdb and the subsequent psql connection failed with
'database "<db>" does not exist'.

Now on reuse path we probe pg_database and create the target DB if missing,
making postgres-init fully idempotent across stale-state recovery.

Adds postgres-init-reuse-missing-db test.
2026-04-30 12:16:09 +00:00
e732ecb878 feat(db-tool): expose overridable postgresql arg and PG_CONF_FILE env
Wrap db-tool, postgres-init, postgres-cleanup with lib.makeOverridable so
consumers can inject extension-enabled PostgreSQL via .override { postgresql = ...; }.
Add PG_CONF_FILE: when set, replaces script-generated postgresql.conf entirely
(runtime port and unix_socket_directories still appended/overridden).
2026-04-30 12:00:08 +00:00
705f5bbd01 fix(db-tool): postgres-init: always invoke main so sourcing exports vars
Previous basename guard only ran the function when invoked as the
postgres-init binary, but consumer shellHooks source the script to
inherit POSTGRESQL_HOST/PGURL/etc. Sourcing left the function defined
but never called, leaving WIPE_PGURL/PGURL unset and breaking devshell
entry in proxydoe and ruststats.
2026-04-30 11:37:19 +00:00
06a5d16ee3 fix(package): db-tool: call postgres-init/cleanup binaries instead of local devshell scripts
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-30 10:10:11 +00:00
5713eaad14 fix(package): db-tool: default PGURL to empty in dispatch to fix pull_staging exit=3 contract 2026-04-30 09:24:58 +00:00
b5dcbf08a1 feat(\db-tool\): introduce unified db-tool package with postgres harness and tests (T0-T8) 2026-04-30 09:06:44 +00:00