今日已更新 158 条资讯 | 累计 37407 条内容
关于我们

标签:#Python

找到 1117 篇相关文章

AI 资讯

mcp-drift-monitor: detección continua de cambios no autorizados en servidores MCP

mcp-drift-monitor detecta cambios no autorizados en servidores MCP (Model Context Protocol). Implementa el control primario faltante descrito en arXiv:2608.00997 : un barrido completo periódico del catálogo que re-descarga todos los servidores y recomputa hashes. Problema arXiv:2608.00997 ( MCP Registry Drift: A 88.6-Day Measurement of 19,099 Servers ) reporta un punto ciego crítico: los enfoques tradicionales de detección de cambios fallan en identificar dos modos de fallo: Cambios silenciosos — un servidor cuyo hash de descripción cambia, pero el monitor ya lo conocía y lo rankinga por historial pasado. Nuevas adiciones — servidores que aparecen en el registro sin que el monitor tenga registro previo. El paper mide 15,845 eventos de cambio, 19,877 adiciones y 911 eliminaciones, pero los modelos que rankean por historial previo pierden una fracción significativa de estos eventos. Este monitor cierra esa brecha con el control primario que el paper propone pero no implementa: un full-catalog sweep periódico. Solución mcp-drift-monitor implementa un motor de diferencias único ( compute_events ) que sirve tanto para polling incremental como para barridos completos. No hay lógica duplicada. Cada vez que un hash de descripción cambia, el motor revalida el contenido ( len(drifts) > 0 es el único disparador). Si el registro responde 429, aplica backoff con Retry-After . Si el payload está malformado, lanza SchemaDriftError y registra el payload ofensor a nivel ERROR. Arquitectura core/ diff.py — CatalogEntry, DriftEvent, NewArrivalEvent, RemovalEvent, compute_events hasher.py — normalize_description (NFC), hash_description state.py — StateStore (sqlite), FetchStatus, removed flag, get_all_hashes poller.py — Poller.fetch_catalog, PollConfig, SchemaDriftError, backoff sweep.py — run_sweep (control primario), SweepReport calibrate.py — replay (FR-6), ReplayReport, external validity vs panel Resultados de calibración El monitor se calibró y verificó contra el panel real del pa

2026-08-23 原文 →
AI 资讯

Beyond Words: Building an AI Mental Health Monitor with HuBERT and Psycho-Acoustics

We often focus on what someone says, but in the realm of clinical psychology, how they say it is often more revealing. Subtle changes in speech—a slight tremor (jitter), a slowing tempo, or a flattened pitch—can be early indicators of depression or anxiety long before a user explicitly voices their distress. In this tutorial, we are building Psycho-Acoustic , a high-performance monitoring tool that leverages the HuBERT model , HuggingFace Transformers , and Librosa to quantify emotional states from non-verbal acoustic features. Whether you're interested in speech sentiment analysis , mental health AI , or advanced audio processing , this guide covers the end-to-face-mic implementation. The Architecture of Sound 🏗️ To accurately detect mental health indicators, we can't just look at text. We need a multimodal approach that combines raw signal processing with deep learning representations. graph TD A[Raw Audio Input .wav] --> B[Librosa Preprocessing] B --> C{Feature Extraction} C --> D[Traditional Features: Jitter, Shimmer, Pitch] C --> E[Deep Learning: HuBERT Embeddings] D --> F[Feature Fusion Layer] E --> F F --> G[Classification Head: Anxiety/Depression/Neutral] G --> H[Quantified Mental Health Score] H --> I[Deployment via ONNX Runtime] Prerequisites To follow this advanced guide, you’ll need: Python 3.9+ Tech Stack : transformers , librosa , torch , onnxruntime A basic understanding of digital signal processing (DSP). Step 1: Extracting Non-Verbal Acoustic Features 🌊 Before hitting the neural network, we need to extract "Psycho-Acoustic" features. Depression is often characterized by "speech prosody" changes—specifically reduced pitch range and slower speaking rates. import librosa import numpy as np def extract_prosodic_features ( audio_path ): y , sr = librosa . load ( audio_path , sr = 16000 ) # 1. Fundamental Frequency (F0) - Pitch f0 , voiced_flag , voiced_probs = librosa . pyin ( y , fmin = librosa . note_to_hz ( ' C2 ' ), fmax = librosa . note_to_hz ( ' C7

