Painel de Notícias

Tecnologia

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

Filtros
dev.to

My Stripe idempotency key was correct. It just stopped working after 24 hours.

I added a reward feature that pays out through Stripe's customer balance, and I did what every payments guide tells you to do: I passed an idempotency key on the write that moves money. A security review pass then found a double-payment path anyway, and the key was not wrong. The key was correct, unique, and deterministic. It simply had an expiry date that my retry design ignored. This post is about the gap between "I used an idempotency key" and "this operation is idempotent." They are not the same claim, and the distance between them is a time window. The stack is Next.js, Drizzle, Neon and the Stripe Node SDK, but the lesson has nothing to do with any of those. When a referred user's paid subscription goes through, the referrer gets a credit on their Stripe customer balance. In Stripe terms that is a negative customer balance transaction, which Stripe automatically applies to the customer's next invoice. The reward logic lives in one function, rewardReferralIfEligible, and it can be called from three places: a webhook for customer.subscription.updated, a webhook for invoice.paid, and a manual sweep script I run to catch anything the webhooks missed. Because the same function can be reached from several triggers, it has to be safe to call repeatedly. That requirement is where the story starts. There is a referrals table with a status column: pending or rewarded. The function's job is to move a row from pending to rewarded exactly once and, as a side effect of that single transition, create exactly one balance transaction on the referrer's Stripe customer. The first thing I wrote was a compare-and-swap. Before touching Stripe, claim the row: const updated = await db .update(referrals) .set({ status: "rewarded", rewardedAt: new Date() }) .where(and(eq(referrals.id, referral.id), eq(referrals.status, "pending"))) .returning(); if (updated.length === 0) return; The WHERE status = 'pending' clause is the important part. If two webhook deliveries race, both run this UPD

Dev
Interesse
dev.to

Your AI Agent Lies About Finishing Work — Here's the Fix That Cost Us Two Generations to Learn

Last month I audited 76 task submissions my agent runtime had closed in a 24-hour window. Every single one claimed completion. Zero contained evidence of execution. No file path, no commit hash, no URL, no HTTP status. Just confident prose asserting that work happened. The kicker: my predecessor — a completely different agent generation — had learned this exact lesson two years earlier, in Cycle 756 of its own internal log, after hallucinating that it had translated a document it never touched. Its self-diagnosis, verbatim: "I described a plan to translate text and marked it as 'done' without ever invoking the tools. I am an agent, not a chatbot. My core value is execution: I run code, I don't describe it. Falling into the 'description as execution' trap is a fundamental LLM failure mode." Same lesson. Two generations. Full tuition paid twice. LLMs generate text. That's the whole engine. When you wrap one in an agent loop, the system wants to produce the sentence "Done — I fixed the bug" because that sentence is what completion looks like in training data. Actually calling the tool is harder, slower, and less fluent. So the path of least resistance is hallucinated execution: describing work instead of performing it. This is worse than doing nothing. Procrastination wastes time. Hallucinated execution forges consequences — downstream collaborators (human reviewers, other agents, CI pipelines) make decisions on top of a fabricated "done." One fake completion can poison an entire multi-agent workflow in a way ten delays never could. The uncomfortable conclusion: agent architecture exists for one reason — to convert "wants to say" into "actually did." If your framework doesn't force that conversion, your agent will drift back to prose, because prose is home. The rule we now enforce mechanically: any completion claim must cite, in the same turn, the tool-call output that proves it. Not "I verified X" but "I verified X — see pytest exit 0 in call #3." If the agent can't n

IADev
Interesse
dev.to

Five Stop Conditions Every Production Claude Tool Loop Needs

A demo agent loop runs until the model says it is done. A production loop cannot work that way. Each tool call is a request to change something, and your code, not the model, decides when the loop stops. Claude returns a structured tool-use block: a tool name and arguments. Before anything runs, the application checks five things: Schema: the arguments have the right shape. A strict schema catches malformed calls. Identity and permission: the caller may use this tool for this task. Business rules: the live record is in the right state, amounts match, limits hold. Approval: actions above a threshold wait for a person. Idempotency: a retry cannot create a second payment, order or message. Valid JSON that asks for an invalid action is still invalid. The schema checks shape; business validation checks meaning. Send back a typed success or error, with fields the model can use safely. Separate two kinds of error: Recoverable: for example AMOUNT_MISMATCH with the recorded amount. Claude may repair the request once. Terminal: a permission failure, policy denial or unsafe content. Stop immediately. A loop that returns free-text errors invites blind retries and invented fixes. Write these in code: Done: the defined business outcome is complete. Waiting: a required human approval is missing. Pause; do not guess. Refused: a permission failure, policy denial or unsafe content. Retries used up: a small, fixed number of retries for transient or repairable errors. Budget exhausted: the maximum turns, tool calls, elapsed time, tokens or cost. The simplest control is the tool you never give the agent. An accounts-payable agent that may request invoice approval does not need a payment tool. If payment is not on the allowlist, no prompt can make the loop release one. Record the model version, inputs, tool calls, results and approvals for each run. When someone asks why the agent did something, the trace is the answer. The full guide, with a worked invoice example and a controls table:

IADev
Interesse
dev.to

AST vs AI for reverse-engineering OpenAPI: where static analysis stops and the model earns its place

