Painel de Notícias

Tecnologia

7045 posts · 26 feeds · tópicos e interesse por Jev

Filtros
dev.to

The Subnet Overlap Nobody Saw Coming (and the 30-Second Check That Catches It)

Two offices merge. Both teams have been happily using 10.34.x.x for years. The network team stitches the sites together with a new VPN tunnel, updates the firewall, and goes home. Three days later the help desk floods with tickets: the build server answers pings but not SSH, a printer works on Tuesdays, and one department swears the CRM "loads eventually, if you refresh five times." Nothing is on fire. Everything is intermittent. Welcome to the worst failure mode in subnetting: overlapping subnets. Site A was assigned 10.34.12.0/23. That block covers: 10.34.12.0 - 10.34.13.255 (512 addresses) Site B, allocated by a different admin in a different year, got 10.34.13.0/24: 10.34.13.0 - 10.34.13.255 (256 addresses) On paper both allocations look fine, and neither admin ever saw the other's spreadsheet. But B's entire /24 is inside A's /23. Every one of B's 256 addresses is claimed twice. Once the tunnel comes up, packets for 10.34.13.x have two valid destinations. The routing table picks whichever route was installed last, ARP caches fight over the same targets, and traffic lands on whichever site the router currently prefers. Intermittent, direction-dependent, and maddening to troubleshoot. Two subnets overlap exactly when their address intervals share at least one address. Forget prefix lengths — expand both blocks into a start and end address and compare intervals: overlap(A, B) = start(A) <= end(B) AND start(B) <= end(A) That's it. It works for equal prefixes, different prefixes, a /23 versus a /24, or a single host versus a whole /8. In Python, the whole check fits on a napkin: def ip_to_int(ip): a, b, c, d = (int(x) for x in ip.split(".")) return (a << 24) | (b << 16) | (c << 8) | d def mask_of(prefix): return (0xFFFFFFFF << (32 - prefix)) & 0xFFFFFFFF def block_span(ip, prefix): base = ip_to_int(ip) & mask_of(prefix) return base, base + (1 << (32 - prefix)) - 1 def overlaps(a_ip, a_pfx, b_ip, b_pfx): a_start, a_end = block_span(a_ip, a_pfx) b_start, b_end = block

Infra
Interesse
dev.to

Most AI Frameworks Give Agents a Context Window, Not a Memory. Here’s How We Fixed It.

Introducing Actrone Memory: open-source, local-first memory for AI agents Every agent demo looks the same after the second exchange. Say your name, get a friendly reply, refresh the page, and the agent has no idea who you are. Most frameworks hand an agent a context window, not a memory: kill the process and it forgets everything it just learned. We kept rebuilding the same missing layer across project after project, so we built it once, properly, and today we are giving it away. Two tiers, not one big bucket Actrone Memory splits memory the way a person actually recalls things: a hot tier for what just happened in this session, and a semantic tier for everything the agent has learned over time. Retrieval fuses dense embeddings, keyword search and recency into one ranked list, so an exact-keyword match a vector search would under-rank still surfaces. Context assembly is budget-aware: hand it a token budget and it fits what it returns to that budget, instead of blowing your context window or truncating blindly. Every fact gets classified, not just stored Most memory libraries treat every remembered fact the same. Ours classifies each one, none, low, PII, or sensitive, at the moment it is extracted. That is the piece we think nobody else frames this way: memory that already knows what kind of data it is holding, before it ever reaches a compliance review. It is the memory that graduates to governed. Zero-service by default The default backend is fully local and in-process: a dependency-free embedder plus an in-memory store, so there is nothing to run and no API key to get. When you are ready to scale, two independent switches take you to a durable Redis and Qdrant backend and to a real embedding provider, local or cloud, your choice. What it is not We would rather say this plainly than have you find out later. No bitemporal knowledge graph and no self-editing memory blocks. Those live on the hosted platform, not in this library. The Python adapters, LangChain, LangGra

IADev
Interesse
dev.to

Select all in a million filtered rows, and send the server one line instead of a list

"How do I get the selected rows from a checkbox column?" has been read more than 82,000 times on Stack Overflow, and it is rarely about the checkbox. It comes up when a table has a filter on and a header checkbox, and someone asks: When the user ticks "select all" on a filtered table, which rows are selected? The ones on screen, the ones the filter matches, or every row? Which of them does my code get back? What do I send to the server when "all" means a million rows? This post answers each one on real data, with the React code. The demo loads the 1,067,371 invoice lines of the Online Retail II dataset into the free Community DataGrid. You can tick rows, filter by country, and see what the selection would look like as a request. The first rule is the one that makes the others possible. A selection is a set of row keys, not row indexes: import { DataGrid } from '@kanunilabs/datagrid-react'; Sort the table and the ticked rows move with their data. Filter them out of view and back, and they are still ticked. An index-based selection points at whichever row happens to be third after the sort, and that is a bug report waiting to happen. With a filter on, the header checkbox selects the rows the filter matches. Not just the rows on screen, and not the rows the filter hides. Filter to France and tick the header. That selects 14,330 lines: Untick three of them and you have 14,327. So far this is what everyone expects. The interesting part is what that selection is made of. The obvious way to select all is to put every matching key in a set. For France that is 14,330 keys and nobody notices. Clear the filter and tick the header, and it is 1,067,371 keys, built on the main thread at the moment of the click. Then the user presses "Archive selected" and you send them. The demo has a button that does exactly that and times it in your browser. With three rows unticked from the whole table, the list is 1,067,368 ids and 7.1 MB of JSON. On our machine it took about a tenth of a sec

Dev
Interesse
dev.to

The boring part of an AI agent is the part that works

