pythia-plsql 0.4.7__tar.gz → 0.4.8__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.
Files changed (39) hide show
  1. {pythia_plsql-0.4.7/scripts/pythia_plsql.egg-info → pythia_plsql-0.4.8}/PKG-INFO +1 -1
  2. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/pyproject.toml +1 -1
  3. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/scripts/pythia.py +51 -3
  4. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8/scripts/pythia_plsql.egg-info}/PKG-INFO +1 -1
  5. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/tests/test_install.py +30 -0
  6. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/LICENSE +0 -0
  7. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/README.md +0 -0
  8. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/queries/compile-errors.sql +0 -0
  9. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/queries/dependencies.sql +0 -0
  10. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/queries/impact.sql +0 -0
  11. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/queries/invalid-objects.sql +0 -0
  12. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/queries/name-occupants.sql +0 -0
  13. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/queries/object-source.sql +0 -0
  14. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/queries/plscope-enabled.sql +0 -0
  15. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/queries/plscope-statements.sql +0 -0
  16. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/queries/plscope-usages.sql +0 -0
  17. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/queries/session-privileges.sql +0 -0
  18. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/queries/similar-candidates.sql +0 -0
  19. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/queries/source.sql +0 -0
  20. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/scripts/pythia_plsql.egg-info/SOURCES.txt +0 -0
  21. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/scripts/pythia_plsql.egg-info/dependency_links.txt +0 -0
  22. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/scripts/pythia_plsql.egg-info/entry_points.txt +0 -0
  23. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/scripts/pythia_plsql.egg-info/requires.txt +0 -0
  24. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/scripts/pythia_plsql.egg-info/top_level.txt +0 -0
  25. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/setup.cfg +0 -0
  26. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/skills/pythia-apply/SKILL.md +0 -0
  27. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/skills/pythia-explore/SKILL.md +0 -0
  28. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/skills/pythia-explore/reference/data-dictionary.md +0 -0
  29. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/skills/pythia-impact/SKILL.md +0 -0
  30. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/skills/pythia-review/SKILL.md +0 -0
  31. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/skills/pythia-review/reference/antipatterns.md +0 -0
  32. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/skills/pythia-setup/SKILL.md +0 -0
  33. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/skills/pythia-skill-author/SKILL.md +0 -0
  34. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/skills/pythia-write/SKILL.md +0 -0
  35. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/skills/pythia-write/reference/patterns.md +0 -0
  36. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/tests/test_phase1.py +0 -0
  37. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/tests/test_phase2.py +0 -0
  38. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/tests/test_phase3.py +0 -0
  39. {pythia_plsql-0.4.7 → pythia_plsql-0.4.8}/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.7
3
+ Version: 0.4.8
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"
7
+ version = "0.4.8"
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" }
@@ -209,12 +209,43 @@ def offer_path_fix(scripts_dir, interactive, forced=False):
209
209
  print(f"Could not update your PATH: {e}")
210
210
  return False
211
211
  print(NL + f" {'Added' if changed else 'Already in'} your user PATH: {scripts_dir}")
212
+ warn = path_length_warning(os.environ.get("PATH", ""))
213
+ if warn:
214
+ print(" " + warn)
212
215
  print(" Open a NEW terminal for it to take effect — an already-running")
213
216
  print(" one keeps the environment it started with, and so do its tabs.")
214
217
  print(f" Until then: {pathlib.Path(sys.executable).stem} -m pythia <command>")
215
218
  return True
216
219
 
217
220
 
221
+ def path_length_warning(combined):
222
+ """Windows tooling still truncates PATH around 2047 characters, and a
223
+ freshly appended entry sits last -- so it is the first thing lost, and it
224
+ is lost silently. The usual cause is a PATH that had the system entries
225
+ copied into the user's."""
226
+ n = len(combined or "")
227
+ if n < 1900:
228
+ return None
229
+ return (f"Your PATH is {n} characters; Windows truncates near 2047, and the "
230
+ "entry just added is last in line.\n"
231
+ " The usual cause is duplicate entries — the system PATH copied "
232
+ "into the user PATH by\n"
233
+ " a `$env:PATH` one-liner. Compare the two scopes and remove what "
234
+ "appears in both.")
235
+
236
+
237
+ def stored_path_has(directory):
238
+ """Is the directory in the PATH as *stored*, rather than the one this
239
+ process inherited? The two differ for every terminal opened before the
240
+ last change, which is the common confusion."""
241
+ if not directory or os.name != "nt":
242
+ return False
243
+ try:
244
+ return path_contains(_read_user_path(), directory)
245
+ except OSError:
246
+ return False
247
+
248
+
218
249
  def path_contains(path_value, directory):