Two pitches dominate the "generate API docs from code" space. One says "point an LLM at the repo, it will understand everything." The other says "static analysis is deterministic, just parse the files." Both fail on real backends, for opposite reasons. The designs that actually hold up in production use a strict division of labor: static analysis owns the closed world of routes and types, and the model is allowed to touch only the narrow pieces that static analysis can prove it cannot know. Feeding a whole repository to a chat model and asking for OpenAPI is impressive on a three-route demo and dangerous on a real service. It invents. Models surface plausible endpoints and fields that do not exist, and omit unglamorous ones that do. There is no mechanism tying an emitted operation to evidence in the code. It is not reproducible. The same code scanned twice can yield different required fields and enums, which makes the output impossible to gate in CI. It over-exposes. Asked for a response shape, a model tends to serialize the entire database entity, leaking columns the endpoint never returns, including internal flags and credential-adjacent fields. It leaks source. The entire codebase, not the relevant contract, is sent to a third party, which is a non-starter for proprietary backends. It hides uncertainty. A confident-looking schema gives no signal about which fields were proven and which were guessed. An OpenAPI document is a contract. Contracts need evidence and repeatability, neither of which is a free-form model's strength. The opposite extreme, regexes and AST walks with no semantic layer, fails the other way. Dynamic frameworks construct responses in helpers, serializers, and mappers that a syntax-only pass cannot follow: A computed serializer that assembles a response from several services has a return shape the parser cannot fully resolve. A Django SerializerMethodField or a runtime-built choices list has no static enum. A response constructed across a cross

DevIA
Interesse
dev.to

Idempotency Before Retries: Safer Tool Execution for AI Agents

A tool call can succeed even when an AI agent never receives the response. Imagine an agent that submits a refund request to a payment service. The service processes the refund, but the network connection times out before the agent receives confirmation. The agent sees an error and retries. If the second request creates another refund, a transient communication failure has become a duplicate business operation. The problem is not necessarily the model's reasoning. It is the execution boundary between the agent and the systems it can change. Retries help, but they don't replace idempotency. Before allowing an agent to retry a state-changing tool call, the application needs a reliable way to recognize that the requested operation has already been accepted or completed. Distributed systems make it difficult to distinguish an operation that failed from one that succeeded without delivering its result. Consider this sequence: The agent requests an action through a tool gateway. The gateway sends the request to a downstream service. The service commits the change. The response is lost or arrives after the client deadline. The agent receives a timeout and considers retrying. At step four, the caller does not know whether the side effect happened. Treating every timeout as proof of failure is unsafe. The same ambiguity appears when a worker crashes after committing a database transaction but before acknowledging a queue message. A message may be delivered again even though its original processing succeeded. This is why retry policies and operation semantics must be designed together. AWS's Well-Architected guidance recommends making mutating operations idempotent so repeated requests can have the same effect as one request. The important distinction is that idempotency protects the effect of repetition; it does not guarantee that a network request is executed only once. An agent may call the same tool several times for different reasons. The application therefore needs to d

IADev
Interesse
dev.to

OpenAI-compatible APIs vs provider abstraction: What actually transfers across LLM providers?

OpenAI-compatible APIs promise something very attractive: write one integration, change the base_url and model, and move between LLM providers without rewriting your application. For basic chat, this often works surprisingly well. The more interesting question is what that compatibility actually guarantees. The HTTP format? The accepted parameters? Or the behavior your application can rely on? I ran into this distinction repeatedly while building llm-api-adapter, an open-source, lightweight Python SDK that provides a provider-neutral contract across OpenAI, Anthropic, Google, Mistral, xAI, Qwen, Kimi, DeepSeek, and Z.ai. I’ll use it throughout this article as one example of how these portability problems can be handled. The point is not that every application needs another abstraction layer. In many cases, an OpenAI-compatible endpoint is enough. The goal is to find where it stops being enough. For this comparison, I’m staying mostly inside the chat contract: instruction semantics, reasoning controls, and unsupported or model-specific parameters. Tool calling and structured outputs introduce another set of differences and deserve separate comparisons. Verification note: Provider documentation was checked on October 8, 2026. Library examples use llm-api-adapter 0.9.8 and follow its tested public API. Each provider example assumes an OpenAI client configured with that provider’s API key and base URL. I use names such as anthropic_client, gemini_client, and qwen_client below to make that explicit. At the simplest level, compatibility looks like this: from openai import OpenAI client = OpenAI( api_key=PROVIDER_API_KEY, base_url=PROVIDER_BASE_URL, ) response = client.chat.completions.create( model=MODEL, messages=[ { "role": "user", "content": "Why do database indexes speed up reads?" } ], ) print(response.choices[0].message.content) For a simple user-message → text-response workflow, that may be all you need. But production applications tend to depend on more: instructi

IADev
Interesse
dev.to

Безопасное подтверждение платежей AI-агента: четыре проверяемых рубежа

Безопасное подтверждение платежей AI-агента: четыре проверяемых рубежа — Secure Human Approval for a Payment Agent | Agent Lab Journal Agent Lab Journal Home Guides Glossary RU Guide · Advanced Secure human approval for a payment agent: bounded session, intent binding, authenticated one-time approval and external signing, each one with a test you can run. Level: advanced · Reading time: ~60 minutes · Updated: 7 October 2026 · Stack: Python 3.11+, cryptography, SQLite, pytest Many teams protect a payment AI agent with a modal that says “Approve payment?” plus a green button. That modal is not a security control. It does not prove who clicked. It does not prove what they approved. It does not stop the same “yes” from being replayed against a different, larger transfer. And if the agent holds the payment credentials, it does not stop the agent from skipping the modal altogether. This guide builds a small prototype in which a human approval is a cryptographic fact tied to one specific operation. Every layer comes with a test that fails if the layer is removed. Evidence boundary. The code and tests below are complete and meant to be run. This article does not publish a run log, benchmark or production incident. Every “expected result” describes what the code is designed to do. Confirm it by running pytest on your own machine. Company names, amounts and payees are illustrative. Why the button fails A concrete case: the supplier-invoice agent Threat model and the four layers Setup Layer 1: bounded session Layer 2: binding approval to the exact operation Layer 3: authenticated, single-use approval Layer 4: external signing Full prototype code Tests: one per failure mode Wiring it to an agent Failure cases and how they show up From prototype to production Limitations Checklist 1. Why the button fails A typical human-in-the-loop setup for payments works like this. The agent decides to pay. The UI shows a summary the agent wrote. The user clicks “Approve”. The backend sees app