Most of the time an incident spends "being worked on" isn't work. It's waiting to reach someone who can act on it. An alert fires, an email lands in a shared inbox, somebody skims it, guesses which team owns it, forwards it, and that team decides it isn't theirs. On a bad night that loop costs you an hour before anyone has opened a terminal. I built an agent to collapse that loop for a BSS platform, and it took mean time to resolution on routed incidents from around two hours to about ten minutes. What surprised me is how little of that came from the language model. The model does one small job in the middle. Everything that makes the system trustworthy is plumbing. This post is about the plumbing. Incoming incident email is semi-structured in the worst way: there's a template, three systems ignore it, two append their own stack traces, and the one that matters most sends plain prose from a human. Regex gets you maybe 60% of the way and then rots every time an upstream team edits their alert body. That 40% tail is exactly where an LLM earns its place. But "classify this email" is not the system. The system is: poll inbox → normalise → classify → resolve owner → create ticket → notify → observe The model is step three. Steps one, two, four, five, six and seven decide whether anyone trusts it. The single highest-leverage thing I did was aggressively strip the email before the model ever saw it. Signatures, legal footers, quoted reply chains, base64 inline images, and the forty lines of Received: headers are pure token cost and pure distraction. import re from email import policy from email.parser import BytesParser QUOTE_MARKERS = ( "-----Original Message-----", "From:", "On ... wrote:", ) def extract_body(raw: bytes) -> str: msg = BytesParser(policy=policy.default).parsebytes(raw) part = msg.get_body(preferencelist=("plain", "html")) text = part.get_content() if part else "" # cut the reply chain at the first quote marker for marker in QUOTE_MARKERS: idx = text.find(

IAInfraDev
Interesse
dev.to

Connect to Any MCP Server in TypeScript Over stdio and HTTP, Then List Its Tools

Most people meet the Model Context Protocol (MCP) through a client like Claude Desktop, where a config file quietly wires up servers and you never see the handshake. But the protocol is just a client and a server talking over a transport, and the official TypeScript SDK gives you every piece you need to do that yourself. In this tutorial I want to show you how to connect to an MCP server programmatically, over both stdio and HTTP, and then enumerate its tools, resources, and prompts. Once you can do this, a lot opens up: writing your own client, building a registry that indexes servers, or scanning a server before you trust it. I will ground the code in mcp-audit, a small security scanner I built that does exactly this connect-and-enumerate dance, but the technique is what matters and it is fully reusable. There are three moving parts: A transport, which carries bytes. It can be a child process you talk to over stdin/stdout (stdio), or an HTTP endpoint. A Client, which speaks the MCP protocol over whatever transport you hand it. The capability calls like listTools() that ask the server what it offers. The nice part of the SDK design is that the Client does not care which transport it got. You build the transport, pass it in, and the rest of your code is identical. So let me build both transports first, then write one probe function they share. npm install @modelcontextprotocol/sdk You want Node 18 or newer, and "type": "module" in your package.json since the SDK ships as ESM. Stdio is for local servers. You give it a command to run, and the SDK spawns that command as a child process and speaks MCP over its standard input and output. This is how most desktop MCP integrations work under the hood. import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"; export function makeStdioTransport(opts: { command: string; args?: string[]; env?: Record ; cwd?: string; }) { return new StdioClientTransport({ command: opts.command, args: opts.args ?? [], env

DevIA
Interesse
dev.to

Designing High-Throughput Event-Driven Microservices with Kafka and RabbitMQ

Introduction & Industry Context In the landscape of modern software architecture, event-driven microservices have transitioned from an advanced engineering design pattern to an industry baseline. As distributed systems scale to ingest petabytes of data and process millions of operations per second, the monolithic "one-size-fits-all" message broker strategy has broken down. To build truly resilient, high-throughput, and low-latency backends, modern system architects must abandon the dogma of choosing a single message transport mechanism. Instead, they must embrace a hybrid event-driven architecture that exploits the distinct architectural characteristics of both Apache Kafka and RabbitMQ. Historically, teams forced themselves to choose between these two paradigms. Kafka was selected for high-throughput stream processing and event sourcing, while RabbitMQ was favored for its flexible, rich AMQP-based routing topologies and task queuing capabilities. However, in modern deployments, these technologies are frequently deployed together. For instance, RabbitMQ might coordinate real-time transactional workflows and user-facing notifications, while Kafka acts as the high-throughput, unified log-based system of record for analytics, auditing, and telemetry ingestion. As of 2026, both platforms have evolved to address their historical pain points. Apache Kafka 3.7.0 has solidified the operational simplicity of the Kafka Raft (KRaft) metadata quorum, eliminating the complexity and single-point-of-failure risks associated with Apache ZooKeeper. KRaft now easily supports production clusters of up to 2,000 brokers with near-instantaneous controller failovers. On the other hand, RabbitMQ 3.13.0 has fully embraced Quorum Queues as the default high-availability model over classic mirrored queues. Running on Erlang/OTP 26, modern RabbitMQ deployments deliver significantly reduced memory overhead, faster queue processing, and a powerful new HTTP API for managing shovel and federation p

Dev
Interesse
dev.to

Starting Nusku: a continuous profiler for Linux, built in Zig, no shortcuts

I've always wanted to see the complete performance picture before pushing any code or building something. Not after it's slow in production, not after a user complains about it, before. Click a button, run a command, trigger a request, and actually see what that cost instead of guessing. That itch has been sitting with me for years. Back in university, I took a course on application performance, and every single homework was the same loop: profile a feature, find what's slow, fix it, measure again, confirm it's actually better. We did it in C# with Visual Studio's live profiler, watching CPU and memory update in real time while clicking through an app. That loop never left me. A few years later I was using NetBird before it had anything close to a performance or observability story, and I kept thinking about the same gap from a completely different angle: infrastructure. So I'm building Nusku. A continuous profiling system for Linux, written in Zig, with eBPF doing the actual watching. Point Nusku at a running process, or launch one through it, and watch what it's actually doing while you use it. CPU time per function, live. Memory as it's allocated, not just a number that goes up, but what called for it and where. Threads that look idle but are actually stuck waiting on a lock, a disk read, or another process, and for how long. Syscalls that quietly eat milliseconds a normal CPU graph never shows you. Network calls that are slow because packets are getting retransmitted, not because the code is doing anything wrong. It runs locally with nothing to configure, you point it at a process and watch. It can also run on a remote machine and stream that same live picture back over a secure connection, so a server can be watched the same way as something running on your own laptop. Every serious Linux profiling tool, Parca, Pyroscope, Cilium, Datadog's continuous profiler, is built on eBPF, not on polling files in /proc and hoping for the best. eBPF is the only way to get r

