diff --git a/plugins/axiomcode/hooks/changes.py b/plugins/axiomcode/hooks/changes.py index 4396f549..33a5dd40 100644 --- a/plugins/axiomcode/hooks/changes.py +++ b/plugins/axiomcode/hooks/changes.py @@ -34,7 +34,7 @@ def rel_of(fp): fp = str(fp) for a, b in ((fp, cwd), (os.path.realpath(fp), os.path.realpath(cwd)), (os.path.realpath(fp), cwd), (fp, os.path.realpath(cwd))): r = os.path.relpath(a, b) - if not r.startswith('..'): return r + if not r.startswith('..'): return r.replace(os.sep, '/') # the index stores '/' on every platform return fp def changed(args, timeout=12): diff --git a/plugins/axiomcode/hooks/enrich.py b/plugins/axiomcode/hooks/enrich.py index 16cb1c26..94ffe51d 100755 --- a/plugins/axiomcode/hooks/enrich.py +++ b/plugins/axiomcode/hooks/enrich.py @@ -22,7 +22,7 @@ def rel_of(fp): fp = str(fp) for a, b in ((fp, cwd), (os.path.realpath(fp), os.path.realpath(cwd)), (os.path.realpath(fp), cwd), (fp, os.path.realpath(cwd))): r = os.path.relpath(a, b) - if not r.startswith('..'): return r + if not r.startswith('..'): return r.replace(os.sep, '/') # the index stores '/' on every platform return fp db = os.path.join(cwd, '.axiomcode', 'out', 'graph.sqlite') if not os.path.exists(db): sys.exit(0) diff --git a/plugins/axiomcode/hooks/validate.py b/plugins/axiomcode/hooks/validate.py index 5c3099f6..8b10e117 100644 --- a/plugins/axiomcode/hooks/validate.py +++ b/plugins/axiomcode/hooks/validate.py @@ -243,7 +243,7 @@ def main(argv): if not e.get('text') or 'input' not in e: continue inp = e['input'] if e.get('as') == 'Read' and inp.get('file_path'): - rel = os.path.relpath(os.path.realpath(inp['file_path']), V_.repo); a0 = int(inp.get('offset') or 1); V_.check_read(e['text'], rel, a0, a0 + int(inp.get('limit') or 100000)) + rel = os.path.relpath(os.path.realpath(inp['file_path']), V_.repo).replace(os.sep, '/'); a0 = int(inp.get('offset') or 1); V_.check_read(e['text'], rel, a0, a0 + int(inp.get('limit') or 100000)) elif e.get('as') == 'Grep' and inp.get('pattern'): V_.check_grep(e['text'], re.sub(r'\W.*', '', inp['pattern'])) else: files = [r[0] for r in V_.q("SELECT DISTINCT file FROM symbols WHERE method_id IS NOT NULL AND kind <> 'module' AND is_test = 0")] diff --git a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-changed b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-changed index 69f49a66..cfd5a4f2 100755 --- a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-changed +++ b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-changed @@ -117,7 +117,7 @@ class Changed: def rel(self, f): f = os.path.realpath(f) if os.path.exists(f) else f r = os.path.relpath(f, self.repo) if os.path.isabs(f) else f - return r + return r.replace(os.sep, '/') # ── the two texts of a file ──────────────────────────────────────────────────────────────────────────────── def texts(self, rel, mode, rng): if mode == 'range': diff --git a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-context b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-context index 4fd8d26c..5da02430 100755 --- a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-context +++ b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-context @@ -386,7 +386,7 @@ def main(argv): elif a == '--seeds' and i + 1 < len(argv): seeds_wanted = int(argv[i + 1]); i += 2 # --in is REPEATABLE and takes a comma-separated list: a change that spans two roots has to be # askable in one call (#1029). They are combined, never intersected. - elif a == '--in' and i + 1 < len(argv): scopes += [x.strip() for x in argv[i + 1].split(',') if x.strip()]; i += 2 + elif a == '--in' and i + 1 < len(argv): scopes += [x.strip().replace('\\', '/') for x in argv[i + 1].split(',') if x.strip()]; i += 2 # the index stores '/'; a Windows user may type a backslash elif a == '--in-offered': scope_offered = True; i += 1 elif a == '--source': show_source = True; i += 1 elif a == '--json': as_json = True; i += 1 diff --git a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-graph b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-graph index 06affc8d..bd414596 100755 --- a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-graph +++ b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-graph @@ -46,7 +46,7 @@ def export(repo, page=None): def rel(p): a = p if os.path.isabs(p) else os.path.join(src, p) a = os.path.realpath(a) if os.path.exists(a) else os.path.normpath(a) - r = os.path.relpath(a, repo); return p.lstrip('/') if r.startswith('..') else r + r = os.path.relpath(a, repo).replace(os.sep, '/'); return p.lstrip('/') if r.startswith('..') else r # ── declarations: types and methods, with the display names the query skill uses when the index is there ── nodes = {} diff --git a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-impact b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-impact index c98a9ba8..70d732bc 100755 --- a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-impact +++ b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-impact @@ -619,7 +619,7 @@ class Impact: with open(fp, 'rb') as fh: head = fh.read(2048) if b'\0' in head: continue except OSError: continue - out.append(os.path.relpath(fp, self.g.repo)) + out.append(os.path.relpath(fp, self.g.repo).replace(os.sep, '/')) if len(out) > 4000: break self._nsf = sorted(out); return self._nsf def nonsource_hits(self, names): @@ -1389,7 +1389,7 @@ def main(argv): i = args.index(flag); v = conv(args[i + 1]); del args[i:i + 2] if flag == '--depth': depth = v elif flag == '--limit': limit = v - elif flag == '--in': IN = v + elif flag == '--in': IN = v.replace('\\', '/') # the index stores '/'; a Windows user may type a backslash else: kind = v repo = '.' if args and os.path.isdir(args[-1]) and (len(args) > 1 or from_text is not None or want_warm): repo = args.pop() diff --git a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-index b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-index index 073b0d16..14817e42 100755 --- a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-index +++ b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-index @@ -45,7 +45,7 @@ def rel(p): if not p: return p a = p if os.path.isabs(p) else os.path.join(SRC, p) a = os.path.realpath(a) if os.path.exists(a) else os.path.normpath(a) - r = os.path.relpath(a, REPO) + r = os.path.relpath(a, REPO).replace(os.sep, '/') # '/' on every platform: every reader splits on it return p.lstrip('/') if r.startswith('..') else r # never DEGRADE: an index built from the IR must not be rebuilt without it (the intermediates are routinely cleaned # to save disk). If only newer tables are missing, add them empty and keep everything else. diff --git a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-path b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-path index 976d9ed6..0b434fec 100755 --- a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-path +++ b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-path @@ -462,7 +462,7 @@ class G: if self.has('paths'): r = self.q("SELECT rel FROM paths WHERE raw = ?", raw) if r: return r[0]['rel'] - return os.path.relpath(raw, self.repo) if os.path.isabs(raw) and raw.startswith(self.repo) else raw + return os.path.relpath(raw, self.repo).replace(os.sep, '/') if os.path.isabs(raw) and raw.startswith(self.repo) else raw # ── facts: exported once per graph, reused while graph.sqlite is unchanged ─────────────────────────────── def export(self): @@ -1065,7 +1065,7 @@ if __name__ == '__main__': limit = 10; IN = None; every = '--every' in args; args = [a for a in args if a != '--every']; max_paths = 20 if '--paths' in args: i = args.index('--paths'); max_paths = int(args[i + 1]); every = True; del args[i:i + 2] if '--limit' in args: i = args.index('--limit'); limit = int(args[i + 1]); del args[i:i + 2] - if '--in' in args: i = args.index('--in'); IN = args[i + 1]; del args[i:i + 2] + if '--in' in args: i = args.index('--in'); IN = args[i + 1].replace('\\', '/'); del args[i:i + 2] if len(args) < 2: die("usage: axiomcode path [] [--all] [--limit N] [--in ]") if args[0] == '*' and args[1] == '*': die("one endpoint must be named: path '*' X (everything that reaches X) or path X '*' (everything X reaches)") diff --git a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-test-impact b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-test-impact index 44780f02..c1bcb374 100755 --- a/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-test-impact +++ b/plugins/axiomcode/skills/axiomcode/scripts/axiomcode-test-impact @@ -176,7 +176,7 @@ def package_tier(repo, changed_files, limit=6000): dirs[:] = [d for d in dirs if d not in ('node_modules', '.git', 'dist', 'build', 'target', '.axiomcode')] for f in fs: if not f.endswith(('.ts', '.tsx', '.js', '.mjs', '.java', '.py', '.cs')): continue # a list that omits an extension makes both tiers below silently inert for that language (#1083's shape) - rel = os.path.relpath(os.path.join(root, f), repo) + rel = os.path.relpath(os.path.join(root, f), repo).replace(os.sep, '/') if not TESTY.search(rel): continue seen += 1 if seen > limit: return dict(by_pkg), {'files': sorted(by_name)}, pkgs