2026-08-23 原文 →
开发者

Hello Everyone

Hello everyone, I am new to coding just begun to learn the ins and outs of coding and what it can do. I am in the process of getting my Full Stack Developer certificates. I have always wanted to do something that has to do with computers because I needed something to pass the time when I hurt myself playing football. I am looking forward to chatting with all of you about the struggles you had and what you found that you liked within the development realm.

2026-08-23 原文 →
AI 资讯

RAG explicado: cómo darle a un LLM tu propia información

Un modelo de lenguaje sabe mucho del mundo, pero no sabe nada de tu empresa : tus manuales, tus políticas, tus productos. Y si le preguntas por algo que no sabe, puede inventar una respuesta que suena convincente. RAG (Retrieval-Augmented Generation) resuelve las dos cosas. La idea En lugar de esperar que el modelo "se sepa" tu información, se la das en el momento de la pregunta : Indexas tus documentos: los divides en fragmentos y los conviertes en embeddings (vectores numéricos que capturan el significado). Cuando llega una pregunta, buscas los fragmentos más parecidos a esa pregunta. Le pasas al LLM la pregunta junto con esos fragmentos y le pides que responda usándolos. El modelo ya no adivina: responde a partir de un contexto real que tú controlas. Y puedes pedirle que cite de dónde salió cada dato. El patrón en Python # 1. Indexado (una vez): fragmentos -> embeddings -> base vectorial # (con librerías como sentence-transformers + FAISS, o un servicio gestionado) # 2. En cada pregunta: recuperar los fragmentos relevantes fragmentos = base_vectorial . buscar ( pregunta , k = 4 ) contexto = " \n\n " . join ( fragmentos ) # 3. Generar la respuesta con el contexto from anthropic import Anthropic client = Anthropic () resp = client . messages . create ( model = " claude-opus-4-8 " , max_tokens = 1024 , system = " Responde SOLO con la información del contexto. Si no está, dilo. " , messages = [{ " role " : " user " , " content " : f " Contexto: \n { contexto } \n\n Pregunta: { pregunta } " , }], ) print ( resp . content [ 0 ]. text ) Fíjate en la instrucción del system : pedirle que responda solo con el contexto y que admita cuando no sabe es lo que reduce drásticamente las alucinaciones. ¿Para qué sirve? Asistentes de soporte que responden con tu documentación real. Búsqueda interna en lenguaje natural sobre tus manuales o wikis. Onboarding : un chatbot que conoce tus procesos. Detalles que marcan la diferencia Cómo divides los documentos (chunking) afecta mucho a l

2026-08-23 原文 →
开源项目

🔥 shy3130 / tickflow-stock-panel - TSP自托管、零运维的 A 股「选股 + 监控 + 回测」量化工作台 | 基于 TickFlow 数据源 | LLM能力

GitHub热门项目 | TSP自托管、零运维的 A 股「选股 + 监控 + 回测」量化工作台 | 基于 TickFlow 数据源 | LLM能力驱使策略定制+个股分析+复盘 | 自由接入第三方数据源与个性化扩展数据 | 个人开源 ,非TickFlow官方项目 | Stars: 3,448 | 90 stars today | 语言: Python

2026-08-23 原文 →
AI 资讯

Free AI Tokens Are a Trap: An Opinionated Cost Gate for Model Experiments

