docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
74
docs/scripts/add-standard-headers.py
Normal file
74
docs/scripts/add-standard-headers.py
Normal file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Add standard doc header (Last Updated, Document Version, Status, ---) to docs missing it."""
|
||||
import os
|
||||
import sys
|
||||
|
||||
DOCS_DIR = os.path.join(os.path.dirname(__file__), "..")
|
||||
HEADER_BLOCK = """
|
||||
**Last Updated:** 2026-01-31
|
||||
**Document Version:** 1.0
|
||||
**Status:** Active Documentation
|
||||
|
||||
---
|
||||
"""
|
||||
|
||||
|
||||
def needs_header(path: str) -> bool:
|
||||
try:
|
||||
with open(path, "r", encoding="utf-8", errors="replace") as f:
|
||||
first = f.read(600)
|
||||
return "**Last Updated:**" not in first
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
def add_header(path: str) -> bool:
|
||||
try:
|
||||
with open(path, "r", encoding="utf-8", errors="replace") as f:
|
||||
lines = f.readlines()
|
||||
except Exception as e:
|
||||
print(f"Read error {path}: {e}", file=sys.stderr)
|
||||
return False
|
||||
if not lines:
|
||||
return False
|
||||
first_500 = "".join(lines[:25])[:500]
|
||||
if "**Last Updated:**" in first_500:
|
||||
return False
|
||||
# Insert after first line (title). Skip one leading --- in rest to avoid double.
|
||||
rest = lines[1:]
|
||||
while rest and rest[0].strip() == "":
|
||||
rest = rest[1:]
|
||||
if rest and rest[0].strip() == "---":
|
||||
rest = rest[1:]
|
||||
new_lines = [lines[0], "\n", "**Last Updated:** 2026-01-31 \n", "**Document Version:** 1.0 \n", "**Status:** Active Documentation\n", "\n", "---\n", "\n"] + rest
|
||||
try:
|
||||
with open(path, "w", encoding="utf-8", newline="\n") as f:
|
||||
f.writelines(new_lines)
|
||||
except Exception as e:
|
||||
print(f"Write error {path}: {e}", file=sys.stderr)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def main():
|
||||
count = 0
|
||||
for root, _dirs, files in os.walk(DOCS_DIR):
|
||||
if "archive" in root.split(os.sep):
|
||||
continue
|
||||
depth = root[len(DOCS_DIR) :].count(os.sep)
|
||||
if depth >= 3:
|
||||
continue
|
||||
for name in files:
|
||||
if not name.endswith(".md"):
|
||||
continue
|
||||
path = os.path.join(root, name)
|
||||
rel = os.path.relpath(path, DOCS_DIR)
|
||||
if needs_header(path) and add_header(path):
|
||||
count += 1
|
||||
print(rel)
|
||||
print(f"\nAdded header to {count} files.", file=sys.stderr)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
57
docs/scripts/add-status-line.py
Normal file
57
docs/scripts/add-status-line.py
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Add **Status:** Active Documentation to docs that have **Last Updated:** but no **Status:** in first 20 lines."""
|
||||
import re
|
||||
import sys
|
||||
|
||||
STATUS_LINE = "**Status:** Active Documentation\n"
|
||||
|
||||
|
||||
def add_status(path: str) -> bool:
|
||||
try:
|
||||
with open(path, "r", encoding="utf-8", errors="replace") as f:
|
||||
lines = f.readlines()
|
||||
except Exception as e:
|
||||
print(f"Read error {path}: {e}", file=sys.stderr)
|
||||
return False
|
||||
if not lines:
|
||||
return False
|
||||
first_20 = "".join(lines[:20])
|
||||
if "**Status:**" in first_20 or "Status:" in first_20:
|
||||
return False
|
||||
if "**Last Updated:**" not in first_20:
|
||||
return False
|
||||
# Find the line index of **Last Updated:** and insert Status after it (or after Document Version if present)
|
||||
insert_after = None
|
||||
for i, line in enumerate(lines[:20]):
|
||||
if "**Last Updated:**" in line:
|
||||
insert_after = i
|
||||
break
|
||||
if insert_after is None:
|
||||
return False
|
||||
# If next line is **Document Version:**, insert after that
|
||||
if insert_after + 1 < len(lines) and "**Document Version:**" in lines[insert_after + 1]:
|
||||
insert_after += 1
|
||||
# Insert Status line after insert_after
|
||||
new_lines = lines[: insert_after + 1] + [STATUS_LINE] + lines[insert_after + 1 :]
|
||||
try:
|
||||
with open(path, "w", encoding="utf-8", newline="\n") as f:
|
||||
f.writelines(new_lines)
|
||||
except Exception as e:
|
||||
print(f"Write error {path}: {e}", file=sys.stderr)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def main():
|
||||
paths = [p.strip() for p in sys.stdin if p.strip()]
|
||||
count = 0
|
||||
for path in paths:
|
||||
if add_status(path):
|
||||
count += 1
|
||||
print(path)
|
||||
print(f"Added Status to {count} files.", file=sys.stderr)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
28
docs/scripts/check-docs-crossrefs.sh
Executable file
28
docs/scripts/check-docs-crossrefs.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
# check-docs-crossrefs.sh - List docs that may be missing a "Related Documentation" section
|
||||
# Usage: run from repo root: ./docs/scripts/check-docs-crossrefs.sh
|
||||
# Optional: use output to add cross-references manually where appropriate.
|
||||
|
||||
set -e
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DOCS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
|
||||
echo "Checking docs for 'Related Documentation' section..."
|
||||
echo ""
|
||||
|
||||
missing=0
|
||||
while IFS= read -r -d '' f; do
|
||||
if ! grep -q "Related Documentation\|Related documentation\|## Related" "$f" 2>/dev/null; then
|
||||
rel="${f#$DOCS_DIR/}"
|
||||
echo " ${rel:-$f}"
|
||||
missing=$((missing + 1))
|
||||
fi
|
||||
done < <(find "$DOCS_DIR" -name "*.md" -not -path "*/node_modules/*" -print0 2>/dev/null | sort -z)
|
||||
|
||||
if [ "$missing" -eq 0 ]; then
|
||||
echo "All checked docs have a Related Documentation section (or similar)."
|
||||
else
|
||||
echo ""
|
||||
echo "Total: $missing doc(s) without a clear Related section. Add cross-refs where appropriate."
|
||||
fi
|
||||
exit 0
|
||||
20
docs/scripts/check-docs-links.sh
Executable file
20
docs/scripts/check-docs-links.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# check-docs-links.sh - Suggest running markdown-link-check or lychee to find broken links in docs/
|
||||
# Usage: run from repo root: ./docs/scripts/check-docs-links.sh
|
||||
# Install: npm install -g markdown-link-check (or: cargo install lychee)
|
||||
|
||||
set -e
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DOCS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
ROOT_DIR="$(cd "$DOCS_DIR/.." && pwd)"
|
||||
|
||||
echo "Docs directory: $DOCS_DIR"
|
||||
echo "Repo root: $ROOT_DIR"
|
||||
echo ""
|
||||
echo "To check links in docs/, run one of:"
|
||||
echo " (from repo root) npx markdown-link-check \"$DOCS_DIR/**/*.md\""
|
||||
echo " (from repo root) lychee \"$DOCS_DIR/**/*.md\" --base \"$ROOT_DIR\""
|
||||
echo ""
|
||||
echo "Broken refs report (if generated): $ROOT_DIR/reports/BROKEN_REFERENCES_REPORT.md"
|
||||
echo "Fix docs-internal and root links first; submodule links can be handled separately."
|
||||
exit 0
|
||||
46
docs/scripts/validate-doc-headers.sh
Executable file
46
docs/scripts/validate-doc-headers.sh
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
# validate-doc-headers.sh - Check that docs have standard headers (Last Updated, Document Version, Status, ---)
|
||||
# Usage: run from docs/ or repo root: ./docs/scripts/validate-doc-headers.sh [dir]
|
||||
# Exit: 0 if all checked files pass, 1 if any fail.
|
||||
# Optional: Document Version is warned only (not required for pass).
|
||||
|
||||
set -e
|
||||
DOCS_DIR="${1:-.}"
|
||||
if [[ "$DOCS_DIR" == . ]]; then
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DOCS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
fi
|
||||
FAIL=0
|
||||
WARN=0
|
||||
|
||||
while IFS= read -r -d '' f; do
|
||||
if ! head -20 "$f" | grep -q '\*\*Last Updated:\*\*'; then
|
||||
echo "Missing 'Last Updated:' in $f"
|
||||
FAIL=1
|
||||
fi
|
||||
if ! head -20 "$f" | grep -q '\*\*Status:\*\*'; then
|
||||
if ! head -20 "$f" | grep -q 'Status:'; then
|
||||
echo "Missing 'Status:' in $f"
|
||||
FAIL=1
|
||||
fi
|
||||
fi
|
||||
if ! head -25 "$f" | grep -q '^---$'; then
|
||||
echo "Missing '---' separator in first 25 lines of $f"
|
||||
FAIL=1
|
||||
fi
|
||||
if ! head -20 "$f" | grep -q '\*\*Document Version:\*\*'; then
|
||||
echo "Warning: Missing 'Document Version:' in $f"
|
||||
WARN=1
|
||||
fi
|
||||
done < <(find "$DOCS_DIR" -maxdepth 3 -name '*.md' -not -path '*/archive/*' -print0 2>/dev/null)
|
||||
|
||||
if [[ $FAIL -eq 1 ]]; then
|
||||
echo "One or more documents failed header validation."
|
||||
exit 1
|
||||
fi
|
||||
if [[ $WARN -eq 1 ]]; then
|
||||
echo "Header validation passed; some docs missing optional 'Document Version:'."
|
||||
else
|
||||
echo "Header validation passed for checked documents."
|
||||
fi
|
||||
exit 0
|
||||
Reference in New Issue
Block a user