scripts/debug_note_payload.py hinzugefügt
Some checks failed
Deploy mindnet to llm-node / deploy (push) Failing after 2s
Some checks failed
Deploy mindnet to llm-node / deploy (push) Failing after 2s
This commit is contained in:
parent
791cda23af
commit
13e50d4695
41
scripts/debug_note_payload.py
Normal file
41
scripts/debug_note_payload.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
scripts/debug_note_payload.py
|
||||
Zeigt, welche app.core.note_payload geladen wird, ruft make_note_payload auf
|
||||
und druckt Typ/Preview der Rückgabe.
|
||||
|
||||
Aufruf:
|
||||
python3 -m scripts.debug_note_payload --file ./test_vault/40_concepts/concept-alpha.md --vault-root ./test_vault
|
||||
"""
|
||||
import argparse, json, os, pprint
|
||||
from app.core import note_payload as np
|
||||
from app.core.parser import read_markdown
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("--file", required=True)
|
||||
ap.add_argument("--vault-root", default=None)
|
||||
ap.add_argument("--hash-mode", default=None)
|
||||
ap.add_argument("--hash-normalize", default=None)
|
||||
ap.add_argument("--hash-source", default=None)
|
||||
args = ap.parse_args()
|
||||
|
||||
print("module_path:", getattr(np, "__file__", "<unknown>"))
|
||||
parsed = read_markdown(args.file)
|
||||
res = np.make_note_payload(parsed, vault_root=args.vault_root,
|
||||
hash_mode=args.hash_mode,
|
||||
hash_normalize=args.hash_normalize,
|
||||
hash_source=args.hash_source,
|
||||
file_path=args.file)
|
||||
print("return_type:", type(res).__name__)
|
||||
if isinstance(res, dict):
|
||||
print("keys:", list(res.keys()))
|
||||
print(json.dumps(res, ensure_ascii=False, indent=2))
|
||||
else:
|
||||
preview = repr(res)
|
||||
if len(preview) > 600: preview = preview[:600] + "…"
|
||||
print("preview:", preview)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Reference in New Issue
Block a user