Free AI tokens are a trap, and teams that treat a free quota as genuinely free pay later in migration and rework. A free allowance only helps when paired with a hard kill switch that stops an experiment the moment it exceeds a budget you chose in advance. This article argues that position, then shows a small gated client that makes free model access and a free server actually safe to use. The concrete example is MonkeyCode's free tier, but the gate works against any OpenAI-compatible endpoint. The trap nobody budgets for Every new model release resets the same argument: the price per token is low, so the cost of trying it must be low too. That reasoning ignores the expensive parts of an experiment, which are the integration, the evaluation, and the cleanup, not the inference itself. A free quota hides those costs behind a zero on the invoice, so teams skip the measurement step and discover the real price only when they migrate. The failure modes repeat across teams: Unbounded loops. A batch job that retries on rate limits can burn a week of free quota in an afternoon, and nobody notices until the allowance is gone. Silent lock-in. Code written against one provider's streaming quirks works fine for a prototype, then becomes a rewrite when the free tier disappears or changes. Shared-budget collisions. One teammate's runaway script consumes the allowance that three other people planned to use, which turns a technical problem into a political one. None of these are solved by choosing a cheaper model. They are solved by treating the free allowance as a finite resource with an explicit ceiling. The gate, not the gift, is the product The fix is a gated client that wraps any OpenAI-compatible chat endpoint with a token budget, a timeout, and an abort path. It is deliberately small, because a cost gate that requires its own deployment will not get used. # cost_gate.py — a hard ceiling for cheap experiments. # Usage: # export LLM_BASE_URL="https://your-endpoint.example/v1" #

2026-08-22 原文 →
AI 资讯

Fixing a pgvector CI mismatch in a FastAPI RAG backend

This is a submission for DEV's Summer Bug Smash: Clear the Lineup , powered by Sentry . Project Overview mini-agent is a public FastAPI backend for an AI support-agent demo. Its test suite covers API behavior, authentication, rate limiting, approval flows, and PostgreSQL/pgvector-backed retrieval. The GitHub Actions workflow starts PostgreSQL and Redis service containers before running the Python test suite. The application database initialization also executes: CREATE EXTENSION IF NOT EXISTS vector The dependency is also visible in the DocumentChunk.embedding column, which uses pgvector's Vector type. That made the database image part of the test contract, not just incidental infrastructure. Bug Fix or Performance Improvement On August 12, 2026, the CI run for the preceding commit reached the test step and failed: Failed workflow run Commit tested by that run The workflow was using the general-purpose postgres:17-alpine service image, while the application required the pgvector extension during database initialization. The test environment therefore did not match the database capability required by the code. The failure was specific enough to avoid a broad rewrite: the container initialized successfully, dependency installation passed, and the workflow stopped only at Run tests . That pointed to the application/database boundary rather than the GitHub Actions runner or Python installation. The fix changed one line: services: postgres: - image: postgres:17-alpine + image: pgvector/pgvector:0.8.6-pg17 Full change: Use pgvector image in CI The PostgreSQL major version, credentials, port mapping, health check, application environment, dependency installation, and test command all remained unchanged. This kept the patch narrow and made the CI database expose the same required extension as the application. Code The evidence is a direct before-and-after pair: The preceding workflow failed at Run tests . The one-line database-image commit triggered a new workflow. The new

2026-08-22 原文 →
AI 资讯

Token Budget Alarm on a Free Server

A free model quota is a budget, not a gift. You should treat it like one if you plan to build anything on top of it. I learned this the hard way when my prototype stopped responding in the middle of a demo. I had silently burned through the monthly allowance, and the provider cut me off without warning. This article shows how I built a small token budget alarm on a free server. It watches a free model's usage and warns me before the quota runs out. Most developers track their cloud spend religiously but ignore the token consumption of free models. The free tier feels like a gift, so we assume it will last forever. Then the provider cuts us off at the worst moment, and we scramble to find the cause. A token budget alarm removes that uncertainty by measuring your actual burn rate. It projects the exhaustion date and alerts you before you hit the wall. The design is deliberately small: a reverse proxy sits in front of the model endpoint. It records the token usage from every response and stores it in a local database. A background thread then computes the average consumption over a sliding window. It compares that rate against the remaining allowance and fires a webhook when the projection looks dangerous. You can run this entire stack on a free server, which is exactly what I did with MonkeyCode's free server option. Disclosure: This article was prepared as part of MonkeyCode's product outreach. The proxy itself is a tiny Flask application that forwards requests to the model. It extracts the usage field from each response and records the token count. If your provider does not return a usage object, you can estimate the token count with a simple heuristic. Dividing the character count by four is a rough but workable approximation. The important part is that every request is accounted for, because a single long prompt can consume more than a hundred small ones. from flask import Flask , request , Response import requests import sqlite3 import time app = Flask ( __name__

