toga-ai 1.0.873 → 1.0.874

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  | Doc | Summary |
4
4
  |-----|---------|
5
5
  | [Test (test) Architecture](architecture.md) | Repo of ad-hoc developer scripts (not a deployed app); `team/` is the shared, documented surface — open to find/run a one-off script or add one. |
6
- | [2.0 Deployment — Per-Client SQL Generator](features/2-0-deployment-client-sql.md) | Standalone script that fans one SQL change-set across all 2.0 client DBs (prints to stdout, executes nothing); open when a schema/data change must run identical |
6
+ | [2.0 Deployment — Per-Client SQL Generator (superseded)](features/2-0-deployment-client-sql.md) | SUPERSEDED by the Tools Multi-Client SQL tool — old offline script that fans one SQL change-set across a static list of 2.0 client DBs; open only when working o |
7
7
  | [Active Directory Authentication Test](features/active-directory-auth-test.md) | Interactive CLI REPL to test Active Directory authentication via `App_ActiveDirectory::isAuthenticated()`; open to verify AD login from a terminal. |
8
8
  | [Compass retrofix2 — Retroactive Data-Fix SQL Generator](features/compass-retrofix2-sql-generator.md) | Standalone 1.0 script emitting review-first SQL to retroactively repair historical Compass USA (`Client_Compass`, 2.0) order data broken by 50+ past bugs; open |
