[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$apiParty6fBuHLCPZ1LTYs42XHdVbjpSDOYYPYzyxeAGwSN5Tp8":3,"$apiPartyAcDlLZVnvooI_RdlPQVnAhV7wMJjyTwCZgDXaiq_W0U":563,"$apiPartyAcDlLZVnvooI_RdlPQVnAhV7wMJjyTwCZgDXaiq_W0U$H93EERW16b":563},{"product_data":4,"scene_data":21,"task_data":407,"modality_data":441,"domain_data":478},[5,9,12,15,18],{"name":6,"value":7,"add_value":8,"describe":8},"Rivo","1","",{"name":10,"value":11,"add_value":8,"describe":8},"Cubo","2",{"name":13,"value":14,"add_value":8,"describe":8},"Moye","3",{"name":16,"value":17,"add_value":8,"describe":8},"Juro","4",{"name":19,"value":20,"add_value":8,"describe":8},"Ordo","5",[22,73,135,197,232,267,302,337,372],{"name":23,"value":7,"add_value":24,"describe":25,"children":26},"Home & Indoor","sofa","AI enhances everyday home life. Our datasets cover real indoor scenes to support smart devices, robotics, and home intelligence.",[27,29,31,33,35,37,40,43,46,49,52,55,58,61,64,67,70],{"name":28,"value":7},"Living Room",{"name":30,"value":11},"Bedroom",{"name":32,"value":14},"Kitchen",{"name":34,"value":17},"Dining Area",{"name":36,"value":20},"Bathroom",{"name":38,"value":39},"Entrance \u002F Foyer","6",{"name":41,"value":42},"Corridor \u002F Hallway","7",{"name":44,"value":45},"Staircase","8",{"name":47,"value":48},"Home Office","9",{"name":50,"value":51},"Hobby \u002F Game Room","10",{"name":53,"value":54},"Worship Space","11",{"name":56,"value":57},"Garage","12",{"name":59,"value":60},"Utility \u002F Laundry Room","13",{"name":62,"value":63},"Pantry","14",{"name":65,"value":66},"Basement","15",{"name":68,"value":69},"Garden","16",{"name":71,"value":72},"Balcony","17",{"name":74,"value":11,"add_value":75,"describe":76,"children":77},"Office & Educational","workshop","AI is reshaping work and learning. Our datasets capture offices and classrooms to power automation and next-generation productivity tools.",[78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,132],{"name":79,"value":80},"Open Office","18",{"name":82,"value":83},"Private Office","19",{"name":85,"value":86},"Co-working Space","20",{"name":88,"value":89},"Reception \u002F Lobby","21",{"name":91,"value":92},"Conference Room","22",{"name":94,"value":95},"Huddle Room \u002F Booth","23",{"name":97,"value":98},"Lecture Hall \u002F Auditorium","24",{"name":100,"value":101},"Classroom","25",{"name":103,"value":104},"Science Laboratory","26",{"name":106,"value":107},"Library","27",{"name":109,"value":110},"Design Studio","28",{"name":112,"value":113},"Pantry \u002F Breakroom","29",{"name":115,"value":116},"Cafeteria \u002F Canteen","30",{"name":118,"value":119},"Restroom (Commercial)","31",{"name":121,"value":122},"Gymnasium \u002F Sports Hall","32",{"name":124,"value":125},"Server Room","33",{"name":127,"value":128},"Mailroom \u002F Logistics","34",{"name":130,"value":131},"Janitorial Closet","35",{"name":133,"value":134},"Corridor \u002F Elevators","36",{"name":136,"value":14,"add_value":137,"describe":138,"children":139},"Healthcare & Medical","love-and-help","AI is advancing modern healthcare. Our datasets include clinics and hospitals to enable clinical insights and medical automation.",[140,143,146,149,152,155,158,161,164,167,170,173,176,179,182,185,188,191,194],{"name":141,"value":142},"Operating Theatre \u002F OR","37",{"name":144,"value":145},"Consultation Room","38",{"name":147,"value":148},"Treatment Room","39",{"name":150,"value":151},"Dental Clinic","40",{"name":153,"value":154},"Inpatient Ward","41",{"name":156,"value":157},"Nurse Station","42",{"name":159,"value":160},"ICU","43",{"name":162,"value":163},"NICU (Neonatal ICU)","44",{"name":165,"value":166},"Emergency Room (ER)","45",{"name":168,"value":169},"Hospital Corridor","46",{"name":171,"value":172},"Waiting Area","47",{"name":174,"value":175},"CT\u002FMRI","48",{"name":177,"value":178},"Medical Laboratory","49",{"name":180,"value":181},"Phlebotomy Room","50",{"name":183,"value":184},"Rehabilitation Gym","51",{"name":186,"value":187},"Assisted Living Room","52",{"name":189,"value":190},"Pharmacy","53",{"name":192,"value":193},"Sterile Processing Dept","54",{"name":195,"value":196},"Medical Storage","55",{"name":198,"value":17,"add_value":199,"describe":200,"children":201},"Business & Public Service","business","AI is elevating commercial and public services. Our datasets span retail, dining, and service centers to improve intelligent operations.",[202,205,208,211,214,217,220,223,226,229],{"name":203,"value":204},"Shopping Mall Atrium","86",{"name":206,"value":207},"Supermarket Shelf","87",{"name":209,"value":210},"Self-Checkout Counter","88",{"name":212,"value":213},"Restaurant Dining Hall","89",{"name":215,"value":216},"Commercial Kitchen","90",{"name":218,"value":219},"Hotel Lobby","91",{"name":221,"value":222},"Subway Platform","92",{"name":224,"value":225},"Security Checkpoint","93",{"name":227,"value":228},"Underground Parking","94",{"name":230,"value":231},"Bank Teller Zone","95",{"name":233,"value":20,"add_value":234,"describe":235,"children":236},"Industrial & Manufacturing","robot-arm","AI is modernizing industry. Our datasets capture factories and logistics spaces to support robotics and intelligent manufacturing.",[237,240,243,246,249,252,255,258,261,264],{"name":238,"value":239},"Final Assembly Line","96",{"name":241,"value":242},"Quality Control Station","97",{"name":244,"value":245},"Robotic Welding Cell","98",{"name":247,"value":248},"CNC Machining Center","99",{"name":250,"value":251},"Cleanroom","100",{"name":253,"value":254},"Automated Warehouse","101",{"name":256,"value":257},"Loading Dock","102",{"name":259,"value":260},"Sorting Center","103",{"name":262,"value":263},"Chemical Plant","104",{"name":265,"value":266},"Power Substation","105",{"name":268,"value":39,"add_value":269,"describe":270,"children":271},"Transportation & Driving","car","AI is revolutionizing mobility. Our datasets capture road networks, vehicle dynamics and traffic scenarios to support autonomous driving and intelligent transportation systems.",[272,275,278,281,284,287,290,293,296,299],{"name":273,"value":274},"Urban Intersection","56",{"name":276,"value":277},"Highway \u002F Expressway","57",{"name":279,"value":280},"Tunnel","58",{"name":282,"value":283},"Roundabout","59",{"name":285,"value":286},"School \u002F Hospital Zone","60",{"name":288,"value":289},"Toll Station","61",{"name":291,"value":292},"Construction Zone","62",{"name":294,"value":295},"Parking Garage","63",{"name":297,"value":298},"Driver Cabin","64",{"name":300,"value":301},"Adverse Weather","65",{"name":303,"value":42,"add_value":304,"describe":305,"children":306},"Outdoor & Construction","tent-tree","AI is optimizing outdoor operations. Our datasets capture construction sites, open-air work zones and outdoor infrastructure to support smart construction and autonomous outdoor machinery.",[307,310,313,316,319,322,325,328,331,334],{"name":308,"value":309},"Excavation Site","66",{"name":311,"value":312},"Scaffolding Area","67",{"name":314,"value":315},"Material Storage Yard","68",{"name":317,"value":318},"Site Entrance","69",{"name":320,"value":321},"Roadwork Zone","70",{"name":323,"value":324},"Bridge Infrastructure","71",{"name":326,"value":327},"Transmission Line","72",{"name":329,"value":330},"Open-pit Mine","73",{"name":332,"value":333},"Tunneling Site","74",{"name":335,"value":336},"Post-Disaster Rubble","75",{"name":338,"value":45,"add_value":339,"describe":340,"children":341},"Nature, Aerial & Aquatic","global-loop","AI is exploring the natural world. Our datasets capture terrestrial landscapes, aerial vistas and aquatic ecosystems to support environmental monitoring and autonomous exploration systems.",[342,345,348,351,354,357,360,363,366,369],{"name":343,"value":344},"Deep Forest","76",{"name":346,"value":347},"Farmland \u002F Crops","77",{"name":349,"value":350},"River \u002F Lake","78",{"name":352,"value":353},"Open Ocean","79",{"name":355,"value":356},"Underwater Coral Reef","80",{"name":358,"value":359},"Fish Farm","81",{"name":361,"value":362},"Mountain Terrain","82",{"name":364,"value":365},"Urban Low Altitude","83",{"name":367,"value":368},"Fire Scene","84",{"name":370,"value":371},"Desert \u002F Gobi","85",{"name":373,"value":48,"add_value":374,"describe":375,"children":376},"Virtul & Digital","siri","AI is reshaping the virtual realm. Our datasets capture digital twins, virtual environments and simulated spaces to support metaverse development and intelligent digital interaction.",[377,380,383,386,389,392,395,398,401,404],{"name":378,"value":379},"VR Social Space","106",{"name":381,"value":382},"Synthetic Driving Sim","107",{"name":384,"value":385},"Digital Twin City","108",{"name":387,"value":388},"FPS \u002F MOBA Game","109",{"name":390,"value":391},"Robotics Gym","110",{"name":393,"value":394},"AR Navigation","111",{"name":396,"value":397},"Virtual Showroom","112",{"name":399,"value":400},"Code \u002F IDE Interface","113",{"name":402,"value":403},"App GUI Screen","114",{"name":405,"value":406},"Synthetic Face\u002FID","115",[408,411,414,417,420,423,426,429,432,435,438],{"name":409,"value":7,"add_value":410,"describe":8},"Classification","rubric",{"name":412,"value":11,"add_value":413,"describe":8},"Detection","radar",{"name":415,"value":14,"add_value":416,"describe":8},"Segmentation","segmentation",{"name":418,"value":17,"add_value":419,"describe":8},"Tacking","crosshairs",{"name":421,"value":20,"add_value":422,"describe":8},"Estimation","streamline",{"name":424,"value":39,"add_value":425,"describe":8},"QA","qa",{"name":427,"value":42,"add_value":428,"describe":8},"Recognition","finger-scan",{"name":430,"value":45,"add_value":431,"describe":8},"Control","control",{"name":433,"value":48,"add_value":434,"describe":8},"Extraction","extraction",{"name":436,"value":51,"add_value":437,"describe":8},"Retrieval","retrieval",{"name":439,"value":54,"add_value":440,"describe":8},"Forecast","forecast",[442,445,448,451,454,457,460,463,466,469,472,475],{"name":443,"value":7,"add_value":444,"describe":8},"Audio","audio",{"name":446,"value":11,"add_value":447,"describe":8},"Image","image",{"name":449,"value":14,"add_value":450,"describe":8},"Text","text",{"name":452,"value":17,"add_value":453,"describe":8},"Video","video",{"name":455,"value":20,"add_value":456,"describe":8},"Multi","multi",{"name":458,"value":39,"add_value":459,"describe":8},"Document","document",{"name":461,"value":42,"add_value":462,"describe":8},"Time-Series","time-series",{"name":464,"value":45,"add_value":465,"describe":8},"3D cloud","cloud",{"name":467,"value":48,"add_value":468,"describe":8},"Code","code",{"name":470,"value":51,"add_value":471,"describe":8},"Event","event",{"name":473,"value":54,"add_value":474,"describe":8},"Motion","motion",{"name":476,"value":57,"add_value":477,"describe":8},"Interaction","interaction",[479,482,487,491,494,499,504,509,514,519,524,528,532,536,540,544,548,552,556,559],{"id":480,"value":480,"name":233,"intro":481,"add_value":234,"describe":481},2,"智能质检：利用图像识别、多模态模型对产品外观或声音、振动等数据进行分析，自动识别缺陷，提高质量控制效率。\n工业知识问答与文档理解：通过大模型理解和总结技术文档、操作手册，实现快速问答、知识检索和培训支持。\n安全监测与风险预警：实时分析视频、传感器和操作日志，识别潜在危险行为或异常状态，提前预警，保障人员和设备安全。",{"id":483,"value":483,"name":484,"intro":485,"add_value":486,"describe":485},3,"Finance & Insurance","风险评估与预测：分析大量客户数据，评估信用风险、市场风险等，预测违约概率、股价走势等，辅助金融机构决策。\n智能投顾：根据客户风险偏好、资产状况等，提供个性化投资组合建议，实时调整投资策略。\n反欺诈检测：通过分析交易数据、用户行为，识别异常交易和欺诈行为，保障金融安全。","funds",{"id":488,"value":488,"name":489,"intro":490,"add_value":269,"describe":490},1,"Transport & Automotive","智能座舱：打造多模态交互的 AI 座舱，通过语音、手势、面部识别等实现人机交互，如语音控制导航、音乐播放。\n驾驶员状态监测：识别疲劳、分心、抽烟、打电话等行为，通过大模型判断危险等级，触发相应提醒或干预机制。\n智能驾驶：AI 用于环境感知、路径规划与决策控制，使车辆能识别道路、行人、障碍物等，实现自适应巡航、自动泊车、车道保持等功能，提升驾驶安全性与便利性。",{"id":492,"value":492,"name":136,"intro":493,"add_value":137,"describe":493},4,"医学影像诊断：分析 CT、MRI 等影像，辅助医生检测疾病、识别病灶，如 AI 系统可快速发现肺部结节。\n医患对话助手：通过自然语言处理理解患者问题，提供初步健康建议或就诊指导，缓解医生接诊压力。\n智能健康管理：根据用户健康数据，提供个性化健康建议、疾病预警，如智能手环结合 AI 分析用户运动、睡眠、心率等数据。",{"id":495,"value":495,"name":496,"intro":497,"add_value":498,"describe":497},6,"Smart Devices","多模态交互：支持语音、手势、眼神等多种交互方式，如 AI 眼镜可通过语音指令实现翻译、搜索功能。\n智能感知与处理：使设备能感知环境、理解用户需求，如智能音箱根据环境噪音自动调节音量。\n个性化服务：根据用户使用习惯和偏好，提供个性化功能与服务，如智能手表为用户定制运动健身计划。","microscope",{"id":500,"value":500,"name":501,"intro":502,"add_value":503,"describe":502},8,"Law & Government","智能法律问答：面向公众或企业用户，提供合规、劳动法、婚姻继承、知识产权等常见法律问题的智能解答。\n合同审查与风险识别：利用大模型分析合同内容，识别潜在风险条款、漏洞或不合理约定，提升合同审核质量。\n法律知识图谱构建：自动梳理法规、案例、条文之间的引用关系，构建语义化知识图谱，支持智能分析和推理。","hammer",{"id":505,"value":505,"name":506,"intro":507,"add_value":508,"describe":507},7,"Education & Training","个性化学习：根据学生学习进度、能力和知识掌握情况，推送个性化学习内容与练习，如智能辅导系统为学生制定专属学习计划。\n智能教学辅助：AI 助教协助教师进行作业批改、答疑解惑，还可分析教学数据，为教师提供教学反馈，优化教学方法。\n虚拟学习环境：利用 AI 创建虚拟实验、历史场景等，让学生沉浸式学习，如在虚拟化学实验室中进行实验操作。","degree-hat",{"id":510,"value":510,"name":511,"intro":512,"add_value":513,"describe":512},5,"Agriculture & Food","作物病虫害识别与防治：通过图像识别分析农作物叶片、果实等症状，识别病虫害类型，给出防治建议，减少产量损失。\n农产品质量检测：利用图像和传感器数据，识别果蔬等农产品的成熟度、外观缺陷，进行自动分级，提高市场竞争力。\n农情监测与预测：利用卫星遥感、气象和传感器数据，结合大模型预测作物长势、干旱、洪涝等农情变化。","ph-farm",{"id":515,"value":515,"name":516,"intro":517,"add_value":518,"describe":517},9,"Retail & E-commerce","智能客服：通过自然语言对话理解用户需求，提供产品推荐、订单查询、退换货支持等服务，提升客户满意度。\n个性化营销推荐：基于用户浏览、购买、偏好等行为数据，生成个性化推荐内容与优惠策略，提高转化率和客单价。\n商品内容生成：自动撰写商品标题、卖点描述、使用说明等内容，适用于海量SKU的内容生产与多语言发布。","buy",{"id":520,"value":520,"name":521,"intro":522,"add_value":523,"describe":8},10,"Security & Protection",null,"safe-shield-line",{"id":525,"value":525,"name":526,"intro":522,"add_value":527,"describe":8},11,"Environment & Climate","weather",{"id":529,"value":529,"name":530,"intro":522,"add_value":531,"describe":8},12,"Energy & Resource","energy-leaf",{"id":533,"value":533,"name":534,"intro":522,"add_value":535,"describe":8},13,"Express & Logistics","speed-outline",{"id":537,"value":537,"name":538,"intro":522,"add_value":539,"describe":8},15,"Sports","baseball-outline",{"id":541,"value":541,"name":542,"intro":522,"add_value":543,"describe":8},16,"General Data","daily-booth",{"id":545,"value":545,"name":546,"intro":522,"add_value":547,"describe":8},17,"Content & Media","media",{"id":549,"value":549,"name":550,"intro":522,"add_value":551,"describe":8},18,"Construction","construction",{"id":553,"value":553,"name":554,"intro":522,"add_value":555,"describe":8},19,"IT & Telecom","tech",{"id":557,"value":557,"name":558,"intro":522,"add_value":498,"describe":8},20,"Science & Research",{"id":560,"value":560,"name":561,"intro":522,"add_value":562,"describe":8},21,"Language & Culture","lang",{"id":564,"unique_code":565,"title":566,"icon":8,"intro":567,"cate":483,"detail":568,"create_time":569,"update_time":570,"price":571,"view_count":572,"download_count":573,"unit":573,"amount":574,"is_create_order":573,"enterprise_id":488,"seo_keywords":575,"seo_description":576,"data_format":577,"file_size":578,"apply_scene":579,"training_task":580,"version":581,"dataset_type_id":492,"dataset_scene_id":553,"sample_file":582,"banner":8,"unit_name":8,"cate_name":449,"icon_url":8,"banner_url":8,"sample_file_url":8,"data_dict":583,"qa_list":632,"sample_metadatas":649,"text_sample_content":691,"enterprise_name":692,"enterprise_logo":693,"data_distribution":694},1118,"0a05accb39d919756ffc91c4cd5ce9fd","Cache Expiration and Eviction Code Verification Dataset","Find defects and root causes in cache implementations involving TTL, expiration boundaries, and eviction behavior.","\u003Cp>This dataset contains source code examples involving TTL settings, expiration checks, capacity limits, and eviction strategy interactions in distributed caches. Annotations assess whether implementations handle boundary conditions and cache entry lifecycles correctly, and analyze common defect root causes and potential risks in distributed environments. It supports training and evaluating code verification, debugging, and root-cause analysis models.\u003C\u002Fp>","2026-10-10 15:20:35","2026-10-19 17:18:32","0.00",29,0,5000,"cache code verification, TTL expiration, cache eviction strategies, distributed caching, code defect analysis, cache boundary testing, entry lifecycle, root cause analysis dataset","Source code examples and defect analysis for cache TTL, expiration, eviction, and entry lifecycles, for distributed cache verification and root-cause analysis.","JSON","0.3GB","cache management systems, software defect detection, cache performance optimization","code verification, defect detection, root cause analysis","V1.0","rivo\u002Fsample-packages\u002F88e24e62-f5fb-458f-9ac9-2c43900b59a9\u002F20261010.zip",[584,589,595,600,605,611,617,622,627],{"id":573,"name":585,"field":586,"intro":587,"type":588},"File Name","file_name","File name","string",{"id":590,"name":591,"field":592,"intro":593,"type":594},8119,"Implementation Correctness","is_correct","Indicates whether the code correctly handles TTL, expiration boundaries, eviction strategies, and entry lifecycles.","boolean",{"id":596,"name":597,"field":598,"intro":599,"type":588},8120,"Source Code","source_code","Cache expiration and eviction implementation code to be verified.",{"id":601,"name":602,"field":603,"intro":604,"type":588},8121,"Defect Root Cause","defect_root_cause","Describes common implementation defect causes, or states that no obvious defect was found.",{"id":606,"name":607,"field":608,"intro":609,"type":610},8122,"Eviction Strategy Analysis","eviction_analysis","Explains cache capacity limits, eviction triggers, and the strategy used to select entries for eviction.","object",{"id":612,"name":613,"field":614,"intro":615,"type":616},8123,"Boundary Case Validation Results","boundary_case_results","Validation results for boundary cases involving TTL, expiration checks, capacity limits, and concurrent interactions.","array",{"id":618,"name":619,"field":620,"intro":621,"type":610},8124,"TTL and Expiration Analysis","ttl_expiration_analysis","Analysis of TTL configuration, expiration criteria, and expiration-check logic.",{"id":623,"name":624,"field":625,"intro":626,"type":610},8125,"Cache Entry Lifecycle Analysis","entry_lifecycle_analysis","Analyzes cache entry state changes and cleanup behavior from insertion through expiration, eviction, or deletion.",{"id":628,"name":629,"field":630,"intro":631,"type":610},8126,"Distributed Cache Risk Analysis","distributed_cache_risk_analysis","Analyzes potential risks involving expiration and eviction when the code runs in a distributed environment.",[633,637,641,645],{"id":634,"question":635,"answer":636},5922,"What cache code does the dataset cover?","It includes source code examples involving TTL configuration and expiration checks, capacity limits, cache eviction strategies, and entry lifecycles, with attention to how these behaviors interact.",{"id":638,"question":639,"answer":640},5923,"What verification annotations are included?","Annotations analyze expiration checks, eviction triggers, boundary cases, and entry state transitions. They also assess implementation correctness, describe common defect root causes, and cover related risks in distributed cache environments.",{"id":642,"question":643,"answer":644},5924,"Which engineering tasks is the dataset suited for?","It can be used to train or evaluate code verification and debugging models, help identify issues in TTL boundary handling, eviction logic, and cleanup behavior, and support cache defect analysis and root-cause workflows.",{"id":646,"question":647,"answer":648},5925,"How can I obtain the dataset, and what are its licensing terms?","Refer to the product listing for the available delivery method, data format, and license terms. Confirm that the license covers your intended use before commercial training, redistribution, or other restricted activities.",[650,666,679],{"id":651,"relate_table":652,"relate_id":653,"file_size":573,"file_name":654,"path":8,"duration":573,"cate":483,"file_format":655,"audio_rate":8,"audio_channel":522,"audio_bit_depth":522,"quality":8,"annotation":656,"cate_name":657,"is_correct":658,"source_code":659,"defect_root_cause":660,"eviction_analysis":661,"boundary_case_results":662,"ttl_expiration_analysis":663,"entry_lifecycle_analysis":664,"distributed_cache_risk_analysis":665},14755,"union_cubo",818729535,"样例_3.json","json","{\"is_correct\": \"true\", \"source_code\": \"from collections import OrderedDict\\nfrom threading import RLock\\nfrom time import monotonic\\n\\nclass LRUCache:\\n    def __init__(self, capacity):\\n        if capacity \u003C 1:\\n            raise ValueError('capacity must be positive')\\n        self.capacity = capacity\\n        self.entries = OrderedDict()\\n        self.lock = RLock()\\n\\n    def _purge_expired(self, now):\\n        expired = [\\n            key for key, (_, deadline) in self.entries.items()\\n            if deadline \u003C= now\\n        ]\\n        for key in expired:\\n            del self.entries[key]\\n\\n    def get(self, key):\\n        with self.lock:\\n            now = monotonic()\\n            item = self.entries.get(key)\\n            if item is None:\\n                return None\\n            value, deadline = item\\n            if deadline \u003C= now:\\n                del self.entries[key]\\n                return None\\n            self.entries.move_to_end(key)\\n            return value\\n\\n    def put(self, key, value, ttl_seconds):\\n        if ttl_seconds \u003C 0:\\n            raise ValueError('ttl_seconds must be non-negative')\\n        with self.lock:\\n            now = monotonic()\\n            self._purge_expired(now)\\n            if key in self.entries:\\n                del self.entries[key]\\n            while len(self.entries) >= self.capacity:\\n                self.entries.popitem(last=False)\\n            self.entries[key] = (value, now + ttl_seconds)\", \"defect_root_cause\": \"No obvious defect was found in the local TTL, expiration-boundary, capacity-eviction, or entry-lifecycle behavior shown. The implementation does not provide distributed replication or cross-node coordination.\", \"eviction_analysis\": \"{\\\"eviction_strategy\\\": \\\"LRU; successful reads and writes place an entry at the most-recently-used end.\\\", \\\"eviction_trigger\\\": \\\"Before inserting, expired entries are purged and least-recently-used entries are removed until there is room.\\\", \\\"expired_entry_precedence\\\": \\\"Expired entries are purged before capacity eviction, so they take precedence over live entries as removal candidates.\\\", \\\"strategy_consistent\\\": true}\", \"boundary_case_results\": \"[{\\\"case_description\\\": \\\"An entry is written with a zero-second TTL and then read.\\\", \\\"expected_behavior\\\": \\\"The entry is expired immediately and the read returns a miss.\\\", \\\"actual_behavior\\\": \\\"The read compares the deadline with the current monotonic time using \u003C=, deletes the entry, and returns a miss.\\\", \\\"passed\\\": true}, {\\\"case_description\\\": \\\"At capacity, an expired entry is not the least-recently-used entry when a new key is written.\\\", \\\"expected_behavior\\\": \\\"Purge the expired entry before evicting any live LRU entry.\\\", \\\"actual_behavior\\\": \\\"The write purges all entries with deadlines at or before the captured time before checking whether capacity eviction is needed.\\\", \\\"passed\\\": true}, {\\\"case_description\\\": \\\"A read and write for the same cache instance overlap across threads.\\\", \\\"expected_behavior\\\": \\\"The operations should observe a serialized state transition without corrupting recency or entry contents.\\\", \\\"actual_behavior\\\": \\\"Both operations hold the instance RLock while accessing the ordered mapping, so their state changes are serialized.\\\", \\\"passed\\\": true}]\", \"ttl_expiration_analysis\": \"{\\\"ttl_value_or_source\\\": \\\"Each write supplies its own ttl_seconds value; negative TTLs are rejected, while zero is allowed.\\\", \\\"ttl_unit\\\": \\\"Seconds\\\", \\\"expiration_basis\\\": \\\"An absolute per-entry deadline computed from the write-time monotonic clock. Reads do not extend the deadline.\\\", \\\"boundary_operator\\\": \\\"deadline \u003C= now; an entry is expired at the exact deadline.\\\", \\\"handles_clock_skew\\\": true}\", \"entry_lifecycle_analysis\": \"{\\\"lifecycle_summary\\\": \\\"A write validates its TTL, purges expired entries, replaces any existing value for the key, evicts LRU entries if necessary, and stores a new deadline. A successful read refreshes recency; an expired requested entry is deleted and returned as a miss.\\\", \\\"expiration_cleanup_behavior\\\": \\\"Lazy cleanup on reads for the requested key, plus a full expired-entry sweep before each write. No background cleanup is used.\\\", \\\"stale_entry_return_possible\\\": false}\", \"distributed_cache_risk_analysis\": \"{\\\"risk_summary\\\": \\\"The lock protects only this process-local instance. Independent nodes can hold different values or eviction orders, and monotonic deadlines are not portable across processes, so this implementation alone does not ensure distributed consistency.\\\", \\\"affected_scenario\\\": \\\"Multiple application nodes maintain separate instances for the same logical keys, or an entry and its monotonic deadline are transferred to another process.\\\", \\\"severity\\\": \\\"Medium\\\"}\"}","文本","true","from collections import OrderedDict\nfrom threading import RLock\nfrom time import monotonic\n\nclass LRUCache:\n    def __init__(self, capacity):\n        if capacity \u003C 1:\n            raise ValueError('capacity must be positive')\n        self.capacity = capacity\n        self.entries = OrderedDict()\n        self.lock = RLock()\n\n    def _purge_expired(self, now):\n        expired = [\n            key for key, (_, deadline) in self.entries.items()\n            if deadline \u003C= now\n        ]\n        for key in expired:\n            del self.entries[key]\n\n    def get(self, key):\n        with self.lock:\n            now = monotonic()\n            item = self.entries.get(key)\n            if item is None:\n                return None\n            value, deadline = item\n            if deadline \u003C= now:\n                del self.entries[key]\n                return None\n            self.entries.move_to_end(key)\n            return value\n\n    def put(self, key, value, ttl_seconds):\n        if ttl_seconds \u003C 0:\n            raise ValueError('ttl_seconds must be non-negative')\n        with self.lock:\n            now = monotonic()\n            self._purge_expired(now)\n            if key in self.entries:\n                del self.entries[key]\n            while len(self.entries) >= self.capacity:\n                self.entries.popitem(last=False)\n            self.entries[key] = (value, now + ttl_seconds)","No obvious defect was found in the local TTL, expiration-boundary, capacity-eviction, or entry-lifecycle behavior shown. The implementation does not provide distributed replication or cross-node coordination.","{\"eviction_strategy\": \"LRU; successful reads and writes place an entry at the most-recently-used end.\", \"eviction_trigger\": \"Before inserting, expired entries are purged and least-recently-used entries are removed until there is room.\", \"expired_entry_precedence\": \"Expired entries are purged before capacity eviction, so they take precedence over live entries as removal candidates.\", \"strategy_consistent\": true}","[{\"case_description\": \"An entry is written with a zero-second TTL and then read.\", \"expected_behavior\": \"The entry is expired immediately and the read returns a miss.\", \"actual_behavior\": \"The read compares the deadline with the current monotonic time using \u003C=, deletes the entry, and returns a miss.\", \"passed\": true}, {\"case_description\": \"At capacity, an expired entry is not the least-recently-used entry when a new key is written.\", \"expected_behavior\": \"Purge the expired entry before evicting any live LRU entry.\", \"actual_behavior\": \"The write purges all entries with deadlines at or before the captured time before checking whether capacity eviction is needed.\", \"passed\": true}, {\"case_description\": \"A read and write for the same cache instance overlap across threads.\", \"expected_behavior\": \"The operations should observe a serialized state transition without corrupting recency or entry contents.\", \"actual_behavior\": \"Both operations hold the instance RLock while accessing the ordered mapping, so their state changes are serialized.\", \"passed\": true}]","{\"ttl_value_or_source\": \"Each write supplies its own ttl_seconds value; negative TTLs are rejected, while zero is allowed.\", \"ttl_unit\": \"Seconds\", \"expiration_basis\": \"An absolute per-entry deadline computed from the write-time monotonic clock. Reads do not extend the deadline.\", \"boundary_operator\": \"deadline \u003C= now; an entry is expired at the exact deadline.\", \"handles_clock_skew\": true}","{\"lifecycle_summary\": \"A write validates its TTL, purges expired entries, replaces any existing value for the key, evicts LRU entries if necessary, and stores a new deadline. A successful read refreshes recency; an expired requested entry is deleted and returned as a miss.\", \"expiration_cleanup_behavior\": \"Lazy cleanup on reads for the requested key, plus a full expired-entry sweep before each write. No background cleanup is used.\", \"stale_entry_return_possible\": false}","{\"risk_summary\": \"The lock protects only this process-local instance. Independent nodes can hold different values or eviction orders, and monotonic deadlines are not portable across processes, so this implementation alone does not ensure distributed consistency.\", \"affected_scenario\": \"Multiple application nodes maintain separate instances for the same logical keys, or an entry and its monotonic deadline are transferred to another process.\", \"severity\": \"Medium\"}",{"id":667,"relate_table":652,"relate_id":668,"file_size":573,"file_name":669,"path":8,"duration":573,"cate":483,"file_format":655,"audio_rate":8,"audio_channel":522,"audio_bit_depth":522,"quality":8,"annotation":670,"cate_name":657,"is_correct":671,"source_code":672,"defect_root_cause":673,"eviction_analysis":674,"boundary_case_results":675,"ttl_expiration_analysis":676,"entry_lifecycle_analysis":677,"distributed_cache_risk_analysis":678},14754,1904276162,"样例_2.json","{\"is_correct\": \"false\", \"source_code\": \"import time\\n\\nclass LFUCache:\\n    def __init__(self, capacity, ttl_seconds=30):\\n        self.capacity = capacity\\n        self.ttl_seconds = ttl_seconds\\n        self.items = {}\\n        self.sequence = 0\\n\\n    def put(self, key, value):\\n        self.sequence += 1\\n        now = time.monotonic()\\n        self.items[key] = {\\n            'value': value,\\n            'expires_at': now + self.ttl_seconds,\\n            'frequency': 1,\\n            'inserted_at': self.sequence,\\n        }\\n        if len(self.items) > self.capacity:\\n            now = time.monotonic()\\n            expired = [k for k, item in self.items.items() if item['expires_at'] \u003C now]\\n            for expired_key in expired:\\n                del self.items[expired_key]\\n            if len(self.items) > self.capacity:\\n                victim = min(\\n                    self.items,\\n                    key=lambda k: (self.items[k]['frequency'], self.items[k]['inserted_at']),\\n                )\\n                del self.items[victim]\\n\\n    def get(self, key):\\n        item = self.items.get(key)\\n        if item is None:\\n            return None\\n        if time.monotonic() > item['expires_at']:\\n            del self.items[key]\\n            return None\\n        item['frequency'] += 1\\n        return item['value']\", \"defect_root_cause\": \"The expiration comparison uses > instead of >=, so an entry remains readable at its exact deadline and may be returned stale. Shared dictionary and frequency state are also accessed without synchronization, making concurrent behavior unsafe.\", \"eviction_analysis\": \"{\\\"eviction_strategy\\\": \\\"LFU, with the oldest insertion used to break ties in frequency.\\\", \\\"eviction_trigger\\\": \\\"A write that makes the item count exceed capacity first scans for expired entries, then evicts one lowest-frequency entry if still over capacity.\\\", \\\"expired_entry_precedence\\\": \\\"Entries whose deadline is strictly earlier than the current monotonic time are removed before LFU selection. An entry exactly at its deadline is incorrectly retained as live.\\\", \\\"strategy_consistent\\\": true}\", \"boundary_case_results\": \"[{\\\"case_description\\\": \\\"A read occurs exactly at an entry's expiration deadline.\\\", \\\"expected_behavior\\\": \\\"The entry is expired at the deadline and the read returns a miss.\\\", \\\"actual_behavior\\\": \\\"The strict > comparison considers equality valid, increments the frequency, and returns the value.\\\", \\\"passed\\\": false}, {\\\"case_description\\\": \\\"A write exceeds capacity while an existing entry is strictly past its deadline.\\\", \\\"expected_behavior\\\": \\\"Remove expired entries before choosing a live LFU victim.\\\", \\\"actual_behavior\\\": \\\"The insertion-time scan removes entries with deadlines earlier than now before applying the frequency and insertion-order tie break.\\\", \\\"passed\\\": true}, {\\\"case_description\\\": \\\"Two threads concurrently read the same entry while writes update the dictionary and frequency counts.\\\", \\\"expected_behavior\\\": \\\"Cache operations should be serialized or otherwise protect shared state from races.\\\", \\\"actual_behavior\\\": \\\"The implementation uses no lock; frequency updates and dictionary mutations can interleave without a defined atomic boundary.\\\", \\\"passed\\\": false}]\", \"ttl_expiration_analysis\": \"{\\\"ttl_value_or_source\\\": \\\"The constructor configures a default fixed TTL of 30 seconds for each write.\\\", \\\"ttl_unit\\\": \\\"Seconds\\\", \\\"expiration_basis\\\": \\\"A per-entry absolute deadline based on time.monotonic() at insertion; reads do not refresh it.\\\", \\\"boundary_operator\\\": \\\"time.monotonic() > expires_at; equality is treated as still valid, so expiration is delayed past the deadline.\\\", \\\"handles_clock_skew\\\": true}\", \"entry_lifecycle_analysis\": \"{\\\"lifecycle_summary\\\": \\\"A write stores a value, a monotonic deadline, a frequency initialized to one, and an insertion sequence. A successful read increments frequency. Expired entries are deleted on reads or during a capacity-triggered scan; remaining over-capacity entries are subject to LFU eviction.\\\", \\\"expiration_cleanup_behavior\\\": \\\"Lazy cleanup on a read of the requested key and a full scan only when an insertion exceeds capacity. There is no background cleanup.\\\", \\\"stale_entry_return_possible\\\": true}\", \"distributed_cache_risk_analysis\": \"{\\\"risk_summary\\\": \\\"Monotonic time avoids wall-clock jumps within one process, but monotonic deadlines are process-local and cannot be assumed comparable across nodes. Independent cache instances can also accumulate different hit counts and eviction choices.\\\", \\\"affected_scenario\\\": \\\"A cache entry or its deadline is copied between nodes, or two nodes independently serve the same key while applying local LFU counters and local monotonic clocks.\\\", \\\"severity\\\": \\\"Medium\\\"}\"}","false","import time\n\nclass LFUCache:\n    def __init__(self, capacity, ttl_seconds=30):\n        self.capacity = capacity\n        self.ttl_seconds = ttl_seconds\n        self.items = {}\n        self.sequence = 0\n\n    def put(self, key, value):\n        self.sequence += 1\n        now = time.monotonic()\n        self.items[key] = {\n            'value': value,\n            'expires_at': now + self.ttl_seconds,\n            'frequency': 1,\n            'inserted_at': self.sequence,\n        }\n        if len(self.items) > self.capacity:\n            now = time.monotonic()\n            expired = [k for k, item in self.items.items() if item['expires_at'] \u003C now]\n            for expired_key in expired:\n                del self.items[expired_key]\n            if len(self.items) > self.capacity:\n                victim = min(\n                    self.items,\n                    key=lambda k: (self.items[k]['frequency'], self.items[k]['inserted_at']),\n                )\n                del self.items[victim]\n\n    def get(self, key):\n        item = self.items.get(key)\n        if item is None:\n            return None\n        if time.monotonic() > item['expires_at']:\n            del self.items[key]\n            return None\n        item['frequency'] += 1\n        return item['value']","The expiration comparison uses > instead of >=, so an entry remains readable at its exact deadline and may be returned stale. Shared dictionary and frequency state are also accessed without synchronization, making concurrent behavior unsafe.","{\"eviction_strategy\": \"LFU, with the oldest insertion used to break ties in frequency.\", \"eviction_trigger\": \"A write that makes the item count exceed capacity first scans for expired entries, then evicts one lowest-frequency entry if still over capacity.\", \"expired_entry_precedence\": \"Entries whose deadline is strictly earlier than the current monotonic time are removed before LFU selection. An entry exactly at its deadline is incorrectly retained as live.\", \"strategy_consistent\": true}","[{\"case_description\": \"A read occurs exactly at an entry's expiration deadline.\", \"expected_behavior\": \"The entry is expired at the deadline and the read returns a miss.\", \"actual_behavior\": \"The strict > comparison considers equality valid, increments the frequency, and returns the value.\", \"passed\": false}, {\"case_description\": \"A write exceeds capacity while an existing entry is strictly past its deadline.\", \"expected_behavior\": \"Remove expired entries before choosing a live LFU victim.\", \"actual_behavior\": \"The insertion-time scan removes entries with deadlines earlier than now before applying the frequency and insertion-order tie break.\", \"passed\": true}, {\"case_description\": \"Two threads concurrently read the same entry while writes update the dictionary and frequency counts.\", \"expected_behavior\": \"Cache operations should be serialized or otherwise protect shared state from races.\", \"actual_behavior\": \"The implementation uses no lock; frequency updates and dictionary mutations can interleave without a defined atomic boundary.\", \"passed\": false}]","{\"ttl_value_or_source\": \"The constructor configures a default fixed TTL of 30 seconds for each write.\", \"ttl_unit\": \"Seconds\", \"expiration_basis\": \"A per-entry absolute deadline based on time.monotonic() at insertion; reads do not refresh it.\", \"boundary_operator\": \"time.monotonic() > expires_at; equality is treated as still valid, so expiration is delayed past the deadline.\", \"handles_clock_skew\": true}","{\"lifecycle_summary\": \"A write stores a value, a monotonic deadline, a frequency initialized to one, and an insertion sequence. A successful read increments frequency. Expired entries are deleted on reads or during a capacity-triggered scan; remaining over-capacity entries are subject to LFU eviction.\", \"expiration_cleanup_behavior\": \"Lazy cleanup on a read of the requested key and a full scan only when an insertion exceeds capacity. There is no background cleanup.\", \"stale_entry_return_possible\": true}","{\"risk_summary\": \"Monotonic time avoids wall-clock jumps within one process, but monotonic deadlines are process-local and cannot be assumed comparable across nodes. Independent cache instances can also accumulate different hit counts and eviction choices.\", \"affected_scenario\": \"A cache entry or its deadline is copied between nodes, or two nodes independently serve the same key while applying local LFU counters and local monotonic clocks.\", \"severity\": \"Medium\"}",{"id":680,"relate_table":652,"relate_id":681,"file_size":573,"file_name":682,"path":8,"duration":573,"cate":483,"file_format":655,"audio_rate":8,"audio_channel":522,"audio_bit_depth":522,"quality":8,"annotation":683,"cate_name":657,"is_correct":671,"source_code":684,"defect_root_cause":685,"eviction_analysis":686,"boundary_case_results":687,"ttl_expiration_analysis":688,"entry_lifecycle_analysis":689,"distributed_cache_risk_analysis":690},14753,1013534483,"样例_1.json","{\"is_correct\": \"false\", \"source_code\": \"from collections import OrderedDict\\nimport time\\n\\nclass TimedLRU:\\n    def __init__(self, capacity, ttl_seconds=5):\\n        self.capacity = capacity\\n        self.ttl_seconds = ttl_seconds\\n        self.entries = OrderedDict()\\n\\n    def put(self, key, value):\\n        if key in self.entries:\\n            del self.entries[key]\\n        self.entries[key] = (value, time.time() + self.ttl_seconds)\\n        self.entries.move_to_end(key)\\n        while len(self.entries) > self.capacity:\\n            self.entries.popitem(last=False)\\n\\n    def get(self, key):\\n        item = self.entries.get(key)\\n        if item is None:\\n            return None\\n        value, expires_at = item\\n        if time.time() >= expires_at:\\n            del self.entries[key]\\n            return None\\n        self.entries.move_to_end(key)\\n        return value\", \"defect_root_cause\": \"Capacity enforcement applies LRU eviction without first purging expired entries, allowing expired data to occupy capacity and live data to be discarded. Wall-clock deadlines are also vulnerable to clock adjustments, and operations are not synchronized for concurrent callers.\", \"eviction_analysis\": \"{\\\"eviction_strategy\\\": \\\"LRU; successful reads and writes move the key to the most-recently-used end.\\\", \\\"eviction_trigger\\\": \\\"After a write, while the entry count exceeds capacity, the least-recently-used entry is removed.\\\", \\\"expired_entry_precedence\\\": \\\"Expired entries are not swept before capacity eviction. An expired entry is removed only when read or selected as the LRU victim, so a live LRU entry can be evicted while another expired entry remains.\\\", \\\"strategy_consistent\\\": true}\", \"boundary_case_results\": \"[{\\\"case_description\\\": \\\"A read occurs exactly at the stored expiration timestamp.\\\", \\\"expected_behavior\\\": \\\"The entry is treated as expired and a miss is returned.\\\", \\\"actual_behavior\\\": \\\"The >= check removes the entry and returns a miss.\\\", \\\"passed\\\": true}, {\\\"case_description\\\": \\\"The cache is at capacity; a non-LRU entry has expired, and the LRU entry is still live when another key is inserted.\\\", \\\"expected_behavior\\\": \\\"Remove the expired entry before evicting any live entry.\\\", \\\"actual_behavior\\\": \\\"The capacity loop removes the LRU entry without checking expiration, leaving the expired entry in the cache.\\\", \\\"passed\\\": false}, {\\\"case_description\\\": \\\"The system wall clock moves backward after an entry is written.\\\", \\\"expected_behavior\\\": \\\"Elapsed TTL should not be extended by a wall-clock adjustment.\\\", \\\"actual_behavior\\\": \\\"The deadline comparison uses time.time(), so a backward adjustment can delay expiration.\\\", \\\"passed\\\": false}]\", \"ttl_expiration_analysis\": \"{\\\"ttl_value_or_source\\\": \\\"The constructor defaults to a fixed 5-second TTL for each write.\\\", \\\"ttl_unit\\\": \\\"Seconds\\\", \\\"expiration_basis\\\": \\\"Absolute expiration timestamp computed from the write time using time.time(). Reads do not extend the deadline.\\\", \\\"boundary_operator\\\": \\\"time.time() >= expires_at; an entry is expired at the deadline itself.\\\", \\\"handles_clock_skew\\\": false}\", \"entry_lifecycle_analysis\": \"{\\\"lifecycle_summary\\\": \\\"A write stores a value and an absolute deadline, replacing any prior value for the key. A successful read updates LRU order. Reads delete an expired requested entry; capacity pressure removes the LRU entry, whether or not it has expired.\\\", \\\"expiration_cleanup_behavior\\\": \\\"Lazy cleanup on reads, with no background sweep. Capacity eviction does not proactively identify expired entries.\\\", \\\"stale_entry_return_possible\\\": false}\", \"distributed_cache_risk_analysis\": \"{\\\"risk_summary\\\": \\\"Wall-clock differences or adjustments can cause nodes to disagree about expiration. The implementation has no synchronization or cross-node coordination, so replicated copies can also diverge in contents and eviction order.\\\", \\\"affected_scenario\\\": \\\"Two nodes store the same key at different local times, or a local clock moves backward while reads and writes continue; concurrent operations on one instance can also interleave without protection.\\\", \\\"severity\\\": \\\"Medium\\\"}\"}","from collections import OrderedDict\nimport time\n\nclass TimedLRU:\n    def __init__(self, capacity, ttl_seconds=5):\n        self.capacity = capacity\n        self.ttl_seconds = ttl_seconds\n        self.entries = OrderedDict()\n\n    def put(self, key, value):\n        if key in self.entries:\n            del self.entries[key]\n        self.entries[key] = (value, time.time() + self.ttl_seconds)\n        self.entries.move_to_end(key)\n        while len(self.entries) > self.capacity:\n            self.entries.popitem(last=False)\n\n    def get(self, key):\n        item = self.entries.get(key)\n        if item is None:\n            return None\n        value, expires_at = item\n        if time.time() >= expires_at:\n            del self.entries[key]\n            return None\n        self.entries.move_to_end(key)\n        return value","Capacity enforcement applies LRU eviction without first purging expired entries, allowing expired data to occupy capacity and live data to be discarded. Wall-clock deadlines are also vulnerable to clock adjustments, and operations are not synchronized for concurrent callers.","{\"eviction_strategy\": \"LRU; successful reads and writes move the key to the most-recently-used end.\", \"eviction_trigger\": \"After a write, while the entry count exceeds capacity, the least-recently-used entry is removed.\", \"expired_entry_precedence\": \"Expired entries are not swept before capacity eviction. An expired entry is removed only when read or selected as the LRU victim, so a live LRU entry can be evicted while another expired entry remains.\", \"strategy_consistent\": true}","[{\"case_description\": \"A read occurs exactly at the stored expiration timestamp.\", \"expected_behavior\": \"The entry is treated as expired and a miss is returned.\", \"actual_behavior\": \"The >= check removes the entry and returns a miss.\", \"passed\": true}, {\"case_description\": \"The cache is at capacity; a non-LRU entry has expired, and the LRU entry is still live when another key is inserted.\", \"expected_behavior\": \"Remove the expired entry before evicting any live entry.\", \"actual_behavior\": \"The capacity loop removes the LRU entry without checking expiration, leaving the expired entry in the cache.\", \"passed\": false}, {\"case_description\": \"The system wall clock moves backward after an entry is written.\", \"expected_behavior\": \"Elapsed TTL should not be extended by a wall-clock adjustment.\", \"actual_behavior\": \"The deadline comparison uses time.time(), so a backward adjustment can delay expiration.\", \"passed\": false}]","{\"ttl_value_or_source\": \"The constructor defaults to a fixed 5-second TTL for each write.\", \"ttl_unit\": \"Seconds\", \"expiration_basis\": \"Absolute expiration timestamp computed from the write time using time.time(). Reads do not extend the deadline.\", \"boundary_operator\": \"time.time() >= expires_at; an entry is expired at the deadline itself.\", \"handles_clock_skew\": false}","{\"lifecycle_summary\": \"A write stores a value and an absolute deadline, replacing any prior value for the key. A successful read updates LRU order. Reads delete an expired requested entry; capacity pressure removes the LRU entry, whether or not it has expired.\", \"expiration_cleanup_behavior\": \"Lazy cleanup on reads, with no background sweep. Capacity eviction does not proactively identify expired entries.\", \"stale_entry_return_possible\": false}","{\"risk_summary\": \"Wall-clock differences or adjustments can cause nodes to disagree about expiration. The implementation has no synchronization or cross-node coordination, so replicated copies can also diverge in contents and eviction order.\", \"affected_scenario\": \"Two nodes store the same key at different local times, or a local clock moves backward while reads and writes continue; concurrent operations on one instance can also interleave without protection.\", \"severity\": \"Medium\"}","{\"is_correct\":\"true\",\"source_code\":\"from collections import OrderedDict\\nfrom threading import RLock\\nfrom time import monotonic\\n\\nclass LRUCache:\\n    def __init__(self, capacity):\\n        if capacity \u003C 1:\\n            raise ValueError('capacity must be positive')\\n        self.capacity = capacity\\n        self.entries = OrderedDict()\\n        self.lock = RLock()\\n\\n    def _purge_expired(self, now):\\n        expired = [\\n            key for key, (_, deadline) in self.entries.items()\\n            if deadline \u003C= now\\n        ]\\n        for key in expired:\\n            del self.entries[key]\\n\\n    def get(self, key):\\n        with self.lock:\\n            now = monotonic()\\n            item = self.entries.get(key)\\n            if item is None:\\n                return None\\n            value, deadline = item\\n            if deadline \u003C= now:\\n                del self.entries[key]\\n                return None\\n            self.entries.move_to_end(key)\\n            return value\\n\\n    def put(self, key, value, ttl_seconds):\\n        if ttl_seconds \u003C 0:\\n            raise ValueError('ttl_seconds must be non-negative')\\n        with self.lock:\\n            now = monotonic()\\n            self._purge_expired(now)\\n            if key in self.entries:\\n                del self.entries[key]\\n            while len(self.entries) >= self.capacity:\\n                self.entries.popitem(last=False)\\n            self.entries[key] = (value, now + ttl_seconds)\",\"defect_root_cause\":\"No obvious defect was found in the local TTL, expiration-boundary, capacity-eviction, or entry-lifecycle behavior shown. The implementation does not provide distributed replication or cross-node coordination.\",\"eviction_analysis\":\"{\\\"eviction_strategy\\\": \\\"LRU; successful reads and writes place an entry at the most-recently-used end.\\\", \\\"eviction_trigger\\\": \\\"Before inserting, expired entries are purged and least-recently-used entries are removed until there is room.\\\", \\\"expired_entry_precedence\\\": \\\"Expired entries are purged before capacity eviction, so they take precedence over live entries as removal candidates.\\\", \\\"strategy_consistent\\\": true}\",\"boundary_case_results\":\"[{\\\"case_description\\\": \\\"An entry is written with a zero-second TTL and then read.\\\", \\\"expected_behavior\\\": \\\"The entry is expired immediately and the read returns a miss.\\\", \\\"actual_behavior\\\": \\\"The read compares the deadline with the current monotonic time using \u003C=, deletes the entry, and returns a miss.\\\", \\\"passed\\\": true}, {\\\"case_description\\\": \\\"At capacity, an expired entry is not the least-recently-used entry when a new key is written.\\\", \\\"expected_behavior\\\": \\\"Purge the expired entry before evicting any live LRU entry.\\\", \\\"actual_behavior\\\": \\\"The write purges all entries with deadlines at or before the captured time before checking whether capacity eviction is needed.\\\", \\\"passed\\\": true}, {\\\"case_description\\\": \\\"A read and write for the same cache instance overlap across threads.\\\", \\\"expected_behavior\\\": \\\"The operations should observe a serialized state transition without corrupting recency or entry contents.\\\", \\\"actual_behavior\\\": \\\"Both operations hold the instance RLock while accessing the ordered mapping, so their state changes are serialized.\\\", \\\"passed\\\": true}]\",\"ttl_expiration_analysis\":\"{\\\"ttl_value_or_source\\\": \\\"Each write supplies its own ttl_seconds value; negative TTLs are rejected, while zero is allowed.\\\", \\\"ttl_unit\\\": \\\"Seconds\\\", \\\"expiration_basis\\\": \\\"An absolute per-entry deadline computed from the write-time monotonic clock. Reads do not extend the deadline.\\\", \\\"boundary_operator\\\": \\\"deadline \u003C= now; an entry is expired at the exact deadline.\\\", \\\"handles_clock_skew\\\": true}\",\"entry_lifecycle_analysis\":\"{\\\"lifecycle_summary\\\": \\\"A write validates its TTL, purges expired entries, replaces any existing value for the key, evicts LRU entries if necessary, and stores a new deadline. A successful read refreshes recency; an expired requested entry is deleted and returned as a miss.\\\", \\\"expiration_cleanup_behavior\\\": \\\"Lazy cleanup on reads for the requested key, plus a full expired-entry sweep before each write. No background cleanup is used.\\\", \\\"stale_entry_return_possible\\\": false}\",\"distributed_cache_risk_analysis\":\"{\\\"risk_summary\\\": \\\"The lock protects only this process-local instance. Independent nodes can hold different values or eviction orders, and monotonic deadlines are not portable across processes, so this implementation alone does not ensure distributed consistency.\\\", \\\"affected_scenario\\\": \\\"Multiple application nodes maintain separate instances for the same logical keys, or an entry and its monotonic deadline are transferred to another process.\\\", \\\"severity\\\": \\\"Medium\\\"}\"}","MOBIUSI INC","https:\u002F\u002Fstatic.mobiusi.com\u002Fmobiwusi\u002F20250829\u002F7bf4ac62b4533e2b809998a6f1c5491e.png?Expires=1792463130&OSSAccessKeyId=LTAI5tH8MQqhgeiAtrzCHrxM&Signature=v6Tr8jBrdm4s5wU1SnnyGsYg%2Bhw%3D&x-oss-process=image%2Fresize%2Cm_fill%2Cw_35%2Ch_35",[695,701],{"type":696,"title":697,"count_data":698},"bar","Length distribution",[699],{"name":700,"value":483},"1k lower",{"type":702,"title":703,"count_data":704},"pie","Language distribution",[705],{"name":706,"value":483},"English"]