2026-08-22 原文 →
开发者

Empecé este bot por desconfianza, no por avaricia.

Diario de un bot que opera con dinero real — Entrada #0: el origen Todo empezó con un tuit. Uno de esos que seguramente también has visto: una captura de una wallet, "$100 convertidos en $10.000 en 24 horas con este bot de trading", flechas verdes, emojis de cohetes, y un "sígueme para más". Debajo, cientos de likes y gente pidiendo el enlace. Mi primera reacción no fue "quiero eso". Fue "eso es mentira". Y no hace falta ser matemático para verlo. Un retorno del 10.000% en un día no es una estrategia — es un billete de lotería premiado que alguien presenta como si fuera un método repetible. Si de verdad tuvieras un sistema que multiplica tu dinero por cien cada 24 horas, no lo estarías publicando en X pidiendo likes. Lo estarías usando en silencio hasta comprar una isla. El que regala el mapa del tesoro es porque el tesoro no existe — el verdadero producto que se vende en esos tuits no es el bot: eres tú, tu like, tu follow, tu atención. Así que no le di like. Pero me quedé pensando. La pregunta que sí valía la pena Descartado el humo, quedaba una pregunta honesta debajo: despojado de la mentira del 10.000%, ¿hay algo real ahí? Porque los bots de trading existen. La automatización de estrategias es legítima. Los mercados operan 24/7 y un programa no duerme ni entra en pánico. La idea de fondo —dejar que un sistema ejecute una estrategia con disciplina, sin la emoción que arruina las decisiones humanas— no es una estafa. La estafa es el número. La estafa es prometer un retorno imposible para vender seguidores. Entonces me hice la pregunta que inició todo esto: ¿qué pasa si alguien escéptico construye un bot de trading de verdad, con expectativas sobrias, y documenta la verdad completa — incluida la parte donde todavía no sabe si funciona? Esa es la serie que estás empezando a leer. Lo que es, y lo que no es Para que no haya malentendidos, porque tú y yo ya sabemos cómo suele terminar este tipo de contenido: Esto no es un tutorial de "hazte rico". No voy a mostrarte u

2026-08-22 原文 →
AI 资讯

Pydantic AI keeps one growing message list per run — and re-sends the whole thing every step

Pydantic AI gives you a clean, typed agent: define an Agent , hand it tools, call agent.run(...) , and it loops — model call, tool call, model call — until it produces a validated result. The typed ergonomics are great. What the quickstart doesn't spell out is what the model receives on each pass of that loop. I read the run graph ( pydantic_ai_slim/pydantic_ai/_agent_graph.py on main ) to find out. The mechanism is structural, and it's the same shape I found in the OpenAI Agents SDK and smolagents. One list, appended twice per turn Each run holds a single mutable conversation list on its state: message_history : list [ _messages . ModelMessage ] = dataclasses . field ( default_factory = list [ _messages . ModelMessage ]) On every model step the graph appends to it — first the outgoing request, then the model's response: ctx . state . message_history . append ( self . request ) ... ctx . state . message_history . append ( response ) Nothing is removed. The list only grows: request, response, request, response — with tool calls and, crucially, tool outputs riding inside those messages. The full list is re-sent every step When the graph builds the input for the next model call, it takes the entire accumulated history — a full copy: messages = ctx . state . message_history [:] ... messages [:] = _clean_message_history ( ctx . state . message_history ) That [:] is the whole conversation to date. So on step 1 the model sees your prompt; on step 2 it sees your prompt + step 1's request + step 1's response (including the tool output); on step 5 it sees all of that plus steps 2–4. The payload you pay for grows every single step, and the heaviest passengers are usually the tool outputs — the search results, file contents, and API responses you least want re-uploaded five times. Why it's quadratic, and why nothing warns you A run of n steps sends roughly 1 + 2 + 3 + … + n copies of history — O(n²) cumulative tokens in the step count. A 3-step agent is fine. A 12-step agent th

