Implement optional single-image intake, Signal ingestion, and multimodal vision analysis
- Add image intake service with format validation (JPEG, PNG, WebP) and EXIF/GPS stripping - Enforce strict single-image rule across Web and Signal attachment channels - Implement token-optimized vision downscaling and JPEG compression - Add IMAGE_CONTEXT pipeline stage with OmniRoute vision routing and resilient failover - Seed and manage versioned idea-image-interpreter prompt in catalog - Update Web UI with responsive image picker, preview chip, and Visual Context tab - Add comprehensive automated test suite in test_image_intake.py - Update README and Labyricorn devlog
This commit is contained in:
@@ -134,7 +134,8 @@ class OpenGistAdapter(BaseServiceAdapter):
|
||||
research_docs: Dict[str, str],
|
||||
outputs: Dict[str, str],
|
||||
provenance_runs: List[Dict[str, Any]],
|
||||
existing_gist_id: Optional[str] = None
|
||||
existing_gist_id: Optional[str] = None,
|
||||
submission_image: Optional[Dict[str, Any]] = None
|
||||
) -> Dict[str, Any]:
|
||||
"""Persists structured idea artifacts to local durable store and syncs with OpenGist."""
|
||||
# 1. Prepare local disk artifact tree
|
||||
@@ -147,13 +148,37 @@ class OpenGistAdapter(BaseServiceAdapter):
|
||||
# 2. Write idea.md
|
||||
cat_str = ", ".join(categories) if categories else "General"
|
||||
tag_str = ", ".join(f"#{t}" for t in tags) if tags else "None"
|
||||
|
||||
img_section = ""
|
||||
if submission_image and submission_image.get("present"):
|
||||
art_id = submission_image.get("artifact_id", "IMG-TS")
|
||||
mime = submission_image.get("mime_type", "image/jpeg")
|
||||
w = submission_image.get("width", 0)
|
||||
h = submission_image.get("height", 0)
|
||||
size_kb = round(submission_image.get("size_bytes", 0) / 1024, 1)
|
||||
sha = submission_image.get("sha256", "")
|
||||
img_section = (
|
||||
f"## Reference Image\n\n"
|
||||
f"- **Artifact ID:** `{art_id}`\n"
|
||||
f"- **MIME Type:** `{mime}`\n"
|
||||
f"- **Dimensions:** `{w}x{h}`\n"
|
||||
f"- **File Size:** `{size_kb} KB`\n"
|
||||
f"- **SHA-256:** `{sha}`\n\n"
|
||||
)
|
||||
|
||||
ctx_section = ""
|
||||
if "image-context.md" in research_docs:
|
||||
ctx_section = f"## Image Context\n\n{research_docs['image-context.md']}\n\n"
|
||||
|
||||
idea_md = (
|
||||
f"# {idea_id}: {title}\n\n"
|
||||
f"**Lifecycle State:** `{lifecycle_state}` \n"
|
||||
f"**Categories:** {cat_str} \n"
|
||||
f"**Tags:** {tag_str} \n\n"
|
||||
f"## Summary\n{summary}\n\n"
|
||||
f"## Original Submission\n> {original_text.strip()}\n"
|
||||
f"## Original Submission\n> {original_text.strip()}\n\n"
|
||||
f"{img_section}"
|
||||
f"{ctx_section}"
|
||||
)
|
||||
(idea_dir / "idea.md").write_text(idea_md, encoding="utf-8")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user