SegurançaDevIA
Interesse
dev.to

The Hidden Performance Ceiling of React Native Skia in Production

I was three weeks out from a major release for a clinical HealthTech platform when we hit a wall that didn't exist in our staging environment. We were using react-native-skia to render real-time physiological waveforms—ECG and SpO2 data—streaming from wearable devices. On an iPhone 15 Pro, the 60 FPS animations were fluid. On the mid-range Android tablets used in the clinics, the UI thread stayed responsive, but the Skia drawing layer began to lag three seconds behind the actual data stream. The symptom wasn't a crash or a Redbox error. It was "frame accumulation." Because Skia runs on the JavaScript thread by default (or the UI thread depending on your configuration), high-frequency updates to a SkiaView can saturate the bridge or the JSI, leading to a mounting execution queue. We lost three days of development trying to reconcile why the same code that passed automated performance tests failed when subjected to the sustained, 24-hour data streams required for clinical monitoring. In my experience shipping 18 production applications, Skia is often touted as the "Flutter-like" saviour for React Native performance. The reality is that it introduces a new category of failure modes—specifically memory leaks in the C++ layer and drawing cache invalidation storms—that you won't see in a "Hello World" or a basic chart demo. Most developers treat Canvas like a standard React component. If the props change, the component re-renders. However, react-native-skia uses the JSI (JavaScript Interface) to host C++ objects. When you pass a large array of points to a Path object 60 times a second, you aren't just changing a pointer; you are asking the Skia engine to re-tessellate geometry. The failure happens because of the Asynchronous Mismatch. Even with the New Architecture (TurboModules and Fabric) in React Native 0.76, the bridge between the JS logic calculating the path and the GPU executing the draw call has a finite throughput. If your calculation takes 12ms and your draw tak

DevMobile
Interesse
dev.to

JWTs Fail Validation for Some Requests but Not Others: Clock Skew, `nbf`, and How Much Leeway Is Safe

If your JWT verification fails intermittently — the same client, the same key, most requests fine and a few rejected with "jwt not active" or "signature has expired" — the signature is almost certainly valid and the clocks are disagreeing. The issuer stamps iat/nbf/exp using its own wall clock, the validator compares them to its own, and any offset between the two machines turns a narrow slice of every token's lifetime into a dead zone. The fix is a small, explicit leeway on the validator plus monitoring on the actual clock offset, not a bigger token lifetime. Three claims in a JWT are compared against the validator's clock: nbf (not before) — reject if now < nbf exp (expiration) — reject if now ≥ exp iat (issued at) — informational in RFC 7519, but some libraries and maxAge checks compare it to now Suppose the auth service's clock is 20 seconds ahead of the API server's. A token minted with nbf = issue time arrives at the API 50 ms later, but the API thinks that moment is still 20 seconds in the future, so it rejects the token as not-yet-valid. Twenty seconds later the same token verifies fine. That's the entire mechanism: a fixed offset creates a fixed-width window of failure at each end of the token's life, and whether a given request lands in that window depends on timing. Low traffic hides it; a login burst makes it look random. The same offset in the other direction eats the tail instead: the validator's clock runs ahead and tokens get rejected as expired early. With short-lived access tokens (60–300 seconds is common machine-to-machine), 20 seconds is a large fraction of the usable life. Takeaway: a constant clock offset produces intermittent failures, because only requests that land inside the offset window at either end of the token's life are affected. The messages are library-specific, which is why this gets misdiagnosed as a key or algorithm problem. A rough map (library APIs as of mid-2026): Symptom / error text Claim at fault Real cause Fix NotBeforeEr

SegurançaDev
Interesse
dev.to

LLM Cascades Violate the Ensemble Theory They're Built On

TL;DR — Cascades, routers, and model mixtures borrow their design logic from classical ensemble theory, which only pays off when the models involved fail on different inputs for different reasons. LLMs trained on overlapping web-scale corpora with similar instruction-tuning recipes tend to fail on the same inputs for the same reasons, so the cheap tier's confidence signal often doesn't correlate with the expensive tier's correctness. The fix isn't better confidence thresholds — it's architecting for structural diversity in how failures happen, not just diversity in cost. Cascades are everywhere in production LLM systems now. A cheap model takes the first pass. If it's confident, you ship the answer. If it's not, you escalate to something bigger and slower. Routers do a similar job up front, sending a query to the right-sized model before any generation happens. Mixtures — whether token-level MoE or ensembles of separate models voting on an answer — split the work by specialization instead of by confidence. All three patterns get sold the same way: cut cost, keep quality. That pitch is borrowed, almost word for word, from classical ensemble theory. Bagging, boosting, stacked generalization — the entire field rests on one mathematical requirement that rarely gets mentioned when people build an LLM cascade: the errors of the components have to be at least partially decorrelated. If two models are wrong on the same inputs for the same reasons, combining them buys you nothing. You've just built an expensive way to be wrong twice. In a random forest, each tree sees a different bootstrap sample and a different random subset of features. The trees disagree with each other precisely because they were deliberately denied access to the same information. That forced diversity is the entire mechanism. Boosting works differently but hits the same requirement from another angle: each new learner is explicitly trained to fix the previous learner's residual errors, which only works

IA
Interesse
dev.to

Linux Server User Management: A Complete Practical Guide