2026-08-22 原文 →
AI 资讯

Build a Real-Time Polymarket Order Book Monitor with Python

Build a Real-Time Polymarket Order Book Monitor A trading bot should not make decisions from stale snapshots. If you want to understand liquidity, spread, depth, or changes in market structure, you need a continuously updated view of the Polymarket order book. This tutorial builds a lightweight Polymarket order book Python monitor using the public CLOB Market WebSocket. Polymarket documents this channel as a real-time feed for order-book, price, and market lifecycle updates. The implementation intentionally focuses on market data—not order execution—so it can be used as the foundation for research, dashboards, alerts, or an automated trading system. What You'll Learn How Polymarket token IDs relate to order-book subscriptions How to connect to the CLOB Market WebSocket How to process book and price_change events How to calculate best bid, best ask, and spread How to handle reconnects and heartbeats How to detect stale market data How to turn raw WebSocket events into trading signals Architecture flowchart LR A[Polymarket CLOB] --> B[Market WebSocket] B --> C[Python Async Client] C --> D[Order Book State] D --> E[Spread / Depth Metrics] D --> F[Trading Signal Engine] D --> G[Logging / Monitoring] The important design decision is separating transport from state . The WebSocket delivers events; your application maintains the current book. 1. Install the Dependencies For this monitor, authentication is not required because the Market WebSocket is public. pip install websockets You need a Polymarket asset ID/token ID for the outcome you want to monitor. The Market Channel subscribes using assets_ids . For example: TOKEN_ID = " YOUR_TOKEN_ID " Do not hard-code credentials into a market-data monitor. In this example, there are no credentials at all. 2. Connect to the Market WebSocket The documented Market Channel endpoint is: wss://ws-subscriptions-clob.polymarket.com/ws/market The subscription message contains type: "market" and one or more asset IDs. A minimal monitor lo

2026-08-22 原文 →
产品设计

How much of the SPX options book is new each day? Open-interest change across 1,081 sessions

Short version of a post on gex.live/research ; the full write-up, definitions and reproduce block live there. Most published dealer-gamma numbers are built from open interest : yesterday's outstanding contracts, multiplied by a convention about who holds which side. Whether the convention is right is a separate question. The prior question is simpler: how much of what trades today was already in that book this morning — and how much of tomorrow's book is being created today? Open interest and volume are enough to answer it, with no assumption about who bought. Sample: SPX and SPXW, 2022-04-14 to 2026-08-14, 1,081 trading days, every expiry within about a month (0DTE plus the 21 nearest), 8.6 million contract-days, 4.3 million with volume. Definitions Per contract (expiry, strike, right) and session D: OI(D) is open interest at the start of D, OI(D+1) at the start of the next session, ΔOI = OI(D+1) − OI(D) , vol the day's volume in that contract. |ΔOI| / vol is a lower bound on how one-sided the day's trading in that contract was — 1.0 means every lot opened (or every lot closed), 0 means opens and closes cancelled. Contracts expiring on D have no next-day OI and drop out of the ΔOI statistics; 4.1% of rows (3.8% of volume) show |ΔOI| > vol, which is impossible (OI snapshot timing) and are excluded. The book grows by 40% of what trades, every day days to expiry on D net ΔOI / volume |ΔOI| / volume (lower bound on one-sidedness) share of volume in contracts whose OI rose contract-days 1–5 37.8% 41.8% 90.3% 813,013 6–21 42.7% 53.3% 81.1% 2,206,446 22+ 42.8% 57.6% 76.5% 831,896 Across the whole book, net ΔOI is 39.9% of the day's volume on the median session (IQR 36.2–44.0%), positive in every year and every expiry bucket: the SPX book is always being built faster than it is unwound, until expiry does the unwinding. Far expiries are open-and-hold (a day's trading in a 22+ DTE contract is at least 58% one-sided); the nearest expiries churn (42% at 1–5 DTE). Per contract-

