Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Getting Started with AI for VLSI Engineers5
  • Just Enough AI: Models and Context15
  • Prompting13
  • Trust and Verification14
  • Using AI for Engineering Work17
  • Engineering Walkthroughs7
  • Practical Foundations for AI Workflows4
    • APIs: Requests, Responses and Errors
    • JSON Records and Meaningful Validation
    • Repositories, Diffs and Isolated Changes
    • Working with Waveforms and Report Images
  • Engineering Data5
  • Retrieval-Augmented Generation6
  • Agents and Tool Use18
  • Agent Design8
  • MCP and Skills6
  • Multi-Agent Design6
  • Practical Capstone6
  • Tokens, Cost and Latency12
  • Agentic Workflows for Chip Teams18
  • Interview and Judgment10
  • AI Skills: Full Course Index
  • Working with AI Glossary
  • Working with AI Cheatsheet
Loading lesson

‹Practical Foundations for AI Workflows
  1. Topics
  2. AI Skills for VLSI Engineers
  3. Practical Foundations for AI Workflows
  4. JSON Records and Meaningful Validation

Practical foundations · Beginner

JSON Records and Meaningful Validation

A guided introduction for VLSI engineers: JSON Records and Meaningful Validation.

On this page

    A prose summary is useful to read, but a workflow needs fields it can inspect. Ask the assistant for a small JSON record: run_id, status and the cited log line. JSON syntax only establishes that a parser can read the text. A schema establishes the types and required keys. Neither proves that the cited line actually supports the diagnosis.

    Three different checks

    Layer

    Example rejection

    Owner

    Parsing

    Unclosed quote or an explanation outside the JSON object.

    A JSON parser.

    Shape and types

    Unknown status, missing evidence, Boolean used where an integer is required.

    A schema or explicit validator.

    Meaning

    Line 12 exists but refers to another test; a count is inconsistent with the source.

    Source checks, arithmetic and an engineering reviewer.

    example.py
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    import json
    
    def validate(text, known_runs):
        try:
            rec = json.loads(text)
        except (ValueError, TypeError):
            return False
        if type(rec) is not dict or set(rec) != {"run_id", "status", "line"}:
            return False
        if type(rec["run_id"]) is not str or rec["run_id"] not in known_runs:
            return False
        if type(rec["status"]) is not str or rec["status"] not in {"PASS", "FAIL"}:
            return False
        if type(rec["line"]) is not int or rec["line"] < 1:
            return False
        return True
    
    known = {"run-014"}
    assert validate('{"run_id":"run-014","status":"FAIL","line":12}', known)
    assert not validate('{"run_id":"run-014","status":"FAIL","line":true}', known)
    assert not validate('{"run_id":"unknown","status":"FAIL","line":12}', known)
    print("PASS: synthetic record shape checks; source meaning must still be reviewed")

    This standard-library example validates a deliberately tiny contract. It accepts only three keys and does not inspect a real source file. The strict Python type check matters because bool is a subclass of int. A production workflow should use its established schema library and define the permitted fields explicitly; do not silently coerce a surprising value and then execute it.

    Exercise

    A reply has the required keys and cites line 12. The actual error is on line 21, while line 12 contains a routine startup message. Explain why this record must not be accepted as an engineering diagnosis. Record an unresolved question in the human review note, outside this example's strict three-key JSON record. A richer schema could explicitly add an unresolved_questions field, but both producer and validator must agree before changing the format.

    Check yourself Does a schema-valid answer become trusted?

    No. Parsing, schema compliance, factual support and permission are separate. The cited source does not support the claim. Keep the failure observation, mark the cause unconfirmed and request the relevant source context.

    Related topics

    • Tool schemas and validation

    Related topics

    • Up: Practical foundations

    • Next: Repositories, Diffs and Isolated Changes

    Previous

    73 / 173

    Next: Repositories, Diffs and Isolated Changes

    Up next

    Up nextRepositories, Diffs and Isolated Changes

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Working with Waveforms and Report Images