toga-ai 1.0.320 → 1.0.321
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.
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
| [Tools MVC — Routing, CSRF & App_Database Access Patterns](features/mvc-data-access-patterns.md) | The load-bearing 1.0 (`App_`) framework conventions a developer needs when adding a page to the Tools app — URL routing, CSRF, and DB access through `App_Databa | tools/_/app/nav.php, tools/mvc/get.php |
|
|
8
8
|
| [Tools Persona-Gated Navigation (App_Nav)](features/persona-gated-navigation.md) | `App_Nav` is the Tools app's two-level, **persona-gated** navigation. | tools/_/app/nav.php, tools/mvc/get.php |
|
|
9
9
|
| [Tools SAML SSO Consumer & Persona-Gated Auth (App_Auth)](features/saml-sso-auth.md) | `App_Auth` is the Tools app's authentication layer: it consumes the SAML gateway `?saml=` handoff (see the 2.0 SAML downstream integration contract), establishe | tools/_/app/auth.php, tools/mvc/sso/initiate/get.php, tools/mvc/sso/get.php, tools/mvc/login/get.php, tools/mvc/login/post.php, tools/mvc/logout/get.php, tools/mvc/get.php, tools/config.production.ini, tools/config.local.ini |
|
|
10
|
-
| [Talos Knowledge Base Admin UI (KB Documents + Vocabulary)](features/talos-kb-documents-admin.md) | A Tools (1.0) admin UI to browse/fix the Talos knowledge-base documents and manage the transcript-cleanup vocabulary — without a deploy. | tools/mvc/talos/kb-documents/get.php, tools/mvc/talos/kb-documents/post.php, tools/mvc/talos/knowledge-bases/post.php, tools/mvc/talos/vocabulary/get.php, tools/mvc/talos/vocabulary/post.php, tools/_/app/talos/s3.php, tools/_/app/talos/bedrock.php, tools/_/app/worker.php, tools/_/app/nav.php, tools/config.production.ini, tools/config.alpha.ini, tools/.platform/httpd/conf.d/timeouts.conf |
|
|
10
|
+
| [Talos Knowledge Base Admin UI (KB Documents + Vocabulary)](features/talos-kb-documents-admin.md) | A Tools (1.0) admin UI to browse/fix the Talos knowledge-base documents and manage the transcript-cleanup vocabulary — without a deploy. | tools/mvc/talos/kb-documents/get.php, tools/mvc/talos/kb-documents/post.php, tools/mvc/talos/knowledge-bases/get.php, tools/mvc/talos/knowledge-bases/post.php, tools/mvc/talos/vocabulary/get.php, tools/mvc/talos/vocabulary/post.php, tools/_/app/talos/s3.php, tools/_/app/talos/bedrock.php, tools/_/app/pg.php, tools/_/app/worker.php, tools/_/app/nav.php, tools/config.production.ini, tools/config.alpha.ini, tools/.platform/httpd/conf.d/timeouts.conf, tools/.platform/hooks/prebuild/01-install-php-pgsql.sh, tools/.platform/hooks/postdeploy/01-restart-php.sh |
|
|
11
11
|
| [Talos Pricing UI (Onboarding, Dashboard, Benchmarks, Cost Factors + Estimator)](features/talos-pricing-ui.md) | The 1.0 (tools app) face of the **Talos Pricing Platform** — a "Talos Pricing" nav folder with four pages plus a client-side estimate engine. | tools/_/app/nav.php, tools/_/app/talos/estimator.php, tools/mvc/talos/onboarding/get.php, tools/mvc/talos/onboarding/post.php, tools/mvc/talos/pricing/get.php, tools/mvc/talos/benchmarks/get.php, tools/mvc/talos/factors/get.php, tools/mvc/talos/factors/post.php, tools/assets/css/style.css |
|
|
12
12
|
| [Deploying Tools to Elastic Beanstalk (PHP 8.5 / Amazon Linux 2023)](workflows/deploy-to-elastic-beanstalk-al2023.md) | How the **Tools** 1.0 app boots on Elastic Beanstalk running `PHP 8.5 on 64bit Amazon Linux 2023/4.13.1 (aarch64)`. | tools/.ebextensions/004_http_to_https.config, tools/.ebextensions/006_mount-s3fs.config, tools/.ebextensions/007_setup_export_cache_folders.config, tools/.ebextensions/008_setup_ldap.config, tools/.ebextensions/009_setup_phpini.config, tools/.ebextensions/020_setup_git_libraries.config, tools/.ebextensions/050_register_instance_to_shared_application_load_balancer.config, tools/ebs/git.json |
|
|
@@ -11,16 +11,20 @@ owners: [jcardinal]
|
|
|
11
11
|
files:
|
|
12
12
|
- tools/mvc/talos/kb-documents/get.php
|
|
13
13
|
- tools/mvc/talos/kb-documents/post.php
|
|
14
|
+
- tools/mvc/talos/knowledge-bases/get.php
|
|
14
15
|
- tools/mvc/talos/knowledge-bases/post.php
|
|
15
16
|
- tools/mvc/talos/vocabulary/get.php
|
|
16
17
|
- tools/mvc/talos/vocabulary/post.php
|
|
17
18
|
- tools/_/app/talos/s3.php
|
|
18
19
|
- tools/_/app/talos/bedrock.php
|
|
20
|
+
- tools/_/app/pg.php
|
|
19
21
|
- tools/_/app/worker.php
|
|
20
22
|
- tools/_/app/nav.php
|
|
21
23
|
- tools/config.production.ini
|
|
22
24
|
- tools/config.alpha.ini
|
|
23
25
|
- tools/.platform/httpd/conf.d/timeouts.conf
|
|
26
|
+
- tools/.platform/hooks/prebuild/01-install-php-pgsql.sh
|
|
27
|
+
- tools/.platform/hooks/postdeploy/01-restart-php.sh
|
|
24
28
|
related:
|
|
25
29
|
- ./mvc-data-access-patterns.md
|
|
26
30
|
- ./persona-gated-navigation.md
|
|
@@ -34,7 +38,8 @@ A Tools (1.0) admin UI to browse/fix the Talos knowledge-base documents and mana
|
|
|
34
38
|
transcript-cleanup vocabulary — without a deploy. It is the human front-end to the worker2
|
|
35
39
|
[Talos Transcript Ingestion](../../../2.0/apps/worker2/features/talos-transcript-ingestion.md)
|
|
36
40
|
pipeline. A new **"Talos Knowledge Base"** nav group (personas *Development Team* / *TOGa
|
|
37
|
-
Technology*) exposes
|
|
41
|
+
Technology*) exposes the pages below. **"Knowledge Bases"** is registered as the **first**
|
|
42
|
+
action in the `talos-kb` nav group (above "KB Documents") and inherits the group's personas.
|
|
38
43
|
|
|
39
44
|
## Pages
|
|
40
45
|
|
|
@@ -76,12 +81,32 @@ so they displayed **double-encoded** (e.g. "Grand & Toy"). `vocabulary/post.
|
|
|
76
81
|
`html_entity_decode()`s values on save so the DB stores **raw** text; `vocabulary/get.php`
|
|
77
82
|
already escapes once at display. Do not re-add encoding on save.
|
|
78
83
|
|
|
84
|
+
### `/talos/knowledge-bases` — KB list + inline rename
|
|
85
|
+
|
|
86
|
+
The list/admin page (`get.php`) for Talos knowledge bases. Unlike KB Documents (whose KB
|
|
87
|
+
list is derived from **live S3 folders**), this page's list comes from the
|
|
88
|
+
**`Team.KnowledgeBases` MySQL table** (via `db_team`) — the two are distinct sources of
|
|
89
|
+
truth. Columns: Slug, Name, Bedrock KB ID, Created On (`dtCreated`, converted UTC→
|
|
90
|
+
America/Chicago). **Name is the only editable field** and is edited **in place** (Edit→Save);
|
|
91
|
+
there is **no delete option**. Server strings are escaped before `innerHTML` (XSS guard).
|
|
92
|
+
|
|
93
|
+
Rename posts `action=rename` → `UPDATE Team.KnowledgeBases SET name WHERE slug` (`db_team`),
|
|
94
|
+
preceded by an **existence SELECT** so a stale slug reports **"not found"** instead of a
|
|
95
|
+
false success.
|
|
96
|
+
|
|
79
97
|
### `POST /talos/knowledge-bases` — create a new KB (synchronous provisioning)
|
|
80
98
|
|
|
81
99
|
Admin action that provisions a brand-new Talos knowledge base end to end in **one
|
|
82
100
|
synchronous request**: creates the S3 prefix, creates the Bedrock KB and **waits for it to
|
|
83
101
|
reach `ACTIVE`**, creates the Bedrock data source (`MANAGED_KNOWLEDGE_BASE_CONNECTOR`), and
|
|
84
|
-
inserts
|
|
102
|
+
inserts rows across **5 systems with no shared transaction**: `Team.KnowledgeBases` (`db_team`,
|
|
103
|
+
Team MySQL cluster), `Client_True.VectorIndexes` (`db_true`, **Client MySQL cluster** — not the
|
|
104
|
+
Team cluster), and 2 Talos **Postgres** rows (`public.knowledge_bases` +
|
|
105
|
+
`public.assistant_knowledge_bases`, the latter linking a hard-coded assistant id). Step order:
|
|
106
|
+
validate name (≤255) + derive slug via **`App_Talos_S3::slugify()`** (kebab-case, `iconv` ASCII
|
|
107
|
+
translit; rejects a duplicate slug — `slug` is UNIQUE); create 3 S3 folder markers
|
|
108
|
+
`development-team/{slug}/{approved,archive,upload}/` via **`App_Talos_S3::putFolderMarker()`**;
|
|
109
|
+
create the Bedrock KB and wait for `ACTIVE`; create the data source; then the DB inserts. This flow
|
|
85
110
|
**stays synchronous by design** — moving it to worker2/SQS async was explicitly rejected;
|
|
86
111
|
the fix path is to raise timeouts, never to background the work.
|
|
87
112
|
|
|
@@ -115,6 +140,13 @@ orphaned KB).
|
|
|
115
140
|
the SDK default chain — because `App_Talos_S3` only ever talks to **togaiq**, so it needs the
|
|
116
141
|
togaiq-account key (the tools `[aws]` key is the toga-private key, which can cross-account *read*
|
|
117
142
|
togaiq but not *write* it).
|
|
143
|
+
- **`App_Pg`** (`_/app/pg.php`) — a **tools-only** minimal PDO `pgsql` wrapper for the Talos
|
|
144
|
+
Postgres DB (host `writer.talos.database.togahub.com:5432`, db `tenant_true`, user
|
|
145
|
+
`talosadmin`). Deliberately **not** added to the shared 1.0 `library` (the App_ framework has
|
|
146
|
+
no Postgres support). The password is **read from the existing `[database_team]` config
|
|
147
|
+
section** (shared with the MySQL DBs) — **no new secret introduced**. `execute()` uses real
|
|
148
|
+
PDO prepared statements (bound params). If the `pdo_pgsql` extension is missing it returns
|
|
149
|
+
`ok=false` with a generic message (detail goes only to `error_log`, never to the client).
|
|
118
150
|
- **`App_Worker::enqueue()`** (`_/app/worker.php`) — inserts a `Core.WorkerJobs` row and sends
|
|
119
151
|
the `{"workerJobId": id}` SQS message, so a 1.0 app can enqueue worker2 jobs. Requires the
|
|
120
152
|
`[worker]` (`queue_url`/`queue_region`) and `[aws]` (main-account key for SQS `SendMessage`)
|
|
@@ -130,6 +162,12 @@ orphaned KB).
|
|
|
130
162
|
- **`[aws]`** — main-account key for SQS `SendMessage` (toga-private key; cross-account reads
|
|
131
163
|
togaiq but cannot write it — that's why `[talos]` exists).
|
|
132
164
|
- `[database_toga2core]` — writable 2.0 Core (already present).
|
|
165
|
+
- **`pdo_pgsql` PHP extension** must be installed on the tools Elastic Beanstalk environment
|
|
166
|
+
(the create flow writes to Talos Postgres via `App_Pg`). Provided by two `.platform` hooks
|
|
167
|
+
(mirroring worker2's): `hooks/prebuild/01-install-php-pgsql.sh` (installs `php-pgsql`,
|
|
168
|
+
idempotent, **fails the deploy loudly** if `pgsql` won't load) and
|
|
169
|
+
`hooks/postdeploy/01-restart-php.sh` (restarts php-fpm/httpd). **EB runs `.platform/hooks`
|
|
170
|
+
regardless of the git exec bit** — worker2's equivalents are committed `100644`.
|
|
133
171
|
- Apply the dbchanges2 `Team/2026-06-30a..e` + `Core/2026-06-30a` migrations in order.
|
|
134
172
|
- Verify the Bedrock KB region / data-source name against the live account (TODOs in code).
|
|
135
173
|
|
|
@@ -171,12 +209,37 @@ orphaned KB).
|
|
|
171
209
|
allows same-name KBs with new ids). After a failed create: either
|
|
172
210
|
`aws bedrock-agent delete-knowledge-base` the orphan and re-run clean, or finish the DB rows
|
|
173
211
|
manually.
|
|
212
|
+
- **Newest KBs use Bedrock's fully-MANAGED type** (`knowledgeBaseConfiguration.type=MANAGED`,
|
|
213
|
+
`managedKnowledgeBaseConfiguration.embeddingModelType=MANAGED`) — **AWS owns the vector store**,
|
|
214
|
+
so there is **no S3 Vectors index, no `embeddingModelArn`, and no `storageConfiguration`** to
|
|
215
|
+
build. Config was replicated from the existing `development-team-craftex` KB. Account
|
|
216
|
+
`654654170868`, region `us-east-1`, execution role `…ForKnowledgeBase_ofl5a`.
|
|
217
|
+
- **KB-list source differs per page.** The new `/talos/knowledge-bases` page lists from
|
|
218
|
+
`Team.KnowledgeBases` (`db_team`); `/talos/kb-documents` lists from live S3 folders. Don't
|
|
219
|
+
assume one reflects the other.
|
|
220
|
+
- **Schemas.** `Team.KnowledgeBases`: `id, uuid`(UNIQUE)`, slug`(UNIQUE)`, name, isGeneral,
|
|
221
|
+
bedrockKbId`(nullable)`, isActive, dtCreated`(datetime default `CURRENT_TIMESTAMP`)`, dtUpdated`.
|
|
222
|
+
`Client_True.VectorIndexes` (Client cluster): `id, uuid`(UNIQUE)`, name, docSlug`(UNIQUE,
|
|
223
|
+
nullable)`, sectionSlug, chunkSlug, description` — create sets `docSlug=sectionSlug=chunkSlug=
|
|
224
|
+
bedrockKbId`.
|
|
225
|
+
- **Not yet run end-to-end in production.** The whole feature is code-complete, `php -l` clean,
|
|
226
|
+
and reviewed, but the create flow has not been exercised in prod pending the `pdo_pgsql`
|
|
227
|
+
deploy plus network/IAM prerequisites (the developer is handling those).
|
|
174
228
|
- No new secret literals introduced; credentials live in the config sections above (documented by
|
|
175
229
|
section/account, never by value). AWS account id `654654170868`, bucket `togaiq`, and the KB
|
|
176
230
|
execution-role ARN are non-secret resource identifiers.
|
|
177
231
|
|
|
178
232
|
## Change history
|
|
179
233
|
|
|
234
|
+
- 2026-07-13 — Added the **`/talos/knowledge-bases` list + inline-rename page** (`get.php`;
|
|
235
|
+
lists from `Team.KnowledgeBases`, rename-only, no delete, existence-check before update),
|
|
236
|
+
registered first in the `talos-kb` nav group. Added the **`App_Pg`** tools-only PDO `pgsql`
|
|
237
|
+
wrapper (password reused from `[database_team]`; not added to shared library) and the
|
|
238
|
+
**`.platform` pdo_pgsql install/restart hooks**. Documented the create flow's 5-system fan-out
|
|
239
|
+
(incl. `Client_True.VectorIndexes` on the **Client** cluster + 2 Postgres rows), the
|
|
240
|
+
`slugify()`/`putFolderMarker()` helpers, the fully-**MANAGED** Bedrock KB type (AWS-owned vector
|
|
241
|
+
store, no storageConfiguration), and the two DB schemas. Feature is code-complete/reviewed but
|
|
242
|
+
not yet run end-to-end in prod. (jcardinal)
|
|
180
243
|
- 2026-07-13 — Added the **synchronous KB-create flow** (`POST /talos/knowledge-bases`) via new
|
|
181
244
|
`App_Talos_Bedrock` helper. Fixed the **504 at 60s**: EB AL2023 PHP = Apache→php-fpm over
|
|
182
245
|
`mod_proxy_fcgi` with a 60s default proxy read timeout; added
|
package/package.json
CHANGED