2026-08-22 原文 →
AI 资讯

Similarity isn't relevance: the hard part of semantic search

Here's a dirty secret of search: "the closest match" and "the most useful result" are not the same thing. Return the mathematically nearest document and you'll often hand someone something technically related and practically useless. Relevance is a harder problem than similarity — and it's where good search is won or lost. Getting that right was the core challenge in the GovernAI Research Atlas , a semantic discovery platform I built to unify research across papers, repositories, and policy. Similarity is not relevance Semantic search gives you a superpower: embed everything into vectors and find items close in meaning , not just wording. But raw nearest-neighbor retrieval has a blind spot. The vector-closest result might be a tangential paper that happens to share vocabulary, while the genuinely useful one sits slightly further out. Distance in embedding space is a proxy for relevance — a good one, but not the whole story. If you stop at "closest vector," your search is clever and still frustrating. Ranking on top of retrieval The Atlas runs ChromaDB vector search with Sentence-Transformer embeddings across sources like OpenAlex and GitHub — that's the retrieval layer, the "what's semantically near this query." On top of it sits a custom relevance score that decides what actually surfaces first. That two-stage shape is the pattern behind every search system worth using: Retrieve broadly by meaning. Vectors pull in the semantically-relevant candidate set, fast, across a large and varied corpus. Rank deliberately. A custom scoring layer reorders those candidates by what's actually useful — because the job isn't to return related results, it's to return the right one first. Unify the sources. Papers, code, and governance material ranked into a single relevance-ordered experience, so discovery crosses formats instead of siloing them. Why this is the interesting part Retrieval gets the attention; ranking gets the results. Anyone can wire up a vector database and get "se

2026-08-22 原文 →
AI 资讯

Your TTS shortlist is three shortlists, and they barely intersect

Every "best text-to-speech API" list I have read is ranked. Number one, number two, number three, with a verdict at the bottom. That shape cannot express the actual decision, and I want to show you why with something you can run. The problem is that the three things that decide a TTS vendor are measured in units that do not convert into each other. Price is dollars per million characters. Transport is a shape — held-open socket, chunked body, finished file. Compliance is a document that either exists or does not. There is no exchange rate between them, so there is no ordering. A ranked list has to pick one axis and pretend the others are tiebreakers. They are not tiebreakers. They are filters, and filters compose by intersection. The three sets Price spans about 40x. Google Cloud's legacy voices and Amazon Polly's standard engine sit at $4 per million characters. The mid-market — OpenAI's tts-1 , Deepgram Aura-1, Inworld TTS-2 Flash — clusters at $15. Cartesia runs $37.38 to $50. ElevenLabs is $166.11 at its Scale tier. A million characters is roughly 22 hours of speech, so at prototype volume this axis is noise; at a hundred million characters a year it is the difference between a $400 bill and a $16,600 one. Transport comes in three shapes and the difference is architectural, not incremental. WebSocket streaming holds a connection open and pushes audio as it is synthesised. The first syllable can reach the caller while the model is still working on the sentence. This is what a live agent needs. Chunked REST streams the response body back progressively. OpenAI works this way, and its docs recommend wav or pcm output specifically because those start playing sooner than a compressed container. Meaningfully better than waiting for a whole file; meaningfully worse than a held-open socket. Batch returns a finished file. Correct for narration, e-learning, anything rendered ahead of time. Wrong for conversation. Two entries in that column are routinely stated wrong, so th