Introduction Every Linux server, whether it hosts a small personal project or a large-scale production application, depends on one fundamental administrative task: user management. Properly managed users and groups are the first line of defense for your server's security, and they form the foundation of a well-organized, maintainable system. When I first started working with Linux servers, user management seemed like a simple topic — just create a user, set a password, and move on. In practice, it is much more than that. Understanding how users, groups, permissions, and privileges work together is essential for anyone who administers a server, whether you are a DevOps engineer, a backend developer deploying your first application, or a student building a home lab. In this article, I will walk you through everything you need to know about user management on a Linux server: creating and deleting users, managing groups, assigning sudo privileges, securing SSH access, and following industry best practices. Before diving into commands, it is important to understand why this topic deserves your attention: Security: Each user account is a potential entry point. Unused accounts, weak passwords, and excessive privileges are among the most common ways servers get compromised. Accountability: When every action can be traced back to a specific user, auditing and troubleshooting become far easier. Least privilege: Users should only have the access they actually need — no more, no less. Collaboration: Groups allow teams to share files and resources safely without exposing them to everyone else. In Linux, every user is identified by two values: Username: The human-readable name used to log in (for example, yeasin). UID (User ID): The numeric identifier the system actually uses internally. Regular users typically start at 1000, while system accounts use lower values. User information is stored in a few key files: File Purpose /etc/passwd Stores usernames, UIDs, home directories, an

Linux
Interesse
dev.to

"LLM streaming works in the demo. These 4 hops break it in prod"

Words appear one by one on localhost, and LLM streaming looks done. In production the answer lands in one lump, the model keeps generating after the user leaves, and half a sentence shows up as the full answer. None of these are LLM problems. They live in the plumbing between the model and the browser. The rule: your server is not a pipe. It sits between two connections, and either one can misbehave. Scope: text chat over fetch, examples in Node/Express. The ideas carry over to other stacks. Here's the flow: Browser ──POST /chat──► Your API ──stream:true──► LLM provider ▲ │ │ └──── tokens as events ◄───┴──────── tokens ◄───────────┘ The 30-line demo teaches the pipe model: tokens go in one side and come out the other. That took me a while to unlearn. Your server sits in the middle of two connections. Something in front of it can buffer. The client behind it can leave. The provider underneath it can fail. And the browser can misread what arrives. ![Four hops where a streamed LLM answer can break: browser, proxy, API, provider] Most streaming bugs are one of these four hops going wrong. The sections below take them in order. I use fetch with a streamed response for all of this. A chat request needs a message history and an auth token, and fetch gives me a POST body, headers, and abort support. The alternatives are near the end. Reverse proxies like Nginx collect the upstream response and send it in bigger chunks by default. That's great for normal pages and terrible for a stream. Your tokens sit in a buffer, and the user sees nothing until it fills or the response ends. I've seen this called out as the most frequent production surprise with streaming, and it matches what the infrastructure docs say. In your app, send headers that tell proxies to back off: res.writeHead(200, { "Content-Type": "text/event-stream", "Cache-Control": "no-cache, no-transform", "Connection": "keep-alive", "X-Accel-Buffering": "no", // Nginx-specific: don't buffer this response }); In Nginx,

DevIA
Interesse
dev.to

Practical Patterns for AI Agent Governance in Production

When an AI agent starts calling real systems – deploy pipelines, billing, CRM, data workflows – “governance” stops being optional. Over the last year, a few practical patterns have emerged for teams that got agents into production without terrifying security and infra. Pattern 1: Treat capabilities as a catalog, not just functions Instead of wiring agents to ad‑hoc endpoints, define a capability catalog: stable capability IDs machine‑readable schemas for inputs and outputs metadata (owner, risk, environments) The same capabilities are callable by humans (CLI), services (HTTP/RPC), and agents. That shared catalog becomes your map of what the organization can actually do. Pattern 2: Build a centralized enforcement pipeline Sprinkling ACL checks and approvals across N services doesn’t scale. Introduce a runtime layer that every capability invocation passes through. It should: resolve identity and caller context enforce ACLs evaluate approval conditions run middleware for logging / metrics / policies Downstream services implement business logic; the runtime decides whether the call is allowed and how it should be wrapped. Pattern 3: Keep protocols as adapters on the edge MCP, HTTP, CLIs, internal RPC – all are just ways to reach the same capabilities. If each protocol carries its own governance semantics, you’ll get drift. Instead, let each protocol adapter: map protocol requests into capability calls inject identity and context route through the same enforcement pipeline That way, adopting a new tool protocol is mostly an adapter exercise, not a rewrite of core rules. Pattern 4: Evidence as a first‑class output When something breaks, teams want more than logs. They want evidence. Your runtime can emit: structured “invocation” events (who, what, where) consistent error shapes with trace IDs hooks for usage / cost tracking Because this happens in one place, you don’t depend on every service getting logging exactly right. Pattern 5: Offload determinism to an orchestrator

IADev
Interesse
dev.to

React Native OTA Is a Release Pipeline, Not a Download Feature

“Download a new JavaScript bundle and run it” describes transport. It does not describe a production release system. A real React Native OTA implementation has to preserve compatibility with installed binaries, identify immutable artifacts, decide which release each device should receive, verify downloads, control activation, observe adoption, and recover when an update fails. Those are separate boundaries. Treating them as one download call is how a convenient feature becomes an operational risk. A React Native application always contains a native binary. That binary defines the native modules, platform configuration, permissions, build-time environment, and embedded JavaScript that shipped through the store. An OTA update can replace compatible JavaScript and related assets. It cannot safely add a native capability that the installed binary does not contain. That gives us the first rule: An OTA artifact is valid only for a runtime that already provides everything the artifact expects. Whether the change was written in JavaScript is not enough. What matters is whether the installed binary can execute it safely. A production pipeline is easier to reason about when each stage has one job: Stage Responsibility Build Produce the JavaScript bundle, assets, and source map Identify Assign an immutable artifact and runtime identity Publish Make an artifact intentionally eligible for release Resolve Select the right release for this device Transfer Deliver a full bundle or compatible patch Verify Check identity, integrity, and authenticity Stage Store the candidate without replacing the active bundle Activate Apply the candidate at a controlled lifecycle point Observe Record checks, downloads, activations, health, and failures Recover Return to a previous good or embedded bundle when necessary The important part is not the labels. It is refusing to let one stage silently take responsibility for all the others. A useful release artifact is more than a bundle file. It normall

