Actors
- Legacy developer and language specialist
- Claims policy SME
- Review lead assigning queues
- Auditor tracing rule to source
- Modernization engineer consuming approved rules
- Pipeline operator managing extractors
MAINFRAME ARCHAEOLOGY / MOCK 05
Design a reproducible static-analysis factory that turns CMS-scale COBOL and Assembly into line-sourced business rules and a safe SME review workflow.
OPENING PROMPT
Read this once, then begin aloud. Spend the first two minutes establishing contract, actors, risk and what must remain authoritative.
Design RuleMine, a static-analysis and review platform for a mock 18-million-line estate of COBOL, Assembly, JCL and copybooks. It must extract roughly 100,000 plain-language business rules, preserve exact source provenance, correlate duplicates across four claims systems, and let subject-matter experts verify, edit, reject and search rules. Re-running the same toolchain on the same snapshot must reproduce the same result.
Treat extraction as a compiler and evidence pipeline, not a single LLM prompt. Immutable snapshots, deterministic intermediate representations and versioned passes establish reproducibility; a model may phrase or classify candidates but can never invent provenance.
REQUIREMENTS
These are supplied mock numbers for sizing and follow-ups. Say your assumptions before using them.
HIGH-LEVEL DESIGN
Name the authoritative state, derived projections, asynchronous boundaries and the exact point where a business decision becomes durable.
STORAGE + ACCESS
The table is logical, not a mandate for one database. Choose physical stores after access patterns, transactions, retention and rebuildability are clear.
| Entity | Primary / unique key | Important fields and purpose |
|---|---|---|
| SourceSnapshot | (estate_id, snapshot_id) | manifest_hash, vcs_refs, encoding, created_at, immutable |
| SourceUnit | (snapshot_id, unit_id) | path, blob_hash, language, dialect, include_graph |
| IRNode | (snapshot_id, toolchain_id, node_id) | opcode, normalized_operands, source_spans |
| FlowEdge | (snapshot_id, toolchain_id, from_id, type, to_id) | control/call/data/include; derivation |
| RuleCandidate | (snapshot_id, toolchain_id, candidate_id) | predicate_ir, outcome_ir, evidence_set_hash, confidence |
| RuleRendering | (candidate_id, rendering_version) | canonical_text, sentence_span_map, model_manifest |
| RuleCluster | (cluster_id, clustering_version) | member_candidates, similarity_evidence, status |
| ReviewDecision | (candidate_id, decision_version) | reviewer, state, edits, reason_code, decided_at |
POST /v1/snapshotsRegister manifest; content hashes make retry idempotent
202 {snapshotId,ingestRun}POST /v1/extraction-runsPin snapshot + toolchain bundle + configuration
202 {runId}GET /v1/rules?system=&program=&state=&cursor=Search candidates/approved rules with facets
200 {rules,nextCursor}GET /v1/rules/{id}/evidenceCanonical text → exact spans + derivation graph
200 {sentences,spans,runManifest}POST /v1/reviews/claim-nextLease a stratified review item
200 {leaseId,rule}POST /v1/rules/{id}/decisionsExpected version + lease + decision + reason
200 / 40900:00 → 30:00
Answers are written in a speakable first-person style. Turn on Practice Mode to hide them, answer aloud, then reveal one at a time.
I will define success as reproducible, inspectable candidate rules—not “an LLM summarizes 18M lines.” The source snapshot and toolchain manifest are immutable inputs. Several deterministic passes normalize dialects, expand includes, build intermediate representation, and trace control/data flow. A model can turn a bounded symbolic candidate into readable language, but sentence-level provenance is constructed from the IR, never hallucinated. SMEs remain the authority. I would ask whether production execution is available as an oracle.
V1 ingests source and build metadata, resolves copybooks/macros, parses supported dialects, builds call/control/data graphs, separates business predicates from technical plumbing, emits Given/When/Then-like candidates, clusters similar candidates across systems, and provides side-by-side review. Every candidate exposes exact file, snapshot, line/column and derivation. Unsupported constructs produce explicit coverage gaps. We need deterministic reruns, seven-year audit history, review queues and exports. We do not claim semantic completeness or auto-approve rules.
Eighteen million lines over 40 mock days means only 450k LOC/day, so raw parse throughput is easy; correctness, dependencies and human review dominate. One hundred thousand candidates at seven minutes each is 700k minutes, around 11,667 hours. At 120 SMEs and five focused review hours/day, a full pass is about 19.4 working days, before rework. This tells me to prioritize candidates by risk and use stratified sampling for quality—not ask every reviewer to inspect every near-duplicate.
18M LOC / 40 days = 450k LOC/day
100k × 7 min = 700k min = 11,667 h
11,667 / (120 × 5 h/day) ≈ 19.4 review daysSourceSnapshot has one cryptographic manifest. SourceUnit maps paths and encoding to blob hashes. IR nodes and graph edges are namespaced by snapshot and toolchain bundle. A RuleCandidate stores normalized predicate/outcome IR and an evidence-set hash; it is not just prose. RuleRendering is versioned separately so better wording does not rewrite candidate identity. RuleCluster groups candidates but does not collapse them, because similar implementations can have meaningful jurisdiction or effective-date differences. ReviewDecision is append-oriented and optimistic-versioned.
The source vault verifies encoding and hashes every unit, then seals a snapshot manifest. A deterministic preprocessor expands copybooks, macros and conditional compilation while recording an origin map. Language front ends parse to a common but loss-aware IR; unknown constructs become typed opaque nodes. Link passes resolve calls, files and shared data. Control- and data-flow passes create summaries per procedure, then a fixpoint propagates summaries across the call graph. Candidate passes identify externally meaningful predicates and outcomes, trace backward to source spans, and filter logging/retry/plumbing. Correlation computes blocking keys and similarities. A bounded renderer produces prose from predicate IR and receives only evidence IDs. The review index is published after run validation.
Preprocessing emits a bidirectional origin map: every normalized token maps to one or more original byte and line spans, including an include stack. Every IR node carries the union of contributing token spans plus the pass that created it. A candidate stores a minimal evidence subgraph. The renderer cannot provide arbitrary citations; it must assign each sentence to supplied evidence IDs. A deterministic verifier rejects a rendering if a sentence lacks evidence, points outside the snapshot, or states a literal absent from the predicate/outcome IR. The UI opens the sealed blob at exact spans and also shows expansion context.
Pass one normalizes fixed/free formats, encodings and dialect syntax without erasing original coordinates. Pass two resolves includes and conditional compilation. Pass three builds per-program CFGs and symbol tables. Pass four computes procedure summaries: inputs read, records mutated, exits and side effects. Pass five resolves inter-program calls and JCL execution edges. Pass six performs backward slicing from business outcomes such as payment amount, eligibility flag or denial code to predicates that influence them. A deterministic candidate builder serializes those predicate/outcome slices. Recursive call components use bounded fixpoint iteration; unresolved dynamic calls remain gaps with impact counts.
I cluster rather than merge. First create blocking keys from normalized domain terms, outcome codes and predicate shape. Within blocks, compare canonical IR features, cited policy terms and embeddings of a controlled rendering. A pairwise explanation says which predicates align and which differ. Graph clustering produces candidate families, but an SME chooses same-rule, variant, supersedes or unrelated. Effective date, geography, claim type and system remain facets. One golden business rule may link to several implementations, each with its own evidence and review state.
Snapshot seal, toolchain promotion, review decision and approved export need strong transactions. Extraction artifacts are immutable and eventually published. A run key is snapshot manifest + toolchain bundle + configuration hash; task keys include pass and partition. At-least-once workers write by content hash, so duplicates converge. Queues separate ingest, parse, graph fixpoint, render and reprocessing. Backpressure is measured in estimated CPU, graph fan-out and model tokens. High-risk incremental changes preempt full historical reclustering, and reviewer queues are capacity-aware.
Silent skip is unacceptable. Unknown or unsupported syntax creates an opaque IR node with severity and reachability. Coverage dashboards report parsed lines, opaque reachable nodes, unresolved calls and outcome slices affected. Canary corpora contain rare opcodes and hand-labeled programs; a parser bundle cannot promote if coverage regresses. If discovered after publication, quarantine affected candidates via lineage from the parser version and opaque node, roll back the review projection, fix the parser, and run only impacted partitions plus dependent summaries. Existing reviewer decisions remain, but are visibly invalidated pending re-review.
A reviewer claims a leased item from a stratified queue based on system, domain, risk and expertise. The page shows canonical rule, source beside it, highlighted evidence, call/include breadcrumb, correlated variants and official-document links. The reviewer can approve, edit wording, split, merge-as-family, reject-as-plumbing or flag analyzer defect. Decision reasons are structured. Optimistic versioning prevents two reviewers overwriting. Leads adjudicate disagreements. Search facets include system, program, rule family, outcome, review state, analyzer version and coverage risk.
Candidate identity should be stable under wording and line movement, but logic normalization can legitimately change. Before promotion, run old and new toolchains on a representative frozen corpus and build an equivalence map: unchanged, wording-only, evidence-expanded, logic-changed, added, removed. A 30% unexplained churn breaches the gate. Keep both projections queryable, show reviewers impact, and require lead approval. Review decisions transfer only when normalized logic and evidence equivalence pass a deterministic policy; otherwise schedule re-review. Never overwrite the old run.
Treat source as highly sensitive. Separate estates by tenant in object keys, metadata, search, encryption keys and worker credentials. Processing sandboxes have no outbound network; source never enters general logs. Model rendering receives only the minimal symbolic slice, uses an approved deployment, and is disabled for restricted tenants. Fine-grained roles separate source read, rule review, toolchain administration and export. Every evidence view and bulk export is audited. Signed snapshot manifests and append-only decision history support chain of custody.
Operationally: snapshot completeness, parse coverage, unresolved-call reachability, pass latency, task retry, lineage integrity, review queue age and search SLO. Quality: rule precision/recall on a golden corpus, sentence-evidence coverage, provenance open success, inter-rater agreement, reviewer edit distance, candidate churn between toolchains, cluster purity and reproducibility hash match. Roll out one claims domain, hand-label a corpus, run dual extractor versions, open reviewer-only search, then expand languages and systems. Approved downstream export starts only after sampling and reproducibility gates pass.
A common IR enables correlation but must preserve language-specific opaque detail. More context can improve prose but harms determinism and leakage; bounded symbolic slices are safer. Deduplication reduces review load but merging destroys system-specific evidence. The biggest traps are one-pass prompting, line URLs to mutable source, hiding unsupported constructs, treating readable prose as the canonical rule, and reporting precision only on the easy parsed subset.
RuleMine seals an immutable source manifest and runs a compiler-like, versioned series of preprocessing, IR, control/data-flow, slicing and candidate passes. Every derived node carries origin spans and pass lineage. A bounded model may render the symbolic candidate, but a verifier requires sentence-level evidence. Similar candidates form reviewable clusters rather than being erased. SMEs work from leased, stratified queues with side-by-side source and append-only decisions. Content-addressed tasks make retries reproducible; coverage gaps, toolchain differentials and conservative rollout keep modernization evidence trustworthy.
DOMAIN DEPTH
These mechanisms are the interview’s differentiators. Be able to redraw each from memory and defend its failure behavior.
Each transformation preserves an origin map and derivation edge, letting an auditor walk prose back to symbolic predicate, IR and sealed source bytes.
Similarity proposes families. It never erases the distinctions that can carry policy, date or system meaning.
FAILURE MATRIX
When the interviewer injects a fault, restate the violated assumption, change state or protocol, and name the new invariant.
| Injection | Recovery mechanism | Tempting wrong answer |
|---|---|---|
| 01Unsupported opcode | Opaque reachable IR + coverage impact | Silent omission |
| 02Include cycle | Cycle-aware expansion and bounded diagnostic | Infinite worker |
| 03Parser regression | Golden corpus + version rollback | Overwrite old run |
| 04Graph explosion | Procedure summaries and SCC fixpoint | Path enumeration |
| 05Model invents rule | Evidence-ID constrained render + verifier | Prose as truth |
| 06Toolchain churn | Differential migration report | Blind review transfer |
BOTEC
Use orders of magnitude to expose the bottleneck. State what this simple model omits.
INTERACTIVE SCENARIO
Estimate mock review days; change candidates, reviewer count and focused hours.
OPERATIONS + DELIVERY
A system is incomplete without observable user outcomes, staged deployment, rollback and an answer to “how will we know?”
INTERVIEWER TRAPS
Use these as flash cards. The right column is the compact sentence you want available under pressure.
| Trap | Better move |
|---|---|
| One giant LLM prompt | Use ordered deterministic passes. |
| Line number as identity | Pin blob hash plus origin span. |
| Unknown syntax ignored | Expose opaque reachable nodes. |
| Dedup means delete | Cluster while retaining variants. |
| Prose is canonical | Canonicalize symbolic predicate/outcome. |
| Only precision | Measure missing rules and estate coverage. |
DEFINITIONS
Define the term, then connect it to a concrete invariant in this design. Avoid dropping vocabulary as a substitute for reasoning.
FINAL MINUTE
RuleMine seals an immutable source manifest and runs a compiler-like, versioned series of preprocessing, IR, control/data-flow, slicing and candidate passes. Every derived node carries origin spans and pass lineage. A bounded model may render the symbolic candidate, but a verifier requires sentence-level evidence. Similar candidates form reviewable clusters rather than being erased. SMEs work from leased, stratified queues with side-by-side source and append-only decisions. Content-addressed tasks make retries reproducible; coverage gaps, toolchain differentials and conservative rollout keep modernization evidence trustworthy.
Rehearse again