@oiyonet/lifecycle-guard
v1.0.0
Published
Progressive retirement, graceful deprecation, and sunsetting engine for AI agent skills, APIs, and content. 100% zero-dependency.
Maintainers
Readme
@oiyonet/lifecycle-guard
Progressive retirement, graceful deprecation, and sunsetting engine for AI agent skills, APIs, models, and content. 100% zero-dependency.
Engineered by OIYO Lab to eliminate breaking changes and system outages when phasing out legacy tools, retired AI models, outdated skills, or old URLs.
🌟 The 4 Stages of Progressive Retirement (점진적 퇴장)
Abruptly deleting code or switching AI models causes catastrophic failures across automated pipelines. @oiyonet/lifecycle-guard formalizes a safe 4-stage lifecycle:
[1. ACTIVE] ──► [2. DEPRECATED] ──► [3. FALLBACK] ──► [4. SUNSET]
Production Emits Warning Transparent Permanent Tombstone
Default & Target Date Auto-Reroute Safe for PurgeACTIVE: Full production support.DEPRECATED: Operational, but logs structured deprecation warnings (Caller,replacementId,sunsetAt).FALLBACK: The legacy implementation is retired, but calls are transparently intercepted and redirected to the modern replacement without throwing or breaking callers.SUNSET: Permanently retired. Returns structured Tombstone metadata with migration guides.
📦 Installation
# Global CLI
npm install -g @oiyonet/lifecycle-guard
# Or run instantly via npx
npx @oiyonet/lifecycle-guard audit🚀 CLI Commands
1. Register an Item into Lifecycle Management
lifecycle-guard register --id legacy-auth-token --type api --stage ACTIVE2. Deprecate with Sunset Deadline & Replacement Target
lifecycle-guard deprecate --id legacy-auth-token --replace modern-jwt-session --sunset 2026-12-31 --reason "Migrating to stateless JWT"3. Transition to Fallback (Transparent Proxying)
lifecycle-guard fallback --id legacy-auth-token --replace modern-jwt-session --reason "Rerouting legacy API requests"4. Permanently Sunset
lifecycle-guard sunset --id legacy-auth-token --reason "All clients migrated"5. Audit Impending Sunsets & Safe-to-Purge Code
lifecycle-guard auditOutput:
📊 Lifecycle Audit Report:
• Total Items: 12
• Active: 🟢 8
• Deprecated: 🟡 2
• Fallback: 🟠 1
• Sunset: 🔴 1
⚠️ Impending Sunsets (<30 days):
• legacy-auth-token (Sunset Date: 2026-12-31) -> migrate to modern-jwt-session
🧹 Safe to Purge from Codebase (Sunset + 0 calls):
• old-hermes-feed (All clients migrated)💻 Programmatic TypeScript API (Graceful Adapters)
import { LifecycleGuard } from '@oiyonet/lifecycle-guard';
const guard = new LifecycleGuard();
// Automatically wrap a function to handle deprecation, fallback, and sunsetting seamlessly:
const getUser = guard.wrapFunction(
'api:get-user-v1',
(id) => fetchLegacyUser(id), // executed during ACTIVE / DEPRECATED
(id) => fetchModernUser(id) // transparently executed during FALLBACK
);
// Callers don't break even when the underlying implementation shifts!
const user = getUser(101);🌐 Powered by OIYO Lab
@oiyonet/lifecycle-guard is an open-source tool developed and maintained by OIYO Lab.
Explore our companion developer tools at tools.oiyo.net and deep technical engineering articles on blog.oiyo.net.
License
MIT © OIYO Lab
