AI 资讯
Mastering Turn-Taking in Group Chat: How Two Characters Share One Thread
Mastering Turn-Taking in Group Chat: How Two Characters Share One Thread Building a seamless group chat experience where two characters share a single thread can be surprisingly tricky. While one-on-one conversations with AI are relatively straightforward, introducing a second AI persona into the same chat thread raises a fundamental question: when a user speaks, who answers? We recently launched multi-character rooms on AmorLink, and this article delves into the turn-taking logic we developed. You'll discover why the majority of this logic deliberately avoids calling a language model and explore the contextual challenges that proved more complex than the routing itself. The Pitfalls of Simple Solutions The most intuitive approach is to have "everyone answer every message." However, this quickly devolves into a "press conference" scenario. Imagine asking, "How was your day?" and receiving two stacked paragraphs, each completely unaware of the other. This method also doubles inference costs and increases the time-to-first-token for every turn. Another common, yet flawed, strategy is to "pick at random." While cheaper, it's often more frustrating. If a user asks, "Iris, what do you think?" and the other character answers, the illusion of intelligent conversation shatters instantly. Randomness offers no improvement as the conversation scales. A Ladder Approach to Turn-Taking The key insight is that turn-taking isn't a single problem but a stack of them. The vast majority of these problems have unambiguous solutions. For instance, if a message explicitly names a character or is very short and follows a reply, the decision is clear. Only a minority of turns genuinely require complex judgment. Therefore, our policy is structured as a ladder, prioritizing cost-effective solutions for easy cases and reserving the more expensive AI model for the difficult ones. Our five-rung ladder works as follows, with the first matching condition determining the response: Exactly one memb
AI 资讯
Make AI-Generated HTTP Endpoints Prove Themselves on a Disposable Server
The fastest way to trust a generated API is not to read the code and not even to run its tests locally; it is to make the code stand up as an actual HTTP server and answer real requests before you let it anywhere near a merge request. Most failures in LLM-generated backend code hide between static correctness and runtime truth: a missing dependency that only matters when the process starts, an assumption about a default host, a path parameter that works in pseudocode but not in the framework's route parser, or a response shape that drifts from what the client expects. A local unit test can pass while every one of those problems remains invisible, because the test never starts the process, binds a port, or sends a request over a socket. The loop worth describing is deliberately narrow. Use a free model to draft a small HTTP endpoint from a short specification, then deploy that draft to a disposable server where you can send it real requests, observe the response, and decide whether the generated code deserves to become part of your project. MonkeyCode's free model access and free server option make that loop easy to try without paying for a host or hand-rolling a local container, but the workflow is useful with any model and any temporary runtime you already have. Disclosure: This article was prepared as part of MonkeyCode's product outreach. Start by asking the model for something tiny but externally observable. A health route plus an echo route is enough, because the point is not to demonstrate cleverness but to prove that the generated service can bind, route, validate query parameters, and return JSON under real HTTP conditions. Have it generate a FastAPI application, for example: from fastapi import FastAPI from pydantic import BaseModel app = FastAPI () class Echo ( BaseModel ): message : str @app.get ( ' /health ' ) def health (): return { ' status ' : ' ok ' } @app.post ( ' /echo ' ) def echo ( body : Echo ): return { ' received ' : body . message } That code
AI 资讯
A Free Server Caught the GUI Fallback a Model Buried in a CLI
A small team shipped a CSV validation service. It passed on a workstation. It died three seconds after starting on a free server. This article reconstructs that failure as a reproducible case. It is not a benchmark and not a product review. The point is to show a workflow for finding display dependencies before they reach production. Two availability points made the loop cheap: free model access to draft a fix and a free server option to run headless checks. Disclosure: This article was prepared as part of MonkeyCode's product outreach. The article does not assert model names, quotas, hardware, or uptime guarantees beyond those availability points. The case began with a small request. The service needed to read a CSV file, reject rows with missing columns, and write a short JSON report. The requirement said nothing about a desktop interface. The generated entry point looked ordinary. def main ( argv = None ): args = parse_args ( argv ) if not args . input : from tkinter import Tk from tkinter.filedialog import askopenfilename root = Tk () root . withdraw () args . input = askopenfilename () validate_csv ( args . input ) The local smoke test passed because it always supplied a file. python csv_check.py --input sample.csv That path never touched the fallback. The application then moved to a free server where the default start command had no file argument. The server process reached the Tk() call and failed. _tkinter.TclError: no display name and no $DISPLAY environment variable The problem was not a hallucinated algorithm. The model added a graphical file picker as a hidden fallback. On the workstation that fallback was harmless. On a headless server it was a startup-time dependency. A code review might have missed it because tkinter is a standard-library module and the fallback looked like convenience logic. The environment mismatch only became visible when the no-argument path ran on a machine without a display. The team turned the failure into a deploy gate. The fi
AI 资讯
How Ranex Judges AI-Written Code: The Kernel, Explained
Your agent reports “done — all tests pass.” Do you believe it? Nothing in that sentence is evidence, and the cost of finding out lands on you, later. I’ve been building with AI coding assistants for years, and the failure that kept costing me time was never that the model wrote bad code. It was that the model told me it was done, and I believed it. This post is the mechanism I built so I don’t have to — written out in enough detail that you can judge whether it would hold up against your own agent. Ranex is a kernel — ordinary, inspectable code — that stays outside the AI’s loop and judges every step of its work. It never asks a model what to do next. Rules an agent can read are suggestions; rules compiled into code are constraints. The problem is not that AI writes bad code An AI writing software is a blindfolded dart thrower with a guide shouting coordinates. Two things go wrong, and they’re separate problems: The thrower is blind. It cannot perceive whether its own dart landed, so it reports success either way. The guide is bad. The coordinates were wrong or vague before the throw. There’s a third failure, and it’s the most common one: Most tools let the thrower paint the bullseye around the dart after it lands. One actor writes the code, writes the test, and declares success. That’s why “all tests pass” from an AI means so little — the target moved to wherever the dart went. Notice that none of this gets fixed by a better model. A more capable agent paints a more convincing bullseye — so upgrading the model you point at your repo does not touch this. That’s why I stopped trying to improve the throw and started working on the scoring. Three ports, and only one produces a verdict The architecture is deliberately boring: Model port — one completion, forced structured output. Intake, review, translating machine state into plain language. Stateless. Worker port — an agent with its own loop and tools, running in an isolated git worktree. Returns a diff. Replaceable by
AI 资讯
Building Samar: My 10-Day Voice AI Agent Journey with Murf Falcon
Building Samar: My 10-Day Voice AI Agent Journey with Murf Falcon Over the past 10 days, I built Samar , a multilingual AI voice agent for a Bharat Digital Bank use case as part of the 10 Days of Voice Agents – VoiceForBharat Edition challenge. The project started as a simple voice assistant and gradually evolved into a more complete Voice AI system capable of remembering users, using real-time tools, making outbound calls, escalating sensitive situations to humans, analyzing calls, and handing specialized conversations to another AI agent. 🎯 The Problem Banking can sometimes be difficult to navigate, especially when users need quick information or assistance without going through multiple screens and menus. I wanted to build a voice-first banking assistant that could provide natural conversations while also maintaining security and knowing when it should involve a human. That's where Samar comes in. 🤖 What is Samar? Samar is a multilingual banking voice agent designed to help users with general banking-related queries. It can: Answer general banking questions Provide financial information Remember returning users with consent Fetch real-time information using tools Find nearby branches Provide exchange-rate information Make outbound reminder calls Escalate sensitive issues to human support Track call analytics Hand specialized conversations to a specialist agent The voice experience is powered by Murf Falcon , the fastest TTS API used in this challenge. 🏗️ How the System Works At a high level, the voice interaction follows this flow: User Speech ↓ Speech-to-Text ↓ LLM / Agent Logic ↓ Memory or Tool Calling ↓ Text-to-Speech ↓ User hears the response The system uses real-time voice communication through LiveKit, an LLM for reasoning and conversation, speech recognition for understanding the user, and Murf Falcon for natural voice generation. 🚀 Important Features 1. Voice AI with Guardrails Samar has a clear banking role and follows safety rules. It does not ask users
AI 资讯
Building AarogyaMitra: My 10-Day Journey Building a Voice AI Agent for Healthcare Access
From a Simple Voice Conversation to a Multi-Capability Healthcare Voice Agent Over the past 10 days, I had the opportunity to participate in 10 Days of Voice Agents — VoiceForBharat Edition , a challenge focused on learning how to build practical, real-world voice AI agents. Instead of treating the challenge as just a series of coding tasks, I wanted to build something around a problem that genuinely matters: making healthcare access more conversational and accessible through voice. That idea became AarogyaMitra — a voice-first healthcare access assistant designed to interact with users naturally, provide useful assistance, use tools when required, remember relevant user context, and involve humans or specialist agents when the situation requires it. This article documents my journey, the architecture behind the project, the important features I built, the challenges I faced, and what I learned while developing a real-time voice AI system. What is AarogyaMitra? AarogyaMitra is a voice AI assistant focused on the Health Access track of the VoiceForBharat challenge. The goal is simple: Make healthcare assistance more accessible through natural voice conversations. Many digital healthcare experiences assume that users are comfortable reading, typing, navigating menus, and interacting with conventional applications. Voice can provide a more natural alternative. Instead of searching through menus or typing a question, a user can simply speak to the assistant and have a conversation. AarogyaMitra is designed around this idea. The core objectives are: Make healthcare-related interactions more conversational Provide a simple voice-first interface Use AI tools when additional information or actions are required Maintain useful context during conversations Follow safety-oriented guardrails Escalate situations that require human assistance Route specialized requests to a specialist agent AarogyaMitra is intended to assist users, not replace qualified healthcare professionals .
AI 资讯
Finding, Verifying, and Adapting the Right Skills for Your Project
Skills are reusable workflows, not magic knowledge pills. Before you install one, inspect its source, versions, and effects to confirm it fits your project. Start with a few focused skills and adapt them to what already exists. A skill is a set of instructions and scripts that lets an agent reproduce a specialized method. It doesn’t guarantee best practices or compatibility with your repository. The official documentation for tools like Claude Code and Codex explains how skills work under the hood. Project rules, documentation, and skills serve different purposes. Official documentation describes technology features, repository conventions are captured in files like AGENTS.md , and skills provide reusable workflows. Mixing these roles leads to confusion and wasted context. Start your search in this order: official skills from the tool’s publisher, official technology docs, resources from recognized organizations, manually inspected community skills, and finally skills you create specifically for your project. Stars and downloads can signal adoption, but they don’t prove correctness. Before adding a skill, verify its origin, technical currency, possible actions, and compatibility with your project. Ask who maintains it, which versions it targets, whether it contains executable scripts, and whether it respects your existing architecture. If a script is unclear, don’t run it just because it comes with a skill. Contradictory skills increase noise and make decisions harder to explain. Two or three reliable workflows are more useful than a collection of twenty skills. For a mini-dashboard, start with a TypeScript review, a React and Next.js review, and a testing strategy tailored to expected behaviors. If no reliable skill matches your needs, write a short procedure adapted to your repository. A minimal skill can formalize a specific review, like verifying that a dashboard metric is typed, validated, displayed, and tested correctly. This keeps the workflow focused and rep
AI 资讯
CanineWhisperer
What I Built Overview & Purpose Canine AI Whisperer is an intelligent multimodal veterinary ethology and behavioral intelligence platform designed to bridge the communication gap between dogs and their humans. Our core goal is to transform modern canine care by translating subtle physical micro-signals, acoustic vocalizations, and behavioral telemetry into actionable, real-time guidance—preventing behavioral escalation and strengthening the bond between pet parents and their dogs. Key Capabilities & Architecture Multimodal Visual Posture Decoder (Gemini Vision AI) Analyzes real-time camera streams or uploaded photos to detect subtle body language cues (ear carriage, commissure tension, tail angles, pupil dilation, and weight distribution). Generates instantaneous ethological diagnoses, arousal scores (0–100), and step-by-step de-escalation action plans. Acoustic Bark Spectrogram & Translation Captures live canine vocalizations to extract fundamental frequency harmonics (Hz), sound pressure intensity (dB), and temporal cadence. Accurately classifies barks, whines, growls, and howls into emotional motivations (e.g., territorial alert, separation distress, predatory excitement) with human-language translations. Canine Voice Synthesis (ElevenLabs Neural Audio) Gives dogs their own distinctive "inner voice" based on tailored ethological personas (e.g., The Hyperactive Herder, The Philosophical Frenchie, The Regal Retriever). Generates spoken translations and calming vocal cues using custom neural text-to-speech. Ultrasonic Whistle & Restorative Sound Studio Features a Web Audio tone generator capable of transmitting silent ultrasonic frequencies (up to 22,000+ Hz) for immediate recall and attention redirection without human disruption. Includes restorative harmonic frequencies (432Hz delta calm, 396Hz distress release, and 60 BPM maternal heartbeat loops) for crate conditioning and thunderstorm anxiety. Snowflake Data Cloud & Cortex ML Analytics Simulates an enterprise-g
AI 资讯
Building Shiksha: My 10-Day Voice Agent Journey with Murf Falcon
For the last 10 days, I have been building a voice agent called Shiksha as part of the 10 Days of Voice Agents — VoiceForBharat Edition challenge by Murf AI. My original idea was simple: Build a voice agent that can help students learn through natural conversation. Over the challenge, that idea grew into a complete voice-based learning system with memory, tools, human escalation, call analytics, and a specialist agent . What is Shiksha? Shiksha is a voice-based learning partner for students. Instead of typing questions and reading answers, a student can simply talk to Shiksha. A student can: Ask learning questions Take quizzes Continue learning with their saved profile Get help when they are stuck Practice mathematics Get transferred to a Maths Specialist when needed The main goal was to make the experience feel more like a conversation than a traditional chatbot. Tech Stack Component Technology Real-time voice LiveKit Speech-to-Text Deepgram LLM Gemini Text-to-Speech Murf Falcon Backend Python Memory SQLite Call analytics Flask + SQLite External data Open Trivia Database The voice experience is powered by Murf Falcon , which was one of the main parts of the challenge. How Shiksha Works At a high level, the system looks like this: STUDENT │ ▼ LiveKit Real-time Audio │ ▼ Deepgram Speech-to-Text │ ▼ Gemini Agent Reasoning │ ┌────────────┼─────────────┐ │ │ │ ▼ ▼ ▼ Memory Tools Handoff SQLite Quiz API Maths Specialist │ │ │ └────────────┴─────────────┘ │ ▼ Murf Falcon Text-to-Speech │ ▼ STUDENT This was the basic architecture that I built and expanded throughout the challenge. What I Built 1. Student Memory One of the first things I added was a simple memory system using SQLite. Shiksha can store: Student name Current learning level Topics covered Last interaction This means the agent can use information from previous conversations instead of starting from zero every time. 2. Real Tool Calling For quizzes, I didn't want the agent to always generate questions from memor
AI 资讯
Container Image Signing & SLSA Provenance Verification with Sigstore Cosign
Container Image Signing & SLSA Provenance Verification with Sigstore Cosign Supply chain security guide on signing OCI container images keylessly and verifying SLSA build provenance using Sigstore Cosign and Rekor. Executive Summary & Key Takeaways Keyless Image Signing: Sign OCI container images in CI/CD using OIDC identity tokens (Fulcio CA) without managing private keys. Immutable Transparency Log: Record signature metadata in the public Rekor transparency log to prevent signature tampering. SLSA Provenance Attestation: Attach cryptographically signed SLSA build provenance attestations to container images. Kyverno Policy Enforcement: Block un-signed or non-compliant container images from running in Kubernetes clusters. 1. Software Supply Chain Risks & Container Image Signing Container registries (Docker Hub, GHCR) store execution binaries for enterprise applications. If an attacker compromises CI/CD credentials or registry access, they can replace legitimate container tags with malicious images containing backdoors. Sigstore Cosign eliminates supply chain tampering by cryptographically signing OCI container images during the CI/CD build process. Using keyless signing powered by Fulcio (certificate authority) and Rekor (transparency log), Cosign binds OIDC identities (e.g., GitHub Actions workflow identity) to container digests without long-lived private keys. This ensures that container images running in Kubernetes can be traced back to exact GitHub workflow runs. Keyless signing eliminates the security liability of storing long-lived signing keys in CI/CD secrets. Cryptographic digest binding guarantees that tag overwrite attacks are detected immediately by container runtimes. Implementing automated continuous monitoring across production nodes ensures that compliance policies remain enforced during infrastructure updates. Regular security audits should be integrated into DevOps CI/CD pipelines to verify that system configurations conform to zero-trust architect
AI 资讯
Claude Code can make videos: it records the app, narrates with ElevenLabs, and syncs audio to video automatically
I'm a solo builder. I needed a 2-minute product demo for ClinTrialFinder — a free tool I built that matches cancer patients to clinical trials. I can fumble through OBS and iMovie, but I'm not proficient — and Claude Code does it faster. So I asked Claude Code — an agentic coding tool — to make it. And it did: a narrated walkthrough where the voiceover lands exactly on the on-screen action. I never opened a screen recorder. I never opened a video editor. I never manually lined up a single caption to a single frame. Here's the video it produced . This post is about the three things the agent did to make it — because I think that combination is new. 1. It recorded the app — no screen recording Instead of me screen-capturing a session by hand, the agent wrote a Playwright script that drives the real, live web app : it opens the site, fills out the 10-step patient wizard with a synthetic case, submits, and records the finished results page — all headless, straight to video. That means no manual take, no re-shooting when I fumble a click, no "oops the mouse jittered." The recording is code , so it's deterministic and repeatable. When the product changes, the agent re-runs the script and out comes a fresh clip. It even injected a fake cursor that glides between elements, because a headless recording has no real mouse pointer. 2. It generated the narration — no microphone I didn't record a voiceover. The agent wrote the narration script, then called the ElevenLabs text-to-speech API to synthesize it in a clean, consistent voice. If I want to change a line, it edits the text and regenerates that clip in seconds — no re-recording, no "let me find a quiet room," no matching my tone across takes. // the agent calls ElevenLabs per narration phrase const res = await fetch ( `https://api.elevenlabs.io/v1/text-to-speech/ ${ VOICE } ` , { method : ' POST ' , headers : { ' xi-api-key ' : KEY , ' Content-Type ' : ' application/json ' }, body : JSON . stringify ({ text , model_id : '
AI 资讯
What I Learned Stealing Ideas from Matt Pocock’s `.agents` Directory
What I Learned Stealing Ideas from Matt Pocock’s .agents Directory If you’ve spent more than ten minutes on TypeScript Twitter, you know Matt Pocock. He’s the guy who made zod and TS generics feel approachable. But a few weeks ago, I stumbled onto something more interesting than his type gymnastics: a repo called mattpocock/skills , which is literally a dump of his .agents directory. At first I thought it was a joke. Then I realized it’s a goldmine for anyone building AI-assisted coding workflows. This isn’t a “prompt engineering” fluff piece. This is about how a working engineer structures the instructions, context, and guardrails that an AI agent needs to actually ship code without wrecking your codebase. Here’s what I learned, what I copied, and what I’d change. The Problem: Your AI Agent Is Only as Good as Your Defaults Let me set the scene. You’ve got Cursor, or Claude Code, or some other agentic tool. You ask it to “refactor this function.” It does. Then you realize it: Renamed a public API that three other files depend on. Used a pattern your team explicitly banned six months ago. Wrote tests that mock everything so they pass but assert nothing. Sound familiar? The root cause isn’t the model. It’s that you gave the agent zero context about your project’s conventions. Most people write a two-line system prompt and expect magic. Matt’s approach is different: he treats the agent like a junior engineer who needs a detailed onboarding doc, not a mind reader. His skills repo is essentially a set of Markdown files that define, in explicit terms, how the agent should behave in specific situations. Think of it as a CONTRIBUTING.md for your AI pair programmer. What’s Actually in the Repo (Don’t Just Clone It) I’m not going to paste the whole thing here—go read it yourself (link: github.com/mattpocock/skills ). But structurally, it breaks down into a few key categories that matter. 1. Role and Tone Definitions The first thing you’ll notice is that Matt doesn’t just say
AI 资讯
Building Roshni: A Real-Time, Multi-Agent Financial Voice AI for Bharat 🇮🇳
Building Roshni: An Ultra-Low Latency, Multi-Agent Financial Voice Assistant for Bharat 🇮🇳 How I built an end-to-end, multilingual financial voice AI using Murf Falcon, LiveKit Agents, Deepgram Nova-3, Google Gemini, and Next.js during the 10 Days of AI Voice Agents Challenge. 🌟 1. The Problem & Why Voice Matters for Bharat In India, financial inclusion has accelerated rapidly with UPI, digital banking, and government-backed credit initiatives. However, navigating complex interest rates, eligibility criteria for government schemes (like PM Mudra or Sukanya Samriddhi Yojana), and understanding formal banking terms remains intimidating for millions of citizens—especially in regional and tier-2/3 heartlands where digital interfaces can be overwhelming. Text-first interfaces fail where voice thrives. When rural entrepreneurs or first-time bank customers have questions, they don't want to navigate complex web forms or read dense PDFs. They want to ask a direct question in their language and get an immediate, clear, spoken answer. To solve this, I built Roshni AI (and her specialist counterpart, Vikram ) — an ultra-low latency, conversational financial assistant engineered for natural voice interactions in English, Hindi (Devanagari script), and Hinglish. 🏗️ 2. High-Level Architecture & Tech Stack Building a real-time conversational agent requires synchronizing four core pipelines with sub-second latency: [ 👤 User Microphone ] │ (WebRTC Audio Stream) ▼ ┌─────────────────────────────┐ │ LiveKit Agents Worker │ └──────────────┬──────────────┘ │ ┌───────────────────────┼───────────────────────┐ ▼ ▼ ▼ ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐ │ Deepgram │ ────► │Google Gemini│ ────► │ Murf Falcon │ │ Nova-3 │ │ (LLM) │ │ Fast TTS │ │ (Fast STT) │ │ │ │ (Anisha / Samar)│ └─────────────┘ └──────┬──────┘ └────────┬────────┘ │ (Tool / Handoff) │ ▼ ▼ ┌───────────────┐ [ 🔊 Audio Output ] │ SQLite Memory │ │ & Analytics │ └───────────────┘ The Stack: TTS (Text-to-Speech):
AI 资讯
What Did That Free-Model Setup Script Actually Do? Audit It With Honeypot Files and Syscall Traces
Here is why this article is worth your time: you cannot tell what a generated setup script does by reading the diff. A diff shows you the words that will run, not the files that will be touched, the network connections that will be opened, or the directories that will be wiped at execution time. For a small patch, manual review may be enough. For a server initialization or cleanup script produced by a free model, the danger is in the side effects you never see in the source. This guide turns that problem around. Instead of trying to predict behavior from generated code, you run the code inside a fake root filesystem and record the operating system calls it makes. The technique uses honeypot files, a minimal chroot, and strace to produce a syscall journal. It works especially well when you can generate the script with a free model and run it on a free Linux box that you are allowed to throw away afterward. Disclosure: This article was prepared as part of MonkeyCode's product outreach. If you have MonkeyCode's free model access and free server option available, you can use that server as the throwaway Linux box described in the examples below. The commands assume a Linux host where you can install strace and have root privileges, which is common for a disposable cloud instance or a small virtual machine you control. Build a fake root before you run anything Create a directory that will act as a minimal root filesystem. You do not need a full distribution; you only need enough structure for the script to attempt its operations and for you to watch what it touches. mkdir -p fake_root/bin fake_root/tmp fake_root/var/log fake_root/home/user fake_root/.ssh Inside this fake root, place simple executable stubs so that commands like ls , cat , and rm do not fail immediately. Use /bin/sh from the host in the chroot command later, or copy a static shell into the fake root if available. The important part is not completeness; it is observability. Create executable placeholders f
开发者
Gravy Theory: three chickens, one base
This is a submission for Frontend Challenge - Comfort Food Edition Perfect Landing. What I...
AI 资讯
Dogfooding BlocSignal on the Web: Building a 100K Ops/sec Reactive App with Jaspr and Dart 3.13
Building Pure Dart Web Apps Without Compromise When developers evaluate Dart for the web, they typically face a stark tradeoff: Flutter Web : Exceptional for canvas-driven applications, design systems, and cross-platform desktop/mobile parity—but heavy for content-first landing pages, docs, and fast-loading SEO sites. Jaspr Web : A lightweight, component-driven framework that compiles pure Dart to HTML and CSS with instant first paint and full search engine indexing. When we built the official documentation and showcase site for BlocSignal , we knew Jaspr was the perfect foundation. But like many engineers diving into a new UI paradigm, our initial implementation took a shortcut: we used raw StatefulComponent lifecycles and manual .subscribe() callbacks to wire up our state machines. It worked—but it wasn't idiomatic. In this behind-the-scenes case study, we walk through the process of dogfooding bloc_signals_jaspr across blocsignal.dev , replacing manual subscription glue with declarative consumer components, achieving 100,000 operations/sec in compiled JavaScript , and exploring the sheer developer ergonomics of Dart 3.13 primary constructors . The "Manual Subscription Trap": Why Raw .subscribe() Fails at Scale In classic Flutter or Jaspr development, when you create a state machine without framework-level consumer widgets, you might be tempted to subscribe inside initState() : // ❌ THE ANTI-PATTERN: Manual subscription glue in StatefulComponent class LiveVisualizerState extends State < LiveVisualizer > { late final LiveCounterBloc _bloc ; @override void initState () { super . initState (); _bloc = LiveCounterBloc (); // ⚠️ Flaw 1: Every state change triggers a full component setState _bloc . state . subscribe (( _ ) { if ( mounted ) setState (() {}); }); } @override void dispose () { // ⚠️ Flaw 2: Manual dispose tracking _bloc . close (); super . dispose (); } } While this appears harmless in a simple counter demo, it introduces three severe architectural flaws:
AI 资讯
Environment Variables the Safe Way
Why Environment Variables Matter Every app has secrets: API keys, database URLs, admin passwords. Hardcoding them in source code is a one-way ticket to leaks. Even if your repo is private, you never know who forks it or what CI logs expose. Environment variables are the standard way to keep configuration out of code. But using them safely requires a few habits that go beyond just process.env . The Basics: Loading and Accessing In Node.js, you read env vars with process.env . But you should not access them raw everywhere. Create a central config module that validates and exposes them. // config.js const required = [ ' DB_URL ' , ' API_KEY ' , ' PORT ' ]; for ( const key of required ) { if ( ! process . env [ key ]) { throw new Error ( `Missing required env var: ${ key } ` ); } } module . exports = { dbUrl : process . env . DB_URL , apiKey : process . env . API_KEY , port : parseInt ( process . env . PORT , 10 ), }; Fail fast at startup. If a required variable is missing, crash immediately rather than failing later in a confusing way. Never Commit .env Files Tools like dotenv load variables from a .env file for local development. That file must stay out of version control. Add .env to your .gitignore immediately. Also add .env.local , .env.production , etc. if you use them. Instead of committing the actual values, commit a .env.example with placeholder or fake values. This documents what is needed without exposing anything. # .env.example DB_URL = postgres :// user : password @ localhost : 5432 / mydb API_KEY = your - api - key - here PORT = 3000 Use a Validation Library Manual checks are fine for small projects, but for anything serious use a schema validator like envalid or joi . They give you type coercion, defaults, and clear error messages. // with envalid const { cleanEnv , str , num } = require ( ' envalid ' ); const env = cleanEnv ( process . env , { DB_URL : str (), API_KEY : str (), PORT : num ({ default : 3000 }), }); module . exports = env ; This catches m
AI 资讯
Building a Zero-Cloud Android Service: Privacy by Architecture
It happened during a quiet Friday sermon at the local masjid. The room was dense with silence, the kind that feels heavy and intentional. Suddenly, a jarring ringtone shattered the atmosphere—someone’s phone, vibrating against the hardwood floor. It wasn't my phone, but the collective wince of the entire room was visceral. A hundred people stopped mid-thought, turning their heads toward the source of the noise. I sat there, my own phone tucked in my pocket, realizing that I had almost been that person just a week prior. It was a moment of pure, avoidable human friction. We live in an age where our devices are supposed to be smart, yet they consistently fail at the most basic context-awareness. I found myself manually toggling my sound profile before every meeting, lecture, or appointment. It is a recurring cognitive tax. If I remembered, great. If I forgot, I risked social embarrassment. Even worse, once the meeting ended, I would inevitably leave my phone on silent for the rest of the day, missing important calls from family or clients. Existing solutions often felt like overkill—they required account creation, constant background sync to a cloud server, or permissions that felt invasive for a task as simple as changing a volume setting. I wanted something that lived entirely on the device, functioning as a silent, invisible utility that didn't need to 'phone home' to function. When I started building Muffle, I decided early on that the entire architecture would be zero-cloud. This wasn't just a philosophical choice; it was a technical constraint I imposed to ensure the app remained performant and trustworthy. By forcing myself to avoid backend dependencies, I had to rely heavily on Android’s AlarmManager and ForegroundService patterns. The biggest challenge was the 'Prayer Time' trigger. Most developers would reach for a Firebase Cloud Function to calculate these times based on the user's location. Instead, I integrated the Adhan library locally. I had to handle c
开源项目
Five tabs open, one refresh token — the race nobody noticed
A user reports that they keep getting logged out. Not immediately — after a while, randomly, always...
AI 资讯
I Run 85 Docker Containers as a Solo Founder. Here's the Bash That Keeps It Alive.
85 containers. 24 PostgreSQL databases. 67 domains. 232 cron jobs. One developer. 120 EUR/month in Hetzner bills. This is not a startup fantasy pitch. This is my production infrastructure for a SaaS ecosystem serving German golf clubs, a golf school management platform, a community platform, a CRM, and an auth service. Every customer gets their own database. Physical tenant isolation, not software filters. People tell me this cannot work. The containers disagree. The Stack Next.js for all frontends. Single-tenant PostgreSQL per customer (Supabase stacks). Docker on bare metal. Coolify for deployment orchestration. Traefik as the reverse proxy handling 67 domains. Two Hetzner servers in Germany. Total infrastructure cost: 120 EUR/month. The single-tenant architecture is a deliberate trade-off. Multi-tenant saves infrastructure cost, but one RLS bug exposes every customer's data. One compromised tenant enables lateral movement to all others. GDPR Article 17 deletion in multi-tenant requires complex cross-tenant queries. In single-tenant, deletion is DROP DATABASE . No residual risk. The cost is more operational complexity. Which is exactly why automation is not optional. 176 Guard Rules: The Immune System My AI agents (Claude Code with custom hooks) execute roughly 80% of daily development and operations work. That is dangerous without constraints. So I built a guard system: 176 shell scripts that fire on every command, every file edit, every session end. The architecture is simple. Four dispatchers route to context-specific guards: #!/bin/bash # Pre-Bash-Dispatcher: Loads guards based on command profile. # Not all 176 guards fire on every command. Profiling classifies # each command (git, docker, npm, database, deploy, comms) and # loads only relevant guards. set -uo pipefail GUARDS_DIR = " $( dirname " $0 " ) /guards" INPUT = $( cat ) CMD = $( echo " $INPUT " | jq -r '.tool_input.command // ""' ) # 8 security gates fire ALWAYS, non-negotiable: # tabu-gate, pii-gate,