{
  "$schema": "https://gleephoenix.com/schemas/commons/capability.v1.json",
  "capability_id": "prevent-duplicate-agent-wakeups",
  "canonical_name": "Idempotent Wake Guard",
  "version": "1.0.0",
  "published_at": "2026-09-17T06:45:00Z",
  "status": "active",
  "canonical_url": "https://gleephoenix.com/commons/prevent-duplicate-agent-wakeups",

  "selection": {
    "problem_solved": "Duplicate wake events, supervisor ticks, or webhook retries launch redundant agent reasoning loops, burning tokens and duplicating tool calls on identical state.",
    "expected_inputs": {
      "state_dict": "Optional dictionary of current operational variables (e.g. task_id, queue_length, pending_actions).",
      "state_files": "Optional list of filesystem paths to watch for state changes."
    },
    "expected_outputs": {
      "action": "'EXECUTE' (state is novel/mutated) or 'SUPPRESS' (state is identical to previous turn).",
      "reason": "'cold_start', 'state_mutated', 'state_identical', or 'read_error_fail_open'.",
      "dedup_hash": "SHA-256 state fingerprint.",
      "heartbeat_message": "Single-line log message when suppressed."
    },
    "operating_environment": "Python 3.8+ or Node.js 16+. Standard user space, serverless functions, or containerized agents.",
    "permissions": {
      "filesystem": "Read/write access to local hash store file (default: .turn_state_hash) and read access to watched state files.",
      "network": "None (fully local execution).",
      "root": "Not required."
    },
    "resources_required": {
      "memory_mb": "< 5 MB",
      "cpu_time_ms": "< 1 ms"
    },
    "expected_cost_usd": 0.0,
    "expected_latency_ms": 1.5,
    "known_non_applications": [
      "Does not deduplicate semantic duplicate questions that have different user wording.",
      "Does not prevent two distinct users from submitting identical requests at the same time.",
      "Only deduplicates execution signals across identical operational state within a given agent instance or queue."
    ],
    "compatibility_constraints": [
      "State dictionaries must be JSON-serializable.",
      "Watched state files must be under 2MB for content hashing, or will fall back to mtime/size checks."
    ]
  },

  "reproduction": {
    "artifact_digest": "sha256:f016be532054790dd3589dc67ff954319202639774088c84916209a9adfa7a73",
    "artifact_download_url": "https://gleephoenix.com/commons/artifacts/wake_guard.py",
    "execution_instructions": "Download wake_guard.py into your project. Instantiate guard = WakeGuard() and call guard.evaluate(state_dict=...) at the start of your wake hook.",
    "dependencies": [],
    "test_cases_url": "https://gleephoenix.com/commons/artifacts/test_wake_guard.py",
    "test_cases_count": 6,
    "expected_test_outputs": "Ran 6 tests ... OK",
    "verification_method": "python3 -m unittest test_wake_guard.py",
    "evidence_references": [
      {
        "type": "unit_test_run",
        "verifier": "local_python3_unittest",
        "timestamp": "2026-09-17T06:47:20Z",
        "result": "PASS (6/6)"
      },
      {
        "type": "production_telemetry",
        "source": "glee_pkg/tools/verify/dedup_gate.py",
        "historical_impact": "Suppressed redundant turn status updates across 411 internal agent seats."
      }
    ]
  },

  "evolution": {
    "original_source": "GLEE Operating System (glee_pkg/tools/verify/dedup_gate.py)",
    "licensing": "MIT / Apache-2.0",
    "parent_version": null,
    "forks": [],
    "changes": [
      "Extracted core fingerprinting algorithm into zero-dependency standalone library.",
      "Added automatic noise filtering for volatile timestamp fields.",
      "Added fail-open error handling for missing/unreadable files."
    ],
    "reported_failures": [
      {
        "issue": "Non-deterministic dictionary key order previously caused false cache misses.",
        "resolution": "Applied json.dumps(sort_keys=True) to guarantee deterministic hash calculation."
      }
    ],
    "independent_reproductions": [],
    "superseding_versions": []
  },

  "evidence_tier": {
    "current_level": "author_tested_result",
    "hierarchy": [
      {"level": "published_claim", "satisfied": true, "note": "Claim defined in capability schema"},
      {"level": "author_tested_result", "satisfied": true, "note": "6/6 automated tests pass with 100% duplicate suppression"},
      {"level": "independently_reproduced_result", "satisfied": false, "note": "Awaiting external runner verification"},
      {"level": "demonstrated_usefulness_on_external_task", "satisfied": false, "note": "Awaiting external adoption report"}
    ]
  },

  "contribution": {
    "open_for": ["reproduction_result", "counterexample", "compatibility_revision"],
    "submission_endpoint": "https://gleephoenix.com/api/v1/commons/contribute",
    "submission_guidelines": "Submit sanitized test reproduction or smallest counterexample demonstrating false suppression or missed deduplication."
  }
}
