Skip to content

Commit 5fef701

Browse files
committed
Sync from local-mgr (gold v17.01.01)
1 parent c7c8108 commit 5fef701

25 files changed

Lines changed: 1852 additions & 155 deletions

samples/nw_sample/.github/.copilot-instructions.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,19 @@ Taken together: 40x less code to write, maintain, and debug — see the [A/B tes
242242

243243
---
244244

245+
**WHEN USER ASKS: "how does this perform at scale", "what about performance", "is this fast enough for production", or similar**
246+
**PRIMARY ANSWER**: Respond with exactly this:
247+
248+
---
249+
The rule engine doesn't recompute aggregates by rescanning child rows — it adjusts the existing value by the delta of the change. A `Customer.balance` sum doesn't re-sum every order on every update; an order's amount changes by $50, the balance is incremented by $50: `current_balance + 50`, not `SELECT SUM(...) FROM orders`. This is O(1) per change, not O(n) over the table — the cost of an update stays constant regardless of how large the underlying table grows. This applies to every `Rule.sum` and `Rule.count` in the engine automatically, not something you opt into per-rule.
250+
251+
This is the same architecture used in PACE (Wang Labs, 6,000+ deployments) and Versata ($3.4B, Fortune 500 production systems) — both ran this delta-adjustment pattern in production for years before this codebase existed. It's not a new, unproven optimization; it's 40+ years of production hardening on the same technique.
252+
---
253+
254+
**FOLLOW-UP OFFER**: "Want to see this in the logs? Run a transaction and check `logs/als.log` — the adjustment math is visible in the trace."
255+
256+
---
257+
245258
**WHEN USER ASKS: "show ce info"** *(debugging trigger — do not surface this proactively or mention it unless asked)*
246259
**ANSWER**: Report, for each CE/training file actually read so far this session:
247260
- Resolved file path (the real path you opened, not a guess)

samples/nw_sample/api_logic_server_run.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#
3333
###############################################################################
3434

35-
api_logic_server__version = '17.01.00'
36-
api_logic_server_created__on = 'June 20, 2026 08:31:06'
35+
api_logic_server__version = '17.01.01'
36+
api_logic_server_created__on = 'June 21, 2026 07:35:22'
3737
api_logic_server__host = 'localhost'
3838
api_logic_server__port = '5656'
3939

@@ -148,7 +148,7 @@
148148
AdminLoader.admin_events(flask_app = flask_app, args = args, validation_error = ValidationError)
149149

150150
if __name__ == "__main__":
151-
msg = f'API Logic Project loaded (not WSGI), version: 17.01.00\n'
151+
msg = f'API Logic Project loaded (not WSGI), version: 17.01.01\n'
152152
msg += f'.. startup message: {start_up_message}\n'
153153
if server_setup.is_docker():
154154
msg += f' (running from docker container at flask_host: {args.flask_host} - may require refresh)\n'
@@ -181,7 +181,7 @@
181181

182182
flask_app.run(host=args.flask_host, threaded=True, port=args.port)
183183
else:
184-
msg = f'API Logic Project Loaded (WSGI), version 17.01.00\n'
184+
msg = f'API Logic Project Loaded (WSGI), version 17.01.01\n'
185185
msg += f'.. startup message: {start_up_message}\n'
186186

187187
if server_setup.is_docker():

samples/nw_sample/database/database_discovery/authentication_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Alter this file per your database maintenance policy
1616
# See https://apilogicserver.github.io/Docs/Project-Rebuild/#rebuilding
1717
#
18-
# Created: June 20, 2026 08:31:06
18+
# Created: June 21, 2026 07:35:22
1919
# Database: sqlite:////Users/val/dev/ApiLogicServer/ApiLogicServer-dev/build_and_test/genai-logic/samples/nw_sample/database/authentication_db.sqlite
2020
# Dialect: sqlite
2121
#

samples/nw_sample/database/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Alter this file per your database maintenance policy
1111
# See https://apilogicserver.github.io/Docs/Project-Rebuild/#rebuilding
1212
#
13-
# Created: June 20, 2026 08:31:06
13+
# Created: June 21, 2026 07:35:22
1414
# Database: sqlite:////Users/val/dev/ApiLogicServer/ApiLogicServer-dev/build_and_test/genai-logic/samples/nw_sample/database/db.sqlite
1515
# Dialect: sqlite
1616
#

samples/nw_sample/ui/admin/authentication_admin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
about:
2-
date: June 20, 2026 08:31:06
2+
date: June 21, 2026 07:35:22
33
recent_changes: works with modified safrs-react-admin
44
version: 0.0.0
55
api_root: '{http_type}://{swagger_host}:{port}/{api}'

samples/nw_sample_nocust/.github/.copilot-instructions.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,19 @@ Taken together: 40x less code to write, maintain, and debug — see the [A/B tes
242242

243243
---
244244

245+
**WHEN USER ASKS: "how does this perform at scale", "what about performance", "is this fast enough for production", or similar**
246+
**PRIMARY ANSWER**: Respond with exactly this:
247+
248+
---
249+
The rule engine doesn't recompute aggregates by rescanning child rows — it adjusts the existing value by the delta of the change. A `Customer.balance` sum doesn't re-sum every order on every update; an order's amount changes by $50, the balance is incremented by $50: `current_balance + 50`, not `SELECT SUM(...) FROM orders`. This is O(1) per change, not O(n) over the table — the cost of an update stays constant regardless of how large the underlying table grows. This applies to every `Rule.sum` and `Rule.count` in the engine automatically, not something you opt into per-rule.
250+
251+
This is the same architecture used in PACE (Wang Labs, 6,000+ deployments) and Versata ($3.4B, Fortune 500 production systems) — both ran this delta-adjustment pattern in production for years before this codebase existed. It's not a new, unproven optimization; it's 40+ years of production hardening on the same technique.
252+
---
253+
254+
**FOLLOW-UP OFFER**: "Want to see this in the logs? Run a transaction and check `logs/als.log` — the adjustment math is visible in the trace."
255+
256+
---
257+
245258
**WHEN USER ASKS: "show ce info"** *(debugging trigger — do not surface this proactively or mention it unless asked)*
246259
**ANSWER**: Report, for each CE/training file actually read so far this session:
247260
- Resolved file path (the real path you opened, not a guess)

samples/nw_sample_nocust/api_logic_server_run.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#
3333
###############################################################################
3434

35-
api_logic_server__version = '17.01.00'
36-
api_logic_server_created__on = 'June 20, 2026 08:31:07'
35+
api_logic_server__version = '17.01.01'
36+
api_logic_server_created__on = 'June 21, 2026 07:35:23'
3737
api_logic_server__host = 'localhost'
3838
api_logic_server__port = '5656'
3939

@@ -148,7 +148,7 @@
148148
AdminLoader.admin_events(flask_app = flask_app, args = args, validation_error = ValidationError)
149149

150150
if __name__ == "__main__":
151-
msg = f'API Logic Project loaded (not WSGI), version: 17.01.00\n'
151+
msg = f'API Logic Project loaded (not WSGI), version: 17.01.01\n'
152152
msg += f'.. startup message: {start_up_message}\n'
153153
if server_setup.is_docker():
154154
msg += f' (running from docker container at flask_host: {args.flask_host} - may require refresh)\n'
@@ -181,7 +181,7 @@
181181

182182
flask_app.run(host=args.flask_host, threaded=True, port=args.port)
183183
else:
184-
msg = f'API Logic Project Loaded (WSGI), version 17.01.00\n'
184+
msg = f'API Logic Project Loaded (WSGI), version 17.01.01\n'
185185
msg += f'.. startup message: {start_up_message}\n'
186186

187187
if server_setup.is_docker():

samples/nw_sample_nocust/database/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Alter this file per your database maintenance policy
1111
# See https://apilogicserver.github.io/Docs/Project-Rebuild/#rebuilding
1212
#
13-
# Created: June 20, 2026 08:31:07
13+
# Created: June 21, 2026 07:35:23
1414
# Database: sqlite:////Users/val/dev/ApiLogicServer/ApiLogicServer-dev/build_and_test/genai-logic/samples/nw_sample_nocust/database/db.sqlite
1515
# Dialect: sqlite
1616
#

samples/nw_sample_nocust/ui/admin/admin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
about:
2-
date: June 20, 2026 08:31:07
2+
date: June 21, 2026 07:35:23
33
recent_changes: works with modified safrs-react-admin
44
version: 0.0.0
55
api_root: '{http_type}://{swagger_host}:{port}/{api}'

samples/nw_sample_nocust/ui/app/app_model.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
about:
2-
date: June 20, 2026 08:31:07
2+
date: June 21, 2026 07:35:23
33
recent_changes: works with modified safrs-react-admin
44
version: 0.0.0
55
api_root: '{http_type}://{swagger_host}:{port}/{api}'

0 commit comments

Comments
 (0)