toga-ai 1.0.89 → 1.0.91
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.
- package/knowledge/1.0/apps/test/INDEX.md +14 -0
- package/knowledge/1.0/apps/test/architecture.md +89 -0
- package/knowledge/1.0/apps/test/features/2-0-deployment-client-sql.md +47 -0
- package/knowledge/1.0/apps/test/features/active-directory-auth-test.md +38 -0
- package/knowledge/1.0/apps/test/features/create-elastic-beanstalk.md +95 -0
- package/knowledge/1.0/apps/test/features/dev-generators.md +45 -0
- package/knowledge/1.0/apps/test/features/forecast-netsuite-discrepancy-analysis.md +47 -0
- package/knowledge/1.0/apps/test/features/tableview-builder.md +55 -0
- package/knowledge/1.0/apps/test/features/toga2-client-onboarding-sql.md +53 -0
- package/knowledge/1.0/apps/test/features/toga2-user-cross-client-access-sql.md +46 -0
- package/knowledge/1.0/apps/test/features/url-domain-markdown-document.md +44 -0
- package/knowledge/2.0/apps/talos/INDEX.md +10 -0
- package/knowledge/2.0/apps/talos/architecture.md +169 -0
- package/knowledge/2.0/apps/talos/features/aegra-api.md +206 -0
- package/knowledge/2.0/apps/talos/features/deployment.md +115 -0
- package/knowledge/2.0/apps/talos/features/mcp-servers.md +142 -0
- package/knowledge/2.0/apps/talos/features/observability.md +132 -0
- package/knowledge/2.0/apps/talos/features/react-agent.md +205 -0
- package/knowledge/INDEX.md +2 -0
- package/knowledge/registry.json +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# test (Test) — 1.0 knowledge
|
|
2
|
+
|
|
3
|
+
| Doc | Summary | Files |
|
|
4
|
+
|-----|---------|-------|
|
|
5
|
+
| [Test (test) Architecture](architecture.md) | `test` (project **Test**) is a **repository of ad-hoc developer scripts** — not a deployed application. | test/team/ |
|
|
6
|
+
| [2.0 Deployment — Per-Client SQL Generator](features/2-0-deployment-client-sql.md) | `team/2.0 deployment/generate_client_sql.php` fans a single SQL change-set out across **all 2.0 client databases**. | test/team/2.0 deployment/generate_client_sql.php, test/team/2.0 deployment/Clients_Db.txt, test/team/2.0 deployment/Client.sql |
|
|
7
|
+
| [Active Directory Authentication Test](features/active-directory-auth-test.md) | `team/active_directory_authentication_test.php` is an interactive CLI tool to test **Active Directory authentication**. | test/team/active_directory_authentication_test.php |
|
|
8
|
+
| [Create Elastic Beanstalk Environment (script)](features/create-elastic-beanstalk.md) | `team/aws/create_elastic_beanstalk.php` is a **standalone** (no `App_` framework) constants-driven PHP generator. | test/team/aws/create_elastic_beanstalk.php |
|
|
9
|
+
| [Developer Generators (password, UUID)](features/dev-generators.md) | Two tiny **1.0 `App_` framework** convenience scripts for everyday developer needs. | test/team/generate_password.php, test/team/uuid.php |
|
|
10
|
+
| [Forecast vs NetSuite Discrepancy Analysis](features/forecast-netsuite-discrepancy-analysis.md) | `team/forecast-netsuite/discrepancy_analysis.php` detects discrepancies between our **Forecast database** and **NetSuite** (the source of truth for all sales da | test/team/forecast-netsuite/discrepancy_analysis.php |
|
|
11
|
+
| [TableView Builder (2.0 TableViews SQL generator)](features/tableview-builder.md) | `team/tableViewBuilder/` generates SQL `INSERT` statements for the **2.0 `TableViews`**, `TableViewFields`, and `TableViewJoins` tables from a plain SQL `SELECT | test/team/tableViewBuilder/TableViewGenerator.php, test/team/tableViewBuilder/index.php, test/team/tableViewBuilder/Instructions.md |
|
|
12
|
+
| [TOGa 2.0 Client Onboarding SQL Generator](features/toga2-client-onboarding-sql.md) | `team/generate_toga2_onboarding_sql.php` generates the SQL needed to **onboard a new client** onto the 2.0 platform. | test/team/generate_toga2_onboarding_sql.php |
|
|
13
|
+
| [TOGa 2.0 User Cross-Client Access SQL Generator](features/toga2-user-cross-client-access-sql.md) | `team/generate_toga2_user_access_sql.php` generates SQL to grant an existing 2.0 user from a **home client** access to a **cross client**. | test/team/generate_toga2_user_access_sql.php |
|
|
14
|
+
| [URL & Domain Markdown Document Builder](features/url-domain-markdown-document.md) | `team/build_url_domain_markdown_document.php` generates a **markdown document of our URLs and domains** by pulling environments and domains from the 2.0 platfor | test/team/build_url_domain_markdown_document.php |
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Test (test) Architecture
|
|
3
|
+
framework: "1.0"
|
|
4
|
+
repo: test
|
|
5
|
+
project: Test
|
|
6
|
+
client: shared
|
|
7
|
+
type: architecture
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-06-16
|
|
10
|
+
owners: [jcardinal]
|
|
11
|
+
files:
|
|
12
|
+
- test/team/
|
|
13
|
+
related:
|
|
14
|
+
- ./features/create-elastic-beanstalk.md
|
|
15
|
+
- ./features/forecast-netsuite-discrepancy-analysis.md
|
|
16
|
+
- ./features/tableview-builder.md
|
|
17
|
+
- ./features/toga2-client-onboarding-sql.md
|
|
18
|
+
- ./features/toga2-user-cross-client-access-sql.md
|
|
19
|
+
- ./features/2-0-deployment-client-sql.md
|
|
20
|
+
- ./features/active-directory-auth-test.md
|
|
21
|
+
- ./features/url-domain-markdown-document.md
|
|
22
|
+
- ./features/dev-generators.md
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Summary
|
|
26
|
+
|
|
27
|
+
`test` (project **Test**) is a **repository of ad-hoc developer scripts** — not a deployed
|
|
28
|
+
application. It is where developers keep throwaway and semi-permanent PHP scripts they run
|
|
29
|
+
locally to do one-off jobs: generate SQL, probe an integration, build a document, create
|
|
30
|
+
infrastructure, etc.
|
|
31
|
+
|
|
32
|
+
**Layout convention:**
|
|
33
|
+
|
|
34
|
+
- **Per-developer folders** — each developer has their own top-level folder for personal
|
|
35
|
+
scratch scripts. These are private and **not** captured in this knowledge base.
|
|
36
|
+
- **`team/` folder** — shared scripts any team member can use. **This is the documented
|
|
37
|
+
surface.** Each feature doc under `apps/test/features/` covers one `team/` script (or a
|
|
38
|
+
small related group).
|
|
39
|
+
|
|
40
|
+
## Framework relationship
|
|
41
|
+
|
|
42
|
+
Most `team/` scripts bootstrap the **1.0 `App_` framework** so they can reuse its helpers
|
|
43
|
+
(DB access, API clients, string/crypto utilities):
|
|
44
|
+
|
|
45
|
+
```php
|
|
46
|
+
require_once('_.php');
|
|
47
|
+
App_Framework_Sandbox::initialize(); // or App_Framework_Worker::initialize()
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Common framework helpers used: `App_Api_Toga2` (calls the 2.0 platform API),
|
|
51
|
+
`App_String` (password hashing / support codes), `App_Misc::generateUUID()`,
|
|
52
|
+
`App_ActiveDirectory`, `App_Framework_Sandbox` / `App_Framework_Worker`. The repo therefore
|
|
53
|
+
`dependsOn` the 1.0 core repo **`library`** (see `1.0/apps/library/architecture.md`).
|
|
54
|
+
|
|
55
|
+
**Some scripts are standalone** (no framework) — pure PHP that only does file processing or
|
|
56
|
+
shells out to the AWS CLI. Examples: `team/aws/create_elastic_beanstalk.php` and
|
|
57
|
+
`team/2.0 deployment/generate_client_sql.php`. These have no `library` dependency.
|
|
58
|
+
|
|
59
|
+
**Note the cross-framework reach:** several scripts run on the 1.0 framework but **generate
|
|
60
|
+
artifacts for the 2.0 platform** (client onboarding SQL, user-access SQL, TableView SQL,
|
|
61
|
+
URL/domain docs via the 2.0 API). The framework a script *runs on* is not necessarily the
|
|
62
|
+
framework it *targets*.
|
|
63
|
+
|
|
64
|
+
## How to run
|
|
65
|
+
|
|
66
|
+
Scripts are run directly from a local dev environment (CLI or browser, depending on the
|
|
67
|
+
script's output). Configuration lives in `const` blocks at the top of each file — set those,
|
|
68
|
+
then run. Several scripts **print SQL/output to stdout** for the developer to review and run
|
|
69
|
+
manually against the target database; they do not execute changes themselves.
|
|
70
|
+
|
|
71
|
+
## team/ folder index
|
|
72
|
+
|
|
73
|
+
| Script | Runs on | Targets | Doc |
|
|
74
|
+
|---|---|---|---|
|
|
75
|
+
| `aws/create_elastic_beanstalk.php` | standalone | AWS (EB) | [create-elastic-beanstalk](./features/create-elastic-beanstalk.md) |
|
|
76
|
+
| `2.0 deployment/generate_client_sql.php` | standalone | 2.0 client DBs | [2-0-deployment-client-sql](./features/2-0-deployment-client-sql.md) |
|
|
77
|
+
| `forecast-netsuite/discrepancy_analysis.php` | 1.0 | Forecast DB vs NetSuite | [forecast-netsuite-discrepancy-analysis](./features/forecast-netsuite-discrepancy-analysis.md) |
|
|
78
|
+
| `tableViewBuilder/TableViewGenerator.php` | standalone | 2.0 TableViews | [tableview-builder](./features/tableview-builder.md) |
|
|
79
|
+
| `active_directory_authentication_test.php` | 1.0 | Active Directory | [active-directory-auth-test](./features/active-directory-auth-test.md) |
|
|
80
|
+
| `build_url_domain_markdown_document.php` | 1.0 | 2.0 API (TOGa Hub) | [url-domain-markdown-document](./features/url-domain-markdown-document.md) |
|
|
81
|
+
| `generate_toga2_onboarding_sql.php` | 1.0 | 2.0 client DBs | [toga2-client-onboarding-sql](./features/toga2-client-onboarding-sql.md) |
|
|
82
|
+
| `generate_toga2_user_access_sql.php` | 1.0 | 2.0 client DBs | [toga2-user-cross-client-access-sql](./features/toga2-user-cross-client-access-sql.md) |
|
|
83
|
+
| `generate_password.php`, `uuid.php` | 1.0 | dev utility | [dev-generators](./features/dev-generators.md) |
|
|
84
|
+
|
|
85
|
+
**Retired / not documented:** `team/DOA_gitbook/` and `team/DOA_talos/` are being retired.
|
|
86
|
+
|
|
87
|
+
## Change history
|
|
88
|
+
|
|
89
|
+
- 2026-06-16 — Initial capture of the `team/` folder. Registered repo in `registry.json`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 2.0 Deployment — Per-Client SQL Generator
|
|
3
|
+
framework: "1.0"
|
|
4
|
+
repo: test
|
|
5
|
+
project: Test
|
|
6
|
+
client: shared
|
|
7
|
+
type: feature
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-06-16
|
|
10
|
+
owners: [jcardinal]
|
|
11
|
+
files:
|
|
12
|
+
- test/team/2.0 deployment/generate_client_sql.php
|
|
13
|
+
- test/team/2.0 deployment/Clients_Db.txt
|
|
14
|
+
- test/team/2.0 deployment/Client.sql
|
|
15
|
+
related:
|
|
16
|
+
- ../architecture.md
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Summary
|
|
20
|
+
|
|
21
|
+
`team/2.0 deployment/generate_client_sql.php` fans a single SQL change-set out across **all
|
|
22
|
+
2.0 client databases**. It is **standalone** (no `App_` framework) — pure file processing.
|
|
23
|
+
|
|
24
|
+
Use it when you have a schema/data change that must run identically against every 2.0 client
|
|
25
|
+
DB and you want one script to paste into a SQL client.
|
|
26
|
+
|
|
27
|
+
## How it works
|
|
28
|
+
|
|
29
|
+
1. Reads `Clients_Db.txt` — newline-separated list of client database names (blank lines ignored).
|
|
30
|
+
2. Reads `Client.sql` — the SQL template (e.g. `CREATE TABLE` / `ALTER` statements) to apply per client.
|
|
31
|
+
3. For each client, emits a banner comment, `USE \`<client>\`;`, then the template SQL.
|
|
32
|
+
4. Prints the combined SQL to **stdout** (with a generated-on header and client count). It does
|
|
33
|
+
**not** execute anything — the developer reviews the output and runs it manually.
|
|
34
|
+
|
|
35
|
+
Edit `Client.sql` to hold the change, keep `Clients_Db.txt` current, then run
|
|
36
|
+
`php generate_client_sql.php` (or via browser) and run the output against the target cluster.
|
|
37
|
+
|
|
38
|
+
## Gotchas
|
|
39
|
+
|
|
40
|
+
- Output is only as correct as `Clients_Db.txt` — a stale/missing client means it is silently
|
|
41
|
+
skipped. Refresh the list before a deployment.
|
|
42
|
+
- The script wraps each client block in `USE \`db\`;` — make sure `Client.sql` does **not** also
|
|
43
|
+
switch databases or it will fight the `USE`.
|
|
44
|
+
|
|
45
|
+
## Change history
|
|
46
|
+
|
|
47
|
+
- 2026-06-16 — Initial capture.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Active Directory Authentication Test
|
|
3
|
+
framework: "1.0"
|
|
4
|
+
repo: test
|
|
5
|
+
project: Test
|
|
6
|
+
client: shared
|
|
7
|
+
type: feature
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-06-16
|
|
10
|
+
owners: [jcardinal]
|
|
11
|
+
files:
|
|
12
|
+
- test/team/active_directory_authentication_test.php
|
|
13
|
+
related:
|
|
14
|
+
- ../architecture.md
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Summary
|
|
18
|
+
|
|
19
|
+
`team/active_directory_authentication_test.php` is an interactive CLI tool to test **Active
|
|
20
|
+
Directory authentication**. Runs on the **1.0 `App_` framework**
|
|
21
|
+
(`App_Framework_Worker::initialize()`) and calls `App_ActiveDirectory::isAuthenticated()`.
|
|
22
|
+
|
|
23
|
+
## How it works
|
|
24
|
+
|
|
25
|
+
A REPL loop: clears the screen, prompts for email and password (password input hidden via
|
|
26
|
+
`stty -echo`), calls `App_ActiveDirectory::isAuthenticated($email, $password)`, and prints
|
|
27
|
+
success/failure. Loops until `Ctrl+C`.
|
|
28
|
+
|
|
29
|
+
Run from a CLI (it uses `STDIN` and `system('clear')`/`stty`, so it is terminal-only — not browser).
|
|
30
|
+
|
|
31
|
+
## Gotchas
|
|
32
|
+
|
|
33
|
+
- Terminal-only: the `stty` calls require a real TTY (won't work over a non-interactive runner).
|
|
34
|
+
- It prints only success/failure, never the password — keep it that way (no credential logging).
|
|
35
|
+
|
|
36
|
+
## Change history
|
|
37
|
+
|
|
38
|
+
- 2026-06-16 — Initial capture.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Create Elastic Beanstalk Environment (script)
|
|
3
|
+
framework: "1.0"
|
|
4
|
+
repo: test
|
|
5
|
+
project: Test
|
|
6
|
+
client: shared
|
|
7
|
+
type: feature
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-06-16
|
|
10
|
+
owners: [jcardinal]
|
|
11
|
+
files:
|
|
12
|
+
- test/team/aws/create_elastic_beanstalk.php
|
|
13
|
+
related:
|
|
14
|
+
- ../architecture.md
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Summary
|
|
18
|
+
|
|
19
|
+
`team/aws/create_elastic_beanstalk.php` is a **standalone** (no `App_` framework) constants-driven
|
|
20
|
+
PHP generator. Running `php create_elastic_beanstalk.php` **prints** a ready-to-paste AWS
|
|
21
|
+
CloudShell command that creates a new Elastic Beanstalk **environment** inside an **existing**
|
|
22
|
+
EB **application**. The script never calls AWS itself — it only emits the command.
|
|
23
|
+
|
|
24
|
+
It supersedes the old `create-elastic-beanstalk` Claude skill (removed 2026-06-16).
|
|
25
|
+
|
|
26
|
+
## How it works
|
|
27
|
+
|
|
28
|
+
- All knobs are `const` at the top: `PROFILE` (`production` | `nonprod`), `ENVIRONMENT` (the
|
|
29
|
+
app's ENVIRONMENT env-var value), `APPLICATION_NAME`, `ENVIRONMENT_NAME`, `CNAME_PREFIX`,
|
|
30
|
+
`INSTANCE_TYPE`, `INSTANCE_COUNT`, `EB_PHP_VERSION`, `SHARED_ALB_NAME`.
|
|
31
|
+
- `PROFILE` selects an entry in the `PROFILES` map → account, VPC, subnets, roles, storage,
|
|
32
|
+
and load-balancer strategy. **Two accounts:** PROD `654654170868`, NON-PROD `975050298201`.
|
|
33
|
+
- Output: an account-check banner + post-run notes (to **stderr**, so `> cmd.sh` captures only
|
|
34
|
+
the command), and the command itself (to **stdout**) — a JSON `option-settings` heredoc piped
|
|
35
|
+
to `aws elasticbeanstalk create-environment`.
|
|
36
|
+
- Baked-in conventions: arm64/`t4g`, Apache, `AllAtOnce` deploys, On-Demand only
|
|
37
|
+
(`EnableSpot=false`), 10 GB root volume (`gp2` prod / `standard` non-prod), pinned
|
|
38
|
+
Min=Max instance count, key pair `true-aws-infrastructure-production`, and the
|
|
39
|
+
**never-trigger CPU autoscaling hack** (watch `CPUUtilization`, `Unit=Percent`, thresholds
|
|
40
|
+
`2000000`–`6000000` so it never breaches).
|
|
41
|
+
|
|
42
|
+
### PROD vs NON-PROD differences
|
|
43
|
+
|
|
44
|
+
| | NON-PROD (`975050298201`) | PROD (`654654170868`) |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| Load balancer | **Shared** ALB (`SHARED_ALB_NAME`) | **Dedicated** public ALB |
|
|
47
|
+
| Storage | `standard` | `gp2` |
|
|
48
|
+
| Default type / count | `t4g.micro` / 1 | `t4g.large` / 2 |
|
|
49
|
+
| Instance profile | `aws-elasticbeanstalk-ec2-role` | `ElasticBeanstalk-EC2-Instance-Profile` |
|
|
50
|
+
|
|
51
|
+
## Shared ALB (NON-PROD) — the critical detail
|
|
52
|
+
|
|
53
|
+
The non-prod shared ALBs (`true-alb-*`) listen on **HTTPS:443 only**. The correct, AWS-documented
|
|
54
|
+
option-settings to attach to them are:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
aws:elbv2:loadbalancer SharedLoadBalancer = <ALB ARN, resolved at runtime>
|
|
58
|
+
aws:elbv2:listener:443 Rules = default
|
|
59
|
+
aws:elasticbeanstalk:environment:process:default Port=80 Protocol=HTTP HealthCheckPath=/
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Plus `aws:elasticbeanstalk:environment` `LoadBalancerType=application`, `LoadBalancerIsShared=true`.
|
|
63
|
+
|
|
64
|
+
**Why `listener:443 Rules=default` is the linchpin:** EB associates its auto-managed *default*
|
|
65
|
+
rule with a **port-80** listener unless you explicitly associate it with the port you actually
|
|
66
|
+
use. On a 443-only shared ALB that fails with *"the load balancer doesn't have a listener on
|
|
67
|
+
port 80."* Setting `aws:elbv2:listener:443 Rules=default` moves the default rule onto 443.
|
|
68
|
+
EB then **auto-creates** the rule and **adds this env's CNAME as the host-header condition**,
|
|
69
|
+
which isolates it from sibling environments on the same shared ALB.
|
|
70
|
+
|
|
71
|
+
## Gotchas (each cost a failed `create-environment`)
|
|
72
|
+
|
|
73
|
+
- **Don't** define a custom listener rule named `default` — that name is reserved for EB's
|
|
74
|
+
auto-created default rule; passing it is rejected.
|
|
75
|
+
- **Don't** try to disable the phantom port-80 listener (`aws:elbv2:listener:80 ListenerEnabled=false`
|
|
76
|
+
or the bogus `aws:elbv2:listener:default`) — neither works. Associating `default` with 443 is
|
|
77
|
+
the only correct fix.
|
|
78
|
+
- **You can't** set `aws:elbv2:listener:<port>` to *add* listeners on a shared ALB — EB doesn't
|
|
79
|
+
manage its listeners. You only associate the existing listener's rules and define rules.
|
|
80
|
+
- `PHP_VERSION` is a reserved PHP built-in constant — the script uses `EB_PHP_VERSION`.
|
|
81
|
+
- The JMESPath number filter must use backticks around the port and be wrapped in single quotes
|
|
82
|
+
so bash doesn't execute the backticks.
|
|
83
|
+
- The live sibling env `api-client-alpha` runs Rolling deploys + Spot + dual instance types —
|
|
84
|
+
i.e. it **diverges** from the conventions this script enforces. The script intentionally keeps
|
|
85
|
+
the team conventions (AllAtOnce / On-Demand / single type), not alpha's drift.
|
|
86
|
+
|
|
87
|
+
## Verified usage
|
|
88
|
+
|
|
89
|
+
2026-06-16: generated `api-client-beta` (env id `e-erp8hg9hhx`) under app `API` on shared ALB
|
|
90
|
+
`true-alb-client-beta` in `975050298201` — created successfully (Status `Launching`).
|
|
91
|
+
|
|
92
|
+
## Change history
|
|
93
|
+
|
|
94
|
+
- 2026-06-16 — Initial capture. Documented the shared-ALB `listener:443 Rules=default` fix
|
|
95
|
+
discovered while porting the old skill to this script; first successful create (`api-client-beta`).
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Developer Generators (password, UUID)
|
|
3
|
+
framework: "1.0"
|
|
4
|
+
repo: test
|
|
5
|
+
project: Test
|
|
6
|
+
client: shared
|
|
7
|
+
type: feature
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-06-16
|
|
10
|
+
owners: [jcardinal]
|
|
11
|
+
files:
|
|
12
|
+
- test/team/generate_password.php
|
|
13
|
+
- test/team/uuid.php
|
|
14
|
+
related:
|
|
15
|
+
- ../architecture.md
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Summary
|
|
19
|
+
|
|
20
|
+
Two tiny **1.0 `App_` framework** convenience scripts for everyday developer needs. Both
|
|
21
|
+
`require_once('_.php'); App_Framework_Sandbox::initialize();` then call a framework helper.
|
|
22
|
+
|
|
23
|
+
## `generate_password.php`
|
|
24
|
+
|
|
25
|
+
Generates a random password **and its hash**. Uses `App_String::generateSupportCode(8)` for the
|
|
26
|
+
password (the "support code" generator deliberately avoids look-alike characters like `O`/`0`
|
|
27
|
+
and `1`/`I`), then prints the password and `App_String::passwordHash($password)`. There is a
|
|
28
|
+
commented line to hardcode your own password instead of generating one.
|
|
29
|
+
|
|
30
|
+
Use it when you need to seed a user password + a storable hash. Hashing goes through
|
|
31
|
+
`App_String::passwordHash` (the framework's bcrypt/argon wrapper) — don't hand-roll hashes.
|
|
32
|
+
|
|
33
|
+
## `uuid.php`
|
|
34
|
+
|
|
35
|
+
Prints a single random UUID via `App_Misc::generateUUID()`. Use it whenever you need a UUID that
|
|
36
|
+
matches the platform's generation (e.g. seeding rows that expect framework-style UUIDs).
|
|
37
|
+
|
|
38
|
+
## Gotchas
|
|
39
|
+
|
|
40
|
+
- These reuse framework helpers on purpose — use them rather than ad-hoc `rand()`/manual hashing
|
|
41
|
+
so output matches what the platform produces and stays consistent with security standards.
|
|
42
|
+
|
|
43
|
+
## Change history
|
|
44
|
+
|
|
45
|
+
- 2026-06-16 — Initial capture.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Forecast vs NetSuite Discrepancy Analysis
|
|
3
|
+
framework: "1.0"
|
|
4
|
+
repo: test
|
|
5
|
+
project: Test
|
|
6
|
+
client: shared
|
|
7
|
+
type: feature
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-06-16
|
|
10
|
+
owners: [jcardinal]
|
|
11
|
+
files:
|
|
12
|
+
- test/team/forecast-netsuite/discrepancy_analysis.php
|
|
13
|
+
related:
|
|
14
|
+
- ../architecture.md
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Summary
|
|
18
|
+
|
|
19
|
+
`team/forecast-netsuite/discrepancy_analysis.php` detects discrepancies between our **Forecast
|
|
20
|
+
database** and **NetSuite** (the source of truth for all sales data). It runs on the **1.0
|
|
21
|
+
`App_` framework** (`require_once('_.php'); App_Framework_Sandbox::initialize();`).
|
|
22
|
+
|
|
23
|
+
## How it works
|
|
24
|
+
|
|
25
|
+
1. **Input:** a CSV exported from the NetSuite saved search *"Data Dump for Mark H"*
|
|
26
|
+
(searchid 7276). The developer opens that report, adjusts dates if needed, exports CSV, saves
|
|
27
|
+
it locally, and points `NETSUITE_FULL_DATA_DUMP_FILEPATH` at it.
|
|
28
|
+
2. Column positions in the CSV are mapped via `NSINDEX_*` constants (doc date, doc type, doc
|
|
29
|
+
number, item internal id, revenue, profit). Date window is `DATE_RANGE_MINIMUM` /
|
|
30
|
+
`DATE_RANGE_MAXIMUM` (defaults to the current year; the report exports year-to-date).
|
|
31
|
+
3. Builds a lookup of NetSuite rows keyed by **docType + docNumber**. Doc type is normalized
|
|
32
|
+
from display text to camelCase; parenthesized amounts like `(1,234)` are converted to
|
|
33
|
+
negative numbers via `cleanNumber()`.
|
|
34
|
+
4. Compares against the Forecast DB and reports rows that don't reconcile (revenue/profit
|
|
35
|
+
mismatches, missing documents).
|
|
36
|
+
|
|
37
|
+
## Gotchas
|
|
38
|
+
|
|
39
|
+
- The `NSINDEX_*` column indices are **positional** — if the NetSuite saved search columns are
|
|
40
|
+
reordered or added to, these constants must be updated or the comparison silently reads the
|
|
41
|
+
wrong fields.
|
|
42
|
+
- The CSV path is a local Windows path constant; update per-machine before running.
|
|
43
|
+
- NetSuite is authoritative — discrepancies mean Forecast is wrong, not NetSuite.
|
|
44
|
+
|
|
45
|
+
## Change history
|
|
46
|
+
|
|
47
|
+
- 2026-06-16 — Initial capture.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: TableView Builder (2.0 TableViews SQL generator)
|
|
3
|
+
framework: "1.0"
|
|
4
|
+
repo: test
|
|
5
|
+
project: Test
|
|
6
|
+
client: shared
|
|
7
|
+
type: feature
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-06-16
|
|
10
|
+
owners: [jcardinal]
|
|
11
|
+
files:
|
|
12
|
+
- test/team/tableViewBuilder/TableViewGenerator.php
|
|
13
|
+
- test/team/tableViewBuilder/index.php
|
|
14
|
+
- test/team/tableViewBuilder/Instructions.md
|
|
15
|
+
related:
|
|
16
|
+
- ../architecture.md
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Summary
|
|
20
|
+
|
|
21
|
+
`team/tableViewBuilder/` generates SQL `INSERT` statements for the **2.0 `TableViews`**,
|
|
22
|
+
`TableViewFields`, and `TableViewJoins` tables from a plain SQL `SELECT` query. It is a
|
|
23
|
+
**standalone** PHP tool (class `TableViewGenerator`, driven by `index.php`).
|
|
24
|
+
|
|
25
|
+
It turns "here's the query that produces the grid I want" into the metadata rows the 2.0 platform
|
|
26
|
+
needs to render that grid as a TableView.
|
|
27
|
+
|
|
28
|
+
## How it works
|
|
29
|
+
|
|
30
|
+
Inputs (see `Instructions.md`):
|
|
31
|
+
- `input/Records.csv` and `input/RecordFields.csv` — metadata exports mapping record routes →
|
|
32
|
+
`recordId` and field names → `recordFieldId`.
|
|
33
|
+
- A user SQL `SELECT` in `queries/<name>.sql`.
|
|
34
|
+
- A fixed `slug` and a manually-assigned `tableViewId`.
|
|
35
|
+
|
|
36
|
+
The generator parses the query for the FROM table, selected fields, and JOIN chains, then:
|
|
37
|
+
1. Resolves `recordId` from the table route and `recordFieldId` from field name + recordId.
|
|
38
|
+
2. Emits an `INSERT` into `TableViews` (with a generated UUID, the slug, defaults like
|
|
39
|
+
`recordsPerPage=25`, `sortPrimaryDirection=ASC`).
|
|
40
|
+
3. Emits `TableViewJoins` for each JOIN (parsing the `ON` clause to resolve child/parent field IDs).
|
|
41
|
+
4. Emits `TableViewFields` for each selected column.
|
|
42
|
+
|
|
43
|
+
Output SQL goes to `output/` for the developer to review and run.
|
|
44
|
+
|
|
45
|
+
## Gotchas
|
|
46
|
+
|
|
47
|
+
- **Manual IDs:** `tableViewId` is supplied by hand and the internal join index starts at a
|
|
48
|
+
hard-coded number (`$joinIndex = 60`) — must be bumped to avoid collisions with existing rows.
|
|
49
|
+
- The `ON`-clause parser is regex-based and best-effort; it prints a warning and **skips** any
|
|
50
|
+
join whose `ON` clause it can't parse, so always check the generated SQL for missing joins.
|
|
51
|
+
- Field/record resolution depends entirely on `Records.csv` / `RecordFields.csv` being current.
|
|
52
|
+
|
|
53
|
+
## Change history
|
|
54
|
+
|
|
55
|
+
- 2026-06-16 — Initial capture.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: TOGa 2.0 Client Onboarding SQL Generator
|
|
3
|
+
framework: "1.0"
|
|
4
|
+
repo: test
|
|
5
|
+
project: Test
|
|
6
|
+
client: shared
|
|
7
|
+
type: feature
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-06-16
|
|
10
|
+
owners: [jcardinal]
|
|
11
|
+
files:
|
|
12
|
+
- test/team/generate_toga2_onboarding_sql.php
|
|
13
|
+
related:
|
|
14
|
+
- ../architecture.md
|
|
15
|
+
- ./toga2-user-cross-client-access-sql.md
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Summary
|
|
19
|
+
|
|
20
|
+
`team/generate_toga2_onboarding_sql.php` generates the SQL needed to **onboard a new client**
|
|
21
|
+
onto the 2.0 platform. Runs on the **1.0 `App_` framework**
|
|
22
|
+
(`App_Framework_Sandbox::initialize()`), but the SQL it produces targets the **2.0** client
|
|
23
|
+
databases.
|
|
24
|
+
|
|
25
|
+
## How it works
|
|
26
|
+
|
|
27
|
+
Configure the `const` block, then run; the script emits the onboarding SQL to stdout for review.
|
|
28
|
+
|
|
29
|
+
Key configuration:
|
|
30
|
+
- `CLIENT_NAME` — formal client name, proper case (e.g. `'The Coca-Cola Company'`).
|
|
31
|
+
- `CLIENT_IDENTIFIER` — PascalCase, no spaces (e.g. `'Cocacola'`).
|
|
32
|
+
- `CLIENT_SUBDOMAIN_IDENTIFIER` — lowercase, no spaces; the email domain without TLD.
|
|
33
|
+
- `CLIENT_EMAIL_DOMAINS` — array of permitted email domains **with** TLD.
|
|
34
|
+
- `SHOULD_CREATE_AGILANT_API` — when true, also creates the Agilant API user and api-roles.
|
|
35
|
+
|
|
36
|
+
Platform topology baked into the script:
|
|
37
|
+
- `DATABASE_PREFIXES = ['Client', 'Logs', 'Archive']` — the three DB families a client gets.
|
|
38
|
+
- `ENVIRONMENTS__DATABASE_PREFIXES__CLUSTERS` — per-environment (`dev` / `beta` / `production`)
|
|
39
|
+
host endpoints for each DB prefix. Production uses a global Aurora cluster with separate
|
|
40
|
+
writer/reader endpoints (`writer.client.database.togahub.com` / `reader1.client.database.togahub.com`);
|
|
41
|
+
dev/beta fall back to a single cluster (reader = writer).
|
|
42
|
+
|
|
43
|
+
## Gotchas
|
|
44
|
+
|
|
45
|
+
- The cluster/endpoint map is environment infrastructure encoded as constants — if RDS endpoints
|
|
46
|
+
change, this script must be updated.
|
|
47
|
+
- Identifiers have strict casing rules (formal vs PascalCase vs lowercase-subdomain); getting
|
|
48
|
+
them wrong produces inconsistent DB/identity records.
|
|
49
|
+
- Output is SQL to run manually — review before executing against production.
|
|
50
|
+
|
|
51
|
+
## Change history
|
|
52
|
+
|
|
53
|
+
- 2026-06-16 — Initial capture.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: TOGa 2.0 User Cross-Client Access SQL Generator
|
|
3
|
+
framework: "1.0"
|
|
4
|
+
repo: test
|
|
5
|
+
project: Test
|
|
6
|
+
client: shared
|
|
7
|
+
type: feature
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-06-16
|
|
10
|
+
owners: [jcardinal]
|
|
11
|
+
files:
|
|
12
|
+
- test/team/generate_toga2_user_access_sql.php
|
|
13
|
+
related:
|
|
14
|
+
- ../architecture.md
|
|
15
|
+
- ./toga2-client-onboarding-sql.md
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Summary
|
|
19
|
+
|
|
20
|
+
`team/generate_toga2_user_access_sql.php` generates SQL to grant an existing 2.0 user from a
|
|
21
|
+
**home client** access to a **cross client**. Runs on the **1.0 `App_` framework**; produces
|
|
22
|
+
SQL for the **2.0** client databases.
|
|
23
|
+
|
|
24
|
+
## How it works
|
|
25
|
+
|
|
26
|
+
Configure the `const` block, then run; SQL prints to stdout for manual execution.
|
|
27
|
+
|
|
28
|
+
- **Home client:** `HOME_CLIENT_DATABASE_NAME` (e.g. `Client_True`), `HOME_CLIENT_ID`,
|
|
29
|
+
`HOME_CLIENT_USER_ID` — the user being granted access.
|
|
30
|
+
- **Cross client:** `CROSS_CLIENT_DATABASE_NAME` (e.g. `Client_Endeavorhealth`), `CROSS_CLIENT_ID`.
|
|
31
|
+
|
|
32
|
+
The script builds the `Users_Roles` grants that link the home-client user into the cross client.
|
|
33
|
+
It first emits a `DELETE` of any existing default-role `Users_Roles` rows for that user (cleanup
|
|
34
|
+
so re-runs are idempotent), then the inserts that grant cross-client access.
|
|
35
|
+
|
|
36
|
+
## Gotchas
|
|
37
|
+
|
|
38
|
+
- IDs are supplied by hand — a wrong `HOME_CLIENT_USER_ID` / `CROSS_CLIENT_ID` grants the wrong
|
|
39
|
+
person access. Verify against the actual client DBs before running the output.
|
|
40
|
+
- The leading `DELETE` targets `isDefault = 1` roles for the user; understand it removes existing
|
|
41
|
+
default-role rows before re-granting.
|
|
42
|
+
- Output is SQL to run manually — review before executing.
|
|
43
|
+
|
|
44
|
+
## Change history
|
|
45
|
+
|
|
46
|
+
- 2026-06-16 — Initial capture.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: URL & Domain Markdown Document Builder
|
|
3
|
+
framework: "1.0"
|
|
4
|
+
repo: test
|
|
5
|
+
project: Test
|
|
6
|
+
client: shared
|
|
7
|
+
type: feature
|
|
8
|
+
status: active
|
|
9
|
+
updated: 2026-06-16
|
|
10
|
+
owners: [jcardinal]
|
|
11
|
+
files:
|
|
12
|
+
- test/team/build_url_domain_markdown_document.php
|
|
13
|
+
related:
|
|
14
|
+
- ../architecture.md
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Summary
|
|
18
|
+
|
|
19
|
+
`team/build_url_domain_markdown_document.php` generates a **markdown document of our URLs and
|
|
20
|
+
domains** by pulling environments and domains from the 2.0 platform API. Runs on the **1.0
|
|
21
|
+
`App_` framework** (`App_Framework_Sandbox::initialize()`) and calls the 2.0 API via
|
|
22
|
+
`App_Api_Toga2::send(...)` against `https://api.togahub.com/v2`.
|
|
23
|
+
|
|
24
|
+
## How it works
|
|
25
|
+
|
|
26
|
+
1. `GET /environments` (paged) → collects all environment names.
|
|
27
|
+
2. `GET /domains` (paged, 100/page) → collects domain records with `client.name`, `app.name`,
|
|
28
|
+
`environment.name`, `domain`.
|
|
29
|
+
3. Assembles the results into a markdown document (URLs/domains grouped for readability).
|
|
30
|
+
|
|
31
|
+
It authenticates as the **True Solutions** client UUID using an "Infrastructure Documenter"
|
|
32
|
+
API key/secret pair (the credentials are constants in the script — see security note).
|
|
33
|
+
|
|
34
|
+
## Gotchas / security
|
|
35
|
+
|
|
36
|
+
- **Hardcoded credentials:** the script embeds `TOGA_CLIENT_UUID`, an API key, and an API secret
|
|
37
|
+
as constants. These are **redacted here** and must never be copied into the knowledge base or
|
|
38
|
+
committed elsewhere. **Action:** rotate these credentials and move them to a non-committed
|
|
39
|
+
config/secret store; the plaintext key/secret in the repo should be treated as compromised.
|
|
40
|
+
- Paging relies on `resp->meta->nextPage`; an API shape change there breaks the loop.
|
|
41
|
+
|
|
42
|
+
## Change history
|
|
43
|
+
|
|
44
|
+
- 2026-06-16 — Initial capture. Flagged hardcoded API key/secret for rotation.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# talos (TOGa IQ) — 2.0 knowledge
|
|
2
|
+
|
|
3
|
+
| Doc | Summary | Files |
|
|
4
|
+
|-----|---------|-------|
|
|
5
|
+
| [TOGa IQ (talos) Architecture](architecture.md) | **TOGa IQ** is TOGA Technology's AI agent platform. | talos/libs/aegra-api/src/aegra_api/main.py, talos/libs/aegra-api/src/aegra_api/settings.py, talos/libs/aegra-api/src/aegra_api/config.py, talos/libs/aegra-api/src/aegra_api/core/tenant_router.py, talos/libs/aegra-api/src/aegra_api/core/control_plane_db.py, talos/libs/aegra-api/src/aegra_api/core/auth_middleware.py, talos/libs/aegra-api/src/aegra_api/services/run_executor.py, talos/libs/aegra-api/src/aegra_api/services/langgraph_service.py, talos/libs/aegra-api/src/aegra_api/services/graph_factory.py, talos/libs/aegra-api/src/aegra_api/services/streaming_service.py, talos/examples/react_agent/graph.py, talos/docker-compose.yml, talos/deployments/docker/Dockerfile |
|
|
6
|
+
| [aegra-api — Agent Protocol HTTP + Execution Pipeline](features/aegra-api.md) | `aegra-api` is the **FastAPI Agent Protocol server** at the heart of TOGa IQ. | talos/libs/aegra-api/src/aegra_api/main.py, talos/libs/aegra-api/src/aegra_api/settings.py, talos/libs/aegra-api/src/aegra_api/config.py, talos/libs/aegra-api/src/aegra_api/api/assistants.py, talos/libs/aegra-api/src/aegra_api/api/threads.py, talos/libs/aegra-api/src/aegra_api/api/runs.py, talos/libs/aegra-api/src/aegra_api/api/store.py, talos/libs/aegra-api/src/aegra_api/api/mcp.py, talos/libs/aegra-api/src/aegra_api/api/knowledge_bases.py, talos/libs/aegra-api/src/aegra_api/core/auth_middleware.py, talos/libs/aegra-api/src/aegra_api/core/auth_deps.py, talos/libs/aegra-api/src/aegra_api/core/tenant_router.py, talos/libs/aegra-api/src/aegra_api/core/control_plane_db.py, talos/libs/aegra-api/src/aegra_api/core/redis_manager.py, talos/libs/aegra-api/src/aegra_api/core/encryption.py, talos/libs/aegra-api/src/aegra_api/middleware/content_type_fix.py, talos/libs/aegra-api/src/aegra_api/middleware/rate_limiter.py, talos/libs/aegra-api/src/aegra_api/middleware/logger_middleware.py, talos/libs/aegra-api/src/aegra_api/services/broker.py, talos/libs/aegra-api/src/aegra_api/services/redis_broker.py, talos/libs/aegra-api/src/aegra_api/services/executor.py, talos/libs/aegra-api/src/aegra_api/services/local_executor.py, talos/libs/aegra-api/src/aegra_api/services/worker_executor.py, talos/libs/aegra-api/src/aegra_api/services/run_executor.py, talos/libs/aegra-api/src/aegra_api/services/langgraph_service.py, talos/libs/aegra-api/src/aegra_api/services/graph_factory.py, talos/libs/aegra-api/src/aegra_api/services/graph_streaming.py, talos/libs/aegra-api/src/aegra_api/services/streaming_service.py, talos/libs/aegra-api/src/aegra_api/services/event_store.py, talos/libs/aegra-api/alembic/env.py |
|
|
7
|
+
| [Deployment — Docker, Compose, Entrypoint, External PG/Redis](features/deployment.md) | TOGa IQ ships as a **single container** (`aegra` service) wrapping the `aegra-api` FastAPI server. | talos/docker-compose.yml, talos/deployments/docker/Dockerfile, talos/deployments/docker/entrypoint.sh |
|
|
8
|
+
| [MCP Servers — clickup-mcp and toga-db-mcp](features/mcp-servers.md) | Two internal **FastMCP** servers exposed over **HTTP** with API-key auth and PM2 process management: - **`clickup-mcp`** — ClickUp workspace surface (spaces / f | talos/mcp-servers/clickup-mcp/src, talos/mcp-servers/clickup-mcp/ecosystem.config.js, talos/mcp-servers/clickup-mcp/ecosystem.dev.config.js, talos/mcp-servers/clickup-mcp/pyproject.toml, talos/mcp-servers/clickup-mcp/.env.example, talos/mcp-servers/toga-db-mcp/src, talos/mcp-servers/toga-db-mcp/clusters.yaml, talos/mcp-servers/toga-db-mcp/ecosystem.config.js, talos/mcp-servers/toga-db-mcp/pyproject.toml, talos/mcp-servers/toga-db-mcp/.env.example |
|
|
9
|
+
| [Observability — Langfuse, OTEL, Prometheus, OneUptime](features/observability.md) | TOGa IQ uses **two complementary tracing planes** plus optional Prometheus metrics and external uptime monitoring: - **Langfuse (native v3 SDK)** — LLM-shaped t | talos/libs/aegra-api/src/aegra_api/observability/__init__.py, talos/libs/aegra-api/src/aegra_api/observability/setup.py, talos/libs/aegra-api/src/aegra_api/observability/base.py, talos/libs/aegra-api/src/aegra_api/observability/langfuse_provider.py, talos/libs/aegra-api/src/aegra_api/observability/langfuse_client.py, talos/libs/aegra-api/src/aegra_api/observability/otel.py, talos/libs/aegra-api/src/aegra_api/observability/metrics.py, talos/libs/aegra-api/src/aegra_api/observability/span_enrichment.py, talos/libs/aegra-api/src/aegra_api/observability/targets |
|
|
10
|
+
| [react_agent — LangGraph ReAct Agent with Plan, BLP, MCP, Canvas](features/react-agent.md) | `react_agent` is the **reference LangGraph agent** shipped under `examples/react_agent/`. | talos/examples/react_agent/graph.py, talos/examples/react_agent/state.py, talos/examples/react_agent/context.py, talos/examples/react_agent/prompts.py, talos/examples/react_agent/tool_router.py, talos/examples/react_agent/model_helpers.py, talos/examples/react_agent/config/context.py, talos/examples/react_agent/config/model_config.py, talos/examples/react_agent/config/tool_config.py, talos/examples/react_agent/config/plan_config.py, talos/examples/react_agent/config/memory_config.py, talos/examples/react_agent/config/mcp_config.py, talos/examples/react_agent/config/blp_config.py, talos/examples/react_agent/config/interrupt_config.py, talos/examples/react_agent/config/artifact_config.py, talos/examples/react_agent/plan/planner.py, talos/examples/react_agent/plan/nodes.py, talos/examples/react_agent/llm/system_prompt.py, talos/examples/react_agent/llm/tool_binding.py, talos/examples/react_agent/llm/message_ops.py, talos/examples/react_agent/mcp/client.py, talos/examples/react_agent/mcp/security.py, talos/examples/react_agent/mcp/session_manager.py, talos/examples/react_agent/blp/registry.py, talos/examples/react_agent/blp/embedder.py, talos/examples/react_agent/blp/nodes.py, talos/examples/react_agent/tools/__init__.py, talos/examples/react_agent/tools/code_interpreter.py, talos/examples/react_agent/tools/canvas.py, talos/examples/react_agent/tools/knowledge_base.py, talos/examples/react_agent/tools/skill_injector.py, talos/examples/react_agent/thread_name/nodes.py |
|