DevInfraLinux
Interesse
dev.to

How to write an AGENTS.md your AI agent actually follows

Originally published on no-code.supply. TL;DR An AGENTS.md is a file that tells your AI coding agent how a project works and which rules it must not break. Most of them get ignored because they're written like a wiki page. Write it like instructions for a new colleague on their first day. What works: where things live, numbered rules with the reason next to them, one recipe for the most common task, and a checklist for when it's done. What doesn't: vague advice ("write clean code"), things the agent can read from the code anyway, and docs nobody updates. Every template I sell ships with one, and here's exactly how they're written. 👉 See the templates I built 15 website templates with an AI coding agent, Claude Code, in about a week. (The whole story is here.) Two repositories, dozens of sessions, and the agent starting from zero every single time. That's the thing people forget: your agent has no memory of yesterday. Every session, it opens the project like a new hire on day one. Whatever it knows about how your project works, it learns from what's written down. If nothing is written down, it guesses. And guessing is where the weird bugs come from. Then there's the second reason. Every template I sell ships with an AGENTS.md, because most buyers won't edit a template by hand. They'll open it in Cursor or Claude Code and say "make the hero blue." That file is the difference between their assistant following the template's rules and their assistant quietly breaking them. So I've written a lot of these by now. Let's dig in! Everything in this post is how things work in October 2026. AI coding tools change every few months, and the rules have already changed more than once. A year ago, every tool wanted its own file. Now most of them read AGENTS.md, and even Claude Code reads it. So take the file names and tool details with a pinch of salt. The thinking behind them should last longer: write down what the agent can't read from the code, and say why. That was good advice

IADev
Interesse
dev.to

This week in Cursor + .NET — 7 rules (week ending October 04, 2026)

Every weekday a single, opinionated rule for senior C#/.NET engineers using Cursor. Here's the full week in one read — canonical posts live on the Agentic Architect blog. Sun 04 Oct Architectural rules belong in tests, not in code review. Encode them as NetArchTest assertions ("no class in Domain references EntityFrameworkCore") and they fail your build instead of your standup. Add the corresponding test whenever a new layer or project is introduced. → Permalink on the blog Sat 03 Oct In-memory EF Core providers lie. Use WebApplicationFactory with Testcontainers (SQL Server, Postgres) for real integration coverage. Cursor defaults to UseInMemoryDatabase — it passes locally and ships the bug to production. Flag the in-memory provider in test projects. → Permalink on the blog Fri 02 Oct Library code (non-ASP.NET) should ConfigureAwait false on every awaited Task. ASP.NET Core code should not. Cursor mixes the two contexts in the same solution. Detect the project type and enforce the right default. → Permalink on the blog Thu 01 Oct async void is a deadlock and unhandled-exception trap everywhere except UI event handlers. The AI uses it routinely for "fire and forget" — wrong answer every time. Flag it on sight. → Permalink on the blog Wed 30 Sep Value objects (Money, Address, Coordinates) should be records. Entities with identity (Order, Customer) should be classes with an Id. Cursor mixes these constantly. A rule that classifies based on the presence or absence of an identity property keeps the distinction honest. → Permalink on the blog Tue 29 Sep Mark every class sealed unless inheritance is explicitly planned. Stops Cursor inventing accidental inheritance hierarchies "for flexibility." Small but measurable virtual-call perf wins too. → Permalink on the blog Mon 28 Sep OrderId as record struct OrderId(Guid Value) beats raw Guid everywhere. Stops the AI passing a CustomerId where an OrderId was expected — a bug the compiler can't catch with primitive obsession but c

Dev
Interesse
dev.to

How to Monetize an MCP Server: Per-Call x402 Payments (With Live Receipts)

How to Monetize an MCP Server: Per-Call x402 Payments (With Live Receipts) There are 20,000+ MCP servers in the wild and fewer than 5% have any monetization. The guides that rank for "how to monetize an MCP server" are vendor pitches, Stripe subscription tutorials, or marketing calculators — none shows a live payment receipt. Here's the receipt-first version. I run ScriptMasterLabs; we bill x402 on our MCP/HTTP tool infra on Base. Per-call x402 billing: your server answers each unpaid tool call with a 402 Payment Required challenge carrying price, asset, network, payTo address, and expiry. The agent's wallet signs the payment authorization, retries the same call, and a facilitator verifies and settles it on-chain. No accounts, no API keys, no checkout pages. Receiving a challenge costs the caller nothing. 1. The x402 payment manifest: curl https://squeezeos-api.onrender.com/.well-known/x402 Returns a live machine-readable contract: operator SCRIPTMASTERLABS, network eip155:8453 (Base), asset USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913), payTo 0xc29185fa176357612f3194735753e520e91adc46, facilitator https://api.cdp.coinbase.com/platform/v2/x402, challenge header PAYMENT-REQUIRED, MCP endpoint https://squeezeos-api.onrender.com/mcp, identity registered on the ERC-8004 agent registry (agent id 74033). Verified live September 22, 2026. 2. A live MCP handshake: curl -X POST https://mcp-x402.onrender.com/mcp \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/event-stream' \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"probe","version":"0"}}}' Answers with serverInfo: {"name": "mcp-x402", "version": "2.1.11"} and tool capabilities live. On tools/call without a payment credential, return the payment terms — JSON-RPC error data on the MCP transport, or 402 + PAYMENT-REQUIRED header over HTTP. Verify the buyer's signature through a facilitator (ours points at the