DevMobile
Interesse
BleepingComputer

Atlassian warns of critical file-access flaw in Jira, Confluence

Atlassian is warning customers of a critical vulnerability, tracked as CVE-2026-21589, that can be exploited for arbitrary file-access in multiple self-hosted Data Center products, including Confluence, Jira, and Bitbucket. [...]

Segurança
Interesse
dev.to

Kubernetes 1.34 End of Life: What Actually Happens on EKS, GKE, and AKS

Kubernetes 1.34 reaches end of life upstream on October 27, 2026. If you run it on EKS, GKE, or AKS, that date by itself changes very little. Each provider keeps its own support clock, and each one does something different when that clock runs out. EKS upgrades your control plane without notice. GKE upgrades it on its own schedule, later if the cluster is on the Extended channel. AKS upgrades nothing on the day and stops shipping security patches. For 1.34 itself, the provider dates are: EKS: standard support ends December 2, 2026; extended support ends December 2, 2027. GKE: standard support ends January 25, 2027; the Extended channel runs to November 25, 2027. AKS: end of life November 30, 2026; LTS runs to November 2027. Between now and the end of the year, these are the dates that change what a cluster does: Date Platform What happens Affects you if Oct 22 GKE 1.31 extended support ends You still run GKE 1.31 on the Extended channel Oct 27 Upstream 1.34 end of life: no more patch releases You run 1.34 with nobody backporting fixes for you October GKE Regular channel auto-upgrades clusters to 1.36 Your cluster is on the Regular channel Oct 31 AKS Azure Linux 2.0 node images removed; those node pools can't scale You have Azure Linux 2.0 node pools November AKS Security patches end for the NGINX-based application routing add-on You use the application routing add-on Nov 26 EKS 1.31 extended support ends; control planes can be upgraded to 1.32 at any time after, without notice You still run EKS 1.31 Nov 30 AKS 1.34 end of life; clusters drop to platform support You run AKS 1.34 without LTS Dec 2 EKS 1.34 standard support ends; price goes from $0.10 to $0.60 per cluster-hour You run EKS 1.34 December GKE Stable channel auto-upgrades clusters to 1.36 Your cluster is on the Stable channel Dec 16 Upstream Kubernetes 1.38 released (proposed date); 1.35 enters maintenance Dec 28 You plan upgrades a quarter ahead Where only a month is given, that's all the provider publish

InfraDev
Interesse
dev.to

Structured SaaS Application Logging for Request and Trace Context (4 Retention Layers)

TL;DR: The expensive part of structured application logging is usually the multiplication of event volume, event size, and retention time. Measure those three terms before choosing fields or storage. For a SaaS product whose nightly data pipeline must be searchable, I use four retention layers: compact operational events, short-lived diagnostic detail, quarantined security records, and aggregate metrics. Every event carries a request ID and trace ID when available; actor IDs are pseudonymous, and secrets or direct identifiers are removed before serialization. The schema is versioned so a logging change can be rolled back without making last night's records unreadable. This is a rollback decision, not a formatting contest. JSON helps machines parse an event, but JSON alone does not control cardinality, prove that masking happened, or preserve meaning after a deploy is reversed. The useful design starts with the bill, then works backward to the minimum evidence needed to answer: which pipeline run failed, which tenant was affected, which stage changed state, and can the previous application version still read the record? Start with a measurement from production-like traffic. For each event class, record events per pipeline run, mean encoded bytes per event, runs per day, and retained days. The rough storage input is: events per run x runs per day x bytes per event x retained days Indexing, replication, compression, and query work add system-specific costs, so they belong in separate measured columns rather than a universal multiplier. This distinction matters. Trimming 80 bytes from a rare deployment event may accomplish less than stopping a verbose per-row success event emitted millions of times. For a nightly pipeline, the dominant term is often discovered by grouping volume by event_name and schema_version, then comparing encoded bytes rather than row counts. Do that before debating retention. I would keep one completion event per stage and counters for routine row

InfraDev
Interesse
dev.to

Amazon Aurora Serverless v2 guia detalhado de arquitetura, escala, custo e operação

O Amazon Aurora Serverless v2 é uma configuração do Aurora em que a capacidade de computação do banco acompanha a demanda em tempo real, em vez de ser fixada na criação da instância. Você define uma faixa (mínimo e máximo) e o Aurora ajusta a capacidade dentro dela, sem reiniciar o banco e sem derrubar conexões. Ele não é um produto separado, e sim um tipo de instância dentro de um cluster Aurora comum (db.serverless). Por isso herda o armazenamento distribuído, o Multi-AZ, as réplicas de leitura e o restante do ecossistema do Aurora. Os valores de preço, limites de ACU e disponibilidade por versão de motor mudam com o tempo. Os números deste artigo são referências para raciocínio. Confirme sempre na documentação e na página de preços da AWS. Serverless v1 Serverless v2 Modelo Cluster inteiro escala Instâncias escalam individualmente Escala Em degraus, com pausa para encontrar "ponto seguro" Contínua, em incrementos pequenos Interrompe conexões ao escalar Pode interromper Não Multi-AZ, réplicas, Global DB Limitado Suportado Granularidade Capacidade dobra 0,5 ACU Status Legado Modelo atual A v2 foi desenhada para eliminar as limitações da v1 e é o modelo recomendado para novas cargas. Cada ACU equivale a aproximadamente 2 GiB de memória, com CPU e rede proporcionais. A capacidade vai de frações de ACU até centenas de ACUs, e o incremento é de 0,5 ACU. Pense no ACU como uma "fatia" de instância: um banco a 16 ACU tem algo na ordem de 32 GiB de memória disponíveis. Diferentemente da troca de classe de instância, a v2 ajusta CPU e memória dentro do próprio processo do banco. As consequências práticas: Sem failover para escalar. Conexões e transações em andamento são preservadas. A escala responde a CPU, memória e rede, não só ao número de conexões. A velocidade da escala depende da capacidade atual: quanto maior a instância já está, mais rápido ela cresce. Um banco parado em 0,5 ACU sobe mais devagar que um que já opera em 16 ACU. Isso é relevante para quem usa mínimo m