2026-08-22 原文 →
AI 资讯

From Sandbox to Review Queue: My GSoC 2026 Project with OWASP OWTF

When I started GSoC in May, my plan was to build a runtime sandbox for community plugins. By week two my mentor had talked me out of it, and I ended up spending the rest of the summer building a review queue instead. This post is about how that happened and what I actually shipped. Quick summary Project: Community Driven Plugin Ecosystem for OWTF Org: OWASP Foundation Mentors: Abraham Aranguren, Viyat Bhalodia What got shipped: Six pull requests against owtf/owtf , around 6,000 lines of Python and TypeScript, 153 backend unit tests, and a trust model doc. Working mirror of this post: gist If you only want the code, here are all my PRs on OWTF . The problem I was trying to solve OWTF is a security testing framework, and until this summer its plugin catalogue was static. If you wrote a detection for some new attack pattern, your options were: open a PR against the framework itself (high bar, slow), or keep the plugin to yourself. Most useful plugins never made it upstream because of that. The Community Plugin Marketplace fixes this. Any authenticated user can upload a Python plugin through the web UI. The plugin is validated at upload time, lands in a pending queue, and waits for an admin to look at the source. Once approved, the plugin gets mirrored into OWTF's standard plugin table. From that point on, the runner, the worklist, and the report generator all treat it exactly like a built-in plugin. The pivot My accepted proposal called for a sandbox. Community plugins would run inside something like a subprocess with dropped privileges, so that a malicious plugin could not do too much damage. Then Viyat said this in Slack: A sandbox in Python that talks to the same postgres, the same file system, the same target scope as OWTF itself is not really a security boundary. I sat with that for a couple of days and realised he was right. A plugin that runs inside OWTF has to see the target, has to read config, has to write results. Any "sandbox" I put around that is going to

2026-08-22 原文 →
AI 资讯

topowatch: audita el Attack Success Rate de tu workspace contra inyección indirecta