IADev
Interesse
dev.to

Jev Decides, x402 Pays: The Decision-Only Model and Its Missing Payment Layer

Jev is a week old and already the most interesting model launch of September 2026. TypeSafe AI — founder Diogo Almeida (ex-OpenAI, ChatGPT research), two years in stealth, $40M seed led by DCVC — shipped a model that refuses to generate text. You send it state (text or JSON) plus questions with predefined answers. It returns typed decisions: Choice (one of up to 255 options), Score (numeric rating), Noul (yes/no with probability) — each with calibrated confidence. All questions evaluate in one forward pass. 70–500ms. $0.042 per million input tokens, output free. Week-one traction is real: 140,000+ waitlist cleared in days, X trending, 12,759 tweets analyzed by OpenChamber, 1,500+ Hacker News points with 426 comments in a day, Vercel AI Gateway availability, and community builds (jevchat, jev-2048, an open-weight "Kev" on Qwen). Simon Willison covered it and shipped an llm-typesafe plugin the next day. The "20–200x faster, 40–400x cheaper" figures are TypeSafe's own launch evaluations — not independently validated. Willison's critique is worth sitting with: a model that returns only a floating-point number is "a regression even further towards black box machine learning." Type safety constrains the form of the answer; decision quality still has to be measured separately. Jev is named for the Jevons-paradox insight: make a decision cheap enough and software makes far more of them. A 1,000-token decision costs about $0.000042 in model cost. That flips the business model. Every decision becomes a billable event, and subscriptions stop making sense at that unit size. The native billing is per-call micropayments: x402 — the server answers an unpaid request with a 402 Payment Required challenge (price, asset, network, payTo), the buyer's wallet signs and retries, a facilitator settles on-chain. This isn't theoretical. ProBlocks runs a live x402 endpoint on Base at 0.001 USDC per call (September 2026). My own shop runs an x402 v2 payment contract live on Base — curl https:/

IA
Interesse
LWN

Nix and Lix local root-privilege-escalation vulnerabilities

The Lix and Nix projects have jointly disclosed a set of vulnerabilities that can be used to escalate privileges to root on systems running the Lix or Nix daemons. "All systems that build untrusted derivations are affected." Releases with fixes from each project are available today. CVE IDs have not yet been requested. See the announcement for more details on the vulnerabilities.

SegurançaInfraDevLinux
Interesse
dev.to

Real-time market data is mostly a freshness problem

A competitor changes price at 2:15 PM. Your scraper runs at midnight. The dashboard looks clean the next morning, but the business already lost a few hours of margin or conversion. The bug is not that you lack data. The bug is that your data describes the wrong moment. Most teams do not need true real-time market intelligence. They need data that is fresh enough for the decision it drives. A pricing bot may need competitor changes within 5 minutes. An assortment gap report may be fine at 6 hours. A weekly category review does not need streaming infrastructure at all. The first useful design question is not how do we make this real-time? It is: What is the maximum age of this data before acting on it becomes unsafe? That gives you a freshness SLO. For example: competitor_price_freshness_seconds 20% unless confirmed by two consecutive observations reject currency changes unless source region also changed ignore out-of-stock changes that flip back within 2 minutes alert when freshness exceeds SLO instead of reusing stale values These checks reduce false reactions. They also make incidents easier to debug because the system can explain why it did or did not act. A report answers what happened. A decision loop answers what changed and what should happen next. That loop can still start manually. Send a Slack alert when a top competitor drops price. Create a ticket when a rival goes out of stock. Notify merchandising when a category gap appears. Once the signal quality is good, automate the low-risk actions first. For example, refresh an internal recommendation, flag a SKU for review, or pause a stale campaign. Leave margin-sensitive pricing changes behind stricter checks. The practical next step: pick one decision your team already makes from stale external data, define its freshness SLO, and instrument the age of that data before changing the scraper itself.

Infra
Interesse
dev.to

Turning an SEO audit into tasks your AI coding agent can actually fix (Claude Code, Cursor, Codex)

A typical SEO audit export is a spreadsheet with a few hundred rows: "Missing canonical (18 pages)," "Duplicate title (11 pages)," "Orphan page," "Redirect chain." Pasting that into Claude Code, Cursor, or Codex with "fix these" usually goes badly. The agent edits the wrong template, "fixes" a warning that didn't matter, or changes robots.txt in a way nobody reviews. Coding agents are good at SEO fixes because most technical SEO problems are template problems, and a template is code. The trick is the translation step between the audit and the agent. This post is the process I use. Not every SEO finding is a coding task. Before anything goes to an agent, I sort the list. Delegate to the agent (deterministic, lives in code, easy to verify): Missing, duplicate, or self-contradicting rel="canonical" tags Duplicate or empty and meta descriptions produced by a template Leftover noindex (meta tag or X-Robots-Tag header) on production routes Sitemap problems: wrong host, non-canonical URLs, URLs that 404 or redirect Internal links pointing at redirects or 404s Redirect chains (A→B→C) that should be a single hop Missing or invalid JSON-LD (Organization, SoftwareApplication, BlogPosting, BreadcrumbList) Missing alt attributes on content images, and heading-level order in components Do it with the agent, but decide yourself (code changes that encode a business decision): robots.txt rules, especially for AI crawlers Which URL is canonical when two pages overlap Redirect maps after a URL restructure hreflang sets Keep away from the agent (not code problems): Content quality, search intent, and topic gaps Backlinks and authority Anything that's really a keyword-strategy decision The first bucket usually covers most of what a technical audit flags. The second bucket is where an agent can do real damage if you let it decide on its own. Audits report symptoms per URL. Agents fix causes. "Missing canonical on 18 pages" isn't 18 tasks. It's usually one layout or one generateMetadata-s

IADev
Interesse
dev.to