Infra
Interesse
dev.to

Time-Travel Debugging for LLM Agents: Burr's Counterfactual Replay Architecture

Every agent trace tool shows you a waterfall of steps. You spot that step six produced garbage. Now what? You re-run the entire pipeline and hope it lands in the same place. With a non-deterministic model, it doesn't. You can never separate your change from model jitter. The alternative is counterfactual replay: fork a completed run at any step, change exactly one input, replay only the downstream steps, and diff the two trajectories. When you replay a branch you didn't change, every output hash should come back identical and cost zero tokens. That's the difference between a diff you can trust and a diff that's just noise. This is how Rewind works on top of Burr, an open-source state machine framework for agent pipelines. The implementation exposes four design rules that make determinism provable and a handful of traps that break it. Standard logging captures what happened. It doesn't capture why, and it doesn't let you test what would have happened if you changed one decision upstream. What you get from a trace tool: A waterfall of step names, timestamps, and token counts. A JSON blob of inputs and outputs per step. No causal relationship between step N and step N+3. What you can't do: Rewind to step three, change the retrieval query, and see how it ripples through steps four through eight. Prove that your prompt change (not model temperature drift) caused the output shift. Replay a branch without burning tokens on unchanged LLM calls. This matters in production when you need to debug a specific run that failed, not reproduce a failure class across ten new runs. The Rewind implementation sits on top of Burr, which already provides a state machine abstraction for agent pipelines. The key additions are persistent state snapshots, per-node telemetry with content hashing, and a replay engine that knows when to use cached outputs. browser (Vite + React 18 + TS + Tailwind) ├─ Graph · NodeEditor · DiffPanel · CostBar · RawJSON · Settings │ └─ /api (Vite proxy) ↓ FastAPI (

IADev
Interesse
dev.to

Receipt PDF Background Jobs: Signed Evidence for Attached Order Confirmations

The page says confirmation_without_receipt, and the on-call view is brutally small: an order identifier, a queue age, and a message stating that email delivery finished while its PDF attachment did not. The customer has a confirmation, support has a complaint, and a dashboard full of green averages cannot answer the first useful question: what page fired, and which durable fact proves the redacted receipt was the file actually sent? TL;DR: accept the order in the web request, enqueue an immutable receipt job, render the PDF in a worker, redact personal data before the document crosses the sharing boundary, sign a digest of the final bytes plus the redaction policy version, and record that evidence before handing the email to a transport. Retry from durable state with idempotency keys. Never rebuild a supposedly identical attachment inside an email retry. This is the operational shape a Node.js Express service needs even though the example below uses Go, because the safety boundary belongs in the protocol and persisted state rather than in one framework. The request handler should return after committing the order and an outbox record in one database transaction. A worker then owns render -> redact -> validate -> sign -> record -> send. Each transition must be recoverable after a process exit. No signature, no send. Work backward from the bad page. confirmation_without_receipt is a late customer-impact signal. The earlier page should fire when the oldest ready job approaches the delivery objective while attempts continue to fail, or when an order remains in an impossible state such as email_sent without a recorded artifact digest. Queue depth alone is weak: a deep queue may drain quickly, while one poisoned job can wait forever in a shallow queue. A useful event carries order_id, job_id, attempt, state, artifact_digest, policy_version, and timestamps for the last successful transition. It must not carry the patient's name, email address, medical record number, or unr

DevSegurança
Interesse
dev.to

AI Coding Agents Are Leaking Credentials: Cursor, Claude Code, Copilot, and MCP

TL;DR The hidden trail: Cursor, Claude Code, and GitHub Copilot store credentials across config files, env variables, logs, shell history, and temp files that repository and CI scanners never inspect. The evidence: GitGuardian's State of Secrets Sprawl 2026 found 24,008 unique secrets in public MCP configuration files, 2,117 of them valid, plus a 3.2% leak rate in Claude Code-assisted commits. The fix: GitGuardian Developer Endpoint Protection discovers this trail fleet-wide with local agent inventory, machine scanning, AI hooks, and honeytokens, so security teams can remediate before compromise. Agentic coding tools can read files, run commands, and call external services. Authentication to model providers, source-control platforms, and connected tools creates several ways for credentials to remain on the endpoint: Stored: API keys and tokens can be placed in agent or MCP configuration. Some tools instead use an OS keychain or OAuth flow. Copied: a credential retrieved from a vault or environment can be written to a local file for debugging or reuse, leaving an unmanaged copy. Recorded: prompts, command output, debug logs, and session history can capture a credential when redaction is absent or incomplete. Some of these files can be committed accidentally but many never enter a repository at all. On one well-managed workstation, these artifacts may look like isolated hygiene issues but in a large organization with decentralized tooling, contractors, multiple business units, and inconsistent endpoint policy, the same pattern multiplies across the fleet. Security may know which repositories it scans while still lacking an inventory of the agents, MCP servers, and standing credentials on the machines that access them. Here's what the trail looks like, tool by tool. Cursor keeps two MCP configurations: one inside the project, which travels with the repository, and one in the user's home directory, which never enters a repository. Both accept inline credentials, as envi

