pythia-plsql 0.4.8__tar.gz → 0.4.9__tar.gz
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.
- {pythia_plsql-0.4.8/scripts/pythia_plsql.egg-info → pythia_plsql-0.4.9}/PKG-INFO +1 -1
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/pyproject.toml +1 -1
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/scripts/pythia.py +41 -5
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9/scripts/pythia_plsql.egg-info}/PKG-INFO +1 -1
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/tests/test_phase1.py +26 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/LICENSE +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/README.md +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/queries/compile-errors.sql +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/queries/dependencies.sql +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/queries/impact.sql +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/queries/invalid-objects.sql +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/queries/name-occupants.sql +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/queries/object-source.sql +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/queries/plscope-enabled.sql +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/queries/plscope-statements.sql +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/queries/plscope-usages.sql +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/queries/session-privileges.sql +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/queries/similar-candidates.sql +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/queries/source.sql +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/scripts/pythia_plsql.egg-info/SOURCES.txt +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/scripts/pythia_plsql.egg-info/dependency_links.txt +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/scripts/pythia_plsql.egg-info/entry_points.txt +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/scripts/pythia_plsql.egg-info/requires.txt +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/scripts/pythia_plsql.egg-info/top_level.txt +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/setup.cfg +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/skills/pythia-apply/SKILL.md +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/skills/pythia-explore/SKILL.md +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/skills/pythia-explore/reference/data-dictionary.md +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/skills/pythia-impact/SKILL.md +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/skills/pythia-review/SKILL.md +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/skills/pythia-review/reference/antipatterns.md +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/skills/pythia-setup/SKILL.md +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/skills/pythia-skill-author/SKILL.md +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/skills/pythia-write/SKILL.md +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/skills/pythia-write/reference/patterns.md +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/tests/test_install.py +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/tests/test_phase2.py +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/tests/test_phase3.py +0 -0
- {pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/tests/test_phase5.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythia-plsql
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.9
|
|
4
4
|
Summary: PL/SQL development for AI agents on Oracle Database - expert data-dictionary queries, impact analysis, and a snapshot-verified write path with honest rollback.
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/thaildhe172591/pythia
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pythia-plsql"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.9"
|
|
8
8
|
description = "PL/SQL development for AI agents on Oracle Database - expert data-dictionary queries, impact analysis, and a snapshot-verified write path with honest rollback."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -967,10 +967,46 @@ def json_envelope(command, connection, schema, cols, rows, truncated, **extra):
|
|
|
967
967
|
|
|
968
968
|
# --- database access ---------------------------------------------------------
|
|
969
969
|
|
|
970
|
-
def
|
|
971
|
-
"""
|
|
972
|
-
|
|
973
|
-
|
|
970
|
+
def authenticating_account(user):
|
|
971
|
+
"""The Oracle account that actually authenticates. With proxy
|
|
972
|
+
authentication the connect string is `agent[owner]` and it is the agent
|
|
973
|
+
whose password is checked, whose account locks, and whose name a DBA
|
|
974
|
+
needs — not the schema in front of you."""
|
|
975
|
+
if not user:
|
|
976
|
+
return None
|
|
977
|
+
return str(user).split("[", 1)[0].strip().upper()
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
def connect_failure_message(exc, conn_name, user=None):
|
|
981
|
+
"""A failure to connect should say which entry failed and what to do. For
|
|
982
|
+
the three errors Oracle has already diagnosed precisely, generic advice
|
|
983
|
+
wastes the reader's time, so name the actual next step instead."""
|
|
984
|
+
text = str(exc)
|
|
985
|
+
account = authenticating_account(user)
|
|
986
|
+
who = account or "<the connecting user>"
|
|
987
|
+
head = f"Could not connect using connection {conn_name!r}: {text}"
|
|
988
|
+
if "ORA-28000" in text:
|
|
989
|
+
return (f"{head}\n"
|
|
990
|
+
f"The account {who} is locked. A DBA or superuser unlocks it:\n"
|
|
991
|
+
f" ALTER USER {who} ACCOUNT UNLOCK;\n"
|
|
992
|
+
"Then find out why, or it locks again — a run of wrong "
|
|
993
|
+
"passwords trips\nFAILED_LOGIN_ATTEMPTS:\n"
|
|
994
|
+
f" SELECT account_status, lock_date, profile FROM dba_users "
|
|
995
|
+
f"WHERE username = '{who}';")
|
|
996
|
+
if "ORA-28001" in text or "ORA-28002" in text:
|
|
997
|
+
return (f"{head}\n"
|
|
998
|
+
f"The password for {who} has expired. A DBA sets a new one:\n"
|
|
999
|
+
f" ALTER USER {who} IDENTIFIED BY \"<new password>\";\n"
|
|
1000
|
+
"Update it in connections.json in the same breath. To stop the "
|
|
1001
|
+
"clock for a\nservice account, put it on a profile with "
|
|
1002
|
+
"PASSWORD_LIFE_TIME UNLIMITED.")
|
|
1003
|
+
if "ORA-01017" in text:
|
|
1004
|
+
return (f"{head}\n"
|
|
1005
|
+
f"Wrong username or password for {who}. Check the entry in "
|
|
1006
|
+
"connections.json —\nand check it before retrying: repeated "
|
|
1007
|
+
"attempts trip FAILED_LOGIN_ATTEMPTS and\nlock the account, "
|
|
1008
|
+
"which needs a DBA to undo.")
|
|
1009
|
+
return (f"{head}\n"
|
|
974
1010
|
"Check host/port/service_name, the credentials, and that the database "
|
|
975
1011
|
"is reachable from here. Use --conn NAME to try a different entry.")
|
|
976
1012
|
|
|
@@ -2298,7 +2334,7 @@ def main(argv=None):
|
|
|
2298
2334
|
except (oracledb.Error, OSError) as e:
|
|
2299
2335
|
# OSError too: a DNS or socket failure arrives raw from the socket layer,
|
|
2300
2336
|
# not wrapped as an oracledb.Error.
|
|
2301
|
-
sys.exit(connect_failure_message(e, name))
|
|
2337
|
+
sys.exit(connect_failure_message(e, name, c.get("user")))
|
|
2302
2338
|
try:
|
|
2303
2339
|
if ns.command == "journal": # only restore reaches here
|
|
2304
2340
|
if not ns.id:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pythia-plsql
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.9
|
|
4
4
|
Summary: PL/SQL development for AI agents on Oracle Database - expert data-dictionary queries, impact analysis, and a snapshot-verified write path with honest rollback.
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/thaildhe172591/pythia
|
|
@@ -301,6 +301,32 @@ def test_json_envelope():
|
|
|
301
301
|
assert d["rows"] == [{"A": 1, "B": "2026-01-02"}]
|
|
302
302
|
|
|
303
303
|
|
|
304
|
+
def test_connect_failure_names_the_fix_for_common_oracle_errors():
|
|
305
|
+
"""Generic advice is useless for an error Oracle already diagnosed. The
|
|
306
|
+
three that actually strand people each have one specific next step."""
|
|
307
|
+
locked = pythia.connect_failure_message(
|
|
308
|
+
Exception("ORA-28000: The account is locked."), "dev", user="agent[owner]")
|
|
309
|
+
assert "ACCOUNT UNLOCK" in locked and "AGENT" in locked # the real account
|
|
310
|
+
assert "DBA" in locked or "superuser" in locked.lower()
|
|
311
|
+
|
|
312
|
+
expired = pythia.connect_failure_message(
|
|
313
|
+
Exception("ORA-28001: the password has expired"), "dev", user="agent")
|
|
314
|
+
assert "PASSWORD EXPIRE" in expired or "new password" in expired.lower()
|
|
315
|
+
|
|
316
|
+
wrong = pythia.connect_failure_message(
|
|
317
|
+
Exception("ORA-01017: invalid username/password"), "dev", user="agent")
|
|
318
|
+
assert "lock the account" in wrong.lower() # warn before they retry into one
|
|
319
|
+
|
|
320
|
+
plain = pythia.connect_failure_message(OSError("getaddrinfo failed"), "dev")
|
|
321
|
+
assert "ORA-" not in plain and "dev" in plain # unchanged for the rest
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
def test_oracle_account_taken_from_a_proxy_connect_string():
|
|
325
|
+
assert pythia.authenticating_account("agent[owner]") == "AGENT"
|
|
326
|
+
assert pythia.authenticating_account("plain_user") == "PLAIN_USER"
|
|
327
|
+
assert pythia.authenticating_account(None) is None
|
|
328
|
+
|
|
329
|
+
|
|
304
330
|
def main():
|
|
305
331
|
failed = 0
|
|
306
332
|
for name, fn in sorted(globals().items()):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/scripts/pythia_plsql.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pythia_plsql-0.4.8 → pythia_plsql-0.4.9}/skills/pythia-explore/reference/data-dictionary.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|