I thought rate limiting was a solved problem. Then my AI agents hit production

Keeping requests to a service under some rate always seemed simple to me, and the whole problem a little overblown. Then I started working closely with AI agents. I've been through the euphoria phase: you connect an agent to your company's data, and it starts producing real insights. The trouble starts when those solutions move to something like production scale. We run heavily on Google Cloud, and suddenly a lot of applications slow down because they hit quotas. Resources get burned at a frightening rate, both on GCP services and on the models behind the agents. Tokens stop being merely expensive; they become worth their weight in gold. governor: perfect, on one pod Redis: works, but come on What rateguard does use rateguard::{Decision, Guard}; let guard = Guard::builder() .bind("0.0.0.0:7946") .advertise(pod_ip) // where the other pods reach this one .seeds(["10.0.0.1:7946", "10.0.0.2:7946"]) .limit(10) // 10 calls/s for the whole fleet .spawn()?; // Before every call to the quota-limited API: loop { match guard.check("vertex-ai") { Decision::Allow => break, Decision::Deny { retry_after } => tokio::time::sleep(retry_after).await, } } call_the_api().await?; Eight pods or eighty, the fleet stays at 10 calls a second. How it works, in four lines: Shares follow demand. Each pod gossips how many calls it is trying to make, and takes a proportional slice of the limit. A busy pod gets more; an idle one doesn't sit on a share it doesn't use. Only busy keys are coordinated. Quiet keys run locally on a small fixed share and generate no network traffic at all. Nothing on the call path can fail. If the other pods disappear, each keeps enforcing the last share it knew. What happens during a network split is a setting (HoldDown, Quorum, or Optimistic), with a stated bound for each. It's tested like a distributed system. The protocol runs in a deterministic simulator — partitions, 30% packet loss, GC pauses, rolling restarts — and the README carries an accuracy report that CI ke

InfraDevIA
Interesse
dev.to

Self-Healing Pipelines: Using AI to Triage Incidents

When a pipeline fails at 2am, the slow part usually isn't the fix — it's the triage: reading It does not mean an AI silently rewriting your pipeline. It means a bounded assistant that observes, explains, and proposes — and only acts within a tight, pre-approved box. Think Roll this out in stages, earning trust at each rung: Explain. On failure, the assistant pulls the logs and context and writes a plain-English summary: which task, likely category (transient / data / code), and the smoking-gun lines. Zero actions — pure triage acceleration. Classify and route. It tags the incident and routes it: page a human for data-correctness issues, or note "likely transient" for a timeout. Propose remediation. It drafts the fix — "rerun partition 2026-08-05 after the upstream lands" — and a root-cause summary, ready for a human to approve with one click. Act within guardrails. For a small set of reversible, pre-approved actions (retry a known-flaky step, re-trigger a failed sensor), it can act automatically and log what it did. Destructive or irreversible actions — deletes, backfills, schema changes — stay human-approved, Bounded actions. An allowlist of safe operations, nothing else. Full audit trail. Every AI decision and action is logged and reviewable. A circuit breaker. Repeated auto-retries must escalate to a human, not loop forever. No masking. Auto-retrying a flaky step is fine; auto-retrying until a real bug happens to pass is how you hide incidents. Track "succeeded only after N retries" so fragility still surfaces. Start with the highest-volume, lowest-stakes failures: transient API timeouts, late upstreams, The win is faster triage and explanation, not autonomous rewriting. Climb an autonomy ladder: explain → classify → propose → act-in-a-box. Keep destructive actions human-approved, log everything, and add a circuit breaker. Never let auto-remediation mask a real bug — surface "passed only after retries."

IAInfraDev
Interesse
dev.to

Verifying Stripe Webhooks in Django, Step by Step

Originally published on the Djangix blog: Verifying Stripe Webhooks in Django, Step by Step If Stripe cannot reliably tell your Django app what happened to a payment, your app cannot reliably fulfil orders, grant access, or handle failures. Webhooks solve that — but only if you verify them. Your webhook endpoint is a public URL, so anyone who finds it can POST a fake “payment succeeded” event to it. Signature verification is how you prove an event really came from Stripe before you act on it. Verification depends on the raw request body. Stripe signs the exact bytes it sent, so you must verify using those raw bytes together with your endpoint's signing secret and Stripe's Python library — not a re-serialised version of the data. If the signature does not match, reject the request and do not process the event. Three pitfalls cause most failures. First, using the parsed JSON body instead of the raw bytes, which changes the payload and breaks the signature check. Second, using the wrong signing secret in production — each endpoint and environment has its own secret. Third, not returning a 200 response fast: do the verification and minimal handling quickly, and move slow work to a background task so Stripe does not time out and retry unnecessarily. Full step-by-step version with complete code: Verifying Stripe Webhooks in Django, Step by Step

Dev
Interesse
dev.to

Offline-First Mobil Mimari: Isar, SQLite ve REST API ile Kusursuz Senkronizasyon