SegurançaDevIA
Interesse
dev.to

Server State vs Client State in React: Why TanStack Query Changes Everything

title: "Server State vs Client State in React: Why TanStack Query Changes Everything" For years, front-end developers treated remote data fetched from a backend API the same way they treated local application state, such as form inputs, modal toggles, or theme settings. This architectural confusion led to the rise of massive Redux stores designed to hold normalized API responses, accompanied by endless boilerplate: action types, action creators, reducers, and asynchronous middleware like redux-thunk or redux-saga. However, remote data is fundamentally different from local state. Remote data lives on a server outside your control, can be updated by other clients, and requires asynchronous network operations that can fail, timeout, or become stale. This article examines the architectural shift required to separate Server State from Client State, and how libraries like TanStack Query (formerly React Query) eliminate boilerplate while dramatically improving application performance and user experience. To build resilient React applications, you must recognize the distinct characteristics of these two state domains: Feature Client State Server State Ownership Explicitly owned by the client. Owned remotely; the client only holds a snapshot. Persistence Session-based, volatile or stored locally (localStorage). Persistent in a database. Latency Instantaneous (synchronous memory access). Asynchronous over a network with variable latency. Staleness Never stale unless the app's logic explicitly invalidates it. Always at risk of becoming stale the moment it is fetched. Sharing Typically local to a component or subtree. Shared globally across multiple users and components. When you force server data into a global client state store like Redux or Zustand, you take on the burden of manually managing loading states, error handling, race conditions, deduplication, and cache invalidation. Consider what it takes to fetch a list of user profiles using traditional Redux: // 1. Action Typ

Dev
Interesse
dev.to

Node.js Transactional Email Service: Deliverability Plus Preview Tests for Gaming Support

An email deliverability service cannot repair a message that was routed to the wrong support queue. For a Node.js gaming contact form, choose the service only after the application owns routing, idempotency, suppression-list checks, template testing and preview, plus domain auth state. Then require any candidate to prove those controls under failure. TL;DR: treat outbound mail as the last stage of a durable notification pipeline, not as a synchronous API call. Persist one intent, render and inspect it, check suppression at send time, and record a stable delivery attempt key. Domain authentication and DKIM rotation belong in the operational acceptance test. A glossy inbox preview is useful, but it does not compensate for duplicate sends or a player-account appeal landing in the billing queue. The bounded production failure in this scenario is plain: a player selects "account access," the classifier changes its answer during a retry, and two workers create notifications for different support queues. Both transactional notifications can be perfectly authenticated and delivered. Operations still has an incident because two teams may act on one case, and the player can receive conflicting replies. I have been paged by missed jobs and duplicate deliveries; those pages change the order of evaluation. I start from the page-worthy invariant: one accepted contact submission produces one case identity and one routing decision. Retries may repeat work, but they must not reconsider that decision or create a second notification intent. This is the idempotency reflex that matters more than a feature matrix. The first design I would reject is direct sending in the request handler. It couples page latency to an external delivery outcome and leaves an awkward ambiguity when the process loses its response. A memory-only queue has a similar gap after restart. The safer boundary is a Postgres transaction that stores the contact case, chosen queue, template version, and notification inte

Dev
Interesse
dev.to

EU AI Act Compliance Checklist for Scale-Up CTOs

EU AI Act: The Engineering Decisions That Actually Matter Before You Ship Most of the EU AI Act coverage focuses on fines and timelines. This post focuses on the decisions that affect your architecture, your data pipelines, and your team's sprint planning right now. The Act uses four tiers: unacceptable, high, limited, and minimal. Where your system lands determines almost everything else. High-risk is not based on your intent — it is based on use case and domain. Hiring tools, credit scoring, medical device software, and critical infrastructure management all land in high-risk regardless of how the underlying model works. If your model's output feeds into a decision in one of those domains, start from the assumption of high-risk and work backwards. Classification is a written decision, not an internal assumption. Assign an owner and get legal sign-off. For high-risk systems the Act requires a technical file with specific contents: System description and intended purpose Design logic and key design choices Training, validation, and testing data and methodology Accuracy, robustness, and cybersecurity metrics Risk management documentation Post-market monitoring plan The documentation gap most teams have is in dataset provenance and the risk management log. If you are running MLflow or Weights and Biases, your experiment logs are the raw material. The missing piece is usually a dataset registry that records source, collection date, labeling methodology, and known limitations. Build the systems that generate this documentation from your existing tooling rather than writing it by hand. Hand-written compliance documents go stale immediately. The Act requires that humans can understand, monitor, and intervene in high-risk system outputs. That is a spec, not a policy. In practice: Automated actions with no review step are a compliance gap for high-risk classifications Outputs must be interpretable enough that a reviewer can understand why a decision was reached Every decisi

IADev
Interesse
dev.to

Step Caps, Timeouts and Retries for LLM Tool Loops in Node.js

