निर्माण निरीक्षण जॉब प्रीफ्लाइट Claude Code से
Cloud Run Jobs se pehle inspection CSV, photo metadata, approvals, env vars aur secrets ko check karein.
Night shift ke end par quality lead inspection CSV aur exterior photo list ko cloud batch me bhejne wali hoti hai. Tab line manager rok deta hai: is lot ki approval abhi nahi hui. CSV me pass, hold, aur fail rows mix hain, ek photo URI me worker name jaisa text hai, aur environment-variable sheet me API key jaisi value plain text me bachi hai. Job chal sakta hai, lekin baad me customer explanation, audit, ya defect analysis me team ko batana mushkil hoga ki ye data kyun gaya.
Is article me hum manufacturing inspection report ko Cloud Run Jobs me bhejne se pehle Claude Code ke saath preflight workflow banate hain. Cloud Run Jobs batch workload ke liye hai: container start hota hai, task chalata hai, aur exit hota hai. Ye long-running HTTP service nahi hai. Yahan Google Cloud se connection nahi hoga. Title ka scope local preflight aur contract check hai, live integration nahi.
Current technical claims official docs se verify kiye gaye: Cloud Run Jobs create karna, Jobs environment variables, Jobs secrets, Jobs service identity, aur Claude Code settings. Local validator sirf local input contract prove karta hai; authentication, IAM, storage access, ya production behavior prove nahi karta.
मुख्य बातें
- Inspection CSV, photo URI rules, Cloud Run Job settings, aur approval checklist ko ek pre-handoff review me rakhein.
- Claude Code se columns, value types, approval state, naming rules, environment variables, aur Secret Manager boundary check karayen.
- Lot hold, customer explanation, retention, service account scope, aur final quality approval humans decide karein.
- Pehle fictional local fixtures use karein. Ye article Cloud Run, Cloud Storage, Secret Manager, ya factory MES call nahi karta.
- Single primary CTA company workflow ke liye training aur consultation hai.
कार्यप्रवाह: निरीक्षण रिपोर्ट को क्लाउड जॉब अनुबंध बनाना
Ye workflow visual inspection, dimensional inspection, equipment check, ya shift-end quality summary ke liye useful hai. Inputs aam taur par inspection_results.csv, photo URI list, batch job environment-variable sheet, aur quality approval checklist hote hain. MES ka matlab manufacturing execution system hai: internal system jo work orders, process status, aur inspection results track karta hai.
Pehla step AI se ye puchhna nahi hai ki lot good hai ya nahi. Pehla step input contract define karna hai: job me jane se pehle data kis shape me hona chahiye. Is example me CSV ke columns hain report_id, line_id, product_code, lot_no, measured_value, unit, status, inspector, approved, photo_uri, aur retention_until. status sirf pass, hold, fail ho sakta hai. approved agar yes nahi hai to row job input me nahi jayegi.
Photo URI ko hidden note field nahi banana chahiye. Better pattern hai gs://factory-qc-evidence/line-a/2026-09/LOT-1042/report-QC-9001-01.webp, jisme line, month, lot, aur report ID ho. Worker names, email addresses, phone numbers, ya full names object key me mat rakhein. Related workflows me manufacturing quality trouble report aur manufacturing GKE manifest release review hain. Ye article un dono ke beech ka cloud batch handoff contract cover karta hai.
Next step Cloud Run Job settings review karna hai. Google Cloud docs kehte hain environment variables container code ko key/value pairs ke roop me milte hain, lekin secrets ko environment variables me store na karne ki warning dete hain. Secrets ke liye Secret Manager references use karein. Agar job Google Cloud APIs call karta hai, to service identity check karein, yani job ka service account. Claude Code checklist bana sakta hai, par account aur roles humans approve karte hain.
flowchart TD
A[Local inspection CSV prepare] --> B[Photo URI aur retention check]
B --> C[Cloud Run Job env/secret boundary review]
C --> D[Claude Code issue table banata hai]
D --> E[Quality owner hold/fail decide karta hai]
E --> F[Approval ke baad human gcloud ya CI me deta hai]
Claude Code kya kare aur humans kya decide karein
Claude Code repeatable contract checks kare. Ye missing columns, nonnumeric measurements, unapproved rows, suspicious photo_uri, image me :latest, serviceAccount me default, aur PASSWORD, TOKEN, API_KEY jaise env names detect kar sakta hai. Ye CSV, job JSON, aur checklist ko side by side compare karke review table bhi bana sakta hai.
Humans quality responsibility aur operational risk decide karte hain. hold lot ko retest karna hai ya shipment stop karna hai, customer ko kya batana hai, photo retention contract se match karta hai ya nahi, service account ko minimum permissions kya deni hain, aur night job kab stop karna hai, ye human judgment hai. Claude Code output discussion evidence hai; legal opinion, quality warranty, ya IAM proof nahi.
Permissions me Claude Code settings se file read aur Bash execution limit karein. .env, production CSV, aur unmasked personal data prompt me na dein. Pehle fixed fixtures se rule pakka karein, phir review table ko operational procedure me move karein. Claude Code ko “upload karo” nahi, “human approval ke liye ready hai ya nahi check karo” kehna boundary hai.
तीन Use case
Use case 1: inspection CSV rows job me ja sakti hain ya nahi
Input: inspection CSV, column definition, allowed status, approval field, aur retention date. Same file me pass, hold, fail rows mix ho sakti hain.
Output: missing columns, invalid dates, unapproved rows, nonnumeric measurements, aur missing retention dates ki table. Output rows ko ready, human review, aur blocked me split karta hai.
Human check: quality owner decide karta hai ki hold ya fail row exclude hogi, retest hogi, ya full lot stop me escalate hogi.
Use case 2: photo URI me personal ya temporary data na aaye
Input: photo URI list, naming rule, line ID, lot number, report ID. Time pressure me photo object key me worker name, device name, ya temporary folder reh sakta hai.
Output: email-like strings, phone-like strings, readable names, private, aur tmp findings. Claude Code safer URI shape bhi suggest karta hai.
Human check: team decide karti hai minimum traceable ID, restricted ledger me kya rahega, aur allowed object-key patterns kya honge.
Use case 3: Cloud Run Job की गुप्त सीमा समीक्षा
Input: Cloud Run Job की settings JSON, environment-variable table, Secret Manager में जाने वाली keys, service account का नाम, retry count, और timeout।
Output: table dikhati hai ki API_KEY, PASSWORD, TOKEN, ya SECRET plain env vars me hain ya nahi, secret references exist karti hain ya nahi, service account dedicated hai ya nahi, aur image :latest avoid karta hai ya nahi.
Human check: cloud admins Secret Manager संसाधन, न्यूनतम अधिकार roles, और failed job को सुरक्षित रूप से फिर चलाया जा सकता है या नहीं, यह तय करते हैं।
Copy-paste prompt
You are the preflight reviewer for a manufacturing inspection report before handoff to a Cloud Run Job.
Goal: align inspection CSV, photo URI rules, Cloud Run Job settings, and approval checklist before execution.
Inputs:
- Inspection CSV sample:
- Photo URI naming rule:
- Cloud Run Job settings JSON:
- Approval checklist:
- Retention and deletion rules:
Check:
1. Missing required columns
2. measured_value is not numeric
3. status outside pass/hold/fail
4. approved is not yes
5. photo_uri contains personal names, emails, phone numbers, tmp, or private
6. Cloud Run Job image uses latest
7. env contains plain API_KEY/PASSWORD/TOKEN-like secrets
8. serviceAccount is not default and permissions to confirm are listed
Output:
- Table with "ready", "human review", and "blocked"
- Fix suggestions
- Items a human must approve
- Untested boundaries
Constraints:
- Do not connect to real cloud services
- Do not keep production CSV or personal data in the output
- Do not insert ClaudeCodeLab, training links, or site-owned CTAs into the generated artifact
Executable local validator
Ye code sirf article ke fixed fixtures check karta hai. Ye Cloud Run API, Cloud Storage, Secret Manager, factory MES, ya network call nahi karta. Agar local save karna ho to path tools/inspection-job-preflight.mjs use kar sakte hain; iska matlab ye nahi ki file is repository me already exists hai.
const requiredColumns = ["report_id","line_id","product_code","lot_no","measured_value","unit","status","inspector","approved","photo_uri","retention_until"];
const inspectionCsv = `report_id,line_id,product_code,lot_no,measured_value,unit,status,inspector,approved,photo_uri,retention_until
QC-9001,line-a,P-441,LOT-1042,0.31,mm,pass,EMP-014,yes,gs://factory-qc-evidence/line-a/2026-09/LOT-1042/report-QC-9001-01.webp,2027-09-30
QC-9002,line-a,P-441,LOT-1042,not-number,mm,hold,EMP-014,no,gs://factory-qc-evidence/private/[email protected],2027-09-30
QC-9003,line-b,P-882,LOT-2099,12.8,N,review,EMP-091,yes,gs://factory-qc-evidence/line-b/tmp/LOT-2099/report-QC-9003.webp,`;
const jobConfig = { name: "inspection-summary-job", image: "asia-northeast1-docker.pkg.dev/factory/prod/inspection-summary:latest", serviceAccount: "default", maxRetries: 3, timeoutSeconds: 1800, env: { REPORT_BUCKET: "factory-qc-evidence", API_KEY: "plain-text-key" }, secrets: { DB_PASSWORD: "projects/123456789/secrets/qc-db-password:2" } };
function parseCsv(text) { const [headerLine, ...rows] = text.trim().split("\n"); const headers = headerLine.split(","); return rows.map((line) => { const values = line.split(","); return Object.fromEntries(headers.map((header, index) => [header, values[index] ?? ""])); }); }
function looksLikeIsoDate(value) { return /^\d{4}-\d{2}-\d{2}$/.test(value) && !Number.isNaN(Date.parse(value)); }
function validateRows(rows) { const issues = []; const allowedStatus = new Set(["pass", "hold", "fail"]); for (const [index, row] of rows.entries()) { const rowNo = index + 1; for (const column of requiredColumns) { if (!(column in row) || row[column].trim() === "") issues.push({ scope: `row ${rowNo}`, severity: "block", message: `missing ${column}` }); } if (!Number.isFinite(Number(row.measured_value))) issues.push({ scope: `row ${rowNo}`, severity: "block", message: "measured_value must be numeric" }); if (!allowedStatus.has(row.status)) issues.push({ scope: `row ${rowNo}`, severity: "block", message: "status must be pass, hold, or fail" }); if (row.status !== "pass" || row.approved !== "yes") issues.push({ scope: `row ${rowNo}`, severity: "review", message: "human approval required before handoff" }); if (!looksLikeIsoDate(row.retention_until)) issues.push({ scope: `row ${rowNo}`, severity: "review", message: "retention_until must be an ISO date" }); if (/@|\b\d{2,4}[- ]\d{2,4}[- ]\d{3,4}\b|private|tmp/i.test(row.photo_uri)) issues.push({ scope: `row ${rowNo}`, severity: "review", message: "photo_uri may expose personal or temporary data" }); } return issues; }
function validateJobConfig(config) { const issues = []; if (/:latest\b/.test(config.image)) issues.push({ scope: "job.image", severity: "block", message: "pin the image tag or digest instead of latest" }); if (!config.serviceAccount || config.serviceAccount === "default") issues.push({ scope: "job.serviceAccount", severity: "block", message: "use a dedicated service account" }); for (const key of Object.keys(config.env ?? {})) { if (/(API_KEY|PASSWORD|TOKEN|SECRET)/i.test(key)) issues.push({ scope: `job.env.${key}`, severity: "block", message: "move secrets to Secret Manager references" }); } if (!config.secrets || Object.keys(config.secrets).length === 0) issues.push({ scope: "job.secrets", severity: "review", message: "list required Secret Manager references" }); if (!Number.isInteger(config.maxRetries) || config.maxRetries < 0 || config.maxRetries > 5) issues.push({ scope: "job.maxRetries", severity: "review", message: "confirm retry count with operations" }); return issues; }
const rows = parseCsv(inspectionCsv);
const report = [...validateRows(rows), ...validateJobConfig(jobConfig)];
console.table(report);
process.exitCode = report.some((item) => item.severity === "block") ? 1 : 0;
Ye code sirf local parsing aur fixture validation prove karta hai. Ye prove nahi karta ki Cloud Run Job create ho sakta hai, service account ke roles sahi hain, Secret Manager secret exists hai, photo object exists hai, ya production batch complete hota hai.
Pitfall: सामान्य कारण और सुधार
Pehla pitfall hai hold rows ko isliye bhej dena ki “baad me koi dekh lega”. Cause hai aggregation aur quality judgment ko same batch me mix karna. Fix: job input banne se pehle pass, hold, fail split karein. Hold aur fail rows human review queue me jayein, Cloud Run Job payload me nahi.
Dusra pitfall hai photo URI ko note field banana. Worker name, email, device name, tmp, ya private object key me aa jaye to deletion aur access scope explain karna mushkil hota hai. Fix: URI me line, month, lot, report ID hi rakhein; identity aur reason restricted ledger me rakhein.
Teesra pitfall hai environment variables aur secrets ko same samajhna. Cloud Run Jobs env vars support karta hai, lekin Google Cloud secrets ke liye Secret Manager suggest karta hai. Fix: nonsecret settings env me rakhein, connection strings, API keys, passwords, tokens secret references me move karein.
Chautha pitfall hai serviceAccount: default chhod dena. Cause hai job chal gaya to permissions design complete maan lena. Fix: job-specific service account banayein, each Google Cloud API ke liye minimum roles dein, aur approver checklist me likhein.
छोटा ROI measurement
Savings percentage invent na karein. Blocked work count karein. Do hafton tak CSV rows, blocking issues, human-review issues, resubmissions, CSV export se job handoff tak wait time, aur night calls record karein. Preflight ke baad wahi fields do hafton tak record karein. Useful signals hain unapproved rows ka early detection, photo URI fixes, secret migration findings, aur night shift se pehle rejections.
Goal ye nahi ki Claude Code hamesha fixed minutes save karta hai. Factory, line count, approval structure, aur job frequency result badalte hain. First ROI target hai galat batch inputs ko tab pakadna jab right humans available hon.
अक्सर पूछे जाने वाले सवाल
Q. Cloud Run Job ke badle Cloud Run service use kar sakte hain?
A. Continuous HTTP handling ke liye service use karein. Batch read-process-exit ke liye Job candidate hai. Ye article sirf Cloud Run Jobs handoff se pehle local preflight cover karta hai.
Q. Real CSV Claude Code ko dikha sakte hain?
A. Pehle anonymized fixtures se columns aur rules fix karein. Production CSV ke liye permissions, storage location, audit logs, prohibited columns internal rules se confirm karein. Ye legal ya audit advice nahi hai.
Q. Validator ko CI me rakhna enough hai?
A. Nahi. CI input contract ka sirf hissa block karta hai. Quality approval, service identity, Secret Manager references, IAM, aur actual job logs alag review maangte hain.
Q. Claude Code ko kya dena chahiye?
A. Fixed fixtures, column definitions, naming rules, job JSON, और approval checklist दें। .env, production keys, बिना mask वाला personal data, या supplier contracts paste न करें।
Company operations me lana
Manufacturing cloud handoff preflight sirf code nahi hai. Quality, operations, information systems, aur cloud admins ko ek shared language me batana hota hai ki AI kya check karega aur human kya stop karega. Cloud Run Jobs aur inspection CSV ke around permission boundary, review table, prompt, aur ROI sheet design karne ke liye training aur consultation use karein.
वास्तव में परीक्षण का परिणाम
Maine upar ka JavaScript validator node se local fixed fixtures par run kiya. Output ne nonnumeric measured_value, unapproved rows, invalid status, private aur tmp wale photo_uri, :latest image, default service account, aur plain API_KEY detect kiya.
Official URLs jo check kiye: Cloud Run Jobs creation, Jobs environment variables, Jobs secrets, Jobs service identity, Claude Code settings. Maine gcloud run jobs create, Cloud Run API call, Cloud Storage read, Secret Manager access, IAM verification, MES connection, ya production CSV inspection run nahi kiya. Evidence sirf local input contract check tak hai.
संबंधित लेख
Claude Code से GCP Cloud Run पर deploy करने की practical guide
Docker, IAM, secrets, logs और rollback के साथ Node.js API को Cloud Run पर सुरक्षित deploy करें।
Food manufacturing में product description और allergen/ingredient लेबल जांच को Claude Code से तेज़ कैसे करें
Food manufacturing के QC और sales के लिए: product descriptions और allergen लेबल जांच Claude Code से तेज़ करें। Prompt और check-script सहित।
Claude Code से होटल बुकिंग CSV का क्लाउड हैंडऑफ प्रीफ्लाइट
क्लाउड पर देने से पहले होटल CSV में निजी डेटा, सहमति, object key और मानव स्वीकृति जांचें।
मुफ़्त PDF: Claude Code cheatsheet
Email डालें और commands, review habits तथा safe workflow वाली एक-page PDF पाएँ.
हम आपका data सुरक्षित रखते हैं और spam नहीं भेजते.
लेखक के बारे में
Masa
Claude Code workflow और team adoption पर काम करने वाला engineer.