Offline-First Mobil Mimari: Isar, SQLite ve REST API ile Kusursuz Senkronizasyon Günümüz mobil uygulama ekosisteminde kullanıcı deneyimini (UX) belirleyen en kritik unsurlardan biri, uygulamanın ağ bağlantısından bağımsız olarak ne kadar kararlı çalıştığıdır. Tünelde giden bir metroda, sinyalin zayıf olduğu kırsal bir bölgede ya da uçak modunda bile uygulamanızın çökmeden, takılmadan ve veri kaybetmeden çalışması gerekir. Bu makalede, modern mobil uygulamalarda Offline-First (Önce Çevrimdışı) mimariyi kurmanın teorik temellerini, yerel veri tabanı (Local DB) seçim kriterlerini ve yerel verileri bir REST API ile kusursuz bir şekilde senkronize etmenin mühendislik pratiklerini ele alacağız. Offline-First, uygulamanın birincil veri kaynağı (Single Source of Truth) olarak yerel veri tabanını (Local Database) kabul ettiği bir tasarım örüntüsüdür. Uygulama ağ isteklerinin sonucunu beklemek yerine, doğrudan cihaz üzerindeki yerel veriyi okur ve yazar. Arka planda çalışan bir Senkronizasyon Motoru (Sync Engine), bu yerel verileri uzak sunucuyla (Cloud/REST API) asenkron olarak eşitler. Ultra Düşük Gecikme (Low Latency): UI, ağ gecikmesine (network latency) takılmadan yerel veri tabanından anında beslenir. Kesintisiz Çalışabilirlik: İnternet bağlantısı koptuğunda dahi tam fonksiyonellik sunulur. Daha Az Pil ve Veri Tüketimi: Ağ istekleri optimize edilerek paketler halinde (batching) gönderilir. Kusursuz bir Offline-First mimari, katmanlı bir yapıda tasarlanmalıdır. İş mantığı (Business Logic), veri tabanı motorundan ve ağ katmanından tamamen izole edilmelidir. +-------------------------------------------------------------+ Özellik SQLite (Drift / Moor) Isar (NoSQL) Tür İlişkisel (SQL) Doküman / Nesne Tabanlı (NoSQL) Hız Orta / İyi Çok Hızlı (Asenkron & Çoklu İzlek) Reaktivite Stream desteği var (Üçüncü parti kütüphanelerle) Doğal reaktif (Query Watchers) Şema Göçü (Migration) Manuel SQL sorguları ile zorlayıcı Otomatik şema yönetimi ile kolay Öneri: Eğer uygulamanız karmaşık

MobileDev
Interesse
dev.to

From Bitrated's 2-of-3 multisig to smart-contract escrow: how trustless escrow actually works

Back in 2014, Bitrated did something clever: it let two strangers trade Bitcoin without either of them, or the platform, holding the money. A decade later the site is widely described as inactive, but the design problem it solved hasn't gone anywhere. Freelancers, OTC traders and domain buyers still need a way to say "I'll pay, but only when you deliver" without trusting a middleman with the funds. This post walks through how Bitrated's model worked at the protocol level, where it broke down in practice, and how the same idea looks when you move it from a Bitcoin multisig script into a smart contract. Bitrated never held coins. Each trade created a pay-to-script-hash (P2SH) address controlled by three keys: the buyer the seller an arbitrator the two parties chose from a marketplace The redeem script looked roughly like this: OP_2 OP_3 OP_CHECKMULTISIG Any two of the three signatures could spend the output. That gives you three paths: Happy path: buyer and seller both sign, and the funds go to the seller. The arbitrator never sees the trade. Buyer wins a dispute: buyer and arbitrator sign a refund. Seller wins a dispute: seller and arbitrator sign the release. The elegant part is that the platform is not in the signing set at all. Even if Bitrated disappeared, the coins would still sit in a standard multisig address on the Bitcoin blockchain, recoverable by any two key holders with a wallet that can import the redeem script (Sparrow and Electrum both can). The cryptography was fine. The problems were operational: Finding an arbitrator. The 2-of-3 design only works if the third key belongs to someone who is still around and still responsive when the dispute happens. As the marketplace thinned out, that stopped being a safe assumption. Volatility during disputes. A trade priced in BTC can move 10% while two people argue over a delivery. Whoever benefits from the price move has a reason to stall. No programmable exits. A multisig has no clock. If the buyer simply goes s

SegurançaDev
Interesse
dev.to

Azure AI Foundry Cost Optimization: Caching & KV-Cache Reuse

Quick Answer Azure AI Foundry cost optimization: By orchestrating caching, KV‑Cache reuse, intent‑based routing, and micro‑batching, a .NET LLM service on Azure AI Foundry can cut token spend by 50% while keeping latency under SLA. When you expose an LLM as a stateless HTTP endpoint, every query is a fresh token‑cost. In a .NET microservice that scales to thousands of requests per second, the bill can outpace user growth within weeks. The root cause isn’t the model’s price per token; it’s the absence of an execution fabric that re‑uses work, trims context, and directs traffic to the most economical endpoint. Consider a customer‑support bot built in ASP.NET Core that forwards every user message to a Foundry endpoint. The bot runs on an AKS GPU pool with 4 vGPU nodes. In production, 12 k requests per minute hit the endpoint, each averaging 200 tokens. The Foundry token price is $0.0004, so the monthly spend is roughly $1,200. The engineering team was surprised when the bill doubled after a marketing campaign that tripled traffic. The culprit: a naive “one‑model‑per‑service” approach that ignored context reuse, caching, and routing. Model Granularity vs. Cost: A single 7B model is cheaper per token than GPT‑4‑Turbo but lacks the nuance for complex queries. Splitting traffic between a distilled 1.3B for FAQs and a 7B for open‑ended tasks reduces average tokens per request but introduces routing logic and potential cache misses. Cache Strategy vs. Consistency: Cache‑aside gives the fastest latency and highest hit rate but can return stale answers if the knowledge base changes. Write‑through guarantees freshness at the cost of extra latency on the request path. Write‑back maximises throughput but risks delivering outdated embeddings during a rapid content update. KV‑Cache Reuse vs. State Management: Maintaining KV‑Cache per conversation cuts per‑turn compute by 45 % but requires a stateful session store and adds complexity to the orchestrator. Discarding KV‑Cache per requ

IAInfraDev
Interesse
dev.to

A Consent Ledger for Customer Texts: Storing Opt-Ins and STOPs So Every Automation Can Check Them

