5 Commits

Author SHA1 Message Date
33635796ee docs: add USER_WORKFLOW.md — end-user journey from idea to trained model
Practical walk-through for someone landing on the platform without
context: pick a base model, prepare data, run a fine-tune, test the
result. Grounded in what the platform actually does today.

Covers the four main pages (/models, /datasets/upload, /jobs/create,
/jobs/view) and flags current limitations (NFP-52 chat-test gap for
platform-trained models, etc.). Includes an iteration table mapping
common failure modes to fixes, and a "first-week mistakes" list.

Linked from README alongside the developer MANUAL.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 22:57:08 +02:00
f3d6d6b6d3 Add db/dev-snapshot.sql with Stephan's local working state
Full mariadb-dump (schema + data) from the live develop instance,
post-NFP-18 migration. Includes test data new devs can immediately
poke at instead of staring at an empty dashboard.

Contents:
  - 36 tables (full schema)
  - 2 users (admin@finetune.ai/admin123, testuser@example.com/test123)
  - 5 datasets, 1 job (Support Bot v1, completed), 1 model
  - 1 user_billing row, 5 user_settings rows
  - 8 email_templates, 3 ACL roles, all migrations table state

Sanitization applied at the end of the dump (POST-LOAD block):
  - user.user_pass set to NULL (legacy AES-encrypted passwords;
    post-NFP-18 auth uses user_password_hash only)
  - user_settings values for keys matching token/key/secret/password/api
    set to empty string (devs add their own HF token, etc.)
  - user_password_hash for both default users reset to freshly-generated
    argon2id hashes that verify against the documented plaintexts

bootstrap-db.sh adds NFP_USE_SNAPSHOT=1 to load this instead of the
clean 3-file path. Both routes arrive at the same credentials.

Verified end-to-end:
  - dump loads on a fresh DB (exit 0)
  - both default credentials authenticate via password_verify
  - all data rows preserved
  - no credential-shaped strings in non-comment lines
2026-05-14 13:15:32 +02:00
b0a2014dd7 Add NFP_TARGET_DB override + verify end-to-end round trip
bootstrap-db.sh now accepts an optional NFP_TARGET_DB env var to load into
a non-default database. Useful for testing the bootstrap against a sandbox
DB without wiping the platform's live data:

  NFP_TARGET_DB=nfp_sandbox ./bootstrap-db.sh

Verified the full round trip:
  1. Create fresh nfp_roundtrip_test DB as root, grant access to neuronetz
  2. Run bootstrap-db.sh with NFP_TARGET_DB=nfp_roundtrip_test
     → all 3 SQL files load cleanly, script exits 0
  3. Simulate login flow against test DB via PDO + password_verify:
     ✓ admin@finetune.ai/admin123    → authenticated, role=superuser
     ✓ testuser@example.com/test123  → authenticated, role=user
     ✗ admin@finetune.ai/wrongpass   → password verify rejects (correct)
     ✗ nobody@example.com/whatever   → user not found (correct)
  4. Drop test DB cleanly

The auth simulation runs the same query a fresh login would, including the
user_to_acl JOIN — confirms ACL role is reachable via the bootstrap data.

Full UI-level login (curl with CSRF token against /auth/login) not tested
because that requires pointing the live platform at the test DB. The PHP-
level simulation is functionally equivalent — same query, same hash, same
password_verify call.
2026-05-14 13:07:53 +02:00
b0ed337862 Fix user_to_acl column names in 03-default-users.sql
The user_to_acl table is one of the few join tables that does NOT follow
the tablename_fieldname column naming convention — its columns are the
plain `user_id` and `acl_id`. The previous version used `user_to_acl_user_id`
and `user_to_acl_acl_id` which fail with "Unknown column".

Found by actually running bootstrap-db.sh end-to-end against a fresh DB
(was missing this verification step on the initial commit).

Verified now:
  - schema loads cleanly (36 tables)
  - seed loads (3 ACL roles, 8 email templates)
  - default users insert + ACL mapping works
  - password_verify against argon2id hashes confirms admin123 and test123
2026-05-14 13:05:19 +02:00
8932534623 Initial delta: full developer manual + DB bootstrap
Generated from finetuning-plattform develop @ 70b203c on 2026-05-14.

Contents:
- MANUAL.md       — full developer manual, setup at front (28 sections)
- bootstrap-db.sh — one-command DB initialization
- db/01-schema.sql       — MariaDB schema, no data
- db/02-seed.sql         — reference data (ACL, email templates, API registry)
- db/03-default-users.sql — admin + test user, argon2id hashes

Drop-in package for new developers joining the platform.
2026-05-14 12:44:47 +02:00