219
250
  """Is this directory already listed in a PATH string? Compared the way
220
251
  the platform does: case-insensitively on Windows, ignoring trailing
@@ -280,7 +311,7 @@ def installed_scripts_dir():
280
311
  return candidates[-1] if candidates else None
281
312
 
282
313
 
283
- def entry_point_hint(found, scripts_dir):
314
+ def entry_point_hint(found, scripts_dir, in_stored_path=False):
284
315
  """What to say when `pythia` will not resolve as a command. pip installs
285
316
  the executable into a scripts directory that is often not on PATH — the
286
317
  default for `pip install --user` on Windows — and the shell's
@@ -288,6 +319,21 @@ def entry_point_hint(found, scripts_dir):
288
319
  step immediately after the install the docs tell you to run."""
289
320
  if found:
290
321
  return None
322
+ if in_stored_path:
323
+ # The directory is in the stored PATH but not in this process: the
324
+ # terminal started before the change. Sending someone to re-run the
325
+ # install here wastes their time -- it already worked.
326
+ return (NL.join([
327
+ "`pythia` is already on your PATH — this terminal just started "
328
+ "before that was true.",
329
+ " Open a NEW terminal WINDOW. A new tab is not enough: tabs "
330
+ "inherit the",
331
+ " environment of the window that spawned them, so if you use "
332
+ "Windows Terminal,",
333
+ " VS Code or Cursor, restart the application itself.",
334
+ " In this one, keep using: "
335
+ + pathlib.Path(sys.executable).stem + " -m pythia <command>",
336
+ ]))
291
337
  out = ["`pythia` is installed but not on your PATH."]
292
338
  if scripts_dir:
293
339
  out.append(" It lives in: " + str(scripts_dir))
@@ -2055,11 +2101,13 @@ def cmd_install(conn, schema, ns):
2055
2101
  clean_legacy_skills(ns.project_root)
2056
2102
  print(f"\nNext: fill in {path}")
2057
2103
  print(f"Then: {invocation()} check")
2058
- hint = entry_point_hint(shutil.which("pythia"), installed_scripts_dir())
2104
+ scripts_dir = installed_scripts_dir()
2105
+ hint = entry_point_hint(shutil.which("pythia"), scripts_dir,
2106
+ in_stored_path=stored_path_has(scripts_dir))
2059
2107
  if hint:
2060
2108
  print()
2061
2109
  print(hint)
2062
- offer_path_fix(installed_scripts_dir(), interactive,
2110
+ offer_path_fix(scripts_dir, interactive,
2063
2111
  getattr(ns, "add_to_path", False))
2064
2112
 
2065
2113
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pythia-plsql
3
- Version: 0.4.7
3
+ Version: 0.4.8
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
@@ -295,6 +295,36 @@ def test_add_to_user_path_handles_an_empty_and_untidy_value():
295
295
  assert written == [USERBIN + os.pathsep + SCRIPTS] # no doubled separator
296
296
 
297
297
 
298
+ def test_hint_tells_a_stale_shell_apart_from_an_unconfigured_one():
299
+ """The directory being in the stored PATH while the running process
300
+ cannot see it means one thing only: this terminal started earlier. Saying
301
+ "not on your PATH" there sends people to re-run an install that already
302
+ worked -- which is exactly what happened in the field."""
303
+ stale = pythia.entry_point_hint(found=None, scripts_dir=SCRIPTS,
304
+ in_stored_path=True)
305
+ assert "already" in stale.lower()
306
+ assert "new" in stale.lower() and "tab" in stale.lower() # window, not tab
307
+ assert "--add-to-path" not in stale # nothing to redo
308
+ unconfigured = pythia.entry_point_hint(found=None, scripts_dir=SCRIPTS,
309
+ in_stored_path=False)
310
+ assert SCRIPTS in unconfigured and "-m pythia" in unconfigured
311
+ # how you fix it is platform-specific: pythia can edit the registry on
312
+ # Windows, while a POSIX shell profile is the developer's to edit
313
+ assert ("--add-to-path" if os.name == "nt" else "profile") in unconfigured
314
+ # and once the command resolves, still silence
315
+ assert pythia.entry_point_hint(found="/x/pythia", scripts_dir=SCRIPTS,
316
+ in_stored_path=True) is None
317
+
318
+
319
+ def test_long_path_is_flagged_before_it_silently_truncates():
320
+ """Windows tooling still truncates PATH near 2047 characters, and the
321
+ entry we just appended is the last one -- the first to be lost."""
322
+ assert pythia.path_length_warning("x" * 1000) is None
323
+ w = pythia.path_length_warning("x" * 2040)
324
+ assert w is not None and "2047" in w
325
+ assert "duplicate" in w.lower() # names the usual cause
326
+
327
+
298
328
  def main():
299
329
  failed = 0
300
330
  for name, fn in sorted(globals().items()):
File without changes
File without changes
File without changes