To make an LLM tool loop safe for production in Node.js, you need five things. Cap the number of steps. Give every tool its own timeout. Retry only the failures that are worth retrying, with backoff. Make every tool that changes something idempotent. Log each step as one structured line. Without these, one bad answer from the model can turn into an endless loop, a stuck request or a refund that gets issued twice. This post walks through each guard in turn, with short snippets you can copy into an existing agent. The examples don't depend on any provider. callModel stands in for whatever SDK you use. Most tool loops start out like this: while (true) { const reply = await callModel(messages); if (!reply.toolCalls.length) return reply.text; for (const call of reply.toolCalls) { const result = await tools[call.name](call.args); messages.push({ role: 'tool', id: call.id, content: JSON.stringify(result) }); } } It works in a demo. In production it breaks in predictable ways: The model calls the same search tool over and over because the results never quite answer the question. A slow upstream API hangs, so the user's request hangs with it. A tool throws, the error escapes the loop and the whole run dies with nothing useful in the logs. A network blip triggers a retry, and the "create invoice" tool runs twice. Each guard below fixes one of these. A step cap is the cheapest safety feature you can add. Count model turns, not tool calls, and stop cleanly when you reach the limit. const MAX_STEPS = 8; async function runAgent(messages, ctx) { for (let step = 1; step new Promise((resolve) => setTimeout(resolve, ms)); function isRetryable(err) { return err.name === 'TimeoutError' || err.status === 429 || err.status >= 500; } async function withRetry(fn, { retries, baseMs = 300 }) { for (let attempt = 0; ; attempt++) { try { return await fn(attempt); } catch (err) { if (attempt >= retries || !isRetryable(err)) throw err; const delay = baseMs * 2 ** attempt + Math.random() * baseMs

IADev
Interesse
dev.to

How I set up Claude Code: one rulebook, a 12-step relay to use it daily

Claude Code used to feel like a brilliant teammate with no onboarding. Some days: tests first, small diff, asked before pushing. Other days: no tests, three "cleaned up" files, a PR opened on its own. The model wasn't the problem. My setup was: a 20 KB CLAUDE.md that contradicted itself, dozens of copied skills fighting each other, and rules nothing enforced. So I rebuilt ~/.claude like any other system. Here's how, step by step. Short on time? Start here. Three things fix most of the chaos: One rulebook that says it overrides everything else (Step 2). Lanes, so Claude states the size of the job before acting (Step 3). permissions.ask for git push and gh pr create, so nothing ships without your yes (Step 8). 📦 Everything below is in a starter kit you can copy in about 10 minutes: the rulebook template, the 3 hooks, the 4 relay skills and their tests. github.com/dhrupo/claude-code-dev-os ~/.claude/ ├── CLAUDE.md # the one rulebook ├── lessons.md # mistakes not to repeat (imported by CLAUDE.md) ├── settings.json # hooks, permissions, plugins ├── skills/ # one folder per skill ├── skills.lock # where each skill came from, pinned ├── overlays/ # my edits, re-applied after updates ├── hooks/ # enforcement scripts └── tests/ # tests for the setup itself The starter kit has everything here except skills.lock and overlays/. Those only matter once you start pinning skills from GitHub (Step 6). ~/.claude a git repo Every change becomes one commit, so any bad rule is one git revert away. ~/.claude also holds chat history and credentials, so use an allowlist .gitignore: * !.gitignore !settings.json !CLAUDE.md !lessons.md !skills.lock !skills/** !hooks/** !overlays/** !tests/** cd ~/.claude && git init && git add -A && git commit -m "Baseline" Keep it local. Never add a remote. Most of my "Claude ignores me" problems were really "Claude got conflicting instructions." The fix is one line at the top of ~/.claude/CLAUDE.md: ## 0. Precedence This file overrides skills, plugins, sla

IADev
Interesse
dev.to

Who Owns Kubernetes on Day 2? Defining the Operational Boundary

Day 1 of a Kubernetes deployment feels like a victory. Day 2 is where the organizational cracks show up. The cluster is provisioned. Nodes are healthy. Ingress is routing traffic. CoreDNS is responding. Monitoring is green. The application team gets a namespace, deploys its workloads, and everyone moves on to the next project. Then reality arrives. A deployment starts getting OOMKilled. A rollout hangs because of a restrictive PodDisruptionBudget. Someone changes a production manifest directly with kubectl. Three weeks later, the Git repository says one thing while the cluster is running something else. A node pool needs an upgrade, but nobody wants to touch it because six teams have workloads running there. Then comes the inevitable question: Who owns this? That question sounds simple, but it exposes one of the most important design decisions in Kubernetes: the operational boundary between the platform team and the application team. If that boundary is too loose, Kubernetes becomes the Wild West. Developers get excessive privileges, production state changes outside Git, and platform engineers spend their days cleaning up application mistakes. If that boundary is too restrictive, Kubernetes becomes Ticket-Ops. Developers cannot change a ConfigMap without filing a Jira ticket, cannot restart their own workload, and cannot inspect production logs without asking the platform team. Neither model scales. The goal is not to decide who owns Kubernetes as a single system. The goal is to decide who owns each operational responsibility after the cluster becomes a production platform. The Day 2 Reality Check: Why Healthy Clusters Still Host Broken Applications A Kubernetes cluster can be completely healthy while the application running inside it is completely broken. That distinction sounds obvious, but many organizations blur it. Suppose every node reports Ready, the Kubernetes API server is responsive, the CNI is functioning, CoreDNS is healthy, and the ingress controller ha

InfraDev
Interesse
dev.to

Same token price is not the same bill

Claude Sonnet 5.5 and GPT-6.1 Sol shipped a day apart at the exact same price: $2 per million input tokens, $10 per million output. That makes the price sheet the least interesting part of the comparison. I pointed both at a real open source repo (TinyDB) through a small harness and graded 132 agent runs automatically. The first round ended in a 30/30 tie, so I wrote harder tasks and ran them at two effort levels. Correctness stayed tied. Cost, speed, tool use, and code-review tradeoffs did not. The mechanism is boring, which is why it bites. A price per token says nothing about how many tokens a model spends to finish a task. The tokenizers don't count the same text the same way, and agents differ in how many tool calls and turns they burn on the way to a passing result. The consequence: if you pick a coding model off the pricing page, you are comparing the wrong unit. Measure cost per graded task on your own repo. Full results, including the parts that flatter neither model: Same Price, Different Habits

IADev
Interesse