// Knowledge.index — 知識庫

Knowledge
in production.

Technical articles, executable examples, and decisions without hype. Written for people who ship software.

61

published articles
EN · OPEN ACCESS

// Latest.entries — 最新記事

Latest articles

01 personal-growth SBI feedback: the "great job, but…" the teammate cannot replay Generic praise plus a “but” leaves no observable act. Write one SBI (situation, behavior, impact) and ask the teammate to restate the request. 7m 02 career Promotion cycle: "be more senior" with no written bar Cycle feedback says \"be more senior\" with no example. Leave the 1:1 with three observable criteria, a team example, and a 90-day check. 9m 03 personal-growth Standup: the AI diff you cannot narrate in 60 seconds The agent wrote the diff and standup asks what changed. Close the diff and narrate intent, area, risk, and verification in 60 seconds without reopening git. 7m 04 java BigDecimal.equals: the 10.0 that misses 10.00 in a balance Map JDK 25: HashMap.get(10.00) is null after put(10.0). equals is false, compareTo is 0. TreeMap hits. long cents or setScale(2) recover the key. 9m 05 java Offset pagination: the item that disappears when the list changes between pages JDK 25: live-list offset/subList duplicates 2 and skips 4 after an insert at index 0. Keyset from the last id keeps [3,4]. An immutable snapshot still works. 11m 06 java mvn test in the coding agent: the *IT that Failsafe never ran JDK 25 and Failsafe 3.6.0: mvn test exits 0 with no failsafe-reports. If the module has *IT.java, the agent gate is mvn verify, not mvn test. 8m 07 java @ConditionalOnProperty without matchIfMissing: the bean that vanishes when the key is absent Spring Boot 4.1.1, JDK 25: matchIfMissing=false plus an absent key starts the app green with no bean. ApplicationContextRunner proves it; two stable fixes. 7m 08 java Duration on @ConfigurationProperties: the YAML 10 that becomes 10 milliseconds On Spring Boot 4.1.1 with JDK 25, timeout: 10 on a Duration binds as 10 ms and the app starts. Compare 10s, PT10S, @DurationUnit and what fails to bind. 9m 09 java Stream Gatherers in Java 25: the sliding window that collect materializes first Moving average of 3 payments with Gatherers.windowSliding on JDK 25, no preview, vs collect+subList. JUnit 6.1.3 tests show where they differ. 9m 10 aws IAM resource-policy Deny: the identity Allow that never takes effect An identity Allow for s3:GetObject does not win if the bucket policy has Deny on the same ARN. Three local JSON files and the User Guide, no account. 8m 11 java JaCoCo on Maven: the line-coverage gate that leaves the error branch untested JaCoCo 0.8.15 / JDK 25: jacoco:check LINE 0.80 passes at 85.7% while the invalid-charge if never runs. BRANCH 0.80 fails at 0.50 on the same .exec. 10m 12 java Jackson in Spring Boot 4.1: the extra JSON field that vanishes on bind and the API does not reject Boot 4.1.1/Jackson 3.1.5: an extra JSON field is dropped and the API returns 200. fail-on-unknown-properties becomes 400; a leftover old name is also unknown. 10m 13 java RestClient in Spring Boot 4.1: the 4xx that becomes an exception and hides the body RestClient 7.0.9 retrieve() on 422 throws UnprocessableContent. The JSON stays on the exception; exchange() and onStatus read it without Testcontainers. 10m 14 java Coding agent that fixes the test: the gate that catches a loosened assert and @Disabled The agent goes green by loosening the assert or adding @Disabled. A local gate reads the src/test diff and Surefire skipped, and passes only the real fix. 12m 15 java @Valid on nested @ConfigurationProperties: the @NotNull that still starts Without @Valid on the nested field, inner @NotBlank does not run at bind and Boot 4.1.1 starts. With @Valid, SpringApplication.run fails. 9m 16 java JUnit 5 in parallel: the test that only fails with more than one thread With Jupiter parallel on, two tests sharing a static Path fail. Reproduce the race and fix it with @ResourceLock, SAME_THREAD or @TempDir. 13m 17 aws IfExists in an IAM policy: the Allow that passes when the context key is missing A missing key under IpAddress is a mismatch, so the Allow grants nothing. With IfExists the condition is true. Three IAM policies show where Allow stays open. 8m 18 java @Transactional in integration tests: the rollback that hides the commit Automatic rollback in a Spring Boot 4.1 test let a duplicate SKU pass that the commit rejects with 409. Where rollback isolates and when to clean up explicitly. 15m 19 ai-agents Do parallel coding agents make a team faster? What still breaks at merge Two agents on the same line conflicted and one decision was dropped; disjoint files merged clean at nearly 2× tokens. Where fan-out pays off. 12m 20 java Did JDK 24 End Virtual Thread Pinning? What Still Holds the Carrier Thread JEP 491 freed synchronized from pinning; native calls still pin the carrier. JDK 21 vs 25 measured, JFR checks, and when the ReentrantLock rule still holds. 12m 21 java JMH benchmarks: why a System.nanoTime loop measures the wrong thing A System.nanoTime loop measures warmup, dead code and the clock. Build a JMH project on Java 25 and read Score and Error before claiming a win. 15m 22 aws Offline IAM Policy Linting with Parliament: Catching Privilege Escalation Before Deploy Parliament 1.6.4 catches iam:PassRole + lambda:CreateFunction/InvokeFunction offline and fails CI before deploy, no AWS account needed. 8m 23 java An unbounded queue in front of a slow call: the GC picks the size LinkedBlockingQueue with no capacity accepts everything until the GC hits a wall. ArrayBlockingQueue, AbortPolicy, and CallerRunsPolicy tested on a real JVM. 10m 24 java Surefire receipt for coding agents: the tests-ok that never wrote XML The agent writes 'tests ok' in chat, but CI breaks because Maven never ran. A local gate only accepts a recent Surefire TEST-*.xml with failures=0 and errors=0. 9m 25 java ArchUnit on Maven: the illegal dependency code review missed A Maven ArchUnit rule catches a domain class depending on a persistence adapter that slipped through code review, using Java 25 and JUnit 6, no Spring. 10m 26 java Java 25 Lets You Validate Before super() — No Static Helper Required JEP 513 in Java 25 lets you validate and normalize subclass arguments before super() — no static helper. Real compile, the exact javac error, JUnit 5 tests. 10m 27 java Resilience4j Bulkhead on Spring Boot 4.1: Keep One Slow Dependency From Starving the Rest Configure Resilience4j Bulkhead per dependency on Boot 4.1 and prove with an in-process WireMock test that a slow payment gateway never starves inventory calls. 12m 28 aws Org Rules on Every Template: CloudFormation Guard Before Anyone Deploys cfn-guard 3.2.1 runs locally, no AWS credentials: org-wide IAM and S3 rules that fail the build before deploy, with real exit codes and a CI gate. 10m 29 java Rate Limiting on Spring Boot 4.1 with Resilience4j: Surviving Traffic Spikes Without Redis In-memory rate limiting with Resilience4j on Spring Boot 4.1: RateLimiterConfig, a deterministic concurrency test, and a 429 with a real Retry-After. 13m 30 aws Testing CDK Stacks Without a Deploy: Assertions and Synth as a Contract How to use cdk synth and aws-cdk-lib/assertions to lock down a CDK stack's properties in CI, before any real deploy hits AWS. 13m 31 java Property-Based Testing with jqwik: The Edge Case Your Fixed Example Misses How jqwik 1.10.1 generates random inputs, catches an overflow a fixed example misses, and shrinks the failure to its minimal case, on plain Java 25. 11m 32 java Saga Pattern: Choreography or Orchestration for Distributed Transactions Without 2PC After the service split: coordinate order, payment, and inventory without 2PC, pick choreography or orchestration, and prove compensation actually ran. 14m 33 ai-agents Prompt Caching in Coding Agents: The Silent Miss That Bills Full Price Again Reordering tools, a stray timestamp, or misplaced project memory silently breaks the cache. Measure it, lock it in CI, and alert before the invoice. 11m 34 java Sealed interfaces instead of boolean-flag soup: model the state Boolean flags accept impossible combinations. Swap them for a sealed interface with records and an exhaustive switch: javac blocks invalid states at build time. 7m 35 ai-agents Sandboxing coding-agent tool calls: filesystem and network isolation before the PR Isolate coding-agent tool calls at the filesystem and network layer with bubblewrap: a reproducible escape test, kernel evidence, and a pre-PR checklist. 10m 36 java Scoped Values in Java 25: Replacing ThreadLocal Without Leaking State Across Pooled Threads Java 25 finalizes Scoped Values: reproduce a ThreadLocal pool leak, use the real API (no bind), and wire StructuredTaskScope while it is still preview. 8m 37 java Mutation Testing in Java: Make Tests Fail for the Right Reason Configure PIT with Maven, investigate surviving mutants, and build a gradual CI gate with Java 25 and JUnit 6. 8m 38 ai-agents Tool Call Telemetry for MCP Agents Track latency, errors, and payload size per tool call in events.jsonl, query it with DuckDB, and enforce a separate CI error gate. 11m 39 aws PrivateLink vs NAT Gateway: Finding the Real Break-Even Calculate when a VPC Interface Endpoint beats NAT Gateway traffic costs, then configure SQS, S3, and DynamoDB with CDK and restrictive policies. 8m 40 ai-agents Versioned Prompts for Coding Agents: Trace Every PR Review Version prompts and tools, record their hashes in usage.json, and compare coding agent revisions against stable golden fixtures in CI. 9m 41 java Graceful Drain in Spring Boot 4.1: HTTP and Workers Configure and verify HTTP and worker drain in Spring Boot 4.1.1 with SIGTERM, SmartLifecycle, and Kubernetes without cutting in-flight work. 10m 42 aws Human Access Across AWS Accounts with Permission Sets Replace human access keys with temporary cross-account sessions using IAM Identity Center, Permission Sets, and AWS CLI v2. 10m 43 ai-agents Project Memory for Coding Agents Starts with Context Packing Build task-specific context for coding agents with byte and token budgets, auditable discards, and fail-closed handling for required files. 12m 44 aws ECS Fargate vs EKS for Java/Spring apps: when the Kubernetes cluster isn't worth the cost Compare cost, operations, and IAM in ECS Fargate and EKS Auto Mode to decide where to run a Spring Boot application on AWS. 12m 45 ai-agents MCP Server with Execute-Verify-Stop and Tool Gating: What the Model Must Not Decide Alone Reject tools/call on the MCP server before side effects, with versioned policy, auditing, and crash-safe idempotency. Spec 2026-07-28 + Python SDK 2.1.1. 14m 46 aws GitHub Actions with AWS OIDC: No More Long-Lived Keys Replace static GitHub Actions keys with OIDC, a restricted IAM role, a permissions boundary, and verifiable failure tests. 10m 47 ai-agents Coding agent with a cost cap: token budget and circuit breaker per task Set a monthly cap, stop long tasks, and bring tokens and cost per PR into CI without exposing prompts or waiting for the bill. 8m 48 aws CloudFront after deployment: cache and invalidation without surprises Configure CloudFront caching, invalidation, and OAC with private S3, predictable headers, and verifiable post-deployment commands. 8m 49 java External configuration in Spring Boot 4.1: which value won See why an environment variable, YAML, or CLI value won in Spring Boot 4.1, and find the value's origin with a minimal application. 9m 50 java AssertJ in Spring Boot 4.1: Failures on the Right Field Use AssertJ with ProblemDetail and MockMvcTester to pinpoint mismatched fields in Spring Boot 4.1 tests without adding redundant dependencies. 8m 51 java Idempotency and outbox in Spring Boot 4.1 without duplicate charges Implement Idempotency-Key and outbox in one JDBC transaction with Spring Boot 4.1, Postgres, and a real Testcontainers test. 12m 52 career Technical career in 2026: the next step is not another framework Trade framework chasing for verifiable seniority in systems, people, and communication, with a 30-minute diagnosis. 7m 53 java StructuredTaskScope in Java 25: fan-out in Spring Boot Organize per-request fan-out with StructuredTaskScope in Java 25, including cancellation, timeouts, tests, and a comparison with CompletableFuture. 8m 54 ai-agents Coding agent in the repository: gates before the first PR Configure AGENTS.md, CODEOWNERS, CI, and auditing before allowing a coding agent to open pull requests in your repository. 9m 55 java OpenShift 4.22 with Java 25: Containerfile and probes on restricted-v3 Package Spring Boot 4.1.1 with Java 25 on UBI 9, pin the image, configure probes, and validate deployment under the restricted-v3 SCC. 9m 56 java Spring Boot Actuator in production: what is worth exposing Configure Spring Boot Actuator endpoints, health checks, readiness, security, and metrics without exposing sensitive production data. 10m 57 architecture Bounded Contexts in Practice: Stop Calling Everything a Microservice Use domain rules, transactions, and data ownership to define boundaries before extracting services from a Spring monolith. 10m 58 java Contract Testing with Pact in Spring Boot: Stop Finding Incompatibilities in Production Create consumer-provider contracts with Pact, verify them in Spring Boot, and block incompatible deployments through Pact Broker. 10m 59 java Reactor and Virtual Threads: When to Parallelize in Spring Boot Learn when parallel and runOn help in Reactor, why subscribeOn does not split items, and how to measure CPU, queues, and latency in Spring Boot. 13m 60 personal-growth Why you reread the same code three times and miss the bug: the cost of forced familiarity Learn to tell visual fatigue from familiarity and try a short routine for reviewing your own code with more attention. 6m 61 java Spring Boot 3 and virtual threads: what really changes in APIs with blocking I/O See when virtual threads help Spring MVC APIs with blocking I/O, with a benchmark, pinning diagnostics, and the path from Java 21 to 25. 12m