Daily Tech Briefing
AI 科技速览

每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。

AI 快讯
Dev.to AI · 2026/8/1 09:02:59

Sole developer on a national SSO platform for six months, with Claude writing most of the code

AI 中文解读
【Sole developer on a national SSO platform for six months, with Claude writing most of the code】Solution architect, 17 years in. From roughly December 2025 to July 2026 I was the only hands-on developer on the identity and single-sign-on layer for a Gulf country's national port community system ...
<p>Solution architect, 17 years in. From roughly December 2025 to July 2026 I was the only hands-on developer on the identity and single-sign-on layer for a Gulf country's national port community system — the platform that fronts its ports and logistics sector. It's live in production.</p> <p>I want to be precise about "sole," because it matters: other people committed to both repos — CI, automation tests, a few fixes, downstream integration work. I authored ~80% of backend commits and ~70% of frontend. Nobody else did hands-on feature development on the core system. That's the honest version.</p> <p><strong>Volume, straight from <code>git log --numstat</code>:</strong></p> <ul> <li>602 commits, ~184,000 lines changed across 1,423 files</li> <li>Backend: 383 Java files / ~21k LOC, 19 controllers, 83 REST endpoints</li> <li>Frontend: 152 TS/HTML files / ~15.3k LOC, 62 Angular components</li> <li>6 external integrations, each with a real <em>and</em> a mock adapter</li> <li>4 environments, 2 independent penetration tests remediated</li> </ul> <p>My own written estimate to leadership in April, before any of this was contentious: 3–4 engineers over 3 months without AI tooling.</p> <h2> Architecture </h2> <p>Hexagonal (ports and adapters) + CQRS. The domain package has <strong>zero Spring or JPA imports</strong> — greppable, returns nothing. That's the actual test of whether hexagonal is a design decision or a buzzword, and most codebases claiming it fail that check.<br> </p> <div class="highlight js-code-highlight"> <pre class="highlight plaintext"><code>domain/ Pure domain — models, value objects, events, ports. No framework imports. application/ Use cases — Commands (writes) and Queries (reads), DTOs, assemblers. dataprovider/ Adapters — JPA entities, Spring Data repos, SOAP clients. web/ Inbound adapter — controllers, DTOs, mappers, JWT filter, SAML handler. </code></pre> </div> <p>Every feature is a paired <code>XxxCommand</code>/<code>XxxCommandImpl</code> (transactional writes) and <code>XxxQuery</code>/<code>XxxQueryImpl</code> (read-only). Every external dependency sits behind a port with a real and a mock adapter selected by Spring profile — which meant QA and UAT ran full end-to-end flows without depending on government systems being up. They frequently weren't.</p> <p>One JPA detail worth stealing: <code>@Version</code> optimistic locking with a <strong>find-then-update</strong> save pattern, specifically to dodge Spring Data's null-version-means-new-entity behaviour producing duplicate-key errors. Easy to get wrong, painful to debug.</p> <p>User lifecycle is a real state machine (<code>PENDING_VERIFICATION → ACTIVE → LOCKED/INACTIVE</code>) using the State pattern, so invalid transitions fail at the domain layer rather than being guarded by scattered <code>if</code> statements in the UI.</p> <h2> The four problems worth reading </h2> <h3> 1. Java's X.509 parser rejected the government certificate </h3> <p><code>AVA not a sequence</code> — a malformed but entirely common real-world encoding that the JDK's strict parser refuses outright. I wrote a manual metadata parser on BouncyCastle's X.509 factory instead.</p> <p>Then the ministry rotated their signing certificate in production and it went down anyway. So I made the certificate hot-reloadable with on-failure refresh. It rotated <em>again</em> twenty days later — that time the system self-healed instead of paging anyone.</p> <h3> 2. Intermittent 500s that everyone blamed on the network </h3> <p>Tester in India, servers in Oman, so "it's latency" was the immediate consensus.</p> <p>I checked instead. The configured timeout was 60 seconds. Real India–Oman round-trip latency is 100–250ms — roughly 240× shorter. Even severe degradation can't produce a 60-second delay. And a 500 or 503 is generated <em>by the server</em>, after it has already accepted the connection, so by definition it isn't a net
分享
阅读原文