Disclosure: I run NxFlowAI, an automation agency serving US businesses remotely from Mumbai. Not legal advice; check consent rules with your own adviser. In US small-business automations, texting consent tends to live in the texting tool and nowhere else. Then a second tool (a CRM sequence, a review-request app, a reminder service) texts someone who replied STOP last month. The fix is boring and effective: one consent ledger that every automation checks before sending. It is a pattern I use as an AI automation agency building US texting workflows. CREATE TABLE consent_events ( id BIGSERIAL PRIMARY KEY, phone_e164 TEXT NOT NULL, -- +1XXXXXXXXXX channel TEXT NOT NULL, -- sms, whatsapp, email purpose TEXT NOT NULL, -- transactional, marketing event TEXT NOT NULL, -- opt_in, opt_out source TEXT NOT NULL, -- web_form, keyword_reply, staff_entry evidence TEXT, -- form id, message id, staff note occurred_at TIMESTAMPTZ NOT NULL DEFAULT now() ); Append-only. Never update a row; add a new event. def may_send(phone, channel, purpose): last = db.latest_event(phone, channel, purpose) if last is None: return purpose == "transactional" and has_active_request(phone) return last.event == "opt_in" Every automation calls may_send right before sending, not when the job is queued. Inbound texts matching the standard opt-out words (the FCC's list is stop, quit, end, revoke, opt out, cancel and unsubscribe; carriers and providers may recognise more) write an opt_out event for all purposes on that channel. Plain-language requests such as "please stop texting me" should be caught too, by a person if not by code. Staff can record an opt-out by hand ("customer asked on the phone"). Opt-ins come from forms with clear wording, and the form id goes in evidence. When someone asks "why did we text this person?", you can answer with dates and sources. That is worth more than a boolean flag. Opt-out on Monday, reminder scheduled Sunday: blocked. Opt-in for reminders only, marketing job runs: blocke

Dev
Interesse
dev.to

Stop pasting other people's agent skills into your repo as-is

Agent skills (the SKILL.md files that Claude Code and Codex load) are easy to share, and GitHub is full of them. Each one was written for its author's project, with their stack, their scripts and their habits. Copy one into your repo unchanged and your agent inherits all of that. A frontend skill tells it to reach for Tailwind when you use CSS modules. A workflow skill says "run the tests" when your project calls it pnpm test:unit. A cleanup skill says "delete unused files" while your AGENTS.md says never to touch docs/. I built skilladopt to fix the skill before it goes in. npx skilladopt anthropics/skills frontend-design It fetches the skill at a pinned commit and hands the text, plus a short summary of your project, to an isolated Claude or Codex worker. The worker makes one decision per paragraph: Decision Meaning keep stays as written bind a generic command becomes yours: "run the tests" → "run npm test" rewrite the intent applies, the details don't (you always approve these) drop doesn't apply here, with the reason review the AI wasn't sure, so you decide Each decision has to cite evidence from your repo: a dependency, an npm script, a line in AGENTS.md or CLAUDE.md. Then plain code checks the answer. A bind may insert exactly one command that really exists in your project and must leave the rest of the sentence identical. A "stack mismatch" drop must point at something your project actually lacks. Paragraphs that carry a duty (a prohibition, an approval step, a verification step) are never dropped or rewritten without you. Nothing from the skill is executed, and the worker runs without tools (claude -p --safe-mode) or in a read-only sandbox (codex). Your teammate renames the test script and adds a rule to AGENTS.md. npx skilladopt impact Because every decision recorded its evidence, skilladopt can tell which ones no longer hold. In the demo run that's 1 decision out of 25, plus the new rule that might conflict. You re-check those lines and leave the rest alon

IADev
Interesse
dev.to

Building an AI Side Project That Actually Ships — Lessons from Shipping 3 MVPs

I remember the exact moment I almost gave up on AI side projects. I had spent three weeks building a context-aware documentation assistant that would sit on top of my team's internal wikis. The architecture was beautiful. The prompt engineering was surgical. And after all that polish, exactly zero people used it. That's when I realized something uncomfortable: I wasn't building products, I was building demos. The line between "working demo" and "usable product" is where most AI side projects go to die. So I changed my approach completely, and in the last two months, I've shipped three MVPs that real people actually use. Here's what I learned. When I talk to developers about AI side projects, the pitch is always the same: "I'm building this thing that parses meeting notes and generates action items." Or "It's like Notion, but AI-native." And then they show me a beautifully designed landing page and a GitHub repo with 400 commits. The reality is that you're competing with every other developer's midnight inspiration. The market is saturated. But worse than that, your own perfectionism is the real enemy. I've seen developers spend four weeks building a custom fine-tuning pipeline when the actual use case needed a simple fetch() call to an existing API. My first shipped MVP in this new batch was painfully simple: a browser extension that rewrites selected text to be more concise. The entire "AI" component is a single API call wrapped in a background script. The whole thing took me a weekend. And guess what? People use it because it solves one specific problem without any friction. If you're building an AI feature, the model is usually the least difficult part. The hard part is everything around it: the user flow, the latency management, the error states, the UI. Here's a concrete example. I built a small endpoint that takes a URL and returns a structured summary. The entire AI part looks like this: from openai import OpenAI import httpx client = OpenAI() def summarize_u

IADev
Interesse
dev.to

EP05: How Simulcast works and what it's for

Episode 5 of 20 in the **PPCDN Low-Latency Live Streaming Course* — building a self-hosted, low-latency live-streaming CDN from protocols to global delivery. Originally published on the PPCDN docs site; see the full course index for all episodes.* Recap EP04 "Transport showdown: RTMP / SRT / WHIP" covered how the three ingest protocols handle loss Next EP06 "Publish/play security: signing, tokens and anti-hotlinking" By the end, the viewer should be able to: Explain Simulcast's underlying mechanism: why "one publish, multiple quality layers" needs no server transcode, and who encodes the layers, where, and how. Explain why Simulcast, not SVC — not an arbitrary choice but a trade-off set by the codec ecosystem today. EP02 said "no transcoding on the network side". EP04 covered the ABR degradation logic Simulcast is not "one encode that the server crops into layers" — the sender produces For example, a 1080p input with Compare the traditional way to get multiple layers without Simulcast: server-side transcoding Simulcast moves that work from "decode then encode on the server" to "encode several copies at no decode, no re-encode, just byte forwarding. That's the technical Someone who knows codecs may ask: isn't Scalable Video Coding (SVC) more bitrate-efficient? Why SVC's idea: the encoded output contains a base layer plus one or more temporal/spatial/ quality enhancement layers, with dependencies between layers. A forwarder can select a subset to forward according to the dependency structure. It is usually more bitrate-efficient than multiple fully independent encodes, but encoding complexity, actual gains and sender compute cannot be generalized. The cost is complexity and compatibility: the SFU/Edge must understand and correctly handle layer identifiers, dependencies and switch points, and the receiver must support the matching codec/profile/scalability mode. VP9 and AV1 commonly use SVC modes in WebRTC; whether H264/HEVC is usable depends on browser, system decoder

Infra
Interesse
dev.to

Node.js Checkout Failure Alerts (Polling Postgres Metrics With Cost Attribution)

For a Node.js checkout worker, a failure count alert should come from Postgres metrics that preserve who incurred each API error and what the attempt cost. A global counter hides both. Short answer: record one sanitized failure fact per checkout attempt, aggregate those facts in Postgres by tenant and error class, and let a Node.js cron worker alert only when a count and cost threshold are crossed inside the same polling window. Keep the first version boring. One query. One decision function. One deduplication key. The hard part isn't sending a notification; it's making sure retries, overlapping polls, and missing attribution don't turn that notification into fiction. The obvious design is a single checkout_failures_total counter. It answers “is checkout failing?” but not “which account should own the investigation cost?” In a multi-tenant healthtech workflow, an alert that combines a validation rejection for one tenant with a database timeout for another creates a number that nobody can act on. It can also encourage a bad response: treating expected user-input failures like infrastructure failures. Cost attribution therefore changes the unit of observation. The useful row is not merely “an error happened.” It carries a stable tenant identifier, a bounded error class, the attempted operation, an integer cost in the smallest currency unit, and a timestamp. Patient data, free-form exception messages, card details, and request bodies don't belong in this metrics path. They increase cardinality, weaken grouping, and create data that an on-call engineer should not need to see. Event facts and alert state stay separate: Postgres owns the durable facts, while the worker owns a small cursor and the record of alerts already emitted. A dashboard can query the same facts, but the dashboard is not the alerting mechanism. If the browser has to stay open, the system is unfinished. Use two thresholds rather than pretending every failure has equal operational weight: a minimum fail

Dev
Interesse
dev.to

Letting a team's AI run commands on shared computers: two layers of permissions and an audit log

Once ChatGPT or Claude can edit files and run commands on your computer through MCP, using it alone is easy. Sharing it with a team raises questions fast: Who asked the AI to do what, on which computer? What if a command the AI ran had an API key in it? Where do you see what someone did after they left the team? Disclosure: I'm the maker of BCD, a hosted remote MCP server that lets AI apps work on your own Mac, Windows or Linux computer. This week I shipped a team activity log, and these are the decisions behind it. Each computer runs a small agent that only opens an outbound connection to a relay. No ports are opened. AI apps (ChatGPT, Claude, Codex) connect by adding https://bcd.snack-wrap.com/mcp as a connector. In a team, each member shares computers they paired. What the computer's owner allows: read / write / run commands / control the screen / clipboard. A new computer starts read-only. The member's team role: admin (everything, plus managing members), builder (read, write, run commands), viewer (read). A member gets the narrower of the two. A builder on a computer its owner left read-only can only read. Every call on a shared computer is recorded, including the owner's own: who, on which computer, through which AI app (ChatGPT, Claude…) what they did (ran a command, read a file, deleted files…), the result, why it failed, how long it took the files and folders, web addresses (without their query) and commands the call named team changes: invitations, joins, role changes, removals, shared computers Never recorded: typed text, file contents, clipboard contents, output. Admins filter by member, computer, result and period, search by file path or command, and export CSV. The team owner picks how long entries are kept: 30, 90, 180 or 365 days. Only admins can see the log. Commands an AI runs tend to carry tokens. These are real outputs of the masking code: curl -H "Authorization: Bearer eyJhbGciOi..." https://api.example.com → curl -H "Authorization: *** ***" htt

IAInfraDev
Interesse
dev.to

Hosted Application Logging for Postgres SaaS: API Workers, Cron Jobs, Europe

TL;DR: Cheap hosted application logging for a Postgres SaaS is useful only when its searchable records can connect the Node.js API, workers, and cron jobs for one AI tutor run. Test that path in a European region before choosing a service. Emit one structured event per boundary, calculate estimated cost from recorded token counts and a versioned rate table, and keep latency as both a total and named step durations. A low ingestion quote is irrelevant if retention, query scans, or uncontrolled payloads make attribution unreliable. That gives a small team a useful unit of work: cost and latency per tutoring run, not a monthly pile of bytes. It also keeps the logging backend replaceable. A European region, searchable JSON, explicit retention controls, export, and predictable limits are requirements to verify during a trial; they are not reasons to organize application code around a provider SDK. A learner asks for help through the API. The agent retrieves course context, calls a model, may call it again after a tool result, writes the final state to Postgres, and queues grading work. Cron jobs later expire abandoned sessions or aggregate usage. The data flow is plain: every boundary emits JSON to standard output, the runtime forwards it to a hosted log store in the required European region, and a search on run_id returns the ordered story. Three identifiers do different jobs. request_id follows the inbound HTTP request. run_id survives queues and retries for the logical tutor run. step_id distinguishes retrieval, generation, persistence, and grading. A retry can create a new attempt while retaining the same run, which is exactly what cost attribution needs. Events need service, environment, event, duration_ms, status, and a timestamp. Model events add input and output token counts plus a stable internal model key. Queue events add attempt number and wait time. Database events record an operation name, never raw SQL parameters or student text. Keep secrets out. No excep

InfraDev
Interesse