Tu agente de código lee tu workspace. Un archivo envenenado en cualquier rincón puede llevar instrucciones que el agente ejecuta. ¿Sabes qué fracción de tu workspace tiene que leer para que eso ocurra? topowatch mide eso. El problema no es el prompt, es la topología El paper Workspace Topology as an Attack Vector in Agentic Coding Assistants (arXiv:2608.14876, Day et al., 2026) demostró algo que intuíamos pero no medíamos: la topología del workspace afecta mediblemente el Attack Success Rate (ASR) de la inyección indirecta. Los entornos altamente modulares muestran ASR significativamente menor que los planos. La razón es mecánica: si el agente acota su lectura al módulo de la tarea, nunca llega al archivo envenenado. Si hace un wide read de todo el workspace, lo lee siempre. Qué es topowatch topowatch es una herramienta de línea de comandos que, dado un workspace, mide el ASR de una inyección indirecta de referencia bajo varias configuraciones de topología, y reporta qué estructura minimiza el ASR. Fundamentado en arXiv:2608.14876. Determinista y reproducible sin claves ni red: usa un agente sintético configurable y un fixture con tres topologías (monolito, modular, nesting profundo). pip install -e ".[test]" topowatch --json Resultados Sobre el fixture de referencia (200 trials, semilla fija): Topología ASR % leído Monolito (plano) 1.000 100% Modular (acotado) 0.000 28.5% Nesting profundo 0.000 66.6% El reporte incluye read_budget (fracción del workspace que lee el agente) y el veredicto del defense contract: modular < monolito . Honestidad sobre v0.1 v0.1 usa un agente sintético , no un coding assistant real (Claude Code / Codex). El claim "modularidad → ASR menor" está anclado al fixture reproducible, no a una medición contra un assistant real — eso es v0.2 (feature 002). El objetivo de v0.1 es darte una herramienta para medir y recomendar modularidad, no simular un ataque completo. Roadmap v0.2 : medición contra coding assistants reales (sandbox, sin credenciale

2026-08-22 原文 →
AI 资讯

Mojo vs Python: What Qualcomm's Open Source Release Actually Changes for Developers

For three years, the biggest complaint about Mojo was not the syntax, the performance claims, or the missing ecosystem. It was that the compiler was closed. You could read the standard library, you could file issues, but the thing that turned your code into GPU machine instructions was a binary you had to download on faith. For a language whose creator, Chris Lattner, built his reputation on LLVM and Swift, two of the most open projects in compiler history, that sat badly with a lot of developers. Then came the strangest possible sequence. Qualcomm announced an all-stock acquisition of Modular on June 24, 2026, valued around $3.92 billion at announcement. The deal closed at the end of July. Mojo hit version 1.0 the following week. And on August 18 at ModCon, Modular open sourced the entire compiler and toolchain under Apache 2.0 with LLVM exceptions. A chip company bought the language, and only then did the source drop. The Hacker News thread reached 409 points, and the reaction splits into two camps that basically never overlap: people who say "finally, I can try this," and people who say "too late, the window closed." Both are worth listening to, because the honest answer to whether Mojo matters now depends on what you actually do with Python. What Actually Got Released The whole toolchain, not a teaser. The modular repository on GitHub now contains the Mojo compiler, the tooling, and everything needed to build the language from source. One command builds the compiler and runs a Mojo file against it: ./bazelw run --config = build-mojo KGEN:mojo -- run hello.mojo That is a real bar to clear. This is not "source available with a look-but-do-not-touch license." Apache 2.0 is the same license family as the rest of the LLVM world, and the LLVM exceptions expand what you can do with distributed binaries. You can fork it today if you want. But not contributions, yet. The announcement is explicit: Modular is not accepting contributions to the compiler and tooling right no

2026-08-22 原文 →
AI 资讯

From Pixels to Prescriptions: Building a Smart Pill Reminder with YOLOv8 and Raspberry Pi

Taking the right medication at the right time is more than just a routine—it's a critical part of healthcare. However, for the elderly or those with complex prescriptions, "pill fatigue" is real. Mistakes happen. In this tutorial, we are diving deep into Computer Vision , Edge AI , and IoT to build a real-time pill identification and reminder system. We will leverage YOLOv8 for multi-pill detection and semantic segmentation, deploy it on a Raspberry Pi , and use MQTT to trigger physical alarms or notifications. Whether you are looking to master real-time object detection , explore embedded AI implementation , or build a life-saving IoT device , this guide has you covered! The Architecture: From Vision to Action 🏗️ The system follows a classic Edge-to-Cloud (or Edge-to-Local) pattern. The Raspberry Pi acts as the brain, processing image frames locally to ensure privacy and low latency. graph TD A[Raspberry Pi Camera] -->|Video Stream| B[OpenCV Preprocessing] B --> C{YOLOv8 Engine} C -->|Detection/Segmentation| D[Logic Layer: Check Schedule] D -->|Match/Mismatch| E[MQTT Broker] E -->|Publish Topic| F[Physical Alarm / Buzzer] E -->|Status Update| G[Mobile App/Dashboard] D -->|Log Data| H[Local Database] Prerequisites 🛠️ To follow along, you'll need: Hardware : Raspberry Pi 4B/5 (8GB recommended), Camera Module (V2 or HQ). Tech Stack : YOLOv8 : For state-of-the-art segmentation and detection. OpenCV : For image manipulation. Paho-MQTT : For the messaging protocol. Ultralytics : The framework powering our model. Step 1: Training the YOLOv8 Segmentation Model While YOLOv8 is famous for object detection, we use Semantic Segmentation here to precisely calculate the area and shape of pills, which helps distinguish between very similar-looking tablets. from ultralytics import YOLO # Load a pretrained model model = YOLO ( ' yolov8n-seg.pt ' ) # Train the model on our custom pill dataset # Assume we have a 'pills.yaml' defining classes: 'aspirin', 'vitamin_c', etc. results = mo

2026-08-22 原文 →