[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BNHC9DT2EVPF2GFTVMNMZ3":3,"skill-same:01M7BNHC9DT2EVPF2GFTVMNMZ3":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7BNHC9DT2EVPF2GFTVMNMZ3","skilltta-task-guidance",null,"Temporary guidance for implementing the Flink LongestSessionPerJob task over Google cluster-usage traces","linyouxue\u002Fskill-repair-benchmark","linyouxue","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F216151464?v=4","01M7BJEVCXKD74KH6FG9CBVSQB","林宥学","01M7BJEVE02NP217V93BKZFC0J",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fcontrolled-skill-repair-experiments\u002Fresult\u002Fskilltta-claude4.7\u002Ftasks\u002Fsingle-flink-query-RI-002\u002Frepaired_skill\u002Fskilltta-task-guidance\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: skilltta-task-guidance\ndescription: Temporary guidance for implementing the Flink LongestSessionPerJob task over Google cluster-usage traces\n---\n\n# Task Guidance: LongestSessionPerJob (Flink)\n\n## Problem Restatement\nFor each **finished** job, identify \"stages\" from its task SUBMIT events. A stage is a run of SUBMIT events separated by \u003C 10 minutes of inactivity (in event time). Report the task count of the job's largest stage.\n\n## Critical Correctness Rules (derive from the spec, not assumptions)\n\n### Rule A — Output qualification: only FINISHED jobs\nThe spec says \"once the job has finished\". **Do not emit a tuple for every jobId that appears in task events.** You must:\n1. Read the job-events stream and detect job completion (Google traces job event types: 0=SUBMIT, 1=SCHEDULE, 2=EVICT, 3=FAIL, 4=FINISH, 5=KILL, 6=LOST; treat FINISH\u002FFAIL\u002FKILL per the format doc — confirm by reading `format.pdf` \u002F `ClusterData2011_2.md`; the spec wording \"finished\" typically means event type 4 FINISH).\n2. Only output `(jobId, maxStageTaskCount)` for jobs whose job-event stream contains a terminal\u002Ffinish event.\n3. A job that has task events but never finishes in the input window **must not appear** in the output.\n\nImplementation sketch: keep per-job stage state keyed by jobId from the task stream, and gate emission on a signal from the job stream (e.g., connect the two streams via `connect` + `KeyedCoProcessFunction`, or union with a tagged type).\n\n### Rule B — Only SUBMIT task events count\nFilter task events to event type `SUBMIT` (type 0) before stage logic. Resubmits (SUBMIT after FAIL\u002FEVICT) **are counted as new tasks within whatever stage they land in** — do not dedupe by taskIndex.\n\n### Rule C — Timestamps are microseconds\n- 10 minutes = `10 * 60 * 1_000_000L` microseconds.\n- Assign event-time timestamps and watermarks in microseconds (don't silently convert to ms).\n\n### Rule D — Stage boundary = 10-min gap of SUBMITs for that job\nUse event-time session windowing per jobId with a 10-minute gap, counting records per window. Then reduce to the max count per jobId. Options:\n- `keyBy(jobId).window(EventTimeSessionWindows.withGap(Time.minutes(10)))` with a count aggregator, then keyBy jobId again and keep max.\n- Or manual `KeyedProcessFunction` with a timer at `lastSubmitTs + 10min` that flushes the current stage count into a running max.\n\n## Output Format\n- One line per finished job: `(jobId,maxCount)` — literal parentheses, comma separated, no spaces.\n- Order does not matter.\n- Write to the local path given by `output` parameter. Use `StreamingFileSink` with a single-file sink or (simpler for batch-style CSV input) collect results and write via `PrintSink`\u002F`writeAsText` to `output` with parallelism 1 to avoid directory output.\n\n## Required Data Classes (under `clusterdata.datatypes`)\nImplement at minimum:\n- `TaskEvent` with fields: `timestamp` (long, μs), `jobId` (long), `taskIndex` (long\u002Fint), `eventType` (int), plus any required by `AppBase`.\n- `JobEvent` with fields: `timestamp` (long, μs), `jobId` (long), `eventType` (int).\nProvide no-arg constructors + public fields or getters (POJO) so Flink serializes efficiently.\n\n## Parsing Pattern (transferable from CSV examples)\nFrom the retrieved CSV-processing patterns:\n- Treat each gzipped CSV as newline-delimited rows; split by `,`; index into fields per `format.pdf`.\n- Guard against empty\u002Fshort lines (skip).\n- Parse ints\u002Flongs with try\u002Fcatch; drop malformed rows (don't crash the job).\n- Reading `.gz`: use `TextInputFormat` on the `.gz` path (Flink auto-decompresses), or `env.readTextFile(path)`.\n\n## Suggested Pipeline\n1. `taskStream = env.readTextFile(task_input).map(parseTaskEvent).filter(eventType==SUBMIT).assignTimestampsAndWatermarks(...μs...)`.\n2. `jobFinishStream = env.readTextFile(job_input).map(parseJobEvent).filter(isTerminal).assignTimestampsAndWatermarks(...)`.\n3. Session-window task stream by jobId with 10-min gap → `(jobId, stageCount)`.\n4. KeyBy jobId → reduce to max stage count per job (keyed state).\n5. Connect with `jobFinishStream` keyed by jobId; on finish signal, emit `(jobId, currentMax)` and clear state.\n6. Sink with parallelism 1 to `output` path, formatting as `(jobId,count)`.\n\n## Common Pitfalls to Avoid\n- ❌ Emitting a line per jobId seen in task events (fails Rule A — the location hint flags exactly this).\n- ❌ Using processing time or Time.minutes assumed to be ms when ts is μs.\n- ❌ Counting non-SUBMIT task events.\n- ❌ Deduping resubmits of the same taskIndex.\n- ❌ Writing to `output` as a directory via default `writeAsText` with parallelism>1.\n- ❌ Changing the class name `LongestSessionPerJob` or editing `pom.xml`.\n\n## Verification Before Finishing\n- Jar builds via provided `pom.xml`.\n- Running with the sample paths produces a file at `output` where every line matches `^\\(\\d+,\\d+\\)$`.\n- Every jobId in output has a terminal event in `job_input`; jobIds without one are absent.\n","# Task Guidance: LongestSessionPerJob (Flink)\n\n## Problem Restatement\nFor each **finished** job, identify \"stages\" from its task SUBMIT events. A stage is a run of SUBMIT events separated by \u003C 10 minutes of inactivity (in event time). Report the task count of the job's largest stage.\n\n## Critical Correctness Rules (derive from the spec, not assumptions)\n\n### Rule A — Output qualification: only FINISHED jobs\nThe spec says \"once the job has finished\". **Do not emit a tuple for every jobId that appears in task events.** You must:\n1. Read the job-events stream and detect job completion (Google traces job event types: 0=SUBMIT, 1=SCHEDULE, 2=EVICT, 3=FAIL, 4=FINISH, 5=KILL, 6=LOST; treat FINISH\u002FFAIL\u002FKILL per the format doc — confirm by reading `format.pdf` \u002F `ClusterData2011_2.md`; the spec wording \"finished\" typically means event type 4 FINISH).\n2. Only output `(jobId, maxStageTaskCount)` for jobs whose job-event stream contains a terminal\u002Ffinish event.\n3. A job that has task events but never finishes in the input window **must not appear** in the output.\n\nImplementation sketch: keep per-job stage state keyed by jobId from the task stream, and gate emission on a signal from the job stream (e.g., connect the two streams via `connect` + `KeyedCoProcessFunction`, or union with a tagged type).\n\n### Rule B — Only SUBMIT task events count\nFilter task events to event type `SUBMIT` (type 0) before stage logic. Resubmits (SUBMIT after FAIL\u002FEVICT) **are counted as new tasks within whatever stage they land in** — do not dedupe by taskIndex.\n\n### Rule C — Timestamps are microseconds\n- 10 minutes = `10 * 60 * 1_000_000L` microseconds.\n- Assign event-time timestamps and watermarks in microseconds (don't silently convert to ms).\n\n### Rule D — Stage boundary = 10-min gap of SUBMITs for that job\nUse event-time session windowing per jobId with a 10-minute gap, counting records per window. Then reduce to the max count per jobId. Options:\n- `keyBy(jobId).window(EventTimeSessionWindows.withGap(Time.minutes(10)))` with a count aggregator, then keyBy jobId again and keep max.\n- Or manual `KeyedProcessFunction` with a timer at `lastSubmitTs + 10min` that flushes the current stage count into a running max.\n\n## Output Format\n- One line per finished job: `(jobId,maxCount)` — literal parentheses, comma separated, no spaces.\n- Order does not matter.\n- Write to the local path given by `output` parameter. Use `StreamingFileSink` with a single-file sink or (simpler for batch-style CSV input) collect results and write via `PrintSink`\u002F`writeAsText` to `output` with parallelism 1 to avoid directory output.\n\n## Required Data Classes (under `clusterdata.datatypes`)\nImplement at minimum:\n- `TaskEvent` with fields: `timestamp` (long, μs), `jobId` (long), `taskIndex` (long\u002Fint), `eventType` (int), plus any required by `AppBase`.\n- `JobEvent` with fields: `timestamp` (long, μs), `jobId` (long), `eventType` (int).\nProvide no-arg constructors + public fields or getters (POJO) so Flink serializes efficiently.\n\n## Parsing Pattern (transferable from CSV examples)\nFrom the retrieved CSV-processing patterns:\n- Treat each gzipped CSV as newline-delimited rows; split by `,`; index into fields per `format.pdf`.\n- Guard against empty\u002Fshort lines (skip).\n- Parse ints\u002Flongs with try\u002Fcatch; drop malformed rows (don't crash the job).\n- Reading `.gz`: use `TextInputFormat` on the `.gz` path (Flink auto-decompresses), or `env.readTextFile(path)`.\n\n## Suggested Pipeline\n1. `taskStream = env.readTextFile(task_input).map(parseTaskEvent).filter(eventType==SUBMIT).assignTimestampsAndWatermarks(...μs...)`.\n2. `jobFinishStream = env.readTextFile(job_input).map(parseJobEvent).filter(isTerminal).assignTimestampsAndWatermarks(...)`.\n3. Session-window task stream by jobId with 10-min gap → `(jobId, stageCount)`.\n4. KeyBy jobId → reduce to max stage count per job (keyed state).\n5. Connect with `jobFinishStream` keyed by jobId; on finish signal, emit `(jobId, currentMax)` and clear state.\n6. Sink with parallelism 1 to `output` path, formatting as `(jobId,count)`.\n\n## Common Pitfalls to Avoid\n- ❌ Emitting a line per jobId seen in task events (fails Rule A — the location hint flags exactly this).\n- ❌ Using processing time or Time.minutes assumed to be ms when ts is μs.\n- ❌ Counting non-SUBMIT task events.\n- ❌ Deduping resubmits of the same taskIndex.\n- ❌ Writing to `output` as a directory via default `writeAsText` with parallelism>1.\n- ❌ Changing the class name `LongestSessionPerJob` or editing `pom.xml`.\n\n## Verification Before Finishing\n- Jar builds via provided `pom.xml`.\n- Running with the sample paths produces a file at `output` where every line matches `^\\(\\d+,\\d+\\)$`.\n- Every jobId in output has a terminal event in `job_input`; jobIds without one are absent.\n",{"name":5,"description":7},"main","cdcb6d230f3b15c3c33f8a2bdd16439f43602cbe","controlled-skill-repair-experiments\u002Fresult\u002Fskilltta-claude4.7\u002Ftasks\u002Fsingle-flink-query-RI-002\u002Frepaired_skill\u002Fskilltta-task-guidance",1,"https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark","https:\u002F\u002Fgithub.com\u002Flinyouxue","2026-11-14 20:28:35",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add linyouxue\u002Fskill-repair-benchmark --skill skilltta-task-guidance",{"tool":37,"command":38},"bunx","bunx skills add linyouxue\u002Fskill-repair-benchmark --skill skilltta-task-guidance",{"tool":40,"command":41},"pnpm","pnpm dlx skills add linyouxue\u002Fskill-repair-benchmark --skill skilltta-task-guidance","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fcontrolled-skill-repair-experiments\u002Fresult\u002Fskilltta-claude4.7\u002Ftasks\u002Fsingle-flink-query-RI-002\u002Frepaired_skill\u002Fskilltta-task-guidance\u002FSKILL.md",true,[],[46,53,60,67,72,77],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M7E1HGVRY73NBJ022CJG13X6","video-frame-extraction","Extract frames from video files and save them as images using OpenCV","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7E1HAG5R7CJ9C8NYJS771MB","openai-vision","Analyze images and multi-frame sequences using OpenAI GPT vision models","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7E1H7DADKB6QBWKC2KQ63SZ","image-ocr","Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[],{"skillNo":68,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7E1H0WBNT43TENGQY7AVZHD","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":73,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7E1GTC7D4N4Q2EF03875J9E","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":78,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7E1GQ92CWFMGH53KSSE4WER","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[]]