9
9
  | [Create Elastic Beanstalk Environment (script)](features/create-elastic-beanstalk.md) | Standalone constants-driven generator that PRINTS a ready-to-paste AWS CloudShell `create-environment` command for a new EB env in an existing app (never calls |
@@ -61,7 +61,7 @@ Run directly from a local dev environment (CLI or browser, depending on the scri
61
61
  | Script | Runs on | Targets | Doc |
62
62
  |---|---|---|---|
63
63
  | `aws/create_elastic_beanstalk.php` | standalone | AWS (EB) | [create-elastic-beanstalk](./features/create-elastic-beanstalk.md) |
64
- | `2.0 deployment/generate_client_sql.php` | standalone | 2.0 client DBs | [2-0-deployment-client-sql](./features/2-0-deployment-client-sql.md) |
64
+ | `2.0 deployment/generate_client_sql.php` | standalone | 2.0 client DBs (superseded by Tools Multi-Client SQL) | [2-0-deployment-client-sql](./features/2-0-deployment-client-sql.md) |
65
65
  | `forecast-netsuite/discrepancy_analysis.php` | 1.0 | Forecast DB vs NetSuite | [forecast-netsuite-discrepancy-analysis](./features/forecast-netsuite-discrepancy-analysis.md) |
66
66
  | `tableViewBuilder/TableViewGenerator.php` | standalone | 2.0 TableViews | [tableview-builder](./features/tableview-builder.md) |
67
67
  | `active_directory_authentication_test.php` | 1.0 | Active Directory | [active-directory-auth-test](./features/active-directory-auth-test.md) |
@@ -1,41 +1,45 @@
1
1
  ---
2
- title: 2.0 Deployment — Per-Client SQL Generator
2
+ title: 2.0 Deployment — Per-Client SQL Generator (superseded)
3
3
  framework: "1.0"
4
4
  repo: test
5
5
  project: Test
6
6
  client: shared
7
7
  type: feature
8
8
  status: active
9
- updated: 2026-09-16
9
+ updated: 2026-09-22
10
10
  owners: [jcardinal]
11
11
  files:
12
12
  - test/team/2.0 deployment/generate_client_sql.php
13
+ - test/team/2.0 deployment/INPUT.sql
13
14
  - test/team/2.0 deployment/Clients_Db.txt
14
- - test/team/2.0 deployment/Client.sql
15
+ - test/team/2.0 deployment/Logs_Clients_Db.txt
16
+ - test/team/2.0 deployment/NetSuite_Clients_Db.txt
15
17
  related:
16
18
  - ../architecture.md
19
+ - ../../tools/features/multi-client-sql.md
17
20
  ---
18
21
 
19
- Standalone script that fans one SQL change-set across all 2.0 client DBs (prints to stdout, executes nothing); open when a schema/data change must run identically per 2.0 client.
22
+ SUPERSEDED by the Tools Multi-Client SQL tool — old offline script that fans one SQL change-set across a static list of 2.0 client DBs; open only when working offline.
20
23
 
21
24
  ## Summary
22
25
 
23
- `team/2.0 deployment/generate_client_sql.php` fans a single SQL change-set out across **all 2.0 client databases**. **Standalone** (no `App_` framework) — pure file processing. Use it when a schema/data change must run identically against every 2.0 client DB and you want one script to paste into a SQL client.
26
+ Use [Tools Multi-Client SQL](../../tools/features/multi-client-sql.md) instead (live DB lists, module lists). This standalone script (no `App_` framework) stays as the offline fallback. Prints to stdout; executes nothing.
24
27
 
25
28
  ## How it works
26
29
 
27
- 1. Reads `Clients_Db.txt` — newline-separated list of client database names (blank lines ignored).
28
- 2. Reads `Client.sql` — the SQL template (e.g. `CREATE TABLE` / `ALTER` statements) to apply per client.
29
- 3. For each client, emits a banner comment, `` USE `<client>`; ``, then the template SQL.
30
- 4. Prints the combined SQL to **stdout** (with a generated-on header and client count). Does **not** execute anything — the developer reviews the output and runs it manually.
31
-
32
- Edit `Client.sql` to hold the change, keep `Clients_Db.txt` current, then run `php generate_client_sql.php` (or via browser) and run the output against the target cluster.
30
+ 1. Reads `INPUT.sql` — the SQL to apply per DB.
31
+ 2. Reads one static list file; switch lists by commenting between `Clients_Db.txt` / `Logs_Clients_Db.txt` / `NetSuite_Clients_Db.txt` in the script.
32
+ 3. Per DB: banner comment, `` USE `<db>`; ``, then the SQL. Prints the combined script with a header and DB count.
33
33
 
34
34
  ## Gotchas
35
35
 
36
- - Output is only as correct as `Clients_Db.txt` — a stale/missing client is silently skipped. Refresh the list before a deployment.
37
- - The script wraps each client block in `` USE `db`; `` — make sure `Client.sql` does **not** also switch databases or it will fight the `USE`.
36
+ - Lists are static — a stale/missing DB is silently skipped. The Tools tool reads them live.
37
+ - Do not put your own `USE` in `INPUT.sql`; it fights the generated `USE`.
38
38
 
39
39
  ## Related
40
40
 
41
41
  - [Test architecture](../architecture.md)
42
+
43
+ ## Change history
44
+
45
+ - 2026-09-22 — Marked superseded by Tools Multi-Client SQL; corrected input file (`INPUT.sql`) and list-switching. (jcardinal)
@@ -12,6 +12,7 @@
12
12
  | [/errors Curation Console (Tools → shared Core Logs DB)](features/errors-curation-console.md) | Internal-only 1.0 Tools triage/curation screen (`/errors`) for the 2.0 Issue/Event error pipeline, reading the shared Core Logs DB via `db_toga2logs`; curates, |
13
13
  | [GitHub Audit (monthly code-churn report)](features/github-audit.md) | Internal monthly code-churn report at `/developers/github-audit` (lines added/removed across every `agilantsolutions` repo for one month); open for the two-phas |
14
14
  | [Legacy Email Notifier (tools /email-migration/notify)](features/legacy-email-notifier.md) | SSO-gated admin tool at `/email-migration/notify` that emails employees a digest of mail still hitting their legacy domains (asks senders to switch to `@togatec |
15
+ | [Tools — Multi-Client SQL (per-client-DB SQL fan-out)](features/multi-client-sql.md) | Tools `/developers/multi-client-sql` — fans one SQL change-set across a live list of 2.0 client/log/archive/module DBs into a copy/download script (never execut |
15
16
  | [Tools MVC — Routing, CSRF & App_Database Access Patterns](features/mvc-data-access-patterns.md) | Load-bearing 1.0 (App_) conventions for adding a Tools page — routing (get/post), Origin-based CSRF, and App_Database access — plus the footguns (global transac |
16
17
  | [OneUptime Monitor Status Panel & Outage Alerting (tools /developer)](features/oneuptime-monitor-status-panel.md) | Live operational monitor column on the `/developer` wall-display dashboard (state-adaptive: calm green when healthy, loud amber/red when broken) fed by a same-o |
17
18
  | [Tools Persona-Gated Navigation (App_Nav)](features/persona-gated-navigation.md) | Tools two-level persona-gated navigation (`App_Nav`), a hard-coded `definition()` array driving left rail + dashboard and the single source of route→persona gat |
@@ -31,6 +31,7 @@ related:
31
31
  - ./features/saml-sso-auth.md
32
32
  - ./features/persona-gated-navigation.md
33
33
  - ./features/developer-tools.md
34
+ - ./features/multi-client-sql.md
34
35
  - ./features/oneuptime-monitor-status-panel.md
35
36
  - ./features/github-audit.md
36
37
  - ../library/architecture.md
@@ -69,6 +70,7 @@ Tools is no longer only a click-through internal-tool shell: `/developer` (renam
69
70
 
70
71
  - **No cross-origin browser dependency any more — it is server-proxied.** Every fetch in this app is now same-origin and authenticated by the SSO session cookie, including the monitor column: the browser GETs `/v2/monitors/status/` (`App_Clickup_Monitors`), and the server does the cross-origin POST to the OneUptime **public** status-page API, reduces ~250 KB → ~1 KB, caches ~5s (APCu) and returns the api2 envelope. This removed the app's last cross-origin browser dependency and the CORS / edge-cache / autoplay coupling it carried; the status-page ID moved from a hardcoded HTML constant into config (`[oneuptime] status_page_id`, default `DEFAULT_STATUS_PAGE_ID`).
71
72
  - **Iframed pages carry their own permission policy.** `mvc/developer/get.php` embeds its asset in an iframe, and browser autoplay policy is scoped **per-iframe** — an iframed page that must play audio needs `allow="… autoplay"` on the frame or it is blocked silently. Unattended displays additionally never receive the user gesture browsers require before audio plays.
73
+ - **External reads:** `/developers/multi-client-sql` reads Core via `[database_toga2core]` and GitHub (dbchanges2 `_main`) via the `GITHUB_TOKEN` env var only (EB environment property in prod) — see `features/multi-client-sql.md`.
72
74
  - **`crypto.randomUUID()` is undefined on a non-secure origin.** Browser code served over plain HTTP by hostname/LAN IP (not `localhost`) has no secure context, so `crypto.randomUUID()` and `crypto.subtle` throw. The dashboard now guards its per-request `transactionId` behind a helper (randomUUID → `getRandomValues` v4 → non-crypto id); any browser code in this app that must run over a non-secure origin must do the same rather than call `crypto.randomUUID` unguarded.
73
75
 
74
76
  ## Adding a tool
@@ -0,0 +1,53 @@
1
+ ---
2
+ title: Tools — Multi-Client SQL (per-client-DB SQL fan-out)
3
+ framework: "1.0"
4
+ repo: tools
5
+ project: Tools
6
+ client: shared
7
+ type: feature
8
+ status: active
9
+ updated: 2026-09-22
10
+ owners: [jcardinal]
11
+ files:
12
+ - tools/_/app/developers/multiclientsql.php
13
+ - tools/mvc/developers/multi-client-sql/get.php
14
+ - tools/mvc/developers/multi-client-sql/post.php
15
+ - tools/_/app/nav.php
16
+ related:
17
+ - ../architecture.md
18
+ - ./developer-tools.md
19
+ - ./persona-gated-navigation.md
20
+ - ../../test/features/2-0-deployment-client-sql.md
21
+ ---
22
+
23
+ Tools `/developers/multi-client-sql` — fans one SQL change-set across a live list of 2.0 client/log/archive/module DBs into a copy/download script (never executes); open to use/extend it or for the `Databases` reserved-word gotcha.
24
+
25
+ ## Summary
26
+
27
+ Replaces `test/team/2.0 deployment/generate_client_sql.php`. Development Team persona **only** (narrowed in `nav.php` + hardcoded `requireAuth` in `get.php` and `post.php`). Class `App_Developers_MultiClientSql`. Output is reviewed and run by the developer — the tool never executes SQL.
28
+
29
+ ## How it works
30
+
31
+ 1. Paste SQL, pick a list, untick/filter DBs. Generate builds the script **in the browser**: header + per-DB banner + `` USE `db`; `` + SQL. Copy / Download `.sql`. Warns if the SQL has its own `USE`.
32
+ 2. `post.php` action `lists` only returns JSON lists.
33
+ 3. Lists are dynamic — no tools commit when clients change:
34
+ - **All Clients / Client Logs / Client Archives** — live read of `Core.Clients` joined to `Core.Databases` on `clientDatabaseId` / `logDatabaseId` / `archiveDatabaseId`, via config `[database_toga2core]`. Every row (no active flag).
35
+ - **Module lists** — one per folder under `dbchanges2/_modules` (branch `_main`). A client is in the list when `Client_<Name>/_modules.txt` names the module (case-insensitive); DB name = client folder name. GitHub GraphQL, 2 calls (folder list, then all `_modules.txt` as aliased blobs). APCu cache 5 min + 7-day "last good" fallback shown with a warning. Warns when a module client is not in `Core.Clients`. One retry on a dropped connection; log names the failed step (`folder list` / `_modules.txt read`).
36
+ 4. GitHub token: **only** the `GITHUB_TOKEN` env var (read via `getenv` + `$_SERVER` + `$_ENV`, because php-fpm `clear_env`). No config fallback (developer decision). Own curl, not `App_Design_Github`. Needs read on `agilantsolutions/dbchanges2`; set as an EB environment property in prod.
37
+ 5. Every DB/folder name is checked against `^[A-Za-z0-9_]{1,64}$` before it goes into GraphQL or a `USE` line. Page writes via `textContent`/`.value` only.
38
+
39
+ ## Gotchas
40
+
41
+ - `Databases` is a MySQL reserved word: `FROM Databases` / `JOIN Databases AS X` fails with error 1064. Backtick it (`` `Databases` ``) or qualify it (`Core.Databases`).
42
+ - dbchanges2 has **no** `_production` branch; its deployed branch is `_main`.
43
+ - A missing `[database_...]` config section is not catchable in 1.0 — `App_Error` renders its HTML error page and exits. The tool pre-checks `config['database_toga2core']` and throws a user-safe message. Local `config.dev-*.ini` files may lack that section.
44
+ - CSS: a class rule with `display:flex` overrides the HTML `hidden` attribute — add `.scope [hidden]{display:none !important}`.
45
+
46
+ ## Related
47
+
48
+ - [Developers folder tools](./developer-tools.md)
49
+ - [Old offline script (test)](../../test/features/2-0-deployment-client-sql.md)
50
+
51
+ ## Change history
52
+
53
+ - 2026-09-22 — Created; shipped and verified in production. (jcardinal)
@@ -15,7 +15,7 @@ _Auto-generated by `knowledge.js index`. Do not hand-edit._
15
15
  - **test** (Test) — 16 doc(s) → [1.0/apps/test/INDEX.md](1.0/apps/test/INDEX.md)
16
16
  - **toga** (TOGa) — 3 doc(s) → [1.0/apps/toga/INDEX.md](1.0/apps/toga/INDEX.md)
17
17
  - **store** (Store) — 3 doc(s) → [1.0/apps/store/INDEX.md](1.0/apps/store/INDEX.md)
18
- - **tools** (Tools) — 18 doc(s) → [1.0/apps/tools/INDEX.md](1.0/apps/tools/INDEX.md)
18
+ - **tools** (Tools) — 19 doc(s) → [1.0/apps/tools/INDEX.md](1.0/apps/tools/INDEX.md)
19
19
 
20
20
  ## 2.0 framework
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.873",
3
+ "version": "1.0.874",
4
4
  "description": "TOGA Technology Team Claude Knowledge System — shared AI coding harness with skills, knowledge base CLI, and project installer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",