diff --git a/docs/assemble.py b/docs/assemble.py new file mode 100644 index 0000000..674d7d5 --- /dev/null +++ b/docs/assemble.py @@ -0,0 +1,30 @@ + +import os +import re + +DOCS_DIR = "/home/e/Desktop/ai-llm-red-team-handbook/docs" +OUTPUT_FILE = "/home/e/.gemini/antigravity/brain/37362efb-057b-43bb-bd3e-a5f4bc7d3761/artifacts/AI_LLM_Red_Team_Handbook_Full.md" + +# Order defined in SUMMARY.md usually, but we can infer from filenames +files = sorted([f for f in os.listdir(DOCS_DIR) if f.startswith("Chapter_") and f.endswith(".md")]) + +# Move 17_01...17_06 to correct position +# The simple sort might put 17_01 after 17? No, 17 does not exist as standalone file. +# 17_01 vs 18 -> 17 comes before 18. +# 01...09...10... so simple string sort works because of leading zeros. + +print(f"[*] Assembling {len(files)} chapters...") + +full_content = "# AI Red Team Handbook\n\n_Generated for Pre-Release Review_\n\n---\n\n" + +for filename in files: + path = os.path.join(DOCS_DIR, filename) + with open(path, 'r', encoding='utf-8') as f: + content = f.read() + # Add a page break or separator + full_content += f"\n\n\n\n" + content + "\n\n---\n" + +with open(OUTPUT_FILE, 'w', encoding='utf-8') as f: + f.write(full_content) + +print(f"[+] Written full handbook to {OUTPUT_FILE} ({len(full_content)} bytes)") diff --git a/docs/typo_check.py b/docs/typo_check.py new file mode 100644 index 0000000..9591cee --- /dev/null +++ b/docs/typo_check.py @@ -0,0 +1,34 @@ + +import re + +TARGET_FILE = "/home/e/.gemini/antigravity/brain/37362efb-057b-43bb-bd3e-a5f4bc7d3761/artifacts/AI_LLM_Red_Team_Handbook_Full.md" + +COMMON_TYPOS = { + "teh": "the", + "recieve": "receive", + "seperate": "separate", + "occured": "occurred", + "accomodate": "accommodate", + "definately": "definitely", + "modle": "model", + "languge": "language", + "inteligence": "intelligence", + "vunerability": "vulnerability" +} + +with open(TARGET_FILE, 'r') as f: + content = f.read() + +found = [] +for typo, correction in COMMON_TYPOS.items(): + # insensitive search + matches = re.findall(r'\b' + typo + r'\b', content, re.IGNORECASE) + if matches: + found.append(f"Found '{typo}' (should be '{correction}') {len(matches)} times.") + +if not found: + print("[+] No common typos found!") +else: + print(f"[-] Found typos:") + for msg in found: + print(msg)